Face Recognition with Eigenfaces
by
Rajesh Hegde K, CSEP576, WI2005, University of Washington
10 eigenfaces of size 25x25 were constructed for the purpose of face detection. Here are the 10 eigen faces ( scaled x2 for the web page )
Here is the mean face( scaled x2 for the web page )
Experiment #1
After 9 eigen faces, the number of faces recognized remains at 20. So 9-10 would be a good number of eigen faces to use.
Using 10 eigen faces, I was able to recognize 20 out of the 32 faces. [ non smiling was used to generate eigen faces and smiling was ued for recognition ]
Here are some recognition errors.
recognized as
recognized as
recognized as
In terms of positions on the sorted user list, the pairs were less than 5 spots away.
Experiment # 2
Here is bush_george_w_portrait.tga cropped with min_scale,max_scale, step parameters of .25, .55, .01
Here is a picture of mine cropped using main --findface me.tga nosmile_eig10.face 0.20 0.40 0.02 crop 1 cropped_me.tga
Cropped to
Experiment # 3
Here are some other images with most faces detected with my program.
Most of these faces can be detected with scale = 0.5
But I used min=0.30, max=0.60 step=.05 to get better accuracy
Here is one other picture I used from the web
It detected 5 faces very well. two are slightly off while it could not detect one. This is mostly due to inadequate training images and angular orientation of the faces as well.
Extra Credits
1. Speed up
I implemented the speed up as mentioned in the whistle
We normally perform eigenanalysis on AAT. This, at W*H x W*H, can be very large. Instead, consider an eigenvector v and eigenvalue l of ATA:xi = face image i as a vector, of length W*H xmean = mean of all face images yi = xi - xmean for i = 1, ..., MA = [y_1 ... y_M] (dimension W*H x M)
ATA v = l vMultiplying both sides with A:AATA v = l A vThis implies that Av is an eigenvector of AAT, where v is an eigenvector of ATA.I had to modify sortEigenValues code to handle this reduced dimensions. The code in the skeleton was always doing it over vector_size
2. Verify Face experiment
This plot is for verifying each student from the smiling_cropped database against themselves using userbase computed from non_smiling database with 6 eigen faces. Click here for the output of the program.
Looking at the plot, threshold of about 190000.0 can verify all the faces. But our eigen faces was able to get 60% accuracy only. So for the subsequent experiments with verify face we'll use about 60% of 190000.0 = 115000.0
Then I verified each face in the 32 face set with every other face ( total 32x32 combinations ) with MSE set at 10000.0, 50000.0, 70000.0 and 115000.0 Here are the results
Here are the outputs
3. Morphing
Here is a morphing from
to
image sequence
Click here for QuickTime movie
These images are computed from the first image and by interpolating the new images along the line in the eigen space from the first image to the second at distances 0.1 to 2.5 in steps of 0.1
4. Image classification based on Skin color
I also used skin detection scheme to search only in areas where skin has been detected. This further enhances the speed by eliminating computations over those areas that fall below the skin threshold. The details of the scheme are described in the paper
In summary, I compute an integral image for each scale. in this image, every pixel (X,Y) has a value equal to the count of all the "SKIN" pixels seen over the rectangle ( 0, 0, X, Y ).
Using this we can obtain the number of skin pixels in any given sub-rectangle in the image very efficiently ( in constant time )
Here is a skin classification image for IMG_8270.tga at scale = 0.5
skin detection and integral image to classify the image
Here is another skin classification for image IMG_8271 at scale = 0.7
I was able to get more than 3 times speed improvements and better accuracy with skin classification.