Vaibhav Thukral
Computer Vision (CSE 455), Winter
2012
Project 4: Eigenfaces
Project
Abstract
Objectives
In this project, I applied the concepts of
dimensionality reduction using PCA and using a linear combination of eigenvectors
to accomplish face recognition.
Challenges
In my opinion, the most challenging part of
the project was to get a good quality face recognition system.
Implementation
I implemented the project using the eigenfaces idea as discussed in the lecture.
The project is structured as follows:
·
Faces::eigenFaces – This method uses PCA using the jacobian eigenvalue decomposition algorithm.
·
EigFaces::projectFace –
This method projects a face onto the face space to generate a vector of k
coefficients.
·
EigFaces::isFace – The
method decides whether an image is a face. It works by using projectFace to find the projection of the face and computes
the MSE between the projection and the original.
·
EigFaces::verifyFace – This
method decides whether a face is a given user’s.
·
EigFaces::recognizeFace –
This method picks the top N users that are closest matches to the face.
·
EigFaces::findFace – This
method searches an image and finds the first N best faces.
Experiment: Recognition
Methodology
I wrote scripts to build eigen faces with 2 different width x height values
(25 x 25 and 30 x 30) and for 1 – 33 eigenfaces as
mentioned in the requirements. These are the average and eigen faces generated if I use 10 eigen
faces and 25 x 25 pixels:-
Average:-
Eigen Faces:-
I also wrote a script to run –eigenFaces with 2 different. I wrote another script to
process the results. Here is the plot I generated in Excel:-
Questions
1.
Describe trends in plots. Discuss tradeoffs, how many eigenfaces should one use? Is there a clear answer?
Ans: The accuracy increases as the number of eigenfaces
increases, but levels out at some point. This is because more eigenfaces add very little variance and hence information.
A way to choose the number of eigenfaces is to choose
the ones where the eigenvalues are beyond a certain threshold. There isn’t a
clear answer to how many eigenfaces should be used.
If we use a test set, we can choose a minimum number of eigenfaces
which provide us an expected level of accuracy.
Adding more pixels
(move from 25x25 to 30x30) doesn’t improve the results significantly which was
a bit unexpected.
2. You likely saw some recognition errors in step 3; show images of a couple.
How unreasonable were the mistakes? Did the correct answer at least appear
highly in the sorted results?
Ans: The mistakes weren’t too unreasonable as you can see below. Also, with a
reasonable number of eigen
faces, the 2nd or 3rd best result was the expected result
in most cases.
Example 1: (10 eigen
faces, 30x30 pixels)
Query:
Expected:
Actual Top result:
Example 2: (11 eigen
faces, 30x30 pixels)
Query:
Expected:
Actual Top result:
Experiment: Find Faces
Methodology
I couldn’t find the elf.tga
image, so I went ahead and did a ‘crop’ on group_neutral
(1).tga image
Result:
I tried quite a few of my personal pictures,
but face detection didn’t work on my currently turned in binary. L So, I found another picture online and it worked.
Image:-
Result:-
I also went ahead and tried ‘mark’ on group_neutral (5).tga
Result:
I found a portrait online and ran face
detection on it.
Result:
Questions
1. What min_scale, max_scale
and scale_step did you use for each image?
Ans.
For group_neutral
(1).tga, I used min_scale =
0.70, max_scale = 0.85, step = 0.02
For group_neutral (5).tga, I used min_scale = 0.68, max_scale = 0.90, step = 0.01
For portrait, I used min_scale = 0.1, max_scale = 0.2, step = 0.01
For group pic, I used min_scale = 0.7, max_scale = 0.8, step = 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.
Ans. There were quite a
few mistakes made by the algorithm while trying to find faces. Most noticeably,
the errors were due to a plain solid white image resulting in false positives.
This is probably because it thinks it lies in the face space if all eigen faces are added with large
coefficients. It might be worthwhile to try to remove low texture areas to
prevent false matches. In the other case, please look at the portrait,
this appears to be caused due to a poor threshold used.
Experiment:
Verify Faces
Methodology
I created a script to compare two images given
an MSE and ran a script to process the results. Then, I calculated the ROC
curve by adjusting the thresholds for a range. This helped in being able to
make the right decision about the thresholds.
Questions
1. What MSE thresholds did you try?
Which one worked best? What search method did you use to find it?
Ans. I tried a range of
thresholds from 5,000 – 2,000,000. The best threshold is 80,000. This is
because we get a good true positive rate and an acceptable false positive rate
of 6.4%. The ROC curve is plotted as follows:-
2. Using the best MSE threshold, what was the false negative rate? What was
the false positive rate?
Ans. The best MSE
threshold is 80,000. The false positive rate here is 6.4%. The false negative
rate is 21.2%
Bells & Whistles
Morphing
I found morphing quite straight forward, so
went ahead and did it. It basically projects the source and destination faces
using projectFace into coefficients and then tweens
between the coefficients.
For example, for this source image:-
And this destination image:-
I created the following video:- project4_files\movie.mp4
To do this, I first generated 100 images,
out00.tga -> out99.tga and then combined it into a movie using ffmpeg –qScale 1 –r 20 –b 12800
out%02d.tga movie.mp4.