[ZJU-Machine Learning] Target detection using AdaBoost

Three types of problems in target detection and segmentation

Semantic Segmentation

Insert image description here

Target positioning and identification (Classification and Localization)

Insert image description here

Object Detection

Insert image description here

Basic idea

(1) The pixel value of the white area, minus the pixel value of the black area.
(2) The length and width of all areas of each FEATURE are consistent.
(3) FEATURE can be translated across the entire image, as long as (1) and (2) are met.
(4) These four forms can be removed.

For a 24*24 image, the number of all Haar-like features is about 200,000.
Insert image description here
In order to solve the problem of excessive calculation, Viola and Jone, Robust Real-Time Face Detection, International Journal of Computer Vision 57(2), 137–154, 2004 proposed a conversion method, which converts the area into Addition and subtraction of points,
Insert image description here
Insert image description here

Insert image description here
Image(D) =Integral(4)+Integral(1)-Integral(3)-Integral(2)

Classifier construction

Take some human faces (about 6,000) and some non-human faces (70,000) as training samples.
Insert image description here
Insert image description here
Insert image description here

Through this step, images, features, thresholds and p are given for training, and all f (200,000 features) can be obtained. For each feature f, we require the optimal threshold and p, so that h is trained The recognition rate is the highest in the set. From this, for each feature, we create a weak classifier, and use Adaboost for feature selection below.

Feature selection using AdaBoost algorithm

1. First, select the feature with the highest accuracy in the data set D, represented by F1.
2. Divide the data set D into two categories, {F1 correctly classified data} and {F1 incorrectly classified data}.
3. Take the data that F1 is classified as wrong with a higher probability, and the data that is classified as correct by F1 with a smaller probability to form a new set D2.
4. Select the feature with the highest accuracy in D2, represented by F2.
5. Divide D into: {data in which both F1 and F2 are classified correctly}, {data in which F1 is classified correctly but F2 is classified incorrectly, and data in which F1 is classified incorrectly and F2 is classified correctly}, {data in which both F1 and F2 are classified incorrectly. }.
6. Take {data in which both F1 and F2 are classified incorrectly} with the maximum probability, take {data in which F1 is classified correctly but F2 is classified incorrectly, and data in which F1 is classified incorrectly and F2 is classified correctly} with the next highest probability, and {data in which F1 and F2 are classified correctly} with the minimum probability. The data of both F1 and F2 are divided into pairs}, and the data set D3 is obtained.
7. Select the feature with the highest accuracy in D3, represented by F3. cycle, and so on.
8. Construct a classifier using a linear combination of each feature.

Finally, the Haar features that can characterize human faces are obtained:
Insert image description here

AdaBoost face detection process:

1. In the image, use the classifier for each 24 * 24 grid traversal, and if it is a face, output it.
2. Reduce the image, divide the length and width by 1.2, and use the classifier to traverse each 24 * 24 grid. If it is a human face, multiply the position coordinates by 1.2 and enlarge it to the original image.
3. Repeat step 2 until the image is less than 24 pixels long or wide.

Tips: For models trained using AdaBoost, only the angle used for training can be used for identification during detection. For multi-angle recognition, you can build multiple pose face AdaBoost classifiers, and after tree cascade, you can get a multi-pose face detector.
Insert image description here

Guess you like

Origin blog.csdn.net/qq_45654306/article/details/113806590