Fast and Robust Face /
In this project we
Viola-Jones cascade face detector in both training speed and
Face Detection is a rare event detection problem, in
the sense that faces are extremely rare compared to non-faces. In the
example image, there are only 3 faces, but there exist millions of
non-face windows. A cascade detector is composed of a series of node
classifiers. It scans every possible window in a image at all
positions and scales, and determine whether it is a face or not. When
examining a window, it quickly determines “this is not a face”
as soon as any node classifier say that window is not a face. This
property makes a cascade classifier has very fast testing speed.
Our contribution to this problem includes the
- We revise the implementation of the AdaBoost
algorithm (which is used to train node classifiers by Viola and Jones)
such that it is 2 orders of magnitude faster;
- In training a node classifier, we propose a Forward
Feature Selection (FFS) algorithm to replace AdaBoost. FFS is a greedy
algorithm that always selects a feature which maximally reduces
training error of the entire node classifier. In contrast, AdaBoost
chooses a feature which minimize the weighted error rate of the
currently selected feature. FFS is about two times faster than the fast
AdaBoost implementation, and achieves approximately the same accuracy
- We show that the node classifiers has different
learning goals than normal classifiers: They need to correctly classify
almost all faces correctly (e.g. >99.9%) but only needs to be
correct on a moderate number of non-faces (e.g. 50%). We formalized
this problem into a constrained optimization problem, and give an
closed-form approximate solution to this problem, which we call Linear
Asymmetric Classifier (LAC).
- We show that the entire cascade can be optimized as
a whole – i.e. the goals of all node classifiers can be coordinated to
give a fast and precise cascade.
The source code for fast AdaBoost
implementation, FFS and LAC are available.
- C++ source code in the Windows
platform with Visual C++ is here.
Please pay attention to
We also provide a live demo executables
(again running in Windows) and a demo video.
- If you got
compile error concerning "OptionDialog", please don't use
the project file to open the VC++ project; instead, please use the
solution file (.sln file).
- Please read the Readme.txt
in the zip file before you play with the code and executable. Note that
if you want to use the attached (trained) face detector, you need to replace
the content of the empty cascade.txt with one of the cascade_*.txt
in the data/ directory.
- In IntImage.cpp,
within the function IntImage::Load,
after the line "img = cvLoadImage(filename,0);", add the following line:
(added June 2, 2011 to fix OpenCV issues)
- If you want to train a classifier of
your own, you will need the non-face
See the Readme.txt
If you use the
provided source code,
please cite the following paper:
Fast Asymmetric Learning
Cascade Face Detection
Jianxin Wu, S. Charles Brubaker, Matthew D. Mullin, and James M. Rehg
IEEE Transactions on Pattern Analysis and Machine Intelligence, 30(3),
2008: pp. 369-382.
For more details, please refer to papers in the
papers [J5] and conference papers [C3][C4] describing FFS and LAC,
while journal paper [J5] describing the global framework that
optimize the entire cascade by moving operating points of node