Biometric feature recognition model updating method and apparatus, readable medium, and device
By training the initial biometric recognition model through feature category classification and fusing network layer parameters, a fusion model is generated, which solves the problems of insufficient recognition accuracy of a single model and resource consumption of multi-model fusion, and achieves efficient feature recognition and resource conservation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-11-29
- Publication Date
- 2026-05-29
AI Technical Summary
When dealing with complex and ever-changing facial data, a single deep learning model struggles to capture all the underlying information behind the data, resulting in insufficient recognition accuracy. At the same time, using multiple model fusion methods increases storage space and computational resource consumption.
By training the initial biometric recognition model by feature category classification, multiple trained models are obtained. Then, based on the differences in network layer parameters, a fusion model is generated, reducing redundant information and computational burden.
It improves the generalization ability and recognition accuracy of biometric recognition models, reduces the consumption of storage space and computing resources, optimizes the model structure, and enhances feature extraction and decision-making capabilities.
Smart Images

Figure CN122116023A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer and communication technology, and more specifically, to a method, apparatus, readable medium, and device for updating a biometric identification model. Background Technology
[0002] Facial recognition, as a biometric identification technology, has been widely used in fields such as intelligent security, human-computer interaction, and financial payments due to its advantages of being non-contact, natural, and highly accurate. However, single deep learning models often have limitations when processing complex and varied facial data, failing to fully capture all the underlying information behind the data. To improve the recognition accuracy and generalization ability of models, related technologies have proposed combining the outputs of multiple models to enhance performance. However, this method requires storing and running multiple models during testing and practical use, increasing storage space and consuming significant computational resources. Summary of the Invention
[0003] The embodiments of this application provide a method, apparatus, readable medium, and device for updating a biometric identification model, which can reduce the occupation of storage space and excessive consumption of computing resources while ensuring the accuracy and reliability of the biometric identification model.
[0004] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part by practice of this application.
[0005] According to one aspect of the embodiments of this application, a method for updating a biometric recognition model is provided, comprising: training an initial biometric recognition model using biometric sample datasets corresponding to different feature categories to obtain multiple trained models, wherein the multiple trained models include trained models corresponding to each of the different feature categories, and each of the multiple trained models includes a first network layer; performing a first fusion process on the multiple trained models to obtain a fusion model, wherein the first fusion process includes: fusing the parameter values of the first network layers of a portion of the trained models to obtain a first fusion parameter value, wherein the portion of the trained models is determined from the multiple trained models based on the difference between the parameter values of the first network layers, and the fusion model is determined based on the first fusion parameter value, wherein the parameter values of the first network layers of the fusion model are the first fusion parameter value; and performing a second fusion process on the fusion model and the initial biometric recognition model to obtain a final biometric recognition model.
[0006] According to one aspect of the embodiments of this application, an apparatus for updating a biometric recognition model is provided, comprising: a training unit configured to train an initial biometric recognition model using biometric sample datasets corresponding to different feature categories to obtain multiple trained models, wherein the multiple trained models include trained models corresponding to each of the different feature categories, and each of the multiple trained models includes a first network layer; a fusion unit configured to perform a first fusion process on the multiple trained models to obtain a fusion model, wherein the first fusion process includes: fusing the parameter values of the first network layers of a portion of the trained models to obtain a first fusion parameter value, wherein the portion of the trained models is determined from the multiple trained models based on the difference between the parameter values of the first network layers, and the fusion model is determined based on the first fusion parameter value, wherein the parameter values of the first network layers of the fusion model are the first fusion parameter value; and a processing unit configured to perform a second fusion process on the fusion model and the initial biometric recognition model to obtain a final biometric recognition model.
[0007] In some optional embodiments, the fusion unit is configured to: select two trained models from the plurality of trained models whose difference between the parameter values of the first network layer exceeds a set threshold; and fuse the parameter values of the first network layer of the two trained models to obtain the first fused parameter value.
[0008] In some optional embodiments, the fusion unit is configured to: perform a weighted summation of the parameter values of the first network layer of the partially trained model according to a set first weight value to obtain the first fusion parameter value.
[0009] In some optional embodiments, the fusion unit is configured to: perform clustering processing on the parameter values of the first network layers of the plurality of trained models to obtain parameter values of the first network layers in a plurality of cluster categories; select parameter values of the first network layers of two cluster categories whose parameter values differ from the parameter values of the first network layers in the plurality of cluster categories by a set threshold; and fuse the parameter values of the first network layers of the two cluster categories to obtain the first fused parameter value.
[0010] In some optional embodiments, the fusion unit is further configured to: calculate the similarity between the parameter values of the first network layers of different trained models based on the parameter values of the first network layers of the plurality of trained models; and determine the difference between the parameter values of the first network layers of different trained models based on the similarity between the parameter values of the first network layers.
[0011] In some optional embodiments, the similarity includes cosine similarity; the fusion unit is further configured to: convert the cosine similarity between the parameter values of the first network layer into an angle value between the parameter values of the first network layer; and determine the difference between the parameter values of the first network layer of different trained models based on the angle value between the parameter values of the first network layer.
[0012] In some embodiments of this application, based on the foregoing scheme, the processing unit is configured to: fuse the parameter values of the fusion model and the initial biometric recognition model in the same network layer to obtain the fusion parameter values corresponding to each network layer; and generate the final biometric recognition model according to the fusion parameter values corresponding to each network layer.
[0013] In some embodiments of this application, based on the foregoing scheme, the processing unit is configured to: perform a weighted summation of the parameter values of the fusion model and the initial biometric recognition model in the same network layer according to a set second weight value, so as to obtain the fusion parameter values corresponding to each network layer.
[0014] In some embodiments of this application, based on the foregoing scheme, the fusion unit is further configured to: for a second network layer that belongs to the same network module as the first network layer, fuse the parameter values of the second network layer of the partially trained model to obtain a second fusion parameter value; determine the fusion model based on the first fusion parameter value and the second fusion parameter value, wherein the parameter value of the first network layer of the fusion model is the first fusion parameter value, and the parameter value of the second network layer of the fusion model is the second fusion parameter value.
[0015] In some embodiments of this application, based on the foregoing scheme, the training unit is further configured to: acquire a training sample dataset containing biometric features; and use the training sample dataset to train a machine learning model to obtain the initial biometric recognition model.
[0016] In some embodiments of this application, based on the foregoing scheme, the training unit is configured to: during the training of the initial biometric recognition model using biometric sample datasets corresponding to different feature categories, control the learning rate corresponding to the header file of the initial biometric recognition model to gradually decrease from a first set value, and control the learning rate of the backbone network of the initial biometric recognition model to be less than or equal to a second set value.
[0017] According to one aspect of the embodiments of this application, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method for updating a biometric identification model as described in the above embodiments.
[0018] According to one aspect of the embodiments of this application, a computer device is provided, including: one or more processors; and a storage device for storing one or more computer programs, which, when executed by the one or more processors, cause the computer device to implement the biometric identification model update method as described in the above embodiments.
[0019] According to one aspect of the embodiments of this application, a computer program product is provided, comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads from the computer-readable storage medium and executes the computer program, causing the computer device to perform the biometric identification model update method provided in the various alternative embodiments described above.
[0020] In some embodiments of this application, the initial biometric recognition model is trained using biometric sample datasets corresponding to different feature categories to obtain multiple trained models. These multiple trained models include trained models corresponding to different feature categories, ensuring that the multiple trained models can learn diverse feature information of different feature categories. This allows these feature information to complement each other during the fusion process, ensuring that the final biometric recognition model has stronger generalization ability and adaptability when facing complex and variable feature data. Furthermore, by determining a portion of the trained models based on the differences in parameter values of the first network layer of different trained models, and fusing the parameter values of the first network layer of these trained models to obtain the first fusion parameter value, the trained models with significantly different first network layer parameter values can be fused. This not only improves the generalization ability of the fused model by combining the parameter values of the first network layer of different trained models, enhancing the accuracy and reliability of feature recognition, but also avoids the problems of high processing burden and excessive redundant information caused by fusing all trained models.
[0021] Simultaneously, fusing the parameter values of the first network layer of the partially trained model effectively optimizes the parameter values of the first network layer of the fused model. This optimization can also indirectly affect key aspects of the fused model, such as feature extraction, representation learning, and decision-making capabilities, making the final biometric recognition model more structurally sound and superior in performance. Since the fused model is based on parameter optimization of the partially trained model, it can maintain high performance while reducing reliance on new sample data. This means that parameter adjustment and optimization can be performed more efficiently during subsequent model iterations and updates, thereby accelerating the model's iteration speed. Finally, because the final biometric recognition model integrates the model parameters of the initial biometric recognition model and the fused model, it eliminates the need to use multiple models for feature recognition during testing or practical use. This ensures the accuracy and reliability of the feature recognition model while avoiding the increased storage space and excessive consumption of computing resources caused by using multiple models in related technologies.
[0022] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0023] Figure 1A A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied is shown;
[0024] Figure 1B A schematic diagram of a palm-swipe payment scenario in which the technical solutions of the embodiments of this application can be applied is shown;
[0025] Figure 1C This illustration shows a face recognition scenario where the technical solutions of the embodiments of this application can be applied;
[0026] Figure 2 A flowchart illustrating an update method for a biometric identification model according to an embodiment of this application is shown;
[0027] Figure 3 A flowchart illustrating an update method for a biometric identification model according to an embodiment of this application is shown;
[0028] Figure 4 A schematic diagram of a model processing procedure for biometric identification according to an embodiment of this application is shown;
[0029] Figure 5 A schematic diagram showing the angular relationship of a fine-tuning model on a certain layer parameter according to an embodiment of this application is illustrated.
[0030] Figure 6 A block diagram of an apparatus for updating a biometric identification model according to an embodiment of this application is shown;
[0031] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing the computer device of the present application is shown. Detailed Implementation
[0032] Exemplary embodiments will now be described in a more comprehensive manner with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be construed as limited to these examples; rather, these embodiments are provided so that this application will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art.
[0033] Furthermore, the features, structures, or characteristics described in this application can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to provide a full understanding of the embodiments of this application. However, those skilled in the art will recognize that when implementing the technical solutions of this application, not all the detailed features in the embodiments may be used, one or more specific details may be omitted, or other methods, elements, devices, steps, etc., may be employed.
[0034] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0036] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0037] It should be noted that "multiple" in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0038] It is understood that this application may display a prompt interface or pop-up window before and during the collection of relevant data (such as biometric data). This prompt interface or pop-up window is used to inform the user that relevant data is being collected. This ensures that the application only begins the data acquisition steps after receiving confirmation from the user regarding the prompt interface or pop-up window; otherwise (i.e., without user confirmation), the data acquisition steps are terminated, and no data is acquired. In other words, all data collected by this application is collected with the user's consent and authorization, and the collection, use, and processing of relevant user data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0039] In recent years, deep neural networks (DNNs) have made significant progress in fields such as computer vision (CV) and natural language processing (NLP). However, a single deep learning model often has limitations and cannot fully capture all the underlying information behind a complex network. Therefore, the concept of ensemble learning has been proposed, which combines the outputs of multiple models to improve the final performance of the deep learning model. However, this technique has the drawback of requiring the storage and execution of multiple models during testing and practical use, which not only increases storage space but also consumes significant computational resources, especially as the complexity and scale of the models increase.
[0040] For example, GPT-3 (an artificial intelligence language model) has billions of parameters, while subsequent large models have reached thousands or even trillions of parameters. Furthermore, from the loss graph of DNNs, gradient optimization solutions typically converge to points near the boundaries of broad, flat regions, rather than the center point. This means that a trained network model is not perfectly close to the optimal solution with the minimum test error; solutions near the optimal point need to be fused to obtain better results. This has inspired researchers to limit the fusion scope not only to predictions (e.g., logits) but also to the fusion of model parameters, thus avoiding the need to access training data or maintain all individual models. Therefore, deep model fusion aims to merge multiple DNNs into a single network, preserving their original functionality and even outperforming multi-task training. In addition, deep model fusion can reduce the tendency of individual models to overfit specific samples or noise, thereby improving the accuracy, diversity, and robustness of predictions.
[0041] Deep model fusion can generally be divided into two categories: prediction result fusion and model parameter rearrangement fusion. Prediction result fusion requires obtaining the prediction results of each model for the same information (such as an image), then averaging or weighted averaging these predictions, and using the averaged result as the prediction for that image. However, this method requires multiple forward inferences on the same information, significantly increasing the time and computational resources consumed, thus limiting its practicality.
[0042] The method of fusing models after parameter rearrangement requires rearranging the parameters of different models located in the same network layer to solve the point-to-point misalignment problem caused by large differences in parameters among multiple models to be fused. For example, if Model 1 uses the parameters of the first channel in the first network layer to extract edge features, and Model 2 uses the parameters of the third channel in the first network layer to extract edge features, then channels with consistent functions need to be aligned first (i.e., the first channel in the first network layer of Model 1 and the third channel in the first network layer of Model 2) before point-to-point parameter fusion. However, this method is generally used for training or testing data and cannot be implemented in real-world business scenarios. Furthermore, this method relies on significant misalignment between the models to be fused, but this problem is relatively minor in some scenarios. For example, in face recognition, since face recognition tasks are generally pre-trained on a large dataset and then fine-tuned on datasets for various sub-scenarios, the differences between face recognition models in different scenarios are generally small, and parameter channels do not need to be rearranged.
[0043] It is evident that while deep model fusion technology has demonstrated great potential, the fusion methods proposed in related technologies still have some shortcomings. Based on these issues, this application proposes a novel technical solution that can improve the recognition accuracy and reliability of the fused deep model, and can be applied to the recognition of various features (such as biometrics), while also reducing the occupation of storage space and excessive consumption of computing resources.
[0044] Specifically, such as Figure 1A As shown, in a system architecture 100 applying the technical solution of this application embodiment, it may include a terminal device 110, a network 120, and a server 130. The terminal device 110 may include smartphones, tablets, laptops, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The server 130 may be a server providing various services; it may be an independent physical server, a server cluster composed of multiple physical servers, or a distributed system. It may also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The network 120 may be a medium providing a communication connection between the terminal device 110 and the server 130, such as a wired communication link or a wireless communication link.
[0045] Depending on the implementation requirements, the system architecture in this embodiment can have any number of terminal devices 110, network 120, and server 130. For example, server 130 can be a server group composed of multiple server devices.
[0046] In one embodiment of this application, a user can use a terminal device 110 to send information to be identified to a server 130 via a network 120, such as a face image, a voice message to be identified, an image containing a palm print, or an image containing an iris. After receiving the information to be identified, the server 130 can use a feature recognition model to extract features from the information for recognition processing. After obtaining the recognition result, the server 130 can return the recognition result to the terminal device 110 via the network 120.
[0047] In a specific application scenario, such as Figure 1BAs shown, terminal device 110 can be a device for collecting palm print images, allowing users to make payments by scanning their palm prints. Specifically, when palm print image collection conditions are met, terminal device 110 can collect the user's palm print image; these conditions include, but are not limited to: the user's order being confirmed, the palm print image entry point being triggered, the palm print image registration operation being detected, and the camera capturing a collectable palm print image within the collection area, etc.
[0048] Terminal device 110 can send the collected palmprint image to server 130, so that server 130 can verify the palmprint image sent by terminal device 110 based on the registered palmprint information stored in the database; alternatively, terminal device 110 can also verify the collected palmprint image based on its own database. If server 130 determines that the palmprint image sent by terminal device 110 has a high similarity to the registered palmprint information stored in the database (e.g., similarity greater than or equal to 95%), then it can determine the account associated with the registered palmprint information and deduct funds from that account to complete the palmprint payment operation. Afterward, server 130 can return the palmprint payment result information to terminal device 110.
[0049] In another specific application scenario, such as Figure 1C As shown, a camera is installed on terminal device 110, which can capture facial images. In one example, if a user needs to log in to an online banking account, the camera on terminal device 110 can capture the user's facial image. Terminal device 110 can then send the captured facial image to server 130, so that server 130 verifies the facial image sent by terminal device 110 against the registered facial information stored in the database. If server 130 determines that the facial image sent by terminal device 110 has a high similarity to the registered facial information stored in the database (e.g., similarity greater than or equal to 98%), then the facial image verification is successful. Server 130 can then send the verification result back to terminal device 110 and identify the online banking account associated with the registered facial information, thus enabling the login to the online banking account.
[0050] It should be noted that the technical solutions of this application embodiment can be applied not only to the recognition of biometric features such as palm prints and faces, but also to the recognition of biometric features such as fingerprints, irises, and voiceprints, and can also be applied to the recognition of other organisms, such as animals or plants.
[0051] In one embodiment of this application, server 130 can improve the recognition accuracy of the biometric recognition model through model training, model parameter fusion, and other methods. Specifically, server 130 can acquire a training sample dataset containing biometric features, and then use the training sample dataset to train a machine learning model (such as a deep neural network model) to obtain an initial biometric recognition model.
[0052] After obtaining the initial biometric recognition model, the server 130 can use biometric sample datasets of at least two feature categories (if it is a face image, the sample data can be divided into multiple categories, with different categories corresponding to different face features, such as different age groups) to train the initial biometric recognition model respectively, thereby obtaining the trained models corresponding to these at least two feature categories. In this way, multiple trained models can be obtained. Since each trained model can learn the feature information of the corresponding feature category, these multiple trained models can learn diverse feature information. These feature information complement each other during the fusion process, making the final biometric recognition model more generalizable and adaptable when facing complex and varied feature data.
[0053] After obtaining the trained models corresponding to different feature categories, server 130 can perform a first fusion process on these trained models to obtain a fused model. Specifically, server 130 can determine a portion of the trained models based on the differences in parameter values of the first network layers of different trained models, and fuse the parameter values of the first network layers of these trained models to obtain a first fusion parameter value. Server 130 can then determine the fused model based on this first fusion parameter value, using it as the parameter value of the first network layer of the fused model. Afterwards, server 130 can perform a second fusion process with the initial biometric recognition model to obtain a final biometric recognition model, which can then respond to the recognition request from terminal device 110. This processing method can improve the generalization ability of the fused model by combining the parameter values of the first network layers of different trained models, thereby enhancing the accuracy and reliability of feature recognition. Furthermore, it avoids the problems of high processing burden and excessive redundant information associated with fusing all trained models.
[0054] Optionally, when server 130 determines a subset of trained models based on the differences in parameter values between the first network layers of different trained models, it can filter out trained models from the multiple trained models whose differences in parameter values between the first network layers exceed a set threshold. For example, it can filter out two trained models whose differences in parameter values between the first network layers exceed the set threshold. It should be noted that in the above embodiments, the first network layer can be one model network layer in the trained models, that is, the processing in the above embodiments can be performed on one model network layer in the trained models. Optionally, the first network layer can also be at least two model network layers in the trained models. In this case, similar processing in the above embodiments can be performed on each of these at least two model network layers, for example, similar processing can be performed on each model network layer in the trained models.
[0055] Optionally, the user can also send instructions to the server 130 through the terminal device 110 to control the processing of the biometric recognition model by the server 130. For example, the user can send biometric sample datasets of different feature categories to the server 130 through the terminal device 110, or the user can send instructions to the server 130 through the terminal device 110 to control the learning rate of the biometric recognition model, etc.
[0056] The implementation details of the technical solutions in the embodiments of this application are described in detail below:
[0057] Figure 2 A flowchart illustrating a method for updating a biometric identification model according to an embodiment of this application is shown. This method can be executed by an electronic device, which may be a server or other device. (Refer to...) Figure 2 As shown, the update method of this biometric recognition model includes at least S210 to S240, which are described in detail below:
[0058] In S210, the initial biometric recognition model is trained using biometric sample datasets corresponding to different feature categories to obtain multiple trained models. These multiple trained models include trained models corresponding to different feature categories, and each of the multiple trained models contains a first network layer.
[0059] In some optional embodiments, the biometric recognition model is a model for identifying identity, object type, etc., based on biometric features. For example, the biometric recognition model can utilize biometric features inside or on the surface of an organism, such as fingerprints, irises, facial features, palm prints, voiceprints, etc., to identify and verify an individual's identity. Optionally, in addition to identifying human identities, the biometric recognition model in this application can also be applied to identify other organisms, such as animals or plants.
[0060] In one application scenario, biometric recognition models can be used to identify individuals. For example, they can identify individuals by analyzing features such as fingerprint texture, ridges, and valleys, and then use this identification for tasks such as unlocking phones, access control, and attendance tracking. Alternatively, biometric recognition models can also utilize features such as texture, color, and shape in the iris for identification, and then be used in security and finance. Or, biometric recognition models can analyze facial contours, eyes, nose, and mouth features for identification, and then be used in smart cities, security monitoring, and phone unlocking. Alternatively, biometric recognition models can utilize palm print texture and lines for identification, and then be used in finance and healthcare. Finally, biometric recognition models can analyze voice pitch, timbre, and speech rate features for identification, and then be used in telephone banking, intelligent customer service, and voice payment.
[0061] In another application scenario, biometric recognition models can be used to identify animal breeds. For example, a dog's breed can be identified by analyzing its fur, color, size, head shape, and limb length. Alternatively, biometric recognition models can be used to identify plant categories. For instance, the shape, size, color, and texture of plant components such as leaves, flowers, fruits, seeds, and stems can be analyzed to identify the plant's category or name.
[0062] In some optional embodiments, the initial biometric recognition model is a biometric recognition model that needs to be optimized, and it can be any of the models mentioned in the above embodiments. Optionally, the initial biometric recognition model can be a pre-trained biometric recognition model. For example, in a face recognition scenario, an existing face dataset can be used to train a neural network model to obtain a biometric recognition model for face recognition, which is the initial biometric recognition model.
[0063] Optionally, the existing face datasets used in face recognition scenarios mentioned above can be the VGGFace2 dataset, the BUPT-Balancedface dataset, the RFW dataset, etc. The VGGFace2 dataset contains over 9,000 different individuals, totaling over 3.3 million face images. These images cover a wide range of poses, ages, and occupations, exhibiting high diversity. Each image in the VGGFace2 dataset provides detailed annotation information, including bounding boxes, facial landmarks (such as the positions of the eyes, nose, and mouth), and the individual's identity. Furthermore, VGGFace2 provides a set of pre-trained face recognition models trained on the dataset, which have achieved excellent performance on multiple benchmark tests.
[0064] The BUPT-Balancedface dataset aims to address the imbalanced face image problem. Therefore, it collects a large number of face images, ensuring a relatively balanced number of samples for each category. Training models on this dataset can improve their recognition performance across different categories. The RFW dataset is used to evaluate the performance of face recognition algorithms. It contains approximately 60,000 face images collected from the internet, exhibiting variations in pose, expression, lighting, and occlusion, thus possessing high realism and challenging characteristics.
[0065] In some optional embodiments, the biometric sample datasets corresponding to different feature categories can be subcategories of the fields in which the biometric recognition model is applied. This allows the initial biometric recognition model to be trained using biometric sample datasets of subcategories, so that the initial biometric recognition model can fully learn the sample feature information of different subcategories.
[0066] For example, if the initial biometric recognition model is the initial face recognition model, then the biometric sample datasets corresponding to different feature categories can be face sample datasets of at least two age groups. After training the initial face recognition model using these face sample datasets of at least two age groups, the trained models corresponding to each age group can be obtained. This enables the trained models corresponding to each age group to fully recognize the facial feature information of that age group.
[0067] For example, if the initial biometric recognition model is the initial face recognition model, then the biometric sample datasets corresponding to different feature categories can be face sample datasets of different genders, etc. After training the initial face recognition model using face sample datasets of different genders, we can obtain the trained models corresponding to different genders. This enables the trained models of different genders to fully recognize the facial feature information of that gender.
[0068] It's important to note that biometric recognition models typically consist of a backbone, neck, and head. The backbone is the core network used to extract biometric features; for example, ResNet18 or DarkNet53 can be used. The head is the detection head, or header file, which primarily uses the extracted biometric features to make predictions. The neck is positioned between the backbone and head, mainly to better utilize the biometric features extracted by the backbone. In biometric recognition models (such as deep learning-based biometric recognition models), the backbone extracts features, the neck further extracts more complex features, and then the head makes predictions based on the extracted features and outputs the prediction results.
[0069] In some optional embodiments, during the training of the initial biometric recognition model using biometric sample datasets corresponding to each feature category, the learning rate corresponding to the header file of the initial biometric recognition model can be gradually reduced from a first preset value, and the learning rate of the backbone network of the initial biometric recognition model can be controlled to be less than or equal to a second preset value. This embodiment's technical solution, by gradually reducing the learning rate corresponding to the header file of the biometric recognition model, enables the biometric recognition model to quickly capture the main features in the sample data during the initial training phase. Subsequently, as the learning rate gradually decreases, the parameters are finely adjusted, which helps the model converge to the optimal solution more smoothly, reducing the risk of oscillations and overfitting, improving the generalization ability of the biometric recognition model. Furthermore, gradually reducing the learning rate for fine-tuning also reduces unnecessary computational resource consumption, especially when training on large-scale datasets and complex models, where this efficiency improvement is particularly significant. By setting the learning rate of the backbone network of the biometric recognition model to be less than or equal to a second preset value, it is possible to effectively prevent the backbone network from over-adjusting the original good feature representations in the feature recognition model during training. This maintains the stability of the backbone network parameters, allowing the model to more effectively utilize pre-trained features while focusing on learning task-specific feature transformations, thus accelerating the training process and improving final performance. Therefore, this embodiment of the application, by finely controlling the learning rate of different parts of the biometric recognition model (header file and backbone network), can significantly reduce instability during model training, such as gradient explosion or vanishing gradients, making the training process more stable and controllable, and facilitating debugging and optimization.
[0070] In S220, a first fusion process is performed on multiple trained models to obtain a fused model.
[0071] In some optional embodiments, the first fusion process in S220 includes: fusing the parameter values of the first network layer of the partially trained model to obtain a first fusion parameter value; and determining a fusion model based on the first fusion parameter value, wherein the parameter values of the first network layer of the fusion model are the first fusion parameter value. The partially trained model is determined from multiple trained models based on the differences between the parameter values of the first network layer.
[0072] It should be noted that the first network layer can be one of the network layers in the trained model, such as a specified network layer in the trained model or a randomly selected network layer. Optionally, the first network layer can also be at least two network layers in the trained model. In this case, similar processing can be performed on each of these at least two network layers, for example, similar processing can be performed on each network layer in the trained model.
[0073] In some optional embodiments, when determining the undifferentiated post-trained models based on the differences between the parameter values of the first network layer, the trained models whose differences between the parameter values of the first network layer exceed a set threshold can be selected from the multiple obtained trained models. In this embodiment, by selecting trained models whose differences between the parameter values of the first network layer exceed the set threshold, the parameter values of the first network layers of the selected trained models can be combined to improve the generalization ability of the fused model, enhance the accuracy and reliability of feature recognition, and avoid the problems of high processing burden and excessive redundant information caused by fusing all trained models.
[0074] In some optional embodiments, two trained models whose parameter values of the first network layer differ by more than a set threshold can be selected from the multiple trained models. The parameter values of the first network layer of these two trained models are then fused to obtain the first fused parameter value in the example above. This embodiment's technical solution, by selecting and fusing parameter values from trained models corresponding to different feature categories whose parameter value differences exceed a set threshold, fully utilizes the complementary information contained in different feature categories. This helps overcome the information limitations that may arise from a single feature category, enabling the model to learn richer feature representations during training. This enhances the diversity and generalization ability of the fused model, allowing it to capture complex features in the data more comprehensively and accurately, thereby helping the model maintain high accuracy and robustness in complex and ever-changing data environments. Optionally, when selecting two trained models whose parameter values of the first network layer differ by more than a set threshold from the multiple trained models, the two trained models with the largest difference in parameter values of the first network layer can be selected from these multiple trained models. Alternatively, if the difference between the parameter values of the first network layer of two or more trained models exceeds a set threshold, then two trained models can be randomly selected, or other selection strategies can be used.
[0075] In some optional embodiments, to determine the differences between the parameter values of the first network layer, the similarity between the parameter values of the first network layer of different trained models can be calculated based on the parameter values of the first network layer of each of the multiple trained models. Then, the differences between the parameter values of the first network layer of different trained models can be determined based on the similarity between the parameter values of the first network layer. This embodiment's technical solution can accurately quantify the degree of difference between the parameter values of the trained models corresponding to different feature categories in the first network layer by calculating the similarity between parameter values. This quantification not only helps to identify parameter changes that significantly affect model performance but also provides reliable data support for subsequent parameter fusion or selection.
[0076] Optionally, the similarity between the parameter values of the first network layer can be calculated using cosine similarity. After calculating the cosine similarity, it can be converted into an angle value between the parameter values. Then, based on this angle value, the differences between the parameter values of the first network layer in different trained models can be determined. This embodiment converts cosine similarity into an angle value, making the differences between model parameters more intuitive and providing a basis for subsequent analysis and decision-making. Specifically, the angle value directly corresponds to the angle between the parameter vectors in space; the larger the angle, the greater the difference between the two parameter vectors, and vice versa. In this case, a trained model corresponding to a feature category can be selected as a benchmark model for comparison. Then, the angle value between the parameter values in the first network layer of other trained models corresponding to different feature categories and the benchmark model can be calculated. This allows the magnitude of the angle value to reflect the parameter differences between the various trained models.
[0077] In some optional embodiments, when determining a subset of trained models based on the differences in parameter values between the first network layers of different trained models, it is also possible to select trained models with differences in parameter values in the first network layer from those corresponding to at least two feature categories. In other words, the subset of trained models determined in this embodiment are those with differences in parameter values in the first network layer. In this embodiment, since trained models of different feature categories often capture unique features of specific data, fusing these parameters that differ in the first network layer can introduce diverse feature representations, enabling the fused model to understand the data more comprehensively. It can also effectively combine the information advantages of different models, thereby improving the model's generalization ability, robustness, and stability.
[0078] In some optional embodiments, when fusing the parameter values of the first network layer of the determined partially trained model, the parameter values of the first network layer of the determined partially trained model can be weighted and summed according to a set first weight value to obtain the first fused parameter value. This embodiment's technical solution, by introducing weight values for weighted summation, can flexibly adjust the contribution of the parameter values of the first network layer of different trained models in the fusion process. This strategy allows for the allocation of reasonable weights to different parameter values based on model performance, feature importance, or specific task requirements, thereby optimizing the fusion result and improving the overall model performance. Simultaneously, by setting weight values, it can be ensured that parameters that have a positive impact on model performance receive more attention during the fusion process, while parameters that contribute less to performance or may introduce noise are suppressed accordingly. This refined parameter fusion method helps improve the model's prediction accuracy and generalization ability. Optionally, for example, the determined part of the trained model can be two trained models with weights of 0.4 and 0.6 respectively (this is just an example; for example, it could also be 0.5 and 0.5, or 0.3 and 0.7, etc.). Then, the parameter values of the first network layer of the two trained models can be weighted and summed according to the weights of 0.4 and 0.6, and the result of the weighted summation can be used as the first fusion parameter value.
[0079] In some optional embodiments, when fusing the parameter values of the first network layer of the partially trained model, the parameter values of the first network layers of multiple trained models can first be clustered to obtain parameter values of the first network layer in multiple cluster categories. Then, from these multiple cluster categories of parameter values, parameter values of the first network layers in two cluster categories whose parameter values differ by more than a set threshold are selected, and then the parameter values of the first network layers in these two cluster categories are fused to obtain the first fused parameter value. The technical solution of this embodiment uses clustering operations to group similar parameter values in the first network layers of different trained models into one category, and then selects parameter values of the first network layers in two cluster categories whose parameter values differ by more than a set threshold for fusion processing. This ensures that similar parameter values can also be used in subsequent fusion, thereby realizing information sharing and complementarity between trained models, and thus enhancing the generalization ability of the subsequent fused model when facing new data and complex tasks.
[0080] Optionally, when selecting parameter values from the parameter values of the first network layers of multiple cluster categories that differ by more than a set threshold, the parameter values of the first network layers of the two cluster categories with the largest differences can be selected. When fusing the parameter values of the first network layers of the two selected cluster categories, a weighted summation can be performed according to set weight values (the specific weights can be set according to actual conditions, such as 0.6 and 0.4, or 0.5 and 0.5) to obtain the first fused parameter value.
[0081] In some optional embodiments, the process of determining the fusion model based on the first fusion parameter value can specifically be that the first fusion parameter value is used as the parameter value of the first network layer of the fusion model. This allows the parameter value of the first network layer of the fusion model to learn the parameter information in different trained models, thereby improving the accuracy and reliability of feature recognition.
[0082] In some optional embodiments, if multiple network layers in the trained model need to be fused, these multiple network layers can be fused in the same way as the first network layer. That is, each of these multiple network layers can be treated as the first network layer and processed in a manner similar to that described in the previous embodiments. Specifically, the portion of the trained model to be fused is first determined based on the differences between parameter values. Then, the parameter values of the determined portion of the trained model in the corresponding network layer are fused, and the fused parameter values of each network layer are used as the parameter values of the corresponding network layer in the fused model. However, to reduce computational load, in an optional embodiment of this application, the process of determining the portion of the trained model can be performed only once for network layers belonging to the same network module.
[0083] For example, after determining the part of the trained model whose parameter values of the first network layer need to be fused based on the differences in parameter values of the first network layer of different trained models, the parameter values of this part of the trained model in the second network layer can be fused to obtain the second fused parameter values. Wherein, the second network layer and the first network layer belong to the same network module, such as belonging to the same convolutional block. In this case, the parameter value fusion result of the first network layer (i.e., the first fused parameter value) can be used as the parameter value of the first network layer of the fused model, and the parameter value fusion result of the second network layer (i.e., the second fused parameter value) can be used as the parameter value of the second network layer of the fused model.
[0084] It should be noted that if there are multiple other network layers belonging to the same network module as the first network layer, then each of these network layers can be treated as the second network layer to perform a similar fusion process. This approach avoids the process of determining a partially trained model for each network layer (i.e., determining the trained model to be fused based on the differences in parameter values), effectively reducing the computational load.
[0085] Specifically, taking a convolutional block as an example, suppose a convolutional block contains several network layers: bias, running_mean, running_var, and weight. When fusing model parameters, the portion of the trained model that needs fusion can be determined based on the differences in the parameter values of the weight layer. Then, the parameter values of the weight layer of this portion of the trained model can be fused. Simultaneously, to reduce the computational cost of determining the trained model to be fused, the parameter values of the other network layers (i.e., bias, running_mean, and running_var layers) of this portion of the trained model determined by the weight layer parameter values can be directly fused, without increasing the computational cost and processing load by performing the determination process for different network layers within the same convolutional block.
[0086] It should be noted that bias refers to the bias term, which is an additional parameter for each neuron (or layer) in a neural network. It allows the model output to have a learnable offset before the activation function. In batch normalization layers, the bias parameter is used to add a learnable offset to the normalized output to ensure that the model can learn the appropriate output range.
[0087] `running_mean` refers to the running mean, a statistic maintained by the batch normalization layer during training to estimate the mean of the entire training set. In each training batch, the batch normalization layer calculates the mean of the current batch and updates `running_mean` using a momentum parameter to gradually approximate the mean of the entire dataset during training. During model inference (or testing), `running_mean` is used to normalize the input data.
[0088] `running_var` refers to the running variance. Similar to `running_mean`, `running_var` is a statistic maintained by the batch normalization layer during training to estimate the variance of the entire training set. `running_var` is also gradually updated during training via the momentum parameter and is used to normalize the input data during the model inference phase.
[0089] Weight refers to the connection strength between neurons in a neural network. In batch normalization layers, the weight parameter is used to scale the output after normalization and the addition of a bias term. This allows the model to learn whether the output needs to be scaled up or down after normalization to accommodate the input requirements of subsequent layers.
[0090] It should be noted that the network modules in the embodiments of this application can be divided according to the actual situation. For example, each convolutional block can be divided as a network module, or multiple convolutional blocks can be divided into one network module. In this case, the process of determining the model after partial training can also be performed on the network layers in multiple convolutional blocks belonging to the same network module.
[0091] Continue to refer to Figure 2 As shown, in S230, the fusion model and the initial biometric recognition model are subjected to a second fusion process to obtain the final biometric recognition model.
[0092] In some optional embodiments, the second fusion process between the fusion model and the initial biometric recognition model can be as follows: the parameter values of the fusion model and the initial biometric recognition model in the same network layer are fused to obtain the fusion parameter values corresponding to each network layer. Then, the final biometric recognition model is generated based on the fusion parameter values corresponding to each network layer. This embodiment's technical solution, by fusing the parameter values of the fusion model and the initial biometric recognition model in the same network layer, combines the advantages of both to ensure that the final biometric recognition model can learn richer feature representations, improving the recognition accuracy and robustness for complex features, and enhancing the performance of the final biometric recognition model when dealing with diverse and high-dimensional data.
[0093] In some optional embodiments, when fusing the parameter values of the fusion model and the initial biometric recognition model in the same network layer, the parameter values of the fusion model and the initial biometric recognition model in the same network layer can be weighted and summed according to a set second weight value to obtain the fusion parameters corresponding to each network layer. This embodiment's technical solution, by introducing weight values for weighted summation, can flexibly adjust the contribution of the fusion model and the initial biometric recognition model in the parameter fusion process. This strategy allows for the allocation of reasonable weights to the fusion model and the initial biometric recognition model based on model performance or specific task requirements, thereby optimizing the fusion result and improving the overall model's performance, prediction accuracy, and generalization ability. Optionally, for example, if the weight values corresponding to the fusion model and the initial biometric recognition model are 0.4 and 0.6 respectively (this is just an example; it could also be 0.5 and 0.5, or 0.3 and 0.7, etc.), then the parameter values of each network layer of the fusion model and the initial biometric recognition model can be weighted and summed according to weights of 0.4 and 0.6, and the result of the weighted summation is used as the parameter value of the corresponding network layer in the final biometric recognition model.
[0094] Figure 3 A flowchart illustrating a method for updating a biometric identification model according to an embodiment of this application is shown. This method can be executed by an electronic device, which may be a server or other device. (Refer to...) Figure 3 As shown, the update method of this biometric recognition model is in Figure 2 The steps shown in S210 to S230 may also include the following:
[0095] S310, Obtain the training sample dataset, and use the training sample dataset to train the machine learning model to obtain the initial biometric recognition model.
[0096] Optionally, the training sample dataset is associated with the application scenario of the biometric recognition model. For example, in the face recognition scenario, an existing sample dataset containing facial features can be used to train the neural network model to obtain a biometric recognition model for face recognition, which is the initial biometric recognition model.
[0097] After obtaining the initial biometric recognition model, further optimization can be performed through steps S210 to S230. The sample datasets corresponding to at least two feature categories are associated with the training sample dataset; that is, the sample datasets corresponding to these at least two feature categories represent subcategories within the domain to which the biometric recognition model is applied. This allows the initial biometric recognition model to be trained using sample datasets from these subcategories, enabling the model to fully learn the feature information of samples from different subcategories.
[0098] For example, in a face recognition scenario, the training sample dataset is a sample dataset containing facial features. The initial biometric recognition model is the initial face recognition model. The sample datasets corresponding to at least two feature categories can be, for example, face sample datasets of at least two age groups. After training the initial face recognition model using these face sample datasets of at least two age groups, the trained models corresponding to each age group can be obtained, thereby enabling the trained models of each age group to fully recognize the facial feature information of that age group.
[0099] based on Figure 3 In an optional embodiment of this application, the technical solution of the illustrated embodiment is referred to... Figure 4 As shown, a machine learning model can first be trained using a training sample dataset to obtain an initial biometric recognition model. Then, the initial biometric recognition model can be retrained using sample datasets corresponding to different feature categories to obtain a trained model. For example, using the sample dataset corresponding to feature category 1 to train the initial biometric recognition model yields trained model 1; using the sample dataset corresponding to feature category 2 to train the initial biometric recognition model yields trained model 2; and using the sample dataset corresponding to feature category n to train the initial biometric recognition model yields trained model n.
[0100] Afterwards, the multiple trained models can be subjected to a first fusion process to obtain a fused model. Specifically, the fusion process involves selecting trained models from these trained models whose differences in parameter values of the first network layer exceed a set threshold, obtaining the model to be fused corresponding to the first network layer, and then fusing the parameter values of the model to be fused corresponding to the first network layer in the first network layer to obtain the parameter value fusion result of the first network layer. The parameter value fusion result of the first network layer can then be used as the parameter value of the first network layer of the fused model.
[0101] Optionally, when filtering trained models whose parameter values differ from a set threshold, the trained models with differences in parameter values in the first network layer can be selected from these trained models to obtain the model to be fused corresponding to the first network layer; or all of these trained models can be used as the model to be fused corresponding to the first network layer, so that the parameter values of these trained models in the first network layer can be fused.
[0102] It should be noted that the first network layer can be one of the model network layers in the trained model, meaning that the processing described in the above embodiments can be performed on one of the model network layers in the trained model. Optionally, the first network layer can also be at least two model network layers in the trained model. In this case, similar processing described in the above embodiments can be performed on each of these at least two model network layers, for example, similar processing can be performed on each model network layer in the trained model.
[0103] Continue to refer to Figure 4 As shown, after obtaining the fusion model, a second fusion process can be performed between the fusion model and the initial biometric recognition model to obtain the final biometric recognition model. The specific fusion method can be found in the description of section S230 in the aforementioned embodiments.
[0104] Optionally, in one embodiment of this application, a fusion model can be directly used as the final biometric recognition model. This is because the fusion model is based on the parameter optimization of multiple trained models. Therefore, the fusion model can understand the data more comprehensively and can effectively combine the information advantages of different models. Thus, it also has strong generalization ability, robustness and stability.
[0105] The following section uses facial recognition as an example to further elaborate on the implementation details of the technical solution in the embodiments of this application.
[0106] In one embodiment of this application, the processing of the face recognition model can mainly include three processes: the training process of the face recognition model, the fusion process of fine-tuning the model, and the fusion process of the pre-trained model.
[0107] Specifically, during the training of a face recognition model, a machine learning model can be trained using a large dataset (such as VGGFace2). Then, the pre-trained face recognition model (which is the initial face recognition model) can be fine-tuned in various scenarios (different scenarios correspond to different facial feature categories, such as different age groups) to obtain multiple fine-tuned models (which are the trained models).
[0108] The pre-training process for the machine learning model involves inputting the training dataset into the model in batches to obtain loss values, and then using these loss values to update the model's weights until convergence. When designing the loss function for a face recognition model, since the loss function is designed to guide the model to obtain as similar feature representations as possible for faces with the same identity, while amplifying the feature differences between faces with different identities, one embodiment of this application can use ArcFace Loss as the loss function for the face recognition model.
[0109] When calculating the loss value of a face recognition model based on this loss function, a batch of face images can be input into the model, and the model can extract the features x of the face images. i , where i represents the real identity of the person in the face image. Then x is calculated. i The recognition head y corresponding to each identity category j Cosine similarity between j Finally, the loss value corresponding to the face image can be calculated using the following formula:
[0110]
[0111] In the above formula, N represents the total number of identity categories; m is a hyperparameter set to further reduce the feature differences between faces of the same identity category; s is a hyperparameter set to further increase the feature differences between faces of different identity categories; θ yi Used to represent x i and its corresponding real identity category y i The angle value between them, the larger the angle value, the stronger the x i and its corresponding real identity category y i The greater the difference between them, the smaller the difference will be.
[0112] In some optional embodiments, when fine-tuning the face recognition model, the model and loss function remain unchanged, but the learning rate can be controlled. Optionally, for the header file corresponding to the face recognition model, the learning rate can be controlled to gradually decrease from 0.1 to 0.0001; while the learning rate of the model backbone is generally controlled to not exceed 0.0001 or less, thereby maintaining the generalization ability obtained during pre-training to a certain extent. When fine-tuning the model using data from different scenarios (different scenarios correspond to different facial feature categories, such as different age groups), the same pre-trained model can be loaded, and the fine-tuning process can generally be completed after 6 to 8 training rounds.
[0113] During the fusion process of fine-tuned models, cosine similarity between pairwise parameters of multiple fine-tuned models can be calculated for each network layer. This similarity is then converted into angle values, and the two fine-tuned models with the largest angles are identified. The parameters of this network layer from these two models are then fused. This process is repeated for each network layer to obtain the final fused model.
[0114] Meanwhile, to maintain parameter alignment within the same convolutional block, the two fine-tuned models with the largest angles can be selected from a single network layer within the same convolutional block. The parameters of these two fine-tuned models in other network layers are then fused separately to obtain the parameter fusion results for those other network layers. For example, if a convolutional block contains bias, running_mean, running_var, and weight network layers, then during parameter fusion, the fine-tuning process can be performed only on the weight layer. The parameters of the selected fine-tuned models in the weight, bias, running_mean, and running_var layers are then fused separately. This yields the parameter fusion results for the weight, bias, running_mean, and running_var layers, avoiding the increased computational load and processing burden of individually selecting fine-tuned models for each network layer.
[0115] Specifically, to integrate the recognition capabilities of multiple scenarios (different scenarios correspond to different facial feature categories, such as different age groups) into a single model, it is necessary to find the parameters with the greatest fusion value. Specifically, this application measures the parameter differences of the same network layer in different fine-tuned models, then selects the two fine-tuned models with the greatest differences, and fuses the network layer parameters of these two models. The difference is defined as the angle values between the parameters (specifically, cosine similarity is first calculated, and then converted into angle values). Taking different facial feature categories corresponding to different age groups as an example, the angle relationships of the fine-tuned models for four age groups on a certain network layer parameter are as follows: Figure 5 As shown, the fine-tuning models corresponding to age group 1 and age group 4 have the largest angle values in the parameters of this network layer. Therefore, the parameters of the fine-tuning models corresponding to age group 1 and age group 4 in this network layer can be fused.
[0116] Alternatively, the angle value θ between parameters in the same network layer of the fine-tuning model can be calculated using the following formula:
[0117]
[0118] Where x1 and x2 represent the parameters of the two fine-tuned models in a certain network layer, and i represents each channel in that network layer. ||||2 represents the 2-norm calculation.
[0119] Alternatively, the parameters of the same network layer from the two fine-tuned models with the greatest differences can be fused using the following formula:
[0120] W 1st =λ*W1+(1-λ)*W2
[0121] Where λ represents the hyperparameters used during fusion, i.e., the weight values, which can be set to 0.5 or other values; W1 and W2 represent the parameters of the same network layer in the two fine-tuned models with the greatest differences; W 1st This represents the parameters of the fusion model at this network layer.
[0122] It should be noted that if the independence between multiple scenes (different scenes correspond to different facial feature categories, such as different age groups) is relatively obvious, then using the angle difference in the aforementioned embodiment to select the same network layer parameters of the two fine-tuning models with the greatest difference for fusion will achieve good results. However, in more complex data relationships, such as when the parameter changes of a certain scene are smaller than the parameter changes of another scene in each network layer, then the fine-tuning model parameters corresponding to that scene will not be used during fine-tuning model fusion, i.e., there is a risk that some or all scene information will be ignored. In this case, all fine-tuning models corresponding to all scenes can be clustered based on the model parameters of the same network layer. Then, based on the clustering results, fine-tuning models with close positions can be fused. After fusion, the technical solution in the aforementioned embodiment is followed, i.e., selecting the two models with the greatest difference based on the angle difference between the fused models, and then fusing the same layer parameters of these two models again, thereby ensuring that the information of each fine-tuning model is used.
[0123] In the process of fusing pre-trained models, the preliminary fusion model can be weighted and fused with the pre-trained model to obtain the final fusion model.
[0124] Specifically, pre-trained models are trained on large datasets. Compared to fine-tuned models, they utilize more data for training, resulting in more robust performance and better generalization. However, each fine-tuned model, in order to fit the data distribution of its respective scene (different scenes correspond to different facial feature categories, such as different age groups), generally compromises the generalization of the pre-trained model. Therefore, to ensure that the final fused model maintains as much generalization as possible from the original pre-trained model, the pre-trained model can be fused again after the fine-tuned models are fused, resulting in the final fused model.
[0125] Alternatively, the initial fusion model obtained by fusing the original pre-trained model and the fine-tuned model can be fused using the following formula:
[0126] W 2nd =α*W base +(1-α)*W 1st
[0127] Here, α represents the hyperparameter used during re-fusion, i.e., the weight value, which can be set to 0.3 or other values. W base W represents the parameters of a pre-trained model in a certain network layer. 1st W represents the parameters of the initial fusion model in this network layer. 2nd This represents the final fusion model.
[0128] It should be noted that in the above-mentioned face recognition application scenarios, the fine-tuning model selection and parameter fusion processing are performed on each network layer of the fine-tuning model. In other embodiments of this application, the fine-tuning model selection and parameter fusion processing can also be performed only on some network layers (such as a specified network layer). This application embodiment does not limit this.
[0129] Verification has shown that the embodiments of this application fuse multiple fine-tuned models, and the fused model can maintain the size of a single model without increasing storage resources or inference time. Furthermore, the fusion scheme proposed in these embodiments maintains the generalization ability of the pre-trained model and the performance of each fine-tuned model in various scenarios as much as possible, effectively improving the accuracy and reliability of feature recognition.
[0130] The following describes an embodiment of the apparatus described in this application, which can be used to execute the method for updating a biometric recognition model applied to feature recognition as described in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method for updating a biometric recognition model described above in this application.
[0131] Figure 6 A block diagram of a biometric model updating device according to an embodiment of this application is shown. The biometric model updating device can be applied to an electronic device, which may be a server or other devices.
[0132] Reference Figure 6 As shown, a biometric identification model updating device 600 according to an embodiment of this application includes: a training unit 602, a fusion unit 604, and a processing unit 606.
[0133] The training unit 602 is configured to train the initial biometric recognition model using biometric sample datasets corresponding to different feature categories, thereby obtaining multiple trained models. Each trained model includes a trained model corresponding to its respective feature category, and each trained model contains a first network layer. The fusion unit 604 is configured to perform a first fusion process on the multiple trained models to obtain a fusion model. The first fusion process includes: fusing the parameter values of the first network layers of a portion of the trained models to obtain first fusion parameter values. The portion of the trained models is determined from the multiple trained models based on the differences between the parameter values of the first network layers, and the fusion model is determined based on the first fusion parameter values. The parameter values of the first network layers of the fusion model are the first fusion parameter values. The processing unit 606 is configured to perform a second fusion process on the fusion model and the initial biometric recognition model to obtain a final biometric recognition model.
[0134] In some optional embodiments, the fusion unit 604 is configured to: select two trained models from the plurality of trained models whose difference between the parameter values of the first network layer exceeds a set threshold; and fuse the parameter values of the first network layer of the two trained models to obtain the first fused parameter value.
[0135] In some optional embodiments, the fusion unit 604 is configured to: perform a weighted summation of the parameter values of the first network layer of the partially trained model according to a set first weight value to obtain the first fusion parameter value.
[0136] In some optional embodiments, the fusion unit 604 is configured to: perform clustering processing on the parameter values of the first network layers of the plurality of trained models to obtain parameter values of the first network layers in a plurality of cluster categories; select parameter values of the first network layers of two cluster categories whose parameter values differ from the parameter values of the first network layers in the plurality of cluster categories by a set threshold; and fuse the parameter values of the first network layers of the two cluster categories to obtain the first fused parameter value.
[0137] In some optional embodiments, the fusion unit 604 is further configured to: calculate the similarity between the parameter values of the first network layers of different trained models based on the parameter values of the first network layers of the plurality of trained models; and determine the difference between the parameter values of the first network layers of different trained models based on the similarity between the parameter values of the first network layers.
[0138] In some optional embodiments, the similarity includes cosine similarity; the fusion unit 604 is further configured to: convert the cosine similarity between the parameter values of the first network layer into an angle value between the parameter values of the first network layer; and determine the difference between the parameter values of the first network layer of different trained models based on the angle value between the parameter values of the first network layer.
[0139] In some embodiments of this application, based on the foregoing scheme, the processing unit 606 is configured to: fuse the parameter values of the fusion model and the initial biometric recognition model in the same network layer to obtain the fusion parameter values corresponding to each network layer; and generate the final biometric recognition model according to the fusion parameter values corresponding to each network layer.
[0140] In some embodiments of this application, based on the foregoing scheme, the processing unit 606 is configured to: perform a weighted summation of the parameter values of the fusion model and the initial biometric recognition model in the same network layer according to a set second weight value, so as to obtain the fusion parameter values corresponding to each network layer.
[0141] In some embodiments of this application, based on the foregoing scheme, the fusion unit 604 is further configured to: for a second network layer belonging to the same network module as the first network layer, fuse the parameter values of the second network layer of the partially trained model to obtain a second fusion parameter value; determine the fusion model based on the first fusion parameter value and the second fusion parameter value, wherein the parameter value of the first network layer of the fusion model is the first fusion parameter value, and the parameter value of the second network layer of the fusion model is the second fusion parameter value.
[0142] In some embodiments of this application, based on the foregoing scheme, the training unit 602 is further configured to: acquire a training sample dataset containing biometric features; and use the training sample dataset to train a machine learning model to obtain the initial biometric recognition model.
[0143] In some embodiments of this application, based on the foregoing scheme, the training unit 602 is configured to: during the training of the initial biometric recognition model using biometric sample datasets corresponding to different feature categories, control the learning rate corresponding to the header file of the initial biometric recognition model to gradually decrease from a first set value, and control the learning rate of the backbone network of the initial biometric recognition model to be less than or equal to a second set value.
[0144] Figure 7 A schematic diagram of a computer system suitable for implementing the computer device of the present application is shown. The computer device may be a device for performing the biometric identification model update method described in the foregoing embodiments.
[0145] It should be noted that, Figure 7 The computer system 700 of the computer device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0146] like Figure 7 As shown, the computer system 700 may include a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes based on a program stored in Read-Only Memory (ROM) 702 or a program loaded from storage portion 708 into Random Access Memory (RAM) 703, such as performing the methods described in the above embodiments. The RAM 703 also stores various programs and data required for system operation. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0147] The following components can be connected to I / O interface 705: input section 706 including keyboard, mouse, etc.; output section 707 including cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; storage section 708 including hard disk, etc.; and communication section 709 including network interface card, modem, etc. Communication section 709 performs communication processing via a network such as the Internet. Drive 710 is also connected to I / O interface 705 as needed. Removable media 711, such as disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 710 as needed so that computer programs read from them can be installed into storage section 708 as needed.
[0148] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs various functions defined in the system of this application.
[0149] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a computer program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0150] 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. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains 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, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and a computer program.
[0151] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0152] In another aspect, this application also provides a computer-readable medium, which may be included in the computer device described in the above embodiments; or it may exist independently and not assembled into the computer device. The computer-readable medium carries one or more computer programs, which, when executed by the computer device, cause the computer device to perform the methods described in the above embodiments.
[0153] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0154] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computer device to execute the method according to the embodiments of this application. For example, the computer device can execute... Figure 2 or Figure 3 The method for updating the biometric recognition model is shown.
[0155] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0156] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for updating a biometric recognition model, characterized in that, include: The initial biometric recognition model is trained using biometric sample datasets corresponding to different feature categories to obtain multiple trained models. The multiple trained models include the trained models corresponding to each of the different feature categories, and each of the multiple trained models contains a first network layer. A first fusion process is performed on the multiple trained models to obtain a fused model. The first fusion process includes: The parameter values of the first network layer of the partially trained model are fused to obtain the first fused parameter value. The partially trained model is determined from the plurality of trained models based on the difference between the parameter values of the first network layer. Based on the first fusion parameter value, the fusion model is determined, and the parameter value of the first network layer of the fusion model is the first fusion parameter value; The fusion model is then combined with the initial biometric recognition model to obtain the final biometric recognition model.
2. The method for updating the biometric recognition model according to claim 1, characterized in that, The parameter values of the first network layer of the fused part of the trained model are used to obtain the first fused parameter values, including: From the plurality of trained models, select two trained models in which the difference between the parameter values of the first network layer exceeds a set threshold. The parameter values of the first network layer of the two trained models are fused to obtain the first fused parameter value.
3. The method for updating the biometric recognition model according to claim 1 or 2, characterized in that, The parameter values of the first network layer of the fused part of the trained model are used to obtain the first fused parameter values, including: The parameter values of the first network layer of the partially trained model are weighted and summed according to the set first weight value to obtain the first fusion parameter value.
4. The method for updating the biometric recognition model according to claim 1, characterized in that, The parameter values of the first network layer of the fused part of the trained model are used to obtain the first fused parameter values, including: Clustering is performed on the parameter values of the first network layer of the multiple trained models to obtain parameter values of the first network layer in multiple cluster categories; From the parameter values of the first network layer of the multiple cluster categories, filter out the parameter values of the first network layer of two cluster categories whose parameter values differ from a set threshold; The parameter values of the first network layer of the two clustering categories are fused to obtain the first fused parameter value.
5. The method for updating a biometric identification model according to any one of claims 1 to 4, characterized in that, Also includes: Based on the parameter values of the first network layer of each of the multiple trained models, calculate the similarity between the parameter values of the first network layer of the different trained models. Based on the similarity between the parameter values of the first network layer, the differences between the parameter values of the first network layer of different trained models are determined.
6. The method for updating the biometric recognition model according to claim 5, characterized in that, The similarity includes cosine similarity; based on the similarity between the parameter values of the first network layer, the differences between the parameter values of the first network layer in different trained models are determined, including: The cosine similarity between the parameter values of the first network layer is converted into the angle value between the parameter values of the first network layer. Based on the angle values between the parameter values of the first network layer, the differences between the parameter values of the first network layer of different trained models are determined.
7. The method for updating a biometric identification model according to any one of claims 1 to 6, characterized in that, The fusion model is then combined with the initial biometric recognition model to obtain the final biometric recognition model, including: The parameter values of the fusion model and the initial biometric recognition model in the same network layer are fused to obtain the fusion parameter values corresponding to each network layer. The final biometric recognition model is generated based on the fusion parameter values corresponding to each network layer.
8. The method for updating the biometric recognition model according to claim 7, characterized in that, The process of fusing the parameter values of the fusion model and the initial biometric recognition model in the same network layer includes: Based on the set second weight value, the parameter values of the fusion model and the initial biometric recognition model in the same network layer are weighted and summed to obtain the fusion parameter values corresponding to each network layer.
9. The method for updating a biometric identification model according to any one of claims 1 to 8, characterized in that, Also includes: For a second network layer that belongs to the same network module as the first network layer, the parameter values of the second network layer in the partially trained model are fused to obtain a second fused parameter value; Determining the fusion model based on the first fusion parameter value includes: The fusion model is determined based on the first fusion parameter value and the second fusion parameter value, wherein the parameter value of the first network layer of the fusion model is the first fusion parameter value, and the parameter value of the second network layer of the fusion model is the second fusion parameter value.
10. The method for updating a biometric identification model according to any one of claims 1 to 9, characterized in that, Also includes: Obtain a training sample dataset containing biological features; The machine learning model is trained using the training sample dataset to obtain the initial biometric recognition model.
11. The method for updating a biometric identification model according to any one of claims 1 to 10, characterized in that, The initial biometric recognition model was trained using biometric sample datasets corresponding to different feature categories, including: During the training of the initial biometric recognition model using biometric sample datasets corresponding to different feature categories, the learning rate corresponding to the header file of the initial biometric recognition model is controlled to gradually decrease from a first set value, and the learning rate of the backbone network of the initial biometric recognition model is controlled to be less than or equal to a second set value.
12. A device for updating a biometric recognition model, characterized in that, include: The training unit is configured to train the initial biometric recognition model using biometric sample datasets corresponding to different feature categories, thereby obtaining multiple trained models. The multiple trained models include the trained models corresponding to each of the different feature categories, and each of the multiple trained models contains a first network layer. A fusion unit is configured to perform a first fusion process on the plurality of trained models to obtain a fusion model. The first fusion process includes: fusing the parameter values of the first network layer of a portion of the trained models to obtain a first fusion parameter value, wherein the portion of the trained models is determined from the plurality of trained models based on the difference between the parameter values of the first network layer; and determining the fusion model based on the first fusion parameter value, wherein the parameter values of the first network layer of the fusion model are the first fusion parameter value. The processing unit is configured to perform a second fusion process on the fusion model and the initial biometric recognition model to obtain the final biometric recognition model.
13. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method for updating the biometric identification model according to any one of claims 1 to 11.
14. A computer device, characterized in that, include: One or more processors; A memory for storing one or more computer programs that, when executed by one or more processors, cause the computer device to implement the method for updating the biometric identification model according to any one of claims 1 to 11.
15. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium, wherein a processor of a computer device reads from the computer-readable storage medium and executes the computer program, causing the computer device to perform the method for updating the biometric identification model according to any one of claims 1 to 11.