Project 5 / Face Detection with a Sliding Window

In this project I implemented histograms of gradients (HOG) method for detecting faces. I pulled HOGs from a training set of images using vl_hog. I used them to train an SVM classifier using vl_svmtrain. To classify the test images I called vl_hog on the whole image and the using a sliding window, of the same size of the HOGs from the training images, I tested the image against the SVM classifier. If the classifier returned a value above a certain threshold it was considered to be a face.

Tweaking Parameters

There are a couple of parameters to play with. The parameters I played with were: the hog cell size, the number of random negative features, and the threshold when classifying the test images. There also were the image scaling factor, which I set to 0.9, and lambda parameter for vl_svmtrain, but I found that changing these only returned poorer results.

First I tried the default parameters of 6 for hog cell size, 10000 for the number of random negative features. I played around with the run detector threshold and found 0.6 to work pretty well. I got pretty decent results.

hog cell size 6, 10000 random negative features and a run detector threshold of 0.6

Since the average precision met the target of at least 0.83 I wanted to test hog cell size 3 and see if it met the target of 0.92.

hog cell size 3, 10000 random negative features and a run detector threshold of 0.6

It did better than the cell size 6 but it did not meet the target. I also noticed that I had too many false positive results.

hog cell size 3, 10000 random negative features and a run detector threshold of 0.6

So I turned up the number of random negatives to 17000 and I saw an increase in average precision and a decrease in the number of false positives

hog cell size 3, 17000 random negative features and a run detector threshold of 0.6

hog cell size 3, 17000 random negative features and a run detector threshold of 0.6

This combination of parameters meets the target average precision.

Class Image

Here are the results from running the algorithm on the class images. I used the following parameters hog cell size 3, 17000 random negative features and a run detector threshold of 0.8