Compute Weight Matrix
Now that we have the eigenfaces, we could proceed to projecting the training images onto the face space. The K-dimension face space is spanned with the top K eigenfaces. An interesting thing to note here is that each axis of the face space is weighted with respect to the eigenvalue associated with it. So the first few axes will contain more weight than the later axes.
To project the mean-subtracted training images Vi’s onto the face space, we first take each image and compute its weight wi on each of the axis by taking the dot product between the image and an eigenface. This process is repeated for each eigenface with each training image. The resulting weights are put into a weight matrix WM with a dimension of K x W.
![]() |
Compute Threshold Values
When given a test image (red dot), it is first projected onto the face space using the same method as before and then categorized using some threshold values. By testing these and graphing the minimum distance between each test image and the closest image in the training set, we were able to experimentally come up with the thresholds. The following graph shows the result of a particular run on the HFH dataset.
![]() |
This graph shows the minimum distance between each test image and the closest image in the training set. Images 0-91 represent faces in the training set, images 92-160 are faces not in the training set, and images 161-225 are images that are not faces. Because the training set is randomly selected from our databases, the thresholds vary each time the code is run. The thresholds are dynamic values that change with respect to the furthest distance d between any two training images. However, a trend emerged after looking at the data, and we determined that the thresholds were to be set at 10% (0.1d) and 20%(0.2d) of the maximum distance between two faces in the training set for determining if it was a match and whether or not the image was a face at all, respectively. These thresholds are used when determining the success or failure of recognition for both the JAFFE and Rice University datasets.
As the figure shows, in this particular run, our algorithm successfully identified all faces in the training set as known faces. Similarly, all but one of the unknown faces fell within the correct threshold. However, our algorithm had some trouble identifying images that were not faces: about ¼ of them were identified as unknown faces. We think this occurred because some non-face images had the same round shape as a face (fruit, for example), or had features (animals). Despite this weakness, our algorithm was successful overall.





Next: Results


