Project 5 / Face Detection with a Sliding Window

In this project, we had to create a pipeline that concluded in the detection of faces. It consisted of a data pre-processing/feature generation stage, a classifier training phase, and then finally applying the classifier over windows of HOG features to detect faces through each one.

Data pre-processing/feature generation/Training

We were given a set of cropped, positive examples in jpg format and we simply ran vl_hog to retrieve the hog features of each positive example. As for the negative examples, we had to pick random partitions of each image and generate hog features from those. I picked the same amount of partitions for each example. All the features were then fed into an SVM

Detector

The image is converted into hog features, and then we have a "box" or "window" that slides across the image. The window is fed into the trained svm to tell us the confidence or probablity of that window being a face. Afterwards, the image is shrunk and the process is repeated until the resized image is smaller than the template which we're using. After that, the non-maxima suppression is ran at every scale to find the window with the highest probability of containing a face as well as removing duplicate detections. All my experiments were done with multiple scales, and I adjusted the confidence threshold and got interesting results. When I kept it at .75 my precision hovered around 80 percent, with few false positives. Then I adjusted it to -.5 and got a large amount of false negatives but my precision went up to .832. Below are some visualizations depicting the results.

Results

Results for confidence of -.5

Results for confidence of .75