Jonathan Beall's Eigenface Recognizer/Detector

Design

My code computes the eigenfaces for a given set of images using the sped-up algorithm suggested on the website. It then implements face recognition, verification (athough this is untested), and detection. The face detector also computes the mse between the color of the center of a proposed face and a 'skin' color, which can optionally be part of the score used to select face locations.

Experiments and Examples

Face Recognition.

Using the pictures of faces from nonsmiling_cropped, I generated an average face as well as 10 25x25 eigenfaces, seen below

I used a test script to generate a number of different sets of different cardinalities of eigenfaces of different. These eigenfaces were generated using the images in nonsmiling_cropped, and are then tested to see what fraction of the images in smiling_cropped thet can identify. The results for everything between 1 and 21 eigenfaces of all even sizes between 10x10 and 40x40 are plotted below.

The general trend is that the fraction of faces recognized rises rapidly between 1 and 10 eigenfaces, but then levels out. The change in recognition rate when changing the size of the eigenvalues appears to have no general trend, but does have a few local anomolies that we can exploit. For some reason, recognition using 18-12 pixel wide features appears to be a region of poor recognition, and there are portions with high recognition scattered across the plot. For example, 10 25x25 pixel egenfaces appears to be one local maximum, as are 10 or 15 eigenfaces of 14 pixesls wide. Still, the highest recognition rate I could acchieve was 66%. Sometimes the correct image would not be the top result, but would show up fairly high on the list of matches, while other times it would not occur at all. Some of these mistakes were due to similar looking images in the database, and sometimes they were due to differences between the smiling and nonsmiling portraits of a student.

Cropping and Finding Faces

I tested the face-finding and cropping code in my application using the 10 eigenfaces shown above, going from a scale factor of 0.3 to 0.5 with a step size of 0.05. This successfully detected a face present at scale 0.45 and then cropped it, yielding the cropped face shown below, ready for recognition.

I then tested this code on a snapshot of myself, again using the 10 eigenfaces shown above, going from a scale factor of 0.1 to 0.9 with a step size of 0.1. This successfully detected a face present at scale 0.2 and then cropped it, yielding the cropped face shown below, ready for recognition.

If I know the approximate scale of a face, I can select scale parameters to look more carefully for the perfect scale, but if I don't know the scale, using a broad, low resolution sequence such as 0.1, 0.2, ..., 0.8, 0.9 works robustly and reasonably accurately for portrait photography.

I tested the multi-person-face-finding and marking code in my application marking the faces in the photo below. Unfortunately, I was unable to get my code to recognize all three of the faces at the same time, although I could get it to recognize different pairs of faces by varying my detection algorithm (for example, adding in a skin-color-detector, or changing the number or size of eigenfaces used).

Code

The latest version of the code and a binary compiled to run on an Intel Mac are available for download.