A mask face recognition method and device based on a knowledge distillation and memory enhancement method, equipment and a storage medium

By employing knowledge distillation and memory enhancement methods, combined with an improved MobileNetV4 model and a face database, the problem of decreased face recognition accuracy under mask obstruction was solved, enabling effective recognition in complex underground environments.

CN120183010BActive Publication Date: 2025-11-07TAIYUAN UNIVERSITY OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510102727.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-11-07
Estimated Expiration
2045-01-22

AI Technical Summary

Technical Problem

Existing technologies suffer from decreased facial recognition accuracy when masks are covering the face, and deep learning methods have issues with false positives and false negatives, especially increasing the difficulty of recognition in complex underground environments.

Method used

We employ a knowledge distillation and memory enhancement approach to construct teacher and student models, extract features using an improved MobileNetV4 model, and combine a face database with memory enhancement techniques to achieve face recognition even when faces are obscured by masks.

Benefits of technology

It improves the performance and detection speed of facial recognition when the face is covered by a mask, reduces storage and computing costs, adapts to different application scenarios, and improves recognition accuracy and detection speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120183010B_ABST
    Figure CN120183010B_ABST
Patent Text Reader

Abstract

The application provides a mask face recognition method and device based on a knowledge distillation and memory enhancement method, equipment and a storage medium, and belongs to the field of face recognition; solves the problems of mask misjudgment of a traditional face recognition algorithm, difficulty in training of a detection model and difficulty in data set labeling; and comprises the following steps: input parameters are used to add different types and colors of masks to faces in a database; images in the database are extracted, converted into feature vectors through a feature extraction model and saved in a feature vector database; knowledge of a teacher model is imparted to a student model through a knowledge transmission method; camera images are extracted every certain period of time, input into a face mask feature extraction module, feature vectors are obtained, similarity measurement is performed on data in the feature vector database, and face information with the maximum similarity is returned; after detection, memory enhancement is performed on features of face information correctly recognized; and the application is applied to a face recognition scene with serious occlusion.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application provides a mask face recognition method and device based on a knowledge distillation and memory enhancement method, equipment and a storage medium, and belongs to the technical field of face recognition. BACKGROUND

[0002] Face recognition technology is a kind of identity verification technology based on biological characteristics, which confirms identity by analyzing and recognizing facial features of individuals. This technology relies on the combination of computer vision, image processing, machine learning and artificial intelligence, and can recognize the facial features of a person from an image or video. Face recognition technology can be roughly divided into feature point-based recognition method and deep learning-based detection method. The feature point-based method divides the face into several key feature points, and realizes face recognition by comparing the feature points; the deep learning-based method includes methods based on convolutional neural networks, etc., which first crops the face in the image, and then processes the cropped face image to encode the feature vector.

[0003] Among them, the feature point-based method has certain limitations. If detection is performed with a mask and a safety helmet, the feature points on the face may not be effectively extracted, especially in the severely occluded areas such as chin contour and nose, thereby reducing the recognition accuracy. Compared with the traditional feature point method, the mask safety helmet face recognition using the deep learning-based method has a great advantage in recognition accuracy. However, simply using the deep learning-based method may also cause false detection and missed detection in the case of mask occlusion, thereby affecting the performance of the overall algorithm.

[0004] In addition, to train a deep learning network with high accuracy, a large number of face images and their corresponding labels are required, which increases the workload of relevant personnel to some extent. The trained network is only applicable to the corresponding data set and is difficult to generalize to other types of face data sets.

[0005] The underground environment is complex, with insufficient light, multiple layers, high humidity, and miners often wearing safety helmets, masks and other equipment, increasing the difficulty of recognition. Therefore, the face recognition method in the underground environment has higher requirements for the recognition algorithm. SUMMARY

[0006] In order to solve the problem of decline in recognition accuracy of the traditional face recognition algorithm in the case of mask occlusion, the application provides a mask face recognition method, device, equipment and storage medium based on a knowledge distillation and memory enhancement method, which can improve the overall training method of the model and the subsequent detection effect.

[0007] The technical scheme adopted by the application is: a mask face recognition method based on a knowledge distillation and memory enhancement method, comprising the following steps:

[0008] S1: Constructing a face database: adding masks to the existing face image database, and storing the face images with masks in the face image database to obtain the face database;

[0009] S2: Face mask feature extraction: converting each image in the face database into a feature vector through a feature extraction model and storing it;

[0010] S3: Constructing a knowledge distillation model: the knowledge distillation model includes a teacher model and a student model, and the specific implementation steps are as follows:

[0011] (1) Teacher model construction: reading the pre-trained InceptionResNetv1 model as the teacher model to guide the training of the student model;

[0012] (2) Student model construction: constructing an improved MobileNetv4 model as the student model, the improved MobileNetV4 model includes FusedIB blocks, MSIB blocks and ExtraDW blocks composed of channel separable convolution, and the structure of the improved MobileNetV4 model is: input through Conv2D, two FusedIB blocks, ExtraDW block, four MSIB blocks, ConvNext, two ExtraDW blocks, four MSIB blocks, average pooling layer, two Conv2D;

[0013] Among them, the MSIB block first uses a 1x1 convolution to expand the channel number of the feature map to twice the original channel number, then divides the feature map into 4 parts, and then through a convolution kernel size of 3x3, 5x5, 3x3, a diffusion coefficient of 2, 5x5, a diffusion coefficient of 2, and then through a 1x1 convolution to restore the channel number and perform information interaction between different channels;

[0014] (3) Teacher knowledge transfer: using a loss function to align the output of the student model with the output of the teacher model, and through this way, the knowledge of the teacher model is transferred to the student model,

[0015] (4) Student model storage: saving the student model with knowledge, and the saved student model is used as a feature extraction model;

[0016] S4: Face database comparison: collecting face data and inputting it into the feature extraction model, comparing the extracted features with the features in the feature database, and outputting the face information corresponding to the highest similarity feature;

[0017] S5: Face memory enhancement: memory enhancement operation is performed on the corresponding features in the feature database, and the enhanced data is updated and stored in the feature database.

[0018] Further, the specific implementation steps of step S1 are as follows:

[0019] (1) Extract the face image from the database: read each image from the image database, and each image represents a face information;

[0020] (2) Face feature point conversion: for the extracted image, first use the MTCNN model to extract the face image in the image, and then use the dlib library to convert the face into 68 feature key points to obtain the absolute coordinates of the feature key points relative to the face image;

[0021] (3) Mask selection: based on the input parameters, select the specified mask image and cover different colors, if there is no specified parameter, randomly select the mask type and color for addition;

[0022] (4) Mask addition: obtain the absolute coordinates corresponding to the chin contour key point and the nose bridge key point, adjust the size and rotation angle of the mask image, and cover the adjusted mask image to the chin position of the face to obtain the face image with the added mask;

[0023] (5) Face mask image storage: save the obtained face mask image into the image database, and obtain the face database containing normal face and face with mask.

[0024] Further, the specific implementation steps of step S2 are as follows:

[0025] (1) Extract the image in the face database constructed in step S1: according to the input parameters, read the face image / face mask image in the face database, if no parameter is specified, read the face mask image;

[0026] (2) Face image feature extraction: input the extracted image into the feature extraction model, and the feature extraction model converts each image into a feature vector;

[0027] (3) Face mask feature vector storage: save the converted feature vector and its corresponding face user information into the feature database.

[0028] Further, the specific implementation steps of step S4 are as follows:

[0029] (1) Feature database reading: according to the selected parameters, extract the face feature / face mask feature and its corresponding face user information from the feature database, if no parameter is specified, read the face mask feature;

[0030] (2) Real-time camera detection: open the device camera, and take a camera picture every certain period of time;

[0031] (3) Real-time feature extraction: input the camera picture taken into a feature extraction model to obtain a feature vector corresponding to the real-time face;

[0032] (4) Feature comparison: compare the feature vector corresponding to the real-time face with the read features one by one to measure the similarity, and decide whether to add the feature to the candidate list according to a threshold value, i.e., if the feature is greater than the threshold value, it is added, otherwise it is not added;

[0033] (5) Face information output: after the face feature and the read features are compared, sort the obtained candidate list, and output the face user information corresponding to the feature with the highest similarity.

[0034] Further, the specific implementation steps of step S5 are as follows:

[0035] (1) Memory feature collection: during the face data comparison process in step S4, the detected results are transmitted into the memory feature list in real time through the keyboard, and the memory feature list transmitted in is saved with the detected face information and the corresponding real-time face feature at this moment;

[0036] (2) Memory enhancement: use the features in the memory feature list to update the features in the feature database one by one;

[0037] (3) Update feature storage: store the updated features into the feature database.

[0038] Further, the use of the features in the memory feature list to update the features in the feature database one by one is to realize the enhancement of the features by weighted average of the two features.

[0039] A mask face recognition device based on a knowledge distillation and memory enhancement method, comprising:

[0040] A face mask adding module: used to add a mask to each image in an existing face image database to obtain a face database containing face images and face mask images;

[0041] A face mask feature extraction module: used to encode the face images to obtain feature vectors;

[0042] The knowledge distillation model learning module is configured to use a student model as a feature extraction model according to a knowledge distillation model, wherein the student model adopts an improved MobileNetV4 model including FusedIB blocks, MSIB blocks and ExtraDW blocks composed of channel separable convolutions, and the structure of the improved MobileNetV4 model is: inputting through Conv2D, two FusedIB blocks, an ExtraDW block, four MSIB blocks, ConvNext, two ExtraDW blocks, four MSIB blocks, an average pooling layer, and two Conv2D;

[0043] The MSIB block first uses a 1x1 convolution to expand the channel number of the feature map to twice the original channel number, then divides the feature map into four parts, and sequentially passes through a convolution kernel with a size of 3x3, 5x5, 3x3, a diffusion coefficient of 2, 5x5, a diffusion coefficient of 2, and then restores the channel number through a 1x1 convolution and performs information interaction between different channels.

[0044] The face database comparison module is configured to perform face recognition by similarity measurement of real-time features and features in a feature database, and to realize real-time feedback of recognition results through face frame selection and information labeling.

[0045] The face memory enhancement module is configured to save face feature data when recognition is correct, and to update stored face data in the feature database.

[0046] A computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the mask face recognition method based on the knowledge distillation and memory enhancement method when executing the computer program.

[0047] A computer readable storage medium stores a computer program, and the computer program implements the steps of the mask face recognition method based on the knowledge distillation and memory enhancement method when executed by a processor.

[0048] A mask face recognition device based on a knowledge distillation and memory enhancement method includes a computer device running on a portable mobile device and a camera.

[0049] The advantages of this invention compared to existing technologies are as follows: The face addition module adds pre-selected masks to faces and stores them in the database, improving face recognition performance and detection speed under mask occlusion conditions and effectively avoiding the missed detections and false detections problems of ordinary face recognition algorithms when masks are occluded; the face mask feature extraction module represents the image as a 512-dimensional face feature vector, greatly reducing storage and computation costs; the knowledge distillation model learning module provides an unsupervised learning method that can train any deep learning network as a feature extraction module; the face database comparison module implements different similarity measurement methods to cope with different application scenarios; and the face memory enhancement module enhances the vector representation of face features, improving detection accuracy. This method is suitable for face recognition scenarios with mask occlusion. Attached Figure Description

[0050] The present invention will be further described below with reference to the accompanying drawings:

[0051] Figure 1 Here is a flowchart of a face mask recognition method based on knowledge distillation and memory enhancement;

[0052] Figure 2 Teacher network: InceptionResNetV1 model structure diagram;

[0053] Figure 3 For student networks: Improved model architecture diagram of MobileNetV4;

[0054] Figure 4 A flowchart for teacher network knowledge transfer using the knowledge distillation method;

[0055] Figure 5 Flowchart for enhancing memory;

[0056] Figure 6 Add an illustration to the face mask;

[0057] Figure 7 This is a schematic diagram of the real-time face recognition result using the method of the present invention (under bright light conditions);

[0058] Figure 8 This is a schematic diagram showing the results of real-time face recognition using the method of the present invention (under dim lighting conditions). Detailed Implementation

[0059] like Figures 1 to 8 As shown, this invention provides a masked face recognition method based on knowledge distillation and memory enhancement, which can be used in complex or dimly lit environments such as underground mines. It can effectively recognize faces obscured by masks. This method combines traditional face recognition algorithms with deep learning-based face recognition algorithms. The method's process includes the following steps:

[0060] S1: Construct a face database, the specific implementation steps are as follows:

[0061] (1) Extract the face image of the database: read each image from the image database, and each image represents a face information;

[0062] (2) Face feature point conversion: for the extracted image, first use the MTCNN model to extract the face image in the image, and then use the dlib library to convert the face into 68 feature key points to obtain the absolute coordinates of the feature key points relative to the face image;

[0063] (3) Mask selection: based on the input parameters, select the specified mask image and cover different colors, if there is no specified parameter, randomly select the mask type and color to add;

[0064] (4) Mask addition: obtain the absolute coordinates corresponding to the chin contour key point and the nose bridge key point, adjust the size and rotation angle of the mask image, and cover the adjusted mask image to the chin position of the face to obtain the face image with the added mask;

[0065] (5) Face mask image storage: save the obtained face mask image into the image database, and obtain the face database containing normal face and face wearing mask.

[0066] S2: Face mask feature extraction, the specific implementation steps are as follows:

[0067] (1) Extract the image in the face database constructed in step S1: according to the input parameters, read the face image / face mask image in the face database, if no parameter is specified, read the face mask image;

[0068] (2) Face image feature extraction: input the extracted image into the feature extraction model, and the feature extraction model converts each image into a 512-dimensional feature vector; wherein the feature extraction model uses the student model in the knowledge distillation model;

[0069] (3) Face mask feature vector storage: save the converted 512-dimensional feature vector and its corresponding face user information into the feature (vector) database. The extracted 512-length feature reduces the data scale by nearly 90% compared to the original image dimension, and the extracted feature can effectively reflect the face information. Greatly reduce the data amount in the face comparison stage.

[0070] S3: Construct a knowledge distillation model: the knowledge distillation model includes a teacher model and a student model, and the specific implementation steps are as follows:

[0071] (1) Teacher model construction: read the pre-trained InceptionResNetv1 model as the teacher model, which is used to guide the training of the student model, the InceptionResNetV1 model is trained in the vggface2 dataset, which has strong feature extraction ability and can be used for knowledge transfer;

[0072] As shown in Figure 2 The teacher model of the method of the application uses an InceptionResNetv1 model, the InceptionResNetv1 network fuses Inception blocks and ResNet blocks to improve the ability of the model to extract features, wherein the Inception blocks ensure the recognition ability of the model to face images of different sizes, and the ResNet blocks ensure the stable update of the model during the training process. The InceptionResNetV1 network is pre-trained on the vggface2 dataset, which contains more than 40,000 images, including face images of different ages, nationalities and shooting angles. The teacher network trained using the vggface2 dataset has strong feature extraction ability.

[0073] (2) Student model construction: an improved MobileNetv4 model is constructed as the student model, the student model has small parameter quantity and fast feature extraction speed, and the knowledge transfer from the teacher model to the student model can enhance the feature extraction ability of the student model;

[0074] As shown in Figure 3 The student model of the method of the application uses an improved MobileNetV4 feature network as the student model, which uses a more lightweight image processing module, and the FusedIB block, IB block and ExtraDW block composed of channel separable convolution (DWConv) are used to build the MobileNetV4 network structure, which can reduce the parameters of the model, thereby improving the speed of feature extraction and face detection of the model. On this basis, the MobileNetV4 model is improved, and the IB block in the model is replaced by a Multi-Scale Inverted Bottleneck block (MSIB). Compared with the IB module, the MSIB module uses multiple parallel convolution layers to process the feature map.

[0075] The MSIB structure first expands the channel number of the feature map using a 1*1 convolution, and is raised to twice the original channel number, then the feature map is divided into 4 parts, and is sequentially processed through a convolution kernel with a size of 3*3, 5*5, 3*3, a diffusion coefficient of 2, 5*5, a diffusion coefficient of 2, and then through a 1*1 convolution to restore the channel number and perform information interaction between different channels. The proposed MSIB structure can better extract face information of different sizes, and improve the detection accuracy of the model under the premise of ensuring the parameter quantity.

[0076] Compared with the IB module using channel-by-channel convolution in the middle layer, the MSIB divides the feature map into 4 parts in the channel direction, and each part is processed using convolution with different kernel sizes and diffusion coefficients, which can extract face information of different scales, improve the detection accuracy, and ensure that the parameters do not increase dramatically.

[0077] (3) Teacher knowledge transfer: using the vggface2 dataset, input into the teacher model and the student model, using the MSE loss function to align the output of the student model with the output of the teacher model, and transferring the knowledge of the teacher model to the student model in this way. The loss function can be expressed as:

[0078]

[0079] In the formula: f student represents the output result of the student model, f teacher represents the output result of the teacher model, n represents the number of samples, and x i represents the input.

[0080] As shown in Figure 4 , the knowledge distillation process of the method of the application, the unlabeled data is used to simultaneously transfer to the teacher model and the student model, the output of the teacher model is used as a label, the output of the student model is aligned with the output of the teacher model, and the parameter update of the student model is performed through the MSE loss function. In this way, the knowledge of the teacher model is imparted to the student model, and the student model obtained by this method is used as a feature extraction model, which can simultaneously consider the extraction accuracy and speed.

[0081] (4) Student model storage: the student model with knowledge is saved, and the saved student model can be used as a feature extraction model.

[0082] The teacher model is characterized by strong feature extraction capability but slow speed, and the student model is characterized by limited feature extraction capability but fast speed. The knowledge distillation method can transfer the knowledge of the teacher model to the student model, effectively improve the feature extraction capability of the student model, and thus improve the detection accuracy and speed of the method.

[0083] The model training using the knowledge distillation method can avoid image labeling, effectively reduce the workload, and train the model on different types of data sets.

[0084] S4: Face database comparison: open the real-time detection camera, take the camera picture every certain time, input it into the feature extraction model, measure the similarity of the extracted features with the features in the feature database, and output the face information corresponding to the highest similarity feature. The specific implementation steps are as follows:

[0085] (1) Feature database reading: according to the selected parameters, extract the face features / face mask features and their corresponding face user information from the feature database. If no parameters are specified, read the face mask features;

[0086] (2) Real-time camera detection: open the device camera, and take the camera picture image every certain time;

[0087] (3) Real-time feature extraction: input the captured camera picture into the feature extraction model to obtain the feature vector corresponding to the real-time face;

[0088] (4) Feature comparison: measure the similarity of the real-time face features and the read features one by one, and decide whether to add the features to the candidate list according to the threshold. If it is greater than the threshold, it is added, otherwise it is not added;

[0089] (5) Face information output: after the face features and the read features are compared, sort the obtained candidate list, and output the face user information corresponding to the highest similarity feature.

[0090] When performing similarity measurement, different methods can be used to calculate similarity, such as Euclidean distance, cosine similarity, Manhattan distance, etc. Different distance calculation methods can be applied to different scenarios.

[0091] S5: Face memory enhancement: use the candidate list obtained in step S4 as memory features to perform memory enhancement operation on the corresponding features in the feature database, and update and store the enhanced data to the feature database. The specific implementation steps are as follows:

[0092] (1) Memory feature collection: during the face data comparison process in step S4, the detected results can be transmitted into the memory feature list in real time through the keyboard. The memory feature list transmits the detected face information and the corresponding real-time face features at this time;

[0093] (2) Memory enhancement: the features in the feature database are updated in turn using the features in the memory feature list, and the specific implementation steps are to perform weighted averaging on two features to achieve feature enhancement, the weight can be passed through parameters, if no parameters are passed, the weight is 0.5, and the update formula can be expressed as:

[0094]

[0095] In the formula: indicates the updated feature of the ith user, indicates the memory feature of the ith user, indicates the feature before updating of the ith user, and alpha1 and alpha2 indicate weight factors.

[0096] (3) Update feature storage: store the updated feature into the feature database.

[0097] As shown in Figure 5 , the memory enhancement process of the method is shown, in the detection process, the correct features and user information are stored into the memory list through keyboard input, after the detection is completed, all features in the memory list are matched with the corresponding user in the feature database, the memory features are weighted and averaged with the features in the feature database, compared with adjusting the parameter space of the model, adjusting the vector space of the feature data has smaller operation cost and feasibility. The adjusted feature vector is more suitable for more complex face detection scenarios.

[0098] As shown in Figure 6 , the face mask adding process of the method is shown, first, the face image is extracted from the database, the face data in the image is recognized using the dlib library, the input mask image is added to the face, and the face data after adding the mask is returned.

[0099] As shown in Figure 7 , real-time detection is performed using the student model, it can be found that the model can recognize the registered face under normal conditions, frame the recognized face and return the registration information; when the face and chin are blocked, the model can also accurately recognize the face information; in particular, when the camera does not appear face information, “No face detected” is marked in the return.

[0100] As shown in Figure 8 , real-time detection is performed using the student model, and face recognition test is performed under dim conditions, it can be found that the model can accurately recognize the face under relatively dim conditions, and can also better recognize the face information in the case of wearing a mask and blocking the head region.

[0101] The application further provides a mask face recognition device based on a knowledge distillation and memory enhancement method, which comprises a face mask adding module, a face mask feature extraction module, a knowledge distillation model learning module, a face database comparison module and a face memory enhancement module, wherein the face mask adding module adds a mask to a face based on dlib; the face mask feature extraction module encodes a face image to obtain a feature vector with smaller storage space; the knowledge distillation model learning module learns a model under a no-label condition, can combine the advantages of a teacher model and a student model, and obtain the most effective feature extraction model; the face database comparison module compares real-time features with features in a feature database to perform face recognition, and performs real-time feedback of a recognition result through face frame selection and information labeling; and the face memory enhancement module can save face feature data when recognition is correct, update stored face data in the feature database, and enhance the recognition accuracy of the face.

[0102] The application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the mask face recognition method based on the knowledge distillation and memory enhancement method when executing the computer program.

[0103] The application further provides a computer readable storage medium, which comprises a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the mask face recognition method based on the knowledge distillation and memory enhancement method of the application when the computer program runs.

[0104] The application further provides a mask face recognition device based on a knowledge distillation and memory enhancement method, which comprises a computer device running on a portable mobile device and a camera.

[0105] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the application, and not to limit them; although the application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the application.

Claims

1. A mask face recognition method based on a knowledge distillation and memory enhancement method, characterized in that: The method comprises the following steps: S1: constructing a face database: adding a mask to the existing face image database, and storing the face image with the added mask in the face image database to obtain the face database; S2: face mask feature extraction: converting each image in the face database into a feature vector through a feature extraction model and storing it; S3: constructing a knowledge distillation model: the knowledge distillation model includes a teacher model and a student model, and the specific implementation steps are as follows: (1) teacher model construction: reading a pre-trained InceptionResNetv1 model as a teacher model to guide the training of a student model; (2) student model construction: constructing an improved MobileNetv4 model as a student model, the improved MobileNetV4 model includes FusedIB blocks, MSIB blocks and ExtraDW blocks composed of channel separable convolutions, and the structure of the improved MobileNetV4 model is: inputting through Conv2D, two FusedIB blocks, ExtraDW blocks, four MSIB blocks, ConvNext, two ExtraDW blocks, four MSIB blocks, an average pooling layer, and two Conv2D; The MSIB block first uses a 1x1 convolution to expand the channel number of the feature map to twice the original channel number, then divides the feature map into four parts, and then passes through a convolution kernel size of 3x3, 5x5, 3x3, a diffusion coefficient of 2, 5x5, a diffusion coefficient of 2, and then restores the channel number through a 1x1 convolution and performs information interaction between different channels; (3) teacher knowledge transmission: using a loss function to align the output of the student model with the output of the teacher model, and transmitting the knowledge of the teacher model to the student model in this way, (4) student model storage: saving the student model with the knowledge, and the saved student model is used as a feature extraction model; S4: face database comparison: collecting face data and inputting it into the feature extraction model, performing similarity measurement on the extracted features and the features in the feature database, and outputting the face information corresponding to the highest similarity feature; S5: face memory enhancement: performing memory enhancement operation on the corresponding features in the feature database, and updating and storing the enhanced data in the feature database.

2. The mask face recognition method based on the knowledge distillation and memory enhancement method according to claim 1, characterized in that: The specific implementation steps of step S1 are as follows: (1) extracting database face images: reading each image from the image database, and each image represents a face information; (2) face feature point conversion: for the extracted image, first use the MTCNN model to extract the face image in the image, and then use the dlib library to convert the face into 68 feature key points to obtain the absolute coordinates of the feature key points relative to the face image; (3) mask selection: based on the input parameters, select a specified mask image and cover different colors, if there is no specified parameter, randomly select a mask type and color for addition; (4) Mask addition: Obtain the absolute coordinates corresponding to the chin key points and the nose bridge key points, adjust the size and rotation angle of the mask image, overlay the adjusted mask image to the chin position of the face, and obtain the face image with added mask; (5) Face mask image storage: save the obtained face mask image into the image database, and obtain a face database containing normal faces and faces wearing masks.

3. The mask face recognition method based on the knowledge distillation and memory enhancement method according to claim 2, characterized in that: The specific implementation steps of step S2 are as follows: (1) Extract the image in the face database constructed in step S1: read the face image / face mask image in the face database according to the input parameter, and read the face mask image if no parameter is specified; (2) Face image feature extraction: input the extracted image into the feature extraction model, and the feature extraction model converts each image into a feature vector; (3) Face mask feature vector storage: save the converted feature vector together with its corresponding face user information into the feature database.

4. The mask face recognition method based on the knowledge distillation and memory enhancement method according to claim 3, characterized in that: The specific implementation steps of step S4 are as follows: (1) Feature database reading: extract the face feature / face mask feature and its corresponding face user information from the feature database according to the selected parameter, and read the face mask feature if no parameter is specified; (2) Real-time camera detection: open the device camera and take a picture every certain period of time; (3) Real-time feature extraction: input the captured camera picture into the feature extraction model to obtain the feature vector corresponding to the real-time face; (4) Feature comparison: compare the feature vector corresponding to the real-time face with the read features one by one to measure the similarity, and decide whether to add to the candidate list according to the threshold value, if greater than the threshold value, add it, otherwise do not add it; (5) Face information output: after the face feature and the read feature are compared, sort the obtained candidate list, and output the face user information corresponding to the feature with the highest similarity.

5. The mask face recognition method based on the knowledge distillation and memory enhancement method according to claim 4, characterized in that: The specific implementation steps of step S5 are as follows: (1) Memory feature collection: During the face data comparison process in step S4, the detected results are transmitted into the memory feature list in real time through the keyboard, and the memory feature list saves the detected face information and the corresponding real-time face feature at this moment; (2) Memory enhancement: update the features in the feature database one by one using the features in the memory feature list; (3) Update feature storage: store the updated features into the feature database.

6. The mask face recognition method based on the knowledge distillation and memory enhancement method according to claim 5, characterized in that: The updating of the features in the feature database one by one using the features in the memory feature list is to realize the enhancement of the features by weighted average of the two features.

7. A mask face recognition device based on a knowledge distillation and memory enhancement method, characterized in that: It includes: Face mask addition module: used to add a mask to each image in the existing face image database to obtain a face database containing face images and face mask images; Face mask feature extraction module: used to encode face images to obtain feature vectors; The knowledge distillation model learning module is configured to use a student model as a feature extraction model according to a knowledge distillation model, wherein the student model adopts an improved MobileNetV4 model including FusedIB blocks, MSIB blocks and ExtraDW blocks composed of channel separable convolutions, and a structure of the improved MobileNetV4 model is: inputting through Conv2D, two FusedIB blocks, an ExtraDW block, four MSIB blocks, ConvNext, two ExtraDW blocks, four MSIB blocks, an average pooling layer, and two Conv2D; The MSIB block first uses a 1x1 convolution to expand the channel number of the feature map to twice the original channel number, then divides the feature map into four parts, and sequentially passes through a convolution kernel with a size of 3x3, 5x5, 3x3, a diffusion coefficient of 2, 5x5, a diffusion coefficient of 2, and then restores the channel number through a 1x1 convolution and performs information interaction between different channels. The face database comparison module is configured to perform face recognition by similarity measurement of real-time features and features in the feature database, and to realize real-time feedback of recognition results through face frame selection and information labeling. The face memory enhancement module is configured to save face feature data when the recognition is correct, and to update the stored face data in the feature database.

8. A computer device, comprising: The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the steps of the mask face recognition method based on the knowledge distillation and memory enhancement method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the steps of the mask face recognition method based on the knowledge distillation and memory enhancement method according to any one of claims 1 to 6.

10. A mask face recognition device based on a knowledge distillation and memory enhancement method, characterized in that: The computer equipment and the camera are run on a portable mobile device.

Citation Information

Patent Citations

  • Face recognition method and device based on rapid mask generation

    CN116665279A

  • Method for recognizing face with mask based on deep learning

    CN117558044A