Ask Your Question

When training a detector, should I take into consideration subclasses?

asked 2013-08-18 03:33:10 -0600

updated 2013-08-18 06:23:13 -0600


I have a general question about object detection. I'll explain in using an example.

I intend to implement a flower detector that will be based on BOW+SVM.

Should I train the SVM using all the flower images or should I divide the flowers into categories - lily, tulip etc. - and train several detectors, each for a single flower category?

Would there be a difference in the results?



edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-08-18 05:03:40 -0600

Guanta gravatar image

It just depends on what you actually want: Do you want to detect if there is a flower in the image or not, then you need one SVM which you feed with flower and non-flower-descriptors.

Otherwise you'll need to train multiple SVMs, since an SVM is not able to deal with multi-class problems. Basically there exist two strategies:

  • 1-vs-1, i.e. each class is trained against each other class resulting in (n_class * (n_class - 1) / 2) models.
  • Alternatively you can use a different strategy called 1-vs-rest, where you train n_class SVMs, each class against all the remaining classes.

I don't know which or if one of these versions is integrated at all in OpenCV's SVM implementation (maybe s.o. else can comment on this).

Personally, I am not a big fan of the ML-part of OpenCV (e.g. OpenCV's SVM is based on an old libSVM version), thus I use here Python's scikit-learn module and / or WEKA.

edit flag offensive delete link more


Thanks for the response. I just want to detect if there is a flower in the image.

Could I get better results by applying multiple detectors, each designed for a specific species or the exact same results will be obtained by a flower/non-flower SVM?

I'm asking since there is large variability in flowers, so I thought to divide it to sub classes to cope with it.

GilLevi gravatar imageGilLevi ( 2013-08-18 05:47:26 -0600 )edit

Due to the exact large variability of the flower class, specifying a single detector for the flower class, will lead to a huge amount of false positives. If you have a limited amount of possible subclasses, combining multiple specific detectors will surely give you better results.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-18 06:25:19 -0600 )edit

Thank you @StevenPuttemans !!

Do you know of any method that can automatically divide the flower class to subclasses according to appearance?

GilLevi gravatar imageGilLevi ( 2013-08-18 07:33:17 -0600 )edit

That is one of the most hottest classification problems for the moment, to divide subclasses in giant classes. For the moment A LOT of manual work is required for giving each sample the correct class label. If you have distinct coloring, you could try to look at the colour channels distribution, maybe in HSV space, and see if you can group samples together that way.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-18 07:43:08 -0600 )edit

Thanks for the comment. I'll post a separate question about dividing classes to subclasses.

GilLevi gravatar imageGilLevi ( 2013-08-18 07:52:15 -0600 )edit

I should mention that I only want to divided them according to appearance, not according to label.

GilLevi gravatar imageGilLevi ( 2013-08-18 08:07:41 -0600 )edit

I will have a look at the other topic then. However for us humas, appearance is something that we use to discriminate between species. However, for a computer it is not that straightforward. If your image will have a large background variety, then you will classify your background, instead of your foreground.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-18 09:39:36 -0600 )edit

BTW you should have a look at the research of the Oxford Visual Geometry Group, which has an extensive research in flower classification.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-18 09:41:41 -0600 )edit

Hmm, actually I'd always start with a single SVM, from there on you can try to improve your results, e.g. with your approach of using an unsupervised learning technique beforehand and then learning multiple classifiers.

Guanta gravatar imageGuanta ( 2013-08-18 10:02:20 -0600 )edit

Thank you @StevenPuttemans, I will definitely look into the oxford group research !

GilLevi gravatar imageGilLevi ( 2013-08-18 11:43:45 -0600 )edit

Question Tools


Asked: 2013-08-18 03:33:10 -0600

Seen: 526 times

Last updated: Aug 18 '13