Research and Implementation of PCA Face Recognition Algorithm Based on Matlab

multidi-mensional space, because the linearly independent variables adopted by the algorithm make the algorithm obtain minimum new component error. After the PCA analysis, the difference between the face image and the original image is little [6], which can be used for the face recognition. This chapter researches the PCA principle and the application procedures of PCA algo- rithm in the face recognition, so as to provide theoretical basis for the implementation of face recognition algorithm in matlab software. Assume that x is m dimensional random vector of the environment, and the mean value of vector is 0, then ABSTRACT: This paper researches the theory of PCA (Principle Component Analysis) algorithm and the fea- ture extraction elements in the process of face recognition, summarizes application procedures of PCA algorithm in the process face recognition, and realizes the application of PCA algorithm in the process face recognition in the matlab software. The research content and realization results show that: PCA algorithm is a kind of algorithm which is very suitable for programming and realization of matlab software; the key factor to realize PCA algorithm is the selection of the number of feature vectors, which affects the recognition rate and training time of the space sample subset. The higher recognition rate indicates better results in the algorithm implementation; the shorter training time of the space sample subset indicates more excellent algorithm implementation. In the process of selection of the number of feature vectors, on one hand, there is a need to protect the recognition rate; on the other hand, there is a need to control training time of the space sample subset, in which the recognition rate is a rigid target. The shortest training time of the subset of samples is selected on the premise of meeting the recognition rate.


INTRODUCTION
The face recognition is widely used in visual surveillance of various departments in China, which is mainly used in the security system, identification of criminal field, proof identification and other important situations [1]. In the design of face recognition system, the design and implementation of face feature extraction algorithm are key techniques. This paper researches the face feature extraction based on PCA algorithm, and realization of matlab by the use of scientific design philosophy of algorithm.
Many people make efforts to research the face feature extraction algorithm in the face recognition system: Yinzhong Tian et al. (2010) discuss the principle and implementation of PCA face recognition algorithm, and indicates that such algorithm can reflect gray-level correlation of the face image on the whole [2]; Zhihong Zhao (2014) proposes a kind of dynamic optimization PCA face recognition algorithm. The experiment shows that this algorithm can be used to optimize key parameters of traditional PCA algorithm to a certain extent [3]. Based on previous studies, this paper designs application programs of PCA algorithm in the face recognition, and realizes such application in matlab. The research aims at providing theoretical basis for the optimization of face recognition algorithm and development of face recognition technology.

OVERVIEW OF FACE RECOGNITION SYS-TEM
The face recognition (FR) refers to the recognition or verification of one or more person's faces by the use of moving the image process and pattern recognition technology in the background of stationary sate or moving state [4]. FR mainly includes five links, that is, face detection, face representation, face authentication, facial expression analysis and physical analysis [5].
The technical process of a face automatic recognition system is shown in Figure 1. The feature extraction (FE) in Figure 1 is an object of the research.

PCA FACIAL IMAGE FEATURE EXTRAC-TION ALGORITHM
The PCA algorithm is a kind of algorithm for the analysis of multivariate statistical data, whose idea is to adopt less linearly independent variables to represent information of most time changes in the multidimensional space, because the linearly independent variables adopted by the algorithm make the algorithm obtain minimum new component error. After the PCA analysis, the difference between the face image and the original image is little [6], which can be used for the face recognition. This chapter researches the PCA principle and the application procedures of PCA algorithm in the face recognition, so as to provide theoretical basis for the implementation of face recognition algorithm in matlab software.

PCA PRINCIPLE
Assume that x is m dimensional random vector of the environment, and the mean value of vector is 0, then there is a relationship shown in Formula (1). Assume that w is m dimensional random vector on this basis, the projection of x on w is called as an inner product (y) of the vector x and the vector w. The Formula y is shown in Formula (2). The establishment of Formula (2) that needs to satisfy constraint conditions [7] is shown in Formula (3).
The main objective of PCA analysis is used to seek for a weight vector (w), so as to achieve the maximum mathematical expectation on 2 y which is shown in Formula (4). In accordance with the linear algebra theory, when the Formula (4) is the maximum, there is a need to meet the Formula (5), that is, to make the maximum expectation on 2 y (w) become a feature vector corresponding to the maximum feature value of the matrix .
The core content of PCA algorithm is to calculate the transformation direction to make the variance maximize. There is a first need to build an incidence matrix as Formula (6), and then we calculate an feature value of x C , rank these feature values according to size, and calculate the orthorhombic feature vector constitute corresponding to previous m feature values; finally, we project the original data on the feature vector w to obtain main feature data of the original image. In the using process of the practical field, it is difficult to obtain mathematical expectation on the original data. The Formula (7) is approximate to the incidence matrix.
in Formula (7) indicates the vector corresponding to all pixels of each original gray-level image. N indicates the number of original image: The above analysis shows that the PCA algorithm is used to calculate the feature value and feature vector of the covariance matrix. For the PCA algorithm of the orthogonalization decomposition, this paper adopts the Jacobian method [8]. Its calculation process is to first order that

APPLICATION PROCEDURES OF PCA AL-GORITHUM IN THE FACE RECOGNITION
The face features of people have a certain degree of similarity, but face which is very similar can be considered as the same face, that is a guiding ideology of face recognition. The face image of the same person has a closer distance in the same space, while the face image instead of the same person has a farther distance in the same space [9], so the face image recognition can be realized by the size of image similarity.
In the actual operation, there are a large number of pixel points in digital image of the face. If the comparison is directly given to each pixel point, the recognition efficiency will be greatly reduced [10]. This paper adopts K-L transformation to realize the face image by low-dimension subspace, so as to effectively increase the face information and the recognition efficiency. The flow of face recognition algorithm based on PCA algorithm is shown in Figure 2.
STEP1. First, matriculate the face image, and then partition the matrix obtained as column, and view the column vector as a training sample set of face image.
STEP2. Adopt K-L transformation to obtain the generated matrix [11].
STEP3. Adopt SVD theorem to obtain the feature value and the feature vector of the face image [12].
STEP4. Calculate the optimal projection matrix.
Finally, the feature face is used for the face image recognition. For all the samples to be recognized (f), the coefficient vector (y) can be calculated through the projection of the vector subspace (U). The calculation method is shown in Formula (13). y is the feature of the samples to be recognized (f). The recognition result can be obtained through comparison with the feature level of training sample ( i p ) and the samples to be recognized (f) according to the specified category partition criteria. If there is a need of face detection, the sample image formula (14) can be re-established. Considering the signal to noise ratio ( SN R ) of the image re-established, if the signal to noise ratio is less than a given threshold value [13], we can determine that f is not the face image.

MATLAB REALIZATION
The process of reading the image matrix can directly read data from the image file. The face recognition can be realized in matlab software by the use of PCA algorithm and the principle of K-L transformation and singular value decomposition. As shown in Figure 4, each person has three images with three kinds of facial expression, and there are 12 images in total. Each original image has 256 gray levels, and the resolution ratio is 112 u 92.
From the aspect of obtaining typical recognition rate, this paper selects two images from three images of each person as training samples, and the rest image is used as a test with a total of three kinds of selection method. There is a need to record the recognition rate for each test set in detail. The final recognition rate is a mean value of three times of test results. As shown in Table 1, it is the file name of each person selected in each training set.  Figure 5. Figure 6 shows the impact of the number of feature vector (k) on the recognition rate and training time. As shown in Figure 6, to select 60 feature vectors, the recognition rate has a slow increase but the training time is still increased with a faster speed. The capacity of 60 feature vectors accounts for about 95% of the whole capacity. The experiment result shows that, when the capacity reaches 99%, the number of feature vector needs to reach about 153, and the recognition rate will reach 99.2%, but the training time reaches 1.42s. In summary, it is optimal to select 60 feature vectors, then the recognition rate is 95.1%, and the training time is 0.93s.

CONCLUSION
The key technology of the face recognition system is the design of the face feature extraction algorithm. Based on the design platform of matlab software, this paper adopts the PCA method to design a programmed algorithm for the face feature extraction, and realize the face feature extraction in matlab. The research results show that: 1) The PCA algorithm is a kind of algorithm for the analysis of multivariate statistical data. The key link is to obtain K-L transformation, and face image feature value and feature vector in the process of feature extraction.
2) The targets of application effects on the evaluation of PCA algorithm in the face recognition are face recognition rate and training time of the space sample subset, the former ranks a high priority, while the latter one ranks a low priority.
3) The face recognition rate and training time of the space sample subset are associated with the number of feature vectors selected. Both values will be increased with the increase of the number of feature vectors selected.
4) The results are realized through the face recognition of four persons with a total of 12 images. Three images on each person show that it is optimal to select 60 feature vectors, then the face recognition rate is 95.1%, and the training time of the space subset is 0.93s.