Identify the person (Face recognition) by PCA (eigenface) – Matlab code on ORL database

Identify the person (Face Recognition) is a field of research in Computer Vision, and is also seen as a field research in Biometrics (similar to fingerprint recognition – Fingerprint recognition or iris recognition – Iris recognition). In terms of general principles that recognize the great similarity with fingerprint and iris recognition, but the difference lies in the selection of specific deduction step (feature extraction) of each area. While fingerprint and iris have reached maturity, that is applicable in practice is widely recognized as the person still remains a challenging and interesting research field with many people. Compared with fingerprint and iris, facial recognition richer data source (you can see the people in any photographs, video clips related to any human being on the network) and requires less interactive control over (to perform fingerprint or iris, input data from the human collaboration required in a controlled environment). Currently the face recognition method is divided into different directions according to different criteria: identification with the input data is static 2D images (still image based FR) is the most popular, but the future will probably be 3D FR (because the arrangement of multiple cameras 2D and 3D data will give better results, more reliable), can also be divided into two directions: to the image data and video data.

The phase in a face recognition system: to build a face recognition system, also not easy, the first step to do is face detection, ie detection of image in input data (image database , video …) and removed the image to make the identification (face Cropping), the second step is image pre-processing (preprocessing) includes the steps to align image (face image alignment) and standardized light (illumination normalization) (here I am talking about the image straight angles – frontal face image), followed by selected characteristics deduction step (feature extraction), in this step, select a method of deduction for certain characteristics (binary form Local – Local Gabor Binary Pattern or wavelets, Gradient …) will be used to image surface to extract specific information for the image, the result is that each image is represented as a vector, the next step is step identification (recognition) or classification (classification), ie identity (identity) or label (label) of the image – the image of one. In the classification step, often the method k-nearest neighbor (k-Nearest neighbor: knn) will be used, the fact that the use of SVM (Support Vector Machine) does not bring greater efficiency, but also slower . Data for a face recognition system is divided into three files: the training set (training set), the reference set (reference set) and set to identify (probe set). In many systems, training coincides with the set reference file. Training set of images used for training (or learning-learning), usually this file is used to generate a subspace (sub projection space) is a matrix and commonly used method is PCA (Principal Component Analysis), WPCA (Whitened PCA), LDA (Linear Discriminant Analysis), KPCA (Kernel PCA). Reference file of the image projected identity (projected) into the space in the training step. Step training to two goals: reduce the number of dimensions (dimension reduction) of the feature vector (feature vector) for the vector lengths are usually quite large (several thousand to several hundred thousand) so if you leave, then the calculation will very very long, the second is to increase the distinction between the different image layers (different identifiers), in addition can reduce the distinction between the image belongs to a class (depending on method). After making reference to the episode subspace, the system saves the result is a matrix with each column of the matrix corresponding to a vector image (identity known) to make identification (or classification ). Identification (or classification) is done with a set of probe images, after preprocessing is complete, each image will be applied to extract selected method characteristics (such as with the reference image and the training set) and was shown to subspace. Next, the classification will be based on k-NN method, the format of an image is assigned to determine the identity of the image distance (distance) close to it most. It should be noted that each image is a vector should be able to use the concept of distance between two vector functions to measure the difference between images.

The challenge for face recognition: Currently the following is considered a major challenge (not a good method) for face recognition:

+ Problem orientation (pose), the resulting image with the direction of change (not the area) is still quite modest, perhaps 3D is one possible approach.

+ Problem with low-resolution images (low resolution) images obtained from the surveillance camera (surveillance cameras) are often the size and quality is very low, the results of research in this field was not much.

+ Working with video data: the development of the means of multimedia, the information of the video data is extremely high, but most of the identification method is to work with still images extracted from video data, there is no good method to take advantage of all the advantages of video data.

+ Very large systems (very large scale systems): the database (DB) on the test image by the researchers is relatively small (few hundred to tens of thousands of face images), but in fact the can be very large databases, for example database of face images of a country policeman …

+ Aging condition: the photography of the identified changes in real time remains a major problem even for the possibility of human identity.

The study of face recognition: since there are many steps and the challenges it can choose an aspect to proceed in one step, such as research on illumination normalization only, or only with low resolution images, receive emotional form of the face, or even more specifically, only the face image alignment … However, most researchers have focused on feature extraction step, ie find a way to extract effective features selected for identification.

Database for face recognition: the first thing needed when the research is to identify a face image databases and the way (protocol) to perform tests on the database, because there must be compared with the results there are other databases on it. ORL is a small database and the old AT & T, but quite suitable for beginners. It includes 400 images of 40 people, each person has 10 images with the expression (facial expression) and the circumstance of the user, different light. The other database is to test: FERET, FRGC v2.0, SCFace, LFW, AR. In this database, images were prepared surface, ie we do not need to perform the face detection, just based on the information provided to make the cut needed for image recognition

In this article, I just talk about PCA for face recognition method Eigen face, will not take steps to standardize the light and extract selected features. Database used is illustrated ORL, training coincides with the set reference file and each class (each) with n = 1,2,3,4 or 5 images, the rest (10-n for each class) will be used for the probe set.

Methods for identification PCA (eigenface): Each image size WxH will be converted into a column vector of length W * H (for both training and probe set) (the vector Xi). In step training, an average vector of all training images are calculated (vector M), then each vector of collective training will be mean-subtracted: Xi = Xi-M, the covariance matrix is calculated by C = A ‘* A, where A’ is the matrix transpose of A and A = [X1, X2, … xk] is the matrix with columns is the vector Xi. A will has size (W * H) xk where k is the number of image files training, Am will also matrix of size kxk, by W * H k larger lots so that the calculation of the eigenvector (eigenvectors) and corresponding eigenvalues (eigenvalues) of C is easy. We will find k eigenvalues corresponding k eigenvector of C. The particular vector are arranged in descending order of corresponding eigenvalues, the use of all of the eigenvector is not required, only N (N capitalization offline) the first component corresponds to the vector N own use (the method of so called main component analysis). This particular vector N will form a matrix of size (W * H) xn matrix of the receiving space (we call this matrix Cp). Next set of training images will be released on subspace by multiplication: Ap = Cp ‘* A similar set of probe images will be released on subspace by multiplication: Bp = Cp’ * B. Ap and Bp will NxNoTrain size respectively (NoTrain is the training images) and NxNoTest (file photo NoTest probe number), that is, each corresponding image is represented by a column vector. In the classification step, with each image of the probe set, we find images of the training set close to it most. At this distance functions: Euclidean, mahalanobis, cosine angle distance can be used.

Indeed, in the original PCA method matrix C = A * A ‘, and has size (W * H) x (W * H), ie a matrix of very, very large, Mathew A. Turk and Alex P. Pentland (author of the eigenface method) used a procedure is to replace C = A ‘* A separate vector to the search for easier and still be effective.

Finding the eigenvector of the covariance matrix C has two ways: using Eigen decomposition method (the matlab eig function) or singular value decomposition-SVD (svd of matlab function), however svd seems faster and produce results better than eig.

Why matlab? Since matlab fast and suitable for the study and testing. Remember that PCA or a method that you think may not be the best, so do not use C / C + + / C # or a programming language application is installed, you will see rates nor much faster rate, so do take time and make your algorithm has worked well enough to invest effort in programming, with a face recognition system that can run on a consistent practice many other steps, here you are new to the frontal image of a database was available, so do not freak out more.

Finally, if you want to discuss article content or get the source code of the PCA (Eigen face), go to email back through the comment section of this article, I will send it back to you via email.


One thought on “Identify the person (Face recognition) by PCA (eigenface) – Matlab code on ORL database

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s