Lightweight face recognition method based on neural network

Through YOLOv5 detection and FaceNet feature extraction combined with SVM classification, the problem of inaccurate detection and facial changes of the face recognition system under extreme conditions is solved, and more efficient and accurate face recognition is achieved.

CN118762389AInactive Publication Date: 2024-10-11JINING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410769166.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing face recognition systems based on deep learning have problems with inaccurate detection in face occlusions, extreme lighting conditions or blurred images, and changes in facial expressions lead to inaccurate feature matching.

Method used

A lightweight face recognition method based on neural networks is used, face detection is performed through YOLOv5, 128-dimensional feature vectors are extracted using FaceNet, and SVM is used for classification, and Euclidean distance is calculated to determine face matching.

Benefits of technology

It improves the accuracy of face detection under different lighting and shadow conditions, enhances the robustness to changes in facial expressions and postures, and improves the accuracy and speed of face recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118762389A_ABST
    Figure CN118762389A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of face recognition, and discloses a lightweight face recognition method based on a neural network, and the face recognition comprises the steps: S1, face detection: carrying out the face detection of an input image through employing YOLOv5, and obtaining a face bounding box; s2, human face cutting: cutting a human face part from the original image according to the bounding box coordinates; s3, face feature extraction: loading a pre-trained FaceNet model, and obtaining a 128-dimensional feature vector of each face; s4, calculating a vector difference: calculating an Euclidean distance between the feature vectors of the two faces; s5, SVM classification: inputting the vector difference obtained by calculation into an SVM as a feature, and giving a classification result by the SVM according to the input feature; and S6, face verification: judging whether the two faces belong to the same person or not according to the classification result of the SVM, thereby solving the problem of inaccurate face detection or missing detection in face shielding, extreme illumination or blurred images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of face recognition, and in particular to a lightweight face recognition method based on a neural network. Background Art

[0002] Face recognition is a biometric-based identification method that uses physiological or behavioral characteristics that humans possess and can uniquely identify their identity for identity verification. With the introduction of human-computer interaction and the concept of smart cities, face recognition technology has become very important. As one of the main research methods in the field of pattern recognition and machine learning, a large number of face recognition algorithms have been proposed.

[0003] After searching, the invention patent with Chinese patent number CN109344731B discloses a lightweight face recognition method based on neural network, which belongs to the field of face recognition technology. In order to solve the technical problems such as large model and slow speed in the existing face recognition system based on deep learning, compared with the prior art, the invention patent with Chinese patent number CN102436202B optimizes the face feature extraction network, compresses the size of the deep neural network model involved in the face recognition process, and speeds up the face recognition process with less or very little loss of system accuracy. The lightweight recognition method of the present invention can be deployed on small mobile terminals such as Raspberry Pi, single-chip microcomputers and other small devices, and can be applied to access control management systems, supermarket membership registration management systems, and candidate identity authentication management systems.

[0004] However, during the use of the above-mentioned device, inaccurate face detection or missed detection may still occur in the case of face occlusion, extreme lighting conditions or blurred images. In addition, when laughing, crying or turning the head, the shape of the face and the position of the feature points will change, which may lead to inaccurate feature matching. Therefore, a lightweight face recognition method based on a neural network is proposed. Summary of the invention

[0005] The purpose of the present invention is to solve the problems existing in the prior art, that is, inaccurate face detection or missed detection may still occur in the case of face occlusion, extreme lighting conditions or blurred images. In addition, when laughing, crying or turning the head, the shape of the face and the position of the feature points will change, which may lead to inaccurate feature matching. A lightweight face recognition method based on a neural network is proposed to solve the problems existing in the prior art.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A lightweight face recognition method based on neural network. The face recognition steps are:

[0008] S1: Face detection: Use YOLOv5 to detect the face of the input image and obtain the face bounding box;

[0009] S2: Face cropping: crop the face part from the original image according to the bounding box coordinates;

[0010] S3: Face feature extraction: Load the pre-trained FaceNet model to obtain a 128-dimensional feature vector for each face;

[0011] S4: Calculate vector difference: For the feature vectors of two faces, calculate the Euclidean distance between them;

[0012] S5: SVM classification: The calculated vector difference is input into SVM as a feature, and SVM gives a classification result based on the input features;

[0013] S6: Face verification: Based on the SVM classification results, determine whether two faces belong to the same person.

[0014] The above further includes:

[0015] In S1, load the pre-trained YOLOv5 model and its weights, use the detect function of YOLOv5 to detect faces on the image, and extract the coordinates of the face bounding box from the detection results of YOLOv5.

[0016] The specific steps for using YOLOv5's detect function to detect faces in images are:

[0017] Preprocessing: resize the input image to the size expected by the model and normalize it;

[0018] Model inference: Input the preprocessed image into the YOLOv5 model for forward propagation to obtain the output tensor of the model;

[0019] Non-maximum suppression: Apply the NMS algorithm to the output of the model to eliminate overlapping bounding boxes and select the best bounding box;

[0020] Post-processing: converting the model’s output into a human-readable format, including bounding box coordinates, class labels, and confidence scores;

[0021] Return result: Return the detected object bounding box, category label and confidence to the caller.

[0022] The specific steps of using the NMS algorithm to eliminate overlapping bounding boxes and select the best bounding box are:

[0023] Calculate the confidence score of the bounding box: For each bounding box, the NMS algorithm first calculates its confidence score, which is usually the probability value predicted by the detection model based on the features and the prior box;

[0024] Sorting bounding boxes: sort all bounding boxes according to their confidence scores, with bounding boxes with higher confidence ranked first;

[0025] Select the bounding box with the highest confidence: Select the bounding box with the highest confidence from the sorted bounding box list as the reference box and add it to the final detection result list;

[0026] Calculate the overlapping area: For the remaining bounding boxes, calculate the area of ​​their overlapping area with the reference box, using IoU as the overlap metric;

[0027] Remove overlapping bounding boxes: Remove the bounding boxes whose overlap with the reference box (IoU) is higher than the set threshold from the remaining bounding boxes, and retain the bounding boxes whose overlap with the reference box is lower than the threshold;

[0028] Repeat processing: select the next bounding box with the second highest confidence as the new reference box, repeatedly select the bounding box with the highest confidence, calculate the overlapping area, and remove the overlapping bounding boxes until all bounding boxes have been processed;

[0029] Output: The final output is the bounding boxes that are retained, which have the highest confidence and do not overlap with each other.

[0030] In S3, the pre-trained FaceNet model is loaded to obtain a 128-dimensional feature vector for each face. The pre-processed face image is passed as input to the FaceNet model. The FaceNet model performs forward propagation calculation on the input face image and outputs a feature vector. The feature vector is a 128-dimensional vector that captures important feature information of the face image.

[0031] In S4, for the feature vectors of two faces, the Euclidean distance between them is calculated. For two feature vectors x and y, the difference between them is calculated by subtracting the second vector from the first vector, and each element in the difference array is squared. The sum of the squared array is calculated, and the square root of the sum is taken to obtain the Euclidean distance between the two feature vectors. The specific formula for calculating the Euclidean distance is:

[0032]

[0033] In S5, the calculated vector difference is input as a feature into the SVM, and the SVM gives a classification result based on the input feature. The difference calculated in S4 is combined with the corresponding label into a data set, and the data set is divided into a training set and a test set. The SVM model is trained and evaluated. Once the model training is completed and passes the evaluation, it is applied to a new face pair, and the feature vector difference of the new face pair is calculated and input into the SVM model for classification to determine whether the two faces are the same.

[0034] The specific steps for training and evaluating the SVM model are:

[0035] Select kernel function: Select a suitable kernel function according to the characteristics of the problem. Since facial feature vectors are usually high-dimensional and sparse, a linear kernel function is selected.

[0036] Setting parameters: Adjust the regularization parameter C;

[0037] Training model: Use the features and labels of the training set to train the SVM model. During the training process, the SVM will find a decision boundary (hyperplane) that maximizes the interval between different categories.

[0038] Prediction: Use the trained SVM model to predict the test set and obtain the predicted label of each sample;

[0039] Calculate the evaluation indicators: the proportion of correctly classified samples to the total number of samples, the accuracy is

[0040]

[0041] The ratio of positive samples to the examples predicted as positive samples is the ratio of positive samples to the examples predicted as positive samples.

[0042] The ratio of true positive examples to all positive examples, and the recall rate is

[0043] The harmonic mean of precision and recall, the F1 score is

[0044] Among them, TP (true positive), TN (true negative), FP (false positive), and FN (false negative) represent the number of samples of true positive, true negative, false positive, and false negative, respectively.

[0045] In S6, based on the classification results of SVM, it is determined whether the two faces belong to the same person. A threshold is set to determine whether the two faces match. If the probability value is higher than a certain threshold (such as 0.5 or higher), they are determined to be the same person; otherwise, they are determined to be not the same person. The best balance point is found by cross-validation or adjusting the threshold to maximize the evaluation index.

[0046] The specific steps to find the best balance point through cross-validation are:

[0047] Step 1: Divide the dataset into multiple folds, usually using K-fold cross validation (such as K=5 or K=10);

[0048] Step 2: For each fold, use the remaining folds as the training set to train the SVM model, and use the current fold as the validation set to evaluate the model performance;

[0049] Step 3: Run the SVM model on the validation set and classify the output using different thresholds (i.e. convert the probabilities into binary labels).

[0050] Step 4: For each threshold, calculate the evaluation indicators on the validation set (such as accuracy, precision, recall, F1 score, etc.);

[0051] Step 5: Repeat steps 2, 3, and 4 until all folds are used as validation sets.

[0052] Step 6: Select a single evaluation metric (such as F1 score) or combine multiple metrics (such as through some weighting method) according to the needs;

[0053] Step 7: For each threshold, calculate the average evaluation index on all validation sets;

[0054] Step 8: Select the threshold with the highest average evaluation index as the optimal threshold.

[0055] The present invention has the following beneficial effects:

[0056] 1. In the present invention, SVM can be trained to identify facial features under different lighting and shadow conditions. When given enough samples with different lighting and shadow conditions, SVM can learn the impact of these conditions on feature vectors and consider these impacts during classification, thereby improving the accuracy under different lighting conditions.

[0057] 2. In the present invention, Yolov5 has a high accuracy and speed in face detection. Using Yolov5 to cut out the face frame can further improve the accuracy of face detection.

[0058] 3. In the present invention, the FaceNet model is used for feature extraction. FaceNet is a deep neural network specially used for facial feature extraction. After being trained with a large amount of data, it can generate highly discriminative facial feature vectors and has strong robustness to factors such as lighting and angle.

[0059] 4. In the present invention, by training SVM with sample data containing multiple facial expressions and postures, it can learn the impact of these changes on the feature vector. During classification, SVM can make more accurate judgments based on these learned changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 A method step diagram of a lightweight face recognition method based on a neural network proposed by the present invention. DETAILED DESCRIPTION

[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] See also Figure 1 As shown, the present invention is a lightweight face recognition method based on a neural network, and the face recognition steps are:

[0063] S1: Face detection: Use YOLOv5 to detect the face of the input image and obtain the face bounding box;

[0064] S2: Face cropping: crop the face part from the original image according to the bounding box coordinates;

[0065] S3: Face feature extraction: Load the pre-trained FaceNet model to obtain a 128-dimensional feature vector for each face;

[0066] S4: Calculate vector difference: For the feature vectors of two faces, calculate the Euclidean distance between them;

[0067] S5: SVM classification: The calculated vector difference is input into SVM as a feature, and SVM gives a classification result based on the input features;

[0068] S6: Face verification: Based on the SVM classification results, determine whether two faces belong to the same person.

[0069] The working principle of a lightweight face recognition method based on neural network proposed in the present invention is that face detection is the starting point of the face recognition method to ensure that the subsequent steps process the face area in the picture. Using YOLOv5, the input picture is passed through the convolutional neural network layer for feature extraction, and then the potential face bounding box is generated through the region proposal network. Finally, the bounding box that is most likely to contain the face is screened out through the non-maximum suppression (NMS algorithm);

[0070] Face cropping is a key step in preprocessing to ensure that the subsequent feature extraction is based on a complete and clear face image. The face part is cropped from the original image according to the coordinates of the face bounding box detected in S1. The cropped image is usually scaled to a fixed size and resized to meet the input requirements of FaceNet, for example, 224x224 pixels, for the subsequent feature extraction step;

[0071] Face feature extraction is the core part of face recognition method, which extracts feature vectors that can represent the uniqueness of the face. Using the pre-trained FaceNet model, the cropped and scaled face image is input into the model. The FaceNet model will output a 128-dimensional feature vector, which represents the unique features of the input face.

[0072] Calculate the vector difference to convert the facial feature vector into the Euclidean distance. For the feature vectors of two faces, calculate the Euclidean distance between them. The smaller the Euclidean distance, the more similar the two faces are; otherwise, the greater the difference between the two faces.

[0073] SVM classification is the decision-making part of the face recognition method. It determines whether they belong to the same person based on the input features. The Euclidean distance calculated in S4 is input into the SVM as a feature. SVM is a binary classifier. It will give a classification result (such as 0 or 1) based on the input features (i.e., Euclidean distance) and the decision boundary learned during training.

[0074] Face verification converts the classification results of SVM in S5 into understandable face verification results and presents them to users or subsequent systems.

[0075] In one embodiment, for the above S1, in S1, a pre-trained YOLOv5 model and its weights are loaded, the detect function of YOLOv5 is used to perform face detection on the image, and the coordinates of the face bounding box are extracted from the detection result of YOLOv5.

[0076] In one embodiment, for the above face detection, the specific steps of using the detect function of YOLOv5 to perform face detection on an image are:

[0077] Preprocessing: resize the input image to the size expected by the model and normalize it;

[0078] Model inference: Input the preprocessed image into the YOLOv5 model for forward propagation to obtain the output tensor of the model;

[0079] Non-maximum suppression: Apply the NMS algorithm to the output of the model to eliminate overlapping bounding boxes and select the best bounding box;

[0080] Post-processing: converting the model’s output into a human-readable format, including bounding box coordinates, class labels, and confidence scores;

[0081] Return result: Return the detected object bounding box, category label and confidence to the caller.

[0082] In one embodiment, for the above NMS algorithm, the specific steps of using the NMS algorithm to eliminate overlapping bounding boxes and select the best bounding box are:

[0083] Calculate the confidence score of the bounding box: For each bounding box, the NMS algorithm first calculates its confidence score, which is usually the probability value predicted by the detection model based on the features and the prior box;

[0084] Sorting bounding boxes: sort all bounding boxes according to their confidence scores, with bounding boxes with higher confidence ranked first;

[0085] Select the bounding box with the highest confidence: Select the bounding box with the highest confidence from the sorted bounding box list as the reference box and add it to the final detection result list;

[0086] Calculate the overlapping area: For the remaining bounding boxes, calculate the area of ​​their overlapping area with the reference box, using IoU as the overlap metric;

[0087] Remove overlapping bounding boxes: Remove the bounding boxes whose overlap with the reference box (IoU) is higher than the set threshold from the remaining bounding boxes, and retain the bounding boxes whose overlap with the reference box is lower than the threshold;

[0088] Repeat processing: select the next bounding box with the second highest confidence as the new reference box, repeatedly select the bounding box with the highest confidence, calculate the overlapping area, and remove the overlapping bounding boxes until all bounding boxes have been processed;

[0089] Output: The final output is the bounding boxes that are retained, which have the highest confidence and do not overlap with each other.

[0090] In one embodiment, for the above S3, in S3, a pre-trained FaceNet model is loaded to obtain a 128-dimensional feature vector for each face, and the pre-processed face image is passed as input to the FaceNet model. The FaceNet model performs forward propagation calculation on the input face image and outputs a feature vector, which is a 128-dimensional vector that captures important feature information of the face image.

[0091] In one embodiment, for the above S4, in S4, for the feature vectors of two faces, the Euclidean distance between them is calculated, for the two feature vectors x and y, the difference between them is calculated by subtracting the second vector from the first vector, each element in the difference array is squared, the sum of the squared array is calculated, and the square root of the sum is taken to obtain the Euclidean distance between the two feature vectors. The specific formula for calculating the Euclidean distance is:

[0092] In one embodiment, for the above S5, in S5, the calculated vector difference is input as a feature into the SVM, and the SVM gives a classification result based on the input feature. The difference calculated in S4 is combined with the corresponding label into a data set, and the data set is divided into a training set and a test set. The SVM model is trained and evaluated. Once the model training is completed and passes the evaluation, it is applied to a new face pair, the feature vector difference of the new face pair is calculated, and it is input into the SVM model for classification to determine whether the two faces are the same.

[0093] In one embodiment, for the above SVM model, the specific steps of training the SVM model and evaluating it are:

[0094] Select kernel function: Select a suitable kernel function according to the characteristics of the problem. Since facial feature vectors are usually high-dimensional and sparse, a linear kernel function is selected.

[0095] Setting parameters: Adjust the regularization parameter C;

[0096] Training model: Use the features and labels of the training set to train the SVM model. During the training process, the SVM will find a decision boundary (hyperplane) that maximizes the interval between different categories.

[0097] Prediction: Use the trained SVM model to predict the test set and obtain the predicted label of each sample;

[0098] Calculate the evaluation indicators: the proportion of correctly classified samples to the total number of samples, the accuracy is

[0099]

[0100] The ratio of positive samples to the examples predicted as positive samples is the ratio of positive samples to the examples predicted as positive samples.

[0101] The ratio of true positive examples to all positive examples, and the recall rate is

[0102] The harmonic mean of precision and recall, the F1 score is

[0103] Among them, TP (true positive), TN (true negative), FP (false positive), and FN (false negative) represent the number of samples of true positive, true negative, false positive, and false negative, respectively.

[0104] In one embodiment, for the above S6, in S6, based on the classification result of SVM, it is determined whether the two faces belong to the same person, and a threshold is set to determine whether the two faces match. If the probability value is higher than a certain threshold (such as 0.5 or higher), they are determined to be the same person; otherwise, they are determined to be not the same person, and the best balance point is found by cross-validation or adjusting the threshold to maximize the evaluation index.

[0105] In one embodiment, for the above cross-validation, the specific steps of finding the best balance point through cross-validation are:

[0106] Step 1: Divide the dataset into multiple folds, usually using K-fold cross validation (such as K=5 or K=10);

[0107] Step 2: For each fold, use the remaining folds as the training set to train the SVM model, and use the current fold as the validation set to evaluate the model performance;

[0108] Step 3: Run the SVM model on the validation set and classify the output using different thresholds (i.e. convert the probabilities into binary labels).

[0109] Step 4: For each threshold, calculate the evaluation indicators on the validation set (such as accuracy, precision, recall, F1 score, etc.);

[0110] Step 5: Repeat steps 2, 3, and 4 until all folds are used as validation sets.

[0111] Step 6: Select a single evaluation metric (such as F1 score) or combine multiple metrics (such as through some weighting method) according to the needs;

[0112] Step 7: For each threshold, calculate the average evaluation index on all validation sets;

[0113] Step 8: Select the threshold with the highest average evaluation index as the optimal threshold.

[0114] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A lightweight face recognition method based on neural network, characterized in that: The steps of face recognition are: S1: Face detection: Use YOLOv5 to detect the face of the input image and obtain the face bounding box; S2: Face cropping: crop the face part from the original image according to the bounding box coordinates; S3: Face feature extraction: Load the pre-trained FaceNet model to obtain a 128-dimensional feature vector for each face; S4: Calculate vector difference: For the feature vectors of two faces, calculate the Euclidean distance between them; S5: SVM classification: The calculated vector difference is input into SVM as a feature, and SVM gives a classification result based on the input features; S6: Face verification: Based on the SVM classification results, determine whether two faces belong to the same person.

2. A lightweight face recognition method based on a neural network according to claim 1, characterized in that: In S1, load the pre-trained YOLOv5 model and its weights, use the detect function of YOLOv5 to detect faces on the image, and extract the coordinates of the face bounding box from the detection results of YOLOv5.

3. A lightweight face recognition method based on neural network according to claim 2, characterized in that: The specific steps for using YOLOv5's detect function to detect faces in images are: Preprocessing: resize the input image to the size expected by the model and normalize it; Model inference: Input the preprocessed image into the YOLOv5 model for forward propagation to obtain the output tensor of the model; Non-maximum suppression: Apply the NMS algorithm to the output of the model to eliminate overlapping bounding boxes and select the best bounding box; Post-processing: converting the model’s output into a human-readable format, including bounding box coordinates, class labels, and confidence scores; Return result: Return the detected object bounding box, category label and confidence to the caller.

4. A lightweight face recognition method based on neural network according to claim 3, characterized in that: The specific steps of using the NMS algorithm to eliminate overlapping bounding boxes and select the best bounding box are: Calculate the confidence score of the bounding box: For each bounding box, the NMS algorithm first calculates its confidence score; Sorting bounding boxes: sort all bounding boxes according to their confidence scores, with bounding boxes with higher confidence ranked first; Select the bounding box with the highest confidence: Select the bounding box with the highest confidence from the sorted bounding box list as the reference box and add it to the final detection result list; Calculate the overlapping area: For the remaining bounding boxes, calculate the area of ​​their overlapping area with the reference box, using IoU as the overlap metric; Remove overlapping bounding boxes: Remove the bounding boxes whose overlap with the reference box (IoU) is higher than the set threshold from the remaining bounding boxes, and retain the bounding boxes whose overlap with the reference box is lower than the threshold; Repeat processing: select the next bounding box with the second highest confidence as the new reference box, repeatedly select the bounding box with the highest confidence, calculate the overlapping area, and remove the overlapping bounding boxes until all bounding boxes have been processed; Output: The final output is the bounding boxes that are retained, which have the highest confidence and do not overlap with each other.

5. The lightweight face recognition method based on neural network according to claim 1, characterized in that: In S3, the pre-trained FaceNet model is loaded to obtain a 128-dimensional feature vector for each face. The pre-processed face image is passed as input to the FaceNet model. The FaceNet model performs forward propagation calculation on the input face image and outputs a feature vector. The feature vector is a 128-dimensional vector that captures important feature information of the face image.

6. A lightweight face recognition method based on a neural network according to claim 1, characterized in that: In S4, for the feature vectors of two faces, the Euclidean distance between them is calculated. For two feature vectors x and y, the difference between them is calculated by subtracting the second vector from the first vector, and each element in the difference array is squared. The sum of the squared array is calculated, and the square root of the sum is taken to obtain the Euclidean distance between the two feature vectors. The specific formula for calculating the Euclidean distance is:

7. A lightweight face recognition method based on neural network according to claim 1, characterized in that: In S5, the calculated vector difference is input as a feature into the SVM, and the SVM gives a classification result based on the input feature. The difference calculated in S4 is combined with the corresponding label into a data set, and the data set is divided into a training set and a test set. The SVM model is trained and evaluated. Once the model training is completed and passes the evaluation, it is applied to a new face pair, and the feature vector difference of the new face pair is calculated and input into the SVM model for classification to determine whether the two faces are the same.

8. A lightweight face recognition method based on a neural network according to claim 7, characterized in that: The specific steps for training and evaluating the SVM model are: Select kernel function: Since facial feature vectors are usually high-dimensional and sparse, a linear kernel function is selected; Setting parameters: Adjust the regularization parameter C; Training model: Use the features and labels of the training set to train the SVM model; Prediction: Use the trained SVM model to predict the test set and obtain the predicted label of each sample; Calculate the evaluation indicators: the proportion of correctly classified samples to the total number of samples, the accuracy is The ratio of positive samples to the examples predicted as positive samples is the ratio of positive samples to the examples predicted as positive samples. The ratio of true positive examples to all positive examples, and the recall rate is The harmonic mean of precision and recall, the F1 score is Among them, TP (true positive), TN (true negative), FP (false positive), and FN (false negative) represent the number of samples of true positive, true negative, false positive, and false negative, respectively.

9. The lightweight face recognition method based on neural network according to claim 7, characterized in that: In S6, based on the classification results of SVM, it is determined whether the two faces belong to the same person. A threshold is set to determine whether the two faces match. If the probability value is higher than a certain threshold, they are determined to be the same person; otherwise, they are determined to be not the same person. The best balance point is found through cross-validation to maximize the evaluation index.

10. A lightweight face recognition method based on neural network according to claim 9, characterized in that: The specific steps to find the best balance point through cross-validation are: Step 1: Divide the dataset into multiple folds; Step 2: For each fold, use the remaining folds as the training set to train the SVM model, and use the current fold as the validation set to evaluate the model performance; Step 3: Run the SVM model on the validation set and classify the output using different thresholds; Step 4: For each threshold, calculate the evaluation index on the validation set; Step 5: Repeat steps 2, 3, and 4 until all folds are used as validation sets. Step 6: Select a single evaluation indicator or combine multiple indicators according to your needs; Step 7: For each threshold, calculate the average evaluation index on all validation sets; Step 8: Select the threshold with the highest average evaluation index as the optimal threshold.

Citation Information

Patent Citations

  • Chemical monitoring and warning system and method for monitoring chemical application amount or stock amount using same

    CN102436202B

  • Lightweight face recognition method based on neural networks

    CN109344731B