A face recognition method based on improved face equal density line analysis matching statistical model algorithm

Through the improved statistical model algorithm for density line analysis and matching statistical model of faces, the problems of slow training speed and inaccurate recognition in traditional face recognition methods are solved, fast and high-precision face recognition is achieved, and information security is improved.

CN114581997BActive Publication Date: 2024-12-13SIKAI GARDEN NETWORK TECH (GUANGZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210242410.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2024-12-13
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

Traditional face recognition methods have problems such as slow training speed and inaccurate recognition. A method that can improve the training speed of face models and improve the accuracy of face models recognition is urgently needed.

Method used

Using the improved face isodensity line analysis matching statistical model algorithm, the face image is acquired and preprocessed, data augmentation and labeling are performed, and the isodensity nearest neighbor matrix and distance matrix are generated, and the local binary mode uniform operator is used for encoding and compression. and manifold space dimensionality reduction, extract face features, set isodensity line analysis environment, train face density analysis matching models, and optimize parameters through SVM to achieve face recognition.

Benefits of technology

The speed and accuracy of face recognition have been improved, the recognition speed is controlled within 0.5 seconds, and the face recognition accuracy has reached 99.6%, while improving information security and promoting the development of information security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114581997B_ABST
    Figure CN114581997B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image recognition technology, and discloses a face recognition method based on an improved face iso-density line analysis matching statistical model algorithm, comprising: acquiring an image, pre-processing the image and dividing it into a test set and a training set, using the improved iso-density line analysis matching statistical model algorithm on the training set, using a non-overlapping sampling window to scan the image, and obtaining a trained face iso-density analysis matching model; using the test set to test the face iso-density analysis matching model and output the face iso-density model matching classification image recognition result; and finally using the face iso-density analysis matching recognition model FRM to perform face recognition. Compared with the prior art, the present invention reduces the amount of calculation for face training and recognition, improves the stability of recognition, does not need to calculate the similarity for each face model, and improves the recognition speed without almost reducing the recognition rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a face recognition method based on an improved face equal density line analysis matching statistical model algorithm. Background Art

[0002] In recent years, the Internet has developed rapidly. The hidden dangers of information security have become increasingly prominent, but at the same time, information identification and detection have also been increasingly valued. Now it has involved all aspects of our lives. The identification methods such as magnetic cards and numbers used in life have the disadvantages of being easy to lose and forge. With the continuous innovation of technology, traditional identity recognition methods have been increasingly challenged. In this context, people began to turn their attention to recognition based on biometrics, especially face recognition. Since the face is innate, unique and not easy to be copied by the user, this provides convenience for biometric identification methods for various types of users. Such identification methods can improve information security and promote the development of information security.

[0003] The document "Chinese invention patent with application publication number CN108090340A" discloses a face recognition processing method. The face recognition processing method includes: triggering an intelligent terminal to perform face recognition; if face recognition fails, storing the image captured by the face recognition at that time, and returning to execute the step of triggering the intelligent terminal to perform face recognition; when face recognition succeeds, judging whether there is a posture reason for the previous face recognition failure; if there is a posture reason, outputting a second prompt information, the second prompt information is used to prompt the user to perform face recognition according to a preset posture standard in the future, but the face recognition rate of this method is low, which affects the recognition effect.

[0004] The document "Chinese invention patent with application publication number CN111291740B" discloses a method for training a face recognition model. The method obtains face feature data corresponding to at least two modal images of a sample object. Feature fusion is performed on the face feature data corresponding to at least two modal images of the sample object to obtain face fusion feature data corresponding to the sample object. The face fusion feature data corresponding to the sample object is used as the input of the face recognition model, and the identification classification label corresponding to the sample object is used as the output of the face recognition model to train the face recognition model. This method mainly trains the face model and lacks the recognition result of the face.

[0005] The document "Chinese invention patent with application publication number CN112200115A" discloses a face recognition training method, recognition method, device, equipment and storage medium. The face recognition training method includes: inputting the training image into a pre-built original face recognition model to extract face features and obtain the output value of the original face recognition model; wherein the original face recognition model includes: feature extraction network, region generation network, first screening layer, RoIAlign pooling layer, classification layer, second screening layer and frame regression layer; the first screening layer is used to filter the output of the region generation network, and the second screening layer is used to filter the output of the classification layer; the output value is used to calculate the cross entropy loss; the output of the second screening layer is used to calculate the EIOU loss; the sum of the cross entropy loss and the EIOU loss is used as the target loss to optimize the original face recognition model and obtain the target face recognition model. This method mainly trains and stores faces and lacks the analysis, matching and recognition process of faces.

[0006] The document "Chinese invention patent with application publication number CN112889062A" discloses a method for processing dynamic face model recognition data. It includes: a mobile device receives dynamic face recognition error feedback information, adjusts the corresponding recognition control threshold in the current face recognition algorithm according to the face recognition error feedback information; and performs face recognition according to the current face recognition algorithm after adjusting the recognition control threshold. This method is mainly based on data processing of dynamic faces and cannot recognize faces.

[0007] The document "Chinese invention patent with application publication number CN112364698A" discloses a dynamic target recognition method based on a convolutional neural network. The method discloses a face recognition method and device based on a convolutional neural network. The method comprises: using a first face database to train a convolutional neural network based on TensorFlow to obtain a first face recognition model; using a second face database to test the first face recognition model, and correcting the first face recognition model according to the test results to obtain a second face recognition model; and using the second face recognition model to perform face recognition. This solution uses a convolutional neural network based on TensorFlow, which can make full use of limited data to improve the performance of the convolutional neural network. This method mainly uses a convolutional neural network to perform dynamic face recognition, lacks analysis and matching recognition effects on faces, and has a slow recognition speed.

[0008] In summary, most of the traditional face recognition methods have the problems of slow training speed and inaccurate face recognition. There is an urgent need for a face recognition method that can improve the training speed of the face model and improve the recognition accuracy of the face model. Summary of the invention

[0009] Purpose of the invention: In view of the problems existing in the prior art, the present invention provides a face recognition method based on an improved face isodensity line analysis matching statistical model algorithm. By using the improved isodensity line analysis matching statistical model algorithm, a trained face isodensity analysis matching model is obtained, thereby realizing face recognition.

[0010] Technical solution: The present invention provides a face recognition method based on an improved face equal density line analysis matching statistical model algorithm, comprising the following steps:

[0011] Step 1: Obtain the user's face image and preprocess it;

[0012] Step 2: Perform data enhancement on the face image data preprocessed in step 1, annotate the enhanced data image, and divide the annotated face image data set into a training set and a test set, and output an improved face image training set according to the equal density classifier;

[0013] Step 3: Input and traverse the face image training set, improve the equal density operator, generate the equal density neighbor matrix E of the face image training set samples, calculate the equal density neighbor distance L and the equal density distance matrix M of the samples, replace the square adjacent area with a circular adjacent area, input the face image training set samples into the local binary pattern uniform operator for encoding and compression, reorganize the encoded and compressed face images in blocks, extract the face features of the reassembled face images after dimensionality reduction in manifold space, set the equal density line analysis environment, obtain the equal density map and equal density threshold DT of the face image training set samples, judge whether the equal density threshold DT reaches the stopping criterion, and complete the training and statistics of the face equal density analysis matching recognition model FRM;

[0014] Step 4: Input the face image test set in step 2 and the face equal density analysis matching recognition model FRM in step 3 to find the optimal equal density parameters of SVM; after comparing the face image test set samples with the face image samples after encoding, compression and block reorganization in step 3, identify the face image test set samples and output the face equal density model matching classification image recognition results;

[0015] Step 5: Use the face equal density analysis matching recognition model FRM to perform face recognition.

[0016] Furthermore, the pretreatment process in step 1 includes:

[0017] (1.1) After obtaining the face image, it is decoded into a three-channel "RGB" image format through PIL;

[0018] (1.2) Convert the face image Img1 into a 24-bit color image using the YCbCr mode, and output the face image Img1;

[0019] (1.3) Thresholding the face image and transforming the face image to the same affine scale or projection scale;

[0020] (1.4) Perform grayscale processing on the face image Img1 to obtain the face image Img1 S1 , and perform histogram equalization, calculate the number of each pixel in the gray level in the entire image, and calculate the number of each pixel in the face image Img1 S1 The probability distribution of the gray level is traversed and searched, and the pixel intensity distribution range is stretched to enhance the image comparison, and the face image Img1 is obtained. S2 ;

[0021] (1.5) Img1 S2 Perform grayscale stretching to obtain the face image Img1 S3 ;

[0022] (1.6) Using the OTSU thresholding method to analyze Img1 S3 Perform image binarization to obtain the face image Img1 S4 ;

[0023] (1.7) Img1 S4 Perform image edge detection and segmentation processing, filter denoising, edge feature enhancement, and threshold detection to obtain the face image Img1 S5 , get the preprocessed face image Img2;

[0024] (1.8) After the face image Img2 is transformed to the same direction and the same scale, the face image Img3 is obtained.

[0025] Furthermore, the data adding operation in step 2 specifically includes:

[0026] (2.1) Input the face image Img3 obtained in step 2, and reduce the face image Img3 multiple times to obtain the face image dataset Img3 D1 ;

[0027] (2.2) The face image Img3 is enlarged multiple times to obtain the face image dataset Img3 D2 ;

[0028] (2.3) Crop the distorted part of the face image Img3 to obtain the face image Img3 S1 ;

[0029] (2.4) Flip the face image Img3 to obtain the face image Img3 S2 ;

[0030] (2.5) Reflect the face image Img3 to obtain the face image Img3 S3 ;

[0031] (2.6) Translate the face image Img3 to obtain the face image Img3 S4 ;

[0032] (2.7) Rotate the face image Img3 to obtain the face image Img3 S5 ;

[0033] (2.8) Combined face image Img3 S1 、Img3 S2 、Img3 S3 、Img3 S4 、Img3 S5 And face image dataset Img3 D1 、Img3 D2 Get the face image dataset D1.

[0034] Furthermore, the specific operation of the face image training set improved according to the output of the equal density classifier in step 2 is:

[0035] (2.9) Define the pattern equal density class and select the face image training set to input the equal density classifier;

[0036] (2.10) The equal-density classifier performs equal-density analysis and classification on the face image training set to obtain the total number of classifications m;

[0037] (2.11) During the dth equal density classification, the equal density classifier output response is input, the equal density classification matrix is ​​added to the response matrix, the lowest response is output, and the lowest response is added to the training set to perform equal density classification on the equal density classifier;

[0038] (2.12) The face image training set is obtained after the improvement of equal density analysis classification.

[0039] Furthermore, the operation of inputting the uniform operator into the face image training set for encoding in step 3 is:

[0040] (3.1) Input the face image training set D5 after the improvement of the iso-density analysis classification in step 2, improve the iso-density operator, expand the 3×3 neighborhood to any adjacent area, and replace the square adjacent area with a circular adjacent area to generate the iso-density neighbor matrix E of the face image samples;

[0041] (3.2) Input the equal-density nearest neighbor matrix E, calculate the equal-density nearest neighbor distances between samples, and generate the equal-density distance matrix M;

[0042] (3.3) Input the equal density distance matrix M, add the face matching scale factor to the feature, and input the face image training set D5 improved by the equal density analysis classification into the local binary pattern uniform operator for encoding and compression.

[0043] Furthermore, the training process of the face equal density analysis matching recognition model FRM in step 3 is as follows:

[0044] (3.4) Divide the face image after the local binary pattern uniform operator coding compression into 4×4 blocks unevenly, and extract the middle four blocks to form a composite face image;

[0045] (3.5) Construct the manifold space, add addition and multiplication operations, input the face image after block combination in (3.4) into the manifold space, extract the face features after dimensionality reduction, calculate the distance between any two samples of equal-density face features, obtain the distance matrix Dist, and calculate the density matrix Den;

[0046] (3.6) Input the number of sample points within a given radius RT. For each row in the density matrix Den, find the number of points whose distance is less than the radius distance RT, and obtain the iso-density map of the sample matrix.

[0047] (3.7) Determine the isodensity threshold DT based on the density matrix Den and the isodensity map;

[0048] (3.8) For each sample A whose density is greater than the density threshold DT, if the distance between sample B and A is less than RT, and the density of B is also greater than DT, then the class where A is located and the class where B is located are merged into one class. All such classes are merged to obtain an equal density clustering result;

[0049] (3.9) Initialize the local cumulative variable, determine whether the stopping criterion is reached, and if the condition is met, proceed to step (3.11), otherwise proceed to step (3.10) to calculate the cumulative square feature gradient, update the face feature gradient parameter, and adjust the density threshold DT through the equal density line threshold to optimize the clustering result. The clustering result is determined according to the value of the equal density threshold DT;

[0050] (3.10) According to the optimized clustering results, adjust the neighborhood size RT so that the neighborhood size is between the minimum value min(Dist) and the maximum value max(Dist) of the distance between all samples, that is, min(Dist)≤RT≤max(Dist);

[0051] (3.11) Update the weights of the local preserved connection function and adjust the equal density learning rate corresponding to the maximum partial derivative parameter of the loss;

[0052] (3.12) Adjust the weighted coefficient of the mixed Gaussian distribution loss function to expand the distance of the face equal density feature space; adjust the weighted coefficient of the regularization loss function to make the face model simpler and more generalized;

[0053] (3.13) After all the data of the face image training set D5 improved by equal density analysis classification are circulated, the training of the face equal density analysis matching recognition model FRM is completed.

[0054] Furthermore, the specific operation of finding the optimal iso-density parameter of SVM in step 4 is:

[0055] (4.1) Select the Gauss kernel function as the kernel function of the SVM equal density classifier;

[0056] (4.2) Set the SVM equal density parameter range;

[0057] (4.3) Use particle swarm optimization to improve and optimize the isodensity parameters;

[0058] (4.4) Obtain the optimal iso-density parameters of SVM.

[0059] Furthermore, the specific operation of using the face image test set to test the face equal density analysis matching recognition model FRM and outputting the face equal density model matching classification image recognition result in step 4 is:

[0060] (4.5) According to the optimal iso-density parameters, the optimal SVM iso-density classifier is established;

[0061] (4.6) Input the face image test set D4, and project the test sample D4 of the face image test set onto the face equal density analysis matching recognition model FRM obtained in the training phase of step 3;

[0062] (4.7) Calculate the collaborative representation coefficient of the test sample D4 of the face image test set;

[0063] (4.8) Using the collaborative representation coefficient, construct the intra-class graph and inter-class graph of equal-density face sample types;

[0064] (4.9) Based on the intra-class graph and inter-class graph of face samples, construct the intra-class scatter matrix and inter-class scatter matrix of face recognition;

[0065] (4.10) The face image projection matrix is ​​obtained by maximizing the ratio of the inter-class divergence to the intra-class divergence, and the face image projection matrix is ​​used to extract the overall model difference between the face image training set D5 and the test sample to be identified D4;

[0066] (4.11) Use the face equal density analysis matching recognition model FRM to identify the test sample D4;

[0067] (4.12) According to the optimal SVM equal density classifier and face identification information in (4.5), the face image training set D5 and the test sample to be identified D4 are classified and matched;

[0068] (4.13) Perform face model matching based on the face model and display the recognized face image information FTResult S3 ;

[0069] (4.14) Loop through all test samples in the face image test set D4, loop through (4.9) to (4.13), and finally output the face equal density model matching classification image recognition result set FT Result.

[0070] Beneficial effects:

[0071] 1. Based on the face image data set, the present invention uses an improved isodensity line analysis matching statistical model algorithm to obtain a trained face isodensity analysis matching model, thereby realizing face recognition.

[0072] 2. This method uses non-overlapping sampling windows to scan images, which reduces the amount of computational effort in face training and recognition. The analysis of equal density line analysis results improves the stability of recognition. It does not require the calculation of similarity for each face model, and improves the recognition speed without almost reducing the recognition rate, thereby improving information security and promoting the development of information security. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 It is the overall flow chart of the present invention;

[0074] Figure 2 This is a flowchart of face image detection and preprocessing;

[0075] Figure 3 A flowchart for augmenting face data and splitting it into training and test sets;

[0076] Figure 4 Flowchart for training the face iso-density analysis matching recognition model;

[0077] Figure 5 Flowchart for recognizing a test set of face images. DETAILED DESCRIPTION

[0078] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0079] The present invention discloses a face recognition method based on an improved face equal density line analysis matching statistical model algorithm, see attached Figure 1To Attachment Figure 5 , mainly includes the following steps:

[0080] Step 1: Upload the user's face image, select the appropriate face image Img1 for analysis and matching, perform face detection to determine whether it contains a face, screen the face image, convert the face image into a face image Img2 in jpg format, pre-process Img2, and obtain the pre-processed face image Img3. For a specific flow chart, see the attached Figure 2 .

[0081] Step 1.1: Turn on the face recognition device;

[0082] Step 1.2: The device uploads the user's face image and determines whether it contains a face.

[0083] Step 1.3: Determine candidate areas one by one within the entire face image and scan them;

[0084] Step 1.4: Limit the range of the face area to maxSize;

[0085] Step 1.5: When receiving a face image, it is decoded into a three-channel "RGB" image format through PIL;

[0086] Step 1.6: Convert the face image Img1 into a 24-bit color image using the YCbCr mode, and determine whether the image conversion is successful;

[0087] Step 1.7: Output the face image Img1;

[0088] Step 1.8: Threshold the face image and transform it to the same affine scale or projection scale so that the threshold of each pixel in the image changes with the change of the surrounding area block, and then go to step (1.9);

[0089] Step 1.9: Introduce the OpenCV runtime library to grayscale the face image Img1 to obtain the face image Img1 S1 ;

[0090] Step 1.10: Img1 S1 Perform histogram equalization, calculate the number of each pixel in the grayscale in the entire image, and calculate the number of each pixel in the face image Img1 S1 The probability distribution of the gray level is traversed and searched, and the pixel intensity distribution range is stretched to enhance the image comparison, and the face image Img1 is obtained. S2 ;

[0091] Step 1.11: Img1 S2 Perform grayscale stretching to obtain the face image Img1 S3 ;

[0092] Step 1.12: Apply OTSU thresholding method to Img1 S3 Perform image binarization to obtain the face image Img1 S4 ;

[0093] Step 1.13: Img1 S4 Perform image edge detection and segmentation processing, filter denoising, edge feature enhancement, and threshold detection to obtain the face image Img1 S5 ;

[0094] Step 1.14: Get the preprocessed face image Img2,

[0095] Step 1.15: After transforming to the same direction and the same scale, the image is transformed to the same affine scale or projection scale to obtain the face image Img3.

[0096] Step 2: Transform the preprocessed face image to the same direction and scale, transform the image to the same affine scale or projection scale, and obtain the face image dataset D1 after image data enhancement. Annotate the face image dataset D1 to obtain the face dataset D2. The annotated face image dataset D2 is divided into the face image training set D3 and the face image test set D4, and the face training set D5 is improved according to the classifier output. For the specific flow chart, please refer to the attached Figure 3 .

[0097] Step 2.1: Input face image Img3;

[0098] Step 2.2: Reduce the face image Img3 multiple times to obtain the face image dataset Img3 D1 ;

[0099] Step 2.3: Enlarge the face image Img3 multiple times to obtain the face image dataset Img3 D2 ;

[0100] Step 2.4: Crop the distorted part of the face image Img3 to obtain the face image Img3 S1 ;

[0101] Step 2.5: Flip the face image Img3 to obtain the face image Img3 S2 ;

[0102] Step 2.6: Reflect the face image Img3 to obtain the face image Img3 S3 ;

[0103] Step 2.7: Translate the face image Img3 to obtain the face image Img3 S4 ;

[0104] Step 2.8: Rotate the face image Img3 to obtain the face image Img3 S5 ;

[0105] Step 2.9: Combined face image Img3 S1 、Img3 S2 、Img3 S3 、Img3 S4 、Img3 S5 And face image dataset Img3 D1 、Img3 D2 Get the face image dataset D1;

[0106] Step 2.10: After the face image data enhancement is completed, the face image dataset D1 after data enhancement is obtained;

[0107] Step 2.11: Define the variable Size1 and set its initial value to 1, which is used to calculate the data volume of the face image dataset D1 after data enhancement;

[0108] Step 2.12: Define a loop variable S1, assign an initial value of 1, and use it to traverse the face image dataset D1 after data enhancement, and satisfy S1∈[1,Size1];

[0109] Step 2.13: If S1≤Size1, go to step 2.14, otherwise go to step 2.17;

[0110] Step 2.14: Input face image Img S1 ;

[0111] Step 2.15: Face image Img S1 Carry out positioning annotation;

[0112] Step 2.16: Let S1=S1+1, and go to step 2.15;

[0113] Step 2.17: Obtain the annotated face image dataset D2 and face image label set FS;

[0114] Step 2.18: Divide the labeled face image dataset D2 into a face image training set D3 and a face image test set D4 according to a ratio of 7:3.

[0115] Step 2.19: Define the pattern equal density class, select the face training set D3 and input it into the equal density classifier;

[0116] Step 2.20: The equal density classifier performs equal density analysis and classification on the face training set D3 to obtain the total number of classifications m;

[0117] Step 2.21: Input the output response of the isodensity classifier during the dth isodensity classification;

[0118] Step 2.22: Add the equal density classification matrix to the response matrix;

[0119] Step 2.23: Output the lowest response, add the lowest response to the training set and perform isodensity classification on the isodensity classifier;

[0120] Step 2.24: Obtain the face image training set D5 after the improvement of equal density analysis classification.

[0121] Step 3: Input and traverse the face image training set, improve the equal density operator, generate the equal density neighbor matrix E of the face image training set samples, calculate the equal density neighbor distance L and the equal density distance matrix M of the samples, replace the square adjacent area with the circular adjacent area, input the face image training set samples into the local binary pattern uniform operator for encoding and compression, reorganize the encoded and compressed face images in blocks, extract the face features of the reassembled face images after dimensionality reduction in manifold space, set the equal density line analysis environment, obtain the equal density map and equal density threshold DT of the face image training set samples, judge whether the equal density threshold DT reaches the stopping criterion, and complete the training and statistics of the face equal density analysis matching recognition model FRM. For the specific flow chart, please refer to the attached Figure 4 .

[0122] Step 3.1: Input the face image training set D5 after the improved equal density analysis classification;

[0123] Step 3.2: Assume that the dataset size of the equal density analysis classification face image training set D5 is Size2, satisfying Size2= 7 / 10Size1;

[0124] Step 3.3: Define a loop variable S2, which is used to traverse the face image training set D5, with an initial value of 1, and satisfies S2∈[1,Size2];

[0125] Step 3.4: Input the equal density analysis classification face image training set D5 S2 ;

[0126] Step 3.5: In order to adapt to different facial texture features and make the grayscale and rotation of the facial image unchanged, the equal density operator is improved, the 3×3 neighborhood is extended to any adjacent area, and the traditional square adjacent area is replaced by a circular adjacent area. The equal density operator generates the facial image D5 S2 The equal density neighbor matrix E S2 ;

[0127] Step 3.6: Input the equal density neighbor matrix E S2 , calculate the equal-density neighbor distance L between samples and generate the equal-density distance matrix M;

[0128] Step 3.7: Input the equal density distance matrix M, add the face matching scale factor to the feature, and transform the face image D5 S2 Input the local binary pattern uniform operator for encoding compression to obtain the face image D5 S2-1 ;

[0129] Step 3.8: Transform the face image D5 S2-1 Unevenly divide the blocks into 4×4 blocks;

[0130] Step 3.9: Extract the middle four-block combined image to obtain the adult face image D5 S2-2 ;

[0131] Step 3.10: Construct the manifold space, add addition and multiplication operations, and combine the face image D5 into blocks S2-2 Input into the manifold space and extract facial features after dimensionality reduction;

[0132] Step 3.11: Define the isodensity line analysis class and isodensity line analysis function;

[0133] Step 3.12: Set up the isodensity line analysis environment;

[0134] Step 3.13: Calculate the distance between any two facial feature samples, obtain the distance matrix Dist, and calculate the density matrix Den;

[0135] Step 3.14: Input the number of sample points within the given radius RT. For each row in the density matrix Den, find the number of points whose distance is less than the radius distance RT to obtain sample D5. S2 Isodensity map of

[0136] Step 3.15: Determine the isodensity threshold DT based on the density matrix and the isodensity map;

[0137] Step 3.16: Initialize local accumulation variables;

[0138] Step 3.17: Determine whether the equal density threshold DT reaches the stop criterion. If the condition is met, proceed to step 3.19; otherwise, proceed to step 3.18;

[0139] Step 3.18: Calculate the cumulative square feature gradient, update the facial feature gradient parameters, adjust the equal density threshold DT, and optimize the clustering results. Determine the clustering results based on the equal density threshold DT and the local cumulative variable. Adjust the neighborhood size RT based on the optimized clustering results so that the neighborhood size is between the minimum value min(Dist) and the maximum value max(Dist) of the distance between all samples, that is, min(Dist)≤RT≤max(Dist);

[0140] Step 3.19: Update the weights of the local retention connection function and adjust the equal-density learning rate corresponding to the loss maximum partial derivative parameter;

[0141] Step 3.20: Adjust the weighted coefficient value of the mixture Gaussian distribution loss function to expand the distance of the face equal-density feature space. Adjust the weighted coefficient of the regularization loss function to make the face model simpler and more generalizable, and then go to Step 3.4;

[0142] Step 3.21: Let S2 = S2 + 1, and enter Step 3.4. When the loop variable S2 < Size2, the loop stops;

[0143] Step 3.22: The training of the face equal-density analysis matching recognition model FRM is completed. Expand the statistical scale of the model and conduct a goodness-of-fit test.

[0144] Step 4: Input the face image test set D4 and the face equal-density analysis matching recognition model FRM. Find the optimal equal-density parameter of SVM, select the Gauss kernel function as the kernel function of the SVM equal-density classifier, and use the particle swarm algorithm to improve and optimize the equal-density parameter. After comparing the face image test set samples with the face image samples encoded, compressed, and block-recombined in Step 3, identify the test samples D4 of the face image test set S3 , and output the face equal-density model matching classification image recognition result. During the recognition process, use the nearest neighbor method for face model analysis, matching, and classification, and use the Euclidean distance to measure the similarity of the test sample D4 i . For the specific flowchart, please refer to the appendix Figure 5 .

[0145] Step 4.1: Input the face image test set D4 and the face equal-density analysis matching recognition model FRM;

[0146] Step 4.2: Select the Gauss kernel function as the kernel function of the SVM equal-density classifier;

[0147] Step 4.3: Set the range of the SVM equal-density parameter;

[0148] Step 4.4: Use the particle swarm algorithm to improve and optimize the equal-density parameter;

[0149] Step 4.5: Determine whether the optimal equal-density parameter of SVM is found. If the optimal equal-density parameter is found, enter Step 4.6; otherwise, enter Step 4.4;

[0150] Step 4.6: Establish the optimal SVM equal-density classifier according to the optimal equal-density parameter;

[0151] Step 4.7: Input the face image test set D4. Assume that the dataset size of the face image training set D4 is Size3, satisfying Size3= 3 / 10Size1.

[0152] Step 4.8: Define a loop variable S3, which is used to traverse the face image test set D4, with an initial value of 1, and satisfies S3∈[1,Size3];

[0153] Step 4.9: Input the face image test machine test sample D4 S3 ;

[0154] Step 4.10: Place the test sample D4 S3 Project to the face equal density analysis matching recognition model FRM obtained in the training phase of step 3;

[0155] Step 4.11: Obtain test sample D4 S3 The collaboration representation coefficient of

[0156] Step 4.12: Use the collaborative representation coefficient to construct the intra-class graph and inter-class graph of equal-density face sample types;

[0157] Step 4.13: Construct the intra-class scatter matrix and inter-class scatter matrix of face recognition based on the intra-class graph and inter-class graph of face samples;

[0158] Step 4.14: Obtain the face image projection matrix by maximizing the ratio of the inter-class divergence to the intra-class divergence, and use the face image projection matrix to extract the training sample D5 S2 With the sample to be identified D4 S3 's overall model differences;

[0159] Step 4.15: Use the face equal density analysis matching recognition model FRM to test sample D4 of the face image test set S3 To identify;

[0160] Step 4.16: According to the optimal SVM equal density classifier and face identification information, the face image training set sample D5 S2 And the test sample D4 to be identified S3 Classification matching;

[0161] Step 4.17: Perform face model matching based on the face model and display the recognized face image information FTResult S3 ;

[0162] Step 4.18: Let S3 = S3 + 1, and go to step 4.9;

[0163] Step 4.19: Obtain the face equal density model matching classification image recognition result set FT Result.

[0164] Step 5: Use the face equal density analysis matching recognition model FRM to perform face recognition, open the face equal density analysis matching recognition interface FR API, and the face equal density analysis matching recognition interface FRM API performs equal density analysis matching recognition on the face and returns the recognized face information Face Info.

[0165] Step 5.1: Open the face equal density analysis matching recognition interface FR API;

[0166] Step 5.2: Create a thread pool Thread Pool;

[0167] Step 5.3: Determine whether all tasks in the thread pool Thread Pool have been executed. If all tasks have been executed, go to step 5.16, otherwise go to step 5.4;

[0168] Step 5.4: Open the process pool;

[0169] Step 5.5: Child Thread obtains task processing;

[0170] Step 5.6: Child Thread uses face statistics and density matching models to perform face analysis and matching;

[0171] Step 5.7: The face recognition interface FR API calls the face equal density analysis matching recognition model FRM to recognize the face;

[0172] Step 5.8: Determine whether they belong to the same face. If yes, proceed to step 5.9. If no, proceed to step 5.10.

[0173] Step 5.9: Update the current face identifier trackID;

[0174] Step 5.10: assign a new face identifier trackID to the current face;

[0175] Step 5.11: Determine whether the face identifier has been recognized. If it has been recognized, proceed to step 5.13; if it has not been recognized, proceed to step 5.12;

[0176] Step 5.12: Insert the face equal density analysis matching recognition processing queue;

[0177] Step 5.13: Display the face density analysis matching information, as well as the current recognition degree and other information;

[0178] Step 5.14: Return the Face Info of the recognized face density analysis match information;

[0179] Step 5.15: End the child process Child Thread and go to step 5.3;

[0180] Step 5.16: Close the thread pool Thread Pool;

[0181] Step 5.17: Face recognition is completed.

[0182] According to the above steps 1-5, the statistical algorithm of the improved equal density line analysis matching model is performed. As shown in Table 2, compared with the unimproved face equal density line analysis matching model algorithm and the convolutional neural network algorithm, the improved face equal density line analysis matching model algorithm improves the model training speed by 13.8% compared with the unimproved face equal density line analysis matching model algorithm. In addition, the face recognition speed and accuracy are improved. The recognition speed is controlled within 0.5 seconds, and the face recognition accuracy reaches 99.6%. The unimproved face equal density line analysis matching model algorithm has been improved.

[0183] Table 2 Algorithm results comparison

[0184] Improved face isodensity line analysis matching model algorithm Unimproved face isodensity line analysis matching model algorithm Convolutional Neural Network Algorithm Model training time 15.7 hours 16.8 hours 18 hours Recognition speed 0.218 seconds 0.221 seconds 0.561 seconds Recognition accuracy 99.6% 99.2% 98.4%

[0185] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A face recognition method based on an improved face equal density line analysis matching statistical model algorithm, characterized in that: The steps include: Step 1: Obtain the user's face image and preprocess it; Step 2: Perform data enhancement on the face image data preprocessed in step 1, annotate the enhanced data image, and divide the annotated face image data set into a training set and a test set, and output an improved face image training set according to the equal density classifier; The face image training set improved according to the output of the equal density classifier is as follows: (1) Define the pattern equal density class and select the face image training set to input the equal density classifier; (2) The equal-density classifier performs equal-density analysis and classification on the face image training set to obtain the total number of classifications m; (3) During the dth equal density classification, the output response of the equal density classifier is input, the equal density classification matrix is ​​added to the response matrix, the lowest response is output, and the lowest response is added to the training set to perform equal density classification on the equal density classifier; (4) Obtaining the face image training set after the improved equal density analysis classification Step 3: Input and traverse the face image training set, improve the equal density operator, generate the equal density neighbor matrix E of the face image training set samples, calculate the equal density neighbor distance L and the equal density distance matrix M of the samples, replace the square adjacent area with a circular adjacent area, input the face image training set samples into the local binary pattern uniform operator for encoding and compression, reorganize the encoded and compressed face images in blocks, extract the face features of the reassembled face images after dimensionality reduction in manifold space, set the equal density line analysis environment, obtain the equal density map and equal density threshold DT of the face image training set samples, judge whether the equal density threshold DT reaches the stopping criterion, and complete the training and statistics of the face equal density analysis matching recognition model FRM; The improved equal density operator is specifically: Input the face image training set D5 after the improvement of the iso-density analysis classification in step 2, improve the iso-density operator, expand the 3×3 neighborhood to any adjacent area, and replace the square adjacent area with a circular adjacent area to generate an iso-density neighbor matrix E of the face image samples; Step 4: Input the face image test set in step 2 and the face equal density analysis matching recognition model FRM in step 3 to find the optimal equal density parameters of SVM; after comparing the face image test set samples with the face image samples after encoding, compression and block reorganization in step 3, identify the face image test set samples and output the face equal density model matching classification image recognition results; Step 5: Use the face equal density analysis matching recognition model FRM to perform face recognition.

2. The face recognition method based on the improved face equal density line analysis matching statistical model algorithm according to claim 1 is characterized in that: The pretreatment process in step 1 includes: (1.1) After obtaining the face image, it is decoded into a three-channel "RGB" image format through PIL; (1.2) Convert the face image Img1 into a 24-bit color image using the YCbCr mode, and output the face image Img1; (1.3) Thresholding the face image and transforming the face image to the same affine scale or projection scale; (1.4) Perform grayscale processing on the face image Img1 to obtain the face image Img1 S1 , and perform histogram equalization, calculate the number of each pixel in the gray level in the entire image, and calculate the number of each pixel in the face image Img1 S1 The probability distribution of the gray level is traversed and searched, and the pixel intensity distribution range is stretched to enhance the image comparison, and the face image Img1 is obtained. S2 ; (1.5) Img1 S2 Perform grayscale stretching to obtain the face image Img1 S3 ; (1.6) Using the OTSU thresholding method to analyze Img1 S3 Perform image binarization to obtain the face image Img1 S4 ; (1.7) Img1 S4 Perform image edge detection and segmentation processing, filter denoising, edge feature enhancement, and threshold detection to obtain the face image Img1 S5 , get the preprocessed face image Img2; (1.8) After the face image Img2 is transformed to the same direction and the same scale, the face image Img3 is obtained.

3. The face recognition method based on the improved face equal density line analysis matching statistical model algorithm according to claim 1 is characterized in that: The data enhancement operation in step 2 specifically includes: (2.1) Input the face image Img3 obtained in step 2, and reduce the face image Img3 multiple times to obtain the face image dataset Img3 D1 ; (2.2) The face image Img3 is enlarged multiple times to obtain the face image dataset Img3 D2 ; (2.3) Crop the distorted part of the face image Img3 to obtain the face image Img3 S1 ; (2.4) Flip the face image Img3 to obtain the face image Img3 S2 ; (2.5) Reflect the face image Img3 to obtain the face image Img3 S3 ; (2.6) Translate the face image Img3 to obtain the face image Img3 S4 ; (2.7) Rotate the face image Img3 to obtain the face image Img3 S5 ; (2.8) Combined face image Img3 S1 、Img3 S2 、Img3 S3 、Img3 S4 、Img3 S5 And face image dataset Img3 D1 、Img3 D2 Get the face image dataset D1.

4. The face recognition method based on the improved face equal density line analysis matching statistical model algorithm according to claim 1 is characterized in that: The operation of inputting the uniform operator into the face image training set for encoding in step 3 is: (3.1) Input the equal-density nearest neighbor matrix E, calculate the equal-density nearest neighbor distances between samples, and generate the equal-density distance matrix M; (3.2) Input the equal density distance matrix M, add the face matching scale factor to the feature, and input the face image training set D5 improved by equal density analysis classification into the local binary pattern uniform operator for encoding and compression.

5. The face recognition method based on the improved face equal density line analysis matching statistical model algorithm according to claim 4 is characterized in that: The training process of the face equal density analysis matching recognition model FRM in step 3 is as follows: (3.3) Divide the face image after the local binary pattern uniform operator coding compression into 4×4 blocks unevenly, and extract the middle four blocks to form a composite face image; (3.4) Construct the manifold space, add addition and multiplication operations, input the face image after block combination in (3.3) into the manifold space, extract the face features after dimensionality reduction, calculate the distance between any two samples of equal-density face features, obtain the distance matrix Dist, and calculate the density matrix Den; (3.5) Input the number of sample points within a given radius RT. For each row in the density matrix Den, find the number of points whose distance is less than the radius distance RT, and obtain the iso-density map of the sample matrix. (3.6) Determine the isodensity threshold DT based on the density matrix Den and the isodensity map; (3.7) For each sample A whose density is greater than the density threshold DT, if the distance between sample B and A is less than RT, and the density of B is also greater than DT, then the class where A is located and the class where B is located are merged into one class. All such classes are merged to obtain an equal density clustering result; (3.8) Initialize the local cumulative variable, determine whether the stopping criterion is reached, and if the condition is met, proceed to step (3.10), otherwise proceed to step (3.9) to calculate the cumulative square feature gradient, update the face feature gradient parameters, adjust the density threshold DT through the equal density line threshold, so as to optimize the clustering result, and determine the clustering result according to the value of the equal density threshold DT; (3.9) According to the optimized clustering results, adjust the neighborhood size RT so that the neighborhood size is between the minimum value min(Dist) and the maximum value max(Dist) of the distance between all samples, that is, min(Dist)≤RT≤max(Dist); (3.10) Update the weights of the local preserved connection function and adjust the equal density learning rate corresponding to the maximum partial derivative parameter of the loss; (3.11) Adjust the weighted coefficient of the mixed Gaussian distribution loss function to expand the distance of the face equal density feature space; adjust the weighted coefficient of the regularization loss function to make the face model simpler and more generalized; (3.12) After all the data of the face image training set D5 improved by equal density analysis classification are circulated, the training of the face equal density analysis matching recognition model FRM is completed.

6. The face recognition method based on the improved face equal density line analysis matching statistical model algorithm according to claim 1, characterized in that: The specific operation of finding the optimal iso-density parameters of SVM in step 4 is: (4.1) Select Gauss kernel function as the kernel function of SVM equal density classifier; (4.2) Set the SVM equal density parameter range; (4.3) Use particle swarm optimization to improve and optimize the isodensity parameters; (4.4) Obtain the optimal iso-density parameters of SVM.

7. The face recognition method based on the improved face equal density line analysis matching statistical model algorithm according to claim 6 is characterized in that: The specific operation of using the face image test set to test the face equal density analysis matching recognition model FRM and outputting the face equal density model matching classification image recognition result in step 4 is: (4.5) According to the optimal iso-density parameters, the optimal SVM iso-density classifier is established; (4.6) Input the face image test set D4, and project the test sample D4 of the face image test set onto the face equal density analysis matching recognition model FRM obtained in the training phase of step 3; (4.7) Calculate the collaborative representation coefficient of the test sample D4 of the face image test set; (4.8) Using the collaborative representation coefficient, construct the intra-class graph and inter-class graph of equal-density face sample types; (4.9) Based on the intra-class graph and inter-class graph of face samples, construct the intra-class scatter matrix and inter-class scatter matrix of face recognition; (4.10) The face image projection matrix is ​​obtained by maximizing the ratio of the inter-class divergence to the intra-class divergence, and the face image projection matrix is ​​used to extract the overall model difference between the face image training set D5 and the test sample to be identified D4; (4.11) Use the face equal density analysis matching recognition model FRM to identify the test sample D4; (4.12) According to the optimal SVM equal density classifier and face identification information in (4.5), the face image training set D5 and the test sample to be identified D4 are classified and matched; (4.13) Perform face model matching based on face equal density analysis matching recognition model FRM, and display the recognized face image information FT Result; (4.14) Loop through all test samples in the face image test set D4, loop through (4.9) to (4.13), and finally output the face equal density model matching classification image recognition result set FT Result.