Boosting training from principle to realization of image array

Source: Internet
Author: User

Boosting principle

It is known that boosting is called a strong classifier with multiple weak classifiers. And what is called weak classification learning and when to use weak classification learning?

Weak classification Learning

Weak classification Learning: The correct rate of recognition of a set of concepts is only a little higher than the probability of random guessing.
Similarly, when the training group that needs to classify has the above characteristics, the boosting algorithm can be used as a priority.

Important historical events of boosting
    1. Kearns & Valiant (1984): Boosting Origin
    2. Kearns & Valiant (1989): The equivalence of weak learners and strong learners is proved.
    3. Schapire (1989): The first one presents a boosting algorithm that can prove a polynomial event.
    4. Schapire (1993): For the first time, the idea of boosting algorithm is used in practical applications (OCR).
    5. Freund & Schapire (1995): AdaBoost algorithm.
The principle of boosting

In order to train a series of weak classifiers h1,h2,.. HT, constantly classifying the samples, after each classification, focuses on the wrong sample, calculates the weight of this classification, and then carries out the wrong sample to the next classifier to learn, and so on.
Finally, all weak classifiers are grouped together:

AdaBoost algorithm

Boosting to implement training image group in OpenCV Cvboostparams

This class is mainly for boosting settings, such as setting the use of which boosting and some training parameters, the default value itself, so if not set, you can directly use the default value.
The default values are as follows:

CvBoostParams::CvBoostParams(){    boost_type = CvBoost::REAL;    100;    0.95;    0;    1;}

If you need to set it, set the method as follows:

params(CvBoost::DISCRETE,100,0.95,0,1);
Cvboostparams::train
voidBoosting_train ( vector<Mat>Mats vector<int>ResponseintClass_count=2) {Cvboost boost;//Use default values    if(Mats.size ()! =0)    {inttotal=mats[0].cols*mats[0].rows; Mat Mat=mat (Total,mats.size (), CV_64FC1); for(intI=0; I<mats.size (); i++) {Mat col_tmp=mat.col (i); Mats[i].reshape (1, total). Col (0). ConvertTo (COL_TMP,CV_64FC1,1/255.); } Mat Resp=mat (Mats.size (),1, CV_64FC1); for(intI=0; I<response.size (); i++) {resp.at (i),0) =response[i];    } boost.train (mat.t (), CV_ROW_SAMPLE,RESP); }//For better results, you can change the sample number to sample number multiplied by the number of categories, i.e. mats.size () to Mats.size () *class_count}

Reference Document: Http://docs.opencv.org/modules/ml/doc/boosting.html

Reprint Please specify source: http://blog.csdn.net/luoyun614/article/details/44254269

Boosting training from principle to realization of image array

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.