使用 SIFT 特征训练 SVM 分类器 [英] Training of SVM classifier using SIFT features

查看:88
本文介绍了使用 SIFT 特征训练 SVM 分类器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请我喜欢用 SIFT DESCRIPTOR 和 SVM 将一组图像分类为 4 类.现在,使用 SIFT 提取器,我得到了不同大小的关键点,例如 img1 有 100 个关键点,img2 有 55 个关键点......如何使用 matlab 构建给出固定大小向量的直方图

please i like to classify a set of image in 4 class with SIFT DESCRIPTOR and SVM. Now, using SIFT extractor I get keypoints of different sizes exemple img1 have 100 keypoints img2 have 55 keypoints.... how build histograms that give fixed size vectors with matlab

推荐答案

在这种情况下,dense sift 或许是一个不错的选择.

In this case, perhaps dense sift is a good choice.

有两个主要阶段:

第一阶段:创建密码本.

  1. 将输入图像分成一组子图像.
  2. 对每个子图像应用筛选.每个关键点将有 128 维特征向量.
  3. 通过简单地将 k 均值聚类与选定的 k 相结合,对这些向量进行编码以创建一个码本.每个图像将产生一个矩阵 Vi(i <= nn 是使用的图像数量来创建代码字.)大小为 128 * m,其中 m 是从图像中收集的关键点的数量.因此,K-means 的输入是一个大矩阵 V,由 Vi 的水平连接创建,对于所有 i.K-means 的输出是一个矩阵 C,大​​小为 128 * k.
  1. Divide the input image into a set of sub-images.
  2. Apply sift on each sub-image. Each key point will have 128 dimensional feature vector.
  3. Encode these vectors to create a codebook by simply applying k-means clustering with a chosen k. Each image will produce a matrix Vi (i <= n and n is the number of images used to create the codeword.) of size 128 * m, where m is the number of key points gathered from the image. The input to K-means is therefore, a big matrix V created by horizontal concatenation of Vi, for all i. The output of K-means is a matrix C with size 128 * k.

第 2 阶段:计算直方图.

对于数据集中的每个图像,执行以下操作:

For each image in the dataset, do the following:

  1. 创建一个大小为 k 的直方图向量 h 并将其初始化为零.
  2. 按照第 1 阶段的第 2 步应用密集筛选.
  3. 对于每个关键点的向量,找到其最佳匹配"的索引;码本矩阵中的向量C(可以是欧几里得距离中的最小值).
  4. h中该索引对应的bin加1.
  5. 通过 L1 或 L2 规范对 h 进行标准化.
  1. Create a histogram vector h of size k and initialize it to zeros.
  2. Apply dense sift as in step 2 in stage 1.
  3. For each key point's vector find the index of it's "best match" vector in the codebook matrix C (can be the minimum in the Euclidian distance) .
  4. Increase the corresponding bin to this index in h by 1.
  5. Normalize h by L1 or L2 norms.

现在 h 已准备好进行分类.

Now h is ready for classification.

另一种可能性是使用 Fisher 向量而不是码本,https://hal.inria.fr/file/index/docid/633013/filename/jegou_aggregate.pdf

Another possibility is to use Fisher's vector instead of a codebook, https://hal.inria.fr/file/index/docid/633013/filename/jegou_aggregate.pdf

这篇关于使用 SIFT 特征训练 SVM 分类器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆