presenter: derek hoiem cs 598, spring 2009 feb 24, 2009

39
Statistical Template-Based Object Detection A Statistical Method for 3D Object Detection Applied to Faces and Cars Henry Schneiderman and Takeo Kanade Rapid Object Detection using a Boosted Cascade of Simple Features Paul Viola and Michael Jones Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009 Some slides/figures from www.cs.cmu.edu/~efros/courses/AP06/presentations/ Schneiderman-Kanade%20Viola-Jones%20presentation.ppt

Upload: doyle

Post on 07-Jan-2016

37 views

Category:

Documents


1 download

DESCRIPTION

Statistical Template-Based Object Detection A Statistical Method for 3D Object Detection Applied to Faces and Cars Henry Schneiderman and Takeo Kanade Rapid Object Detection using a Boosted Cascade of Simple Features Paul Viola and Michael Jones. Presenter: Derek Hoiem CS 598, Spring 2009 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Statistical Template-Based Object Detection

A Statistical Method for 3D Object Detection Applied to Faces and CarsHenry Schneiderman and Takeo Kanade

Rapid Object Detection using a Boosted Cascade of Simple FeaturesPaul Viola and Michael Jones

Presenter: Derek HoiemCS 598, Spring 2009

Feb 24, 2009

Some slides/figures from www.cs.cmu.edu/~efros/courses/AP06/presentations/Schneiderman-Kanade%20Viola-Jones%20presentation.ppt

Page 2: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Goal: Detect all instances of objects

Page 3: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Influential Works in Detection• Sung-Poggio (1994, 1998) : ~1260

– Basic idea of statistical template detection (I think), bootstrapping to get “face-like” negative examples, multiple whole-face prototypes (in 1994)

• Rowley-Baluja-Kanade (1996-1998) : ~2700 citations– “Parts” at fixed position, non-maxima suppression, simple cascade, rotation,

pretty good accuracy, fast

• Schneiderman-Kanade (1998-2000,2004) : ~1150– Careful feature engineering, excellent results, cascade

• Viola-Jones (2001, 2004) : ~4400– Haar-like features, Adaboost as feature selection, very fast, easy to implement

• Dalal-Triggs (2005) : ~400– Careful feature engineering, excellent results, HOG feature, online code

• Felzenszwalb-McAllester-Ramanan (2008)? 8 citations– Excellent template/parts-based blend

Page 4: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Sliding window detection

Page 5: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

What the Detector Sees

Page 6: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Statistical Template

• Object model = log linear model of parts at fixed positions

+3 +2 -2 -1 -2.5 = -0.5

+4 +1 +0.5 +3 +0.5= 10.5

> 7.5?

> 7.5?

Non-object

Object

Page 7: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Design challenges• Part design

– How to model appearance– Which “parts” to include– How to set part likelihoods

• How to make it fast• How to deal with different viewpoints• Implementation details

– Window size– Aspect ratio– Translation/scale step size– Non-maxima suppression

Page 8: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Schneiderman and Kanade

Page 9: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Parts model

• Part = group of wavelet coefficients that are statistically dependent

Page 10: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Parts: groups of wavelet coefficients

• Fixed parts within/across subbands

• 17 types of parts• Discretize wavelet coefficient to 3 values• E.g., part with 8 coefficients has 3^8 = 6561

values

Page 11: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Part Likelihood

• Class-conditional likelihood ratio

• Estimate P(part|object) and P(part | non-object) by counting over examples

• Adaboost tunes weights discriminatively

r r

r

objectnonpartP

objectpartP

)|(

)|(

)(

)&()|(

objectcount

objectpartcountobjectpartP

Page 12: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Training1) Create training data

a) Get positive and negative patchesb) Pre-process (optional), compute wavelet

coefficients, discretizec) Compute parts values

2) Learn statisticsa) Compute ratios of histograms by counting for

positive and negative examplesb) Reweight examples using Adaboost, recount, etc.

More on this later

Page 13: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Training multiple viewpoints

Train new detector for each viewpoint.

Page 14: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Testing1) Processing:

a) Lighting correction (optional)b) Compute wavelet coefficients, quantize

2) Slide window over each position/scale (2 pixels, 21/4 scale)

a) Compute part valuesb) Lookup likelihood ratiosc) Sum over partsd) Threshold

3) Use faster classifier to prune patches (cascade)… more on this later

4) Non-maximum suppression

Page 15: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Results: faces

208 images with 441 faces, 347 in profile

Page 16: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Results: cars

Page 17: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Results: faces today

Page 18: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Viola and Jones

Fast detection through two mechanisms

Page 19: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Integral Images• “Haar-like features”

– Differences of sums of intensity– Millions, computed at various positions and scales

within detection window

Two-rectangle features Three-rectangle features Etc.

-1 +1

Page 20: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Integral Images• ii = cumsum(cumsum(Im, 1), 2)

x, y

ii(x,y) = Sum of the values in the grey region

How to compute A+D-B-C?

How to compute B-A?

Page 21: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Adaboost as feature selection

• Create a large pool of parts (180K)• “Weak learner” = feature + threshold + parity

• Choose weak learner that minimizes error on the weighted training set

• Reweight

Page 22: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Sidebar: Adaboost

Page 23: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Adaboost

Page 24: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Adaboost

“RealBoost”

Figure from Friedman et al. 1999

Important special case: ht partitions input space:

alphat

Page 25: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Adaboost: Immune to Overfitting?

Test error

Train error

Page 26: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Interpretations of Adaboost

• Additive logistic regression (Friedman et al. 2000)– LogitBoost from Collins et al. 2002 does this more

explicitly

• Margin maximization (Schapire et al. 1998)– Ratch and Warmuth 2002 do this more explicitly

Page 27: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Adaboost: Margin Maximizer

margin

Test error

Train error

Page 28: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Interpretations of Adaboost• Rosset Zhu Hastie 2004

– Early stopping is form of L1-regularization– In many cases, converges to “L1-optimal” separating hyperplane– “An interesting fundamental similarity between boosting and kernel support vector machines emerges, as both can be described as methods for regularized optimization

in high-dimensional predictor space, utilizing a computational trick to make the calculation practical, and converging to margin-maximizing solutions.”

Page 29: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Back to recognition

Page 30: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Cascade for Fast Detection

Examples

Stage 1H1(x) > t1?

Reject

No

YesStage 2

H2(x) > t2?Stage N

HN(x) > tN?

Yes

… Pass

Reject

No

Reject

No

• Choose threshold for low false negative rate• Fast classifiers early in cascade• Slow classifiers later, but most examples don’t get there

Page 31: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Viola-Jones details• 38 stages with 1, 10, 25, 50 … features

– 6061 total used out of 180K candidates– 10 features evaluated on average

• Examples– 4916 positive examples– 10000 negative examples collected after each stage

• Scanning– Scale detector rather than image– Scale steps = 1.25, Translation s to 1.5s

• Non-max suppression: average coordinates of overlapping boxes

• Train 3 classifiers and take vote

Page 32: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Viola Jones Results

MIT + CMU face dataset

Page 33: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Schneiderman later results

Viola-Jones 2001Roth et al. 1999

Schneiderman-Kanade 2000

Schneiderman 2004

Page 34: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Speed

• Schneiderman-Kanade: 1 minute for 3 viewpoints

• Viola-Jones: 15 fps for frontal

Page 35: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Important Ideas and Tricks• Excellent results require careful feature

engineering• Speed = fast features (integral image) +

cascade• Adaboost for feature selection• Bootstrapping to deal with many, many

negative examples

Page 36: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Occlusions?• A problem

• Objects occluded by > 50% considered “don’t care”

• PASCAL VOC changed this

Page 37: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

Strengths and Weaknesses of Statistical Template ApproachStrengths• Works very well for non-deformable objects:

faces, cars, upright pedestrians• Fast detection

Weaknesses• Not so well for highly deformable objects• Not robust to occlusion• Requires lots of training data

Page 38: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

SK vs. VJSchneiderman-Kanade• Wavelet features• Log linear model via

boosted histogram ratios• Bootstrap training• Two-stage cascade

• NMS: Remove overlapping weak boxes

• Slow but very accurate

Viola-Jones• Similar to Haar wavelets• Log linear model via

boosted stubs• Bootstrap training• Multistage cascade,

integrated into training• NMS: average coordinates

of overlapping boxes• Less accurate but very fast

Page 39: Presenter: Derek Hoiem CS 598, Spring 2009 Feb 24, 2009

BB discussion http://www.nicenet.org/ICA/class/conf_topic_show.cfm?topic_id=643240