Face recognition model processing method, face recognition method and device

By constructing a face recognition model based on reconstruction loss and recognition loss, the problem of low accuracy in recognizing partially occluded face images was solved, achieving accurate recognition of both occluded and complete face images.

CN115708135BActive Publication Date: 2026-07-24TENCENT 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
2021-08-11
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies have low facial recognition accuracy when faced with partially obscured facial images, and cannot effectively identify individuals wearing masks, glasses, bangs, or whose faces are obscured by light.

Method used

The reconstruction network in the face recognition model is used to reconstruct faces from the original face image and the partially occluded face image. Reconstruction loss and recognition loss are constructed, and a model suitable for recognizing partially occluded face images is trained. The reconstruction network can fill in the missing facial data and preserve the original face information.

Benefits of technology

It improves the recognition accuracy of partially occluded face images while maintaining the recognition accuracy of complete face images, without affecting the recognition effect of the original face image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115708135B_ABST
    Figure CN115708135B_ABST
Patent Text Reader

Abstract

The application relates to a face recognition model processing method, a face recognition method and a device. The method relates to a face recognition technology in the field of artificial intelligence, and comprises the following steps: obtaining a first reconstruction image corresponding to an original face image and a second reconstruction image corresponding to a partially occluded face image through a reconstruction network in a face recognition model; constructing a reconstruction loss according to the difference between the original face image and the first reconstruction image and the difference between the original face image and the second reconstruction image; constructing an identification loss by performing face recognition on the first reconstruction image and the second reconstruction image to obtain a face recognition result according to an identification network in the face recognition model; and updating network parameters of the face recognition model based on a target loss constructed by the reconstruction loss and the identification loss. The method can be applied to face recognition in intelligent supermarkets, intelligent traffic and the like, and can improve the accuracy of face recognition of partially occluded face images.
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 method for processing a face recognition model, a face recognition method, and an apparatus. Background Technology

[0002] With the development of computer technology and artificial intelligence technology, facial recognition technology has greatly facilitated accurate and rapid identity verification. For example, common applications of facial recognition include facial recognition unlocking, facial recognition access control, facial payment, facial login, and so on.

[0003] Currently, facial recognition technology typically uses original, complete facial images for identification. However, in real-life situations, obstructions such as masks, glasses, bangs, hats, or lighting conditions can prevent the acquisition of a complete facial image. Current facial recognition technology requires users to remove their masks for recognition; without masks, the lack of complete facial data leads to low accuracy. Therefore, improving the accuracy of facial recognition for partially obscured facial images is a pressing issue that needs to be addressed. Summary of the Invention

[0004] Therefore, it is necessary to provide a face recognition model processing method, face recognition method, and device that can improve the accuracy of face recognition for partially occluded face images, addressing the aforementioned technical problems.

[0005] A method for processing a face recognition model, the method comprising:

[0006] Acquire training samples, which include original face images and partially occluded face images formed by partially occluding the faces in the original face images;

[0007] The reconstruction network in the face recognition model is used to reconstruct the face from the original face image and the partially occluded face image, respectively, to obtain a first reconstructed image corresponding to the original face image and a second reconstructed image corresponding to the partially occluded face image.

[0008] Based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image, a reconstruction loss is constructed;

[0009] Based on the recognition network in the face recognition model, the face recognition results obtained by performing face recognition on the first reconstructed image and the second reconstructed image respectively are used to construct the recognition loss;

[0010] Based on the target loss constructed from the reconstruction loss and the recognition loss, the network parameters of the face recognition model are updated, and the process returns to the step of obtaining training samples to continue executing the above steps until a face recognition model suitable for recognizing partially occluded face images is obtained.

[0011] A face recognition model processing device, the device comprising:

[0012] The acquisition module is used to acquire training samples, which include original face images and partially occluded face images formed by partially occluding the faces in the original face images.

[0013] The face reconstruction module is used to reconstruct the face from the original face image and the partially occluded face image through the reconstruction network in the face recognition model, respectively, to obtain a first reconstructed image corresponding to the original face image and a second reconstructed image corresponding to the partially occluded face image.

[0014] The reconstruction loss construction module is used to construct a reconstruction loss based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image;

[0015] The recognition loss construction module is used to construct the recognition loss based on the face recognition results obtained by performing face recognition on the first reconstructed image and the second reconstructed image respectively, according to the recognition network in the face recognition model.

[0016] The network parameter update module is used to update the network parameters of the face recognition model based on the target loss constructed by the reconstruction loss and the recognition loss, and then return to the step of obtaining training samples to continue to execute the above steps until a face recognition model suitable for recognizing partially occluded face images is obtained.

[0017] In one embodiment, the reconstruction loss is a feature-level feature reconstruction loss, and the reconstruction loss construction module is further configured to: construct the feature reconstruction loss based on the feature differences between the image features extracted from the original face image and the first reconstructed image, and the feature differences between the image features extracted from the original face image and the second reconstructed image, respectively.

[0018] In one embodiment, the reconstruction loss is an image reconstruction loss at the image level, and the reconstruction loss construction module is further configured to: construct the image reconstruction loss based on the image difference between the original face image and the first reconstructed image, and the image difference between the original face image and the second reconstructed image.

[0019] In one embodiment, the reconstruction loss construction module is further configured to: construct a feature reconstruction loss based on the feature differences between image features extracted from the original face image and the first reconstructed image, and the feature differences between image features extracted from the original face image and the second reconstructed image, respectively; construct an image reconstruction loss based on the image differences between the original face image and the first reconstructed image, and the image differences between the original face image and the second reconstructed image, respectively; and fuse the feature reconstruction loss and the image reconstruction loss to obtain the reconstruction loss used to constrain the reconstruction network.

[0020] In one embodiment, the recognition network in the face recognition model is a recognition network pre-trained based on the training samples; the reconstruction loss construction module is further configured to: input the original face image, the first reconstructed image, and the second reconstructed image into the pre-trained recognition network in the face recognition model respectively; and extract features from the original face image, the first reconstructed image, and the second reconstructed image through the pre-trained recognition network to obtain the image features corresponding to each of the original face image, the first reconstructed image, and the second reconstructed image.

[0021] In one embodiment, the reconstruction loss construction module is further configured to: obtain a trained face reconstruction supervision network, the face reconstruction supervision network being used to assist the reconstruction network in the face recognition model in training; input the original face image, the first reconstructed image, and the second reconstructed image into the face reconstruction supervision network respectively; and extract features from the original face image, the first reconstructed image, and the second reconstructed image respectively through the face reconstruction supervision network to obtain the image features corresponding to each of the original face image, the first reconstructed image, and the second reconstructed image.

[0022] In one embodiment, the recognition loss construction module is further configured to: obtain the identity label that is commonly associated with the original face image and the partially occluded face image; extract image features from the first reconstructed image using the recognition network in the face recognition model, and obtain a first face recognition result based on the image features corresponding to the first reconstructed image; extract image features from the second reconstructed image using the recognition network in the face recognition model, and obtain a second face recognition result based on the image features corresponding to the second reconstructed image; and construct the recognition loss based on the difference between the first face recognition result and the identity label, and the difference between the second face recognition result and the identity label.

[0023] In one embodiment, the network parameter update module is further configured to: perform supervised training on the reconstruction network in the face recognition model based on the target loss constructed from the reconstruction loss and the recognition loss, and update the network parameters of the reconstruction network; when the supervised training stopping condition is met, return to the step of obtaining training samples to continue training, and perform joint training on the recognition network and reconstruction network in the face recognition model based on the target loss constructed from the reconstruction loss and the recognition loss, and update the network parameters of the recognition network and reconstruction network in the face recognition model; when the joint training stopping condition is met, obtain a face recognition model suitable for recognizing partially occluded face images.

[0024] In one embodiment, the recognition network in the face recognition model is a recognition network pre-trained based on pre-training samples; the processing device of the face recognition model further includes a pre-training module, which is used to: acquire pre-training samples including faces; input the pre-training samples into an initial recognition network; extract features from the pre-training samples through the initial recognition network to obtain image features corresponding to the pre-training samples; obtain a face recognition result corresponding to the pre-training samples based on the image features corresponding to the pre-training samples; construct a pre-training recognition loss based on the face recognition result corresponding to the pre-training samples and the identity label corresponding to the pre-training samples; update the network parameters of the initial recognition network based on the pre-training recognition loss, and then return to the step of acquiring pre-training samples including faces to continue training until a pre-trained recognition network is obtained.

[0025] In one embodiment, the processing device of the face recognition model further includes a face recognition module; the acquisition module is further configured to: acquire a face image to be recognized and an identity to be verified, wherein the face image to be recognized is a complete face image or a partially occluded face image formed by partial occlusion of the face; the face reconstruction module is further configured to: perform face reconstruction on the face image to be recognized through the reconstruction network in the trained face recognition model to obtain a reconstructed image corresponding to the face image to be recognized; the face recognition module is configured to: perform face recognition on the reconstructed image through the recognition network in the trained face recognition model to obtain image features corresponding to the reconstructed image; match the image features corresponding to the reconstructed image with the image features corresponding to the identity to be verified; when the match is successful, it is determined that the face image to be recognized has passed the identity verification.

[0026] In one embodiment, the processing device of the face recognition model further includes a face recognition module; the acquisition module is further configured to: acquire a face image to be recognized, wherein the face image to be recognized is a complete face image or a partially occluded face image formed by partially occluding the face; the face reconstruction module is further configured to: perform face reconstruction on the face image to be recognized through the reconstruction network in the trained face recognition model to obtain a reconstructed image corresponding to the face image to be recognized; the face recognition module is configured to: perform face recognition on the reconstructed image through the recognition network in the trained face recognition model to obtain image features corresponding to the reconstructed image; match the image features corresponding to the reconstructed image with at least one reference image feature, and take the target identity corresponding to the successfully matched reference image feature as the identity of the face in the face image to be recognized.

[0027] A computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described face recognition model processing method.

[0028] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described face recognition model processing method.

[0029] A computer program 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 steps of the above-described face recognition model processing method.

[0030] The aforementioned face recognition model's processing method, apparatus, computer equipment, and storage medium, on the one hand, utilize the reconstruction network within the face recognition model to reconstruct faces from both the original face image and the partially occluded face image, obtaining corresponding first and second reconstructed images respectively. A reconstruction loss can then be constructed based on the differences between the original face image and the first and second reconstructed images. This reconstruction loss constrains the reconstruction network during training, enabling it to retain image information from the original face image while also learning the ability to complete partially occluded face images. On the other hand, the recognition loss, constructed based on the face recognition results obtained from the first and second reconstructed images, constrains the reconstruction network during training, ensuring that both the original face image and the reconstructed images from the partially occluded face image can be accurately recognized by the recognition network. Thus, the face recognition model trained based on the target loss constructed from the reconstruction and recognition losses not only possesses the ability to recognize complete face images but also significantly improves the accuracy of face recognition from partially occluded face images.

[0031] A face recognition method, the method comprising:

[0032] Acquire the image of the face to be identified;

[0033] The reconstructed image is obtained by using the reconstruction network in the trained face recognition model to reconstruct the face image to be recognized.

[0034] The reconstructed image is then subjected to face recognition through the recognition network in the trained face recognition model to obtain the face recognition result corresponding to the face image to be recognized.

[0035] The face recognition model is trained based on the difference between the original face image and the first reconstructed image obtained by the reconstruction network from the original face image, the difference between the original face image and the second reconstructed image obtained by the reconstruction network from the partially occluded face image corresponding to the original face image, and the face recognition results corresponding to the first reconstructed image and the second reconstructed image obtained by the recognition network.

[0036] A facial recognition device, the device comprising:

[0037] The acquisition module is used to acquire the face image to be identified;

[0038] The face reconstruction module is used to reconstruct the face of the face to be identified by using the reconstruction network in the trained face recognition model, and obtain the reconstructed image corresponding to the face of the face to be identified.

[0039] The face recognition module is used to perform face recognition on the reconstructed image through the recognition network in the trained face recognition model, and obtain the face recognition result corresponding to the face image to be recognized;

[0040] The face recognition model is trained based on the difference between the original face image and the first reconstructed image obtained by the reconstruction network from the original face image, the difference between the original face image and the second reconstructed image obtained by the reconstruction network from the partially occluded face image corresponding to the original face image, and the face recognition results corresponding to the first reconstructed image and the second reconstructed image obtained by the recognition network.

[0041] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described face recognition method.

[0042] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described face recognition method.

[0043] A computer program 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 steps of the aforementioned face recognition method.

[0044] The aforementioned face recognition method, device, computer equipment, and storage medium reconstruct the face from the image to be recognized using the reconstruction network in the trained face recognition model, thereby obtaining the reconstructed image corresponding to the image to be recognized. Since the reconstruction network can preserve the image information of the original face image and fill in the missing face data for partially occluded face images, the face recognition result obtained by performing face recognition on the reconstructed image through the recognition network in the trained face recognition model not only does not affect the accuracy of face recognition on complete face images, but also improves the accuracy of face recognition on partially occluded face images. Attached Figure Description

[0045] Figure 1 This is an application environment diagram of a face recognition model processing method in one embodiment;

[0046] Figure 2This is a flowchart of a face recognition model processing method in one embodiment;

[0047] Figure 3 This is a schematic diagram illustrating the construction of the target loss in one embodiment;

[0048] Figure 4 A schematic diagram illustrating the construction of the target loss in another embodiment;

[0049] Figure 5 This is a schematic diagram illustrating the construction of the target loss in yet another embodiment;

[0050] Figure 6 This is a schematic diagram of the training process of a face recognition model in one embodiment;

[0051] Figure 7 This is a flowchart of a face recognition model processing method in another embodiment;

[0052] Figure 8 This is a flowchart of a face recognition model processing method in yet another embodiment;

[0053] Figure 9 Here is a flowchart of a face recognition method in one embodiment;

[0054] Figure 10 This is a structural block diagram of a face recognition model processing device in one embodiment;

[0055] Figure 11 This is a structural block diagram of a face recognition device in one embodiment;

[0056] Figure 12 This is an internal structural diagram of a computer device in one embodiment;

[0057] Figure 13 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0059] The face recognition model processing method and face recognition method provided in this application's embodiments relate to Artificial Intelligence (AI) technology. AI utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to obtain optimal results—theories, methods, technologies, and application systems. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce new intelligent machines capable of reacting in a manner similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.

[0060] 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.

[0061] The face recognition model processing method provided in this application mainly involves machine learning (ML) technology in artificial intelligence. Machine learning is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and many other disciplines. 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.

[0062] For example, in this embodiment, the reconstruction network in the face recognition model is trained under supervision using the original face image and the partially occluded face image formed by partially occluding the face in the original face image, and the reconstruction network and recognition network in the face recognition model are jointly trained to finally obtain a face recognition model suitable for recognizing partially occluded face images.

[0063] The face recognition method provided in this application mainly relates to computer vision (CV) technology in artificial intelligence. Computer vision is a science that studies how to enable machines to "see." More specifically, it refers to machine vision that uses cameras and computers to replace human eyes for target recognition, tracking, and measurement, and further performs image processing to make the computer-processed images more suitable for human observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, attempting to establish artificial intelligence systems capable of extracting information from images or multi-dimensional data. Computer vision technology typically includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, autonomous driving, intelligent transportation, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.

[0064] For example, in the embodiments of this application, the reconstruction network in the trained face recognition model is used to reconstruct the face image to be recognized, thereby obtaining the reconstructed image corresponding to the face image to be recognized. Then, the recognition network in the trained face recognition model is used to perform face recognition on the reconstructed image, thereby obtaining the face recognition result corresponding to the face image to be recognized.

[0065] The face recognition model processing method and face recognition method provided in this application embodiment may also involve blockchain technology. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain may include a blockchain underlying platform, a platform product service layer, and an application service layer.

[0066] For example, in this embodiment of the application, the server can be a blockchain node in a blockchain network, the trained face recognition model can be stored on the blockchain, and the face image to be recognized can be uploaded to the data block of the blockchain for face recognition.

[0067] The face recognition model processing method provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. Terminal 102 can be, but is not limited to, various smartphones, tablets, laptops, desktop computers, portable wearable devices, smart speakers, etc. Server 104 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.

[0068] In one embodiment, terminal 102 acquires training samples, including the original face image and partially occluded face images formed by partially occluding the face in the original face image. The training samples are sent to server 104. Server 104 uses the reconstruction network in the face recognition model to reconstruct the face from the original face image and the partially occluded face image, respectively, to obtain a first reconstructed image corresponding to the original face image and a second reconstructed image corresponding to the partially occluded face image. Based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image, a reconstruction loss is constructed. Based on the recognition network in the face recognition model, face recognition is performed on the first reconstructed image and the second reconstructed image to obtain face recognition results, and a recognition loss is constructed. Based on the target loss constructed from the reconstruction loss and the recognition loss, the network parameters of the face recognition model are updated, and the process returns to the step of acquiring training samples to continue executing the above steps until a face recognition model suitable for recognizing partially occluded face images is obtained.

[0069] The face recognition model processing method provided in this application embodiment can be executed by a face recognition model processing device provided in this application embodiment, or a computer device integrating the face recognition model processing device. The face recognition model processing device can be implemented in hardware or software. The computer device can be... Figure 1 The terminal 102 or server 104 shown.

[0070] The face recognition method provided in this application can also be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. In one embodiment, terminal 102 acquires a face image to be recognized and sends it to server 104. Server 104 uses the reconstruction network in a trained face recognition model to reconstruct the face image to obtain a reconstructed image corresponding to the face image to be recognized. Then, it uses the recognition network in the trained face recognition model to perform face recognition on the reconstructed image to obtain the face recognition result corresponding to the face image to be recognized. The face recognition model is trained based on the difference between the original face image and the first reconstructed image obtained by the reconstruction network from the original face image, the difference between the original face image and the second reconstructed image obtained by the reconstruction network from the partially occluded face image corresponding to the original face image, and the face recognition results obtained by the recognition network from the first and second reconstructed images, which are constructed using a target loss.

[0071] The face recognition method provided in this application embodiment can be executed by a face recognition device provided in this application embodiment, or a computer device integrating the face recognition device, wherein the face recognition device can be implemented in hardware or software. The computer device can be... Figure 1 The terminal 102 or server 104 shown.

[0072] The face recognition method provided in this application can be applied to one-to-one identity verification scenarios. It improves the accuracy of face recognition for partially occluded face images without affecting the accuracy of face recognition for complete face images. In one-to-one identity verification scenarios, when the identity to be verified is known, the image features corresponding to the face image to be recognized are compared with the image features corresponding to the identity to be verified to confirm whether the identity corresponding to the face in the face image is the identity to be verified. Examples include identity verification scenarios and terminal screen unlocking scenarios.

[0073] For example, to ensure user data security, electronic payment applications, financial service applications, social communication applications, government service applications, and travel service applications all have identity verification functions. Users can only conduct related business based on the application after their identity has been verified. Specifically, computer equipment collects the user's facial image to be identified. This image can be a complete face image or a partially occluded face image. The computer equipment uses the reconstruction network in a trained facial recognition model to reconstruct the face from the image to be identified. If the face image is a complete face image, the reconstruction network retains the original facial data; if the face image is partially occluded, the reconstruction network completes the missing facial data. The recognition network in the trained facial recognition model then performs facial recognition on the reconstructed image to obtain image features. These features are matched with the image features corresponding to the identity to be verified. When a match is successful, the face image is considered to have passed identity verification.

[0074] The face recognition method provided in this application can be applied to one-to-many identity recognition scenarios. It improves the accuracy of face recognition for partially occluded face images without affecting the accuracy of face recognition for complete face images. In one-to-many identity recognition scenarios, the image features corresponding to the face image to be recognized are compared with pre-stored reference image features in a database to determine the identity corresponding to the face in the face image to be recognized from the identities corresponding to the reference image features in the database. Examples include traffic safety scenarios, face payment scenarios, work attendance scenarios, and missing persons retrieval scenarios. This face recognition method can provide great convenience in scenarios such as smart transportation, smart travel, and smart supermarkets.

[0075] For example, in a facial recognition payment scenario, a computer device captures the facial image of the user to be recognized. This image can be a complete face or a partially occluded face. The reconstruction network in a trained facial recognition model reconstructs the face from the image. If the image is a complete face, the reconstruction network preserves the original facial data; if it is partially occluded, the network fills in the missing facial data. The recognition network in the trained facial recognition model then performs facial recognition on the reconstructed image to obtain image features. These features are matched with at least one reference image feature, and the payment is deducted from the account corresponding to the successfully matched reference image feature.

[0076] In one embodiment, such as Figure 2 As shown, a method for processing a face recognition model is provided. This embodiment mainly applies this method to the above-mentioned... Figure 1Using a computer device (terminal 102 or server 104) as an example, the following steps are included:

[0077] Step S202: Obtain training samples, which include the original face image and partially occluded face images formed by partially occluding the face in the original face image.

[0078] The training samples are face images used to train the face recognition model. The training samples include original face images and partially occluded face images corresponding to the original face images. The original face image is an image containing a complete face, and the partially occluded face image is an image formed by partially occluding the face in the original face image.

[0079] In one embodiment, a computer device partially occludes an original face image to obtain a partially occluded face image corresponding to the original face image. For example, the computer device identifies key points of the face in the original face image and adds image occlusion material at specific locations on the face based on these key points to obtain a partially occluded face image corresponding to the original face image. The image occlusion material can be a mask, glasses, bangs, a hat, or lighting, etc.

[0080] In one embodiment, a computer device performs partial occlusion processing on an original face image to varying degrees, obtaining partially occluded face images with different degrees of occlusion corresponding to the original face image. The computer device then uses the original face image and the partially occluded face images with different degrees of occlusion to train a face recognition model, resulting in a face recognition model suitable for recognizing partially occluded face images with different degrees of occlusion.

[0081] In one embodiment, the computer device acquires at least one set of training samples and trains the face recognition model based on the at least one set of training samples. Optionally, a set of training samples may include an original face image and at least one partially occluded face image corresponding to the original face image. When the at least one partially occluded face image is more than one partially occluded face image, the more than one partially occluded face image may be partially occluded face images with different degrees of occlusion.

[0082] In one embodiment, a computer device performs partial occlusion processing on an original face image at different occlusion locations to obtain partially occluded face images at different occlusion locations corresponding to the original face image. The computer device then uses the original face image and the partially occluded face images at different occlusion locations to train a face recognition model, resulting in a face recognition model suitable for recognizing partially occluded face images at different occlusion locations.

[0083] In facial recognition scenarios, obstructions such as bangs, hats, glasses, masks, or lighting often prevent the acquisition of complete facial images. This lack of complete facial data leads to low accuracy in facial recognition models. The facial recognition model processing method provided in this application improves upon the model by incorporating a reconstruction network. This network reconstructs faces from partially obscured images, and the recognition network within the model performs facial recognition based on the complete facial data output by the reconstruction network, thereby enhancing the model's accuracy. Therefore, this application uses original facial images containing complete faces and corresponding partially obscured facial images as training samples. The facial recognition model is trained using these samples, and the reconstruction network within the model "learns" to reconstruct faces from partially obscured images, supplementing the missing facial data in these images.

[0084] Step S204: Using the reconstruction network in the face recognition model, face reconstruction is performed on the original face image and the partially occluded face image respectively to obtain the first reconstructed image corresponding to the original face image and the second reconstructed image corresponding to the partially occluded face image.

[0085] To enable the reconstruction network in a face recognition model to not only complete the missing facial information required for face recognition in partially occluded face images, but also to preserve the original facial data of the original face image, thus ensuring accurate recognition of both complete and partially occluded face images, this application inputs the original face image and the corresponding partially occluded face image into the reconstruction network. The reconstruction network uses the original face image as a reference to "learn" to complete the missing facial data in the partially occluded face image, and uses the original face image as a reference to "learn" to preserve the original facial data of the original face image.

[0086] In one embodiment, a computer device inputs an original face image and a partially occluded face image corresponding to the original face image into a reconstruction network. The reconstruction network then performs face reconstruction on the original face image and the partially occluded face image respectively to obtain a first reconstructed image corresponding to the original face image and a second reconstructed image corresponding to the partially occluded face image.

[0087] In one embodiment, the reconstruction network can be a network structure composed of convolutional neural networks, which generally includes processes such as convolution computation, non-linear activation function computation, pooling computation, upsampling processing, and deconvolution. For example, the reconstruction network can be a deep learning network using an encoder-decoder structure, such as U-Net, U-Net++, U-Net+++, etc.

[0088] Step S206: Construct a reconstruction loss based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image.

[0089] In this application, a computer device constructs a reconstruction loss, which can be used to constrain the reconstruction network so that the reconstruction network, with the original face image as a reference, "learns" to fill in the missing face data in the partially occluded face image, and with the original face image as a reference, "learns" to preserve the original face data of the original face image.

[0090] In one embodiment, the computer device constructs a reconstruction loss based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image. Specifically, the portion of the reconstruction loss that represents the difference between the original face image and the first reconstructed image is used to prompt the reconstruction network to "learn" to preserve the original face data of the original face image, using the original face image as a reference. The portion of the reconstruction loss that represents the difference between the original face image and the second reconstructed image is used to prompt the reconstruction network to "learn" to complete the missing face data in partially occluded face images, using the original face image as a reference.

[0091] For example, refer to Figure 3 , Figure 3 This is a schematic diagram illustrating the construction of the target loss in one embodiment. The computer device inputs the original face image and the partially occluded face image corresponding to the original face image into the reconstruction network 302. The reconstruction network 302 obtains a first reconstructed image corresponding to the original face image and a second reconstructed image corresponding to the partially occluded face image. Based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image, a reconstruction loss is constructed.

[0092] It is understood that a general loss function can meet the reconstruction loss requirements of this application embodiment. Therefore, the computer device can use a general loss function to construct the reconstruction loss based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image. General loss functions include the Cosine similarity loss function, the Softmax function, the Contrastive Loss function, the Triplet Loss function, the Center Loss function, the Margin function, etc.

[0093] Step S208: Based on the recognition network in the face recognition model, perform face recognition on the first reconstructed image and the second reconstructed image respectively to obtain the face recognition results, and construct the recognition loss.

[0094] In this application, a computer device constructs a recognition loss, which can be used to constrain the reconstruction network so that the reconstruction network can accurately recognize the reconstructed image, whether it is the original face image or the reconstructed image obtained by the reconstruction network from the face reconstruction of the partially occluded face image.

[0095] In one embodiment, a computer device acquires the identity tags corresponding to both the original face image and the partially occluded face image. A recognition network in a face recognition model performs face recognition on the first reconstructed image to obtain a first face recognition result. The recognition network then performs face recognition on the second reconstructed image to obtain a second face recognition result. Based on the differences between the first face recognition result and the identity tag, and the differences between the second face recognition result and the identity tag, a recognition loss is constructed. Specifically, the difference between the first face recognition result and the identity tag in the recognition loss is used to enable the reconstruction network to "learn" face reconstruction from the original face image, allowing the recognition network to accurately recognize the first reconstructed image. Similarly, the difference between the second face recognition result and the identity tag in the recognition loss is used to enable the reconstruction network to "learn" face reconstruction from the partially occluded face image, allowing the recognition network to accurately recognize the second reconstructed image.

[0096] The identity tag is used to describe the identity corresponding to the face in the face image. Optionally, the identity tag is an identification identifier corresponding to the face in the original face image and the partially occluded face image. The identity identifier is used to uniquely identify the user and can consist of at least one of letters, numbers, and words.

[0097] In one embodiment, step S208 includes: a computer device acquiring an identity label corresponding to both the original face image and the partially occluded face image; extracting image features from the first reconstructed image using the recognition network in the face recognition model, and obtaining a first face recognition result based on the image features corresponding to the first reconstructed image; extracting image features from the second reconstructed image using the recognition network in the face recognition model, and obtaining a second face recognition result based on the image features corresponding to the second reconstructed image; and constructing a recognition loss based on the differences between the first face recognition result and the identity label, and the differences between the second face recognition result and the identity label.

[0098] Image features are data that reflect the facial features in the reconstructed image. Facial features are the inherent physiological characteristics of the human face, such as iris morphology, the positional relationship between facial organs, the shape of facial organs, the size of facial organs, and skin texture.

[0099] In one embodiment, the image features may specifically be one or a combination of several of the following: location information, texture information, shape information, and color information related to facial features, extracted from the original face image, the first reconstructed image, or the second reconstructed image. For example, location information may be the distance or angle between various facial features.

[0100] For example, continue to refer to Figure 3 The computer device inputs the first reconstructed image corresponding to the original face image and the second reconstructed image corresponding to the partially occluded face image into the recognition network 304. The recognition network 304 obtains the first image features corresponding to the first reconstructed image, and obtains the first face recognition result corresponding to the first reconstructed image based on the first image features. The recognition network 304 obtains the second image features corresponding to the second reconstructed image, and obtains the second face recognition result corresponding to the second reconstructed image based on the second image features. Based on the differences between the first face recognition result and the identity label, and the differences between the second face recognition result and the identity label, a recognition loss is constructed.

[0101] In one embodiment, both the first and second face recognition results can be probability vectors, with their dimensions matching the number of identity identifiers in the training samples. Taking the probability vector corresponding to the first face recognition result as an example, the value of each dimension represents the probability that the face in the first reconstructed image corresponds to one of the identity identifiers.

[0102] In one embodiment, a computer device acquires the identity tags corresponding to both the original face image and the partially occluded face image, converts the identity tags into tag vectors, and the tag vectors have the same dimension as the aforementioned probability vectors. Based on the differences between the tag vectors and the probability vectors corresponding to the first face recognition result, and the differences between the tag vectors and the probability vectors corresponding to the second face recognition result, a recognition loss is constructed.

[0103] It is understood that a general loss function can meet the requirements of the recognition loss in the embodiments of this application. Therefore, the computer device can use a general loss function to construct the recognition loss based on the face recognition results obtained by the recognition network from the first reconstructed image and the second reconstructed image respectively.

[0104] Step S210: Based on the target loss constructed from the reconstruction loss and recognition loss, update the network parameters of the face recognition model and return to the step of obtaining training samples to continue executing the above steps until a face recognition model suitable for recognizing partially occluded face images is obtained.

[0105] In one embodiment, the computer device constructs a target loss based on reconstruction loss and recognition loss, updates the network parameters of the face recognition model according to the target loss, until the training stopping condition is met, and obtains a face recognition model suitable for recognizing partially occluded face images.

[0106] For example, please refer to... Figure 3 The computer device constructs a target loss based on the reconstruction loss and the recognition loss. Optionally, the computer device obtains a preset loss weighting coefficient, and sums the reconstruction loss and the recognition loss according to the preset loss weighting coefficient to obtain the target loss.

[0107] In one embodiment, the computer device obtains the gradient corresponding to the current training based on the gradient descent algorithm, following the direction that minimizes the target loss, and updates the network parameters of the face recognition model according to the gradient. The gradient descent algorithm can be stochastic gradient descent, or an algorithm optimized based on stochastic gradient descent, such as stochastic gradient descent with a moving average term.

[0108] It is understood that the training stopping condition involved in the embodiments of this application may be that the number of training sessions reaches a preset number, or the loss value calculated by the target loss is less than a preset value, etc.

[0109] In one embodiment, step S210 includes: performing supervised training on the reconstruction network in the face recognition model based on the target loss constructed from the reconstruction loss and the recognition loss, and updating the network parameters of the reconstruction network; when the supervised training stopping condition is met, returning to the step of obtaining training samples to continue training, and jointly training the recognition network and the reconstruction network in the face recognition model based on the target loss constructed from the reconstruction loss and the recognition loss, and updating the network parameters of the recognition network and the reconstruction network in the face recognition model; when the joint training stopping condition is met, obtaining a face recognition model suitable for recognizing partially occluded face images.

[0110] In one embodiment, the computer device first fixes the network parameters of the recognition network in the face recognition model, performs supervised training on the reconstruction network in the face recognition model based on the target loss, and updates the network parameters of the reconstruction network; when the supervised training stopping condition is met, the target loss is constructed again, and the recognition network and reconstruction network in the face recognition model are jointly trained based on the target loss, and the network parameters of the recognition network and reconstruction network in the face recognition model are updated; when the joint training stopping condition is met, a face recognition model suitable for recognizing partially occluded face images is obtained.

[0111] Specifically, supervised training of the reconstruction network in the face recognition model aims to constrain the network so that it preserves the original facial data when reconstructing faces from original images, and fills in missing facial data in partially occluded images. Furthermore, the reconstructed images, whether from the original or partially occluded images, can be accurately recognized by the recognition network. Joint training of the recognition and reconstruction networks in the face recognition model aims to fine-tune their parameters to improve their compatibility.

[0112] In the aforementioned face recognition model processing method, on the one hand, the reconstruction network in the face recognition model performs face reconstruction on the original face image and the partially occluded face image respectively, obtaining corresponding first reconstructed images and second reconstructed images. A reconstruction loss can be constructed based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image. This reconstruction loss constrains the reconstruction network during training, enabling it to retain image information from the original face image while also learning the ability to complete partially occluded face images. On the other hand, the recognition loss, constructed based on the face recognition results obtained from the first and second reconstructed images, constrains the reconstruction network during training, ensuring that the reconstruction network can accurately recognize both the original face image and the reconstructed images from the partially occluded face image. Thus, the face recognition model trained based on the target loss constructed from the reconstruction loss and recognition loss not only possesses the ability to recognize complete face images but also significantly improves the accuracy of face recognition on partially occluded face images.

[0113] In one embodiment, the reconstruction loss is a feature-level feature reconstruction loss, which is constructed based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image. The reconstruction loss includes: constructing a feature reconstruction loss based on the feature differences between the image features extracted from the original face image and the first reconstructed image, and the feature differences between the image features extracted from the original face image and the second reconstructed image, respectively.

[0114] In one embodiment, the computer device performs feature extraction on the original face image, the first reconstructed image, and the second reconstructed image to obtain the image features corresponding to each of the original face image, the first reconstructed image, and the second reconstructed image. Based on the differences between the image features corresponding to the original face image and the first reconstructed image, and the differences between the image features corresponding to the original face image and the second reconstructed image, a feature reconstruction loss is constructed.

[0115] In one embodiment, the feature reconstruction loss can be expressed by the following formula:

[0116]

[0117] in, Indicates the feature reconstruction loss; Represents the image features corresponding to the original human face image; This represents the image features corresponding to the first reconstructed image; This represents the image features corresponding to the second reconstructed image; This represents the second norm.

[0118] In this embodiment, the feature reconstruction loss can be used to constrain the reconstruction network. Specifically, the first reconstructed image obtained by the reconstruction network from the original face image is constrained to maintain consistency with the original face image in terms of image features, and the second reconstructed image obtained by the reconstruction network from the partially occluded face image is constrained to maintain consistency with the original face image in terms of image features. This enables the trained face recognition model to complete the missing image features of the partially occluded face image and maintain the original image features of the original face image when performing face recognition.

[0119] In one embodiment, the reconstruction loss is an image-level image reconstruction loss, which is constructed based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image. The reconstruction loss includes: constructing the image reconstruction loss based on the image differences between the original face image and the first reconstructed image, and the image differences between the original face image and the second reconstructed image.

[0120] In one embodiment, the image reconstruction loss may constrain the original face image and the first reconstructed image to maintain consistency in image parameters, and the original face image and the second reconstructed image to maintain consistency in image parameters. These image parameters may include, for example, at least one of image size and pixel values.

[0121] In one embodiment, the image reconstruction loss can be the MSE (Mean Square Error) loss function.

[0122] In one embodiment, the image reconstruction loss can be expressed by the following formula:

[0123]

[0124] in, Indicates the image reconstruction loss; Represents the original human face image; This represents the first reconstructed image; This represents the second reconstructed image; This represents the first norm.

[0125] In this embodiment, the image reconstruction loss can be used to constrain the reconstruction network. Specifically, the first reconstructed image obtained by the reconstruction network from the original face image is constrained to maintain consistency with the original face image in terms of image parameters, and the second reconstructed image obtained by the reconstruction network from the partially occluded face image is constrained to maintain consistency with the original face image in terms of image parameters. This enables the trained face recognition model to complete the missing image parameters of the partially occluded face image and maintain the original image parameters of the original face image when performing face recognition.

[0126] In one embodiment, a reconstruction loss is constructed based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image. This includes: constructing a feature reconstruction loss based on the feature differences between image features extracted from the original face image and the first reconstructed image, and the feature differences between image features extracted from the original face image and the second reconstructed image, respectively; constructing an image reconstruction loss based on the image differences between the original face image and the first reconstructed image, and the image differences between the original face image and the second reconstructed image, respectively; and fusing the feature reconstruction loss and the image reconstruction loss to obtain a reconstruction loss used to constrain the reconstruction network.

[0127] In one embodiment, the computer device constructs a feature reconstruction loss based on the feature differences between image features extracted from the original face image and the first reconstructed image, and the feature differences between image features extracted from the original face image and the second reconstructed image, respectively. Based on the image differences between the original face image and the first reconstructed image, and the image differences between the original face image and the second reconstructed image, the device constructs an image reconstruction loss. Based on the face recognition results obtained by performing face recognition on the first reconstructed image and the second reconstructed image respectively, the device constructs a recognition loss. Finally, the device fuses the feature reconstruction loss, the image reconstruction loss, and the recognition loss to obtain the target loss.

[0128] In one embodiment, the computer device obtains a preset loss weighting coefficient, and sums the feature reconstruction loss, image reconstruction loss, and recognition loss according to the preset loss weighting coefficient to obtain the target loss.

[0129] In one embodiment, the target loss can be expressed by the following formula:

[0130]

[0131] in, Indicates target loss; Indicates the feature reconstruction loss; Indicates the image reconstruction loss; Indicates recognition loss; , , These represent the respective weighted coefficients for feature reconstruction loss, image reconstruction loss, and recognition loss.

[0132] In this embodiment, a target loss is constructed based on feature reconstruction loss, image reconstruction loss, and recognition loss. The face recognition model is trained based on the target loss, so that when the trained face recognition model performs face recognition, it can complete the missing image features and image parameters of partially occluded face images, maintain the original image features and image parameters of the original face image, and improve the accuracy of face recognition.

[0133] In one embodiment, the recognition network in the face recognition model is a recognition network pre-trained based on training samples; the method further includes: inputting the original face image, the first reconstructed image, and the second reconstructed image into the pre-trained recognition network in the face recognition model respectively; and extracting features from the original face image, the first reconstructed image, and the second reconstructed image through the pre-trained recognition network to obtain the image features corresponding to each of the original face image, the first reconstructed image, and the second reconstructed image.

[0134] In one embodiment, a computer device can extract image features from the original face image, the first reconstructed image, and the second reconstructed image through a pre-trained recognition network, and then construct a feature reconstruction loss based on the differences between the image features extracted from the original face image and the first reconstructed image, and the differences between the image features extracted from the original face image and the second reconstructed image.

[0135] For example, refer to Figure 4 , Figure 4 This is a schematic diagram illustrating the construction of the target loss in another embodiment. A computer device inputs an original face image and a partially occluded face image corresponding to the original face image into a reconstruction network. The reconstruction network obtains a first reconstructed image corresponding to the original face image and a second reconstructed image corresponding to the partially occluded face image. The first reconstructed image, the second reconstructed image, and the original face image are then input into a pre-trained recognition network. The pre-trained recognition network obtains a first image feature corresponding to the first reconstructed image, a second image feature corresponding to the second reconstructed image, and an original image feature corresponding to the original face image. Based on the differences between the original image features and the first image features, and the differences between the original image features and the second image features, a feature reconstruction loss is constructed. The first and second image features are further used to determine the first face recognition result corresponding to the first reconstructed image and the second face recognition result corresponding to the second reconstructed image, respectively.

[0136] In one embodiment, the pre-trained recognition network can be trained using training samples including the original face image and the partially occluded face image. When pre-training the recognition network with training samples, it is not necessary to input the original face image and the corresponding partially occluded face image into the recognition network in pairs; the original face image and the corresponding partially occluded face image can be used as separate training samples.

[0137] In one embodiment, the computer device inputs training samples into an initial recognition network, extracts features from the training samples through the initial recognition network to obtain image features corresponding to the training samples, obtains face recognition results corresponding to the training samples based on the image features corresponding to the training samples, constructs a pre-trained recognition loss based on the face recognition results corresponding to the training samples and the identity labels corresponding to the training samples, and updates the network parameters of the initial recognition network based on the pre-trained recognition loss until a pre-trained recognition network is obtained.

[0138] In this embodiment, the reconstruction network is trained by identifying the network, which eliminates the need for additional network structures and saves resources during the training process.

[0139] In one embodiment, the method further includes: acquiring a trained face reconstruction supervision network, which is used to assist the reconstruction network in the face recognition model in training; inputting the original face image, the first reconstructed image, and the second reconstructed image into the face reconstruction supervision network respectively; and extracting features from the original face image, the first reconstructed image, and the second reconstructed image through the face reconstruction supervision network to obtain the image features corresponding to the original face image, the first reconstructed image, and the second reconstructed image respectively.

[0140] In one embodiment, a computer device introduces a face reconstruction supervision network to assist in training the reconstruction network in a face recognition model. The trained face reconstruction supervision network extracts image features from the original face image, the first reconstructed image, and the second reconstructed image, respectively. Then, based on the differences between the image features extracted from the original face image and the first reconstructed image, and the differences between the image features extracted from the original face image and the second reconstructed image, a feature reconstruction loss is constructed.

[0141] In one embodiment, the face reconstruction supervision network can be a network structure that is more complex, has higher feature extraction accuracy, and is more versatile than the recognition network.

[0142] In one embodiment, the image input size of the face reconstruction supervision network is the same as the image input size of the recognition network.

[0143] For example, refer to Figure 5 , Figure 5This is a schematic diagram illustrating the construction of the target loss in another embodiment. The computer device inputs the original face image and a partially occluded face image corresponding to the original face image into a reconstruction network. The reconstruction network obtains a first reconstructed image corresponding to the original face image and a second reconstructed image corresponding to the partially occluded face image. The first reconstructed image, the second reconstructed image, and the original face image are then input into a trained face reconstruction supervision network. The trained face reconstruction supervision network obtains first image features corresponding to the first reconstructed image, second image features corresponding to the second reconstructed image, and original image features corresponding to the original face image. Based on the differences between the original image features and the first image features, and the differences between the original image features and the second image features, a feature reconstruction loss is constructed.

[0144] In one embodiment, the face reconstruction supervision network can be trained using training samples including the original face image and / or partially occluded face images. When training the face reconstruction supervision network using training samples including the original face image and partially occluded face images, it is not necessary to input the original face image and the corresponding partially occluded face image into the face reconstruction supervision network as a pair; the original face image and the corresponding partially occluded face image can be used as separate training samples.

[0145] In one embodiment, the computer device inputs training samples into an initial face reconstruction supervision network, extracts features from the training samples through the initial face reconstruction supervision network to obtain image features corresponding to the training samples, obtains face recognition results corresponding to the training samples based on the image features corresponding to the training samples, constructs a training loss based on the face recognition results corresponding to the training samples and the identity labels corresponding to the training samples, updates the network parameters of the initial face reconstruction supervision network based on the training loss, until training stops and a trained face reconstruction supervision network is obtained.

[0146] In this embodiment, a face reconstruction supervision network with a more complex network structure and higher feature extraction accuracy is introduced to assist the reconstruction network in training. This not only helps to improve the training speed of the reconstruction network, but also the reconstructed images output by the trained reconstruction network can contain more accurate recognition information, which helps to improve the accuracy of face recognition.

[0147] In one embodiment, the recognition network in the face recognition model is a recognition network pre-trained based on pre-training samples. The method further includes: acquiring pre-training samples including faces; inputting the pre-training samples into an initial recognition network; extracting features from the pre-training samples through the initial recognition network to obtain image features corresponding to the pre-training samples; obtaining face recognition results corresponding to the pre-training samples based on the image features corresponding to the pre-training samples; constructing a pre-training recognition loss based on the face recognition results corresponding to the pre-training samples and the identity labels corresponding to the pre-training samples; updating the network parameters of the initial recognition network based on the pre-training recognition loss, and then returning to the step of acquiring pre-training samples including faces to continue training until a pre-trained recognition network is obtained.

[0148] The pre-training samples can be training samples including at least one of the original face images and partially occluded face images.

[0149] In one embodiment, the computer device pre-trains the recognition network, and after obtaining the pre-trained recognition network, trains the reconstruction network in the face recognition model.

[0150] In one embodiment, refer to Figure 6 , Figure 6 This is a schematic diagram of the training process of a face recognition model in one embodiment. The computer device pre-trains the recognition network. After obtaining the pre-trained recognition network, the network parameters of the recognition network are fixed. Supervised training is then performed on the reconstruction network in the face recognition model based on the target loss, updating the network parameters of the reconstruction network. When the supervised training stopping condition is met, the target loss is constructed again. Joint training is then performed on the reconstruction network and the recognition network in the face recognition model based on the target loss, updating the network parameters of both networks. When the joint training stopping condition is met, a face recognition model suitable for recognizing partially occluded face images is obtained.

[0151] In one embodiment, the computer device inputs pre-trained samples into an initial recognition network, extracts features from the pre-trained samples through the initial recognition network to obtain image features corresponding to the pre-trained samples, obtains face recognition results corresponding to the pre-trained samples based on the image features corresponding to the pre-trained samples, constructs a pre-trained recognition loss based on the face recognition results corresponding to the pre-trained samples and the identity labels corresponding to the pre-trained samples, and updates the network parameters of the initial recognition network based on the pre-trained recognition loss until a pre-trained recognition network is obtained.

[0152] In this embodiment, the recognition network is pre-trained to enable it to recognize faces. Subsequently, only the reconstruction network and the recognition network need to be fine-tuned and trained so that the recognition network can accurately recognize the reconstructed image output by the reconstruction network.

[0153] Continue to refer to Figure 6As can be seen, the face recognition model trained using the method provided in this application embodiment can be applied to identity verification and identity recognition scenarios. In these scenarios, it can be connected to a corresponding matching network for face recognition. The application of the face recognition model in identity verification and identity recognition scenarios is described below.

[0154] In one embodiment, the method further includes: acquiring a face image to be identified and an identity to be verified, wherein the face image to be identified is a complete face image or a partially occluded face image formed by partial occlusion of the face; reconstructing the face image to be identified using a reconstruction network in a trained face recognition model to obtain a reconstructed image corresponding to the face image to be identified; performing face recognition on the reconstructed image using a recognition network in a trained face recognition model to obtain image features corresponding to the reconstructed image; matching the image features corresponding to the reconstructed image with the image features corresponding to the identity to be verified; and determining that the face image to be identified has passed the identity verification when the match is successful.

[0155] The image to be identified is the image to be authenticated. Authentication involves verifying whether the identity corresponding to the face in the image matches the identity being verified.

[0156] The face recognition model trained using the method provided in this application can be applied to one-to-one identity verification scenarios. One-to-one identity verification scenarios involve comparing the image features corresponding to the face image to be recognized with the image features corresponding to the identity to be verified, given that the identity is known, to verify whether the face in the face image matches the identity being verified. Examples include identity verification scenarios, terminal screen unlocking scenarios, and locating missing persons scenarios.

[0157] In one embodiment, a computer device uses a reconstruction network within a trained face recognition model to reconstruct a face from an image to be recognized, obtaining a reconstructed image. If the face image to be recognized is a complete face image, the reconstruction network preserves the original face data. If the face image to be recognized is a partially occluded face image, the reconstruction network completes the missing face data. The reconstructed image is then subjected to face recognition using the recognition network within the trained face recognition model to obtain image features. These image features are then matched with the image features corresponding to the identity to be verified. When a match is successful, the face image to be recognized is deemed to have passed identity verification. Optionally, a successful match is determined when the similarity between the image features corresponding to the reconstructed image and the image features corresponding to the identity to be verified exceeds a threshold.

[0158] In this embodiment, the trained face recognition model can be applied to identity verification scenarios, improving the accuracy of face recognition for partially occluded face images without affecting the accuracy of face recognition for complete face images.

[0159] In one embodiment, the method further includes: acquiring a face image to be identified, wherein the face image to be identified is a complete face image or a partially occluded face image formed by partial occlusion of the face; reconstructing the face image to be identified using a reconstruction network in a trained face recognition model to obtain a reconstructed image corresponding to the face image to be identified; performing face recognition on the reconstructed image using a recognition network in a trained face recognition model to obtain image features corresponding to the reconstructed image; matching the image features corresponding to the reconstructed image with at least one reference image feature, and using the target identity corresponding to the successfully matched reference image feature as the identity of the face in the face image to be identified.

[0160] In this context, the face image to be identified is the image for which identity verification is performed. Identity verification involves identifying the identity corresponding to the face in the face image to be identified. The reference image features are data used to reflect the facial features in the reference face image; in this application scenario, the reference face image is a pre-stored face image in the database.

[0161] The face recognition model trained using the method provided in this application can be applied to one-to-many identity recognition scenarios. One-to-many identity recognition scenarios compare the image features corresponding to the face image to be recognized with pre-stored reference image features in a database to determine the identity of the face in the face image to be recognized from the identities corresponding to the reference image features in the database. Examples include traffic safety scenarios, face payment scenarios, work attendance scenarios, and missing persons retrieval scenarios.

[0162] In one embodiment, a computer device uses a reconstruction network in a trained face recognition model to reconstruct a face from an image to be recognized, obtaining a reconstructed image. If the face image to be recognized is a complete face image, the reconstruction network preserves the original face data. If the face image to be recognized is a partially occluded face image, the reconstruction network completes the missing face data. The reconstructed image is then subjected to face recognition using the recognition network in the trained face recognition model to obtain image features. These image features are then matched with at least one reference image feature. The target identity corresponding to the successfully matched reference image feature is used as the identity of the face in the face image to be recognized. Optionally, the target identity corresponding to the reference image feature with the highest matching degree is used as the identity of the face in the face image to be recognized.

[0163] In this embodiment, the trained face recognition model can be applied to identity recognition scenarios, improving the accuracy of face recognition for partially occluded face images without affecting the accuracy of face recognition for complete face images.

[0164] In one embodiment, refer to Figure 7 This paper provides a method for processing a face recognition model, including the following steps:

[0165] Step S702: Obtain training samples, which include the original face image and partially occluded face images formed by partially occluding the face in the original face image.

[0166] Step S704: Using the reconstruction network in the face recognition model, face reconstruction is performed on the original face image and the partially occluded face image respectively to obtain the first reconstructed image corresponding to the original face image and the second reconstructed image corresponding to the partially occluded face image.

[0167] Step S706: Obtain the pre-trained recognition network. The face reconstruction supervision network is used to assist the reconstruction network in the face recognition model for training. Input the original face image, the first reconstructed image, and the second reconstructed image into the face reconstruction supervision network. Extract features from the original face image, the first reconstructed image, and the second reconstructed image through the face reconstruction supervision network to obtain the image features corresponding to the original face image, the first reconstructed image, and the second reconstructed image.

[0168] Step S708: Construct a feature reconstruction loss based on the feature differences between the image features extracted from the original face image and the first reconstructed image, and the feature differences between the image features extracted from the original face image and the second reconstructed image; construct an image reconstruction loss based on the image differences between the original face image and the first reconstructed image, and the image differences between the original face image and the second reconstructed image.

[0169] Step S710: Obtain the identity label corresponding to both the original face image and the partially occluded face image; extract image features from the first reconstructed image using the pre-trained recognition network in the face recognition model, and obtain a first face recognition result based on the image features corresponding to the first reconstructed image; extract image features from the second reconstructed image using the recognition network in the face recognition model, and obtain a second face recognition result based on the image features corresponding to the second reconstructed image; construct a recognition loss based on the differences between the first face recognition result and the identity label, and the differences between the second face recognition result and the identity label.

[0170] Step S712: Based on the target loss constructed from feature reconstruction loss, image reconstruction loss, and recognition loss, supervised training is performed on the reconstruction network in the face recognition model, and the network parameters of the reconstruction network are updated. When the supervised training stopping condition is met, the process returns to the step of obtaining training samples and continues to execute the above steps. Based on the target loss constructed from reconstruction loss and recognition loss, joint training is performed on the recognition network and reconstruction network in the face recognition model, and the network parameters of the recognition network and reconstruction network in the face recognition model are updated. When the joint training stopping condition is met, a face recognition model suitable for recognizing partially occluded face images is obtained.

[0171] Reference Figure 8 , Figure 8 This is a flowchart illustrating the processing method of a face recognition model in one embodiment. As can be seen, introducing a face reconstruction supervision network with a more complex network structure and higher feature extraction accuracy to assist the reconstruction network in training not only helps improve the training speed of the reconstruction network, but also ensures that the reconstructed images output by the well-trained network contain more accurate recognition information, thus improving the accuracy of face recognition. A target loss is constructed based on feature reconstruction loss, image reconstruction loss, and recognition loss. The face recognition model is trained according to the target loss, enabling the trained face recognition model to fill in the missing image features and parameters of partially occluded face images during face recognition, preserving the original image features and parameters of the original face image, thereby improving the accuracy of face recognition.

[0172] In this application, there is no need to adjust the proportion configuration in the traditional training sample set. Only the reconstruction network needs to be configured before the recognition network. This configuration method will not affect the application of the back-end recognition network. Moreover, the reconstruction network is a small network that consumes less resources in training and application. In other words, this application has good compatibility with traditional face recognition systems.

[0173] The aforementioned face recognition model's processing method has two aspects. First, through the reconstruction network within the face recognition model, face reconstruction is performed on both the original face image and the partially occluded face image, obtaining corresponding first and second reconstructed images. Reconstruction losses can then be constructed based on the differences between the original face image and the first and second reconstructed images. These reconstruction losses constrain the reconstruction network during training, ensuring that it retains image information from the original face image while also learning to complete partially occluded face images. Second, the recognition loss, constructed based on the face recognition results obtained from the first and second reconstructed images, constrains the reconstruction network during training, ensuring that the reconstructed images obtained from both the original and partially occluded face images can be accurately recognized by the recognition network. Thus, the face recognition model trained based on the target loss constructed from the reconstruction and recognition losses not only possesses the ability to recognize complete face images but also significantly improves the accuracy of face recognition for partially occluded face images.

[0174] In one embodiment, such as Figure 9 As shown, a face recognition method is provided. This embodiment mainly applies this method to the above-mentioned... Figure 1 Using a computer device (terminal 102 or server 104) as an example, the following steps are included:

[0175] Step S902: Obtain the face image to be identified.

[0176] The image to be identified is the image to be recognized by the face recognition model trained in this embodiment. The image to be identified can be a complete face image or a partially occluded face image. The image to be identified may include one or at least two faces. The computer device performs identity recognition on one or at least two faces in the image to be identified.

[0177] In one embodiment, the computer device can acquire a face image to be identified from an authentication scenario and an identity recognition scenario. For example, the terminal can acquire face images of a real-world scene through a built-in camera, or it can acquire face images of a real-world scene through an external camera associated with the terminal. The camera can be a monocular camera, a binocular camera, a depth camera, a 3D (3D) camera, etc. The terminal can acquire live face images of real-world individuals, or it can acquire existing images of real-world scenes containing faces, such as scanned copies of ID cards.

[0178] Step S904: Reconstruct the face image to be identified using the reconstruction network in the trained face recognition model to obtain the reconstructed image corresponding to the face image to be identified.

[0179] Specifically, if the face image to be identified is a complete face image, the reconstruction network preserves the original face data of the face image to be identified; if the face image to be identified is a partially occluded face image, the reconstruction network completes the missing face data of the face image to be identified.

[0180] The specific implementation of step S904 can be found in the above embodiment of the specific implementation of face reconstruction of training samples, and will not be repeated here.

[0181] Step S906: Using the recognition network in the trained face recognition model, face recognition is performed on the reconstructed image to obtain the face recognition result corresponding to the face image to be recognized; wherein, the face recognition model is trained based on the difference between the original face image and the first reconstructed image obtained by the reconstruction network from the original face image, the difference between the original face image and the second reconstructed image obtained by the reconstruction network from the partially occluded face image corresponding to the original face image, and the face recognition results corresponding to the first and second reconstructed images obtained by the recognition network.

[0182] The specific implementation of step S906 can be found in the above embodiments for the specific implementation of face recognition on the reconstructed image and the training of the face recognition model, which will not be repeated here.

[0183] In one embodiment, a computer device uses the recognition network in a trained face recognition model to perform face recognition on the reconstructed image, obtaining image features corresponding to the face image to be recognized, and determining the face recognition result based on the image features corresponding to the face image to be recognized. The specific implementation of the step "determining the face recognition result based on the image features corresponding to the face image to be recognized" can be found in the specific implementation of the face recognition model in the above embodiments for identity verification and identity recognition scenarios, and will not be repeated here.

[0184] In the aforementioned face recognition method, the reconstruction network in the trained face recognition model is used to reconstruct the face image to be recognized, thereby obtaining the reconstructed image corresponding to the face image to be recognized. Since the reconstruction network can preserve the image information of the original face image and fill in the missing face data for partially occluded face images, the face recognition result obtained by performing face recognition on the reconstructed image through the recognition network in the trained face recognition model not only does not affect the accuracy of face recognition on complete face images, but also improves the accuracy of face recognition on partially occluded face images.

[0185] It should be understood that, although Figure 2 , 7 The steps in flowchart -9 are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order requirement for the execution of these steps, and they can be executed in other orders. Furthermore, Figure 2 , 7 At least some of the steps in -9 may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.

[0186] In one embodiment, such as Figure 10 As shown, a face recognition model processing device is provided. This device can be a software module, a hardware module, or a combination of both integrated into a computer device. Specifically, the device includes: an acquisition module 1002, a face reconstruction module 1004, a reconstruction loss construction module 1006, a recognition loss construction module 1008, and a network parameter update module 1010, wherein:

[0187] The acquisition module 1002 is used to acquire training samples, which include the original face image and the partially occluded face image formed by partially occluding the face in the original face image.

[0188] The face reconstruction module 1004 is used to reconstruct the face from the original face image and the partially occluded face image through the reconstruction network in the face recognition model, and obtain the first reconstructed image corresponding to the original face image and the second reconstructed image corresponding to the partially occluded face image.

[0189] The reconstruction loss construction module 1006 is used to construct a reconstruction loss based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image;

[0190] The recognition loss construction module 1008 is used to construct the recognition loss based on the face recognition results obtained by performing face recognition on the first reconstructed image and the second reconstructed image respectively, according to the recognition network in the face recognition model.

[0191] The network parameter update module 1010 is used to update the network parameters of the face recognition model based on the target loss constructed by the reconstruction loss and the recognition loss, and then return to the step of obtaining training samples to continue to execute the above steps until a face recognition model suitable for recognizing partially occluded face images is obtained.

[0192] In one embodiment, the reconstruction loss is a feature reconstruction loss at the feature level. The reconstruction loss construction module 1006 is further configured to: construct a feature reconstruction loss based on the feature differences between the image features extracted from the original face image and the first reconstructed image, and the feature differences between the image features extracted from the original face image and the second reconstructed image, respectively.

[0193] In one embodiment, the reconstruction loss is an image reconstruction loss at the image level, and the reconstruction loss construction module 1006 is further configured to: construct an image reconstruction loss based on the image difference between the original face image and the first reconstructed image, and the image difference between the original face image and the second reconstructed image.

[0194] In one embodiment, the reconstruction loss construction module 1006 is further configured to: construct a feature reconstruction loss based on the feature differences between image features extracted from the original face image and the first reconstructed image, and the feature differences between image features extracted from the original face image and the second reconstructed image, respectively; construct an image reconstruction loss based on the image differences between the original face image and the first reconstructed image, and the image differences between the original face image and the second reconstructed image, respectively; and fuse the feature reconstruction loss and the image reconstruction loss to obtain a reconstruction loss used to constrain the reconstruction network.

[0195] In one embodiment, the recognition network in the face recognition model is a recognition network pre-trained based on training samples; the reconstruction loss construction module 1006 is further configured to: input the original face image, the first reconstructed image, and the second reconstructed image into the pre-trained recognition network in the face recognition model respectively; and extract features from the original face image, the first reconstructed image, and the second reconstructed image through the pre-trained recognition network to obtain the image features corresponding to the original face image, the first reconstructed image, and the second reconstructed image respectively.

[0196] In one embodiment, the reconstruction loss construction module 1006 is further configured to: obtain a trained face reconstruction supervision network, which is used to assist the reconstruction network in the face recognition model in training; input the original face image, the first reconstructed image, and the second reconstructed image into the face reconstruction supervision network respectively; and extract features from the original face image, the first reconstructed image, and the second reconstructed image through the face reconstruction supervision network to obtain the image features corresponding to the original face image, the first reconstructed image, and the second reconstructed image respectively.

[0197] In one embodiment, the recognition loss construction module 1008 is further configured to: obtain the identity label corresponding to both the original face image and the partially occluded face image; extract image features from the first reconstructed image using the recognition network in the face recognition model, and obtain a first face recognition result based on the image features corresponding to the first reconstructed image; extract image features from the second reconstructed image using the recognition network in the face recognition model, and obtain a second face recognition result based on the image features corresponding to the second reconstructed image; and construct a recognition loss based on the difference between the first face recognition result and the identity label, and the difference between the second face recognition result and the identity label.

[0198] In one embodiment, the network parameter update module 1010 is further configured to: perform supervised training on the reconstruction network in the face recognition model based on the target loss constructed from the reconstruction loss and the recognition loss, and update the network parameters of the reconstruction network; when the supervised training stopping condition is met, return to the step of obtaining training samples to continue executing the above steps, and perform joint training on the recognition network and the reconstruction network in the face recognition model based on the target loss constructed from the reconstruction loss and the recognition loss, and update the network parameters of the recognition network and the reconstruction network in the face recognition model; when the joint training stopping condition is met, obtain a face recognition model suitable for recognizing partially occluded face images.

[0199] In one embodiment, the recognition network in the face recognition model is a recognition network pre-trained based on pre-training samples. The processing device for the face recognition model further includes a pre-training module, which is used to: acquire pre-training samples including faces; input the pre-training samples into an initial recognition network; extract features from the pre-training samples through the initial recognition network to obtain image features corresponding to the pre-training samples; obtain face recognition results corresponding to the pre-training samples based on the image features corresponding to the pre-training samples; construct a pre-training recognition loss based on the face recognition results and identity labels corresponding to the pre-training samples; update the network parameters of the initial recognition network based on the pre-training recognition loss, and then return to the step of acquiring pre-training samples including faces to continue training until a pre-trained recognition network is obtained.

[0200] In one embodiment, the processing device for the face recognition model further includes a face recognition module; the acquisition module 1002 is further configured to: acquire a face image to be recognized and an identity to be verified, wherein the face image to be recognized is a complete face image or a partially occluded face image formed by partial occlusion of the face; the face reconstruction module 1004 is further configured to: perform face reconstruction on the face image to be recognized through the reconstruction network in the trained face recognition model to obtain a reconstructed image corresponding to the face image to be recognized; the face recognition module is configured to: perform face recognition on the reconstructed image through the recognition network in the trained face recognition model to obtain image features corresponding to the reconstructed image; match the image features corresponding to the reconstructed image with the image features corresponding to the identity to be verified; when the match is successful, it is determined that the face image to be recognized has passed the identity verification.

[0201] In one embodiment, the processing device for the face recognition model further includes a face recognition module; the acquisition module 1002 is further configured to: acquire a face image to be recognized, wherein the face image to be recognized is a complete face image or a partially occluded face image formed by partially occluding the face; the face reconstruction module 1004 is further configured to: perform face reconstruction on the face image to be recognized through the reconstruction network in the trained face recognition model to obtain a reconstructed image corresponding to the face image to be recognized; the face recognition module is configured to: perform face recognition on the reconstructed image through the recognition network in the trained face recognition model to obtain image features corresponding to the reconstructed image; match the image features corresponding to the reconstructed image with at least one reference image feature, and use the target identity corresponding to the successfully matched reference image feature as the identity of the face in the face image to be recognized.

[0202] Specific limitations regarding the processing device for the face recognition model can be found in the limitations on the processing method for the face recognition model above, and will not be repeated here. Each module in the aforementioned face recognition model processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0203] In the processing device of the aforementioned face recognition model, on the one hand, the reconstruction network in the face recognition model performs face reconstruction on the original face image and the partially occluded face image respectively, obtaining corresponding first reconstructed images and second reconstructed images. A reconstruction loss can be constructed based on the differences between the original face image and the first reconstructed image, and the differences between the original face image and the second reconstructed image. This reconstruction loss constrains the reconstruction network during training, enabling it to retain image information from the original face image while learning the ability to complete partially occluded face images. On the other hand, the recognition loss, constructed based on the face recognition results obtained from the first and second reconstructed images, constrains the reconstruction network during training, ensuring that the reconstruction network can accurately recognize both the original face image and the reconstructed images obtained from the partially occluded face image. Thus, the face recognition model trained based on the target loss constructed from the reconstruction loss and recognition loss not only possesses the ability to recognize complete face images but also significantly improves the accuracy of face recognition on partially occluded face images.

[0204] In one embodiment, such as Figure 11 As shown, a face recognition device is provided. This device can be a software module, a hardware module, or a combination of both integrated into a computer device. Specifically, the device includes: an acquisition module 1102, a face reconstruction module 1104, and a face recognition module 1106, wherein:

[0205] The acquisition module 1102 is used to acquire the face image to be identified;

[0206] The face reconstruction module 1104 is used to reconstruct the face of the face to be recognized by using the reconstruction network in the trained face recognition model, and obtain the reconstructed image corresponding to the face image to be recognized.

[0207] The face recognition module 1106 is used to perform face recognition on the reconstructed image through the recognition network in the trained face recognition model, and obtain the face recognition result corresponding to the face image to be recognized.

[0208] The face recognition model is trained based on the difference between the original face image and the first reconstructed image obtained by the reconstruction network from the original face image, the difference between the original face image and the second reconstructed image obtained by the reconstruction network from the partially occluded face image corresponding to the original face image, and the face recognition results corresponding to the first and second reconstructed images obtained by the recognition network.

[0209] For specific limitations regarding the facial recognition device, please refer to the limitations on the facial recognition method above, which will not be repeated here. Each module in the aforementioned facial recognition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0210] In the aforementioned face recognition device, the reconstruction network in the trained face recognition model performs face reconstruction on the face image to be recognized, obtaining the reconstructed image corresponding to the face image to be recognized. Since the reconstruction network can maintain the image information of the original face image and can also fill in the missing face data for partially occluded face images, the face recognition result obtained by performing face recognition on the reconstructed image through the recognition network in the trained face recognition model not only does not affect the accuracy of face recognition on complete face images, but also improves the accuracy of face recognition on partially occluded face images.

[0211] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 12 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores processing data for a face recognition model and / or image generation data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a face recognition model processing method and / or a face recognition method.

[0212] In one embodiment, a computer device is provided, which may be a terminal or a face recognition device, and its internal structure diagram may be as follows. Figure 13As shown, the computer device includes a processor, memory, communication interface, and image acquisition device connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a face recognition model processing method and / or a face recognition method.

[0213] Those skilled in the art will understand that Figure 12 and Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0214] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0215] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0216] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program 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 executes the computer instructions, causing the computer device to perform the steps in the above method embodiments.

[0217] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0218] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0219] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for processing a face recognition model, characterized in that, The method includes: Acquire training samples, which include original face images and partially occluded face images formed by partially occluding the faces in the original face images; The reconstruction network in the face recognition model is used to reconstruct the face from the original face image and the partially occluded face image, respectively, to obtain a first reconstructed image corresponding to the original face image and a second reconstructed image corresponding to the partially occluded face image. The original face image, the first reconstructed image, and the second reconstructed image are respectively input into a face reconstruction supervision network used to train the reconstruction network in the face recognition model. The face reconstruction supervision network extracts features from the original face image, the first reconstructed image, and the second reconstructed image to obtain the image features corresponding to each of the three images. Based on the feature differences between the image features of the original face image and the first reconstructed image, and between the image features of the original face image and the second reconstructed image, a feature reconstruction loss is constructed. Based on the image differences between the original face image and the first reconstructed image, and between the original face image and the second reconstructed image, an image reconstruction loss is constructed. The feature reconstruction loss and the image reconstruction loss are fused to obtain the reconstruction loss used to constrain the reconstruction network. Based on the recognition network in the face recognition model, the face recognition results obtained by performing face recognition on the first reconstructed image and the second reconstructed image respectively are used to construct the recognition loss; Based on the target loss constructed from the reconstruction loss and the recognition loss, the network parameters of the face recognition model are updated, and the process returns to the step of obtaining training samples to continue executing the above steps until a face recognition model suitable for recognizing partially occluded face images is obtained.

2. The method according to claim 1, characterized in that, The recognition network in the face recognition model is a recognition network pre-trained based on the training samples; The method further includes: The original face image, the first reconstructed image, and the second reconstructed image are respectively input into the pre-trained recognition network of the face recognition model; The pre-trained recognition network is used to extract features from the original face image, the first reconstructed image, and the second reconstructed image to obtain the image features corresponding to each of the original face image, the first reconstructed image, and the second reconstructed image.

3. The method according to claim 1, characterized in that, The step of constructing a recognition loss by performing face recognition on the first reconstructed image and the second reconstructed image respectively based on the recognition network in the face recognition model includes: Obtain the identity tag that corresponds to both the original face image and the partially occluded face image; The recognition network in the face recognition model extracts image features from the first reconstructed image, and a first face recognition result is obtained based on the image features corresponding to the first reconstructed image. The recognition network in the face recognition model extracts image features from the second reconstructed image, and a second face recognition result is obtained based on the image features corresponding to the second reconstructed image. The recognition loss is constructed based on the difference between the first face recognition result and the identity label, and the difference between the second face recognition result and the identity label.

4. The method according to claim 1, characterized in that, The step of updating the network parameters of the face recognition model based on the target loss constructed from the reconstruction loss and the recognition loss, and then returning to the step of obtaining training samples, continues to execute the above steps until a face recognition model suitable for recognizing partially occluded face images is obtained, including: Based on the target loss constructed from the reconstruction loss and the recognition loss, the reconstruction network in the face recognition model is trained under supervision, and the network parameters of the reconstruction network are updated. When the supervised training stopping condition is met, return to the step of obtaining training samples to continue training, and jointly train the recognition network and reconstruction network in the face recognition model based on the target loss constructed by the reconstruction loss and the recognition loss, and update the network parameters of the recognition network and reconstruction network in the face recognition model. When the joint training stopping condition is met, a face recognition model suitable for recognizing partially occluded face images is obtained.

5. The method according to claim 1, characterized in that, The recognition network in the face recognition model is a recognition network obtained by pre-training based on pre-training samples; The method further includes: Obtain pre-trained samples, including human faces; Input the pre-trained samples into the initial recognition network; The initial recognition network extracts features from the pre-trained samples to obtain image features corresponding to the pre-trained samples, and then obtains the face recognition result corresponding to the pre-trained samples based on the image features corresponding to the pre-trained samples. A pre-training recognition loss is constructed based on the face recognition results corresponding to the pre-training samples and the identity labels corresponding to the pre-training samples; After updating the network parameters of the initial recognition network based on the pre-trained recognition loss, the process returns to the step of obtaining pre-trained samples including faces to continue training until a pre-trained recognition network is obtained.

6. The method according to claim 1, characterized in that, The method further includes: Acquire the face image to be identified and the identity to be verified. The face image to be identified is a complete face image or a partially occluded face image formed by partially occluding the face. The reconstructed image is obtained by using the reconstruction network in the trained face recognition model to reconstruct the face image to be recognized. The reconstructed image is then subjected to face recognition through the recognition network in the trained face recognition model to obtain the image features corresponding to the reconstructed image. The image features corresponding to the reconstructed image are matched with the image features corresponding to the identity to be verified; When a match is successful, the face image to be identified is determined to have passed authentication.

7. The method according to claim 1, characterized in that, The method further includes: Acquire a face image to be identified, wherein the face image to be identified is a complete face image or a partially occluded face image formed by partially occluding the face; The reconstructed image is obtained by using the reconstruction network in the trained face recognition model to reconstruct the face image to be recognized. The reconstructed image is then subjected to face recognition through the recognition network in the trained face recognition model to obtain the image features corresponding to the reconstructed image. The image features corresponding to the reconstructed image are matched with at least one reference image feature, and the target identity corresponding to the successfully matched reference image feature is taken as the identity of the face in the face image to be identified.

8. A face recognition method, characterized in that, The method includes: Acquire the image of the face to be identified; The reconstructed image is obtained by using the reconstruction network in the trained face recognition model to reconstruct the face image to be recognized. The reconstructed image is then subjected to face recognition through the recognition network in the trained face recognition model to obtain the face recognition result corresponding to the face image to be recognized. The face recognition model is trained based on the differences between the original face image and a first reconstructed image obtained by the reconstruction network from the original face image, the feature differences and image differences between the original face image and a second reconstructed image obtained by the reconstruction network from a partially occluded face image corresponding to the original face image, and the target loss constructed by the recognition network based on the face recognition results corresponding to the first and second reconstructed images. The feature differences include: inputting the original face image, the first reconstructed image, and the second reconstructed image respectively into the reconstruction network used to assist the face recognition model. The trained face reconstruction supervision network extracts features from the original face image, the first reconstructed image, and the second reconstructed image, respectively, to obtain the image features corresponding to each of the original face image, the first reconstructed image, and the second reconstructed image. The network then identifies the feature differences between the image features of the original face image and the image features of the first reconstructed image, as well as the feature differences between the image features of the original face image and the image features of the second reconstructed image. These image differences include the image differences between the original face image and the first reconstructed image, and the image differences between the original face image and the second reconstructed image.

9. A processing device for a face recognition model, characterized in that, The device includes: The acquisition module is used to acquire training samples, which include original face images and partially occluded face images formed by partially occluding the faces in the original face images. The face reconstruction module is used to reconstruct the face from the original face image and the partially occluded face image through the reconstruction network in the face recognition model, respectively, to obtain a first reconstructed image corresponding to the original face image and a second reconstructed image corresponding to the partially occluded face image. A reconstruction loss construction module is used to input the original face image, the first reconstructed image, and the second reconstructed image into a face reconstruction supervision network used to assist the reconstruction network in the face recognition model for training. The face reconstruction supervision network extracts features from the original face image, the first reconstructed image, and the second reconstructed image to obtain the image features corresponding to each of the three images. Based on the feature differences between the image features of the original face image and the first reconstructed image, and between the image features of the original face image and the second reconstructed image, a feature reconstruction loss is constructed. Based on the image differences between the original face image and the first reconstructed image, and between the original face image and the second reconstructed image, an image reconstruction loss is constructed. The feature reconstruction loss and the image reconstruction loss are fused to obtain the reconstruction loss used to constrain the reconstruction network. The recognition loss construction module is used to construct the recognition loss based on the face recognition results obtained by performing face recognition on the first reconstructed image and the second reconstructed image respectively, according to the recognition network in the face recognition model. The network parameter update module is used to update the network parameters of the face recognition model based on the target loss constructed by the reconstruction loss and the recognition loss, and then return to the step of obtaining training samples to continue to execute the above steps until a face recognition model suitable for recognizing partially occluded face images is obtained.

10. The apparatus according to claim 9, characterized in that, The recognition network in the face recognition model is a recognition network pre-trained based on the training samples; The reconstruction loss construction module is further configured to input the original face image, the first reconstructed image, and the second reconstructed image into the pre-trained recognition network in the face recognition model; and to extract features from the original face image, the first reconstructed image, and the second reconstructed image through the pre-trained recognition network to obtain the image features corresponding to each of the original face image, the first reconstructed image, and the second reconstructed image.

11. The apparatus according to claim 9, characterized in that, The recognition loss construction module is further configured to: obtain the identity label corresponding to both the original face image and the partially occluded face image; extract image features from the first reconstructed image using the recognition network in the face recognition model; obtain a first face recognition result based on the image features corresponding to the first reconstructed image; extract image features from the second reconstructed image using the recognition network in the face recognition model; obtain a second face recognition result based on the image features corresponding to the second reconstructed image; and construct the recognition loss based on the differences between the first face recognition result and the identity label, and the differences between the second face recognition result and the identity label.

12. The apparatus according to claim 9, characterized in that, The network parameter update module is further configured to perform supervised training on the reconstruction network in the face recognition model based on the target loss constructed from the reconstruction loss and the recognition loss, and update the network parameters of the reconstruction network; when the supervised training stopping condition is met, return to the step of obtaining training samples to continue training, and perform joint training on the recognition network and reconstruction network in the face recognition model based on the target loss constructed from the reconstruction loss and the recognition loss, and update the network parameters of the recognition network and reconstruction network in the face recognition model; when the joint training stopping condition is met, a face recognition model suitable for recognizing partially occluded face images is obtained.

13. The apparatus according to claim 9, characterized in that, The recognition network in the face recognition model is a recognition network obtained by pre-training based on pre-training samples; The device further includes a pre-training module for acquiring pre-training samples including faces; inputting the pre-training samples into an initial recognition network; extracting features from the pre-training samples through the initial recognition network to obtain image features corresponding to the pre-training samples; obtaining face recognition results corresponding to the pre-training samples based on the image features corresponding to the pre-training samples; constructing a pre-training recognition loss based on the face recognition results corresponding to the pre-training samples and the identity labels corresponding to the pre-training samples; updating the network parameters of the initial recognition network based on the pre-training recognition loss; and returning to the step of acquiring pre-training samples including faces to continue training until a pre-trained recognition network is obtained.

14. The apparatus according to claim 9, characterized in that, The acquisition module is also used to acquire the face image to be identified and the identity to be verified. The face image to be identified is a complete face image or a partially occluded face image formed by partially occluding the face. The face reconstruction module is also used to reconstruct the face image to be identified by using the reconstruction network in the trained face recognition model, so as to obtain the reconstructed image corresponding to the face image to be identified. The device further includes a face recognition module, used to perform face recognition on the reconstructed image through the recognition network in the trained face recognition model to obtain the image features corresponding to the reconstructed image; match the image features corresponding to the reconstructed image with the image features corresponding to the identity to be verified; when the match is successful, it is determined that the face image to be identified has passed the identity verification.

15. The apparatus according to claim 9, characterized in that, The acquisition module is also used to acquire a face image to be identified, wherein the face image to be identified is a complete face image or a partially occluded face image formed by partially occluding the face. The face reconstruction module is also used to reconstruct the face image to be identified by using the reconstruction network in the trained face recognition model, so as to obtain the reconstructed image corresponding to the face image to be identified. The device further includes a face recognition module, used to perform face recognition on the reconstructed image through the recognition network in the trained face recognition model to obtain the image features corresponding to the reconstructed image; match the image features corresponding to the reconstructed image with at least one reference image feature, and use the target identity corresponding to the successfully matched reference image feature as the identity of the face in the face image to be recognized.

16. A face recognition device, characterized in that, The device includes: The acquisition module is used to acquire the face image to be identified; The face reconstruction module is used to reconstruct the face image to be identified by using the reconstruction network in the trained face recognition model, and obtain the reconstructed image corresponding to the face image to be identified. The face recognition module is used to perform face recognition on the reconstructed image through the recognition network in the trained face recognition model, and obtain the face recognition result corresponding to the face image to be recognized; The face recognition model is trained based on the differences between the original face image and a first reconstructed image obtained by the reconstruction network from the original face image, the feature differences and image differences between the original face image and a second reconstructed image obtained by the reconstruction network from a partially occluded face image corresponding to the original face image, and the target loss constructed by the recognition network based on the face recognition results corresponding to the first and second reconstructed images. The feature differences include: inputting the original face image, the first reconstructed image, and the second reconstructed image respectively into the reconstruction network used to assist the face recognition model. The trained face reconstruction supervision network extracts features from the original face image, the first reconstructed image, and the second reconstructed image, respectively, to obtain the image features corresponding to each of the original face image, the first reconstructed image, and the second reconstructed image. The network then identifies the feature differences between the image features of the original face image and the image features of the first reconstructed image, as well as the feature differences between the image features of the original face image and the image features of the second reconstructed image. These image differences include the image differences between the original face image and the first reconstructed image, and the image differences between the original face image and the second reconstructed image.

17. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.