Eigenface Tutorial
Keywords: Matlab, Face Recognition, Eigenfaces, Computer vision
This picture represents the set of images used to create our eigen space for face recognition. The goal of this tutorial is to apply the eigenface approach to recognize someone's face. The overall problem is to be able to accurately recognize a person's identity and take some action based on the outcome of the recognition process. Recognize a person's identity is important mainly for security reason, but it could also be used to obtain quick access to medical, criminal, or any type of records. Solving this problem is important because it could allow personnel to take preventive action action, provide better service - in the case of a doctors appointment, or allow a person access to a secure area. This tutorial will shows you how to build a face recognition program using Matlab.
Motivation and Audience
This tutorial has been developed to get people interest on computer vision and face recognition; in addition to give you some guidance on how to approach the problem. The reader should have the following background and interests:
- Moderate Matlab knowledge
- Being familiar with Linear Algebra concepts
- Desire to learn about face recognition using Matlab
- In addition, would like to learn more about computer vision
The rest of the tutorial is presented as follows:
Parts List and Sources
US-based vendors to obtain material to complete this tutorial include
MathworksTo complete this tutorial, you'll need the following items
Software VENDOR Version PRICE QTY Matlab Mathworks 6.1 $500 1 Construction
This section gives step-by-step instructions along with photos and formulas on how to recognize faces and implemented into Matlab. All the necessary files to complete this tutorial would beprovided.
Steps
The first step is to obtain a set S with M face images. In our example M = 25 as shown at the beginning of the tutorial. Each image is transformed into a vector of size N and placed into the set.
After you have obtained your set, you will obtain the mean image Ψ
Then you will find the difference Φ between the input image and the mean image
Next we seek a set of M orthonormal vectors, un, which best describes the distribution of the data. The kth vector, uk, is chosen such that
is a maximum, subject to
Note: uk and λk are the eigenvectors and eigenvalues of the covariance matrix C
We obtain the covariance matrix C in the following manner
AT
Once we have found the eigenvectors, vl, ul
These are the eigenfaces of our set of original images
Recognition Procedure
1. A new face is transformed into its eigenface components. First we compare our input image with our mean image and multiply their difference with each eigenvector of the L matrix. Each value would represent a weight and would be saved on a vector Ω.
2. We now determine which face class provides the best description for the input image. This is done by minimizing the Euclidean distance
3. The input face is consider to belong to a class if εk is bellow an established threshold θε. Then the face image is considered to be a known face. If the difference is above the given threshold, but bellow a second threshold, the image can be determined as a unknown face. If the input image is above these two thresholds, the image is determined NOT to be a face.
4. If the image is found to be an unknown face, you could decide whether or not you want to add the image to your training set for future recognitions. You would have to repeat steps 1 trough 7 to incorporate this new face image.
The source code face recognition using Matlab is provided below: