Eigenfaces

Project 4 CSEP 576

Shahid Razzaq

 

 

Eigenfaces:

Average Face:  

Eigenfaces:       

The above eigenfaces are from the serious (non smiling) faces.  These were used to recognize the smiling counterpart faces and here is the results:

The accuracy curve stabalises at about 62.5% (20/32).

Questions:

The trend is that the recognition accuracy is plateau-ing out at some point in the number of eigenfaces used, meaning that there isn't much information we are getting from the additional eigenvectors we are adding.  One can try to increase the number of loops that the eigenvector generator function goes through to find the eigenvectors.  This would increase the execution time of the face recognition and may or may not be desireable.  I think we should use enough eigenfaces to capture the peculiarities in peoples faces.  Most of the small difference can be handled by the first three eigenfaces, but what come afterward should uniquely identify certain trend in faces, e.g say moustache, beard.  How many of these will be required will depend on the variation of the faces. 

Here are a few errors in the face recognition alongwith the order by which they were missed..  The outputs for these images are below:

  How reasonable were the mistakes?  Did the correct answer at least appear highly in the sorted results?

The first one i think is pretty reasonable, inface i think the program was very smart as to classify people from the same origin into one group :)  The skin color here is pretty similar and the 1st recognized face also has glasses, whose glare in different circumstances can affect the recognition, as compared to other parts of the face which don't respond a great deal in slightly different face orientations.

    Actual Face                      Face Recognized 1       Recognized Face 2

                               

Face 'smiling_cropped/s07.tga' recognized as being closest too:
0: nonsmiling_cropped/19; MSE: 41605.6
1: nonsmiling_cropped/15; MSE: 55600.4
2: nonsmiling_cropped/07; MSE: 109092
3: nonsmiling_cropped/18; MSE: 111436
4: nonsmiling_cropped/12; MSE: 117170

The second one i think is also allright as one can be fooled into believing that they are the same person ... only on closer analysis of features you can tell for sure that they are different.

    Actual Face                      Face Recognized

                       

Face 'smiling_cropped/s14.tga' recognized as being closest too:
0: nonsmiling_cropped/13; MSE: 21930.5
1: nonsmiling_cropped/14; MSE: 22334.6
2: nonsmiling_cropped/28; MSE: 26824.9
3: nonsmiling_cropped/09; MSE: 34670.3
4: nonsmiling_cropped/11; MSE: 53782.8

 

Extra Credits:

-  Extreme Gausian:
           
I used this to remove non-faces from the potential candidates of faces.  It is basically a filter with only positive value assigned to the center of the face (since i used the center pixel of the candidate faces to store of a liklihood value), and negative values at the rest of the positions (neighbors, and neighbors neighbors).  So in a way it is an extremely steep gausian with only one huge positive value and other smaller -ive values.  This does the job of removing not only the low textured areas, but also any confusion that can be caused by edges in the image.  My face candidates have a round region, approximately the size of the nose, that have the heighest possibility of being a face.  This is what i mean by the white region around the nose:

 

(picture here)

-  Verify Face:
           
Implement the verify face function for extra credit. This was pretty simple and straight forward.  I guess there isn't much to explain here.

 

Group Photo:

I thought this was a challenging picture.  For a few reasons, one that the face scales are different, secondly the faces are not totally vertical and lastly because my fathers mustache was not accounted for in the training data.

First the initial face:

Now the big achievement! :) .....  the output:

And the intermediate image generated showing the face centers:

NOTE:  The whiter the pixel, the greater the liklihood that it is the center of the face.

I experiment with the scale settings and got the above ressults with:

main --findface family.tga eig10.face 0.30 0.48 0.01 mark 6 cropped_sample.tga


99     286     1.19895e+006      0.37
160   149     1.12755e+006      0.48
95     210     910729                 0.46
118   77       898356                 0.48
91     129     857191                 0.48
172   209     688156                 0.43

The first column is the pixel position along y axis, next is along x-axis, the bigger figure after that is the value of the white pixels (the image above is normalized to 0-255, but before that the values are high).  And last is the scale at which that particular face was found.

 

Portrait:

A couple of pictures of mine with results:

         

        

 

Test Sample:

The program correctly found the faces in the sample images:

The the intermediate image used to get the face centers ....

I thought it was funny that the picture brought out the dog in everyone :p

 

main --findface IMG_8270.tga eig10.face 0.30 0.60 0.01 mark 4 cropped_IMG_8270.tga

280     313     1.15695e+006  0.51
234     169     937624             0.52
167     609     773303             0.53
199     453     751309             0.49

 

Bush Cropped:        

       

(using .25, .55, .01)

Others:

Gave the elf picture a try and got these results:

 

main --findface elf.tga eig10.face 0.25 0.55 0.02 mark 2 cropped_elf.tga

121     192     499022     0.41
110     94      444407     0.39