Project 3 - Eigenfaces

1 — Recognition

Average And 10 Eigenfaces X3
Average face (top); From left to right, the 10 computed eigenfaces in decreasing order of respective eigen values. All images were 25 x 25 pixels but are shown at 3x resolution here.

1 — The spike in number of correct matches at 7 eigenfaces strikes me as a bit odd, as otherwise this graph is monotonically increasing. Even if this spike is a programming error, the fact that 9, 11, and 13 level back down to 10 out of 21 correct matches makes 7 eigenfaces with 11 correct matches seem like a good compromise. Given a different set of images to train from, it would be interesting to see how these trends would compare. Eventually higher accuracy is achieved at 15 eigenfaces and to a lesser extent at 19 eigenfaces, but these seem to be at the point of diminishing returns. Although it is not clear cut, the sharp rate of increasing accuracy seems to fall off past 7 eigenfaces.

Plot
Plot of how many of the cropped smiling faces were matched to the correct cropped non-smiling face in relation to the number of eigenfaces used. A score of 21 faces would have been a perfect score.

2 — With 21 eigenfaces, and an accuracy rate of 61.9%, 14.2% of the wrong matches had the right match as the 2nd best guess. With 11 eigenfaces, and an accuracy rate of 47.6%, 19% of the wrong matches had the right match as the 2nd best guess and 23.8% in the 2nd or 3rd positions.

IncorrectMatch 02
The image on the left (smiling) was incorrectly matched to the image in the center, rather than the correct choice on the right (this had the second lowest mean squared error).

The correct match on the right was the second best match. I'd conjecture that the tighter crop just above the eyebrows of the non-smiling image led to a higher mean squared error through much of the image, allowing 06.tga to surpass the correct 02.tga answer.

IncorrectMatch 11
The image on the left (smiling) was incorrectly matched to the image in the center, rather than the correct choice on the right (this had the second lowest mean squared error).

As in the earlier example, cropping likely plays a larger role in raising the MSE for the correct non-smiling photo (11.tga). The different aspect ratio led to most of the chin in the non-smiling correct image to be lost. This would likely propagate errors even for the parts of the face that were present in both images but which had different x, y coordinates for these features.

2 — Cropping and finding faces

At the time of this submission, my find face algorithm is working accurately on the test image below, but I did not have time to run any of the other tests. I have commented the code well in the hopes that it will apparent how I was attempting to address the scale, intersecting tests for overlapping previous faces, cropping of images, etc. I was definitely running into problems before implementing the suggested low-texture avoidance measure (e.g. getting only 1 out of 3 faces). After multiplying by the distance to the average face and dividing by the mean this jumped up to 3 out of 3 faces.

P10result 3finds
../code/main --findface group/smiling/00010.tga nosmile-eig10.face .45 .55 .01 mark 3 p10result.tga

-Rich MacDonald