| |
|
Seeing With OpenCV, Part 4: Face Recognition With Eigenface
(Continued)
|
|
|
|
This article originally appeared in
SERVO Magazine, April 2007.
Reprinted by permission of T & L Publications, Inc.
|
| |
Computing Distances Between Faces
In eigenface, the distance between two face images is the Euclidean distance between their projected points in a PCA subspace, rather than the distance in the original 2,500 dimensional image space. Computing the distance between faces in this lower dimensional subspace is the technique that eigenface uses to improve the signal-to-noise ratio.
Many advanced face recognition techniques are extensions of this basic concept. The main difference between eigenface and these advanced techniques is the process for defining the subspace. Instead of using PCA, the subspace might be based on Independent Component Analysis (ICA) or on Linear Discriminant Analysis (LDA), and so on.
As mentioned in above, this basic idea - dimensionality reduction followed by distance calculation in a subspace - is widely used in computer vision work. It's also used in other branches of AI. In fact, it's one of the primary tools for managing complexity and for finding the patterns hidden within massive amounts of realworld data.
Picturing The Principal Components
In our definition of a line as a 1D subspace, we used both x and y coordinates to define m, its 2D slope. When m is a principal component for a set of points, it has another name. It's an eigenvector. As you no doubt guessed, this is the basis for the name "eigenface." Eigenvectors are a linear algebra concept. That concept is important to us here only as an alternative name for principal components.
For face recognition on 50x50 images, each eigenvector represents the slope of a line in a 2,500 dimensional space. As in the 2D case, we need all 2,500 dimensions to define the slope of each line. While it's impossible to visualize a line in that many dimensions, we can view the eigenvectors in a different way. We can convert their 2,500 dimensional "slope" to an image simply by placing each value in its corresponding pixel location. When we do that, we get facelike images called - guess what - eigenfaces!
Eigenfaces are interesting to look at, and give us some intuition about the principal components for our dataset. The lefthand side of Figure 3 shows face images for ten people. These face images are from the Yale Face Database B (References 4 and 5). It contains images of faces under a range of lighting conditions. I used seven images for each of these ten people to create a PCA subspace.
The righthand side of
Figure 3
shows the first six principal components of this dataset, displayed as eigenfaces. The eigenfaces often have a ghostly look, because they combine elements from several faces. The brightest and the darkest pixels in each eigenface mark the face regions that contributed most to that principal component.
|
|
|
|
Figure 3. Right: face images for ten people. Left: the first six principal components viewed as eigenfaces.
|
|
Limitations Of Eigenface
The principal components that PCA finds are the directions of greatest variation in the data. One of the assumptions in eigenface is that variability in the underlying images corresponds to differences between individual faces. This assumption is, unfortunately, not always valid.
Figure 4
shows faces from two individuals. Each individual's face is displayed under four different lighting conditions.
These images are also from the Yale Face Database B. In fact, they're face images for two of the ten people shown in
Figure 3.
Can you tell which one's which? Eigenface can't. When lighting is highly variable, eigenface often does no better than random guessing would.
|
|
|
|
Figure 4. Face images from two individuals. Each individual's face is displayed under four different lighting conditions. The variability due to lighting here is greater than the variability between individuals. Eigenface tends to confuse individuals when lighting effects are strong.
|
|
Other factors that may "stretch" image variability in directions that tend to blur identity in PCA space include changes in expression, camera angle, and head pose.
Figure 5
shows how data distributions affect eigenface's performance. The best case for eigenface is at the top of Figure 5. Here, images from two individuals are clumped into tight clusters that are well separated from one another. That's what you hope will happen. The middle panel in Figure 5 shows what you hope won't happen. In this panel, images for each individual contain a great deal of variability. So much so, that they've skewed the PCA subspace in a way that makes it impossible for eigenface to tell these two people apart. Their face images are projecting onto the same places in the PCA subspace.
In practice, you'll probably find that the data distributions for face images fall somewhere in between these extremes. The bottom panel in
Figure 5
shows a realistic distribution for eigenface.
Since the eigenvectors are determined only by data variability, you're limited in what you can do to control how eigenface behaves. However, you can take steps to limit, or to otherwise manage, environmental conditions that might confuse it. For example, placing the camera at face level will reduce variability in camera angle.
Lighting conditions, such as side lighting from windows, are harder for a mobile robot to control. But you might consider adding intelligence on top of face recognition to compensate for that. For example, if your robot knows roughly where it's located, and which direction it's facing, it can compare the current face image only to ones it's seen previously in a similar situation.
Even highly tuned commercial face recognition systems are subject to cases of mistaken identity. In fact, part of the challenge of incorporating face recognition into any robotics application is finding ways to accommodate these.
|
|
|
|
Figure 5. How data distributions affect recognition with eigenface. Top: best-case scenario - data points for each person form tight, well separated clusters. Middle: worst-case scenario - variability in the face images for each individual is greater than the variability between individuals. Bottom: a realistic scenario - reasonable separation, with some overlap.
|
|
Next...
Next month's article concludes this series by taking you step by step through a program that implements eigenface with OpenCV.
Be seeing you!
Pages:
1
2
3
|