Sliding window approach
The hypothesis of the project: having datasets of faces and non-faces it is possible to extract consistent features from
those images and to train the classifier to recognize faces on the photographs it has never seen before.
For the purpose of the hypothesis we are going to implement a sliding window approach. It's main idea is to iteratively
go through an image with a small offset, take a patch of it and decide whether it contains a face or not. This is done
for different sizes of the patch region. In order to decide if the patch contains a face we first need to know how to
compare the image region with some reference faces. SIFT is used as a descriptor in this project's implementation. The
classifier training requires some hard negative examples (non-faces) and we provide those from random patches from
non-faces regions. In the next iteration of the algorithm we run classifier on images without faces to get false
positives. And only after that new classifier is trained using the data from previous step having false positives
information. In this assignment a linear and non-linear SVMs have been used to make a decision boundary between face and
non-face classes. Non-linear SVM produces better results (more accurate) but takes a much longer time to compute due to
high number of polynomials in the training data (see Images 1 and 2). Precision of 79% has been reached on this
assignment.
The algorithm of the program:
VLFeat paths are set to be able to call the SIFT
load positive examples
load initial negatives
set total number of stages of cascade depending on the task we need to do
do cascade:
mine hard negatives (false positives)
train classifier
add it to cascade
cascade classifier adjustment in cascade mode
evaluation
Results:
The results are provided for linear and non-linear classifiers having hard negatives included in cascade adjustment.
Images 3-12 show different levels of confidence from 0.0 to 0.9.
Image 1. Precision-Recall plot for linear classifier
Image 2. Precision-Recall plot for non-linear classifier

Image 3. Detections with 0.0 confidence

Image 4. Detections with 0.1 confidence
Image 5. Detections with 0.2 confidence

Image 6. Detections with 0.3 confidence
Image 7. Detections with 0.4 confidence

Image 8. Detections with 0.5 confidence
Image 9. Detections with 0.6 confidence

Image 10. Detections with 0.7 confidence
Image 11. Detections with 0.8 confidence

Image 12. Detections with 0.9 confidence
|