Combine SVM and Boosting

asked 2018-11-23 01:08:15 -0500

hi, i am still green in OpenCV and CV thing but is it possible combining SVM with Boosting in OpenCV? and is there a way to reduce data needed for training?

Thank You,

edit retag flag offensive close merge delete


it's a bit unclear, what "boosting" means here. did you mean this ? (that would be a seperate (binary also) classifier)

or did you mean some process of "hard negative mining" ?

can you be more concise about the purpose of it, the context,- which problem are you trying to solve here ?

what is your input data, and the expected outcome ?

berak gravatar imageberak ( 2018-11-23 05:08:34 -0500 )edit

yes this, and is it possible to combine SVM with other machine learning algorithm(in opencv)?

i'm trying to classify an image with multiple classes in SVM but i have a problem with gaining datasets. i'm already trying with a 100 image per class but the testing result isn't satisfying. so there is a way to minimize the data set used but getting a good classification?

Thank You,

andika M gravatar imageandika M ( 2018-11-23 08:15:04 -0500 )edit

what is your data ? how many classes do you have ?

sure you can combine an ensemble of classifiers, but you probably have to enquire first, why your svm classifies poorly. maybe you need better features, or a different kernel.

berak gravatar imageberak ( 2018-11-23 08:26:49 -0500 )edit

my dataset is images and i'm using edge as feature. I already process it to array of float using this technique. i'm using six class in my classification. actually I already trying with 1000 data set image per class and the result is pretty good but that used too many memory on the process and the size xml file resulted is too big. Thank You,

andika M gravatar imageandika M ( 2018-11-23 19:06:08 -0500 )edit

how large are the images ? maybe you can reduce that a bit. you could also use other features than pixels, like LBPH, or compress the dataset with PCA

the Boost classifier is a binary one (2 classes only). if you want to use that with 6 classes, you need 6 classifiers, each with one_class_versus_all_others. i'm quite sure, this won't reduce the overall memory consumption ...

berak gravatar imageberak ( 2018-11-24 01:11:12 -0500 )edit

are there any example on boost with one_class_versus_all_others in OpenCV?

Thank You very much. it help me gain new knowledge

andika M gravatar imageandika M ( 2018-11-24 02:45:02 -0500 )edit

no, there is no such example. (the only one is here

but you'd have to re-label your dataset for each classifier. for class A, every A image gets a 1 label, B,C,D,E,F get a 0, for class B, every B img gets a 1 label, and A,C,D,E,F get a 0, and so on.

why insist on using Boost here, just curious ? (you could use the same setup as for the SVM with e.g. RTrees)

berak gravatar imageberak ( 2018-11-24 03:27:17 -0500 )edit

well not really but my lecturer advice me to use it (for assigment). combine SVM as weak classifier with Boosting. And other than adding Boosting he said I could use Cross Validation with expectation to reduce the dataset needed. Still long way to go. by the way thanks a lot for the advice

andika M gravatar imageandika M ( 2018-11-25 19:45:25 -0500 )edit

i'm more and more thinking, your advisor meant: you should use boosting with N binary SVM's (aka an ensemble of weak classifiers) , not the cv::Boost class.

berak gravatar imageberak ( 2018-11-26 02:42:07 -0500 )edit

is it posible in open cv? boosting svm as weak classification

andika M gravatar imageandika M ( 2018-11-26 07:15:00 -0500 )edit