0
votes

I 'm trying to classify some pixels using a binary support vector machine. my training database is made of 28 data files and has two classes, number pixels of class1 is 16571 and number of pixels of class2 is 313.

The test data(each file) has around 600 pixels that only 6-10 pixels are member of class 2 and the remaining pixels are in class1.

My problem is that, after training, when I try to classify data, the SVM classifies all of the pixels in class1.

I think that it maybe because it has seen few samples from class2. but the number of available data files are limited(around 35 data file).

How can I train the svm and get reasonable result?

Thank you for your help.

1
If some balance in number of class members is needed, I can a little decrease the number of samples of class 1. - Lily
try scaling the data to [0,1] and retry the classifcation again... - lakshmen
I already scaled the data into [0,1] interval before classification. - Lily
I'm not sure I understand what your feature set is, what is one training instance comprised of? Just the number of pixels? The value of each pixel? What are you trying to classify? - karenu
The features are some info about each pixel, such as intensiy,.... There are four features for each pixel. each pixel is classified as the object(class2) pixel or the background(class1) pixel. since there is an small object in the large background, number of object pixels(class2) is small. - Lily

1 Answers

0
votes

SVM might indeed be sensitive to large differences in train set sizes. I'd suggest trying the following 2 methods:

  1. Limit class 1's train set by sampling, so that its size is around the size of class 2's, and check for any improvement (sizes between 1X to 10X of class 2's size might fit).

  2. Play with the 'cost' parameter of your SVM (e.g, in SVMLight it's done with the 'J' parameter), it can help balance the classes.

you can of course use both methods together, i.e. somewhat limit the size of class 1's train data, then further balance the classes using the cost parameter.