Knowledge migration method and system for rapid updating of face recognition system
Through the knowledge migration method, distillation technology is used to transfer the knowledge of the old version of the face recognition model to the new version of the model, solving the huge training expenses when updating the face recognition system, and achieving rapid updates and efficient training.
Patent Information
- Application Number
- CN202411844210.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-29
AI Technical Summary
The existing facial recognition system needs to be retrained when updated, resulting in huge training expenses and hindering the rapid upgrade and development of the system.
A knowledge transfer method is proposed to transfer the knowledge of the old version of the model to the new version of the model through secondary knowledge distillation, reducing the training time. The specific steps include obtaining the face sample dataset, building a distillation label vector, preheating a new version of the model, and optimizing the new version of the model through distillation branches and main branches.
It realizes rapid update of the face recognition system, shortens the training time, reduces the update cost, and ensures the stability of recognition performance.
Smart Images

Figure CN119904899A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of face recognition technology, and in particular to a knowledge migration method and system for rapid updating of a face recognition system. Background Art
[0002] The mainstream high-performance face recognition systems today are all based on deep learning models. They convert properly processed face images into face feature vectors, and then compare different face feature vectors to calculate cosine similarity. When the similarity is higher than the set threshold, it indicates that the two faces belong to the same person. Otherwise, it indicates that the two faces do not belong to the same person. The key to the reliable operation of face recognition systems based on deep learning models is large-scale and sophisticated model training optimization, which requires the input of massive labeled face data and is based on excellent face recognition loss functions. The performance of the model is improved through a sufficient number of iterations. On the other hand, the technology related to face recognition systems is developing very rapidly. Better machine vision network structures are constantly being proposed, from the initial convolutional neural network (CNN) to the visual transformer network (ViT), and then to a composite structure network that integrates multiple networks. Each upgrade of the network structure may bring about an upgrade in the capabilities of the face recognition system; better loss functions are also constantly being constructed, from the initial contrast loss to various variants of classification losses such as Cosface and ArcFace. Each update of the training loss may bring about an improvement in the applicability and reliability of the face recognition system. At present, the facial recognition system that uses the latest technology has recognition capabilities far higher than the average human level, and has been widely used in finance, security, intelligent management and other fields.
[0003] The rapid development of face recognition and machine vision technology has put forward high requirements for the rapid replacement of systems. In the current mainstream solutions, whether it is to modify the network structure, replace the loss function, or add new face training data, the model must be re-trained completely to achieve the best results. The difficulty of this approach is that the training cost of face recognition models is extremely large, and excellent systems are often optimized based on millions or even tens of millions of different identity IDs. With such a large amount of data, it takes one to several months to optimize the model even on a high-performance server with multiple GPUs. It is very likely that the model has not yet completed training, and newer and better technical solutions have been proposed by researchers. It is precisely this high training cost that hinders the rapid upgrade and development of face recognition systems. Summary of the invention
[0004] In view of the technical problems in the prior art, in order to reduce the update cost of the face recognition system and accelerate the training of the model, we proposed a new method to transfer the knowledge learned from the old version of the model to the new version of the model through secondary knowledge distillation, thereby significantly reducing the training time and ensuring the rapid update of the face recognition system.
[0005] According to one aspect of the present invention, a knowledge transfer method for fast updating of a face recognition system is proposed, comprising the following steps:
[0006] S1, obtaining a face sample data set, wherein the face sample data set includes face sample image data and corresponding face ID data, and the face sample data set is input into a pre-trained old version face recognition model to construct a corresponding distilled label vector;
[0007] S2, preheating the new version of face recognition model, the new version of face recognition model includes a backbone network for extracting face features and a main branch, the main branch includes an ID classification layer for predicting face ID, the backbone network includes multiple layers of transformer layers, the face sample data set is input into the new version of face recognition model, and a distillation tag vector is input into the first transformer layer at the same time, the new version of face recognition model adds a distillation branch, and the distillation tag vector processed by the multiple layers of transformer layers is input into the distillation branch and the main branch respectively;
[0008] S3, the distillation branch maps the processed distillation mark vector to the distillation label vector dimension, outputs the distillation feature, and calculates the distillation loss function based on the distillation feature and the distillation label vector;
[0009] S4, the main branch performs face ID prediction on the extracted face features through the ID classification layer and calculates the main branch loss function;
[0010] S5, optimizing the new version of the face recognition model based on the distillation loss function and the main branch loss function.
[0011] Preferably, S1 further comprises performing face alignment preprocessing on the face sample data set using a RetinaFace face key point detection algorithm.
[0012] Preferably, the old version of the face recognition model includes an ID classification layer and a backbone network for extracting facial features. When the old version of the face recognition model is pre-trained using the face sample data set, the weight matrix obtained by processing the ID classification layer of the old version of the face recognition model is used for L2 normalization to construct the distilled label vector; when the face sample data set includes face sample data that has not been trained with the old version of the face recognition model, the facial features of the face sample image data are extracted through the backbone network, and then the mean of each facial feature is calculated and normalized into a unit vector to construct the distilled label vector.
[0013] Preferably, the distillation loss function L in S3 dist It is expressed as:
[0014] L dist =∑-Z×log(softmax(arcsin(D×Y T )))
[0015] Where D is a B×N dimensional distilled feature matrix, B is the number of face sample data in each training batch, N is the feature dimension, Y is a B×N dimensional distilled label vector matrix, and Z is an N×N dimensional binary matrix. The value of the i-th row and j-th column records whether the i-th face sample in D and the j-th face sample in Y belong to the same ID. If yes, it is equal to 1, otherwise it is equal to 0.
[0016] Preferably, the main branch loss function L in S4 is main It is expressed as:
[0017]
[0018] Where s and m are positive constants, is the vector angle between the i-th face sample feature extracted by the new version of the face recognition model through the backbone network and the corresponding ID category feature, and θ is the vector angle between the face sample feature and the j-th ID category feature.
[0019] Further preferably, S5 specifically includes weighted addition of the distillation loss function and the main branch loss function, and optimizing the new version of the face recognition model based on the final loss function L, where L=L main +λ·L dist , λ is the weighting coefficient.
[0020] More preferably, λ is 0.05.
[0021] According to one aspect of the present invention, a knowledge transfer system for rapid updating of a face recognition system is proposed, comprising:
[0022] A distillation label construction module: obtains a face sample data set, wherein the face sample data set includes face sample image data and corresponding face ID data, and the face sample data set is input into a pre-trained old version face recognition model to construct a corresponding distillation label vector;
[0023] New version model training module: preheating the new version face recognition model, the new version face recognition model includes a backbone network and a main branch for extracting face features, the main branch includes an ID classification layer for predicting face ID, the backbone network includes multiple layers of transformer layers, the face sample data set is input into the new version face recognition model, and the distillation tag vector is input into the first transformer layer at the same time, the new version face recognition model adds a distillation branch, and the distillation tag vector processed by the multiple layers of transformer layers is input into the distillation branch and the main branch respectively;
[0024] Distillation branch optimization module: the distillation branch maps the processed distillation tag vector to the distillation label vector dimension, outputs the distillation feature, and calculates the distillation loss function based on the distillation feature and the distillation label vector;
[0025] Main branch optimization module: the main branch predicts the face ID of the extracted face features through the ID classification layer and calculates the main branch loss function;
[0026] New version model optimization module: optimizes the new version face recognition model based on the distillation loss function and the main branch loss function.
[0027] According to one aspect of the present invention, a computer program product is provided, on which a computer program is stored. When the computer program is executed by a processor, the method according to any one of the first aspects is implemented.
[0028] According to one aspect of the present invention, a computing system is provided, including a processor and a memory, wherein the processor is configured to execute the method as described in any one of the first aspects.
[0029] The method provided by the present invention gives distillation labels through the old version of the face recognition model, and performs two distillations with the distillation branch and the main branch, which can help engineers of the face recognition system to quickly update the system, ensure the advancement of the face recognition system, and save valuable time and computing resources for corresponding researchers. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.
[0031] Figure 1 A schematic flow chart of a knowledge transfer method for rapid updating of a face recognition system according to the present invention is shown;
[0032] Figure 2 A schematic diagram of the structure and training process of a face recognition model in an embodiment of the present invention is shown;
[0033] Figure 3 A schematic diagram of the model structure and training process after the distillation branch is introduced in an embodiment of the present invention is shown;
[0034] Figure 4 A schematic structural diagram of a knowledge transfer system for rapid updating of a face recognition system according to the present invention is shown.
[0035] Figure 5 It is a schematic diagram of the structure of a computer device suitable for implementing the electronic device of the embodiment of the present invention. DETAILED DESCRIPTION
[0036] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0037] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0038] like Figure 1 As shown, a knowledge transfer method for fast updating of face recognition system is proposed, which includes:
[0039] S1, obtaining a face sample data set, wherein the face sample data set includes face sample image data and corresponding face ID data, and the face sample data set is input into a pre-trained old version face recognition model to construct a corresponding distilled label vector;
[0040] S2, preheating the new version of face recognition model, the new version of face recognition model includes a backbone network for extracting face features and a main branch, the main branch includes an ID classification layer for predicting face ID, the backbone network includes multiple layers of transformer layers, the face sample data set is input into the new version of face recognition model, and a distillation tag vector is input into the first transformer layer at the same time, the new version of face recognition model adds a distillation branch, and the distillation tag vector processed by the multiple layers of transformer layers is input into the distillation branch and the main branch respectively;
[0041] S3, the distillation branch maps the processed distillation mark vector to the distillation label vector dimension, outputs the distillation feature, and calculates the distillation loss function based on the distillation feature and the distillation label vector;
[0042] S4, the main branch predicts the extracted facial features through the ID classification layer to calculate the main branch loss function;
[0043] S5, optimizing the new version of the face recognition model based on the distillation loss function and the main branch loss function.
[0044] In a specific embodiment, S1 also includes using the RetinaFace face key point detection algorithm to perform face alignment preprocessing on the face sample data set. This is done by first using the RetinaFace face key point detection algorithm to obtain face key points of the face sample image data, then obtaining face key points of the face sample image data center, calculating a similarity transformation matrix based on manually preset key points and performing a similarity transformation, and aligning the above face key points to the target position.
[0045] In a specific embodiment, the old version of the face recognition model includes an ID classification layer and a backbone network for extracting face features, and its training process is as follows: Figure 2 As shown in the figure. After inputting the image training data, the old face recognition model extracts the corresponding face features through the backbone network. The ID classification layer is a fully connected layer, and the face ID is predicted based on the extracted face features. Finally, the loss function is calculated based on the face ID label corresponding to the input image training data and the predicted face ID. The backbone network and ID classification layer parameters of the training model are optimized through the loss function. During the optimization process, the learning rate increases linearly from 0 to the preset value.
[0046] The distilled label vector represents the distribution of facial features learned by the old face recognition model. When the face sample data set used for pre-training of the old face recognition model is consistent with the face sample data set used for training of the new face recognition model, the weight matrix obtained by processing the ID classification layer of the old face recognition model is used to perform L2 normalization to construct the distilled label vector. The ID classification layer is composed of multiple layers of fully connected layers. The obtained weight matrix represents the central features of each category. The matrix dimension is generally C×D, where C is the number of categories in the training set and D is the model feature dimension. In this implementation, the value is 512. Each row vector corresponds to the central feature of a class of face sample images, and the arrangement order is consistent with the order of the training set categories. The weight matrix obtained after L2 normalization of each row vector of the weight matrix can be used as the distilled label vector of the corresponding face ID. L2 normalization is a common vector normalization method, and the process is to divide each element of each row vector of the weight matrix by the L2 norm of each row vector.
[0047] When the face sample data set used for pre-training of the old version of the face recognition model is inconsistent with the face sample data set used for training of the new version of the face recognition model, the face features extracted by the old version of the face recognition model through the backbone network are mean calculated and normalized into unit vectors to construct the distilled label vector.
[0048] The preheating process of the new face recognition model is the same as the pre-training process of the old face recognition model, but the model is only preheated and trained under the training data set of the face sample data set. This process often accounts for about 10% of the total number of update iterations.
[0049] After the model is preheated, the model structure is added to the new version of the face recognition model. The process is as follows Figure 3 As shown, an additional token is added to the input of the first transformer layer, called the distilled token vector, which functions similarly to the category tag in traditional classification tasks. The distilled tag consists of a trainable vector, which is assigned an initial value by a random number. The dimension of the distilled token vector is the same as other tags converted from patches of facial images. They will be input into the transformer layer together and propagate forward. At the output of the last transformer layer, the distilled token vector is cut out and cloned into two branches. One is the main branch, and the distilled token vector and the transformed tags processed by other backbone network structures enter the subsequent structure of the backbone network together, participate in the feature extraction of the model, and calculate the cosine similarity of facial features and various categories of the training set through the ID classification layer, and finally optimize through the main branch loss function. The main branch loss function L described in S4 main It is expressed as:
[0050]
[0051] Where s and m are positive constants, is the vector angle between the i-th face sample feature extracted by the new version of the face recognition model through the backbone network and the corresponding ID category feature, and θ is the vector angle between the face sample feature and the j-th ID category feature.
[0052] After the distilled label vector is input into the distillation branch, it passes through one or two fully connected layers to map the corresponding result of the distilled label vector calculated by the backbone network to the distilled label dimension, so as to be decoupled from the main branch and independent of the output feature distribution of the main branch. Finally, the output of the distillation branch is normalized to a unit vector for optimization, and the difference between the distilled features output by the distillation branch and the distilled label vector is calculated to optimize the network.
[0053] There is no strict restriction on the selection of distillation loss function, and the traditional mean square error can also achieve significant results. The method proposed in this invention constructs a more stable and reliable distillation loss function for this task. dist It is expressed as:
[0054] L dist =∑-Z×log(softmax(arcsin(D×Y T )))
[0055] Where D is a B×N dimensional distilled feature matrix, B is the number of face sample data in each training batch, N is the feature dimension, Y is a B×N dimensional distilled label vector matrix, and Z is an N×N dimensional binary matrix. The value of the i-th row and j-th column records whether the i-th face sample in D and the j-th face sample in Y belong to the same ID. If yes, it is equal to 1, otherwise it is equal to 0.
[0056] Finally, the distillation loss function and the main branch loss function are weightedly added, and the new version of the face recognition model is optimized based on the final loss function L, where L = L main +λ·L dist , λ is the weighting coefficient.
[0057] In one embodiment, λ is 0.05.
[0058] During the optimization process, the learning rate is linearly reduced from the set value to 0, and the model training is finally completed.
[0059] In order to demonstrate how the distillation training scheme proposed in the present invention improves the final performance of the model, the experiment compares the model recognition results of the original model, the recognition results of a new model containing a distillation branch trained after providing a distillation label based on the original model (hereinafter referred to as the distillation model), and the recognition results of a second distillation (hereinafter referred to as the secondary distillation model) after providing a distillation label based on the original model.
[0060] The test results on business data for four different application scenarios are shown in Table 1 below. The comparison models all use the same structure and the same training settings. The only difference is that the original model does not enable the distillation branch for training. The latter two models have different distillation labels. The evaluation indicators are Rank1 and Tar@1e-4. The former evaluates the model's ability to match the same person's identity, and the latter evaluates the model's ability to correctly distinguish different people.
[0061] Table 1 Performance of the distillation-based model compared with the original model on multiple test sets
[0062]
[0063] Compared with previous training schemes, the face recognition system training and updating scheme of the present invention shortens the time for training a new model from scratch by 50%, and performs better than the other two training methods on various test sets. This method not only ensures training efficiency, but also takes into account the stability of recognition performance.
[0064] According to one aspect of the present invention, a knowledge transfer system for rapid updating of a face recognition system is proposed, comprising:
[0065] A distillation label construction module 401: obtaining a face sample data set, wherein the face sample data set includes face sample image data and corresponding face ID data, and the face sample data set is input into a pre-trained old version face recognition model to construct a corresponding distillation label vector;
[0066] New version model training module 402: preheating the new version face recognition model, the new version face recognition model includes a backbone network for extracting face features and a main branch, the main branch includes an ID classification layer for predicting face ID, the backbone network includes multiple layers of transformer layers, the face sample data set is input into the new version face recognition model, and a distillation tag vector is input into the first transformer layer at the same time, the new version face recognition model adds a distillation branch, and the distillation tag vector processed by the multiple layers of transformer layers is input into the distillation branch and the main branch respectively;
[0067] Distillation branch optimization module 403: the distillation branch maps the processed distillation mark vector to the distillation label vector dimension, outputs the distillation feature, and calculates the distillation loss function based on the distillation feature and the distillation label vector;
[0068] Main branch optimization module 404: the main branch predicts the extracted facial features through the ID classification layer to calculate the main branch loss function;
[0069] New version model optimization module 405: optimizes the new version face recognition model based on the distillation loss function and the main branch loss function.
[0070] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 suitable for implementing an electronic device of an embodiment of the present application. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0071] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which performs various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 509 into a random access memory (RAM) 504. In the RAM 504, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, the ROM 503, and the RAM 504 are connected to each other via a bus 505. An input / output (I / O) interface 506 is also connected to the bus 505.
[0072] The following components are connected to the I / O interface 506: an input section 507 including a keyboard, a mouse, etc.; an output section 508 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 509 including a hard disk, etc.; and a communication section 510 including a network interface card such as a LAN card, a modem, etc. The communication section 510 performs communication processing via a network such as the Internet. A drive 511 is also connected to the I / O interface 506 as needed. A removable medium 512, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 511 as needed so that a computer program read therefrom is installed into the storage section 509 as needed.
[0073] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart is implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program is downloaded and installed from the network through the communication part 510, and / or installed from the removable medium 512. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the method of the present application are executed.
[0074] It should be noted that the computer-readable storage medium of the present application is a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium is, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium is any tangible medium containing or storing a program that is used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium includes a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal takes a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium is any computer-readable storage medium other than a computer-readable storage medium that sends, propagates or transmits a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium is transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0075] Computer program code for performing the operations of the present application is written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code is executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer is connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or is connected to an external computer (e.g., via the Internet using an Internet service provider).
[0076] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram represents a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession are actually executed substantially in parallel, and they are sometimes also executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, are implemented by a dedicated hardware-based system that performs the specified function or operation, or are implemented by a combination of dedicated hardware and computer instructions.
[0077] The modules involved in the embodiments of the present application are implemented by software and hardware.
[0078] As another aspect, the present application also provides a computer-readable storage medium, which is included in the electronic device described in the above embodiment; it also exists independently and is not assembled into the electronic device. The above computer-readable storage medium carries one or more programs. When the above one or more programs are executed by the electronic device, the electronic device performs: S1, obtaining a face sample data set, the face sample data set includes face sample image data and corresponding face ID data, the face sample data set is input into the pre-trained old version face recognition model to construct a corresponding distilled label vector; S2, preheating the new version face recognition model, the new version face recognition model includes a backbone network for extracting face features and a main branch, the main branch includes an ID classification layer for predicting face ID, the backbone network includes multiple layers of transformer layers, the face sample data set is input into the new version face recognition model type, and input the distilled label vector into the first transformer layer at the same time, the new version of the face recognition model adds a distillation branch, and inputs the distilled label vector processed by the multiple transformer layers into the distillation branch and the main branch respectively; S3, the distillation branch maps the processed distilled label vector to the distillation label vector dimension, outputs the distillation feature, and calculates the distillation loss function based on the distillation feature and the distillation label vector; S4, the main branch predicts the face ID of the extracted face features through the ID classification layer and calculates the main branch loss function; S5, optimizes the new version of the face recognition model based on the distillation loss function and the main branch loss function.
[0079] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims
1. A knowledge transfer method for rapid updating of a face recognition system, characterized in that: The following steps are involved: S1, obtaining a face sample data set, wherein the face sample data set includes face sample image data and corresponding face ID data, and the face sample data set is input into a pre-trained old version face recognition model to construct a corresponding distilled label vector; S2, preheating the new version of face recognition model, the new version of face recognition model includes a backbone network for extracting face features and a main branch, the main branch includes an ID classification layer for predicting face ID, the backbone network includes multiple layers of transformer layers, the face sample data set is input into the new version of face recognition model, and a distillation tag vector is input into the first transformer layer at the same time, the new version of face recognition model adds a distillation branch, and the distillation tag vector processed by the multiple layers of transformer layers is input into the distillation branch and the main branch respectively; S3, the distillation branch maps the processed distillation mark vector to the distillation label vector dimension, outputs the distillation feature, and calculates the distillation loss function based on the distillation feature and the distillation label vector; S4, the main branch performs face ID prediction on the extracted face features through the ID classification layer and calculates the main branch loss function; S5, optimizing the new version of the face recognition model based on the distillation loss function and the main branch loss function.
2. A knowledge transfer method for rapid updating of a face recognition system according to claim 1, characterized in that: S1 also includes performing face alignment preprocessing on the face sample data set using the RetinaFace face key point detection algorithm.
3. A knowledge transfer method for rapid updating of a face recognition system according to claim 1, characterized in that: The old version of the face recognition model includes an ID classification layer and a backbone network for extracting facial features. When the old version of the face recognition model is pre-trained using the face sample data set, the weight matrix obtained by processing the ID classification layer of the old version of the face recognition model is used for L2 normalization to construct the distilled label vector; when the face sample data set includes face sample data that has not been trained by the old version of the face recognition model, the facial features of the face sample image data are extracted through the backbone network, and then the mean of each facial feature is calculated and normalized into a unit vector to construct the distilled label vector.
4. A knowledge transfer method for rapid updating of a face recognition system according to claim 1, characterized in that: The distillation loss function L described in S3 dist It is expressed as: L dist =∑-Z×log(softmax(arcsin(D×Y T ))) Where D is a B×N dimensional distilled feature matrix, B is the number of face sample data in each training batch, N is the feature dimension, Y is a B×N dimensional distilled label vector matrix, and Z is an N×N dimensional binary matrix. The value of the i-th row and j-th column records whether the i-th face sample in D and the j-th face sample in Y belong to the same ID. If yes, it is equal to 1, otherwise it is equal to 0.
5. A knowledge transfer method for rapid updating of a face recognition system according to claim 1, characterized in that: The main branch loss function L described in S4 main It is expressed as: Where s and m are positive constants, is the vector angle between the i-th face sample feature extracted by the new version of face recognition model through the backbone network and the corresponding ID category feature, θ j is the vector angle between the face sample feature and the jth ID category feature.
6. A knowledge transfer method for rapid updating of a face recognition system according to claim 4 or 5, characterized in that: S5 specifically includes weighted addition of the distillation loss function and the main branch loss function, and optimizing the new version of the face recognition model based on the final loss function L, where L=L main +λ·L dist , λ is the weighting coefficient.
7. A knowledge transfer method for rapid updating of a face recognition system according to claim 6, characterized in that: λ is taken as 0.
05.
8. A knowledge transfer system for rapid updating of face recognition system, characterized in that: include: A distillation label construction module: obtains a face sample data set, wherein the face sample data set includes face sample image data and corresponding face ID data, and the face sample data set is input into a pre-trained old version face recognition model to construct a corresponding distillation label vector; New version model training module: preheating the new version face recognition model, the new version face recognition model includes a backbone network and a main branch for extracting face features, the main branch includes an ID classification layer for predicting face ID, the backbone network includes multiple layers of transformer layers, the face sample data set is input into the new version face recognition model, and the distillation tag vector is input into the first transformer layer at the same time, the new version face recognition model adds a distillation branch, and the distillation tag vector processed by the multiple layers of transformer layers is input into the distillation branch and the main branch respectively; Distillation branch optimization module: the distillation branch maps the processed distillation tag vector to the distillation label vector dimension, outputs the distillation feature, and calculates the distillation loss function based on the distillation feature and the distillation label vector; Main branch optimization module: the main branch predicts the face ID of the extracted face features through the ID classification layer and calculates the main branch loss function; New version model optimization module: optimizes the new version face recognition model based on the distillation loss function and the main branch loss function.
9. A computer program product having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 7.
10. A computing system comprising a processor and a memory, wherein the processor is configured to execute the method according to any one of claims 1 to 7.