Project 4: Eigenfaces for Recognition
Testing recognition with cropped class images:
1.     Use the cropped, non-smiling students (in class_nonsmiling_cropped) to compute 10 eigenfaces.
  Average face:
  Eigenfaces:
2.    Use the same set of images to compute a userbase.
Link to userbase
3.    Have the program recognize the cropped, smiling students. 
       Plot the number of faces correctly recognized versus the number of eigenfaces used (1 through 25 eigenfaces, a granularity of 2).
1.     Describe the trends you see in your plots.   Discuss the tradeoffs; how many eigenfaces should one use?  Is there a clear answer? 

The more eigenfaces that are used, the more faces that are correctly recognized.  Using a large number of eigenfaces can slow down the runtime of your program.  Using a small number of eigenfaces can result in inability to recognize faces in your image.  There is no clear answer to this problem, however, using the lowest number of eigenfaces that recognize around 50% of faces gives a reasonable compromise between runtime and facial recognition.
2.    You likely saw some recognition errors in step 3; show images of a couple.  How reasonable were the mistakes?  Did the correct answer at least appear highly in the sorted results?

The mistakes are caused by a number of factors such as lighting and face angle.  Based on these two images I think that the mistakes are reasonable - the eyebrows and cheeks look similar in the images although, in person, these two people don't look alike. 
The correct answers appeared within the top third of the sorted results.
Cropping and finding faces:

Link to face object
1.     Use the cropped, non-smiling students (in class_nonsmiling_cropped) to compute 6 eigenfaces.
  Eigenfaces:
2.    Use the same set of images to compute a userbase.
Link to userbase
1.     What min_scale, max_scale, and scale step did you use for each image? 

elf.tga: 0.45 0.55 0.01 (as requested )

chrissie_hynde.tga:  0.25 0.35 0.01

IMG_0003.tga:  0.45 0.55 0.01

IMG_0004.tga:  0.45 0.55 0.01

IMG_0002.tga: 1.00 1.50 0.01

pretenders.tga:  0.55 0.65 0.01


2.     Did your attempt to find faces result in any false positives and/or false negatives?  Discuss each mistake, and why you think they might have occurred.

elf.tga:  I should have worked on color perception so that the false positive had a much higher MSE.

chrissie_hynde.tga:  Her hair is partially covering her eyes which makes her face more difficult to recognize.  She is smiling and that may also make her face more difficult to recognize.  I also should have worked on color perception so that the false positive had a much higher MSE.

IMG_0002.tga:  The faces of the people on the far left in the blue shirts are partially covered and at an angle and so they are difficult to recognize.  Some of the other faces are also at an angle or lit in such a way that their features are not as well defined as those in the sample images.  Where the set of hands is selected, the hands are positioned in a round shape like that of a face.  Where the section of the table and papers is selected there are some variances in shape and color between the table, the paper, the inside of the coat sleeve and the side of the hand that would have been ignored had I worked on color perception so that the false positives had a much higher MSE.  This is also true for where the section of the table and arm in a purple shirt is selected.

pretenders.tga:  I should have worked on color perception so that the false positive had a much higher MSE that way the blue would not have been selected as part of the face on the far left and the black would not have been selected as part of the face in the middle (this face may also have been difficult to recognize as the hair is covering one of the eyes).  The face that has not been selected at all may be at an angle that was harder to recognize and instead the hand was selected possibly due to the way that the fingers are splayed and the shadow they create on the table.



Verify Face:


Link to face object
3.     Have the program verify the cropped, smiling student images in the smiling userbase. Test by verifying each student against his or her smiling face, as well as each student against a smiling face which is of someone else.

4.    Experiment with various thresholds to find the one that gives the fewest false positives and fewest false negatives

1.    What MSE thresholds did you try? Which one worked best? What search method did you use to find it?

I started at 10000.00 and worked my way up in 5000.0 increments until I reached a plateau of an even number of false positives and false negatives.  The best result I found was at 80000.0

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

The false negative rate was: 2
The false positive rate was: 2



Extra Credit:
Implemented speedup for calculating eigenvectors.
elf.tga
chrissie_hynde.tga
IMG_0003.tga
IMG_0004.tga
IMG_0002.tga
pretenders.tga