Knowledge distillation training method based on offline features and system and model thereof
By employing an offline feature knowledge distillation training method, the problem of slow training of lightweight models is solved, achieving efficient training and improving student model performance. This method is applicable to scenarios such as edge-side face recognition.
Patent Information
- Application Number
- CN202111579692.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2041-12-22
AI Technical Summary
In existing biometric technologies, the training process of lightweight models is slow due to the need for multiple iterations and the time-consuming online feature extraction, which fails to meet the needs of practical applications.
The knowledge distillation training method using offline features is adopted. Before training, features are extracted and saved from the image dataset of the teacher model. Offline features are stored in an offline database. During training, offline features are directly read for knowledge distillation, skipping the time-consuming online feature calculation process. Combined with online data augmentation and feature correction, the training efficiency is improved.
It significantly shortens training time, enables plug-and-play functionality, improves the performance of student models, and can outperform teacher models in specific scenarios, thereby enhancing the testing effectiveness of face verification.
Smart Images

Figure CN116416652B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of biometrics, and in particular to a knowledge distillation training method, system, and model based on offline features. Background Technology
[0002] Currently, while biometric technologies such as facial recognition are widely used in security, financial payments, and smart locks, the increasing prevalence of these applications has led to growing concerns about the security of biometric data. Taking facial recognition as an example, edge-based facial recognition, by confining facial data to the edge environment, inherently possesses a greater advantage in protecting facial data security. However, due to the limited computing power of edge chips, lightweight feature extraction models are often used. Generally, since training a lightweight model directly from scratch rarely yields ideal results, the industry often employs knowledge distillation for training. This involves using multiple heavyweight models as teacher models and employing ensemble learning to distill knowledge from the lightweight model—a highly effective training method. However, in actual R&D, it has been found that forwarding multiple heavyweight models is extremely time-consuming, resulting in very slow training of the lightweight model and failing to meet the application requirements of real-world scenarios. Summary of the Invention
[0003] One advantage of this invention is that it provides a knowledge distillation training method, system, and model based on offline features, which can achieve efficient and rapid knowledge distillation and significantly shorten training time.
[0004] Another advantage of the present invention is that it provides a knowledge distillation training method, system and model based on offline features. In one embodiment of the present invention, the knowledge distillation training method based on offline features can use online loading of offline features to replace time-consuming online feature calculation through graphics cards, so as to skip the time-consuming calculation process of generating features by the integrated model during the training of student models, thereby greatly accelerating the training process.
[0005] Another advantage of the present invention is that it provides a knowledge distillation training method, system and model based on offline features. In one embodiment of the present invention, the knowledge distillation training method based on offline features can use the teacher model to perform angular distillation on the features generated by the student model. It not only combines the characteristics of existing face recognition loss functions for feature angles, but also has a very simple implementation and low computational complexity, so as to achieve a plug-and-play effect.
[0006] Another advantage of the present invention is that it provides a knowledge distillation training method, system and model based on offline features. In one embodiment of the present invention, the knowledge distillation training method based on offline features can correct the sample features of incorrect acceptance and incorrect rejection of the teacher model, avoid the defects of the teacher model, and help to improve the upper limit of the student model's performance to a certain extent, so that the final performance of the student model is expected to exceed that of the teacher model.
[0007] Another advantage of the present invention is that it provides a knowledge distillation training method, system and model based on offline features. In one embodiment of the present invention, the knowledge distillation training method based on offline features can perform online feature correction for human verification scenarios after offline feature loading, which can quickly improve the test effect of 1:1 face verification.
[0008] Another advantage of this invention is that it provides a knowledge distillation training method, system, and model based on offline features, wherein expensive materials or complex structures are not required to achieve the above objectives. Therefore, this invention successfully and effectively provides a solution that not only offers a simple knowledge distillation training method, system, and model based on offline features, but also increases the practicality and reliability of the method, system, and model.
[0009] To achieve at least one of the above-mentioned advantages or other benefits and objectives of the present invention, the present invention provides a knowledge distillation training method based on offline features, comprising the following steps:
[0010] The teacher model extracts features from all image samples in the image dataset to obtain corresponding offline features, which are then saved to an offline database; and
[0011] Image samples from the image dataset and corresponding offline features from the offline database are read online to train the student model using knowledge distillation.
[0012] According to one embodiment of this application, the step of reading image samples from the image dataset online and offline features corresponding to the image samples in the offline database to perform knowledge distillation training on the student model includes the following steps:
[0013] Before each iteration of training the student model, a batch of image samples is read online from the image dataset, and a batch of offline features corresponding to the batch of image samples is read online from the offline database; and
[0014] Online data augmentation is performed on the batch of image samples to use the augmented batch of image samples and the corresponding offline features for this iteration of training the student model.
[0015] According to one embodiment of this application, the knowledge distillation training method based on offline features further includes the following steps:
[0016] Feature correction is performed on all offline features in the offline database to obtain the corrected offline database.
[0017] According to one embodiment of this application, the step of performing feature correction on all offline features in the offline database to obtain a corrected offline database includes the following steps:
[0018] Using the ground truth labels provided by this image dataset, defect correction processing is performed on all offline features in the offline database to obtain defect-corrected offline features; and
[0019] Before or after performing defect correction on the offline feature, the decision to perform scenario correction on the offline feature depends on the application scenario.
[0020] According to one embodiment of this application, the step of using the real labels provided by the image dataset to perform defect correction processing on all offline features in the offline database to obtain defect-corrected offline features includes the following steps:
[0021] By judging image quality, one image is selected from each category in the image dataset as a standard photo, and the remaining images are used as comparison photos;
[0022] Based on the real labels provided by this image dataset, cross-comparison of all standard and comparison photos yields similarity tables for individuals within the same category and for different individuals; and
[0023] Based on the similarity table of the same person and the similarity table of different people, the offline feature is corrected using a defect correction model.
[0024] According to one embodiment of this application, the defect correction model is feat_revised1 = (1-lambda1)feat_benchmark + lambda1*feat_fused, where feat_revised1 is the feature after defect correction; feat_benchmark is the feature of the standard photograph; feat_fused is the feature of the comparison photograph; and lambda1 is the defect correction parameter.
[0025] According to one embodiment of this application, the step of determining whether to perform scene correction processing on the offline feature before or after performing defect correction on the offline feature, based on the application scenario, includes the following steps:
[0026] Determine whether there are ID photos in each category of the image dataset;
[0027] In response to the existence of an ID photo, the offline feature corresponding to that ID photo is selected as the ID photo feature for that category; and
[0028] Based on the characteristics of ID photos in this category, other offline features of this category are corrected using a scene correction model.
[0029] According to one embodiment of this application, the scene correction model is feat_revised2 = (1-lambda2)feat_Id + lambda2*feat_other, where feat_revised2 is the scene-corrected feature; feat_Id is the feature of the ID photo in this category; feat_other is the offline feature of other images in this category; and lambda2 is the scene correction parameter.
[0030] According to another aspect of this application, this application further provides a knowledge distillation training system based on offline features, comprising interconnected components:
[0031] The offline feature generation module is used to extract features from all image samples in the image dataset using the teacher model, thereby obtaining corresponding offline features and saving them to an offline database; and
[0032] The knowledge distillation training module is used to read image samples from the image dataset online and the corresponding offline features from the offline database to train the student model using knowledge distillation.
[0033] According to one embodiment of this application, the knowledge distillation training module includes an augmentation processing module and an iterative training module that are communicatively connected to each other. The augmentation processing module is used to read a batch of image samples online from the image dataset and a batch of offline features corresponding to the batch of image samples online from the offline database before each iteration of training the student model; and to perform online data augmentation processing on the batch of image samples so as to use the augmented batch of image samples and the corresponding batch of offline features to perform the iterative training of the student model.
[0034] According to one embodiment of this application, the knowledge distillation training system based on offline features further includes a feature correction module communicatively connected to the offline feature generation module and the knowledge distillation training module, wherein the feature correction module is used to perform feature correction on all offline features in the offline database to obtain a corrected offline database.
[0035] According to one embodiment of this application, the feature correction module includes a defect correction module and a scene correction module that are communicatively connected to each other. The defect correction module is used to perform defect correction processing on all offline features in the offline database using the real labels provided by the image dataset to obtain defect-corrected offline features. The scene correction module is used to determine whether to perform scene correction processing on the offline features before or after performing defect correction on the offline features, based on the landing scene.
[0036] According to another aspect of this application, this application further provides a face recognition model, which is trained by any of the knowledge distillation training methods based on offline features described above. Attached Figure Description
[0037] Figure 1 This is a flowchart illustrating the knowledge distillation training method based on offline features according to a first embodiment of the present invention;
[0038] Figure 2 A flowchart illustrating the iterative training steps in the knowledge distillation training method based on offline features according to the first embodiment of the present invention is shown.
[0039] Figure 3 This is a flowchart illustrating the knowledge distillation training method based on offline features according to a second embodiment of the present invention.
[0040] Figure 4 A flowchart illustrating the feature correction step in the knowledge distillation training method based on offline features according to the second embodiment of the present invention is shown.
[0041] Figure 5 A flowchart illustrating the defect correction step in the knowledge distillation training method based on offline features according to the second embodiment of the present invention is shown.
[0042] Figure 6 A flowchart illustrating the scene correction step in the knowledge distillation training method based on offline features according to the second embodiment of the present invention is shown.
[0043] Figure 7 An application example of the knowledge distillation training method based on offline features according to the above embodiments of the present invention is shown;
[0044] Figure 8 This is a block diagram of a knowledge distillation training system based on offline features according to an embodiment of the present invention.
[0045] Key component symbols: 1. Knowledge distillation training system based on offline features; 10. Offline feature generation module; 20. Knowledge distillation training module; 21. Augmentation processing module; 22. Iterative training module; 30. Feature correction module; 30. Defect correction module; 32. Scene correction module.
[0046] The above description of the main component symbols, together with the accompanying drawings and specific embodiments, provides a more detailed explanation of the present invention. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] It should be noted that when a component is said to be "installed on" another component, it can be directly on the other component or it may be in a component that is centered on it. When a component is said to be "set on" another component, it can be directly set on the other component or it may also be in a component that is centered on it. When a component is said to be "fixed to" another component, it can be directly fixed to the other component or it may also be in a component that is centered on it.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "or / and" as used herein includes any and all combinations of one or more of the associated listed items.
[0050] Existing technical solutions using knowledge distillation for training typically employ multiple heavyweight models as teacher models, using ensemble learning to train a lightweight model through knowledge distillation. However, in actual development, it has been found that because knowledge distillation training usually requires multiple iterations, and each iteration generally involves online data augmentation of image samples in the face image dataset, the input images to the network change to some extent each time. Therefore, existing technical solutions need to repeatedly use the teacher model to extract features from the face image training set in each iteration. Forwarding multiple heavyweight models is very time-consuming, resulting in very slow training of the lightweight model, which cannot meet the application requirements of real-world scenarios.
[0051] To address this issue, this application provides a knowledge distillation training method, system, and model based on offline features. It utilizes online loading of offline features to replace time-consuming online feature computation performed by the graphics card. This skips the time-consuming computational process of feature generation by the ensemble model during student model training, thus significantly accelerating the training process. It is understood that the online features used in existing technologies refer to teacher features obtained by freezing the teacher model weights and using the same image input as the student model for pre-passing the teacher model during knowledge distillation. In contrast, the offline features mentioned in this application refer to teacher features obtained and saved by freezing the teacher model weights before knowledge distillation of the student model and pre-passing all images from the dataset to be used in the knowledge distillation process onto the teacher model.
[0052] Specifically, see the attached document. Figure 1 and Figure 2 As shown, the first embodiment of the present invention provides a knowledge distillation training method based on offline features, which may include the following steps:
[0053] S110: Features are extracted from all image samples in the image dataset using a teacher model to obtain corresponding offline features, which are then saved to an offline database; and
[0054] S120: Read the image samples from the image dataset online and the offline features corresponding to the image samples in the offline database to perform knowledge distillation training on the student model.
[0055] It is worth noting that, since the offline features described in this application are acquired before knowledge distillation of the student model and stored in an offline database, the knowledge distillation training method based on offline features described in this application only needs to read the offline features corresponding to the input image of the student model during the knowledge distillation process, without having to perform pre-passing on multiple heavyweight models, thus significantly shortening the training time. It is understood that the teacher model mentioned in this application is typically a heavyweight model, such as the ResNet200 network model; while the student model is a lightweight model, such as the MobileFaceNet network model.
[0056] Furthermore, during the knowledge distillation training of the student model, this application can perform online data augmentation on a batch of image samples in the existing image dataset before each iteration. For example, color data augmentation mainly involves random cropping, random grayscale conversion, random horizontal flipping, and random keypoint jittering, so that the image samples input to the network change to a certain extent in each iteration, while the offline features corresponding to the augmented image samples do not change significantly. It is understandable that compared to knowledge distillation using fixed feature data, the offline feature-based knowledge distillation training method described in this application reduces limitations and helps improve the training effect of the student model.
[0057] More specifically, such as Figure 2 As shown, step S120 of the offline feature-based knowledge distillation training method of this application may include the following steps:
[0058] S121: Before each iteration of training the student model, a batch of image samples is read online from the image dataset, and a batch of offline features corresponding to the batch of image samples is read online from the offline database; and
[0059] S122: Perform online data augmentation on the batch of image samples, and use the augmented batch of image samples and the corresponding batch of offline features to train the student model for this iteration.
[0060] It is understood that the knowledge distillation training method based on offline features described in this application only needs to perform online data augmentation on the image dataset during each iteration of training, without repeatedly performing pre-training on the teacher model to extract offline features. It can still reuse the pre-acquired offline features in the offline feature library for training, skipping the time-consuming computational process of generating features through the ensemble model, thus significantly accelerating the training process. Furthermore, after each iteration of training the student model, this application reads a new batch of image samples online from the image dataset again, repeating the above iterative training steps until all image samples in the image dataset participate in the iterative training, completing one round of iterative training. Subsequently, this application can adjust the model parameters for the next round of iterative training until the student model is trained successfully.
[0061] For example, such as Figure 7 As shown, taking the training of a face recognition model as an example, in step S110 of the knowledge distillation training method based on offline features described in this application: a suitable teacher model is usually selected for the face image dataset used for knowledge distillation training to generate offline features and form an offline feature library, that is, the extracted offline features are saved in the offline database.
[0062] In one example of this application, three pre-trained models based on the ResNet200 network are first used as teacher models, for example, named ResNet200-A, ResNet200-B, and ResNet200-C respectively. Then, the features generated by the three teacher models are fused using ensemble learning to process the embeddings of the three teacher models. For example, when the dimensions of the embeddings of the three teacher models are the same, the features of the three teacher models can be summed: feat_fused = (feat_A + feat_B + feat_C). In this way, the three features are fused into one feature using the above fusion method, and the N fused feature vectors corresponding to the N face datasets are stored on the hard drive to form a training set parallel to the face image dataset, i.e., an offline face feature dataset stored in the offline face database. Therefore, when training the student model for knowledge distillation, it is only necessary to read the corresponding offline face features online from the offline face database, without repeatedly extracting face features. In other words, after generating the offline face feature library, this application will treat both the feature library and the face dataset as training sets, so that they can be read online during the training process without having to forward the teacher model.
[0063] It is worth noting that in step S120 of the offline feature-based knowledge distillation training method of this application: offline features are used to perform angle distillation on the generated features of the student model to complete the knowledge distillation training of the student model. Thus, the offline feature-based knowledge distillation training method of this application not only combines the characteristics of existing face recognition loss functions for feature angles, but also has a very simple implementation process and low computational complexity, achieving a plug-and-play effect.
[0064] For example, this application can use the MobileFaceNet network model as the student model for knowledge distillation training, wherein the loss function of the face distillation training method is L = L Arc +ɑL s ;
[0065] Where: α is the equilibrium L Arc and L s The weights;
[0066]
[0067]
[0068] In the formula: L Arc F is the Arcface loss function; t Features of the teacher model; F sFeatures generated online for student models; L s The loss function is a knowledge distillation function that focuses on the feature angle; s and m are hyperparameters; θ is the feature angle. It is understood that in some examples of this application, the Arcface loss function can also be changed to other loss functions that focus on feature angle information, such as various variant face loss functions based on the cross-entropy loss function; or, in other examples of this application, L... s Other knowledge distillation loss functions that focus on feature perspectives can also be used, such as the cosine similarity between teacher features and student features, which will not be elaborated upon in this application.
[0069] It is worth noting that although the above example uses face recognition as an example to illustrate the features and advantages of the knowledge distillation training method based on offline features described in this application, it is only an example. It is understood that in other examples of this application, the knowledge distillation training method based on offline features can also be used for knowledge distillation training of other object recognition. It is only necessary to select the required dataset and teacher model according to the specific application scenario. This application will not elaborate on this further.
[0070] Furthermore, in general, traditional knowledge distillation methods often fail to produce student models that outperform teacher models. This is because the teacher model sets an upper limit on the performance of the student model. For example, in face recognition, the face dataset used by the teacher model during knowledge distillation may not achieve a perfect performance of 100% correct acceptance rate and 0% false acceptance rate (i.e., TAR=1@FAR=0). This, to some extent, sets an upper limit on the performance of the student model, making it difficult for the student model to surpass the teacher model.
[0071] In order to break through the upper limit set by the teacher model, the knowledge distillation training method based on offline features described in this application adopts some features for erroneous acceptance samples under different error acceptance rates to make corresponding corrections, so as to avoid the impact of the teacher model's defects on the student model to a certain extent.
[0072] Specifically, such as Figure 3 As shown, a second embodiment of this application provides a knowledge distillation training method based on offline features, which may include the following steps:
[0073] S210: The teacher model extracts features from all image samples in the image dataset to obtain the corresponding offline features and save them to the offline database.
[0074] S220: Perform feature correction on all offline features in the offline database to obtain a corrected offline database; and
[0075] S230: Read the image samples from the image dataset online and the corresponding offline features in the corrected offline database to train the student model using knowledge distillation.
[0076] It is worth noting that, compared with the first embodiment of this application described above, the difference of the knowledge distillation training method based on offline features in the second embodiment of this application is that: after generating the offline database and before training the model, feature correction is performed on all offline features in the offline database for incorrect acceptance samples and incorrect rejection samples, so as to avoid the influence of the teacher model's defects on the student model, which helps to improve the upper limit of the student model and makes it possible for the student model to outperform the teacher model.
[0077] More specifically, such as Figure 4 As shown, step S220 of the knowledge distillation training method based on offline features may include the following steps:
[0078] S221: Using the real labels provided by the image dataset, perform defect correction processing on all offline features in the offline database to obtain defect-corrected offline features.
[0079] Furthermore, such as Figure 5 As shown, step S221 may include, but is not limited to, the following steps:
[0080] S2211: Based on image quality discrimination, select one image from each category in the image dataset as a standard image, and use the remaining images as comparison images;
[0081] S2212: Based on the real labels provided by this image dataset, through cross-comparison of all standard and comparison photos, obtain similarity tables for the same person and for different people between the standard and comparison photos; and
[0082] S2213: Based on the same-person similarity table and the different-person similarity table, the offline feature is corrected using a defect correction model.
[0083] Preferably, the defect correction model of this application is implemented as follows: feat_revised1=(1-lambda1)feat_benchmark+lambda1*feat_fused, where feat_revised1 is the feature after defect correction; feat_benchmark is the feature of the standard photograph; feat_fused is the feature of the comparison photograph; and lambda1 is the defect correction parameter.
[0084] For example, such as Figure 7As shown, taking the correction of offline features in face recognition as an example, assuming there are M categories and K face images in the face image dataset: First, in each of the M categories, the image with the best quality is selected as the standard photo, and the remaining images are used as comparison photos, resulting in M standard photos and KM comparison photos. Next, the features feat_fused of these M standard photos and KM comparison photos are cross-compared to generate M*(KM) similarity tables. Through the similarity tables and the real labels provided by the face image dataset, the similarity tables of the same person and different people for the M standard photos and KM comparison photos can be obtained, thus obtaining the TAR corresponding to different FAR, that is, obtaining the erroneous acceptance samples and erroneous rejection samples corresponding to different ranges of FAR. Finally, the offline features are corrected, and the corrected offline features are implemented as feat_revised1=(1-lambda1)feat_benchmark+lambda1*feat_fused.
[0085] It is understood that the defect correction parameter lambda1 described in this application is generally set to a value between 0 and 1, and can be adjusted accordingly based on the FAR of the erroneous sample within the corresponding range. For example, for erroneous samples with FAR in [0, 0.01%], lambda1 = 0.95; for erroneous samples with FAR in [0.01%, 0.1%], lambda1 = 0.9; for erroneous samples with FAR in [0.1%, FAR@TAR = 100%], lambda1 = 0.8.
[0086] It is worth noting that, besides the upper limit of the teacher model affecting the performance of the student model, the performance of large models trained on large-scale training data using knowledge distillation methods still needs improvement in specific scenarios (such as 1:1 identity verification), which can lead to less than ideal performance for lightweight models trained by knowledge distillation. To address this issue, the offline feature-based knowledge distillation training method described in this application can determine whether to perform scene correction on offline features based on the application scenario. In other words, after offline features are read or loaded, online scene correction of offline features for identity verification scenarios can be performed, which can quickly improve the performance of the student model.
[0087] Specifically, such as Figure 4 As shown, step S220 of the offline feature-based knowledge distillation training method of this application may further include the following steps:
[0088] S222: Before or after performing defect correction on the offline feature, decide whether to perform scenario correction processing on the offline feature based on the application scenario.
[0089] More specifically, such as Figure 6 As shown, step S222 may include the following steps:
[0090] S2221: Determine whether there is an ID photo in each category of the image dataset;
[0091] S2222: In response to the existence of an ID photo, select the offline feature corresponding to that ID photo as the ID photo feature for this category; and
[0092] S2223: Based on the ID photo features of this category, other offline features of this category are corrected using a scene correction model.
[0093] Preferably, the scene correction model of this application is implemented as follows: feat_revised2 = (1-lambda2)feat_Id + lambda2*feat_other, where feat_revised2 is the scene-corrected feature; feat_Id is the feature of the ID photo in this category; feat_other is the offline feature of other images in this category; and lambda2 is the scene correction parameter. It is understood that the scene correction parameter lambda2 of this application is between 0 and 1, and is generally set to 0.7.
[0094] It is worth noting that, such as Figure 7 As shown, when step S222 is performed after step S221, the offline feature feat_other of other images in this category refers to the feature feat_revised1 after defect correction; while when step S222 is performed before step S221, the offline feature feat_other of other images in this category refers to the offline feature directly read online from the offline database, that is, the feature without defect correction.
[0095] For example, taking a 1:1 face verification scenario, the features of the teacher model's casual photos or non-frontal photos can be modified by fusing the features of the current image and the ID photo with a certain coefficient. The modified offline features can then be used to supervise the training of the student model. For instance, when an ID photo exists in a certain category of the image dataset, the feature corresponding to that ID photo is selected as the ID photo feature feat_Id for that category. Then, the offline features corresponding to other images in that category, after modification, satisfy feat_revised2 = (1-lambda2)feat_Id + lambda2*feat_revised1.
[0096] In summary, in the second embodiment of this application, the knowledge distillation training method based on offline features described in this application, during the knowledge distillation process, on the one hand, corrects the features of the incorrectly accepted and incorrectly rejected samples of the teacher model, thereby avoiding the defects of the teacher model and improving the upper limit of the student model's performance to a certain extent, so that the final performance of the student model may even surpass that of the teacher model; on the other hand, after loading offline features, online correction of facial features is performed for the identity verification scenario, which can quickly improve the 1:1 test effect of face verification.
[0097] It is worth mentioning that, according to another aspect of this application, such as Figure 8 As shown, one embodiment of this application further provides a knowledge distillation training system 1 based on offline features, which may include an offline feature generation module 10 and a knowledge distillation training module 20 that are communicatively connected to each other. The offline feature generation module 10 is used to extract features from all image samples of the image dataset using a teacher model to obtain corresponding offline features and save them to an offline database. The knowledge distillation training module 20 is used to read the image samples of the image dataset and the offline features corresponding to the image samples in the offline database online to perform knowledge distillation training on the student model.
[0098] It is worth noting that, in one example of this application, such as Figure 8 As shown, the knowledge distillation training module 20 may include an augmentation processing module 21 and an iterative training module 22 that are communicatively connected to each other. The augmentation processing module 21 is used to read a batch of image samples online from the image dataset and read a batch of offline features corresponding to the batch of image samples online from the offline database before each iteration of training the student model; and to perform online data augmentation processing on the batch of image samples so as to use the augmented batch of image samples and the corresponding batch of offline features to perform the iterative training of the student model.
[0099] Furthermore, according to the above embodiments of this application, such as Figure 8 As shown, the knowledge distillation training system 1 based on offline features may further include a feature correction module 30 communicatively connected to the offline feature generation module 10 and the knowledge distillation training module 20, wherein the feature correction module 30 is used to perform feature correction on all offline features in the offline database to obtain a corrected offline database.
[0100] In one example of this application, such as Figure 8As shown, the feature correction module 30 may include a defect correction module 31 and a scene correction module 32 that are communicatively connected to each other. The defect correction module 31 is used to perform defect correction processing on all offline features in the offline database using the real labels provided by the image dataset to obtain defect-corrected offline features. The scene correction module 32 is used to determine whether to perform scene correction processing on the offline features before or after performing defect correction on the offline features, based on the landing scene.
[0101] In one example of this application, the defect correction module 31 is further configured to select one image from each category in the image dataset as a standard photo and the remaining images as comparison photos based on image quality discrimination; based on the real labels provided by the image dataset, obtain a similarity table between standard photos and comparison photos of the same person and a similarity table between different people by cross-comparing all standard photos and comparison photos; and based on the similarity table between the same person and the similarity table between different people, correct the offline feature through the defect correction model.
[0102] In one example of this application, the scene correction module 32 is further configured to determine whether there is an ID photo in each category of the image dataset; in response to the existence of an ID photo, select the offline feature corresponding to the ID photo as the ID photo feature of that category; and based on the ID photo feature of that category, perform correction processing on other offline features of that category through the scene correction model.
[0103] It is worth mentioning that, according to another aspect of this application, this application further provides a face recognition model, wherein the face recognition model is trained by any of the knowledge distillation training methods based on offline features described above.
[0104] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0105] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. An offline feature-based knowledge distillation training method, characterized in that, The method comprises the steps of: performing feature extraction on all image samples in the image dataset by the teacher model to obtain corresponding offline features respectively and save to an offline database; performing feature correction on error accepted samples and error rejected samples in all offline features in the offline database to obtain a revised offline database; and respectively reading an image sample in the image dataset and an offline feature corresponding to the image sample in the revised offline database to perform knowledge distillation training on a student model. 2.The offline-feature-based knowledge distillation training method of claim 1, wherein, The step of respectively reading an image sample in the image dataset and an offline feature corresponding to the image sample in the offline database to perform knowledge distillation training on a student model comprises the steps of: before each iteration of training the student model, reading a batch of image samples from the image dataset online and reading a batch of offline features corresponding to the batch of image samples from the offline database online; and performing online data augmentation processing on the batch of image samples to use the augmented batch of image samples and the corresponding batch of offline features to perform the iteration of training on the student model. 3.The offline-feature-based knowledge distillation training method of claim 1 or 2, wherein, The step of performing feature correction on all offline features in the offline database to obtain a revised offline database comprises the steps of: performing defect correction processing on all offline features in the offline database using the real labels provided by the image dataset to obtain defect-corrected offline features; and determining whether to perform scene correction processing on the offline features according to a landing scene before or after the defect correction on the offline features. 4.The offline-feature-based knowledge distillation training method of claim 3, wherein, The step of performing defect correction processing on all offline features in the offline database using the real labels provided by the image dataset to obtain defect-corrected offline features comprises the steps of: selecting one image as a standard image and the remaining images as comparison images from each category in the image dataset by image quality discrimination; obtaining a same-person similarity table and a different-person similarity table between the standard images and the comparison images by cross-comparison of all standard images and comparison images based on the real labels provided by the image dataset; and performing correction processing on the offline features by a defect correction model based on the same-person similarity table and the different-person similarity table. 5.The offline-feature-based knowledge distillation training method of claim 4, wherein, The defect correction model is feat_revised1=(1-lambda1)feat_benchmark + lambda1*feat_fused, where feat_revised1 is the defect-corrected feature; feat_benchmark is the feature of the standard image; feat_fused is the feature of the comparison image; and lambda1 is a defect correction parameter. 6.The offline feature-based knowledge distillation training method of claim 3, wherein, The step of determining whether to perform scene correction processing on the offline features according to a landing scene before or after the defect correction on the offline features comprises the steps of: determining whether there is an ID photo in the images of each category in the image dataset; in response to the existence of the ID photo, selecting an offline feature corresponding to the ID photo as an ID photo feature of the category; and Based on the features of the category of the ID photo, other offline features of the category are corrected by a scene correction model.
7. The offline-feature-based knowledge distillation training method of claim 6, wherein, The scene correction model is feat_revised2=(1-lambda2)feat_Id + lambda2*feat_other, where feat_revised2 is the corrected feature; feat_Id is the feature of the ID photo in the category; feat_other is the offline feature of other images in the category; and lambda2 is a scene correction parameter.
8. An offline feature-based knowledge distillation training system, comprising: The system comprises: An offline feature generation module for extracting features of all image samples in an image dataset by a teacher model to obtain corresponding offline features and save them to an offline database; and A knowledge distillation training module for reading image samples and corresponding offline features of the image samples in the offline database online to train a student model by knowledge distillation. The system further comprises a feature correction module communicatively connected to the offline feature generation module and the knowledge distillation training module, which is configured to correct error acceptance samples and error rejection samples in all offline features in the offline database to obtain a corrected offline database.
9. The offline-feature-based knowledge distillation training system of claim 8, wherein, The knowledge distillation training module comprises an augmentation processing module and an iterative training module communicatively connected to each other, wherein the augmentation processing module is configured to read a batch of image samples from the image dataset and a batch of offline features corresponding to the batch of image samples from the offline database before each iteration of the student model. The feature correction module comprises a defect correction module and a scene correction module communicatively connected to each other, wherein the defect correction module is configured to correct defects of all offline features in the offline database using real labels provided by the image dataset to obtain defect-corrected offline features; and the scene correction module is configured to determine whether to correct the offline features according to the landing scene before or after the defect correction of the offline features.
10. The offline-feature-based knowledge distillation training system of claim 8 or 9, wherein, The face recognition model is trained by the knowledge distillation training method based on offline features according to any one of claims 1 to 7.
11. A face recognition model characterized in that,
Citation Information
Patent Citations
Target tracking method based on deep transfer learning
CN109544603A
Model distillation method and device for different scenes
CN112733879A
Video behavior recognition method based on weighted fusion of multiple image tasks
CN113536922A