Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

FACE DETECTION

The problem to be solved is detection of


l

faces in an image. A human can do this


easily, but a computer needs precise
instructions and constraints. To make the
task more manageable, ViolaJones
requires full view frontal upright faces. Thus
in order to be detected, the entire face must
point towards the camera and should not be
tilted to either side.
Challenges
Slide a window across image and evaluate a face model at every location

Sliding window detector must evaluate tens of thousands of location/scale

combinations
Faces are rare: 010 per image

For computational efficiency, we should try to spend as little time as possible


on the non-face windows
A megapixel image has ~106 pixels and a comparable number of candidate face
locations
To avoid having a false positive in every image, the false positive rate has to be
less than 106
Key ideas
Integral images for fast
feature evaluation

Boosting for feature


selection

Attentional cascade for


fast rejection of non-face
windows
Haar-features (1)
The differe e etwee pixels su of the
white and black areas
Haar-features (2)
Capture the face symmetry
lHaar Feature that looks
similar to the eye
region which is darker
than the upper cheeks
is applied onto a face
lHaar Feature that looks

similar to the bridge of


the nose is applied
onto the face
Haar-features (3)
Type A

Four types of haar features

Can be extracted at any


location with any scale! A 24x24 detection window
Haar Features All human faces share some similar
properties. These regularities may be matched
using Haar Features.
A few properties common to human faces:
lThe eye region is darker than the upper-cheeks.

lThe nose bridge region is brighter than the eyes.

lComposition of properties forming matchable facial

features:
lLocation and size: eyes, mouth, bridge of nose

lValue: oriented gradients of pixel intensities


24

Haar-features (4)
24

Too many features!


location, scale, type
180,000+ possible features associated with each 24
x 24 window
Not all of them are useful!
Speed-up strategy
Fast calculation of haar-features
Selection of good features
AdaBoost
Integral image
a = sum(1)
1 2 b = sum(1+2)
a b c = sum(1+3)
3 4 d = sum(1+2+3+4)
c d
Sum(4) = ? d+abc
Four-point calculation!

A, B: 2 rectangles =>
C: 3 rectangles
D: 4 rectangles
Feature selection
A very small number of features can be
combined to from an effective classifier!
Example: The 1st and 2nd features selected by
AdaBoost
Feature selection
A weak classifier h

f1 f2
f1 > a threshold => Fa e!
f2 a threshold => Not a Fa e!
1 if fi >
h=
0 otherwise
Feature selection
Idea: Combining several weak classifiers to
generate a strong classifier


1 3
2 T
><
1h1+ 2h2 + 3h3 + + ThT Tthresold
~performance of
the weak classifier
on the training set weak classifier (feature, threshold)
h1 = 1 or 0
Feature selection
Training Dataset
4916 face images
non-face images cropped from 9500 images

non-face images

positive samples negative samples


AdaBoost
Each training sample may have different
importance!
Focuses more on previously misclassified
samples
Initially, all samples are assigned equal weights
Weights may change at each boosting round
misclassified samples => increase their weights
correctly classified samples => decrease their weights
Learning the classifier
Initialize equal weights to training samples
For T rounds
normalize the weights
select the best weak classifier in terms of the
weighted error
update the weights (raise weights to misclassified
samples)
Linearly combine these T weak classifiers to
form a strong classifier
AdaBoost Algorithm
Start with uniform weights on Training examples

For T rounds

Evaluate weighted error for each feature, pick best.

Re-weight the examples:


Incorrectly classified -> more weight
Correctly classified -> less weight

Final classifier is combination of the


weak ones, weighted according to
error they had.
Feature Selection: Results

First two features


selected
Cascade of classifiers

IMAGE T T T
SUB-WINDOW
Classifier 1 Classifier 2 Classifier 3 FACE
F F F

NON-FACE NON-FACE NON-FACE


Viola-Jones detector: summary
Train cascade of
classifiers with
AdaBoost
Faces
New image

Selected features,
Non-faces thresholds, and weights

Train with 5K positives, 350M negatives


Real-time detector using 38 layer cascade
6061 features in all layers

You might also like