I got a dataset of images(GRAZ_02 Data set-Cars,Bikes,People) and extracted features from each and every image in the database using a descriptor(SIFT algorithm) that returns a matrix of order :(No. of interest points)X128.
Since the number of interest points detected for each image varies from image to image,the output Descriptot Matrix is not uniform.In order to overcome this problem,we are using K-means clustering that gives same sized desriptorl the presence for the purpose of classification(presence/absence of an object). My question is that how is this matrix :(kX128) for each and every image converted into vector so that it can be applied on the SVM classification?1 Answer
This approach is called bag-of-words. During training you get features (SIFT in your case) from all the training images. Because each image contains different number of features extracted and there are too many of them you perform $k$-means clustering. This process creates a codebook which is something like compressed version of the initial features. After clustering given an image you extract SIFT features and map each of them to the closest $k$-means centroid. Finally you calculate a vector of frequencies which consists of the number of SIFT features mapped to the first centroid, second, and so on. This vector is $k$ dimensional. Once such conversion is possible you can create $k$ dimensional representation for both training and testing images and learn SVM.
-
$\begingroup$ Thanks a lot for the reply.Does the vector that we feed into the SVM consist of the frequency of occurrence of each cluster? Does this mean that the vector is of dimension kX1 where all the elements of the vectors are positive integers. $\endgroup$– logamadiCommented Mar 20, 2014 at 2:58
-
$\begingroup$ I would suggest to normalize (to one) that vector before feeding into SVM. $\endgroup$– GnattuhaCommented Mar 20, 2014 at 16:27