A face recognition method
By acquiring facial images of people without and with masks in the training environment, generating images with masks using a GAN network, and combining feature comparison, the problem of low recognition accuracy caused by wearing masks is solved, achieving higher recognition accuracy and system optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN MIRACLE WISDOM NETWORK CO LTD
- Filing Date
- 2023-01-18
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, wearing masks reduces the accuracy of facial recognition, and there is a contradiction between human body structure and facial recognition when used simultaneously, making it impossible to effectively guarantee recognition accuracy.
By acquiring facial images of people without and with masks in a preset training environment, a database is established. Then, a GAN network is used to generate facial images of people with masks for inclusion in the database. The recognition accuracy is improved by combining facial features and structured features.
It improves the accuracy of facial recognition when people are wearing masks, solves the recognition problem when wearing masks, optimizes the contradiction between human body structure and facial recognition, and improves the overall accuracy of the recognition system.
Smart Images

Figure CN116071803B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, specifically to a facial recognition method. Background Technology
[0002] With the rapid development of science and technology, especially the Internet of Things, the Internet, and AI, multifunctional smart poles have become an indispensable product for building smart and safe cities. However, in actual implementation, the following challenges exist for facial recognition of people wearing masks:
[0003] (1) Wearing a mask obscures most of the facial features of the person to be identified, which greatly reduces the accuracy of identification.
[0004] (2) In daily life, for example, the hats worn by deliverymen and security personnel due to the nature of their work also cover most of their facial features, which further reduces the accuracy of recognition.
[0005] (3) Existing technologies often employ human body structuring, which involves re-identifying the object to be identified. However, there is a contradiction when human body structuring and face recognition are used simultaneously: face recognition requires a smaller field of view to obtain a larger face image, while human body structuring requires a sufficiently large field of view to obtain more human feature information, resulting in the recognition accuracy still not being guaranteed. Summary of the Invention
[0006] To address the aforementioned technical problems, this application provides a face recognition method that aims to resolve the issues of low face recognition accuracy when the subject is wearing a mask and the contradictions that exist when using human body structuring and face recognition simultaneously in existing technologies.
[0007] To achieve the above objectives, this application provides a face recognition method, comprising the following steps:
[0008] In a preset training environment, a first face training image of the training subject without a mask and a second face training image of the training subject with a mask are acquired, and a training dataset is generated based on the first face training image and the second face training image.
[0009] Establish a database for storing facial images of people wearing or not wearing masks, train the training dataset to obtain a replacement model, and use the replacement model to generate a second facial image of a person wearing a mask based on the first facial image of a person not wearing a mask to be stored in the database.
[0010] A facial image of the subject to be identified, whether wearing a mask or not, is acquired, and the acquired facial image is compared with the second facial image in the database to determine whether the subject to be identified matches the training object.
[0011] Optionally, the step of comparing the captured face image with the second face database image to determine whether the object to be identified matches the training object includes:
[0012] First facial features and first facial structured features are obtained based on the first facial image and the second facial image; second facial features and second facial structured features are obtained based on the facial image.
[0013] The second facial feature and the second facial structured feature are compared with the first facial feature and the first structured feature, respectively, to determine whether the object to be identified matches the training object.
[0014] Optionally, obtaining the second facial features and the second facial structured features based on the captured facial image includes:
[0015] The second facial structured features are obtained from the facial acquisition image, the facial acquisition image is preprocessed to obtain a cropped facial image, and it is determined whether the cropped facial image meets the requirements of image quality assessment.
[0016] If the cropped face image meets the requirements of image quality assessment, then the second face feature is obtained.
[0017] Optionally, the step of preprocessing the captured face image to obtain a cropped face image, and determining whether the cropped face image meets the requirements of image quality assessment, includes:
[0018] The face acquisition image is cropped to obtain a face cropped image that only displays the face area. The face cropped image is then subjected to image correction and image illumination equalization. The face cropped image that has undergone image correction and image illumination equalization is used to perform image quality evaluation to obtain an evaluation score. It is then determined whether the evaluation score is greater than a preset evaluation threshold.
[0019] If the evaluation score is greater than the preset evaluation threshold, then the second facial feature is obtained based on the cropped facial image;
[0020] If the evaluation score is less than the preset evaluation threshold, the cropped face image is discarded, and the process returns to the step of acquiring the face image of the object to be identified, whether it is wearing a mask or not.
[0021] Optionally, after obtaining the second facial features from the cropped facial image, the method further includes:
[0022] The second facial feature is matched with the first facial feature to obtain facial feature similarity, and it is determined whether the facial feature similarity is greater than a preset first facial feature matching threshold.
[0023] If the facial feature similarity is greater than a preset first facial feature matching threshold, then the object to be identified corresponding to the second facial feature is determined to be the same object as the training object corresponding to the first facial feature.
[0024] Optionally, determining whether the facial feature similarity is greater than a preset first facial feature matching threshold further includes:
[0025] If the facial feature similarity is less than a preset first facial feature matching threshold and greater than a preset second facial feature matching threshold, then a preset number of first and second facial feature images of the training object corresponding to the maximum facial feature similarity are obtained, and a first score for each training object is determined based on the total number of the first and second facial feature images obtained and the total number of the first and second facial feature images of each training object.
[0026] The second structured feature is used to perform structure matching with the first structured feature corresponding to the preset number of training objects to obtain a second score for each training object;
[0027] Based on the first score, the second score, and the weight ratio between facial features and facial structured features, a total matching score is determined for each training object. Based on the total matching score, it is determined whether the object to be identified matches a preset number of training objects.
[0028] Optionally, determining whether the object to be identified matches a preset number of training objects based on the total matching score includes:
[0029] Determine whether the total matching score of each training object is greater than a preset judgment threshold;
[0030] If the total matching score of any preset number of training objects is greater than a preset judgment threshold, then the training object and the object to be identified corresponding to the second structured feature are determined to be the same object.
[0031] Optionally, determining whether the facial feature similarity is greater than a preset first facial feature matching threshold further includes:
[0032] Each training object in the database is assigned a different primary ID number, and the first face image and the second face image of each training object are assigned different sub-ID numbers according to the primary ID number.
[0033] If the facial feature similarity is less than a preset first facial feature matching threshold and greater than a preset second facial feature matching threshold, then a preset number of the main ID number and the sub-ID number associated with the main ID number are obtained, and a first score for each main ID number is determined based on the total number of the sub-ID numbers and the total number of sub-ID numbers associated with each main ID number.
[0034] Optionally, after obtaining the second facial features and the second facial structured features based on the captured facial image, the method further includes:
[0035] The second facial feature and the second facial structured feature are matched with the first facial feature and the first facial structured feature respectively to obtain a matching similarity, and it is determined whether the matching similarity is greater than a preset replacement threshold.
[0036] If the matching similarity is greater than the preset replacement threshold, then the second face training image is replaced with the face acquisition image.
[0037] If the matching similarity is less than a preset replacement threshold, a preset number of second face training images with the highest matching similarity to the face acquisition image are output, and the preset number of second face training images are manually judged to determine whether they match the face acquisition image.
[0038] Optionally, after manually determining whether a preset number of the second face training images match the face acquisition images, the process includes:
[0039] If a preset number of the second face training images fail to match the face acquisition images, the face acquisition images are stored in a face data acquisition library that provides a database source for face recognition, face detection, and the replacement model. Attached Figure Description
[0040] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a schematic flowchart of a face recognition method according to an embodiment of this application;
[0042] Figure 2 This is a schematic diagram of a module device for a face recognition method according to an embodiment of this application. Detailed Implementation
[0043] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some, not all, of the embodiments of the present invention. Based on the description of the present invention, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present invention.
[0044] The following specific embodiments illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification.
[0045] The terms “first,” “second,” “third,” etc., are used merely to distinguish elements with similar properties, not to indicate or imply relative importance or a specific order.
[0046] Furthermore, the terms “including,” “comprising,” or any other variations thereof are intended to cover non-exclusive inclusion, which includes not only the elements listed but also other elements not expressly listed.
[0047] Figure 1 The diagram shows a flowchart of the face recognition method provided in an embodiment of the present invention. Please refer to it. Figure 1 The facial recognition method includes the following steps:
[0048] In step S100, a first face training image of the training subject without a mask and a second face training image of the training subject with a mask are acquired in a preset training environment, and a training dataset is generated based on the first face training image and the second face training image.
[0049] In one implementation, face capture devices (commonly such as surveillance cameras or infrared cameras) are installed on multi-functional smart poles along urban roads. The backend can remotely control and capture facial images of pedestrians on the street in real time. Specifically, the preset training environment may include, but is not limited to, different lighting conditions, different climates, different visibility levels, and different temperatures. Under the preset training environment, the backend can control the face capture device to acquire facial images of all pedestrians passing within the camera's field of view. If the acquired facial image shows a pedestrian without a mask, it is labeled as the first face training image; if the acquired facial image shows a pedestrian wearing a mask, it is labeled as the second face training image. Subsequently, a training dataset is generated using the real-time acquired first and second face training images.
[0050] In step S110, a database is established to store facial images of people wearing or not wearing masks. A replacement model is trained on the training dataset. The replacement model is then used to generate a second facial image of a person wearing a mask based on the first facial image of a person not wearing a mask to be stored.
[0051] Furthermore, the backend first needs to establish a database to store all facial images acquired by the face capture device, both those wearing masks and those not. Secondly, a GAN (Generative Adversarial Network) is selected to train the training dataset, resulting in a replacement model capable of replacing unmasked facial images with masked facial images. Finally, the replacement model is used to generate corresponding masked second-face images for all unmasked first-face images to be added to the database. In one scenario, if the face capture device acquires a face image of a passerby named Zhang San without a mask, the replacement model can generate a varying number of images of Zhang San wearing different types and colors of masks. The acquisition methods for the first and second face images are the same as in step S100 and will not be elaborated here. On the other hand, GAN networks are a commonly used technique in this field and will not be described in detail here either.
[0052] In step S120, a face image of the object to be identified, whether wearing a mask or not, is acquired, and the face image is compared with the second face image in the database to determine whether the object to be identified matches the training object.
[0053] In this embodiment, the method for acquiring facial images in this step can be, but is not limited to, facial capture devices on electronic sentry posts, facial capture devices used for company attendance tracking, and facial capture devices used for security at the entrance of residential communities. The facial capture device in this step shares a platform with the facial capture device on the smart pole described in step S110, and the captured images can be transmitted between them. Specifically, the facial capture device in this step acquires facial images of the person to be identified, whether wearing a mask or not. These facial images are then compared with the second facial image in the database acquired from the facial capture device in step S110 to determine whether the person to be identified matches a training object in the database. In one scenario, when Li Si enters a building wearing a mask, the electronic sentry at the entrance acquires a facial image of Li Si wearing a mask. The built-in wireless network module transmits this image to the backend. Upon receiving the image, the backend automatically compares it with all the second facial images in the database to determine whether Li Si is the same person as a training object in the database.
[0054] Optionally, the comparison between the captured face image and the second face database image in step S120 to determine whether the target object matches the training object specifically includes: First, performing face feature analysis and face structured feature analysis on the first and second face database images obtained in step S110 to obtain first face features and first face structured features, respectively. Second, performing face feature analysis and face structured feature analysis on the captured face image obtained in step S120 to obtain second face features and second face structured features. Finally, comparing the second face features with the first face features and comparing the second face structured features with the first structured features to determine whether the target object matches the training object. Among them, the content of facial feature analysis and processing can include eyebrow direction, single or double eyelids, eyelid distance, nose bridge shape, whether the brow bone is prominent, hairline height, whether there are moles or birthmarks on the face, etc. The content of facial structure feature analysis and processing can include whether a mask is worn, the color of the mask, the type of the mask, whether a hat is worn, the color of the hat, the type of the hat, gender, hair color, etc., without any restrictions.
[0055] Optionally, the acquisition of the second facial features and the second facial structured features based on the facial capture image described above specifically includes: First, performing facial structured feature analysis on the facial capture image of the object to be identified acquired by the facial capture device in step S120 to obtain the second facial structured features. Second, preprocessing the facial capture image to obtain a cropped facial image. Finally, determining whether the cropped facial image meets the requirements of image quality assessment; if the cropped facial image meets the requirements of image quality assessment, then performing facial structure analysis on the cropped facial image to obtain the second facial features.
[0056] Optionally, the preprocessing of the captured face image described above to obtain a cropped face image, and the determination of whether the cropped face image meets the requirements of image quality assessment, specifically includes: first, cropping and deleting all regions of the captured face image except for the face region to obtain a cropped face image displaying only the face region; second, performing image correction and image illumination equalization on the cropped face image; and finally, performing image quality assessment on the cropped face image after image correction and image illumination equalization to obtain a corresponding assessment score, and determining whether the assessment score is greater than a preset assessment threshold. If the assessment score is greater than the preset assessment threshold, then performing facial structure analysis processing on the cropped face image to obtain a second facial feature. If the assessment score is less than the preset assessment threshold, it indicates that the image quality of the cropped face image is too low and cannot be used for subsequent recognition steps. To avoid accumulating invalid resources, cropped face images with evaluation scores below a preset evaluation threshold are automatically discarded and destroyed. The process then returns to the step above where the system acquires face images of the subject, whether wearing a mask or not, for preprocessing the next face image. Since face images acquired by the face acquisition device may have issues including, but are not limited to, unclear, distorted, under-centered, or excessively bright or dark lighting, preprocessing includes image correction and illumination equalization of the cropped face image to obtain a clearer and more accurate face image, thereby improving recognition accuracy.
[0057] Optionally, after obtaining the second facial feature from the cropped face image as described above, the process further includes: automatically matching the second facial feature of the object to be identified with the first facial features of all training objects in the database to obtain facial feature similarity scores. Then, it is determined whether the similarity score of each facial feature is greater than a preset first facial feature matching threshold. If any facial feature similarity score is greater than the preset first facial feature matching threshold, then it can be determined that the object to be identified corresponding to the second facial feature and the training object corresponding to the first facial feature are the same person. It is understandable that the higher the facial feature similarity, i.e., the higher the matching degree between the two facial images, the higher the probability that the objects corresponding to the two facial images are the same person. For example, if the first facial feature matching threshold is 95%, when the facial feature similarity reaches or exceeds 95%, excluding twins, it can be concluded that the object to be identified corresponding to the second facial feature and the training object corresponding to the first facial feature are the same person.
[0058] Optionally, the determination of whether the facial feature similarity is greater than a preset first facial feature matching threshold, as described above, further includes: if the facial feature similarity is less than the preset first facial feature matching threshold but greater than a preset second facial feature matching threshold, then a preset number of first and second facial images of the training subjects with the maximum corresponding facial feature similarity values are obtained from the database. A first score for each training subject is determined based on the total number of obtained first and second facial images and the total number of first and second facial images for each training subject. Specifically, the preset second facial feature matching threshold is less than the preset first facial feature matching threshold. For example, if the preset second facial feature matching threshold is 85% and the preset first facial feature matching threshold is 95%, then when the facial feature similarity is within the range of greater than 85% and less than 95%, a preset number of training objects and their corresponding first and second facial feature images are retrieved from the database. The logic for retrieving training objects is to sort them in descending order of facial feature similarity and select the preset number of training objects with the highest facial feature similarity. The preset number is not unique and can be 3, 5, 8, 11, etc.
[0059] Furthermore, the number of first and second face images stored in the database for each training subject is uncertain. For example, Zhang San may have 3 first face images and 10 second face images. For instance, the preset number is set to 5. Following the logic described above, firstly, the first and second face images corresponding to each of the 5 training subjects are obtained and summed to obtain a total number of images. Secondly, the first and second face images for each training subject are summed to obtain a total number of images for the 5 individuals. Finally, by dividing the total number of individual images by the total number of images, the first score for each of the 5 training subjects can be obtained. For instance, if the total number of images is 30 and Zhang San has 15 individual images, then Zhang San's first score is: 15 / 30 = 0.5.
[0060] Furthermore, the second structured feature is used to perform structure matching with the first structured feature corresponding to a preset number of training objects to obtain the second score for each training object. Specifically, there are only two states for structure matching: a successful match (status1 = 1) and a failed match (status2 = 0). As mentioned earlier, the content processed by facial structured feature analysis can include whether a mask is worn, the color of the mask, the type of the mask, whether a hat is worn, the color of the hat, the type of the hat, gender, hair color, etc. For the sake of convenience, the content processed by facial structured feature analysis is defined as the aforementioned eight types. Following the logic described above, the second structured feature of the object to be identified is structure-matched with the first structured feature of each training object. For example, if the mask worn by Zhang San in his facial image is black, and the mask worn by the first training object among the five training objects is blue, then the state of the first training object in the "mask color" category is status2. Following this logic, the state of each training object in the eight matching contents can be determined. Following this, weights are determined according to the importance of the eight types of facial structured feature analysis. Then, a weighted sum is calculated based on the product of these weights and the state of each training object across the eight matching categories to obtain the second score for each training object. For example, the weights for the eight matching categories are 0.2, 0.05, 0.05, 0.1, 0.1, 0.1, 0.2, and 0.2. The first training object's first structured feature is matched with Zhang San's second structured feature. The states across the eight matching categories are: status1, status2, status1, status2, status2, status2, status1, status1. Therefore, the second score for the first training object is:
[0061] 0.2*1+0.05*0+0.05*1+0.1*0+0.1*0+0.1*0+0.2*1+0.2*1=0.65.
[0062] Furthermore, based on the first score, the second score, and the weight ratio between facial features and facial structured features, the total matching score for each training object is determined. The total matching score is then used to determine whether the object to be identified matches a preset number of training objects. Specifically, the weight ratio between facial features and facial structured features is first determined based on their importance. For example, facial features are more persuasive in improving the recognition rate, so their weight can be set as facial features: facial structured features = 6:4. As mentioned earlier, the first score is obtained based on matching facial features, and the second score is obtained based on matching facial structured features. Therefore, in this step, the total matching score for each training object is obtained by adding the product of the first score and the facial feature weight to the product of the second score and the facial structured feature weight. For example, as mentioned earlier, if the first score for the first training object is 0.5 and the second score is 0.65, then the total matching score for the first training object is: 0.5 * 0.6 + 0.65 * 0.4 = 0.56.
[0063] Furthermore, the matching score of each training object is used to determine whether the object to be identified matches the preset number of training objects. By dividing the face image acquired by the face acquisition device into two parts according to the face structure and the face structured features, and then performing weighted summation on each part to obtain a matching score, a sufficiently rigorous method can effectively improve the recognition accuracy.
[0064] Optionally, the method described above for determining whether the target object matches a preset number of training objects based on the total matching score further includes: determining whether the total matching score of each training object is greater than a preset judgment threshold. If the total matching score of any preset number of training objects is greater than the preset judgment threshold, then the training object and the target object corresponding to the second structured feature are determined to be the same object. It can be understood that setting a judgment threshold serves as a final hurdle in determining whether the target object and the training objects are the same person. For example, determining whether the total matching score of each of the five training objects is greater than the preset judgment threshold; if the total matching score of any one of the five training objects is greater than the preset judgment threshold, then it can be concluded that the training object and the target object corresponding to the second structured feature are the same person.
[0065] Optionally, the determination of whether the facial feature similarity is greater than a preset first facial feature matching threshold, as described above, further includes: assigning different master IDs to the training objects in the database, and then assigning different sub-IDs to the first and second facial images of each training object based on the master IDs. For example, Zhang San's master ID is assigned as X1, and sub-IDs are assigned to Zhang San's first and second facial images based on the master IDs, such as X1-1, X1-2, ..., X1-n (n is a positive integer greater than 1). In one embodiment, if the facial feature similarity is less than a preset first facial feature matching threshold but greater than a preset second facial feature matching threshold, the database can obtain a preset number of master IDs and sub-IDs associated with each master ID, and determine a first score for each master ID based on the total number of sub-IDs and the total number of sub-IDs associated with each master ID. Assigning IDs effectively improves the speed and convenience of retrieving and accessing facial images from the database.
[0066] Optionally, after obtaining the second facial features and second facial structured features from the facial capture image as described above, the method further includes: matching the second facial features of the object to be identified with the first facial features of each training object in the database; then matching the second facial structured features of the object to be identified with the first facial structured features of each training object in the database to obtain the matching similarity between the object to be identified and each training object in the database; and finally determining whether any matching similarity exceeds a preset replacement threshold. For example, if the matching similarity between the object to be identified and Zhang San in the database exceeds the preset replacement threshold, then it can be concluded that the object to be identified is Zhang San. In this case, the facial capture image of the object to be identified is automatically used to replace the second facial training image of Zhang San, thereby continuously optimizing the database and effectively improving the recognition accuracy.
[0067] On the other hand, if the matching similarity between the object to be identified and all training objects in the database is less than a preset replacement threshold, then a preset number of second face training images with the highest matching similarity to the face capture image will be automatically output. A manual review will then be conducted to determine whether these preset number of second face training images match the face capture image. Specifically, the matching similarity will be sorted from highest to lowest, and the second face training images of the N (positive integers greater than 1) training objects with the highest matching similarity will be selected. A manual review will then be conducted on the face capture image of the object to be identified and the second face training images of the N training objects to determine whether any of the N training objects matches the object to be identified, thus further optimizing the database.
[0068] Optionally, after manually determining whether a preset number of second face training images match the face acquisition images as described above, the method further includes: if the preset number of second face training images fail to match the face acquisition images, then the face acquisition images of the object to be identified are automatically stored in the face data acquisition library, which provides the database source for face recognition, face detection, and replacement models. That is, in practical applications, the face acquisition device will acquire many face images from different environments. Some face images cannot match the main ID number in the database, so these face images are stored in the face data acquisition library, which provides the database source for face recognition, face detection, and replacement models. The face data acquisition library only stores the unrecognized face images as inventory and cannot be included in the training dataset of step S100.
[0069] Figure 2 A schematic diagram of a module device for a face recognition method is provided. As those skilled in the art will understand, Figure 2 This is merely an example of a modular device and does not constitute a limitation on the modular device. It may include more or fewer components than shown, or combine certain components, or different components. For example, the device may also include input / output devices, network access devices, buses, etc.
[0070] In this embodiment, this application provides an apparatus for a face recognition method. Please refer to [link / reference]. Figure 2 The device includes:
[0071] The face training image acquisition unit is used to acquire a first face training image of the training subject without wearing a mask and a second face training image of the training subject wearing a mask in a preset training environment.
[0072] The training dataset generation unit is electrically connected to the face training image acquisition unit and is used to generate a training dataset based on the first face training image and the second face training image.
[0073] The database building unit is electrically connected to the training dataset generation unit and is used to build a database for storing facial images of people wearing or not wearing masks.
[0074] The training unit, electrically connected to the library building unit, is used to train the training dataset to obtain the replacement model;
[0075] The control unit, electrically connected to the training unit, is used to generate a second face image with a mask on based on a first face image without a mask to be stored using a replacement model.
[0076] The face image acquisition unit is electrically connected to the control unit and is used to acquire face images of the object to be identified, whether the object is wearing a mask or not.
[0077] The face image matching unit is electrically connected to the face image acquisition unit and is used to compare the face acquisition image with the second face database image to determine whether the object to be identified matches the training object.
[0078] The aforementioned device and the cooperation between its internal units achieve the same beneficial effects as the face recognition method described above.
[0079] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this invention should be included within the scope of protection of this invention. Therefore, the scope of protection of this invention should be determined by the appended claims.
Claims
1. A face recognition method, characterized in that, Includes the following steps: In a preset training environment, a first face training image of the training subject without a mask and a second face training image of the training subject with a mask are acquired, and a training dataset is generated based on the first face training image and the second face training image. A database is established to store facial images of people wearing or not wearing masks. The training dataset is used to train a replacement model. The replacement model is then used to generate a second facial image of a person wearing a mask based on a first facial image of a person not wearing a mask to be stored. Acquire facial images of the subject to be identified, whether wearing a mask or not, and compare the facial images with the second facial database images to determine whether the subject to be identified matches the training subjects; The step of comparing the captured face image with the second face database image to determine whether the object to be identified matches the training object includes: First facial features and first facial structured features are obtained based on the first facial image and the second facial image; second facial features and second facial structured features are obtained based on the facial image. The second facial feature and the second facial structured feature are compared with the first facial feature and the first facial structured feature, respectively, to determine whether the object to be identified matches the training object. This specifically includes the following steps: The second facial feature is matched with the first facial feature to obtain facial feature similarity, and it is determined whether the facial feature similarity is greater than a preset first facial feature matching threshold. If the facial feature similarity is greater than the preset first facial feature matching threshold, then the object to be identified corresponding to the second facial feature and the training object corresponding to the first facial feature are determined to be the same object. If the facial feature similarity is less than a preset first facial feature matching threshold and greater than a preset second facial feature matching threshold, then a preset number of first and second facial feature images of the training object corresponding to the maximum facial feature similarity are obtained, and a first score for each training object is determined based on the total number of the first and second facial feature images obtained and the total number of the first and second facial feature images of each training object. The second face structured feature is used to perform structure matching with the first face structured feature corresponding to the preset number of training objects to obtain the second score of each training object; Based on the first score, the second score, and the weight ratio between facial features and facial structured features, a total matching score is determined for each training object. Based on the total matching score, it is determined whether the object to be identified matches a preset number of training objects.
2. The method according to claim 1, characterized in that, The step of obtaining the second facial features and the second facial structured features based on the captured facial image includes: The second facial structured features are obtained from the facial acquisition image, the facial acquisition image is preprocessed to obtain a cropped facial image, and it is determined whether the cropped facial image meets the requirements of image quality assessment. If the cropped face image meets the requirements of image quality assessment, then the second face feature is obtained.
3. The method according to claim 2, characterized in that, The step of preprocessing the captured face image to obtain a cropped face image and determining whether the cropped face image meets the requirements of image quality assessment includes: The face acquisition image is cropped to obtain a face cropped image that only displays the face area. The face cropped image is then subjected to image correction and image illumination equalization. The face cropped image that has undergone image correction and image illumination equalization is used to perform image quality evaluation to obtain an evaluation score. It is then determined whether the evaluation score is greater than a preset evaluation threshold. If the evaluation score is greater than the preset evaluation threshold, then the second facial feature is obtained based on the cropped facial image; If the evaluation score is less than the preset evaluation threshold, the cropped face image is discarded, and the process returns to the step of acquiring the face image of the object to be identified, whether it is wearing a mask or not.
4. The method according to claim 3, characterized in that, The step of determining whether the object to be identified matches a preset number of training objects based on the total matching score includes: Determine whether the total matching score of each training object is greater than a preset judgment threshold; If the total matching score of any preset number of training objects is greater than a preset judgment threshold, then the training object and the object to be identified corresponding to the second facial structured feature are determined to be the same object.
5. The method according to claim 3, characterized in that, Determining whether the facial feature similarity is greater than a preset first facial feature matching threshold further includes: Each training object in the database is assigned a different primary ID number, and the first face image and the second face image of each training object are assigned different sub-ID numbers according to the primary ID number. If the facial feature similarity is less than a preset first facial feature matching threshold and greater than a preset second facial feature matching threshold, then a preset number of the main ID number and the sub-ID number associated with the main ID number are obtained, and a first score for each main ID number is determined based on the total number of the sub-ID numbers and the total number of sub-ID numbers associated with each main ID number.
6. The method according to claim 1, characterized in that, After obtaining the second facial features and the second facial structured features based on the captured facial image, the process further includes: The second facial feature and the second facial structured feature are matched with the first facial feature and the first facial structured feature respectively to obtain a matching similarity, and it is determined whether the matching similarity is greater than a preset replacement threshold. If the matching similarity is greater than the preset replacement threshold, then the second face training image is replaced with the face acquisition image. If the matching similarity is less than a preset replacement threshold, a preset number of second face training images with the highest matching similarity to the face acquisition image are output, and the preset number of second face training images are manually judged to determine whether they match the face acquisition image.
7. The method according to claim 6, characterized in that, After manually determining whether a preset number of the second face training images match the face acquisition images, the process includes: If a preset number of the second face training images fail to match the face acquisition images, the face acquisition images are stored in a face data acquisition library that provides a database source for face recognition, face detection, and the replacement model.