Eigenfaces

Peter Davis
CSE 455 A, Project 4
Winter 2006

Eigenfaces Generation

These ten eigenfaces were created from a set of cropped images of non-smiling students. They are shown in descending order of their eigenvalues, so the first eigenface is the one over which there was the least variation in the input set. This set was used to compute a userbase.

Average Face: (magified 3×)
Eigenfaces:

Face Recognition

Baseline

Using these 10 eigenfaces created from images of non-smiling students, the program managed to correctly identify 20 out of 27 smiling students, for an accuracy of 74%.

An asterisk (and yellow background) denotes a student who was incorrectly identified, but who was correctly identified in the second-best result. Considering both of the top-two results increases the accuracy to 85% (but of course with less confidence).

*
* *

Note that among the recognition errors (shown with red and yellow backgrounds), the incorrectly matched faces are clearly similar. In some cases, the misrecognition seems to be due to one or both students wearing glasses, a very distinctive feature that we would expect to skew results since most of the training set was not wearing glasses. In other cases, misrecognition seems to be due to different angles at which the face was held, or by different amounts of background seen on one side of the face. Since the algorithm does not know to treat the background differently, and since these students apparently shifted their heads between taking the smiling and non-smiling photos, it makes sense that this would cause errors.

Varying the Number of Eigenfaces

I again ran the program to identify smiling students from non-smiling eigenfaces, but with the number of eigenfaces ranging from 2 to 27 (stepping by 1). In general, lower numbers of eigenfaces yielded much lower accuracy.

However, this trend leveled out at about 10 eigenfaces. At least with this relatively small training set of only 27 input images, given the increased running time of the algorithm with larger numbers of eigenfaces and diminishing performance improvements, the "best" number of eigenfaces seems to be 10.

Note that the best results were actually achieved with 11 and 17 eigenfaces. However these appear to be flukes, since the trend clearly remains pinned to 20 correct identifications as the number of eigenfaces increases further.

Cropping Faces

"Elf"

Using the set of ten eigenfaces computed in the first problem, here is the result of cropping elf.tga.

Scale from 0.45 to 0.55, step 0.01. Best match found at scale 0.54.

Getting the program to find the man's face, rather than the featureless wall behind him or other features in the image, was a little tricky. I implemented the suggested trick of multiplying each potential match's mean-squared-error by the match's distance from the face mean and dividing by its variance, to avoid low-texture regions while giving better scores to things that more closely resemble a face. However, this gave too high a score to the very high-texture object above the man's head. I found a compromise that seemed to work well on this image and others in dividing by the square root of the variance, giving less weight to very high-textured candidates.

Self-Portrait

Using the set of ten eigenfaces computed in the first problem, here is the result of cropping a silly image of myself.

Scale from 0.20 to 0.30, step 0.075. Best match found at scale 0.2525.

I did not need to experiment much with min_scale and max_scale to get a good crop, since I used an image editor to find that my "face" was approximately 100 pixels wide. Since the window size is 25 pixels, this implies a scale of approximately 0.25. This turned out to be almost dead on, but I gave a wide buffer of ±0.05 just to be sure.

But just for kicks, I ran findface on scales ranging from 0.02 to 0.50 (step 0.01). This yielded a very different result, with the best match at scale 0.48. Strangely, the correct match was nowhere to be found in the top 10 results.

This demonstrates that this basic algorithm is indeed sensitive to the range of scales, and thus cannot be trusted to run completely automated (say, from scales 0.01 to 2.00). A human must give it a little guidance as to the scale at which faces are expected.

Finding Faces

"IMG_0031.tga"

Matching this group of three faces (including mine) worked with no surprises.

Scale from 0.45 to 0.55, step 0.01. Best matches found at scales 0.54, 0.47, and 0.55 (in that order).

Group Photo

I found this random image on Flickr. As you can see, my attempts to find all six faces were not successful. In my first attempt, the only face found was of the non-smiling guy. This makes a little sense, because that's the type of face on which the eigenvectors were trained. However, I would have expected a little better performance on the smiling faces.

Scale from 0.70 to 0.72, step 0.01. Best match found at scale 0.71.

The false-positives in this image all seem to share the trait of being darker on top than on the bottom. If you look at the "average face" at the top of this document, this might correspond to the very dark areas around the eyes.

Discouraged by the performance with smiling faces, I created a new set of eigenvectors, trained from 27 images of smiling students. This had predictable results, finding two smiling people in the group image but failing to find the non-smiling guy that was found previously. The remaining two people seem hopeless.

Scale from 0.70 to 0.72, step 0.01. Best matches found at scale 0.71.