0
votes

I have managed to convert images into histogram representation of visual words. It could be something simple like the following(normalized):

[0.1, 0.2, 0, 0.1, 0, 0.05, 0.3, 0, 0, 0, 0.2, 0.05, 0]

which adds up to 1

now, if i have many different iteration of the histogram above, I want to classify it with libsvm. But I'm stuck here, I know the syntax for svmtrain:

model=svmtrain(label,training_matrix)

training matrix should just be a m x n matrix of all my histograms but what about label? I know it's supposed to be +1, or -1 but where do the negative images come from? Everything in the training_matrix should be positive images representative of the class.

Am I wrong to treat each histogram as a separate instance? If instead I treat every visual word as an instance, then I would have my negatives from the words that represent the class.

1
Generally SVM would be used to classify instances, e.g. images, to two or more classes. Can you clarify what are your classes? are you trying to distinguish between two types of images, or between 'visual words' in a given image (e.g. to identify elements in it)?etov
@etov im trying to classify imagesmugetsu
Right, but in what are you trying to classify the images? i.e, do you have some classes, for instance people vs. scenery vs. buildings? if that's the case, in order to build a 'people' classifier you'd use 'people' images as positive examples, and 'scenery' or 'buildings' images as negative ones.etov
Additionally: if really want to classify people/buildings etc - histograms will not get you a very high accuracy.snøreven

1 Answers

0
votes

I assume, your classes are groups of images having visual similarities. Then:

  • each image is an instance
    • image histogram is nothing else as a transformed/reduced image-data, so each image histogram is also an instance
  • each bin in the histogram is a feature

I'd suggest, you convert your histograms in text files and use the binary tools and this description for the first evaluation.

I guess, however, histogram alone won't give good results, if the color/intensity is not the main distinguishing feature of your objects.

If you have small images with only object on the image without much background, a better quick solution would be downsizing the image to e.g. 32x32 and using pixel-values as features.