Lightweight face recognition method

By using a joint system with improved YOLOv5 detection model and ResNet101 model in the face recognition system, the face data is extracted and aligned, and the problem of low recognition accuracy caused by blurred and distorted face information collected is solved, and fast and high-precision personnel recognition and monitoring are achieved.

CN119888804APending Publication Date: 2025-04-25国网甘肃省电力公司金昌供电公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411656303.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In application scenarios with large personnel flow, the collected facial information has problems such as blurring and distortion, resulting in low recognition accuracy of existing facial recognition systems, resulting in chaos in personnel management and low security factor.

Method used

By obtaining the face image data to be recognized and inputting it into the joint system of the trained and improved YOLOv5 detection model and the ResNet101 model, the face data is extracted for alignment, reducing image blur and distortion, and then using the ResNet101 model for facial feature extraction, and by comparing the face feature data with the face database, the recognition results are accurately obtained.

Benefits of technology

It effectively improves the recognition accuracy, especially in application scenarios with large flow of people, visitors can be identified quickly and with high accuracy, improving the reliability of personnel monitoring and ensuring safety in and out.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888804A_ABST
    Figure CN119888804A_ABST
Patent Text Reader

Abstract

The invention relates to a lightweight face recognition method. The method comprises the following steps: acquiring to-be-recognized face image data; inputting the face image data to be recognized into a trained improved YOLOv5 detection model, and extracting face data; wherein a C3 module in a backbone network of the improved YOLOv5 detection model is composed of a plurality of stacked Ghost sub-modules; performing face alignment processing on the face data to obtain aligned face data; inputting the aligned face data into a trained ResNet101 model to carry out feature extraction so as to obtain face feature data; calculating the face feature data and a plurality of face image data stored in a face database to obtain an identification value; and comparing the identification value with a discrimination threshold to obtain a comparison result. The method can greatly improve the recognition precision, and reduces the problems of disordered personnel management and low safety coefficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Facial recognition technology, as an important branch of artificial intelligence, has played an increasingly important role in our lives. From mobile phone unlocking and payment verification to public security monitoring and access control systems, facial recognition is increasingly widely used. The commonly used and low-cost method is to collect faces through high-definition cameras, and then use template matching, knowledge-based and statistical-based methods for identity recognition. However, in application scenarios with large personnel flow, the collected facial information has problems such as blur and distortion, resulting in low recognition accuracy in existing facial recognition systems, causing confusion in personnel management and low security factors. Summary of the invention

[0003] In order to solve the above problems existing in the prior art, the present invention provides a lightweight face recognition method. The technical problem to be solved by the present invention is achieved by the following technical solutions:

[0004] The invention provides a lightweight face recognition method, comprising: obtaining face image data to be recognized; inputting the face image data to be recognized into a trained improved YOLOv5 detection model to extract face data; wherein the C3 module in the backbone network of the improved YOLOv5 detection model is composed of a plurality of stacked Ghost modules, and the neck network of the improved YOLOv5 detection model comprises an EfficientDet-BiFPN module; performing face alignment processing on the face data to obtain aligned face data; inputting the aligned face data into a trained ResNet101 model to perform feature extraction to obtain face feature data; calculating the face feature data and a plurality of face image data stored in a face database to obtain a recognition value; comparing the recognition value with a discrimination threshold to obtain a comparison result, wherein the comparison result comprises: the face image data to be recognized is face image data stored in the face database, and the face image data to be recognized is not face image data stored in the face database.

[0005] Compared with the prior art, the present invention has the following beneficial effects:

[0006] In view of the fact that the collected face information has the problems of blur and distortion in the application scenario with large flow of personnel, the existing face recognition system has the problems of low recognition accuracy, chaotic personnel management and low safety factor. The present invention provides a lightweight face recognition method, which obtains the face image data to be recognized, and inputs the face image data to be recognized into the joint system of the trained improved YOLOv5 detection model and the trained ResNet101 model, extracts the face data through the trained improved YOLOv5 detection model, aligns the face data to reduce image blur and distortion, and then uses the trained ResNet101 model to extract face features from the aligned face data. By comparing the extracted face feature data with the face database, a comparison result can be accurately obtained, and the recognition accuracy can be effectively improved. Especially in the application scenario with large flow of personnel, the visiting personnel can be identified quickly and accurately, the reliability of personnel monitoring can be improved, and the safety of entry and exit can be guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 is a flow chart of a lightweight face recognition method provided by an embodiment of the present invention;

[0008] Figure 2 It is a schematic diagram of the structure of the improved YOLOv5 detection model provided by an embodiment of the present invention;

[0009] Figure 3 It is a schematic diagram comparing the original connections between the layers provided by an embodiment of the present invention and the connections between the layers in the EfficientDet-BiFPN module. DETAILED DESCRIPTION

[0010] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.

[0011] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0012] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0013] Now, in conjunction with the accompanying drawings, a lightweight face recognition method proposed by the present invention is described in detail. In one application scenario, a lightweight face recognition method proposed by the present invention is applied to a construction site to monitor construction personnel and prevent outsiders from entering. It should be understood that the method provided by the present invention can also be applied to other scenarios.

[0014] Figure 1 FIG. 1 is a flow chart of a lightweight face recognition method provided by an embodiment of the present invention. Figure 1 As shown, the method includes:

[0015] Step 110: Obtain facial image data to be recognized.

[0016] Exemplarily, photos or videos of visitors are collected through a camera and used as facial image data to be recognized.

[0017] Step 120: Input the face image data to be recognized into the trained improved YOLOv5 detection model to extract the face data; wherein the C3 module in the backbone network of the improved YOLOv5 detection model is composed of multiple stacked Ghost sub-modules, and the neck network of the improved YOLOv5 detection model includes an EfficientDet-BiFPN module.

[0018] Here, before executing step 120, the method also includes: obtaining a first training data set, where the first training data set is obtained by performing format conversion processing on the CelebA data set; using the first training data set and the first loss function, iteratively training the initial improved YOLOv5 model to obtain a trained improved YOLOv5 detection model.

[0019] Specifically, the CelebA dataset refers to the CelebFaces Attritribute dataset, which includes 202,599 178×218 facial images from 10,177 celebrities, each of which is annotated with 40 binary labels representing facial attributes such as hair color, gender, and age. Since the initial improved YOLOv5 model cannot directly recognize the labels in the CelebA dataset, the CelebA dataset needs to be format converted before it can be used. In addition, the first loss function is a general loss function, and the embodiment of the present invention does not limit the specific function type.

[0020] Here, 70% of the CelebA dataset is used as the first training dataset, and the remaining 30% of the CelebA dataset is used as the validation set. The initial improved YOLOv5 model is iteratively trained using the first training dataset until the model's recognition rate for the validation set reaches at least 95%. The model training is stopped to obtain a trained improved YOLOv5 detection model.

[0021] Here, the formula for format conversion of the CelebA dataset is:

[0022]

[0023] Among them, w refers to the width of the face box in the CelebA dataset label; refers to the width of the face box in the dataset label after format conversion; img_w refers to the image width; img_h refers to the image height; h refers to the height of the face box in the CelebA dataset label; It refers to the height of the face box in the dataset label after format conversion; x refers to the horizontal axis coordinate of the upper left corner pixel of the face box in the CelebA dataset label; It refers to the horizontal coordinate of the center pixel of the face frame in the dataset label after format conversion; y refers to the vertical coordinate of the upper left corner pixel of the face frame in the CelebA dataset label; Refers to the vertical coordinate of the center pixel of the face frame in the dataset label after format conversion.

[0024] Figure 2 Schematic diagram of the structure of the improved YOLOv5 detection model provided by the embodiment of the present invention. Figure 2 As shown, the C3 module includes: a first Ghost submodule (i.e. Figure 2 C3Ghost1 in the second Ghost submodule (i.e. Figure 2C3Ghost 1 expands the channel dimension of the input feature based on the expansion ratio. After batch normalization (BN) and ReLU activation, the result is passed to C3Ghost2 to reduce the channel dimension of the feature so that the output channel matches the input. Finally, the output is concatenated with the original input after BN to solve the problem of gradient information duplication that may occur in the original C3 module combination.

[0025] Here, the backbone network of the improved YOLOv5 detection model includes: attention modules connected in sequence (i.e. Figure 2 Focus in), the first convolution module (i.e. Figure 2 CBL1 in the first CSP module (i.e. Figure 2 CBL1 in), the second convolution module (i.e. Figure 2 CBL2 in ), the first Ghost submodule, the third convolution module (i.e. Figure 2 CBL3 in), the fourth convolution module (i.e. Figure 2 CBL4 in ), the second Ghost submodule, the fifth convolution module (i.e. Figure 2 CBL5 in), the sixth convolution module (i.e. Figure 2 CBL6 in), the seventh convolution module (i.e. Figure 2 CBL7 in), SPP module and the eighth convolution module (i.e. Figure 2 CBL8 in, wherein each convolution module includes: a Pconv lightweight convolution layer, a BN batch normalization layer, and a LeakyReLU activation function layer connected in sequence; wherein the attention module is used to receive face image data to be recognized, and the output end of the third convolution module, the output end of the fifth convolution module, and the output end of the eighth convolution module are respectively connected to the three input ends of the neck network of the improved YOLOv5 detection model.

[0026] It should be noted that the convolution module in the neck network of the improved YOLOv5 detection model is also composed of a Pconv lightweight convolution layer, a BN batch normalization layer, and a LeakyReLU activation function layer connected in sequence. By using the Pconv lightweight convolution layer, redundant calculation processes can be reduced and the reasoning speed can be improved. Here, the EfficientDet-BiFPN module includes: the first connection layer (i.e. Figure 2 concat1 in), the second connection layer (i.e. Figure 2 concat2 in), the third connection layer (i.e. Figure 2 concat3 in), the second CSP module (i.e. Figure 2 CSP 2_1 in the third CSP module (i.e. Figure 2 CSP 2_2 in the fourth CSP module (i.e. Figure 2CSP 2_3 in), the ninth convolution module (i.e. Figure 2 CBL9 in), the tenth convolution module (i.e. Figure 2 CBL10 in), the eleventh convolution module (i.e. Figure 2 CBL11 in), the first CONV module (i.e. Figure 2 CONV1 in), the second CONV module (i.e. Figure 2 CONV2 in the diagram) and the third CONV module (i.e. Figure 2 CONV3 in ).

[0027] Among them, the first connection layer, the second CSP module, the ninth convolution module and the first CONV module are connected in sequence, the input end of the first connection layer is respectively connected to the output end of the first downsampling module and the output end of the twelfth convolution module of the neck network, the output end of the first CONV module is connected to the first input end of the top network of the improved YOLOv5 detection model, and the input end of the twelfth convolution module is connected to the output end of the third convolution module; the second connection layer, the third CSP module, the tenth convolution module and the second CONV module are connected in sequence, the input end of the second connection layer is respectively connected to the output end of the thirteenth convolution module of the neck network, and the first output end of the seventeenth convolution module of the neck network, the output end of the second CONV module is connected to the second input end of the top network of the improved YOLOv5 detection model, and the output end of the ninth convolution module is also connected to the input end of the thirteenth convolution module; the third connection layer, the fourth CSP module, the eleventh convolution module and the third CONV module are connected in sequence. The input end of the third connection layer is respectively connected to the output end of the fourteenth convolution module of the neck network and the second output end of the seventeenth convolution module, the output end of the third CONV module is connected to the third input end of the top network of the improved YOLOv5 detection model, and the output end of the tenth convolution module is also connected to the input end of the fourteenth convolution module; the neck network of the improved YOLOv5 detection model also includes: a second downsampling module, a fifth CSP module, a sixth CSP module, a fifteenth convolution module, a sixteenth convolution module and a fourth connection layer; wherein the fifth CSP module, the fifteenth convolution module, and the second downsampling module are connected in sequence, the output end of the second downsampling module and the output end of the sixteenth convolution module are connected to the input end of the fourth connection layer, and the fourth connection layer, the sixth CSP module and the seventeenth convolution module are connected in sequence; the input end of the sixteenth convolution module is connected to the output end of the fifth convolution module, and the input end of the fifth CSP module is connected to the output end of the eighth convolution module.

[0028] Here, the number of the second convolution module, the fifteenth convolution module and the seventeenth convolution module is 2.

[0029] Figure 3It is a schematic diagram comparing the original connections between the layers provided by an embodiment of the present invention and the connections between the layers in the EfficientDet-BiFPN module. Figure 3 The left side of the figure shows the connection diagram between the original layers, and the right side shows the connection diagram between the layers in the EfficientDet-BiFPN module. Figure 3 As shown in the figure, the P3 and P7 convolution nodes are removed from the EfficientDet-BiFPN module, and skip connections are added, so that deep and shallow features can be bidirectionally fused from top to bottom and from bottom to top, so as to enhance the transmission of feature information between different network layers and improve the accuracy and robustness of the improved YOLOv5 algorithm.

[0030] Please continue to refer to Figure 2 ,The top network of the improved YOLOv5 detection model includes three detection heads, namely 76*76*255 detection head, 38*38*255 detection head and 19*19*255 detection head, which can detect pictures of different sizes.

[0031] Here, the improved YOLOv5 detection model performs rapid detection on the input face image data to be identified, and marks the bounding box of the face to obtain the face data.

[0032] Step 130: Perform face alignment processing on the face data to obtain aligned face data.

[0033] Here, after the face border is detected, since different images may have different sizes, angles and lighting conditions, in order to ensure the stability and accuracy of the subsequent processing process, all face images need to be converted into a unified standard format. The main goal of image calibration is to eliminate the differences between images so that all faces are consistent in size and angle. Specifically, by rotating and cropping the image, all face data are adjusted to a uniform orientation and size, and histogram equalization is performed on the face data, which can enhance the contrast and brightness of the image, thereby reducing the impact of lighting differences on the recognition results.

[0034] After completing the rotation, cropping and histogram equalization, step 130 includes: extracting first eye coordinate data from the face data; using the first eye coordinate data, determining the angle between the first eye coordinate data and the horizontal line; based on the angle, rotating the face data to obtain rotated face data; obtaining second eye coordinate data from the rotated face data; based on the second eye coordinate data, resizing the rotated face data to obtain aligned face data.

[0035] Here, rotating the face data can be understood as unifying the angles of multiple face data. The second eye coordinate data can be expressed as:

[0036]

[0037] Among them, (x1, y1) is the coordinate of the center of the left eye, (x2, y2) is the coordinate of the center of the right eye, θ is the angle between the line connecting the two eyes and the horizontal line, (x0, y0) is the coordinate of the center point of the face data, (a, b) is the coordinate of the eye before rotation, including (x1, y1) and (x2, y2), is the second eye coordinate data.

[0038] Exemplarily, when it is necessary to obtain the coordinates of the center of the left eye after rotation or the coordinates of the center of the right eye after rotation, (x1, y1) or (x2, y2) can be substituted into the expression of the second eye coordinate data to obtain the coordinates.

[0039] Step 140: Input the aligned face data into the trained ResNet101 model for feature extraction to obtain face feature data.

[0040] Here, before executing step 140, the method also includes: obtaining a second training data set, which is obtained by performing data cleaning processing on the CASIA-WebFace data set; using the second training data set and the second loss function, iteratively training the initial ResNet101 model to obtain a trained ResNet101 model.

[0041] Here, the CASIA-WebFace dataset is created by the Institute of Automation, Chinese Academy of Sciences (CASIA). This dataset contains a large number of face images and corresponding identity tags. Since the CASIA-WebFace dataset includes some blurred images, using it directly for training will affect the accuracy of the model, so data cleaning is required before use. After the images are cleaned, they can be input into the ResNet101 network for iterative training. When the number of iterations or the preset recognition rate is reached, the trained ResNet101 model can be obtained.

[0042] Step 150: Calculate the facial feature data and multiple facial image data stored in the face database to obtain an identification value.

[0043] Here, step 150 includes: using a metric function to calculate the vector distance between the facial feature data and each facial image data in the face database to obtain multiple vector distance values; selecting a minimum value from the multiple vector distance values, and using the minimum value as the recognition value.

[0044] Here, the metric function is the ArcFace function. This function improves the normalization of feature vectors and the additive angle interval based on the SphereFace function, which can improve the inter-class separability while strengthening the intra-class compactness and inter-class differences, thereby further improving the discriminative ability of the face recognition model.

[0045] Exemplarily, the ArcFace function is used to calculate the vector distances between facial feature data and multiple facial image data stored in the face database one by one to obtain multiple vector distance values. Since different faces are quite different, the corresponding vector distances are larger. The more similar the faces are, the smaller the vector distances are. By obtaining the minimum value of the multiple vector distance values, the closest recognition result can be determined.

[0046] Step 160: Compare the recognition value with the discrimination threshold to obtain a comparison result, wherein the comparison result includes: the facial image data to be recognized is the facial image data stored in the face database, and the facial image data to be recognized is not the facial image data stored in the face database.

[0047] Here, the generated comparison results are stored in a specified folder for subsequent technical personnel to review and conduct security risk assessment.

[0048] Here, before executing step 160, the method further includes: calculating a discrimination threshold based on the LFW data set. Specifically, the LFW data set includes I face pairs, each face pair includes two face shape data, and I is a positive integer; calculating a discrimination threshold based on the LFW data set includes: S1, randomly selecting the i-th face pair in the LFW data set, i is a positive integer and is less than or equal to I; S2, obtaining the similarity of the i-th face pair, and using the similarity of the i-th face pair as the i-th threshold; S3, based on the i-th threshold, identifying multiple face pairs other than the i-th face pair in the LFW data set to obtain multiple recognition results; S4, based on the multiple recognition results, determining the recognition accuracy of the i-th threshold; S5, repeatedly executing S1-S4 until I thresholds and corresponding I recognition accuracy rates are obtained; S6, selecting the maximum value from the I recognition accuracy rates, and using the threshold corresponding to the maximum value as the discrimination threshold.

[0049] Exemplarily, S3 means that multiple face pairs other than the i-th face pair in the LFW dataset are identified using the i-th threshold, and face pairs greater than or equal to the i-th threshold are identified as the faces of the same person, and face pairs less than the i-th threshold are identified as faces of different people. Different thresholds correspond to different division results, that is, different recognition accuracy rates.

[0050] Here, 6000 test cases in the LFW dataset are used for testing and the discrimination threshold is selected. When the discrimination threshold is 0.337, the model recognition accuracy is 0.963.

[0051] In a possible implementation, when the facial image data to be identified is not facial image data stored in the facial database, the staff can add the image information of the visitor to the facial database if necessary.

[0052] In view of the fact that the collected face information has the problems of blur and distortion in the application scenario with large flow of personnel, the existing face recognition system has the problems of low recognition accuracy, chaotic personnel management and low safety factor. The present invention provides a lightweight face recognition method, which obtains the face image data to be recognized, and inputs the face image data to be recognized into the joint system of the trained improved YOLOv5 detection model and the trained ResNet101 model, extracts the face data through the trained improved YOLOv5 detection model, aligns the face data to reduce image blur and distortion, and then uses the trained ResNet101 model to extract face features from the aligned face data. By comparing the extracted face feature data with the face database, a comparison result can be accurately obtained, and the recognition accuracy can be effectively improved. Especially in the application scenario with large flow of personnel, the visiting personnel can be identified quickly and accurately, the reliability of personnel monitoring can be improved, and the safety of entry and exit can be guaranteed.

[0053] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the scope of protection of the present invention.

Claims

1. A lightweight face recognition method, characterized in that: include: Obtaining face image data to be recognized; Input the face image data to be identified into the trained improved YOLOv5 detection model to extract face data; wherein the C3 module in the backbone network of the improved YOLOv5 detection model is composed of a plurality of stacked Ghost submodules, and the neck network of the improved YOLOv5 detection model includes an EfficientDet-BiFPN module; Performing face alignment processing on the face data to obtain aligned face data; Input the aligned face data into the trained ResNet101 model to extract features and obtain face feature data; Calculating the facial feature data and multiple facial image data stored in a facial database to obtain an identification value; The recognition value is compared with a discrimination threshold to obtain a comparison result, wherein the comparison result includes: the facial image data to be identified is facial image data stored in the facial database, and the facial image data to be identified is not facial image data stored in the facial database.

2. The lightweight face recognition method according to claim 1, characterized in that: Before inputting the face image data to be recognized into the trained improved YOLOv5 detection model and extracting the face data, the method further includes: Obtain a first training data set, where the first training data set is obtained by performing format conversion processing on the CelebA data set; The initial improved YOLOv5 model is iteratively trained using the first training data set and the first loss function to obtain the trained improved YOLOv5 detection model.

3. The lightweight face recognition method according to claim 1, characterized in that: The performing face alignment processing on the face data to obtain aligned face data includes: Extracting first eye coordinate data from the face data; Determine an angle between the first eye coordinate data and a horizontal line using the first eye coordinate data; Based on the angle, rotating the face data to obtain rotated face data; Acquire second eye coordinate data in the rotated face data; Based on the second eye coordinate data, the rotated face data is resized to obtain the aligned face data.

4. The lightweight face recognition method according to claim 1, characterized in that: Before inputting the aligned face data into the trained ResNet101 model to extract features and obtain face feature data, the method further includes: Acquire a second training data set, where the second training data set is obtained by performing data cleaning processing on the CASIA-WebFace data set; The initial ResNet101 model is iteratively trained using the second training data set and the second loss function to obtain the trained ResNet101 model.

5. The lightweight face recognition method according to claim 1, characterized in that: Before comparing the recognition value with the discrimination threshold to obtain a comparison result, the method further includes: Based on the LFW data set, the discrimination threshold is calculated.

6. The lightweight face recognition method according to claim 5, characterized in that: The LFW dataset includes I face pairs, each face pair includes two face shape data, and I is a positive integer; The step of calculating the discrimination threshold based on the LFW data set includes: S1. Randomly select the i-th face pair in the LFW dataset, where i is a positive integer and is less than or equal to 1; S2, obtaining the similarity of the i-th face pair, and taking the similarity of the i-th face pair as the i-th threshold; S3. Based on the i-th threshold, recognize multiple face pairs in the LFW dataset except the i-th face pair to obtain multiple recognition results; S4. Determine the recognition accuracy of the i-th threshold based on the multiple recognition results; S5, repeatedly execute S1-S4 until I threshold values ​​and corresponding I recognition accuracy rates are obtained; S6. Select a maximum value from the I recognition accuracy rates, and use the threshold corresponding to the maximum value as the discrimination threshold.

7. The lightweight face recognition method according to claim 1, characterized in that: The calculation of the facial feature data and the plurality of facial image data stored in the facial database to obtain an identification value includes: Using a metric function, calculating a vector distance between the facial feature data and each facial image data in the face database to obtain a plurality of vector distance values; A minimum value is selected from the multiple vector distance values, and the minimum value is used as the identification value.

8. The lightweight face recognition method according to claim 7, characterized in that: The metric function is the ArcFace function.

9. The lightweight face recognition method according to claim 1, characterized in that: The C3 module includes: a first Ghost submodule and a second Ghost submodule; The backbone network of the improved YOLOv5 detection model includes: an attention module, a first convolution module, a first CSP module, a second convolution module, the first Ghost submodule, a third convolution module, a fourth convolution module, the second Ghost submodule, a fifth convolution module, a sixth convolution module, a seventh convolution module, an SPP module and an eighth convolution module connected in sequence, wherein each convolution module includes: a Pconv lightweight convolution layer, a BN batch normalization layer, and a LeakyReLU activation function layer connected in sequence; Among them, the attention module is used to receive the face image data to be identified, and the output end of the third convolution module, the output end of the fifth convolution module and the output end of the eighth convolution module are respectively connected to the three input ends of the neck network of the improved YOLOv5 detection model.

10. The lightweight face recognition method according to claim 9, characterized in that: The EfficientDet-BiFPN module includes: a first connection layer, a second connection layer, a third connection layer, a second CSP module, a third CSP module, a fourth CSP module, a ninth convolution module, a tenth convolution module, an eleventh convolution module, a first CONV module, a second CONV module and a third CONV module; Among them, the first connection layer, the second CSP module, the ninth convolution module and the first CONV module are connected in sequence, the input end of the first connection layer is respectively connected to the output end of the first downsampling module of the neck network and the output end of the twelfth convolution module, the output end of the first CONV module is connected to the first input end of the top network of the improved YOLOv5 detection model, and the input end of the twelfth convolution module is connected to the output end of the third convolution module; The second connection layer, the third CSP module, the tenth convolution module and the second CONV module are connected in sequence, the input end of the second connection layer is respectively connected to the output end of the thirteenth convolution module of the neck network and the first output end of the seventeenth convolution module of the neck network, the output end of the second CONV module is connected to the second input end of the top network of the improved YOLOv5 detection model, and the output end of the ninth convolution module is also connected to the input end of the thirteenth convolution module; The third connection layer, the fourth CSP module, the eleventh convolution module and the third CONV module are connected in sequence, the input end of the third connection layer is respectively connected to the output end of the fourteenth convolution module of the neck network and the second output end of the seventeenth convolution module, the output end of the third CONV module is connected to the third input end of the top network of the improved YOLOv5 detection model, and the output end of the tenth convolution module is also connected to the input end of the fourteenth convolution module; The neck network of the improved YOLOv5 detection model further includes: a second downsampling module, a fifth CSP module, a sixth CSP module, a fifteenth convolution module, a sixteenth convolution module and a fourth connection layer; Among them, the fifth CSP module, the fifteenth convolution module, and the second down-sampling module are connected in sequence, the output end of the second down-sampling module and the output end of the sixteenth convolution module are connected to the input end of the fourth connection layer, and the fourth connection layer, the sixth CSP module and the seventeenth convolution module are connected in sequence; The input end of the sixteenth convolution module is connected to the output end of the fifth convolution module, and the input end of the fifth CSP module is connected to the output end of the eighth convolution module.