Harmful Content Detection Based on Cascaded Adaptive Boosting
Pseudocode 1
Pseudocode of AdaBoost.
AdaBoost algorithm for filtering candidate areas
Step 1. learning data samples are given. Here, indicates an image sample, and the index has a range from 1 to . may have values of 0 and 1, which mean a negative sample and a positive sample, respectively.
Step 2. The weight is initialized, and a sample with is set to , and a sample with is set to . Here, and represent the number of negative samples and positive samples.
Step 3. For
Step 3.1. The weights are normalized so that can be a probability distribution.
Step 3.2. Learn a weak classifier that is constrained to use a single feature for each feature . The error is calculated by the following equation using the weight .
Here, represents a feature, is a parity value for determining a sign, and represents a threshold value.
Step 3.3. Select , a weak classifier with a minimum error, where ,, and are values that minimize .
Step 3.4. Update the weight.
Here, if the sample was correctly classified, and otherwise, .
Step 4. Finally, a strong classifier is defined by linearly combining weak classifiers obtained above.