Application Research of Face Recognition Algorithm based on MATLAB

Face recognition is a biometric recognition technology based on human facial features. Its application is generally to collect relevant face images through the camera, extract the video stream containing the face, or monitor the face in real time. This paper will take matlab simulation software as the research platform to study the effect of different face recognition algorithms in practical application. The main research method is to establish the corresponding face recognition application simulation interface on MATLAB, carry out simulation verification through different face recognition algorithms, compare and analyze the simulation results, and summarize the advantages and disadvantages of face recognition in the process of practical application,it provides a certain reference for the follow-up application of face recognition in real life.


Significance of face recognition
With the rapid development of science and technology, face recognition products have been widely used in finance, justice, military, public security, border inspection, government, aerospace, electric power, factory, education, medical treatment and many enterprises and institutions [1] .With the further maturity of technology and the improvement of social identity, face recognition technology will be applied in more fields. The essence of face recognition is biometric recognition technology, which is the most direct carrier of human emotion expression and communication. A person's race, region, even identity and status can be inferred from the face; People can also know each other's personality or emotion through the rich, complex and small expression changes of human faces. The scientific community often studies human face from many disciplines, such as computer graphics, image processing, computer vision, anthropology and so on.Compared with other forms of biological sign recognition, face recognition also has its unique advantages.Mainly as follows: • Non contact: face recognition does not need to have physical contact with the detection equipment in the recognition process, and the detection process is simple and easy; Especially during the epidemic prevention and control period, it can greatly reduce people's mutual contact and avoid people's risk of cross infection. • Non mandatory: in the process of face recognition, there is no need for special cooperation for face recognition. The recognition detection can be completed in an unconscious state. The process is not easy to detect and the recognition experience is good. • Easy to promote: the cost of face recognition application promotion equipment is not high.
Generally, ordinary cameras, digital cameras, embedded cameras and other widely used camera equipment can be used. It is easy to promote, convenient and simple to install, and can be applied to all kinds of places required for face detection. At the same time, the operation is simple and the use threshold is low.
• High concurrency: in practical application scenarios, face recognition technology can detect multiple people at the same time, collect data for everyone in the scene, and the response speed and detection time are faster than other methods. The research of face recognition is of great significance in the understanding of human visual system and the development of social artificial intelligence technology. Face recognition technology integrates artificial intelligence, machine recognition, machine learning, model theory, video image processing and other technologies in the application process. At the same time, it needs to be combined with the theory and implementation of intermediate value processing. It has broad application fields and attractive application prospects in the field of artificial intelligence.

Research on face recognition algorithm
As a basic biological sign recognition method, face recognition algorithm is divided into twodimensional and three-dimensional according to the image type. Face recognition based on twodimensional image is mainly for plane image processing, and there are rich face recognition related algorithms and sample database for face recognition. The nodes or punctuation points distributed on the face can be used for identity authentication by measuring the distance between eyes, cheekbones, chin, etc. This paper will study the face recognition algorithm from the perspective of two-dimensional image.At present, the commonly used face recognition algorithms based on two-dimensional include template matching method, singular value feature method, principal component analysis method, artificial neural network method and so on [2] .Combined with the above face recognition algorithms, the general steps of face recognition in practical application are shown in Figure 1.

Design of GUI simulation interface of face recognition based on MATLAB
In order to facilitate the application of the Matlab platform for face recognition research, two GUI interfaces for face recognition simulation will be established as required. Figure2 is the real-time display GUI interface of the camera based on Matlab, which is mainly used to control the camera to collect face images, and has functions such as real-time display and image saving.At present, the camera call based on MATLAB is generally divided into two ways: one is the camera provided by the computer, and the other is through the external camera. Figure3 is the GUI interface of face recognition training and detection based on MatlabIt can be used for input, training, face recognition comparison and other functions of face sample database. [3]

Face recognition algorithm strategy based on MATLAB
There are two ways of face recognition, one is static face image recognition, the other is real-time face recognition through camera. Taking matlab simulation software as the platform, this paper will study the accuracy and stability of face recognition based on different algorithms from three aspects: face image recognition based on binary algorithm, face recognition function of Viola Jones based on MATLAB and face recognition algorithm based on PCA, so as to study the core elements of face recognition algorithm [4] .

Face recognition algorithm based on pixel statistics after image binarization
In the image containing face, there is an obvious distinction between the color of face part and the color of other areas of the image, and the skin color of face part is often a connected area in the image. Combined with the above two characteristics, face recognition in the image is carried out.Since the general images are three color images based on RGB, which have many color features and are difficult to process, the overall image can be grid marked and divided into several small areas, and then the image can be transformed into gray-scale images through rgb2gray function, and binarized with im2bw function. After processing, judge and count the pixel proportion information in the image according to the pixel characteristics in each small area, Combined with the characteristics that the skin color of the face part is connected, and combined with the judgment of pixel proportion, the white pixel area covered by the face part is marked out through a rectangular box to complete the face recognition process of the image. As shown in Figure 4.

4.2Face recognition algorithm based on Viola-Jone
Viola-Jones algorithm is a target detection algorithm based on sliding window, which can be used for static face image detection and real-time face detection.The algorithm makes quantitative discrimination of face image features, uses Haar features to describe, uses cascade classifiers to improve efficiency, and finally makes efficient regional brightness statistics.In Matlab, the vision.CascadeObjectDetector function is generally used to use the Viola-Jones algorithm for face detection, and at the same time, the specific parts and expressions of the face can be recognized through training.Such as: human face, nose, eyes, mouth or upper body, etc. As shown in the figure, the recognition mark of face image is displayed. As shown in Figure 5.

Face recognition algorithm based on PCA
Principal component analysis (PCA) is a widely used algebraic feature extraction method at present. It is an effective method to process, compress and extract the information in the sample based on the variable covariance matrix. The main features of the face can be extracted from the face database through the K-L transformation expansion to form the feature face space. During recognition, the face image to be tested is projected into the feature face space to obtain a set of projection coefficients, Compare and recognize with each face image in the database to find the correct face.
For face recognition through PCA algorithm, it is necessary to prepare a set of relevant face database for training and extracting face features.Firstly, select the number of face images input as training samples, then scan each sample image one by one, and start the image preprocessingrespectively [5] .The specific operation process can be divided into three steps. The first step is to standardize the size of the sample image into 10 * 10, and then judge the image color. If there is an RGB trichromatic image, it will be converted into gray scale. Finally, the image will be converted into a row vector and put into the training sample function;In the second step, all the preprocessed sample images are processed by PCA algorithm. After centralizing the training samples, a mean face is obtained, and then its covariance matrix, eigenvalue and eigenvector are solved. By sorting the eigenvalues, the transpose of the centralized matrix is multiplied by the feature vector to obtain its corresponding feature face, which can be used for subsequent face recognition;Step 3 in the subsequent face recognition, multiply the vector of each picture in the training sample by the feature face to obtain the projection vector in the feature face space. At the same time, the face picture to be recognized also refers to this operation, and compare the projection vector of the sample face picture used for training with the projection vector with the recognized face picture, Find out the corresponding sample face image with the smallest Euclidean distance between the two projection vectors, which is the required face image for recognition [6] .
In this paper, Yelu face database is used as the sample database. A total of 100 faces of 10 people are selected. Combined with the requirements of PCA algorithm, different numbers of face samples are selected for training.Select one of the remaining face images as the face image to be tested, and then use the GUI visual interface based on MATLAB platform to compare face recognition, and get the following two groups of recognition results respectively.
The first group uses 60 face sample images as the training database images, and the human face recognition results are shown in Figure 6.   According to the simulation results of the above two groups of different sample data, for the same face to be tested, the number of training samples directly determines the accuracy of recognition. The simulation shows that when the number of face training samples is high, face recognition can be carried out more accurately. If the number of face training samples is low, there will be insufficient eigenvalues, so face recognition cannot be carried out accurately.

Conclusion
Through the simulation tests of the above different face recognition algorithms and the comparison and analysis of the simulation results, the following problems generally exist in the application of face recognition algorithms based on two-dimensional images in practical scenes: • In real-time face detection, the color contrast between the face image and the surrounding environment affects the detection effect; • Whether the features contained in the face image are universal and can be used for subsequent feature extraction and face comparison; • Whether the face sample data used for training is rich and meets the minimum threshold required for feature extraction and face recognition; • In the process of real-time face recognition, the light angle, intensity, shooting angle and shooting distance in the camera display image affect the accuracy and stability of face recognition; • For facial expression recognition, we need enough facial expression samples for training to ensure the accuracy and stability of recognition. According to the face recognition algorithm, through the face image processing, sample training, feature extraction and other methods, we can basically realize the application of face detection in general scenes.