Quiz: boosted detectors and the cascade
Before this unit: Rectangle features (previous unit); Day 1: Images, filters and frequencies.
See also: Decision trees (day 33); Day 3: Bit depth and noise; Day 12: Thresholding; Day 33: Random forests; Day 7: Wavelets.
Short questions to test your understanding. Try each on paper first, then open the answer.
Q1. Why must a sliding-window detector have an extremely low false-positive rate per window?
Because it looks at hundreds of thousands of windows per image (every position and scale), and almost all are background. A false-positive rate of 1 % would give thousands of false detections per image; even 10^{-5} gives several.
Q2. What is a decision stump, and why is it called a weak classifier?
One feature, one threshold and a direction: “face if the feature is above (or below) \theta”. It is a decision tree of depth 1. Alone it is only somewhat better than guessing; boosting combines many of them into a strong classifier.
Q3. After an AdaBoost round, which training examples get more weight, and why?
The examples the new stump classified wrongly: their weights are multiplied by e^{\alpha}, the others by e^{-\alpha}. The next stump is chosen by its weighted error, so it must do well on exactly those examples: each round focuses on what is still wrong.
Q4. A stump has weighted error \varepsilon = 0.2. What is its vote \alpha? What would \varepsilon = 0.5 give?
\alpha = \tfrac12\ln(0.8/0.2) = \tfrac12\ln 4 = 0.69. With \varepsilon = 0.5: \alpha = 0, no vote; the stump is no better than guessing.
Q5. How does boosting select features?
Each round chooses the single stump, and hence the single feature, with the smallest weighted error out of the whole pool. After T rounds the classifier uses at most T features; the rest of the pool (often over 100 000 features) is never evaluated at detection time.
Q6. A cascade has 5 stages, each with detection rate 0.995 and false-positive rate 0.4. What are D and F?
D = 0.995^5 = 0.975; F = 0.4^5 = 0.010.
Q7. Why is the first stage of a cascade made as small as possible (one or two features)?
Every window passes through stage 1, so its cost is paid for every window; later stages are paid only by the few windows that reach them. Most background windows are easy and can be rejected by one or two features.
Q8. Why is each new cascade stage trained on background windows that the earlier stages accepted, rather than on random background?
Random background is already rejected by the earlier stages; training on it would teach nothing new. The windows that got through are the hard, face-like ones the cascade still gets wrong. Training each stage on those makes the cascade progressively better at exactly the cases that matter.
Q9. How does the detector handle faces of different sizes without an image pyramid?
It scales the features: in a larger window every rectangle grows by the same factor. With the integral image a larger rectangle costs the same four lookups. Dividing by the window’s standard deviation and the rectangle area keeps the responses comparable across scales.
Q10. A detector trained mostly on faces without glasses misses faces with glasses. Is this a bug in boosting?
No: boosting chose features and thresholds that fit the training set. If a group of faces is rare or absent there, the chosen features (e.g. “the eyes are dark”) may not hold for it, and the stage thresholds reject it. The fix is in the data: a training (and test) set that covers everyone the detector will be used on, with rates reported per group.
Q11. (math) Show that after reweighting, the stump just chosen has weighted error exactly \tfrac12.
Before normalising, the wrong examples weigh \varepsilon e^{\alpha} and the correct ones (1-\varepsilon)e^{-\alpha}. With e^{\alpha} = \sqrt{(1-\varepsilon)/\varepsilon} both are \sqrt{\varepsilon(1-\varepsilon)}, so after normalising each part is \tfrac12.