Matt Hall

Computer Vision (CSE 455), Winter 2012

Project 4: Eigenfaces

Project Abstract

Objectives

The purpose of the EigenFaces project was to use principal component analysis to create a facial recognition program. This is done by projecting images of face onto a "face space" then using that face space to recognize other faces we haven't trained on.

Challenges

Two funcitons of this program made this assignment especially difficult: the compution of the eigenfaces and using thes eigenfaces to find faces in a picture. The eigenface computation function was difficult because of the mathematical complexity of the function while the findfaces function was made difficult by the fact that it just didn't seem to work very well. The former challenge was solved by reading the slides more carefully, but the latter took a lot of testing before it semi-worked.

Lessons Learned

This assignment helped my understanding of the concepts of PCA, high dimensionality vector analysis, and image processing. The understand of PCA and it's application to computer vision could concievably be called the main purpose of this assignment and therefore having completed this assignment I feel that I have come to grips with a better understanding of the purpose of eigenvectors and how they can be used to represent data in a more concise fashion. These representations were still vectors with a high degree of dimentionality though, so working with them was somewhat of a new experience for me. Thus thinking about projecting these vectors onto the facespace led to some thinking I'd never done before. Finally to tie it all together we had to write the findfaces funtion which absolutely refused to work for me so I did a lot of thinking about how to improve my searching function.

Implementation

EigenFaces is meant to address the face recognition problem by constructing a set of base eignfaces to use to construct any face we come across. We can use these eigenfaces as the base vectors to define the space we consider to be faces then project any image we encounter onto this space and compute the error of this projection.

The project is structured as follows:

Experiment: Recognition

Methodology

The first step involved calculating the eigenfaces by use of the Faces::eigenFaces function. Secondly we calculated all user coefficients using the projectFace method described above. Lastly we used these coefficients to rank the top matched face to each face in smiling_cropped.

Questions

Question 1:
The trend in the plot I generated is that the accuracy is generally increasing through 10 eigenfaces then levels off with small variations through the remaining iterations. Based on these results it would seem prudent to use 10 or more eigenfaces. There aren't any benefits that I can see to using more so for the sake of computational time it would make sense to use between 10-15 eigenfaces.

Question 2:
A noticable trend in matching was that a few of the smiling pictures were never matched meaning that the same 22-24 faces were always matching while the remaining ~10 were being problematic. Instances of these faces include smiling 4, 12 and 24 among others. neutral 4 didn't come up on 4's recognition ranking, neutral 12 came up 2nd on 12's recognition ranking and neutral 24 came up 3rd on 24's recognition ranking. 4 does have a pretty crazy face.

Sample Results

..\Release\main --eigenfaces 10 30 30 nonsmilinglist.txt eigennonsmiling.out


Never able to match these:

for /L %%B in (1, 2, 33) do (singleit %%B) > output.txt
singleit.bat:
..\Release\main --eigenfaces %1 25 25 nonsmilinglist.txt eigennonsmiling.out
..\Release\main --constructuserbase eigennonsmiling.out nonsmilinglist.txt nosmile.user
for %%A in (smiling_cropped/*.tga) do (..\Release\main --recognizeface smiling_cropped/%%A nosmile.user eigennonsmiling.out 1)

Experiment: Find Faces

Methodology

This experiment mainly made use of the --findface method described above. The first step involved it finding the top face in elf.tga and cropping that face from the image. The second step was the same thing except with an image I ran my testing on extensively that had some good results while I was testing.

Questions

Question 1:
Elf: .45 .55 .01
Test: 0.5 0.65 0.03

Question 2:
Other results (not shown) all have tons of false positives and corresponding false negatives. The best of that I'm showing here has only one false positive which seems to be centered on the middle guy's throat. My algorithm seems to really dislike the left guy's face giving it an mse of around 12000 while the other two guys' faces are recieving mse's of around 400. It could be because of the glasses or the bald head, I don't know.

Sample Results

..\Release\main --findface misc\elf.tga eigennonsmiling.out .45 .55 .01 crop 1 misc\elf_crop.tga

An obvious fail on the part of my program. Really my find faces doesn't work very well.

..\Release\main --findface misc\test_image.tga eigenall.out 0.5 0.65 0.03 mark 3 misc\test_output.tga

This is the image I tested with the most extensively. As you can see it finds 2 of the three faces and the top face is the guy in the middle. After working on this function for about 5 hours I gave up with 2/3 faces. It was never able to find the guy with glasses' face ever.

Experiment: Verify Faces

Methodology

I wrote three scripts for this experiment. The first was a brute force listing of every verifyface command. One of the smiling face against the same person's neutral face and another for that person against the next person by file name number. The second was an iterative script that ran this for several thresholds and output the results to seperate files. The last was a parsing script which counted the false negatives and false positives in each file.

Questions

Question 1:
I tried MSE thresholds 10000 through 120000. It looks like 100000 totalled the least total errors in predicitons. In order to search the space of possible MSE thresholds I just iterated by increments of 10000. Once I found the sweet spot I itereated by 2000. The graphs below show the results.

Question 2: The best MSE threshold I found was 100000 which gave a false negative rate of .151 and a false positive rate of .121.

The result obtained occured because of the alignment of the star crystals in the Charleston St. Orrery. We expected that the snow would be orange because of the velociraptor principle, however we did not expect that it would speak German. This can be explained by the use of imported Ketchup rather than home-brew, because the imported variety has higher trace levels of palladium.

Sample Results