Research and Implementation of Face Recognition Based on PCA Algorithm

PCA algorithm principal component analysis

The Principal Component Analysis (PCA) method is a widely used algebraic feature extraction method. It can be said that a commonly used variable covariance matrix processes, compresses and extracts information in a sample. The effective method mainly extracts the main feature [i] of the face from the face database by KL (Karhunen-Loeve) transformation expansion, and forms the feature face space, and projects the face image to be tested into the feature face space during recognition. A set of projection coefficients is obtained, which are compared with each face image in the database for recognition.

This method preserves the projection of the original vector in the direction of the eigenvector corresponding to the largest eigenvalue of its covariance matrix, ie Principal Components, and is therefore called principal component analysis. Due to the effectiveness of the PCA method in dimension reduction processing and face feature extraction, it has been widely used in the field of face recognition. Its core idea is to describe the sample with less data features to reduce the feature space dimension. According to the position distribution of the sample points in the multi-dimensional space, the maximum direction of the sample points in space, that is, the maximum direction of variance , as a difference vector to achieve feature extraction of data. The KL transform is used to extract the main components of the face. The process of face recognition using the feature face method consists of two phases: the training phase and the recognition phase.

Research on Face Recognition Based on PCA Algorithm

1 Development and current status of face recognition

The study of face recognition has a long history. In the 19th century, the Frenchman Galton studied this problem. He used a set of numbers to represent the different side features of the face to realize the recognition of the side image of the face. At home and abroad, the research and development of face recognition have gone through three stages: the traditional human-computer interactive stage, the automatic stage of automatic machine recognition, and the advanced stage of automatic machine recognition.

1.1 Traditional human-computer interactive stage

The first stage is represented by BerTIlion, which mainly studies the facial features required for face recognition. The recognition of this stage depends on human operations. These face recognition methods need to take advantage of some of the operator's prior knowledge, and still can't get rid of human intervention.

1.2 Automatic identification of the initial stage

The second stage is mainly to identify by means of automatic machine identification. Since the 1990s, with the advent of high-speed high-performance computers, the face recognition method has made a major breakthrough, entering the real automatic recognition stage of the machine, the face Identification research has also received unprecedented attention.

1.3 Machine automatic identification advanced stage

The third stage is to use the machine to automatically recognize the face. With the development of computer large-scale, high-speed and face recognition methods, many automatic face recognition systems are proposed.

2 Principles of the PCA algorithm

The PCA (Principal Component Analysis) algorithm is a relatively new algorithm in face recognition. The advantage of this algorithm is that the recognition rate is high and the recognition speed is fast.

2.1 Introduction to PCA Algorithm

2.1.1 Principle of PCA

Let x be an m-dimensional random vector representing the environment. Suppose the x mean is zero, ie:

E[x]=O.

Let w be expressed as an m-dimensional unit vector on which x is projected. This projection is defined as the inner product of the vectors x and w, expressed as:

Research and Implementation of Face Recognition Based on PCA Algorithm

The purpose of principal component analysis is to find a weight vector w to maximize the value of the expression E[y2]:

Research and Implementation of Face Recognition Based on PCA Algorithm

According to the theory of linear algebra, it can be known that the training that satisfies the maximization of the subvalues ​​should satisfy the following formula:

Research and Implementation of Face Recognition Based on PCA Algorithm

That is, w which maximizes the above expression is the feature vector corresponding to the maximum eigenvalue of the matrix Cx.

2.1.2 The main component solution step

In PCA, the main reason is to make the conversion direction that makes the variance the most. The specific solution steps are as follows:

(1) Construct an association matrix: Cx=E[x*xT], Cx∈Pn*n.

In practical applications, since the mathematical expectation of the original data is not easy to solve, we can use the following formula to approximate the construction of the correlation matrix:

Research and Implementation of Face Recognition Based on PCA Algorithm

(where x1, x2, ..., xN are vectors corresponding to all pixel points of each original grayscale image, N is the number of original images)

(2) First calculate the eigenvalues ​​of Cx

(3) Sort the feature values ​​by size

Research and Implementation of Face Recognition Based on PCA Algorithm

(4) Calculate that the first m eigenvalues ​​correspond to the orthogonal eigenvectors constituting w.

(5) The original data is projected on the feature vector w to obtain the main feature data of the original image.

2.1.3 Method of solving principal components

Through the above analysis, we can know that the problem of principal component analysis is finally transformed into the problem of solving the eigenvalues ​​and eigenvectors of the covariance matrix. The algorithm of orthogonalization decomposition of principal components or the algorithm for solving XXT eigenvalue problems is commonly used. Jacobi method and NIPALS method.

2.2 Eigenface algorithm

In the algorithm of feature extraction using PCA, the feature face method (Eigenface) is one of the classic algorithms. The feature face method is a face recognition and description technique derived from principal component analysis. The feature face method is to regard the image area containing the face as a random vector, so the KL transform can be used to obtain its orthogonal KL base. A substrate corresponding to a larger feature value has a shape similar to a human face, and is therefore also referred to as a feature face. Face recognition can be described, expressed, and approximated using a linear combination of these substrates, so face recognition and synthesis can be performed. The recognition process is to map the face image to the subspace composed of the feature face, and compare the position of the face with the known face in the feature space. The specific steps are as follows:

(1) Initializing, obtaining a training set of the face image and calculating the feature face, defined as a face space, stored in the template library for the system to recognize;

(2) inputting a new face image, mapping it to the feature face space, and obtaining a set of feature data about the face;

(3) judging whether it is a human face by checking the distance between the image and the face space;

(4) If it is a face, judge whether it is a certain person in the database according to the weight mode, and make a specific operation.

2.2.1 Calculating the feature face

Let the face image I(x, y) be a two-dimensional N*N grayscale image, represented by an N-dimensional vector R. The face image training set is {Ri|i=1,...,M}, where M is the total number of images in the training set, and the average vector of the M images is:

Research and Implementation of Face Recognition Based on PCA Algorithm

The difference vector between each face Ri and the average face ψ is:

Research and Implementation of Face Recognition Based on PCA Algorithm

The covariance matrix of the training image can be expressed as:

C=AAT.

Where A=[φ1,...φM].

The feature face is composed of orthogonal feature vectors of the covariance matrix C. For the N*N face image, the size of the covariance matrix C is N2*N2, and it is difficult to solve the feature value and the feature vector. One way to do this is to make L=ATA.

That is, the transposed matrix of the covariance matrix, we can know that this matrix is ​​a smaller matrix of M*M (M is the number of training faces). First, the eigenvectors vi (l=l, . . . , M) of the M*M matrix L are calculated, and the feature vector ui (l=1, . . . , M) of the matrix C is composed of the difference image φi (i=1, . . . , M). ) Linear combination with vi(l=l,...,M) gives: U=[u1,...,uM]=[[ψ1,...,ψM]T][v1. ..., vM]. In fact, m (m "M) feature values ​​are sufficient for face recognition. Therefore, only the feature vector of the first m largest eigenvalues ​​of L is used to calculate the feature face.

3 PCA algorithm in face recognition

The eigenface-based face recognition process consists of two phases: the training phase and the recognition phase. In the training phase, each known face Ri is mapped to a subspace composed of feature faces to obtain an m-dimensional vector.

Research and Implementation of Face Recognition Based on PCA Algorithm

In the recognition phase, the image R to be identified is first mapped to the feature face space. Get the vector:

Research and Implementation of Face Recognition Based on PCA Algorithm

In order to distinguish between a face and a non-face, it is also necessary to calculate the distance ε between the original image R and its image Rf reconstructed from the feature space:

Research and Implementation of Face Recognition Based on PCA Algorithm

The face is classified by the minimum distance method. The classification rules are as follows:

(1) If ε ≥ θc, the input image is not a face image;

Research and Implementation of Face Recognition Based on PCA Algorithm

4 Experimental results

The experiment was tested on two galleries. The first is an ORL face database, which contains 40 different characters, each with 10 pictures, a total of 400. Tested with training samples, the recognition rate was 95%. One is a self-built face library, which contains 20 different characters, each with 5 images of different expressions and gestures, for a total of 100 images. As the training sample increases, the recognition rate will increase, but not as much as possible. When the number of training samples exceeds a certain number, the recognition rate will decrease.

5 Face recognition future development

Face recognition is an interdisciplinary and challenging frontier. The changes in attitude, illumination, expression, ornaments, background, time span and other factors in face images have a negative impact on the robustness of face recognition algorithms. The recognition rate of the PCA method is not high, and the future development direction can be combined with other methods (such as support vector machine, wavelet variation, etc.) to make up for the deficiency of the single method and make the identification more accurate.

CBD Pod System

A new rule from the Drug Enforcement Administration (DEA) threatens to upend the American hemp industry, and could even result in criminal prosecutions for manufacturers of CBD and delta-8 THC products.


The DEA says the [interim final rule," issued Aug. 20, is simply a matter of adjusting its own regulations to account for changes to the Controlled Substances Act that were mandated by the 2018 Farm Bill (or Agricultural Improvement Act) that legalized hemp and CBD production. The new rule [merely conforms DEA`s regulations to the statutory amendments to the CSA that have already taken effect," says the agency. The new rule doesn`t break any ground, according to the DEA.


But many experts on cannabis and hemp law say the DEA rule creates a potential pathway the law enforcement agency could use to prosecute hemp processors and producers of CBD (cannabidiol) and delta-8 THC (or Δ8THC) products. There are two issues: partially processed CBD, and [synthetically derived" delta-8 THC.

Cbd Pod System Oem,Cbd Vape Pod Oem,Best Cbd Pod System,Cbd Pod System

Shenzhen MASON VAP Technology Co., Ltd. , https://www.cbdvapefactory.com

Posted on