CSE 455 Project 4: Eigenfaces

Hye In Kim

CSE 455: Computer Vision

Project 4 Artifact

Original Image - NonSmiling

Original Image - Smiling

Five Sample Reconstructions

Original :

Reconstruction :

Testing Recognition with Cropped Class Images

1. Average Face & 10 Eigenfaces

25 X 25 :

2. Number of Eigenfaces Vs. Number of face (cropped, smiling) recognized

3. Recognition Errors (When 10 EigenFaces are used)

Face 2 matched Face 3
Face 12 matched Face 20
Face 17 matched Face 19
Face 20 matched Face 27
Face 22 matched Face 7
Face 24 matched Face 18
Face #2

0: faceImages\nonsmiling_cropped\neutral-3; MSE: 25886
1: faceImages\nonsmiling_cropped\neutral-29; MSE: 29658.3
2: faceImages\nonsmiling_cropped\neutral-2; MSE: 31921.6
3: faceImages\nonsmiling_cropped\neutral-33; MSE: 51778.2
4: faceImages\nonsmiling_cropped\neutral-15; MSE: 92489.1
Face #12

0: faceImages\nonsmiling_cropped\neutral-20; MSE: 27944.4
1: faceImages\nonsmiling_cropped\neutral-12; MSE: 30693.8
2: faceImages\nonsmiling_cropped\neutral-27; MSE: 44112.5
3: faceImages\nonsmiling_cropped\neutral-28; MSE: 57364.3
4: faceImages\nonsmiling_cropped\neutral-11; MSE: 66429.7
Face #17

0: faceImages\nonsmiling_cropped\neutral-19; MSE: 51065.2
1: faceImages\nonsmiling_cropped\neutral-13; MSE: 69246.4
2: faceImages\nonsmiling_cropped\neutral-17; MSE: 73679.1
3: faceImages\nonsmiling_cropped\neutral-18; MSE: 81548.3
4: faceImages\nonsmiling_cropped\neutral-25; MSE: 92945.1
Face #20

0: faceImages\nonsmiling_cropped\neutral-27; MSE: 15854.6
1: faceImages\nonsmiling_cropped\neutral-20; MSE: 36855.1
2: faceImages\nonsmiling_cropped\neutral-24; MSE: 55616
3: faceImages\nonsmiling_cropped\neutral-12; MSE: 70283.4
4: faceImages\nonsmiling_cropped\neutral-26; MSE: 70803.1
Face #22

0: faceImages\nonsmiling_cropped\neutral-7; MSE: 25046.8
1: faceImages\nonsmiling_cropped\neutral-16; MSE: 37833
2: faceImages\nonsmiling_cropped\neutral-22; MSE: 45431.6
3: faceImages\nonsmiling_cropped\neutral-1; MSE: 62324.9
4: faceImages\nonsmiling_cropped\neutral-4; MSE: 85496.9
Face #24

0: faceImages\nonsmiling_cropped\neutral-18; MSE: 42018.8
1: faceImages\nonsmiling_cropped\neutral-24; MSE: 56704.8
2: faceImages\nonsmiling_cropped\neutral-27; MSE: 83993.4
3: faceImages\nonsmiling_cropped\neutral-26; MSE: 94747.8
4: faceImages\nonsmiling_cropped\neutral-11; MSE: 101860

4. Questions

a. Describe the method & plot

To generate "Number of EigenFaces vs. Number of matches" plot above, I compared 33 smiling faces with its corresponding neutral face in the userbase (smiling 1 comapred to neutral 1 etc., so that there are 33 comprisons per eigenFace) and counted the number of recognized faces. I repeated it with 33 times, varying the number of eigenfaces used from 1 to 33.
When # EigneFace < 5, The number of face recognized increases rapidly as the number of eigenface used increases.
When 5 < # EigneFace < 8, The graph starts to flattens out.
When # EigneFace > 8, There are some variations, but in general the number of face recognized doesn't change much as the number of eigenface used increases.

b. How many eigenfaces should one use? Is there a clear answer?

Based on the plot above, it seems like using 8 - 10 eigenfaces would be good, because using more than 10 eigenfaces doesn't seem to incease accuracy. It isn't really a clear answer, but is a rough estimate. In general, it is better to use only Eigenvectors (Eigenfaces) that has large eigenvalues, because the eigenFaces with small eigenvalues doesn't really help much. When I looked at the eigenfaces in lower rank (say 30th eigenface), it didn't even look like a face, and especially the last eigenface was totally garbage. So in the above experiment, probably only 8 or 10 eigenvectors had eigenvalues large enough to be significant. And since adding more eigenvectors with very small eigenvalue doesn't help much, number of recognized faces doesn't really change as number of eigenfaces increases when more than 8 or so eigenfaces are used.

c. Show images of recognition errors. How reasonable were the mistakes? Did the correct answer at least appear highly in the sorted results?

Six sample recognition errors (when 10 Eigenfaces are used) are shown above.
I think the mistakes are fairly reasonable. For Face #2 & Face #3: Eyes and eyebrows are alike and both have very light skin color.
For Face #12 & Face #20: The positions of eyes, nose and mouth are very similar.
For Face #17 & Face #19: Both are wearing glasses and position and size of eyes, nose and mouth are alike.
For Face #20 & Face #27: The general layout of the face are similar.
For Face #22 & Face #7: The area aroud the nose and sizo of mouth are similar.
For Face #24 & Face #18: They are both wearing glasses that have fairly thick border.
For all six errors shown above, the correct answer appears highly in the sorted results (either in second or third place). The correct answers are highlighted in orange in the sample result above.

5. Links to Script & Resulting Output Files Used to Generate Results

Output Data Files

Raw Data
Processed Data
Final Result Summary
Script and Parser Files

Script File (FindFace.bat)
Parser File1 (FindFace_Parser.java)
Parser File2 (IntPair.java)

Cropping and Finding Faces

1. Finding and cropping one face

main --findface faceImages\group\elf.tga faces\eig_10.face .45 .55 .01 crop 1 elf_crop.tga
main --findface faceImages\myFace.tga faces\eig_10.face .05 .2 .01 crop 1 myFace_crop.tga

2. Finding multiple faces

main --findface "faceImages\group\group_neutral (2).tga" faces\eig_10.face .6 .9 .05 mark 3 group_out.tga
main --findface faceImages\group\massGroup2.tga faces\eig_10.face .70 .90 .01 mark 35 massGroup_out.tga

3. Questions

a. What min_scale, max_scale, and scale step did you use for each image?

From the top to bottom, imageName(min_scale, max_scale, scale_step):
elf.JPG(.45 .55 .01), myFace.JPG(.05 .2 .01), group.JPG(.6 .9 .05), massGroup.JPG(.70 .90 .01)

b. Did your attempt to find faces result in any false positives and/or false negatives? Discuss why you think they occurred.

Yes. In the massGroup.JPG (The last picture above), there are many false positives and false negatives.
The 3 false positives on the girl with bluish-purple sweater, 1 false positive on the guy with bright yellow shirt (in the back) and 3 false positives on the forehead of the 3 people in the front have a strong horizontal line which can be mistakenly indentified as eyes or eyebrows.
The false positive on the arm of the guy with light yellow shirt (in the front) and the false positive on the arm of the guy with gray shirt have a strong vertical line which can be mistakenly identified as a nose.
I cannot think of any convincing explanation about why the other false positives occured. Some of them are on the empty spaces, so maybe it is just due to the limit of the algorithm or has to do with the way I implemented the algorithm.
Most of the false negatives are at the back of the picture. Some people has only the part of their face exposed, which is probably the reason why their faces are not detected. However, there are at least 5 people whose faces are fully exposed and didn't get detected. To me they all have very obvious faces, so maybe experimenting more with parameters or drawing more boxes will help finding them.
Overall, I think the result is pretty good. Even though there are false positives and false negatives, most of the faces are correctly detected, and there were no false positives or false negatives in the pictures other than massGroup.JPG.




Verify Face

1. Average Face & 6 Eigenfaces

25 X 25 :

2. Plot of Threshold Vs. Face recognized

3. Questions

a. What MSE thresholds did you try? Which one worked best?

I tried 10 MSE Thresholds, starting from 10000 and incrementing by 10000 until it reached 100000.
Of course, as the threshold increases, the number of faced recognized increases. The result is shown in the plot "Threshold vs. Number of faces recognized" above.
Howerver, the threshold that recognizes the most face is not necessarily the best threshold. The best threshold it the one that detects the most face with minimum false positive and false negative rates.
Based on the plots above, I think threshold around 40000 is the best.

b. What search method did you use to find it?

To generate the "Threshold vs. Number of faces recognized" plot, I compared 33 smiling faces with its corresponding neutral face in the userbase (smiling 1 comapred to neutral 1 etc., so that there are 33 comprisons per threshold) and counted the number of recognized faces. I repeated it with 10 different thresholds explained in the above question (part a), and plotted them. The number of faces not recognized here are false negatives.
To generate the "Threshold vs. Number of false-positives and false-negatives" plot, I compared each of the 33 smiling faces with 32 neutral faces in the userbase (compared with everybody else except themselves, so that there are 33x33-33 = 1056 comparisons per threshold), and counted the number of recognized faces. I repeated it with 10 different thresholds explained in the above question (part a). Number of recognized faces here are the false positives. Then, I plotted number of recognized faces (false positives) and previously computed false negatives against the threshold.

c. Using the best MSE threshold, what was the false negative rate? What was the false positive rate?

Using the best threshold of 40000,
False Negative Rate = 18 / 33 = 0.54545454545... = 0.55
False Positive Rate = 20 / 1056 = 0.018939393... = 0.0189

4. Links to Script & Resulting Output Files Used to Generate Results

Output Data Files

Raw Data - False Negatives
Raw Data - False Positives
Final Result Summary (False Negatives)
Final Result Summary (FalsePositives)
Script and Parser Files

Script File (VerifyFace.bat)
Parser File (VerifyFace_Parser.java)
W3C XHTML 1.1 W3C CSS