Face recognition method, device, equipment, storage medium and product

By learning the common distribution of unoccluded and occluded face images, and using a target face recognition model to align the feature distribution, the problem of low accuracy in recognizing occluded face images is solved, achieving higher recognition accuracy and model stability.

CN117011903BActive Publication Date: 2026-04-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-08-02
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, the recognition accuracy of facial images with occlusion is low, and they cannot effectively match the features of unoccluded facial images.

Method used

By learning the common distribution of facial features in unoccluded and occluded face images from the training data, the consistency of feature distribution between occluded and unoccluded face images is improved. The target face recognition model is then used to align the feature distribution and fine-tune the training model parameters.

Benefits of technology

It improves the recognition accuracy of occluded face images, and enhances the stability and recognition accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117011903B_ABST
    Figure CN117011903B_ABST
Patent Text Reader

Abstract

The application discloses a face recognition method, device and equipment, a storage medium and a product, and belongs to the technical field of computers. The method comprises the following steps: acquiring a face image to be processed; inputting the face image to be processed into a target face recognition model for face recognition processing, so as to obtain object recognition information corresponding to the face image to be processed. In the technical scheme provided by the embodiment of the application, the target face recognition model can learn the common distribution of the face features of the face images in the unoccluded sample face set and the occluded sample face set in the training data, so that the feature distribution consistency between the feature distribution of the occluded face image and the feature distribution of the unoccluded face image can be improved, and the face recognition accuracy of the face image to be processed can be improved on the model application side.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a face recognition method, apparatus, device, storage medium, and product. Background Technology

[0002] With the development of technology and artificial intelligence, more and more scenarios require facial recognition, such as payment scenarios, authentication scenarios, login scenarios, etc.

[0003] In related technologies, the recognition mode of face recognition models is the comparison between unobstructed, high-quality faces. For occluded face images, such as faces wearing masks, the image features output by the face recognition model need to be compared with the features of unobstructed face images in the system to determine the target object corresponding to the occluded face image.

[0004] Among related technologies, facial recognition accuracy is low when the face image is occluded. Summary of the Invention

[0005] This application provides a face recognition method, apparatus, device, storage medium, and product that can improve the consistency of feature distribution between occluded face images and unoccluded face images, thereby improving the accuracy of face recognition.

[0006] According to one aspect of the embodiments of this application, a face recognition method is provided, the method comprising:

[0007] Obtain the face image to be processed;

[0008] The face image to be processed is input into the target face recognition model for face recognition processing to obtain the object recognition information corresponding to the face image to be processed;

[0009] The training data corresponding to the target face recognition model includes a sample face set, which includes a first sample face set and a second sample face set. The first sample face set refers to the set of sample face images with unobstructed faces, and the second sample face set refers to the set of sample face images with obstructed faces. The target face recognition model is obtained by learning the common distribution of face features corresponding to sample face images in the first sample face set and the second sample face set.

[0010] According to one aspect of the embodiments of this application, a face recognition device is provided, the device comprising:

[0011] The face image acquisition module is used to acquire the face image to be processed;

[0012] The face image recognition module is used to input the face image to be processed into the target face recognition model for face recognition processing, and obtain the object recognition information corresponding to the face image to be processed;

[0013] The training data corresponding to the target face recognition model includes a sample face set, which includes a first sample face set and a second sample face set. The first sample face set refers to the set of sample face images with unobstructed faces, and the second sample face set refers to the set of sample face images with obstructed faces. The target face recognition model is obtained by learning the common distribution of face features corresponding to sample face images in the first sample face set and the second sample face set.

[0014] According to one aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the above-described face recognition method.

[0015] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the above-described face recognition method.

[0016] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform to implement the above-described face recognition method.

[0017] The technical solution provided in this application can bring the following beneficial effects:

[0018] The target face recognition model improves the consistency of feature distribution between occluded and unoccluded face images by learning the common distribution of face features in the unoccluded and occluded face image sets in the training data. This improves the face recognition accuracy of the face images to be processed on the model application side. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram of an application runtime environment provided in one embodiment of this application;

[0021] Figure 2 This is a flowchart of a face recognition method provided in one embodiment of this application. Figure 1 ;

[0022] Figure 3 This is a flowchart of a face recognition model training method provided in one embodiment of this application. Figure 1 ;

[0023] Figure 4 This is a flowchart of a face recognition model training method provided in one embodiment of this application. Figure 2 ;

[0024] Figure 5 An exemplary diagram illustrates a network layer adaptation method that uses a multi-kernel function to constrain the feature distribution of the target feature extraction layer.

[0025] Figure 6 An exemplary diagram illustrates the training and deployment process for a target face recognition model.

[0026] Figure 7 This is a flowchart of a face recognition model pre-training method provided in one embodiment of this application;

[0027] Figure 8 An exemplary diagram illustrates the training process corresponding to a preset face recognition model;

[0028] Figure 9 An exemplary diagram illustrates a fine-tuning training process for a target face recognition model.

[0029] Figure 10 This is a flowchart of a face recognition method provided in one embodiment of this application. Figure 2 ;

[0030] Figure 11 This is a block diagram of a face recognition device provided in one embodiment of this application;

[0031] Figure 12 This is a structural block diagram of a computer device provided in one embodiment of this application. Figure 1 ;

[0032] Figure 13 This is a structural block diagram of a computer device provided in one embodiment of this application. Figure 2 . Detailed Implementation

[0033] The face recognition method provided in this application involves artificial intelligence technology, which will be briefly described below to facilitate understanding by those skilled in the art.

[0034] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0035] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0036] Computer Vision (CV) is a science that studies how to enable machines to "see." More specifically, it refers to machine vision, which uses cameras and computers to replace human eyes in recognizing and measuring targets, and then performs image processing to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, attempting to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition), video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), and common biometric recognition technologies such as facial recognition and fingerprint recognition.

[0037] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0038] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as the common field of facial recognition. The solutions provided in this application involve AI technologies such as computer vision and machine learning, and can be applied to the aforementioned facial recognition field, as illustrated in the following embodiments.

[0039] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0040] Please refer to Figure 1 This diagram illustrates an application runtime environment provided in one embodiment of this application. The application runtime environment may include: terminal 10 and server 20.

[0041] Terminal 10 includes, but is not limited to, electronic devices such as mobile phones, computers, smart voice interaction devices, smart home appliances, in-vehicle terminals, aircraft, game consoles, e-book readers, multimedia playback devices, and wearable devices. Application clients can be installed on terminal 10.

[0042] In this embodiment, the application can be any application capable of providing facial recognition services. Typically, this application is a payment application. Of course, other types of applications besides payment applications can also provide facial recognition services. For example, news applications, social applications, interactive entertainment applications, browser applications, video applications, shopping applications, content sharing applications, virtual reality (VR) applications, augmented reality (AR) applications, etc., are not limited in this embodiment. Furthermore, the purpose and functionality of facial recognition services will differ for different applications, and these can be pre-configured according to actual needs; this embodiment does not limit this.

[0043] Server 20 provides background services to clients of applications in terminal 10. For example, server 20 can be a background server for the aforementioned applications. Server 20 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, server 20 can simultaneously provide background services to applications in multiple terminals 10.

[0044] Optionally, terminal 10 and server 20 can communicate with each other via network 30. Terminal 10 and server 20 can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0045] Before introducing the method embodiments provided in this application, a brief introduction will be given on the application scenarios, related terms or nouns that may be involved in the method embodiments of this application, so as to facilitate the understanding of those skilled in the art.

[0046] Maximum Mean Discrepancy (MMD) is primarily used to measure the distance between two distinct but related distributions.

[0047] A gallery is a collection of registered facial images.

[0048] The test set (Query) refers to the collection of face images used to test the face recognition model.

[0049] Fine-tuning refers to retraining a pre-trained machine learning model using training data.

[0050] Please refer to Figure 2 It illustrates the flow of a face recognition method provided in one embodiment of this application. Figure 1 This method can be applied to computer devices, which refer to electronic devices with data computing and processing capabilities. For example, the entity executing each step can be... Figure 1 The application runtime environment shown is a terminal 10 or a server 20. The method may include the following steps (210-220).

[0051] Step 210: Obtain the face image to be processed.

[0052] Optionally, a face image refers to an image including a face. Optionally, the face image to be processed refers to an image that needs to be used for face recognition. Optionally, the face image to be processed is an image obtained by the terminal capturing the face corresponding to the target object.

[0053] Optionally, the face image to be processed includes at least one of a first face image with an unobstructed face and a second face image with an obstructed face. An unobstructed face indicates that the face in the face image is complete and not obstructed by any object. An obstructed face indicates that the face in the face image is obstructed by an object. Optionally, the obstructing object includes, but is not limited to, masks, jewelry, hands, etc., and this embodiment of the application does not limit this.

[0054] Step 220: Input the face image to be processed into the target face recognition model for face recognition processing to obtain the object recognition information corresponding to the face image to be processed.

[0055] The training data for the target face recognition model includes a set of sample faces. Optionally, the set of sample faces includes a first set of sample faces and a second set of sample faces. Optionally, the first set of sample faces refers to the set of sample face images with unobstructed faces. Optionally, the second set of sample faces refers to the set of sample face images with occluded faces. The target face recognition model is obtained by learning the common distribution of facial features corresponding to sample face images in the first and second set of sample faces.

[0056] The first and second sample face sets mentioned above can be determined by the occlusion attribute label corresponding to each sample face image in the sample face set. The occlusion attribute label characterizes the occlusion status of the faces in the sample face image. Based on the occlusion attribute label corresponding to each sample face image, the sample face set can be classified to obtain the first and second sample face sets mentioned above.

[0057] Optionally, the aforementioned object recognition information refers to the recognition result output by the target face recognition model for the face image to be processed.

[0058] Optionally, the object recognition information includes the probability that the face image to be processed corresponds to at least two registered objects, where the probability represents the likelihood that the face in the face image to be processed belongs to the corresponding registered object.

[0059] Alternatively, the object recognition information includes the recognition object corresponding to the face image to be processed, where the recognition object refers to the registered object predicted and recognized by the target face recognition model for the face image to be processed.

[0060] Optionally, the target face recognition model includes a target feature extraction layer. The face image to be processed includes at least one of a first face image with an unobstructed face and a second face image with an obstructed face. The target feature extraction layer outputs a first face feature corresponding to the first face image or a second face feature corresponding to the second face image. The feature distribution corresponding to the first face feature and the feature distribution corresponding to the second face feature meet a preset feature distribution alignment condition.

[0061] Optionally, the aforementioned preset feature distribution conditions include that the feature distribution distance between the feature distribution corresponding to the first sample face set output by the target feature extraction layer and the feature distribution corresponding to the second sample face set is less than or equal to a preset feature distribution distance threshold.

[0062] Optionally, the aforementioned preset feature distribution conditions include the feature distribution loss corresponding to the target face recognition model being less than or equal to a preset feature distribution loss threshold.

[0063] Optionally, the aforementioned preset feature distribution condition may further include that the total model loss corresponding to the target face recognition model is less than or equal to a preset total loss threshold. The aforementioned total model loss is a loss jointly determined based on the recognition loss and feature distribution loss of the target face recognition model.

[0064] In the technical solution provided in this application embodiment, starting from the features extracted from the face recognition model, the feature distribution of occluded and unoccluded face images in the target feature extraction layer is directly fine-tuned and constrained for alignment, rather than matching the feature space distribution of masked face images and normal face images through reweighting or geometric transformation. This effectively improves the stability and recognition accuracy of the target face recognition model.

[0065] Optionally, the target face recognition model is a machine learning model obtained by adjusting the parameters of a preset face recognition model based on the feature distribution loss information and the first recognition loss information corresponding to the training data. The feature distribution loss information is determined based on the first feature distribution information corresponding to the first sample face set and the second feature distribution information corresponding to the second sample face set. The feature distribution loss information characterizes the alignment degree between the first feature distribution information and the second feature distribution information. The first recognition loss information is determined based on the first recognition information and object label information corresponding to each sample face image. The sample face images in the sample face set are input into the preset face recognition model for face recognition processing to obtain the first feature distribution information, the second feature distribution information, and the first recognition information.

[0066] In an exemplary embodiment, the target face recognition model described above is trained using the following method, such as... Figure 3 As shown, the method includes the following steps (310-350). Figure 3This application illustrates the flowchart of a face recognition model training method provided in one embodiment. Figure 1 .

[0067] Step 310: Obtain the object label information corresponding to each sample face image in the sample face set.

[0068] Optionally, the object label information described above represents information about the object to which the face in the sample face image belongs. Optionally, the object label information includes, but is not limited to, the object identifier, face identifier, object account, and other information corresponding to the object to which the face in the sample face image belongs.

[0069] Step 320: Input the sample face images from the sample face set into a preset face recognition model for face recognition processing to obtain the first feature distribution information corresponding to the first sample face set, the second feature distribution information corresponding to the second sample face set, and the first recognition information corresponding to each sample face image.

[0070] Optionally, the first sample face set includes at least two first sample face images, where a first sample face image refers to a sample face image with an unobstructed face.

[0071] Optionally, the second sample face set includes at least two second sample face images, where the second sample face image refers to a sample face image with the face partially obscured.

[0072] Optionally, the preset face recognition model includes a target feature extraction layer, which refers to at least one feature extraction layer in the preset face recognition model whose feature distribution needs to be aligned.

[0073] After each first sample face image in the aforementioned first sample face set is input into the preset face recognition model, the device executes the operations corresponding to each network layer in the preset face recognition model. The network layers corresponding to the face recognition model include, but are not limited to, feature extraction layers, pooling layers, and fully connected layers. Each network layer performs its corresponding data operations based on its input information, thereby outputting the processing result of that network layer. For the target feature extraction layer, it determines the output data corresponding to each sample face image in the target feature extraction layer based on the input data corresponding to each sample face image in the target feature extraction layer, that is, the face features corresponding to each sample face image.

[0074] Therefore, the first feature distribution information mentioned above includes the facial features corresponding to at least two first sample face images output by each feature extraction layer in at least one feature extraction layer, and the second feature distribution information includes the facial features corresponding to at least two second sample face images output by each feature extraction layer.

[0075] The technical solution provided in this application, by aligning the feature distribution of the target feature extraction layer in the face recognition model, helps to improve the consistency of the feature distribution of occluded and unoccluded face images in the target feature extraction layer.

[0076] In addition, after the preset face recognition model obtains the final output face feature vector corresponding to each sample face image, the face feature vector corresponding to each sample face image can be input into the classification layer to obtain the first recognition information corresponding to each sample face image. The aforementioned first recognition information refers to the recognition result output by the preset face recognition model for the sample face image.

[0077] Optionally, the first identification information includes the probability that the sample face image corresponds to at least two registered objects, where the probability represents the likelihood that the face in the sample face image belongs to the corresponding registered object.

[0078] Alternatively, the first identification information includes the identification object corresponding to the sample face image, where the identification object refers to the registered object predicted and identified by the preset face recognition model for the sample face image.

[0079] Step 330: Determine the feature distribution loss information based on the first feature distribution information and the second feature distribution information.

[0080] Optionally, the feature distribution loss information characterizes the degree of alignment between the first feature distribution information and the second feature distribution information.

[0081] Optionally, the alignment degree mentioned above is used to characterize the consistency of feature distribution between the first feature distribution information and the second feature distribution information.

[0082] Optionally, based on the first feature distribution information and the second feature distribution information, the feature distribution difference information between the two can be determined, and then the feature distribution loss information can be determined based on the feature distribution difference information between the two.

[0083] Optionally, the aforementioned feature distribution loss information includes feature distribution loss data. Optionally, the feature distribution loss data is negatively correlated with the aforementioned alignment degree; the smaller the feature distribution loss data, the higher the alignment degree between the first feature distribution information and the second feature distribution information, and vice versa.

[0084] In an exemplary embodiment, such as Figure 4 As shown, step 330 above may include the following steps (331-333). Figure 4 This application illustrates the flowchart of a face recognition model training method provided in one embodiment. Figure 2 .

[0085] Step 331: For each feature extraction layer, obtain the first face feature set and the second face feature set corresponding to the feature extraction layer.

[0086] Optionally, the first face feature set refers to the set of face features corresponding to each first sample face image in the first sample face set output by the feature extraction layer. Optionally, the first face feature set includes at least two first face features, where each first face feature refers to the face feature corresponding to the first sample face image.

[0087] Optionally, the second face feature set refers to the set of face features corresponding to each second sample face image in the second sample face set output by the feature extraction layer. Optionally, the second face feature set includes at least two second face features, where each second face feature refers to the face feature corresponding to the second sample face image.

[0088] Step 332: Based on the first face feature set and the second face feature set, determine the feature distribution difference information corresponding to the feature extraction layer.

[0089] By comparing the first face features in the first face feature set with the second face features in the second face feature set, the feature distribution difference information between the two face feature sets output by the feature extraction layer can be determined.

[0090] Alternatively, the above-mentioned feature distribution difference information can be determined in the following way:

[0091] Determine the first feature distance between at least two first face features, the second feature distance between at least two first face features and at least two second face features, and the third feature distance between at least two second face features; perform fusion processing on the first feature distance, the second feature distance and the third feature distance to obtain the feature distribution difference information corresponding to the feature extraction layer.

[0092] Optionally, the aforementioned first feature distance refers to the dot product of the feature vectors corresponding to the two first face features in the target feature space, which can characterize the feature distribution distance between the two first face features. Optionally, the dimension of the target feature space is higher than the dimension of the first face feature. Optionally, the feature vector corresponding to the first face feature in the target feature space can be obtained by performing a nonlinear transformation on the first face feature.

[0093] Optionally, the aforementioned second feature distance refers to the dot product of the feature vectors corresponding to the first and second face features in the target feature space. This dot product can characterize the feature distribution distance between the first and second face features. Optionally, the dimension of the target feature space is higher than the dimension of the first and second face features. Optionally, the feature vectors corresponding to the first and second face features in the target feature space can be obtained by performing a nonlinear transformation on the first and second face features.

[0094] Optionally, the aforementioned third feature distance refers to the dot product of the feature vectors corresponding to the two second face features in the target feature space. This dot product can characterize the feature distribution distance between the two second face features. Optionally, the dimension of the target feature space is higher than the dimension of the second face features. Optionally, the feature vector corresponding to the second face features in the target feature space can be obtained by performing a nonlinear transformation on the second face features.

[0095] By fusing the first feature distance, the second feature distance, and the third feature distance, the feature distribution difference distance can be obtained. This feature distribution difference information includes the feature distribution difference distance. Optionally, the feature distribution difference distance refers to the maximum mean difference (MMD) between two feature distributions.

[0096] In one example, the feature distribution difference information can be determined by the following formula:

[0097]

[0098] Where X and Y represent two distributions, X represents the feature distribution corresponding to the second face feature set, and Y represents the feature distribution corresponding to the first face feature set. MMD[X, Y] represents the feature distribution difference distance between the two feature distributions. i Let x represent the feature vector corresponding to the i-th first sample face image in the same training batch. j y represents the feature vector corresponding to the j-th first sample face image in the same training batch. i Let y represent the feature vector corresponding to the i-th second sample face image in the same training batch. j Let κ represent the feature vector corresponding to the j-th second sample face image in the same training batch, m represent the number of first sample face images, n represent the number of second sample face images, and κ represent the function that determines the feature distance (e.g., the target kernel function). κ(x) i x j That is, x i With x jThe third feature distance between them, κ(x) i y j That is, x i With y j The second characteristic distance between them, κ(y) i y j That is, y i With y j The first characteristic distance between them.

[0099] The technical solution provided in this application embodiment can accurately determine the feature distribution difference information corresponding to the feature extraction layer by fusing the feature distances between each pair of multiple facial features output by each feature extraction layer.

[0100] Optionally, the first feature distance, the second feature distance, and the third feature distance are determined by the distance mapping relationship corresponding to the target kernel function. The distance mapping relationship is used to determine the inner product of the feature vectors corresponding to the two input face features in the target feature space. The target kernel function includes at least one preset kernel function.

[0101] The kernel function described above can directly determine the dot product of the feature vectors corresponding to the two input facial features in the target feature space, without having to specifically calculate the feature vectors corresponding to each of the two facial features in the target feature space. This can effectively reduce computational complexity, improve computational efficiency, and thus improve the training efficiency of the face recognition model.

[0102] Optionally, the target kernel function may include a Gaussian kernel function or a polynomial kernel function. This application does not limit the number or type of kernel functions in the target kernel function.

[0103] In one example, the target kernel function described above can be expressed by the following formula:

[0104]

[0105] Where k represents the target kernel function, and k u For a single kernel function, β u Here, u represents the kernel function index, and m represents the number of kernel functions.

[0106] In one example, please refer to Figure 5 The example illustrates a network layer adaptation diagram that uses a multi-kernel function to constrain the feature distribution of the target feature extraction layer. Figure 5The diagram illustrates feature extraction layers 1, 2, 3, and 4 in a face recognition model. Feature extraction layers 3 and 4 are feature extraction layers whose feature distributions need to be aligned. Therefore, multi-kernel function distribution constraint modules can be applied to feature extraction layers 3 and 4 respectively. These modules superimpose multiple MMD distance constraints onto feature extraction layers 3 and 4, thereby adapting the occluded face features and unoccluded face features output by feature extraction layers 3 and 4, and ultimately aligning the feature distributions corresponding to the occluded and unoccluded face features.

[0107] The technical solution provided in this application introduces a kernel function to map unobstructed and occluded face features into a high-dimensional feature space. Then, it uses statistics based on the distribution in this space to express the distribution. In the high-dimensional feature space, the feature distribution statistics of occluded and unobstructed faces are constrained at different network layers. This method differs from the method of using random sampling to calculate the Euclidean distance between two features to measure the feature difference between them. Instead, it aligns the feature distribution to enable the face recognition model to learn the common feature distribution between unobstructed and occluded faces, thereby significantly improving the accuracy of face recognition with masks.

[0108] Step 333: The feature distribution difference information corresponding to each feature extraction layer in at least one feature extraction layer is fused to obtain feature distribution loss information.

[0109] Optionally, the feature distribution difference distances corresponding to each feature extraction layer in at least one feature extraction layer are weighted and fused to obtain the aforementioned feature distribution loss data.

[0110] In one example, the loss information for the above feature distribution can be determined by the following formula:

[0111]

[0112] Where λ represents the coefficient, l1 and l2 are the adaptive feature extraction layers, s represents unobstructed face, and t, Let l be the feature distribution of the first face feature set at layer l. Let l be the feature distribution of the first face feature set at layer l. express and Information on the differences in feature distribution between them.

[0113] The technical solution provided in this application uses a multi-layer network adaptive learning approach to constrain the feature distribution alignment of each feature extraction layer whose feature distribution needs to be aligned. This allows the total feature distribution loss information to be determined based on the feature distribution differences of each feature extraction layer. This helps improve the consistency of feature distributions in each feature extraction layer between occluded and unoccluded face images, and also helps improve the accuracy of the model's feature distribution loss information, thereby improving the model's recognition accuracy.

[0114] Step 340: Based on the first recognition information and the object label information, determine the first recognition loss information corresponding to the preset face recognition model.

[0115] Optionally, the aforementioned first recognition loss information represents the recognition accuracy of the preset face recognition model.

[0116] Since the first recognition information represents the object predicted and recognized by the preset face recognition model for the sample face image, and the object label information represents the actual object corresponding to the sample face image, by comparing the first recognition information and the object label information, it can be determined whether the object determined by the preset face recognition model is correct, thereby determining the first recognition loss data corresponding to the preset face recognition model. The first recognition loss information includes the first recognition loss data.

[0117] Optionally, the first recognition loss data is negatively correlated with the recognition accuracy; the smaller the first recognition loss data, the higher the recognition accuracy, and vice versa.

[0118] Step 350: Based on the feature distribution loss information and the first recognition loss information, the parameters of the preset face recognition model are adjusted to obtain the target face recognition model.

[0119] Optionally, the feature distribution loss information and the first recognition loss information are fused to obtain the total model loss information; the parameters of the preset face recognition model are adjusted according to the total model loss information to obtain the target face recognition model.

[0120] Optionally, the above-mentioned fusion processing includes, but is not limited to, fusion methods such as weighted fusion and weighted average, and the embodiments of this application do not limit this.

[0121] Optionally, if the aforementioned feature distribution loss data is greater than a preset feature distribution loss threshold or the first recognition loss data is greater than a preset recognition loss threshold, the preset face recognition model is iteratively trained until the aforementioned feature distribution loss data is less than or equal to the preset feature distribution loss threshold and the first recognition loss data is less than or equal to the preset recognition loss threshold, or the number of iterations reaches the upper limit of the number of iterations, and the aforementioned target face recognition model is obtained based on the latest model parameters.

[0122] Optionally, if the total model loss data exceeds a preset total loss threshold, the preset face recognition model is iteratively trained until the total model loss data is less than or equal to the preset total loss threshold, or the number of iterations reaches the upper limit. Then, the target face recognition model is obtained based on the latest model parameters. Optionally, the total model loss information includes the total model loss data. The total model loss data comprehensively characterizes the recognition accuracy of the face recognition model.

[0123] In one example, the total loss of the model can be determined using the following formula:

[0124] Loss total =α*Loss logit +β*Loss MMD

[0125] Optionally, α and β are adjustment weights, and Loss logit Loss represents the recognition loss. MMD Feature distribution loss, Loss total This represents the total loss of the model. Optionally, the empirical values ​​for the weights α and β are set to 2:1.

[0126] In an exemplary embodiment, the target face recognition model is a machine learning model obtained by adjusting the parameters of a preset face recognition model based on a first sample face set and a second sample face set.

[0127] Optionally, the aforementioned preset face recognition model is a pre-trained face recognition model, and the target face recognition model can be obtained by fine-tuning the preset face recognition model.

[0128] In one example, please refer to Figure 6 This example illustrates a schematic diagram of the training and deployment process for a target face recognition model. Figure 6 As shown, the training and deployment process for the target face recognition model mainly consists of two stages: the face recognition model training stage and the face recognition model deployment stage. In the face recognition model training stage, existing data is used to train the original face recognition model. Multiple kernel function constraint layers are introduced to perform distribution adaptation and alignment of occluded and unoccluded face features extracted from the deep networks of multiple face recognition models, constraining the model to learn the common distribution of both. This process does not require modification to the original face recognition model's network structure; only the training objective function needs to be improved to enhance the accuracy of occluded face recognition without compromising the accuracy of unoccluded face recognition. In the face recognition model deployment stage, only the trained face recognition model needs to be exported and deployed.

[0129] Optionally, the preset face recognition model is a machine learning model obtained by training an initial face recognition model to be trained based on a sample face set and the object label information corresponding to each sample face image in the sample face set.

[0130] The technical solution provided in this application provides fine-tuning training on the original face recognition model, which effectively reduces the model training complexity and improves the accuracy of occluded face recognition without affecting the original model's face recognition accuracy.

[0131] In an exemplary embodiment, such as Figure 7 As shown, the aforementioned preset face recognition model is trained using the following method, which includes the following steps (710-730). Figure 7 A flowchart of a face recognition model pre-training method provided in one embodiment of this application is shown.

[0132] Step 710: Input the sample face images from the sample face set into the initial face recognition model to be trained for face recognition processing to obtain the second recognition information corresponding to each sample face image.

[0133] Optionally, the second identification information mentioned above refers to the identification result output by the initial face recognition model for the sample face image.

[0134] Optionally, the second identification information includes the probability that the sample face image corresponds to at least two registered objects, whereby the probability represents the likelihood that a face in the sample face image belongs to the corresponding registered object.

[0135] Alternatively, the second identification information includes the identification object corresponding to the sample face image, where the identification object refers to the registered object predicted and identified by the initial face recognition model for the sample face image.

[0136] Step 720: Based on the second recognition information and object label information, determine the second recognition loss information corresponding to the initial face recognition model.

[0137] Optionally, the aforementioned second recognition loss information represents the recognition accuracy of the initial face recognition model.

[0138] Since the second recognition information represents the object predicted and recognized by the initial face recognition model for the sample face image, and the object label information represents the actual object corresponding to the sample face image, by comparing the second recognition information and the object label information, it can be determined whether the object determined by the initial face recognition model is correct, thereby determining the second recognition loss data corresponding to the initial face recognition model. The second recognition loss information includes the second recognition loss data.

[0139] Optionally, the second recognition loss data is negatively correlated with the recognition accuracy of the initial face recognition model. The smaller the second recognition loss data, the higher the recognition accuracy of the initial face recognition model, and vice versa.

[0140] Step 730: Adjust the parameters of the initial face recognition model according to the second recognition loss information to obtain the preset face recognition model.

[0141] Optionally, if the second recognition loss data is greater than the preset recognition loss threshold, the process is repeated from step 710 to iteratively train the initial face recognition model until the second recognition loss data is less than or equal to the preset recognition loss threshold, or the number of iterations reaches the upper limit of the number of iterations. Then, the preset face recognition model is obtained based on the latest model parameters.

[0142] The technical solution provided in this application embodiment can accurately train an accurate face recognition model based on the sample face set and its corresponding object label, which helps to improve the subsequent fine-tuning training to obtain the target face recognition model, thereby improving the model training efficiency and accuracy.

[0143] In one example, please refer to Figure 8 The example illustrates a schematic diagram of the training process corresponding to a preset face recognition model. For instance... Figure 8 As shown, the training process and functions of each module of the preset face recognition model are as follows:

[0144] (1) Training data preparation module: This module reads the face training data during the training process, combines the read data into a batch (sample batch) and sends it into the initial face recognition model to be trained for processing.

[0145] (2) Face Recognition Model Module: This module extracts spatial features from the input face image, and the output feature map retains the spatial structure information of the face image. This module typically uses a Convolutional Neural Network (CNN) structure, which includes operations such as convolution calculation, linear rectification function (ReLU) calculation, and pooling calculation.

[0146] (3) Face Recognition Loss Calculation Module: This module takes the feature vector output by the fully connected mapping unit corresponding to the face recognition model and the object label information of the sample face image corresponding to the feature vector as input to the objective function to calculate the recognition loss value. The objective function can be a classification function (such as softmax (logistic regression), various types of softmax with margin (used to set the width of all margins of all current or specified elements in a declaration, or to set the width of the margins on each side), or other types of objective functions.

[0147] (4) Face Recognition Loss Optimization Module: This module uses gradient descent (such as stochastic gradient descent, stochastic gradient descent with a driving term, Adam (first-order optimization algorithm), and Adamard (adaptive learning rate gradient descent)) to train and optimize the entire face recognition model network. During training, steps (1) to (4) are repeated until the training result meets the training termination condition. The conditions for terminating model training generally include that the number of training iterations meets the set value, or the recognition loss value calculated by the face recognition objective function is less than the set recognition loss threshold, which completes the training of the preset face recognition model.

[0148] In one example, please refer to Figure 9 This example illustrates a schematic diagram of a fine-tuning training process for a target face recognition model. For instance... Figure 9 As shown, the fine-tuning training process and the functions of each module for the target face recognition model are as follows:

[0149] (a) Training data preparation module: The function of this module is the same as that of the training data preparation module in the training of the preset face recognition model.

[0150] (b) Multi-kernel function-based multi-layer network distribution adaptation module: This module aligns the distributions of occluded and unoccluded face features extracted by the face recognition model. Its inputs are occluded and unoccluded face features, and its output is the loss generated by constraining their feature distributions. During the fine-tuning of the preset face recognition model, the loss function corresponding to this module constrains the deep layers of the preset face recognition model, thereby calculating the MMD distance between the feature distributions corresponding to occluded and unoccluded face features, and constraining this distance to a minimum value, ensuring consistency between the feature distributions corresponding to occluded and unoccluded face features.

[0151] To enhance the expressive power of the loss function, multiple kernel functions can be used to construct the overall loss function. Optionally, the loss function includes Gaussian kernel functions and polynomial kernel functions. Correspondingly, this module integrates multiple kernel functions to impose feature distribution alignment constraints on the features output by the multi-layer network in the face recognition model. For example, multiple MMD distance constraints can be superimposed in the deep network of the face recognition model to adapt occluded face features to unoccluded face features.

[0152] Optionally, the occluded and unoccluded face features are mapped to a high-dimensional space using the distance mapping relationship corresponding to the multi-kernel function, and the inner product of the corresponding feature vectors in the high-dimensional space is determined, thereby calculating the feature distribution loss. MMD In this module, minimizing the MMD distance aligns the feature distributions corresponding to occluded and unoccluded facial features.

[0153] (c) Face recognition loss calculation module: This can be the face recognition loss calculation module used in the training of the preset face recognition model.

[0154] (d) Model loss accumulation module: This module performs weighted processing on the two constraint losses (feature distribution loss and recognition loss) to obtain the total model loss.

[0155] (e) Loss Optimization Module: This module trains and optimizes the entire face recognition model network using gradient descent methods (such as stochastic gradient descent, stochastic gradient descent with a driving term, Adam (first-order optimization algorithm), and Adamard (adaptive learning rate gradient descent)). Steps (a) to (d) are repeated during training until the training results meet the training termination conditions. Termination conditions include setting the number of iterations to a predetermined value, or the feature distribution loss, recognition loss, and total loss being less than corresponding values. This training process is a fine-tuning of the pre-trained face recognition model; therefore, a smaller learning rate than that used in the pre-trained face recognition model is generally used for iterations during optimization.

[0156] The technical solution provided in this application, in addition to using object recognition loss for face recognition model training, also determines feature distribution loss based on the feature distributions corresponding to the occluded sample face image set and the unoccluded sample face image set, and then introduces the feature distribution loss and object recognition loss together into the training of the face recognition model, which helps to improve the consistency of feature distribution between the feature distribution of occluded face images and the feature distribution of unoccluded face images, thereby improving the accuracy of face recognition.

[0157] In an exemplary embodiment, such as Figure 10 As shown, the above face recognition method further includes the following step 230. Figure 10 The flowchart of a face recognition method provided in one embodiment of this application is shown. Figure 2 .

[0158] Step 230: Obtain a preset set of face images.

[0159] Optionally, the aforementioned preset face image set includes, but is not limited to, a registration set and a face database. The aforementioned registration set includes at least two registered face images.

[0160] Accordingly, such as Figure 10 As shown, step 220 above may include the following steps (221 to 223).

[0161] Step 221: Input the face image to be processed into the target face recognition model for face recognition processing to obtain the face features corresponding to the face image to be processed.

[0162] Optionally, after obtaining the target face recognition model, the trained target face recognition model can be directly integrated into the face recognition system for face recognition processing, thereby improving the accuracy of occluded face recognition without adding additional deployment modules.

[0163] Step 222: Perform facial feature-based matching processing on the preset set of facial images to obtain the target facial image corresponding to the face image to be processed.

[0164] Optionally, the facial features corresponding to the face image to be processed are matched with the facial features corresponding to at least two face images in a preset face image set to obtain the feature similarity between the facial features corresponding to the face image to be processed and the facial features corresponding to the at least two face images. Then, based on the aforementioned feature similarity, a target face image that matches the face image to be processed in the preset face image set is determined. Optionally, the face image with the highest feature similarity in the preset face image set is determined as the target face image.

[0165] Step 223: Determine the object information corresponding to the target face image as object recognition information.

[0166] Optionally, obtain the object information corresponding to the target face image, such as object identifier, object account, and face identifier, and determine it as the object recognition information corresponding to the image to be processed.

[0167] Optionally, the object corresponding to the target face image is determined as the target object corresponding to the image to be processed.

[0168] While using feature classification to determine the target object during model training can effectively improve model training efficiency, the application side can choose not to use this method. Instead, the application side can use feature matching to determine the target object corresponding to the image to be processed, thus effectively improving face recognition efficiency.

[0169] In summary, the technical solution provided in this application embodiment allows the target face recognition model to improve the consistency of feature distribution between the occluded face image feature distribution and the unoccluded face image feature distribution by learning the common distribution of face features corresponding to the face images in the unoccluded sample face set and the occluded sample face set in the training data. This improves the face recognition accuracy of the face image to be processed on the model application side.

[0170] The technical solutions provided in this application embodiment are described below in conjunction with specific application backgrounds. In the context of epidemic virus medical protection, wearing masks when going out has become an indispensable part of people's daily lives. Because masks obscure the face, the accuracy of face recognition systems for masked faces in related technologies has significantly decreased. In the face recognition models of related technologies, the recognition mode is the comparison between unobstructed, high-quality faces; therefore, it cannot properly adapt to the comparison mode between masked faces and normal faces. According to the inventor's analysis, the fundamental reason for the significant decrease in the accuracy of masked face recognition in related technologies is the inconsistency in the feature distribution between masked face images and normal face images, leading to misalignment in the feature space and resulting in inconsistent similarity scales for mask-to-mask, mask-to-face, and face-to-face comparisons. In face recognition comparison, this scale inconsistency causes abnormalities in inter-class and intra-class similarity. Abnormal inter-class similarity leads to a higher false alarm rate, while abnormal intra-class similarity leads to a lower pass rate.

[0171] In some possible implementations, the face recognition model is trained using a multi-task approach. This involves increasing the model's size and adjusting the weights of the loss function between images with and without masks during training. This implementation requires adjusting the weights of the loss function for each task. These weights are hyperparameters, and their optimal values ​​change with the data distribution. Due to the presence of these hyperparameters, it's impossible to guarantee a stable improvement in the accuracy of masked faces during model training. Furthermore, in applications with high forward inference speed requirements, an excessively large model can lead to increased processing time, failing to meet the required recognition speed in these scenarios.

[0172] In other possible implementations, a multi-center approach is used to train the model on both masked and normal images of the same object. Each object has two class centers (the class center vector represents the average of all image features within each identity): one for the masked image and one for the normal image. The distances between the input image's features and each class center are then calculated to determine the target object corresponding to the input image. In this implementation, two class centers are required for each object when training the face recognition model. Furthermore, in large-scale data training, these class centers consume a significant amount of GPU memory, leading to severe GPU memory shortages during model training. Additionally, since each object has two class centers, the features need to undergo two fully connected operations with the class centers, greatly increasing training time.

[0173] In view of this, the technical solution provided in this application adopts a kernel-learning-based multi-layer network adaptation method to spatially align and match the feature distributions of masked faces with those of normal faces, thereby achieving the goal of scale normalization of the similarity between images. Furthermore, the aforementioned target face recognition model is obtained by fine-tuning and training on the basis of an existing face recognition model, eliminating the need for retraining, shortening the training cycle, and ensuring ease of application. In addition, the technical solution provided in this application constrains the distribution statistics of features in high-dimensional space by determining the maximum mean difference between the two feature distributions corresponding to the deep network layers in the face recognition model through multiple kernel functions, thereby constraining the two feature distributions to a consistent space. In model training, the technical solution provided in this application only requires adding a small maximum mean difference constraint module for training. The computational cost and memory usage of this module are negligible compared to the resources consumed in training the face recognition model, ensuring the lightweight nature of the method. Furthermore, the distribution constraint module does not need to be deployed after training is completed, thus ensuring that the method can be used in both large and small models without affecting the original deployment results. The accuracy of the training data also does not require adjusting the ratio between masked sample face images and normal sample face images; it is only necessary to keep the number of both consistent, reducing the configuration cost of training data.

[0174] Based on the application results, after the technical solution provided in this application embodiment was tested in various 1:1 and 1:N masked face recognition services, the face recognition processing in each different test showed corresponding performance improvement.

[0175] The following are embodiments of the apparatus of this application, which can be used to execute embodiments of the method of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method of this application.

[0176] Please refer to Figure 11 This diagram illustrates a block diagram of a face recognition device according to an embodiment of this application. The device has the function of implementing the face recognition method described above; this function can be implemented in hardware or by hardware executing corresponding software. The device can be a computer device or can be installed within a computer device. The device 1100 may include: a face image acquisition module 1110 and a face image recognition module 1120.

[0177] The face image acquisition module 1110 is used to acquire the face image to be processed.

[0178] The face image recognition module 1120 is used to input the face image to be processed into the target face recognition model for face recognition processing, and obtain the object recognition information corresponding to the face image to be processed.

[0179] The training data corresponding to the target face recognition model includes a sample face set, which includes a first sample face set and a second sample face set. The first sample face set refers to the set of sample face images with unobstructed faces, and the second sample face set refers to the set of sample face images with obstructed faces. The target face recognition model is obtained by learning the common distribution of face features corresponding to sample face images in the first sample face set and the second sample face set.

[0180] In an exemplary embodiment, the target face recognition model includes a target feature extraction layer. The face image to be processed includes at least one of a first face image with an unobstructed face and a second face image with an obstructed face. The target feature extraction layer outputs a first face feature corresponding to the first face image or a second face feature corresponding to the second face image. The feature distribution corresponding to the first face feature and the feature distribution corresponding to the second face feature meet a preset feature distribution alignment condition.

[0181] In an exemplary embodiment, the target face recognition model is a machine learning model obtained by adjusting the parameters of a preset face recognition model based on the first sample face set and the second sample face set. The preset face recognition model is a machine learning model obtained by training an initial face recognition model to be trained based on the sample face set and the object label information corresponding to each sample face image in the sample face set.

[0182] In an exemplary embodiment, the device 1100 further includes an image set acquisition module.

[0183] The image set acquisition module is used to acquire a preset set of face images.

[0184] The face image recognition module 1120 includes: a face feature determination unit, a face image matching unit, and a recognition information determination unit.

[0185] A face feature determination unit is used to input the face image to be processed into the target face recognition model for face recognition processing to obtain the face features corresponding to the face image to be processed;

[0186] A face image matching unit is used to perform matching processing based on the face features on the preset face image set to obtain the target face image corresponding to the face image to be processed;

[0187] The identification information determination unit is used to determine the object information corresponding to the target face image as the object identification information.

[0188] In an exemplary embodiment, the training device corresponding to the target face recognition model includes: a sample label acquisition module, a sample face recognition module, a distribution loss determination module, a recognition loss determination module, and a model parameter adjustment module.

[0189] The sample label acquisition module is used to acquire the object label information corresponding to each sample face image in the sample face set.

[0190] The sample face recognition module is used to input the sample face images from the sample face set into a preset face recognition model for face recognition processing, and obtain the first feature distribution information corresponding to the first sample face set, the second feature distribution information corresponding to the second sample face set, and the first recognition information corresponding to each sample face image.

[0191] The distribution loss determination module is used to determine feature distribution loss information based on the first feature distribution information and the second feature distribution information, wherein the feature distribution loss information characterizes the degree of alignment between the first feature distribution information and the second feature distribution information.

[0192] The recognition loss determination module is used to determine the first recognition loss information corresponding to the preset face recognition model based on the first recognition information and the object label information.

[0193] The model parameter adjustment module is used to adjust the parameters of the preset face recognition model according to the feature distribution loss information and the first recognition loss information to obtain the target face recognition model.

[0194] In an exemplary embodiment, the first sample face set includes at least two first sample face images, where the first sample face image refers to a sample face image with an unobstructed face. The second sample face set includes at least two second sample face images, where the second sample face image refers to a sample face image with an obstructed face. The preset face recognition model includes a target feature extraction layer, where the target feature extraction layer refers to at least one feature extraction layer in the preset face recognition model whose feature distribution needs to be aligned. The first feature distribution information includes the face features corresponding to the at least two first sample face images output by each feature extraction layer in the at least one feature extraction layer. The second feature distribution information includes the face features corresponding to the at least two second sample face images output by each of the feature extraction layers.

[0195] In an exemplary embodiment, the distribution loss determination module includes: a feature set acquisition unit, a distribution difference determination unit, and a distribution loss determination unit.

[0196] The feature set acquisition unit is used to acquire, for each feature extraction layer, a first face feature set and a second face feature set corresponding to the feature extraction layer. The first face feature set refers to the set of face features corresponding to each first sample face image in the first sample face set output by the feature extraction layer, and the second face feature set refers to the set of face features corresponding to each second sample face image in the second sample face set output by the feature extraction layer.

[0197] The distribution difference determination unit is used to determine the feature distribution difference information corresponding to the feature extraction layer based on the first face feature set and the second face feature set.

[0198] The distribution loss determination unit is used to perform fusion processing on the feature distribution difference information corresponding to each of the at least one feature extraction layer to obtain the feature distribution loss information.

[0199] In an exemplary embodiment, the first face feature set includes at least two first face features, where the first face feature refers to the face feature corresponding to the first sample face image; the second face feature set includes at least two second face features, where the second face feature refers to the face feature corresponding to the second sample face image; and the distribution difference determination unit includes: a feature distance determination subunit and a feature distance fusion subunit.

[0200] The feature distance determination subunit is used to determine the first feature distance between each pair of the at least two first face features, the second feature distance between the at least two first face features and the at least two second face features, and the third feature distance between each pair of the at least two second face features.

[0201] The feature distance fusion subunit is used to fuse the first feature distance, the second feature distance and the third feature distance to obtain the feature distribution difference information corresponding to the feature extraction layer.

[0202] In an exemplary embodiment, the first feature distance, the second feature distance, and the third feature distance are determined by a distance mapping relationship corresponding to the target kernel function. The distance mapping relationship is used to determine the inner product of the feature vectors corresponding to the two input facial features in the target feature space. The target kernel function includes at least one preset kernel function.

[0203] In an exemplary embodiment, the sample face recognition module is further configured to input the sample face images from the sample face set into the initial face recognition model to be trained for face recognition processing, and obtain second recognition information corresponding to each sample face image;

[0204] The recognition loss determination module is further configured to determine the second recognition loss information corresponding to the initial face recognition model based on the second recognition information and the object label information;

[0205] The model parameter adjustment module is further configured to perform parameter adjustment processing on the initial face recognition model based on the second recognition loss information to obtain the preset face recognition model.

[0206] In summary, the technical solution provided in this application embodiment allows the target face recognition model to improve the consistency of feature distribution between the occluded face image feature distribution and the unoccluded face image feature distribution by learning the common distribution of face features corresponding to the face images in the unoccluded sample face set and the occluded sample face set in the training data. This improves the face recognition accuracy of the face image to be processed on the model application side.

[0207] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0208] Please refer to Figure 12 It illustrates the structural block of a computer device provided in one embodiment of this application. Figure 1 The computer device can be a terminal. This computer device is used to implement the face recognition method provided in the above embodiments. Specifically:

[0209] Typically, computer device 1200 includes a processor 1201 and a memory 1202.

[0210] Processor 1201 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1201 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1201 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1201 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1201 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0211] The memory 1202 may include one or more computer-readable storage media, which may be non-transitory. The memory 1202 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1202 is used to store at least one instruction, at least one program, code set, or instruction set, configured to be executed by one or more processors to implement the above-described face recognition method.

[0212] In some embodiments, the computer device 1200 may also optionally include a peripheral device interface 1203 and at least one peripheral device. The processor 1201, memory 1202, and peripheral device interface 1203 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1203 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 1204, a touch display screen 1205, a camera assembly 1206, an audio circuit 1207, a positioning assembly 1208, and a power supply 1209.

[0213] Those skilled in the art will understand that Figure 12 The structure shown does not constitute a limitation on the computer device 1200, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0214] Please refer to Figure 13 It illustrates the structural block of a computer device provided in one embodiment of this application. Figure 2 The computer device can be a server used to perform the aforementioned facial recognition method. Specifically:

[0215] Computer device 1300 includes a central processing unit (CPU) 1301, a system memory 1304 including random access memory (RAM) 1302 and read-only memory (ROM) 1303, and a system bus 1305 connecting the system memory 1304 and the CPU 1301. Computer device 1300 also includes a basic input / output system (I / O system) 1306 that facilitates information transfer between various devices within the computer, and a mass storage device 1307 for storing the operating system 1313, application programs 1314, and other program modules 1315.

[0216] The basic input / output system 1306 includes a display 1308 for displaying information and an input device 1309 for user input, such as a mouse or keyboard. Both the display 1308 and the input device 1309 are connected to the central processing unit 1301 via an input / output controller 1310 connected to the system bus 1305. The basic input / output system 1306 may also include the input / output controller 1310 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1310 also provides output to a display screen, printer, or other types of output devices.

[0217] Mass storage device 1307 is connected to central processing unit 1301 via a mass storage controller (not shown) connected to system bus 1305. Mass storage device 1307 and its associated computer-readable media provide non-volatile storage for computer device 1300. That is, mass storage device 1307 may include computer-readable media (not shown) such as hard disk or CD-ROM (Compact Disc Read-Only Memory) drive.

[0218] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types. The system memory 1304 and mass storage device 1307 described above can be collectively referred to as memory.

[0219] According to various embodiments of this application, the computer device 1300 can also be connected to a remote computer on a network, such as the Internet. That is, the computer device 1300 can be connected to the network 1312 via the network interface unit 1311 connected to the system bus 1305, or the network interface unit 1311 can be used to connect to other types of networks or remote computer systems (not shown).

[0220] The memory also includes a computer program stored in the memory and configured to be executed by one or more processors to implement the above-described face recognition method.

[0221] In an exemplary embodiment, a computer-readable storage medium is also provided, the storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set, when executed by a processor, implements the above-described face recognition method.

[0222] Optionally, the computer-readable storage medium may include: ROM (Read Only Memory), RAM (Random Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0223] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned face recognition method.

[0224] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.

[0225] In addition, in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0226] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A face recognition method, characterized in that, The method includes: Obtain the face image to be processed; The face image to be processed is input into the target face recognition model for face recognition processing to obtain the object recognition information corresponding to the face image to be processed; The training data corresponding to the target face recognition model includes a sample face set, which includes a first sample face set and a second sample face set. The first sample face set refers to the set of sample face images with unobstructed faces, and the second sample face set refers to the set of sample face images with obstructed faces. The target face recognition model is obtained by learning the common distribution of face features corresponding to sample face images in the first sample face set and the second sample face set. The target face recognition model includes a target feature extraction layer, which is used to output a first face feature corresponding to a first face image with an unobstructed face and a second face feature corresponding to a second face image with an obstructed face. The feature distribution corresponding to the first face feature and the feature distribution corresponding to the second face feature meet a preset feature distribution alignment condition. The first face image and the second face image are face images to be processed.

2. The method according to claim 1, characterized in that, The object recognition information includes the probability that the face image to be processed corresponds to at least two registered objects, whereby the probability represents the likelihood that the face in the face image to be processed belongs to the corresponding registered object; Alternatively, the object recognition information includes the recognition object corresponding to the face image to be processed, wherein the recognition object refers to the registered object predicted and recognized by the target face recognition model for the face image to be processed.

3. The method according to claim 1, characterized in that, The target face recognition model is a machine learning model obtained by adjusting the parameters of a preset face recognition model based on the first sample face set and the second sample face set. The preset face recognition model is a machine learning model obtained by training an initial face recognition model to be trained based on the sample face set and the object label information corresponding to each sample face image in the sample face set.

4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Obtain a preset set of face images; The step of inputting the face image to be processed into the target face recognition model for face recognition processing to obtain the object recognition information corresponding to the face image to be processed includes: The face image to be processed is input into the target face recognition model for face recognition processing to obtain the face features corresponding to the face image to be processed; The preset set of face images is subjected to matching processing based on the face features to obtain the target face image corresponding to the face image to be processed; The object information corresponding to the target face image is determined as the object recognition information.

5. The method according to claim 1, characterized in that, The target face recognition model is trained using the following method: Obtain the object label information corresponding to each sample face image in the sample face set; The sample face images in the sample face set are input into a preset face recognition model for face recognition processing to obtain the first feature distribution information corresponding to the first sample face set, the second feature distribution information corresponding to the second sample face set, and the first recognition information corresponding to each sample face image. Based on the first feature distribution information and the second feature distribution information, feature distribution loss information is determined, wherein the feature distribution loss information characterizes the degree of alignment between the first feature distribution information and the second feature distribution information; Based on the first identification information and the object label information, the first identification loss information corresponding to the preset face recognition model is determined; Based on the feature distribution loss information and the first recognition loss information, the preset face recognition model is adjusted to obtain the target face recognition model.

6. The method according to claim 5, characterized in that, The first sample face set includes at least two first sample face images, where the first sample face image refers to a sample face image with an unobstructed face. The second sample face set includes at least two second sample face images, where the second sample face image refers to a sample face image with an obstructed face. The preset face recognition model includes a target feature extraction layer, where the target feature extraction layer refers to at least one feature extraction layer in the preset face recognition model whose feature distribution needs to be aligned. The first feature distribution information includes the face features corresponding to the at least two first sample face images output by each feature extraction layer in the at least one feature extraction layer. The second feature distribution information includes the face features corresponding to the at least two second sample face images output by each feature extraction layer.

7. The method according to claim 6, characterized in that, The step of determining feature distribution loss information based on the first feature distribution information and the second feature distribution information includes: For each of the feature extraction layers, a first face feature set and a second face feature set corresponding to the feature extraction layer are obtained. The first face feature set refers to the set of face features corresponding to each first sample face image in the first sample face set output by the feature extraction layer, and the second face feature set refers to the set of face features corresponding to each second sample face image in the second sample face set output by the feature extraction layer. Based on the first face feature set and the second face feature set, determine the feature distribution difference information corresponding to the feature extraction layer; The feature distribution difference information corresponding to each of the at least one feature extraction layer is fused to obtain the feature distribution loss information.

8. The method according to claim 7, characterized in that, The first face feature set includes at least two first face features, where each first face feature refers to the face feature corresponding to the first sample face image. The second face feature set includes at least two second face features, where each second face feature refers to the face feature corresponding to the second sample face image. The step of determining the feature distribution difference information corresponding to the feature extraction layer based on the first face feature set and the second face feature set includes: Determine the first feature distance between each pair of the at least two first face features, the second feature distance between the at least two first face features and the at least two second face features, and the third feature distance between each pair of the at least two second face features; The first feature distance, the second feature distance, and the third feature distance are fused to obtain the feature distribution difference information corresponding to the feature extraction layer.

9. The method according to claim 8, characterized in that, The first feature distance, the second feature distance, and the third feature distance are determined by the distance mapping relationship corresponding to the target kernel function. The distance mapping relationship is used to determine the inner product of the feature vectors corresponding to the two input facial features in the target feature space. The target kernel function includes at least one preset kernel function.

10. The method according to any one of claims 5 to 9, characterized in that, The preset face recognition model is trained using the following method: The sample face images in the sample face set are input into the initial face recognition model to be trained for face recognition processing to obtain the second recognition information corresponding to each sample face image. Based on the second identification information and the object label information, the second identification loss information corresponding to the initial face recognition model is determined; The initial face recognition model is adjusted based on the second recognition loss information to obtain the preset face recognition model.

11. A face recognition device, characterized in that, The device includes: The face image acquisition module is used to acquire the face image to be processed; The face image recognition module is used to input the face image to be processed into the target face recognition model for face recognition processing, and obtain the object recognition information corresponding to the face image to be processed; The training data corresponding to the target face recognition model includes a sample face set, which includes a first sample face set and a second sample face set. The first sample face set refers to the set of sample face images with unobstructed faces, and the second sample face set refers to the set of sample face images with obstructed faces. The target face recognition model is obtained by learning the common distribution of face features corresponding to sample face images in the first sample face set and the second sample face set. The target face recognition model includes a target feature extraction layer, which is used to output a first face feature corresponding to a first face image with an unobstructed face and a second face feature corresponding to a second face image with an obstructed face. The feature distribution corresponding to the first face feature and the feature distribution corresponding to the second face feature meet a preset feature distribution alignment condition. The first face image and the second face image are face images to be processed.

12. A computer device, characterized in that, The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the face recognition method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or instruction set is loaded and executed by a processor to implement the face recognition method as described in any one of claims 1 to 10.

14. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, a processor of a computer device reading the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions to cause the computer device to perform the face recognition method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Face recognition model training method, device, system and computer readable medium

    CN110414550A

  • Face recognition model training method and device, equipment and medium

    CN111783600A