Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Fundamentals
Learning: Boosting
• Binary classification – classify the elements of a
given set into two groups on a given rule
• Error rate
0 0.5 1
h2 is wrong
h1 is wrong
h3 is wrong
h2 is wrong
h1 is wrong
h3 is wrong
h1 h2 h3
ω2
In the beginning:
ω1 1
ωi1 =
N
• Enforced a distribution ∑
ALL
ωit = 1
CASES
Idea #4
( x ) sign (α 1h1 ( x ) + α 2 h 2 ( x ) + α 3 h3 ( x ) + ....)
H=
1
LET ωi1 = , where N - # of samples
N
Pick ht that
Pick α t
minimizes ERROR t
Calculate ω t +1
Idea #6
ω t
−α t ht ( x ) y ( x )
• Suppose that: ω t +1
i = i
e
Z
+1 for samples the classifier thinks belongs to the class
h ( x) =
−1 for samples that the classifier thinks do not belong to the class
1 1 − E t
α t = ln t , where E is the ERROR at time t
2 E
• The error will be bounded by an exponential decay function
• It’s guaranteed to converge on 0
Error
Exponential boundary
Error
time
Ada Boost
• You use uniform weights to start.
• For each step, you find the classifier that yields the lowest error
rate for the current weights, wit
• You use that best classifier, ht(xi) , to compute the error rate
associated with the step, Et
• You determine the alpha for the step, αt from the error for the step,
Et .
• With the alpha in hand, you compute the weights for the next step,
wit+1, from the weights for the current step, wit , taking care to
include a normalizing factor, Zt , so that the new weights add up to
1.
• You stop successfully when H(xi) correctly classifies all the samples,
xi; you stop unsuccessfully if you reach a point where there is no
weak classifier, one with an error rate < 1/2 .
Change the weights
Et
t if it's correct
ωi 1 − E T
ωit +1 =
Z 1− Et
if it's wrong
ET
Et 1− Et
=Z
1− Et
∑
CORRECT
ω +
t
i ∑
E t WRONG
ωi
t
Et 1 − E t
= (1 − E t ) + E=
t
2 E t (1 − E t )
1− E E t
1 1 1 1
t
ωi 1 − E t
if it's correct = ∑ ω t +1
i =
− t ∑ ω t
– Line features
– Other features
Face detection
• Integral image – each pixel (x,y) is the sum of all pixels
above and left of x,y applied to original image
A B
1 2
(x,y)
C D
3 4
= ( location _1)
v1 ii= ∑i
ii ( x, y ) = ∑
x '≤ x , y '≤ y
i ( x ', y '),
v 2 ii ( location _=
= 2)
A
∑i + ∑i
A B
rect ( D) = v1 + v 4 − v 2 − v3
Face detection
• For 24x24 pixels image – 162.336 features
Face detection
• Choosing the threshold for each classifier
Face detection
• The first and second features selected by
AdaBoost
Face detection
Starts from top-left
• Sub-window – 24x24 pixels corner and go to
left 1 pixel at a
width time. When reach
the end of the row,
go down 1 pixel
and start again
24 from the left.
24
height
Face detection
• Cascade of classifier
– #of features in the first 5 layers: 1, 10, 25, 25 and 50
– total # of features in all layers - 6061
All
T T T T
sub-windows 1 2 3 38 Face
F F F F
Reject sub-window
Related resources
• P. Viola, M. Jones, “Robust Real-Time Face Detection”,
http://www.vision.caltech.edu/html-files/EE148-2005-
Spring/pprs/viola04ijcv.pdf