Face recognition model updating method and device, equipment, medium and program product

By monitoring recognition failure events and optimizing the face recognition model through multi-stage training, the problems of inconsistent image quality and low recognition accuracy under attacks were solved, achieving higher recognition accuracy and robustness.

CN123182280APending Publication Date: 2026-11-27INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611393276.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-09
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Current facial recognition technology suffers from low accuracy and is difficult to improve when image quality varies and the technology is vulnerable to attacks from photos and videos.

Method used

By monitoring and recognizing failure events and counting the cumulative number of failures, a model update process is triggered when a preset threshold is reached. The retraining dataset is used for multi-stage training to optimize the face recognition model, including the training of a twin network structure with a shared backbone network and a multi-task joint loss function.

Benefits of technology

It improves the accuracy and robustness of facial recognition, adapts to complex recognition scenarios, reduces the waste of computing resources, and enhances model performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123182280A_ABST
    Figure CN123182280A_ABST
Patent Text Reader

Abstract

The present application provides a face recognition model updating method and device, equipment, storage medium and program product, which can be applied to the field of biometric identification technology. The method comprises: acquiring a face recognition image, inputting the face recognition image into a first face recognition model for identification, wherein the first face recognition model comprises a backbone network, a face recognition branch and a living body detection branch; monitoring an identification failure event of the first face recognition model in the identification process, and counting the cumulative number of the identification failure event; in response to the cumulative number reaching a preset trigger threshold, triggering a model updating process to obtain a second face recognition model; and identifying through the second face recognition model and monitoring the identification failure event of the second face recognition model in the identification process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of biometric technology, and more specifically, to a method, apparatus, device, medium, and program product for updating a face recognition model. Background Technology

[0002] Facial recognition technology identifies individuals based on their facial features and is widely used in the financial sector, such as for mobile banking security monitoring and identity verification. The key technical challenge lies in improving recognition accuracy.

[0003] Current facial recognition algorithms acquire facial images from terminals and compare them with features from a pre-stored facial database to achieve identity verification. However, the quality of facial images acquired by terminals varies greatly. When these images are compared with standard images in the preset database, matching failures are easily caused by factors such as angle deviation or uneven lighting. Furthermore, facial recognition systems are vulnerable to attacks from photos and videos, becoming a major bottleneck restricting the improvement of facial recognition technology's recognition rate. Summary of the Invention

[0004] In view of the above problems, embodiments of this application provide a face recognition model update method, apparatus, device, medium, and program product.

[0005] According to a first aspect of this application, a face recognition model update method is provided, comprising: acquiring a face recognition image; inputting the face recognition image into a first face recognition model for recognition, wherein the first face recognition model includes a backbone network, a face recognition branch, and a liveness detection branch; monitoring recognition failure events of the first face recognition model during the recognition process, and counting the cumulative number of recognition failure events; in response to the cumulative number reaching a preset trigger threshold, triggering a model update process to acquire a second face recognition model; and performing recognition through the second face recognition model and monitoring recognition failure events of the second face recognition model during the recognition process.

[0006] According to an embodiment of this application, the face recognition branch and the liveness detection branch share the backbone network; wherein, the face recognition branch adopts a twin network structure, used to receive two input images and output the similarity score of the two input images; the liveness detection branch is used to receive a single input image and output the liveness detection result of the single input image.

[0007] According to an embodiment of this application, the first face recognition model is trained using a multi-task joint loss function, which is obtained by weighted summation of the face recognition loss function and the liveness detection loss function.

[0008] According to an embodiment of this application, the model update process includes: extracting image samples corresponding to the recognition failure events from logs to construct a retraining dataset; using the current parameters of the first face recognition model as the initial state, performing multi-stage training using the retraining dataset to obtain a candidate face recognition model, wherein the multi-stage training includes a coarse-tuning stage, a fine-tuning stage, and a fine-tuning stage; performing performance evaluation on the candidate face recognition model and the first face recognition model to generate evaluation results; and based on the evaluation results, determining the candidate face recognition model or the first face recognition model as the second face recognition model.

[0009] According to an embodiment of this application, the step of extracting image samples corresponding to the recognition failure event from the log and constructing a retraining dataset includes: extracting the input image corresponding to the recognition failure event and a reference image from a preset database from the log to form an image pair; labeling each image pair with an identity relationship tag, wherein the identity relationship tag includes the same identity or different identities; and labeling each input image with an attribute tag, wherein the attribute tag includes liveness or attack.

[0010] According to an embodiment of this application, the identity relationship label is determined by at least one of device fingerprint association, time window association, and manual assisted annotation; wherein, the device fingerprint association is based on the device's unique identifier; and the time window association is based on a preset time window.

[0011] According to an embodiment of this application, image samples corresponding to the recognition failure event are extracted from the logs to construct a retraining dataset, including: dividing the image samples into a training set and a verification set based on user identity identifiers, wherein the training set and the verification set follow the identity isolation principle.

[0012] According to an embodiment of this application, the coarse-tuning stage freezes the shallow parameters of the backbone network and trains and updates the parameters of the top classification layer and the liveness detection branch; the fine-tuning stage unfreezes all layer parameters of the coarse-tuned face recognition model and performs joint training on all layer parameters; the fine-tuning stage increases the boundary hyperparameters in the triplet loss function and uses hard samples to reinforce the fine-tuned face recognition model.

[0013] According to an embodiment of this application, the multi-stage training further includes data augmentation operations, which include basic augmentation operations and / or specialized augmentation operations; wherein, the basic augmentation operations perform uniform augmentation on the image samples; and the specialized augmentation operations perform specialized augmentation on at least one of hard positive samples, hard negative samples, and liveness attack samples.

[0014] According to an embodiment of this application, the performance evaluation of the candidate face recognition model and the first face recognition model, and the generation of evaluation results, includes: acquiring user traffic, dividing the user traffic into first user traffic and second user traffic; routing the first user traffic to the candidate face recognition model, and routing the second user traffic to the first face recognition model; and collecting and comparing the performance metrics of the candidate face recognition model and the first face recognition model to generate the evaluation results.

[0015] According to an embodiment of this application, dividing the user traffic into first user traffic and second user traffic includes: dividing the user traffic into first user traffic and second user traffic according to a preset ratio using a user identity hashing distribution strategy.

[0016] According to embodiments of this application, the identification failure events include a first type of failure event, a second type of failure event, and a third type of failure event; wherein, the first type of failure event is: the liveness detection score is lower than a preset threshold, resulting in identification failure; the second type of failure event is: the liveness detection score is higher than the preset threshold, and for sample pairs of users with the same identity, the similarity score is lower than the matching threshold, resulting in identification failure; the third type of failure event is: the liveness detection score is higher than the preset threshold, and for sample pairs of users with different identities, the similarity score is higher than the matching threshold, resulting in identification failure.

[0017] According to a second aspect of this application, a face recognition model update apparatus is provided, comprising: a model recognition module for acquiring a face recognition image and inputting the face recognition image into a first face recognition model for recognition, wherein the first face recognition model includes a backbone network, a face recognition branch, and a liveness detection branch; a result monitoring module for monitoring recognition failure events of the first face recognition model during the recognition process and counting the cumulative number of recognition failure events; and an update triggering module for triggering a model update process to acquire a second face recognition model in response to the cumulative number reaching a preset trigger threshold; the model recognition module is further configured to perform recognition using the second face recognition model, and the result monitoring module is further configured to monitor recognition failure events of the second face recognition model during the recognition process.

[0018] According to a third aspect of this application, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.

[0019] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.

[0020] According to a fifth aspect of this application, a computer program product is also provided, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description

[0021] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0022] Figure 1 The illustrations depict application scenarios of the face recognition model update method, apparatus, device, medium, and program products according to embodiments of this application.

[0023] Figure 2 A flowchart illustrating a face recognition model update method according to an embodiment of this application is shown schematically.

[0024] Figure 3 This illustration schematically shows a flowchart of the model update process of the face recognition model update method according to an embodiment of this application;

[0025] Figure 4 A flowchart illustrating a performance evaluation method according to an embodiment of this application is shown schematically;

[0026] Figure 5 This schematic diagram illustrates a structural block diagram of a face recognition model update apparatus according to an embodiment of this application;

[0027] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a face recognition model update method according to an embodiment of this application. Detailed Implementation

[0028] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0029] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0030] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0031] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0032] During the process of acquiring facial images at the terminal, the quality of the acquired images varies due to differences in factors such as shooting environment, background lighting, shooting distance, shooting angle, and posture. Comparing these images with standard images in a preset database results in a low success rate for facial recognition, requiring users to attempt repeatedly, which is time-consuming and laborious. Facial recognition systems are also vulnerable to attacks using photos and videos. To address these issues, this application proposes a facial recognition model update method based on failure sample-driven approaches.

[0033] This application provides a face recognition model update method, the method comprising: acquiring a face recognition image; inputting the face recognition image into a first face recognition model for recognition, wherein the first face recognition model includes a backbone network, a face recognition branch, and a liveness detection branch; monitoring recognition failure events of the first face recognition model during the recognition process, and counting the cumulative number of recognition failure events; in response to the cumulative number reaching a preset trigger threshold, triggering a model update process to acquire a second face recognition model; and performing recognition through the second face recognition model and monitoring recognition failure events of the second face recognition model during the recognition process.

[0034] The face recognition model update method described in this embodiment can automatically identify weaknesses in the model's recognition capabilities during actual operation, thereby continuously improving model performance, enhancing the accuracy and robustness of face recognition, and addressing the issue of decreased recognition accuracy due to changes in facial features over time. This method has promising applications in multiple fields such as security authentication and financial payments.

[0035] It should be noted that the face recognition model update method, apparatus, device, medium and program products provided in this application can be used in the field of biometrics technology, or in any field other than biometrics technology, such as fintech technology. Here, the application fields of the face recognition model update method, apparatus, device, medium and program products provided in this application are not limited.

[0036] In the technical solution of this application, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.

[0037] In scenarios where personal information is used for automated decision-making, the methods, devices, and systems provided in this application all provide users with corresponding operation entry points for users to choose to agree to or reject the automated decision results; if the user chooses to reject, the process enters the expert decision-making process.

[0038] As used in this paper, the term "model" refers to a model that learns the relationship between inputs and outputs from training data, enabling it to generate corresponding outputs for a given input after training. Model generation can be based on machine learning techniques. Deep learning is a machine learning algorithm that processes inputs and provides corresponding outputs using multiple layers of processing units. A neural network model is an example of a deep learning-based model. In this paper, "model" may also be referred to as a "machine learning model," "learning model," "machine learning network," or "learning network," and these terms are used interchangeably.

[0039] It's important to note that the term "neural network" can refer to a machine learning network based on deep learning. A neural network processes input and provides corresponding output, typically consisting of an input layer, an output layer, and one or more hidden layers between them. Neural networks used in deep learning applications often include many hidden layers, increasing the network's depth. The layers of a neural network are connected sequentially, so that the output of the previous layer serves as the input to the next layer. The input layer receives the input to the neural network, while the output layer's output becomes the final output. Each layer of a neural network includes one or more nodes (also called processing nodes or neurons), each processing the input from the layer above.

[0040] It should be understood that machine learning generally includes three phases: training, testing, and application (also known as inference). In the training phase, a given model is trained using a large amount of training data, iteratively updating parameter values ​​until the model can consistently generate inferences that meet the expected goals from the training data. Through training, the model can be considered to have learned the relationship between inputs and outputs (also known as the input-output mapping) from the training data. The parameter values ​​of the trained model are determined. In the testing phase, test inputs are applied to the trained model to test whether it can provide the correct output, thus determining the model's performance. In the application phase, the model can be used to process actual inputs based on the trained parameter values ​​to determine the corresponding output.

[0041] Figure 1 The illustrations depict application scenarios of the face recognition model update method, apparatus, device, medium, and program products according to embodiments of this application.

[0042] like Figure 1 As shown, application scenario 100 according to an embodiment of this application may include a first terminal device 101, a second terminal device 102, a database 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the database 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables. For example, a user can use the first terminal device 101 and the second terminal device 102 to interact with the server 105 and / or the database 103 through the network 104 to receive or send information, etc.

[0043] The first terminal device 101 and the second terminal device 102 can be electronic devices such as smartphones, wearable devices, personal computers, intelligent voice interaction devices, smart home appliances, intelligent vehicles, in-vehicle terminals, aircraft, unmanned vending terminals, and extended reality devices. Extended reality devices can include virtual reality devices, augmented reality devices, and mixed reality devices. A client application for the target application can be installed and run on the terminal device. This target application can include, but is not limited to, financial transaction applications, payment applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, and social media platform software (these are just examples). Furthermore, this application embodiment does not limit the form of the target application, including but not limited to applications, mini-programs, etc., installed on the terminal device, and can also be in web page form.

[0044] Server 105 can be a server providing various services, such as a backend management server supporting websites browsed by users using the first terminal device 101 and the second terminal device 102 (this is just an example). The backend management server can analyze and process received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and big data. The server can be a backend server for the aforementioned target application, used to provide backend services to the clients of the target application.

[0045] Database 103 is a professional storage system for storing and managing data. It can store various types of data related to the target application, such as user account information, business transaction records, and content resource data. It supports structured, semi-structured, or unstructured data storage and has management capabilities such as data creation, deletion, modification, querying, backup, and recovery. In this application scenario, database 103 can be connected to server 105 via a communication link. Server 105 can retrieve the required data from database 103 for processing based on requests from the first terminal device 101 and the second terminal device 102. It can also synchronously store new data generated by the operations of the first terminal device 101 and the second terminal device 102 into database 103, thereby achieving data persistence and efficient retrieval.

[0046] It should be noted that the face recognition model update method provided in this application embodiment can generally be executed by server 105 and / or terminal devices 101-102. Accordingly, the face recognition model update device provided in this application embodiment can generally be set in server 105 and / or terminal devices 101-102.

[0047] It should be understood that Figure 1 The number of terminal devices, networks, databases, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, databases, and servers can be included.

[0048] The following will describe in detail the face recognition model update method according to the embodiments of this application, based on the scenario described in Figure 1 and Figures 2 to 4.

[0049] Figure 2 A flowchart illustrating a face recognition model update method according to an embodiment of this application is shown schematically. Figure 2As shown, the face recognition model update method 200 according to the embodiments of this application may include steps S210 to S240.

[0050] It should be noted that, although the steps of the method are described in a specific order in the embodiments of this application, it should be understood that the execution order of these steps is not fixed and can be adjusted according to actual needs. Specifically, some steps can be executed in reverse order, or they can be executed in parallel to improve efficiency without affecting the overall method effect. In addition, some steps may be optional and can be selectively executed according to specific application scenarios or requirements.

[0051] In step S210, a face recognition image is acquired and input into a first face recognition model for recognition. The first face recognition model includes a backbone network, a face recognition branch, and a liveness detection branch.

[0052] In embodiments of this application, user consent or authorization can be obtained before acquiring user information. For example, a request to acquire user information can be sent to the user before step S210. If the user consents or authorizes the acquisition of user information, step S210 is executed.

[0053] In the embodiments of this application, a corresponding operation entry can be provided to the user, allowing the user to choose to agree to or reject the automated decision result. That is, before the user information is processed / decided by the first face recognition model, the user can provide an instruction to agree to or reject the processing / decision through the corresponding operation entry. If the user agrees to the processing / decision, the user information is processed / decided by the first face recognition model, i.e., step S210 is executed. If the user rejects the processing / decision, the expert decision-making process is initiated.

[0054] In step S220, the recognition failure events of the first face recognition model during the recognition process are monitored, and the cumulative number of recognition failure events is counted.

[0055] In step S230, in response to the cumulative number of times reaching a preset trigger threshold, a model update process is triggered to obtain a second face recognition model.

[0056] In step S240, the second face recognition model is used for recognition, and recognition failure events of the second face recognition model during the recognition process are monitored.

[0057] It should be noted that the face recognition model update method in this embodiment is not limited to a specific executing entity. The executing entity can be any electronic device, such as a terminal device or a server device, etc. The executing entity can also be any software application or client.

[0058] According to embodiments of this application, a face recognition model update method based on local adaptive training and liveness detection is provided. This method iteratively trains and updates the model using failed sample data from actual face recognition processes, continuously improving the model's recognition performance based on existing deployment conditions, thereby enhancing model performance. It avoids the waste of computational resources caused by periodic indiscriminate retraining, triggering updates only when problems accumulate to a certain extent, resulting in high computational resource utilization efficiency. It is applicable not only to recognition scenarios where changes in user habits or unexpected events lead to significant differences between the current face and the preset image, but also to various complex recognition scenarios such as poor lighting, pose deviations, and unsatisfactory shooting angles, demonstrating good versatility and adaptability.

[0059] The face recognition model update method in this embodiment can acquire face recognition images using an image acquisition device, use a preset database as the comparison data source, and continuously monitor recognition failures during use. When the number of failures reaches a preset trigger threshold, local training is performed based on the failed images recorded in the log. If the model performance is effectively improved after training, it is released online; if the performance is not improved, the training results are discarded.

[0060] The preset trigger threshold is not a fixed constant and can be dynamically set according to factors such as computing resources, different application scenario requirements, and model training needs. For example, in different scenarios, the model update process is triggered when the cumulative number of failed samples reaches 500, 800, or 1000.

[0061] For example, the first face recognition model and the second face recognition model can be image recognition models with liveness detection function. The first face recognition model and the second face recognition model can include a face recognition branch, a liveness detection branch and a backbone network.

[0062] According to an embodiment of this application, the face recognition branch and the liveness detection branch share a backbone network; wherein, the face recognition branch adopts a twin network structure, which is used to receive two input images and output the similarity score of the two input images; the liveness detection branch is used to receive a single input image and output the liveness detection result of the single input image.

[0063] According to an embodiment of this application, after acquiring the face recognition image in step S210, the method of the embodiment may further include an image preprocessing step. Image preprocessing may include: acquiring the original image captured by the image acquisition end, cropping it, extracting the face region, converting the cropped face region image into a grayscale image, and uniformly scaling it to the input size required by the model. Denoising is performed using a bilateral filtering method, the expression for which is as follows.

[0064]

[0065] Where (i,j) are the horizontal and vertical coordinates of the target pixel in the output image; y(i,j) is the output pixel value, for example, the output grayscale pixel value; (m,n) are the coordinates of the neighboring pixels within the neighborhood window centered at (i,j); x(m,n) is the original pixel value at the neighborhood position (m,n) in the original input image, for example, the original grayscale pixel value; s(i,j) is a local neighborhood window centered at point (i,j) with a size of (2N+1)×(2N+1), where N is the radius of one side of the window, and N can be 1, 2, etc.; g(i,j,m,n) is the total weight of the bilateral filter, which is composed of the spatial distance weight and the pixel similarity weight multiplied together, for example, the total weight of the bilateral filter is calculated using two Gaussian functions; ∑ is the summation operation.

[0066] It should be noted that image preprocessing may include cropping, scaling, and noise reduction using bilateral filtering, etc., which are merely examples and not limitations on the embodiments of this application. In other embodiments, image preprocessing may also include other preprocessing operations, such as data augmentation and Gaussian filtering.

[0067] Through image preprocessing, the method in this embodiment can remove camera lighting noise and grain noise without weakening key facial textures, thereby improving the recognition accuracy of subsequent liveness detection and face comparison.

[0068] For example, the method of the embodiment can input the preprocessed face recognition image into a first face recognition model or a second face recognition model for recognition.

[0069] For example, the preprocessed image is input into a first face recognition model, which uses a neural network as its backbone and is built based on a Siamese network architecture. The backbone network maps the input image into a high-dimensional feature vector; for example, the backbone network can be a residual neural network, a lightweight convolutional neural network for mobile devices, etc. Whether it is a single image (for liveness detection) or an image pair (for face recognition), its underlying features (edges, textures, lighting patterns) are common to the backbone network. Therefore, the backbone network can perform uniform feature extraction on the input image.

[0070] A Siamese network is a neural network architecture consisting of two branches with identical structures and shared weights, whose parameters (weights) are updated synchronously. The method in this embodiment adds a similarity comparison layer at the end of the Siamese network to calculate the similarity between two face images, and outputs a similarity score between the two input images based on the calculation result.

[0071] In some embodiments, the endpoint of the Siamese network can be a face recognition branch: two input images are fed into two branches sharing weights, each extracting a high-dimensional feature vector. Then, a similarity comparison layer is used to calculate the similarity between the two feature vectors, outputting a similarity score to determine whether the two images belong to the same category or the same person. For example, given two input images X1 and X2, each image is independently passed through the same backbone network, yielding features F(X1) and F(X2) respectively. The similarity between these two features F(X1) and F(X2) is calculated, and a similarity score is output.

[0072] To enhance the anti-spoofing capability of facial recognition systems, a liveness detection branch can be constructed in the first facial recognition model. Liveness detection is a binary classification task, that is, determining whether the input image is a real face or a fake face. Fake faces and real faces have subtle differences in texture, reflection, and details. The liveness detection task aims to identify spoofing attacks from a single face image, such as mask attacks and screen replay attacks. The processing flow of the liveness detection branch can be as follows: input a single image X, extract features F(X) through the backbone network, and connect it to a fully connected layer to output a binary classification result, for example, the binary classification result can be a real face or a fake face.

[0073] According to embodiments of this application, the face recognition branch and the liveness detection branch share the backbone network, which reduces the number of parameters, making the face recognition model more lightweight; it also reduces the number of feature extractions, improving recognition speed. A single forward propagation can simultaneously complete both face recognition and liveness detection tasks, improving deployment efficiency.

[0074] For example, the method in this embodiment adopts a multi-task learning architecture of "shared feature extractor and independent task head" to jointly train the face recognition branch and the liveness detection branch.

[0075] Shared Feature Extractor: This is the backbone network of the model, such as a residual network. Regardless of whether the input is a single image or a pair of images, high-dimensional feature vectors are extracted through the same backbone network. This is because the underlying requirements of both tasks are common: both need to extract general features such as edges, textures, and lighting patterns of face images. Independent Task Headers: Based on the shared backbone network, two independent task branches are connected, each performing a different discrimination task.

[0076] A training batch contains both single-image samples for liveness detection and image pairs for face recognition. The gradient backpropagation for the two tasks does not interfere with each other and converges at a shared backbone network, achieving collaborative and non-interfering joint optimization.

[0077] According to embodiments of this application, the multi-task learning architecture has fewer parameters and higher inference efficiency. The two tasks promote each other, and the quality of features extracted by the shared backbone network is continuously improved under the dual-task constraint.

[0078] According to an embodiment of this application, the first face recognition model is trained using a multi-task joint loss function, which is obtained by weighted summation of the face recognition loss function and the liveness detection loss function.

[0079] During training, the method in this embodiment can simultaneously optimize two tasks: face recognition and liveness detection. These two tasks share the same feature extraction backbone network, which is then connected to their respective task branches. The face recognition branch employs a Siamese network structure, where two branches with shared weights extract features from two face images. The similarity between the two feature vectors is then calculated (e.g., using cosine similarity), and finally, a fully connected layer outputs a similarity score to determine whether the two images represent the same person. The liveness detection branch, based on the shared backbone network, connects to a fully connected layer for binary classification, outputting a determination of whether the input image is a real face or a fake face. Both tasks are trained using a multi-task joint loss function, the formula of which is as follows.

[0080]

[0081] Where L is the joint loss, L1 is the face recognition loss, L2 is the liveness detection loss, and λ represents the task weight coefficient, ranging from 0.1 to 1.0. The face recognition loss L1 can be a triplet loss, as shown in the following formula.

[0082]

[0083] Among them, f a It is the anchor point sample feature vector (feature vector of the baseline face image); f p It is the feature vector of the positive sample (the feature vector of another face image belonging to the same person as the anchor sample); f n It is the negative sample feature vector (the feature vector of a face image that does not belong to the same person as the anchor sample); d(,) is the distance metric function; max(,) is the truncation operation, when d(f a ,f p )+α>d(f a ,f n When d(f) is greater than 0, the model needs further optimization to reduce the distance between identical faces and increase the distance between faces of strangers; when d(f) is greater than 0, the model needs further optimization to reduce the distance between identical faces and increase the distance between faces of strangers. a ,f p )+α≤d(f a ,f nWhen the distance between positive and negative samples is 0, the loss L1=0, the facial features have met the interval requirement, there is no loss, and backpropagation is no longer used to update the network weights. α is a boundary hyperparameter used to control the minimum distance between positive and negative samples, and its value range is usually from 0.1 to 1.0, with a default value of 0.2 or 0.5. During the fine-tuning phase of training, if there are many difficult samples, α can be appropriately increased to force the model to widen the feature distance between difficult positive and difficult negative samples. If the samples are relatively easy to distinguish, α can be decreased to accelerate convergence.

[0084] In some embodiments, the formula for the liveness detection loss L2 is as follows.

[0085]

[0086] Where N is the total number of samples in the current training batch; i is the sample index, which iterates through each face sample in the batch, i=1,2,……,N; y i The true label of the i-th sample (y) i =1: Live human body, y i =0: Not a real person); p i It is the model's predicted probability, that is, the probability that the input is a real person; w p, w n It is the class weight, where w p These are the positive sample weights, w n These are negative sample weights, for example, w p =1.2,w n =0.8 to alleviate sample imbalance; ∑ is the summation operation.

[0087] In a training batch, both single-image samples with liveness labels and image pairs with identity labels are included. For single-image samples, only the liveness detection loss is calculated, and gradient backpropagation updates the backbone network and the liveness detection head. For image pairs, the face recognition loss is calculated, and gradient backpropagation updates the backbone network and the recognition head. Here, the liveness label is the attribute label mentioned below, and the identity label is the identity relationship label mentioned below, which will not be elaborated further. Through split backpropagation, the two tasks only intersect at the shared backbone network, while their respective task heads are updated independently, achieving a collaborative but non-interfering optimization effect.

[0088] According to embodiments of this application, face recognition and liveness detection can be trained collaboratively to jointly optimize a shared backbone network, benefiting the performance of both tasks simultaneously. By adjusting the joint loss function through weight coefficients, it is possible to prevent either task from dominating training and causing a performance degradation in the other task.

[0089] For example, the face recognition model update method of the embodiment may include a pre-training strategy: before deployment, the model is pre-trained using a public dataset or internally collected dedicated liveness data (including attack samples such as re-photographed images and masks) to enable the model to have basic anti-spoofing capabilities. For example, a first face recognition model to be trained is trained using a public dataset or internally collected dedicated liveness data to obtain the first face recognition model described in the embodiment. Here, the first face recognition model to be trained includes a backbone network, a face recognition branch, and a liveness detection branch.

[0090] The face recognition model update method in this embodiment can monitor recognition failure events during the recognition process of the first face recognition model, count the cumulative number of recognition failure events, and determine whether the cumulative number has reached a preset trigger threshold. If the preset trigger threshold is reached, the model update process is triggered. For example, monitoring the cumulative number of various failure events such as liveness detection failure, false rejection, and false acceptance determines whether to activate the model update process. This mechanism uses actual business feedback as the driving signal, abandoning the traditional timed retraining or manual triggering mode, ensuring that optimization operations are based on evidence and respond accurately, avoiding waste of computing resources.

[0091] The model update process in this embodiment is optimized based on the first face recognition model. For example, a new face recognition model can be retrained based on the parameters of the first face recognition model. The following will combine... Figure 3 This paper describes the model update process of the face recognition model update method according to an embodiment of the present application.

[0092] Figure 3 A flowchart illustrating the model update process of a face recognition model update method according to an embodiment of this application is shown. Figure 3 As shown, the model update process 300 according to the embodiment of this application may include steps S310 to S340.

[0093] In step S310, image samples corresponding to recognition failure events are extracted from the logs to construct a retraining dataset.

[0094] In step S320, the current parameters of the first face recognition model are used as the initial state, and multi-stage training is performed using the retraining dataset to obtain the candidate face recognition model. The multi-stage training includes a coarse-tuning stage, a fine-tuning stage, and a fine-tuning stage.

[0095] In step S330, the performance of the candidate face recognition model and the first face recognition model is evaluated, and the evaluation results are generated.

[0096] In step S340, based on the evaluation results, the candidate face recognition model or the first face recognition model is determined as the second face recognition model.

[0097] The method in this embodiment employs a progressive face recognition model update approach. The execution flow may include: terminal acquiring face images; image preprocessing; inputting the preprocessed face images into a first face recognition model and monitoring the face recognition results; logging the number of recognition failures; if the number of recognition failures reaches a preset trigger threshold, then performing multi-stage training using a retraining dataset; evaluating the model training results; if the performance of the model after multi-stage training is improved compared to before, then considering releasing it online and restarting the next round of sample accumulation; otherwise, continuing to use the previous first face recognition model for sample accumulation; and repeating the above operations.

[0098] For example, based on the evaluation results, determining the candidate face recognition model or the first face recognition model as the second face recognition model may include: if the model performance of the candidate face recognition model is better than that of the first face recognition model, then the candidate face recognition model is determined as the second face recognition model; if the model performance of the first face recognition model is better than that of the candidate face recognition model, then the first face recognition model is determined as the second face recognition model, thereby ensuring that the second face recognition model is the face recognition model with better current performance.

[0099] According to the embodiments of this application, the model update method inherits the recognition capabilities already possessed by the current model, strengthens only the weak links, and can avoid "catastrophic forgetting". Through the evaluation and selection mechanism, it is ensured that the performance of the deployed model will not decrease due to optimization, but will at least remain at the current level.

[0100] For example, after deploying the first face recognition model, the method of this embodiment can continuously expand the training data through log mining and data augmentation. Detailed image information for each face recognition is extracted from the system logs to construct a sample dataset for retraining and validation. For example, difficult negative samples can be mined from the logs to construct the retraining dataset. Alternatively, attack samples can be synthesized through data augmentation, such as by using "screen reflection synthesis" or "moiré pattern addition" to synthesize "failed real-person samples" from the logs into "attack samples," thereby expanding the liveness detection training set.

[0101] According to an embodiment of this application, image samples corresponding to recognition failure events are extracted from logs to construct a retraining dataset, including: extracting input images corresponding to recognition failure events from logs and reference images from a preset database to form image pairs; labeling each image pair with an identity relationship label, wherein the identity relationship label includes the same identity or different identities; and labeling each input image with an attribute label, wherein the attribute label includes liveness or attack.

[0102] For example, the input image corresponding to the recognition failure event (i.e., the on-site face image captured by the terminal) and the associated reference image in the preset database are extracted from the log, and the two are paired to form an image pair. Each image pair can constitute a training sample unit.

[0103] Each image pair can be labeled with an identity relationship tag. This tag is used for training and optimization of the face recognition branch, and is divided into two categories: "same identity" and "different identity," corresponding to the two types of failed samples respectively. The "same identity" tag can be used to label incorrectly rejected samples: situations where the actual user is incorrectly rejected by the model; the "different identity" tag can be used to label incorrectly accepted samples: situations where an imposter is incorrectly allowed entry by the model. This tag can be determined through methods such as device fingerprint association, time window association, or manual annotation to ensure the accuracy of the label.

[0104] For example, each input image can be labeled with attribute tags. These tags are used for training and optimization of the liveness detection branch and are divided into two categories: "liveness" and "attack". Liveness tags are used to label real human face images, while attack tags are used to label fake human face images, such as photoshopped images, screen displays, 3D masks, and other deception attack methods.

[0105] For example, in the log, if the face recognition fails because of "low liveness detection score" and is rejected, the input image is added to the training set as a pseudo-label candidate for "attack sample". That is, the input image will be automatically assigned a pseudo-label of "attack" as the attribute label of the input image.

[0106] According to an embodiment of this application, the identity relationship label is determined by at least one of device fingerprint association, time window association, and manual assisted annotation; wherein, device fingerprint association is based on the device's unique identifier; and time window association is based on a preset time window.

[0107] The accuracy of identity relationship labels directly affects the quality of the training dataset, and consequently, the effectiveness of model optimization. This embodiment provides three methods for determining identity relationship labels: device fingerprint association, time window association, and manual-assisted annotation. These methods can be used individually or in combination to adapt to annotation needs in different scenarios.

[0108] Device fingerprint association is based on the device's unique identifier, which is typically recorded in logs, such as the device number and media access control address. If a user successfully logs in on the same device using other methods (e.g., password, fingerprint) after a failed identification attempt, the previously failed image is associated with the logged-in user and marked as "the same person." These failed images are considered hard positive samples. Device fingerprint association enables automated annotation with high efficiency.

[0109] The time window association method is based on a preset time window. Within this preset time window (e.g., 5 minutes, 10 minutes, etc.), if the same device fails to identify multiple times consecutively, it will eventually succeed or abandon the attempt. These images are highly likely to belong to the same user, and the method in this embodiment can automatically cluster them and label them as "same person" candidate samples. The time window association method does not require the user to cooperate with other authentication methods and has a wide range of applications.

[0110] For example, for samples that cannot be automatically associated, manual annotation can be used. Image pairs are presented to annotators using annotation tools, who then determine whether they belong to the same person and perform manual annotation. Manual annotation serves as a fallback solution to ensure complete coverage of the annotation work.

[0111] According to embodiments of this application, the retraining dataset is directly derived from failure cases in real-world business scenarios, closely matching the model's weaknesses and improving the targeted nature of training optimization. Learning from real-world failures enables the model to continuously adapt to new problems arising in real-world application scenarios. Double labeling improves labeling efficiency, providing training labels for two tasks simultaneously with a single labeling, thus enhancing data labeling efficiency and providing high-quality labeled data support for subsequent multi-task joint training.

[0112] The face recognition model update method in this embodiment achieves automated sample labeling, significantly reducing the workload of manual labeling and improving the efficiency of dataset construction. The three identity relationship label determination methods complement each other, covering labeling requirements in different scenarios. Manually assisted labeling serves as a fallback solution, ensuring that labeled data can still be obtained when automatic association fails.

[0113] In some embodiments, attack samples based on log mining can be manually reviewed. Annotators can annotate not only identity relationship tags but also attribute tags. For example, annotators can annotate image pairs with identity relationship tags to indicate whether the image pairs belong to the same person or different people; and annotate input images with attribute tags to indicate whether the input image is a real person or an attack.

[0114] In some embodiments, the dataset construction process is initiated when the number of failed identification samples collected through logs reaches a preset trigger threshold. Since the same user may have made multiple attempts after a failure, resulting in sample duplication, cluster analysis is performed on the mined sample dataset to select the most representative samples for each user, for example, selecting 1-2 of the most representative samples for each user. Then, data annotation tools are used to annotate the image pairs and / or the input image. After annotation, the annotated retraining dataset is used for training and optimization.

[0115] According to an embodiment of this application, image samples corresponding to recognition failure events are extracted from logs to construct a retraining dataset, including: dividing the image samples into a training set and a validation set based on user identity identifiers, wherein the training set and the validation set follow the identity isolation principle.

[0116] The method in this embodiment can use user identity identifiers as the smallest unit of division, dividing the retraining dataset according to a preset ratio, and strictly adhering to the identity segregation principle. That is, all image samples corresponding to the same user identity identifier are assigned to either the training set or the validation set, and images of the same user are not allowed to appear in both the training set and the validation set simultaneously. For example, for the retraining dataset, 80% is allocated to the training set and 20% to the validation set. During this process, the identity segregation principle is strictly followed to ensure that image samples of the same identity do not appear in the intersection of the training set and the validation set.

[0117] For example, if an image of the same user appears in both the training and validation sets, the model has already "seen" that user's facial features during the training and optimization phase. Subsequent optimization and validation essentially test the model's ability to remember known samples, rather than its true generalization ability to recognize unfamiliar faces. This leads to inflated evaluation results that fail to objectively reflect the model's performance in real-world applications.

[0118] According to embodiments of this application, the training set and validation set follow the principle of identity segregation, which can prevent data leakage and avoid images of the same identity appearing in both the training set and validation set simultaneously. This ensures that the validation results truly reflect the model's generalization ability, rather than the model's memory of "people it has seen." This allows the evaluation results to truly reflect the model's ability to identify unknown users, ensuring the objectivity and credibility of the performance evaluation and providing a reliable basis for determining the second face recognition model.

[0119] After constructing the retraining dataset, in step S320, using the current parameters of the first face recognition model as the initial state, multi-stage training is performed using the retraining dataset to obtain candidate face recognition models. Multi-stage training is not a general training from scratch, but rather inherits all parameters of the currently deployed model based on the existing model, and uses difficult samples for targeted adjustments.

[0120] For example, multi-stage training using a retrained dataset is essentially a model optimization process. This optimization process does not interfere with the first face recognition model. Instead, it replicates all the parameters of the first model as the initial state, creating a new model copy (with parameters identical to those of the first face recognition model). This new model copy is then trained and optimized. After training and optimization, a candidate face recognition model is obtained. Further, for instance, by testing and comparing the performance of the first and candidate face recognition models, if the candidate face recognition model outperforms the first, it is used as the second face recognition model for face recognition.

[0121] For example, the method of the embodiment may adopt a three-stage progressive training strategy, from coarse to fine and from easy to difficult, to gradually optimize the model performance.

[0122] According to an embodiment of this application, in the coarse-tuning stage, the shallow parameters of the backbone network are frozen, and the parameters of the top classification layer and the liveness detection branch are trained and updated; in the fine-tuning stage, all layer parameters of the coarse-tuned face recognition model are unfrozen, and all layer parameters are jointly trained; in the fine-tuning stage, the boundary hyperparameters in the triplet loss function are increased, and the fine-tuned face recognition model is reinforced using difficult samples.

[0123] During the coarse-tuning phase, the shallow parameters of the backbone network are frozen, and only the parameters of the top classification layer and the liveness detection branch are trained and updated. The shallow network is responsible for extracting general low-level features such as edges, colors, and textures. These features have good task independence, and freezing the shallow parameters can protect the general visual knowledge already learned by the model (e.g., new model copies) from being destroyed. At the same time, updating only the top-level parameters and the parameters of the liveness detection branch allows the model to quickly adapt to the distribution of difficult samples, improving training efficiency and accelerating convergence.

[0124] In the fine-tuning phase: all layer parameters are unfrozen for joint training and optimization, with parameters from the backbone network, face recognition branch, and liveness detection branch all participating in the optimization update. For example, after coarse tuning, the top layer of the model (e.g., the coarse-tuned face recognition model) has initially adapted to difficult samples, but its underlying features are still based on the original data distribution. This phase uses a small learning rate to fine-tune all layer parameters, enabling the feature extractor and classifier to work together to achieve a better matching state.

[0125] In the fine-tuning phase: Focus on hard samples for reinforcement training, dynamically adjust the boundary hyperparameters in the triplet loss function, for example, increase the boundary hyperparameters in the triplet loss function, and use failed recognition samples from the logs to reinforce the model (e.g., the fine-tuned face recognition model). Hard samples are those that the original model (e.g., the first face recognition model) struggles to recognize correctly; reinforcement training on the original model directly addresses performance bottlenecks. Increasing the boundary hyperparameters requires the model to widen the feature distance between the same person and different people, forcing the model (e.g., the fine-tuned face recognition model) to learn more discriminative feature representations, thereby improving the model's ability to distinguish hard samples.

[0126] According to embodiments of this application, the coarse-tuning stage freezes shallow layer parameters, preserving general knowledge. Adjusting only the top layer allows for rapid adaptation to the distribution of difficult samples, resulting in fast training speed and low computational consumption. The fine-tuning stage unfreezes all layers for precise optimization, enabling lower-level features to also adapt to the data distribution of difficult samples. The fine-tuning stage focuses on the most difficult samples, improving the model's ability to identify and generalize to difficult scenarios. This three-stage progression avoids the risks of training instability and performance degradation caused by training directly from scratch or making large-scale adjustments all at once.

[0127] It should be noted that the multi-stage training, including the coarse-tuning stage, the fine-tuning stage, and the fine-tuning stage, is merely an example and is not a limitation on the embodiments of this application. In other embodiments, multi-stage training may include at least one of the coarse-tuning stage, the fine-tuning stage, and the fine-tuning stage, or may include other training methods, which will not be elaborated here.

[0128] The method in this embodiment uses the current parameters of the first face recognition model as the initial state and performs multi-stage training using a retraining dataset. However, in real-world business scenarios, the absolute number of failed recognition samples that can be collected is limited, especially liveness attack samples. Due to the low probability of real attacks, these samples are scarce and difficult to support effective model training. To address this, this embodiment introduces data augmentation operations: by applying transformations such as random cropping, rotation, and color jitter to existing samples, the scale and diversity of training samples can be expanded without increasing annotation costs, providing a sufficient data foundation for the model optimization process.

[0129] Furthermore, if the retraining dataset contains far more real samples than attack samples, a severe class imbalance will occur. Directly training and optimizing on such data will cause the model to be biased in predicting samples as real people, ignoring the identification of attack samples. By using data augmentation operations to target and expand the attack samples, so that the attack samples reach a reasonable proportion in the retraining dataset, and combining this with the joint loss function mentioned above, the class imbalance problem can be effectively alleviated, making the model's identification more realistic and reliable.

[0130] According to embodiments of this application, multi-stage training further includes data augmentation operations, which include basic augmentation operations and / or specific augmentation operations; wherein, the basic augmentation operations perform uniform augmentation on image samples; and the specific augmentation operations perform specific augmentation on at least one of hard positive samples, hard negative samples, and liveness attack samples.

[0131] Data augmentation operations include basic augmentation operations and specialized augmentation operations, which complement each other to form a layered augmentation strategy.

[0132] Basic augmentation operations can uniformly enhance all image samples, regardless of sample type. Specifically, they include common image transformation techniques such as random cropping, random rotation, and color dithering to expand the sample dataset. Random cropping and random rotation generate image variants with different cropping positions and angles to simulate face alignment deviations and head tilts during the acquisition process; color dithering adjusts parameters such as brightness, contrast, saturation, and hue to simulate imaging differences under different lighting conditions. The purpose of basic augmentation operations is to expand the sample size, enabling the model to adapt to various common environmental changes and improving the overall robustness of the model.

[0133] Specialized enhancement operations target three special sample types: difficult positive samples, difficult negative samples, and liveness attack samples. Differentiated enhancement strategies are employed for targeted reinforcement. For difficult positive samples (samples where the same person is incorrectly rejected), operations such as finite angle rotation (±5°) and local occlusion simulation are used to improve the model's tolerance to subtle pose changes and local occlusion, enabling the model to correctly identify users even when they are facing sideways or looking down. For difficult negative samples (samples where different people are incorrectly accepted), operations such as adversarial sample generation and cross-domain style transfer are used to enhance the model's ability to distinguish between adversarial attacks and people with similar appearances, improving the model's defense level. For liveness attack samples, operations such as screen reflection synthesis and 3D mask texture rendering are used. Image fusion algorithms are used to overlay real faces with screen moiré patterns, or 3D deformation technology is used to render stereoscopic mask images, enabling the model to learn common discriminative features of fictional faces, such as abnormal reflections, missing textures, and moiré patterns.

[0134] For example, screen reflection synthesis uses an image fusion algorithm, as shown in the following formula.

[0135]

[0136] Where I is the synthesized face image; I f It is the original human face image, that is, the original image of a real human face; I s It is a pre-captured screen moiré or reflective texture template, γ is the transparency blending factor, and G... nIt is Gaussian noise, and β is the noise weight. The screen re-shooting effect under different lighting conditions is simulated by randomly adjusting γ and β.

[0137] 3D mask texture rendering uses 3D deformation technology (e.g., mesh deformation, depth-guided 3D reconstruction deformation, 3D Gaussian sputtering, etc.) to map a 2D face image onto a 3D mesh surface using a 3D face model. By adjusting the lighting direction and camera angle, a three-dimensional mask image is rendered, and skin texture smoothing is added artificially to simulate the texture of the mask.

[0138] In some embodiments, to optimize the training of the liveness detection branch, the following data augmentation methods can be adaptively introduced: for example, color dithering to simulate different screen color differences; Gaussian blur to simulate out-of-focus attack images; moiré pattern addition to simulate interference patterns generated by shooting the screen, etc.

[0139] According to embodiments of this application, a hierarchical strategy combining basic enhancement and specialized enhancement effectively expands the scale and diversity of retrained samples, solving the problem of insufficient difficult and attack samples. By learning general attack features through specialized enhanced samples, the model improves its recognition accuracy and generalization ability in complex scenarios; enabling the model to effectively defend against attack types not present in the retrained dataset, thus targeting various difficult scenarios and enhancing robustness.

[0140] According to an embodiment of this application, after obtaining a candidate face recognition model through multi-stage training, the method of the embodiment can perform performance evaluation on the obtained candidate face recognition model and the originally deployed first face recognition model to determine the face recognition model to be used for subsequent face recognition.

[0141] Figure 4 A flowchart illustrating a performance evaluation method according to an embodiment of this application is shown schematically. Figure 4 As shown, the performance evaluation method 400 according to an embodiment of this application may include steps S410 to S430.

[0142] In step S410, user traffic is acquired and divided into first user traffic and second user traffic.

[0143] In step S420, the first user traffic is routed to the candidate face recognition model, and the second user traffic is routed to the first face recognition model.

[0144] In step S430, the performance metrics of the candidate face recognition model and the first face recognition model are collected and compared to generate evaluation results.

[0145] For example, after the model optimization is completed, it is not directly deployed to replace the model in the production environment. Instead, it can be verified under real business traffic to ensure that its performance is indeed superior to the current production model. Therefore, this application uses A / B testing for performance evaluation. To ensure the stability of online services, the new model is deployed gradually using a canary release strategy.

[0146] For example, firstly, the user traffic to be identified is acquired and divided into first user traffic and second user traffic. Secondly, the first user traffic is routed to the candidate face recognition model (i.e., the experimental group), and the second user traffic is routed to the first face recognition model (i.e., the control group). Both groups of traffic run in parallel in the same real-world business environment, simultaneously receiving recognition requests from real users. Finally, key performance indicators of the two models are collected and compared, and objective evaluation results are generated through comparative analysis. It should be noted that, as described above, the first face recognition model is a deployed face recognition model that has not been trained or optimized, and can be used for performance comparison with the optimized candidate face recognition model.

[0147] Key performance indicators (KPIs) may include, but are not limited to: face recognition accuracy, liveness detection accuracy, the harmonic mean of precision and recall (F1 score), area under the receiver operating characteristic (ROC) curve, pass rate with low false recognition rate, equal error rate, and engineering indicators such as model inference latency and hardware resource utilization. It should be noted that the above KPIs are merely examples and not limitations on the embodiments of this application. In other embodiments, other KPIs may be used, such as mean average precision (mAP).

[0148] The harmonic mean of precision and recall is used as the key performance indicator. The formula for calculating the harmonic mean F1 of precision and recall is as follows.

[0149]

[0150] Here, FAR (False Acceptance Rate) represents the false acceptance rate, which is the probability of incorrectly identifying an image of a non-target person as the target person; FRR (False Rejection Rate) represents the false rejection rate, which is the probability of incorrectly rejecting a legitimate image of the target person; the two are usually inversely proportional. The larger the F1 score, the better the overall performance of the model.

[0151] According to embodiments of this application, when the overall performance of the new model is better than the current production model, the new model is fully released; otherwise, the model is fully rolled back to the current production model. For example, if the overall performance of the candidate face recognition model is better than the first face recognition model, the candidate face recognition model is fully released as the new production model.

[0152] According to the embodiments of this application, the actual effect of the trained and optimized model (i.e., the new model) is verified in a real business environment, and the evaluation results are real and reliable; the A / B testing mechanism can verify the actual effect of the model in real user scenarios, which is more convincing than offline testing; the risk of deploying the new model is limited to a controllable range through traffic control, which reduces the risk of deploying the new model; if the evaluation results show that the performance of the new model is better than the current production model, it is determined as the second face recognition model and fully released; otherwise, it is fully rolled back to the current production model, ensuring that the stability of online services is not affected.

[0153] This application embodiment achieves real-time comparison of the old and new models by allocating user traffic, providing direct data support for the decision to determine the second face recognition model.

[0154] For example, to ensure the fairness and comparability of the evaluation, the traffic splitting strategy in the embodiment can adopt the user identity hash splitting strategy. The user identity hash splitting strategy divides traffic based on the calculated hash value. The user identity hash splitting strategy can ensure that the same user is always routed to the same model during the test, avoiding the deviation of results caused by the same user experiencing different models alternately.

[0155] According to an embodiment of this application, dividing user traffic into first user traffic and second user traffic includes: dividing user traffic into first user traffic and second user traffic according to a preset ratio using a user identity hashing distribution strategy.

[0156] The method in this embodiment can employ a user identity hash-based traffic splitting strategy to achieve precise division of user traffic. The user identity hash-based traffic splitting strategy may include: performing a hash operation on each user identity to generate a fixed-length hash value; then taking the modulo of this hash value by a preset modulo (e.g., 100); and dividing the user traffic into first user traffic and second user traffic according to a preset ratio based on the modulo result. The preset ratio can be set according to actual business needs; for example, 50% of the user traffic can be designated as first user traffic, and the other 50% as second user traffic.

[0157] For example, a hash operation is performed on the user's identity identifier, and the hash value is modulo 100. If the remainder is less than 50, the corresponding user traffic is routed to the first face recognition model; if the remainder is greater than or equal to 50, the corresponding user traffic is routed to the candidate face recognition model, thus strictly controlling the traffic allocation to a 50% ratio. It should be noted that using a user identity identifier hash-based traffic allocation strategy to achieve precise user traffic division is merely an example and not a limitation of the embodiments of this application. In other embodiments, other strategies can be used to divide user traffic, such as weighted random traffic allocation, request parameter-based traffic allocation, time-slice round-robin traffic allocation, etc.

[0158] According to embodiments of this application, the same user is always routed to the same model during the test, avoiding inconsistent experiences due to different requests from the same user. Deterministic traffic splitting is achieved through hash operations, eliminating the need to maintain a mapping between users and models, resulting in simplicity and low overhead. By adjusting the modulo threshold, the traffic ratio between the experimental and control groups can be flexibly controlled, supporting flexible canary release strategies (e.g., starting with 10% and gradually increasing), ensuring fairness in A / B testing and consistency in user experience.

[0159] The adaptive optimization or update method for face recognition models proposed in this application effectively reduces the recognition error rate of the model in complex scenarios such as changes in lighting and extreme poses through operations such as failure sample targeted enhancement, triplet loss optimization, and multi-stage training.

[0160] For example, after determining the second face recognition model based on the evaluation results, the method of this embodiment can use the second face recognition model to perform recognition and monitor recognition failure events during the recognition process. When the number of recognition failure samples collected through logs reaches a preset trigger threshold again, the model update process is repeated to obtain a "new" second face recognition model, thereby achieving continuous adaptive optimization of the model. The continuous adaptive optimization mechanism of this embodiment is based on failure samples during the recognition process, and the recognition failure events in this embodiment will be described in detail below.

[0161] For identification failure logs, in addition to liveness detection failures, identification failure events can also include two other scenarios: one is incorrect rejection, where the model rejects a legitimate user who should have passed; the other is incorrect acceptance, where the model passes an attacker or impersonator who should have been rejected.

[0162] According to embodiments of this application, the identification failure events include a first type of failure event, a second type of failure event, and a third type of failure event; wherein, the first type of failure event is: the liveness detection score is lower than a preset threshold, resulting in identification failure; the second type of failure event is: the liveness detection score is higher than the preset threshold, and for sample pairs of users with the same identity, the similarity score is lower than the matching threshold, resulting in identification failure; the third type of failure event is: the liveness detection score is higher than the preset threshold, and for sample pairs of users with different identities, the similarity score is higher than the matching threshold, resulting in identification failure.

[0163] Type 1 failure: When the liveness detection score of the input image is below a preset threshold, the model determines that the image is a fake face and directly rejects the recognition request. This type of failure belongs to the liveness detection branch and reflects the model's defense capability against deception attacks. Reasons for this type of failure may include: users using fake methods such as photo manipulation, screen display, or 3D masks to launch attacks; or real faces being misidentified as attacks under extreme lighting conditions. Image samples corresponding to this type of failure will be labeled as "attack" samples and used for reinforcement training of the liveness detection branch.

[0164] For example, a liveness detection score can be a numerical result output by the liveness detection branch in a face recognition model, used to quantify the probability that an input face image is a real face. This score is typically a probability value between 0 and 1; a higher value indicates that the model is more certain that the image comes from a real, live face, while a lower value is more likely to be judged as a fake attack.

[0165] In the actual identification process, the method of the embodiment can compare the liveness detection score with a preset threshold: if the score is lower than the threshold, it is determined to be an attack sample and the identification request is directly rejected, corresponding to the first type of failure event; if the score is higher than the threshold, the liveness detection is passed.

[0166] The liveness detection score directly reflects the model's ability to prevent spoofing, and its accuracy depends on the training quality and data coverage of the liveness detection branch. Through continuous accumulation of failed samples and targeted training, the distribution of the model's liveness detection score is gradually optimized, and the score boundary between real and fake faces becomes increasingly clear.

[0167] The second type of failure occurs when a liveness detection passes but the similarity score is below the matching threshold, and the individuals in the image are the same person. For example, the tags indicate the same person, but after recognition by the first face recognition model, the liveness detection score is above the preset threshold, while the similarity score fails to reach the matching threshold. The liveness detection confirms the image is a real face, but the face recognition branch considers the live image and the image in the preset database to be different people, giving a lower similarity score, resulting in the legitimate user being incorrectly rejected. This type of failure is considered a false rejection, reflecting the model's insufficient tolerance to factors such as changes in lighting, pose deviations, and facial expression changes. Image pairs corresponding to this type of failure will be labeled as difficult positive samples, i.e., falsely rejected samples, for reinforcement training of the face recognition branch.

[0168] The third type of failure occurs when a liveness detection passes but the similarity score exceeds the matching threshold, and the individuals are different. For example, the tags may be different people, but after recognition by the first face recognition model, both the liveness detection score and the similarity score exceed the preset threshold. The liveness detection has confirmed that the image is a real face, but the face recognition branch incorrectly identifies the imposter as a legitimate user in the preset database, giving it a high similarity score, leading to a security risk. This type of failure is considered a false acceptance, reflecting the model's insufficient ability to distinguish facial features of different identities. Image pairs corresponding to this type of failure will be labeled as difficult negative samples, i.e., falsely accepted samples, for reinforcement training of the face recognition branch.

[0169] For example, the similarity score can be a numerical result output by the face recognition branch, used to quantify the degree of similarity between faces in two input images. In the actual recognition process, these two images are a live face image captured by the terminal and a reference image stored in a preset database, such as an ID photo entered during user registration. This score is typically a probability value between 0 and 1 (or a normalized similarity metric), with a higher value indicating that the model believes the two images are more likely to belong to the same person.

[0170] In the identification process, the method of this embodiment compares the similarity score with a preset matching threshold: if the score is lower than the threshold, it is determined that they are different identities and the identification fails; if the score is higher than the threshold, it is determined that they are the same identity and the identification passes. The preset matching threshold can be set according to the actual use scenario, for example, it can be 0.6.

[0171] Similarity score directly reflects the model's face recognition capability, and its accuracy depends on the training quality of the face recognition branch. For sample pairs of users with the same identity, the similarity score should be as high as possible; for sample pairs of users with different identities, the similarity score should be as low as possible. A Type II failure occurs when the similarity score of a sample pair of users with the same identity is below the matching threshold; a Type III failure occurs when the similarity score of a sample pair of users with different identities is above the matching threshold. Through continuous accumulation of difficult samples and targeted training, the model continuously optimizes the intra-class aggregation and inter-class separation of the feature space, causing the distribution difference in similarity scores between positive and negative sample pairs to continuously expand.

[0172] According to embodiments of this application, the method can accurately identify different types of failure events, clarify the specific deficiencies in the current capabilities of the model, and provide differentiated training data sources for model optimization. The construction of the classification data has clear technical basis (preset threshold, matching threshold), ensuring the consistency of data quality. By classifying the identified failure events, the distribution of weaknesses in the model can be analyzed, guiding targeted adjustments to optimization strategies and improving optimization efficiency.

[0173] In some embodiments, for successfully identified logs, images from a preset database and terminal input images are associated based on information such as process identifiers, and similarity scores are recorded. Successfully identified logs can be used to dynamically update the reference image library, i.e., the preset database. Successfully identified logs record valid facial images of the user at different times and in different environments. As a user's appearance slowly changes (e.g., aging, changes in body shape), previously entered photos in the database may gradually become out of sync with the current appearance, leading to a decrease in recognition accuracy. Images accumulated through successful logs can dynamically update the user's reference images, ensuring the model always uses the user's recent appearance as a comparison benchmark, effectively extending the model's applicability over long periods.

[0174] For example, successfully identified logs can also serve as a benchmark for calculating evaluation metrics. In performance evaluation, successfully identified logs provide a positive sample basis for calculating evaluation metrics such as accuracy, precision, recall, F1 score, and area under the receiver operating characteristic curve.

[0175] This application provides a method for updating a face recognition model based on failed samples, aiming to solve the problem of low face recognition success rate caused by factors such as lighting, angle, and pose in practical applications. The core architecture of this method is as follows: constructing a multi-task face recognition model that includes a backbone network, a face recognition branch (Siamese network structure), and a liveness detection branch (binary classification structure). The two task branches share the same backbone network and are trained through a multi-task joint loss function to achieve collaborative optimization of face recognition and liveness detection.

[0176] The workflow of the method in this embodiment is as follows: A face recognition image is input into a first face recognition model for recognition. Failure events during the recognition process are continuously monitored, and the cumulative number of failures is counted. When the cumulative number reaches a preset trigger threshold, a model update process is automatically triggered. The update process extracts the input image corresponding to the failure event from the log, forms image pairs with reference images in the database, and labels each image pair with an identity relationship label (same identity / different identity). Each input image is labeled with an attribute label (live / attack). After identity isolation and partitioning, a retraining dataset is constructed. Subsequently, using the current parameters of the first face recognition model as the initial state, a three-stage progressive training process of coarse tuning, fine tuning, and fine tuning is performed using the retraining dataset. During the fine tuning stage, the boundary hyperparameters in the triplet loss are increased. After training, the performance of the trained model and the first face recognition model is evaluated through A / B testing. Based on the evaluation results, the optimal model is selected as the second face recognition model. Then, based on the second model, recognition continues and its failure events are continuously monitored, forming a complete closed loop of "recognition → monitoring → accumulation → update → deployment → re-recognition," achieving continuous adaptive optimization of the model.

[0177] The method in this application embodiment can avoid matching failures caused by angle deviations or uneven lighting by means of targeted enhancement of failed samples and multi-stage fine-tuning, while ensuring that the original recognition ability is not degraded and the stability of online services is not affected. It also solves the problem that face recognition systems are vulnerable to attacks by photos and videos, and improves the recognition accuracy and anti-spoofing ability of the model in complex scenarios.

[0178] Based on the above-described face recognition model update method, embodiments of this application also provide a face recognition model update device. The following will be combined with... Figure 5 The device is described in detail.

[0179] Figure 5 A schematic block diagram of a face recognition model update apparatus according to an embodiment of this application is shown.

[0180] like Figure 5 As shown, the face recognition model update device 500 in this embodiment includes a model recognition module 510, a result monitoring module 520, and an update triggering module 530.

[0181] The model recognition module 510 is used to acquire a face recognition image and input the face recognition image into a first face recognition model for recognition. The first face recognition model includes a backbone network, a face recognition branch, and a liveness detection branch. In one embodiment, the model recognition module 510 can be used to perform step S210 described above, which will not be repeated here.

[0182] The result monitoring module 520 is used to monitor recognition failure events of the first face recognition model during the recognition process and count the cumulative number of recognition failure events. In one embodiment, the result monitoring module 520 can be used to execute step S220 described above, which will not be repeated here.

[0183] The update trigger module 530 is used to trigger the model update process in response to the accumulated number of times reaching a preset trigger threshold, so as to obtain a second face recognition model. In one embodiment, the update trigger module 530 can be used to execute the step S230 described above, which will not be repeated here.

[0184] The model recognition module 510 is also used to perform recognition using a second face recognition model, and the result monitoring module 520 is also used to monitor recognition failure events of the second face recognition model during the recognition process. In one embodiment, the model recognition module 510 and the result monitoring module 520 can be used to execute the step S240 described above, which will not be repeated here.

[0185] According to an embodiment of this application, the face recognition branch and the liveness detection branch share a backbone network; wherein, the face recognition branch adopts a twin network structure, which is used to receive two input images and output the similarity score of the two input images; the liveness detection branch is used to receive a single input image and output the liveness detection result of the single input image.

[0186] According to an embodiment of this application, the first face recognition model is trained using a multi-task joint loss function, which is obtained by weighted summation of the face recognition loss function and the liveness detection loss function.

[0187] According to an embodiment of this application, the update triggering module 530 includes: a sample acquisition unit, used to extract image samples corresponding to recognition failure events from logs and construct a retraining dataset; a model update unit, used to perform multi-stage training using the retraining dataset with the current parameters of the first face recognition model as the initial state to obtain a candidate face recognition model, wherein the multi-stage training includes a coarse-tuning stage, a fine-tuning stage, and a fine-tuning stage; a performance evaluation unit, used to perform performance evaluation on the candidate face recognition model and the first face recognition model and generate evaluation results; and a model determination unit, used to determine the candidate face recognition model or the first face recognition model as the second face recognition model based on the evaluation results.

[0188] According to an embodiment of this application, the sample acquisition unit is further configured to: extract the input image corresponding to the identification failure event from the log and the reference image from the preset database to form an image pair; label each image pair with an identity relationship tag, wherein the identity relationship tag includes the same identity or different identities; and label each input image with an attribute tag, wherein the attribute tag includes liveness or attack.

[0189] According to an embodiment of this application, the identity relationship label is determined by at least one of device fingerprint association, time window association, and manual assisted annotation; wherein, device fingerprint association is based on the device's unique identifier; and time window association is based on a preset time window.

[0190] According to an embodiment of this application, the sample acquisition unit is further configured to: divide the image samples into a training set and a verification set based on the user identity identifier, wherein the training set and the verification set follow the identity isolation principle.

[0191] According to an embodiment of this application, in the coarse-tuning stage, the shallow parameters of the backbone network are frozen, and the parameters of the top classification layer and the liveness detection branch are trained and updated; in the fine-tuning stage, all layer parameters of the coarse-tuned face recognition model are unfrozen, and all layer parameters are jointly trained; in the fine-tuning stage, the boundary hyperparameters in the triplet loss function are increased, and the fine-tuned face recognition model is reinforced using difficult samples.

[0192] According to embodiments of this application, multi-stage training further includes data augmentation operations, which include basic augmentation operations and / or specific augmentation operations; wherein, the basic augmentation operations perform uniform augmentation on image samples; and the specific augmentation operations perform specific augmentation on at least one of hard positive samples, hard negative samples, and liveness attack samples.

[0193] According to an embodiment of this application, the performance evaluation unit includes: a traffic acquisition unit, used to acquire user traffic and divide the user traffic into first user traffic and second user traffic; a traffic allocation unit, used to route the first user traffic to the candidate face recognition model and the second user traffic to the first face recognition model; and an indicator comparison unit, used to collect and compare the performance indicators of the candidate face recognition model and the first face recognition model, and generate an evaluation result.

[0194] According to an embodiment of this application, the traffic acquisition unit is further configured to: divide user traffic into first user traffic and second user traffic according to a preset ratio using a user identity hashing strategy.

[0195] According to embodiments of this application, the identification failure events include a first type of failure event, a second type of failure event, and a third type of failure event; wherein, the first type of failure event is: the liveness detection score is lower than a preset threshold, resulting in identification failure; the second type of failure event is: the liveness detection score is higher than the preset threshold, and for sample pairs of users with the same identity, the similarity score is lower than the matching threshold, resulting in identification failure; the third type of failure event is: the liveness detection score is higher than the preset threshold, and for sample pairs of users with different identities, the similarity score is higher than the matching threshold, resulting in identification failure.

[0196] According to embodiments of this application, any multiple modules of the model recognition module 510, result monitoring module 520, and update triggering module 530 can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this application, at least one of the model recognition module 510, result monitoring module 520, and update triggering module 530 can be at least partially implemented as a hardware circuit, such as a field-programmable gate array, a programmable logic array, a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit, or any other reasonable means of integrating or packaging the circuit, or implemented in software, hardware, or firmware, or in any appropriate combination of any of these three implementation methods. Alternatively, at least one of the model recognition module 510, result monitoring module 520, and update triggering module 530 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0197] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a face recognition model update method according to an embodiment of this application.

[0198] like Figure 6 As shown, an electronic device 1200 according to an embodiment of this application includes a processor 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory 1202 or a program loaded from a storage portion 1208 into a random access memory 1203. The processor 1201 may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a dedicated microprocessor. The processor 1201 may also include onboard memory for caching purposes. The processor 1201 may include a single processing unit or multiple processing units for executing different steps of the method flow according to an embodiment of this application.

[0199] Random access memory 1203 stores various programs and data required for the operation of electronic device 1200. Processor 1201, read-only memory 1202, and random access memory 1203 are interconnected via bus 1204. Processor 1201 executes various steps of the method flow according to embodiments of this application by executing programs in read-only memory 1202 and / or random access memory 1203. It should be noted that the programs may also be stored in one or more memories other than read-only memory 1202 and random access memory 1203. Processor 1201 may also execute various steps of the method flow according to embodiments of this application by executing programs stored in said one or more memories.

[0200] According to embodiments of this application, the electronic device 1200 may further include an input / output interface 1205, which is also connected to the bus 1204. The electronic device 1200 may also include one or more of the following components connected to the input / output interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube, liquid crystal display, etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card, such as a local area network card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the input / output interface 1205 as needed. A removable medium 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1210 as needed so that computer programs read from it can be installed into the storage section 1208 as needed.

[0201] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.

[0202] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include the read-only memory 1202, and / or random access memory 1203, and / or one or more memories other than read-only memory 1202 and random access memory 1203 described above.

[0203] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.

[0204] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1209, and / or installed from the removable medium 1211. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0205] In embodiments of this application, the computer program can be downloaded and installed from a network via communication section 1209, and / or installed from removable medium 1211. When the computer program is executed by processor 1201, it performs the functions defined in the system of this application embodiment. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0206] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0207] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0208] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.

Claims

1. A method for updating a face recognition model, characterized in that, The method includes: A face recognition image is acquired, and the face recognition image is input into a first face recognition model for recognition, wherein the first face recognition model includes a backbone network, a face recognition branch, and a liveness detection branch; Monitor the recognition failure events of the first face recognition model during the recognition process, and count the cumulative number of recognition failure events; In response to the accumulated number of times reaching a preset trigger threshold, a model update process is triggered to obtain a second face recognition model; and The second face recognition model is used for identification, and the recognition failure events of the second face recognition model during the recognition process are monitored.

2. The method according to claim 1, characterized in that, The face recognition branch and the liveness detection branch share the backbone network; The face recognition branch employs a Siamese network structure to receive two input images and output the similarity score between the two input images; the liveness detection branch receives a single input image and outputs the liveness detection result of the single input image.

3. The method according to claim 1, characterized in that, The first face recognition model is trained using a multi-task joint loss function, which is obtained by weighted summation of the face recognition loss function and the liveness detection loss function.

4. The method according to any one of claims 1-3, characterized in that, The model update process includes: Extract image samples corresponding to the recognition failure events from the logs to construct a retraining dataset; Using the current parameters of the first face recognition model as the initial state, multi-stage training is performed using the retraining dataset to obtain a candidate face recognition model. The multi-stage training includes a coarse-tuning stage, a fine-tuning stage, and a fine-tuning stage. The performance of the candidate face recognition model and the first face recognition model is evaluated, and evaluation results are generated; and Based on the evaluation results, the candidate face recognition model or the first face recognition model is determined as the second face recognition model.

5. The method according to claim 4, characterized in that, The step of extracting image samples corresponding to the recognition failure events from the logs and constructing a retraining dataset includes: Extract the input image corresponding to the recognition failure event from the log and the reference image from the preset database to form an image pair; For each image pair, an identity relationship label is assigned, wherein the identity relationship label includes whether the identities are the same or different; and Each input image is labeled with an attribute tag, wherein the attribute tag includes liveness or attack.

6. The method according to claim 5, characterized in that, The identity relationship label is determined through at least one of device fingerprint association, time window association, and manual auxiliary annotation; The device fingerprint association is based on the device's unique identifier; the time window association is based on a preset time window.

7. The method according to claim 4, characterized in that, Extract image samples corresponding to the recognition failure events from the logs, and construct a retraining dataset, including: Based on user identity identifiers, the image samples are divided into a training set and a verification set, wherein the training set and the verification set follow the identity isolation principle.

8. The method according to claim 4, characterized in that, The coarse-tuning stage freezes the shallow parameters of the backbone network and trains and updates the parameters of the top classification layer and the liveness detection branch. The fine-tuning stage involves unfreezing all layer parameters of the coarse-tuned face recognition model and jointly training all layer parameters. The fine-tuning stage increases the boundary hyperparameters in the triplet loss function and uses difficult samples to reinforce the fine-tuned face recognition model.

9. The method according to claim 4, characterized in that, The multi-stage training also includes data augmentation operations, which include basic augmentation operations and / or specific augmentation operations. The basic enhancement operation performs uniform enhancement on the image samples; the specialized enhancement operation performs specialized enhancement on at least one of the difficult positive samples, difficult negative samples, and liveness attack samples.

10. The method according to claim 4, characterized in that, The performance evaluation of the candidate face recognition model and the first face recognition model, and the generation of evaluation results, include: Acquire user traffic and divide the user traffic into first user traffic and second user traffic; The first user traffic is routed to the candidate face recognition model, and the second user traffic is routed to the first face recognition model; and The performance metrics of the candidate face recognition model and the first face recognition model are collected and compared to generate the evaluation results.

11. The method according to claim 10, characterized in that, The step of dividing the user traffic into first user traffic and second user traffic includes: The user traffic is divided into the first user traffic and the second user traffic according to a preset ratio using a user identity hashing strategy.

12. The method according to any one of claims 1-3 and 5-11, characterized in that, The identified failure events include a first type of failure event, a second type of failure event, and a third type of failure event; wherein, The first type of failure event is: the liveness detection score is lower than a preset threshold, resulting in recognition failure; The second type of failure event is: the liveness detection score is higher than the preset threshold, and for sample pairs of users with the same identity, the similarity score is lower than the matching threshold, resulting in recognition failure; The third type of failure event is: the liveness detection score is higher than the preset threshold, and for sample pairs of users with different identities, the similarity score is higher than the matching threshold, resulting in recognition failure.

13. A face recognition model update device, characterized in that, The device includes: The model recognition module is used to acquire a face recognition image and input the face recognition image into a first face recognition model for recognition. The first face recognition model includes a backbone network, a face recognition branch, and a liveness detection branch. The result monitoring module is used to monitor recognition failure events of the first face recognition model during the recognition process and to count the cumulative number of recognition failure events; and An update trigger module is used to trigger a model update process to obtain a second face recognition model in response to the accumulated number of times reaching a preset trigger threshold. The model recognition module is also used to perform recognition using the second face recognition model, and the result monitoring module is also used to monitor recognition failure events of the second face recognition model during the recognition process.

14. An electronic device comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 12.

15. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 12.

16. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 12.