Model training method, device, equipment and system
By conducting distillation training of student models on the biometric collection device side and smart contract support of the blockchain system, the problem of insufficient device computing resources and privacy leakage is solved, and efficient biometric recognition and accuracy improvement are achieved.
Patent Information
- Application Number
- CN202210151523.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-18
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-02-18
AI Technical Summary
In biometric technology, due to the limited computing resources of the collection device, it is difficult to efficiently perform biometric recognition on the device side, and the cross-device transmission of biometric images risks leaking user privacy.
The student model is obtained through distillation training and combined with smart contracts in the blockchain system to achieve biometric identification and model training on the collection device side, avoiding cross-device transmission and improving recognition performance and accuracy.
It achieves efficient biometric identification on the device side under limited computing resources, reduces the risk of user privacy leakage, and improves the accuracy of biometric identification through periodic model training.
Smart Images

Figure CN114528937B_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of computer technology, and in particular to a model training method, device, equipment and system. Background Art
[0002] In recent years, biometric technology has been widely used in many fields, such as payment, attendance, access control, etc. In the current biometric recognition process, due to the limited computing resources of the biometric acquisition device, the lack of the ability to train the recognition model and the low recognition performance of the biometrics, the acquisition device usually sends the collected biometric image to the server, which performs biometric recognition and image storage operations. However, the cross-device transmission of biometric images often poses a risk of user privacy leakage. Therefore, how to achieve efficient biometric recognition on the acquisition device side when the computing resources of the acquisition device are limited is a technical problem that needs to be solved urgently. Summary of the invention
[0003] One or more embodiments of the present specification provide a model training method, which is applied to an image acquisition device. The method includes collecting a biometric image of a user to be identified. The biometric image is identified and processed based on a student model to obtain an identification result. The student model is obtained by performing distillation training on a student network to be trained based on a pre-trained teacher model by the server. If it is determined according to the identification result that the biometric image meets a preset sample accumulation condition, the biometric image is determined as a first target sample and saved. Determine whether the self-distillation training conditions of the student model are met. If so, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the first target sample saved to obtain an updated student model.
[0004] One or more embodiments of the present specification provide a model training method. The method includes performing distillation training processing on a student network to be trained according to an acquired training sample set and a pre-trained teacher model to obtain a student model. The training samples in the training sample set include the user's biometrics. The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the acquired biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets a preset sample accumulation condition, the biometric image is determined as a first target sample and saved. And when it is determined that the self-distillation training conditions of the student model are met, the student model is self-distilled based on the self-distillation training method of fusion guidance and one-to-many guidance, and the first target sample saved is used to perform self-distillation training processing on the student model to obtain an updated student model.
[0005] One or more embodiments of the present specification provide a model training method. The method includes performing distillation training processing on a student network to be trained based on an acquired training sample set and a pre-trained teacher model based on a smart contract in a blockchain system to obtain a student model. The training samples in the training sample set include the user's biometrics. The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the acquired biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved. And when it is determined that the self-distillation training conditions of the student model are met, the self-distillation training method based on fusion guidance and one-to-many guidance is used to perform self-distillation training processing on the student model using the saved first target sample to obtain an updated student model. The training record information of the student model is generated and saved in the blockchain system.
[0006] One or more embodiments of the present specification provide a model training device, which is applied to an image acquisition device. The device includes an acquisition module, which acquires a biometric image of a user to be identified. The device also includes an identification module, which performs identification processing on the biometric image based on a student model to obtain an identification result. Among them, the student model is obtained by the server performing distillation training on a student network to be trained based on a pre-trained teacher model. The device also includes a first determination module, and if it is determined according to the identification result that the biometric image meets a preset sample accumulation condition, the biometric image is determined as a first target sample and saved. The device also includes a second determination module, which determines whether the self-distillation training condition of the student model is met. The device also includes a training module, and if so, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the first target sample saved to obtain an updated student model.
[0007] One or more embodiments of the present specification provide a model training device. The device includes a training module, which performs distillation training processing on a student network to be trained according to an acquired training sample set and a pre-trained teacher model to obtain a student model. The training samples in the training sample set include the user's biometrics. The device also includes a sending module, which sends the student model to an image acquisition device, so that the image acquisition device performs recognition processing on the acquired biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved. And when it is determined that the self-distillation training conditions of the student model are met, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample to obtain an updated student model.
[0008] One or more embodiments of the present specification provide a model training device. The device also includes a training module, which, based on the smart contract in the blockchain system, performs distillation training processing on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model. The training samples in the training sample set include the user's biometrics. The device also includes a sending module, which sends the student model to the image acquisition device, so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved. And when it is determined that the self-distillation training condition of the student model is met, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the first target sample saved to obtain an updated student model. The device also includes a saving module, which generates training record information of the student model and saves it to the blockchain system.
[0009] One or more embodiments of the present specification provide a model training system. The system includes a server and an image acquisition device. The server performs distillation training on a student network to be trained according to an acquired training sample set and a pre-trained teacher model to obtain a student model. The student model is sent to an image acquisition device; the training samples in the training sample set include the user's biometrics. The image acquisition device acquires a biometric image of a user to be identified; the biometric image is identified based on the received student model to obtain an identification result. If it is determined according to the identification result that the biometric image meets a preset sample accumulation condition, the biometric image is determined as a first target sample and saved. Determine whether the self-distillation training conditions of the student model are met. If so, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the first target sample saved to obtain an updated student model.
[0010] One or more embodiments of the present specification provide a model training system. The system includes a blockchain system and an image acquisition device. The blockchain system, based on the smart contract in the blockchain system, performs distillation training processing on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model. The student model is sent to the image acquisition device. And, the training record information of the student model is generated and saved in the blockchain system. The training samples in the training sample set include the user's biometrics. The image acquisition device collects the biometric image of the user to be identified. Based on the received student model, the biometric image is identified and processed to obtain an identification result. If it is determined according to the identification result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved. Determine whether the self-distillation training condition of the student model is met. If so, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled and trained using the first target sample saved to obtain an updated student model.
[0011] One or more embodiments of the present specification provide a model training device. The device includes a processor. The device also includes a memory arranged to store computer executable instructions. When the computer executable instructions are executed, the processor collects a biometric image of a user to be identified. The biometric image is identified and processed based on a student model to obtain an identification result. The student model is obtained by performing distillation training on a student network to be trained based on a pre-trained teacher model by the server. If it is determined according to the identification result that the biometric image meets a preset sample accumulation condition, the biometric image is determined as a first target sample and saved. Determine whether the self-distillation training conditions of the student model are met. If so, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the first target sample saved to obtain an updated student model.
[0012] One or more embodiments of the present specification provide a model training device. The device includes a processor. The device also includes a memory arranged to store computer executable instructions. When the computer executable instructions are executed, the processor performs distillation training processing on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model. The training samples in the training sample set include the user's biometrics. The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved. And when it is determined that the self-distillation training condition of the student model is met, the student model is self-distilled based on the self-distillation training method of fusion guidance and one-to-many guidance. The first target sample saved is used to perform self-distillation training processing on the student model to obtain an updated student model.
[0013] One or more embodiments of the present specification provide a model training device. The device includes a processor. The device also includes a memory arranged to store computer executable instructions. When the computer executable instructions are executed, the processor performs distillation training processing on the student network to be trained based on the acquired training sample set and the pre-trained teacher model based on the smart contract in the blockchain system to obtain a student model. The training samples in the training sample set include the user's biometrics. The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the biometric image of the user to be identified based on the student model. When it is determined that the biometric image meets the preset sample accumulation condition according to the recognition result, the biometric image is determined as the first target sample and saved. And when it is determined that the self-distillation training condition of the student model is met, the self-distillation training method based on fusion guidance and one-to-many guidance is used to perform self-distillation training processing on the student model using the saved first target sample to obtain an updated student model. The training record information of the student model is generated and saved in the blockchain system.
[0014] One or more embodiments of the present specification provide a storage medium. The storage medium is used to store computer-executable instructions. When the computer-executable instructions are executed by the processor, a biometric image of a user to be identified is collected. The biometric image is identified and processed based on a student model to obtain an identification result. The student model is obtained by performing distillation training on a student network to be trained based on a pre-trained teacher model by the server. If it is determined according to the identification result that the biometric image meets a preset sample accumulation condition, the biometric image is determined as a first target sample and saved. Determine whether the self-distillation training conditions of the student model are met. If so, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the first target sample saved to obtain an updated student model.
[0015] One or more embodiments of the present specification provide a storage medium. The storage medium is used to store computer executable instructions. When the computer executable instructions are executed by the processor, the student network to be trained is subjected to distillation training processing according to the acquired training sample set and the pre-trained teacher model to obtain a student model. The training samples in the training sample set include the user's biometrics. The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the acquired biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved. And when it is determined that the self-distillation training conditions of the student model are met, the student model is subjected to self-distillation training processing based on the self-distillation training method of fusion guidance and one-to-many guidance, and the first target sample saved is used to obtain an updated student model.
[0016] One or more embodiments of the present specification provide a storage medium. The storage medium is used to store computer executable instructions. When the computer executable instructions are executed by the processor, based on the smart contract in the blockchain system, the student network to be trained is distilled and trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model. The training samples in the training sample set include the user's biometrics. The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved. And when it is determined that the self-distillation training condition of the student model is met, the self-distillation training method based on fusion guidance and one-to-many guidance is used to perform self-distillation training processing on the student model using the saved first target sample to obtain an updated student model. The training record information of the student model is generated and saved in the blockchain system. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate one or more embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0018] Figure 1 A schematic diagram of a first scenario of a model training method provided for one or more embodiments of this specification;
[0019] Figure 2A first flow chart of a model training method provided for one or more embodiments of this specification;
[0020] Figure 3 A second flow chart of a model training method provided for one or more embodiments of this specification;
[0021] Figure 4 A third flow chart of a model training method provided for one or more embodiments of this specification;
[0022] Figure 5 A fourth flow chart of a model training method provided for one or more embodiments of this specification;
[0023] Figure 6 A fifth flow chart of a model training method provided for one or more embodiments of this specification;
[0024] Figure 7 A sixth flow chart of a model training method provided for one or more embodiments of this specification;
[0025] Figure 8 A second scenario schematic diagram of a model training method provided for one or more embodiments of this specification;
[0026] Fig. 9 A seventh flow chart of a model training method provided for one or more embodiments of this specification;
[0027] Fig.10 A schematic diagram of the first module composition of a model training device provided in one or more embodiments of this specification;
[0028] Fig.11 A schematic diagram of a second module composition of a model training device provided in one or more embodiments of this specification;
[0029] Fig.12 A schematic diagram of a third module composition of a model training device provided in one or more embodiments of this specification;
[0030] Fig.13 A first schematic diagram of a model training system provided for one or more embodiments of this specification;
[0031] Fig.14 A second schematic diagram of a model training system provided for one or more embodiments of this specification;
[0032] Fig.15 A schematic diagram of the structure of a model training device provided for one or more embodiments of this specification. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to clearly and completely describe the technical solutions in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.
[0034] Figure 1 A schematic diagram of an application scenario of the model training method provided in one or more embodiments of this specification, such as Figure 1 As shown, the scenario includes: an image acquisition device and a server. The image acquisition device can be an IoT device with a biometric acquisition function, such as an intelligent attendance device, an intelligent access control device, an intelligent camera device, etc. ( Figure 1 Only the smart camera device is shown); the image acquisition device can also be a terminal device with a biometric acquisition function, such as a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, etc. ( Figure 1 Only a mobile phone is shown in the figure). The server side may be an independent server, such as a cloud server, a common server, etc., or a server cluster composed of multiple servers.
[0035] Specifically, the server performs distillation training on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; wherein the training samples in the training sample set include the user's biometric features; and the server sends the obtained student model to the image acquisition device. After receiving the student model sent by the server, the image acquisition device deploys the student model in the image acquisition device, and when the biometric image of the user to be identified is acquired, the biometric image is identified based on the student model deployed by itself to obtain the identification result. If the image acquisition device determines that the biometric image meets the preset sample accumulation condition according to the identification result, the biometric image is determined as the first target sample and saved. In addition, the image acquisition device determines whether the self-distillation training condition of the student model is met. If so, the self-distillation training process is performed on the student model based on the self-distillation training method of fusion guidance and one-to-many guidance, and the saved first target sample is used to obtain an updated student model. Wherein, the biometric features included in the biometric image can be one or more of face, fingerprint, palm print, iris, etc. Therefore, a student model is obtained by distillation training based on the teacher model on the server side. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is also much smaller than that of the teacher model, and it has a faster recognition rate. Therefore, the server side sends the student model to the image acquisition device, so that the image acquisition device can perform effective biometric processing based on the student model under limited computing resources, and performs self-distillation training on the student model based on the accumulated first target samples; not only does it realize biometric recognition on the image acquisition device side, but it also avoids the risk of user privacy leakage caused by cross-device transmission of biometric images; it also realizes periodic model training on the image acquisition device side, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side.
[0036] Based on the above application scenario architecture, one or more embodiments of the present application provide a model training method. Figure 2 A flowchart of a model training method provided in one or more embodiments of this specification, Figure 2 The method in can be Figure 1 The image acquisition device in the implementation, such as Figure 2 As shown, the method comprises the following steps:
[0037] Step S102, collecting a biometric image of the user to be identified;
[0038] The model training method provided in the embodiments of this specification can be applied to various scenarios that require biometric identification, for example, in a payment scenario based on biometric identification, the user to be identified can be the user requesting payment; in another example, in an attendance scenario based on biometric identification, the user to be identified can be the user to be checked in; in another example, in a business handling scenario based on biometric identification, the user to be identified can be the user requesting business handling, etc. It can be understood that for different application scenarios, the user to be identified can be different types of users, which will not be listed here one by one.
[0039] Step S104, performing recognition processing on the biometric image based on the student model to obtain a recognition result; wherein the student model is obtained by the server performing distillation training on the student network to be trained based on the pre-trained teacher model;
[0040] Specifically, the server first performs distillation training on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; wherein the training samples in the training sample set include the user's biometric features; the server sends the obtained student model to the image acquisition device. When the image acquisition device acquires the biometric image of the user to be identified, the biometric image is input into the student model for identification processing to obtain the identification result. The process of the server performing distillation training on the student network to be trained according to the acquired training sample set and the pre-trained teacher model can be found in the relevant description below, and the repeated parts will not be repeated here.
[0041] Step S106, if it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved;
[0042] In order to realize model training on the image acquisition device side, thereby continuously improving the biometric recognition performance of the student model and optimizing the student model, in the embodiment of this specification, when the image acquisition device determines that the collected biometric image meets the preset sample accumulation conditions, the collected biometric image is determined as the first target sample and saved.
[0043] Step S108, determining whether the self-distillation training conditions of the student model are met, and if so, performing self-distillation training on the student model using the saved first target sample based on the self-distillation training method of fusion guidance and one-to-many guidance to obtain an updated student model.
[0044] Optionally, determine whether a preset self-distillation training cycle has been reached. If the preset self-distillation training cycle has been reached, and if it is determined that the number of saved first target samples is not less than a first preset number, determine that the self-distillation training conditions of the student model are met; based on the self-distillation training method of fusion guidance and one-to-many guidance, use the saved first target samples to perform self-distillation training on the student model to obtain an updated student model. Alternatively, determine whether the number of saved first target samples has reached a second preset number. If so, determine that the self-distillation training conditions of the student model are met; based on the self-distillation training method of fusion guidance and one-to-many guidance, use the saved first target samples to perform self-distillation training on the student model to obtain an updated student model. The process of self-distillation training processing can be found in the relevant description below.
[0045] In one or more embodiments of the present specification, a student model is obtained by performing distillation training based on a teacher model on the server side. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and it has a faster recognition rate. Therefore, by deploying the student model in an image acquisition device, the image acquisition device can perform biometric processing based on the student model with limited computing resources, and perform self-distillation training on the student model based on the accumulated first target samples; not only effective biometric recognition on the image acquisition device side is achieved, and the risk of user privacy leakage caused by the transmission of biometric images across devices is avoided; but also periodic model training on the image acquisition device side is achieved, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side.
[0046] In order to continuously improve the recognition accuracy of the student model, in one or more embodiments of the present application, after the image acquisition device obtains the recognition result each time, it determines the recognition score of the recognition result, and determines whether the corresponding biometric image meets the preset sample accumulation condition based on the recognition score. Figure 3 As shown, after step S104, the following steps S105-2 and S105-4 may also be included:
[0047] Step S105-2, obtaining a first image feature of the biometric image corresponding to the recognition result and a second image feature of the reference biometric image of the user to be recognized;
[0048] Specifically, a first image feature of the biometric image extracted by the student model during the process of performing recognition processing on the biometric image based on the student model is obtained; and a second image feature of a reference biometric image of a user to be recognized is obtained from a designated image library. The designated image library includes reference biometric images of multiple users.
[0049] Step S105-4, determining a recognition score of the recognition result according to the first image feature and the second image feature;
[0050] Specifically, the cosine similarity between the first image feature and the second image feature is calculated; and according to a preset recognition score calculation method, the recognition score of the recognition result is calculated based on the cosine similarity. The higher the recognition score, the higher the accuracy of the recognition result. In one embodiment, the preset recognition score calculation method can be P = 50 + 50 *<f1,f2> , where f1 is the first image feature, f2 is the second image feature,<f1,f2> is the cosine similarity between the first image feature and the second image feature. It should be noted that the calculation method of the recognition score is not limited to this calculation method, and it can be set according to actual needs in actual applications.
[0051] Corresponding to step S105-2 and step S105-4, as Figure 3 As shown, step S106 may include the following steps S106-2:
[0052] Step S106-2: If it is determined that the recognition score is within the preset first score range, it is determined that the biometric image meets the preset sample accumulation condition, and the biometric image is determined as the first target sample and saved.
[0053] In one embodiment, a score threshold T may be preset. When the score of the recognition result is greater than the score threshold T, it indicates that the accuracy of the recognition result is high, and vice versa. The first score interval may be [T-5, T]. Thus, by accumulating some biometric images with low recognition results and some biometric images with high recognition results, and using them as the first target sample, the student model may be self-distilled based on the first target sample without obtaining training samples from the outside. Therefore, the training efficiency of the self-distillation training may be improved, and the accuracy of the student model may be improved.
[0054] It can be understood that since the recognition result represents the user identity corresponding to the corresponding biometric image, the recognition result of the first target sample can be determined as its label data, and in the self-distillation training process, some samples in the first target sample with low recognition results can be used as negative samples, and some samples in the first target sample with high recognition results can be used as positive samples.
[0055] In one or more embodiments of this specification, in order to improve the accuracy of the student model, the image acquisition device performs self-distillation training based on the self-distillation training method of fusion guidance and one-to-many guidance. Figure 4 As shown, step S108 may include the following steps S108-2 and S108-4:
[0056] Step S108-2, determining whether the self-distillation training condition of the student model is met, and if so, dividing the saved first target sample into at least one training set;
[0057] Partitioning the stored first target samples into at least one training set may include: partitioning the stored first target samples into at least one training set according to a preset number of samples included in each training set.
[0058] Step S108-4, based on the training set and the preset first loss function, performing self-distillation training processing on the student model to obtain an updated student model;
[0059] Among them, the first loss function includes: a multi-classification loss function, a first self-distillation loss function and a second self-distillation loss function; the multi-classification loss function is used to classify the image features output by each layer of the student model; the first self-distillation loss function is used to use the fusion classification result obtained by fusing the classification results of each layer of the student model to guide the classification results of each layer of the student model; the second self-distillation loss function is used to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
[0060] The first loss function can be expressed as:
[0061]
[0062] Among them, L total represents the total loss; B represents the student model; li is the i-th layer of the student model, LB is the total number of layers of the student model; L ce (f B-li,y ) is a multi-classification loss function, representing the image feature f output of the i-th layer of the student model B-li The result of the classification process is y; L KD (p B-li , p B-Ensemble ) is the first self-distillation loss function, p B-li is the classification result of the i-th layer of the student model, p B-Ensemble is the fusion classification result obtained by fusing the classification results of each layer of the student model; L KD-mse (F map-B-li ,Resize(F map-B-LB )) is the second self-distillation loss function, F map-B-li is the image feature output by the i-th layer of the student model, Resize(F map-B-LB ) is the image feature output by the last layer of the student model.
[0063] Optionally, when the loss value determined based on the first loss function reaches a preset loss value, the training is stopped, and the corresponding model is determined as the updated student model. Alternatively, when the number of iterative training reaches a preset number of times, the training is stopped, and the corresponding model is determined as the updated student model.
[0064] In the self-distillation training process, the classification results of each layer are guided by the fusion classification results obtained by fusing the classification results of each layer, that is, fusion guidance; and the image features output by the last layer are used to guide the learning process of each layer except the last layer, that is, one-to-many guidance; it can not only improve the training speed, but also improve the model accuracy of the student model. Furthermore, the image acquisition device performs self-distillation training of the student model to optimize the student model, without the need for the server to optimize the student model, so the server does not need to manage multiple versions of the student model, reducing the management cost of the student model.
[0065] Since the image acquisition device continuously saves new first target samples, the first target samples used in the current self-distillation training process can be deleted after each self-distillation training process, and the accumulated new first target samples can be used for training in the next self-distillation training process.
[0066] Considering that in the early stage of using the student model, due to the small number of self-distillation training times, the performance is slightly low, and recognition results with very low recognition scores may appear. Or after the performance of the student model is greatly improved, the quality of the collected biometric images or other factors may lead to recognition results with very low recognition scores. In order to continuously improve the recognition performance of the student model, in one or more embodiments of the present specification, on the basis of the aforementioned cumulative storage of the first target sample, the second target sample corresponding to the recognition result with a very low recognition score may also be accumulated and stored. The second target sample may also be called a difficult sample. Specifically, if Figure 5 As shown, after step S105-4, the following steps S105-6 to S105-10 may also be included: corresponding to steps S105-6 to S105-10, step S108 may include the following steps S108-6 to S108-10:
[0067] Step S105-6, if it is determined that the recognition score is less than the preset score, and the number of times that the recognition score after re-recognition processing of the user to be identified is continuously less than the preset score reaches the preset number of times, the biometric feature image collected by the last recognition processing is determined as the second target sample and saved;
[0068] Specifically, if it is determined that the recognition score is less than the preset score, the biometric image of the user to be identified is re-collected, and the re-collected biometric image is identified based on the student model to obtain the recognition result; the recognition score of the recognition result is determined in the above manner, and it is determined whether the recognition score is less than the preset score; if so, the recognition process is continued in this manner to re-identify the user to be identified and obtain the corresponding recognition score. It is determined whether the number of times the recognition score is less than the preset score reaches the preset number of times. If so, the biometric image collected by the last recognition process is determined as the second target sample and saved. Among them, the preset score can be T-10, and the preset number of times can be 3 times. Accordingly, the biometric image collected by the third recognition process in the three consecutive recognition processes is determined as the second target sample and saved.
[0069] Step S105-8: If it is determined that the preset label acquisition condition is met, the label data of the second target sample is obtained from the server according to the saved second target sample; wherein the label data is generated by the teacher model.
[0070] Optionally, if it is determined that the number of the second target samples reaches a third preset number, it is determined that the preset label acquisition condition is met. Alternatively, if it is determined that the preset self-distillation training cycle is reached, it is determined that the preset label acquisition condition is met. And, when it is determined that the label acquisition condition is met, a label data acquisition request is sent to the server according to the second target sample. When the server receives the label data acquisition request, it generates label data for the second target sample based on the teacher model and sends the label data to the image acquisition device.
[0071] Step S105-10, associate the label data with the second target sample and save it, and execute step S108-6;
[0072] Step S108-6, if it is determined that the self-distillation training conditions of the student model are met, determine whether there is a second target sample and the label data of the second target sample, if yes, execute step S108-8, otherwise execute step S108-10;
[0073] Step S108-8, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample, the determined label data of the first target sample, the second target sample, and the label data of the second target sample to obtain an updated student model;
[0074] Specifically, a first target sample carrying labeled data and a second target sample carrying labeled data are determined as samples to be trained; the samples to be trained are divided into at least one training set, and based on the training set and a preset first loss function, a self-distillation training process is performed on the student model to obtain an updated student model.
[0075] Step S108-10, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled and trained using the saved first target sample and the determined label data of the first target sample to obtain an updated student model.
[0076] Furthermore, after the image acquisition device obtains the updated student model, the method further includes: performing recognition processing on the collected biometric image of the user to be identified based on the updated student model to obtain a recognition result. That is, each time the image acquisition device obtains the updated student model, the previously deployed student model is replaced with the updated student model, and after the biometric image of the user to be identified is collected, the biometric image is recognized based on the updated student model to improve the recognition accuracy.
[0077] Furthermore, in order to realize biometric recognition and model training on the image acquisition device side, in one or more embodiments of the present specification, before step S102, it also includes: receiving a student model sent by the server, and deploying the received student model in the image acquisition device.
[0078] In one or more embodiments of the present specification, a student model is obtained by performing distillation training based on a teacher model on the server side. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and it has a faster recognition rate. Therefore, by deploying the student model in an image acquisition device, the image acquisition device can perform biometric processing based on the student model with limited computing resources, and perform self-distillation training on the student model based on the accumulated first target samples; not only biometric recognition on the image acquisition device side is realized, and the risk of user privacy leakage caused by the transmission of biometric images across devices is avoided; but also periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side.
[0079] Corresponding to the model training method described above, based on the same technical concept, one or more embodiments of this specification also provide another model training method. Figure 6 A flowchart of another model training method provided for one or more embodiments of this specification, Figure 6 The method in can be Figure 1 The server executes in Figure 6 As shown, the method comprises the following steps:
[0080] Step S202, performing distillation training processing on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; wherein the training samples in the training sample set include the user's biometric features;
[0081] Specifically, the training sample set is divided into multiple training subsets; each training subset is input into the teacher model for feature extraction processing to obtain the third image feature corresponding to each training sample in the training subset; based on the training subset, the third image feature and the preset second loss function, the student network to be trained is subjected to distillation training processing to obtain the student model.
[0082] More specifically, the server divides the training sample set into multiple training subsets according to the number of samples included in the preset training subsets; inputs each training subset into the pre-trained teacher model for feature extraction processing to obtain the third image feature corresponding to each training sample in the training subset; iteratively inputs each training subset into the student network to be trained for training processing to obtain the fourth image feature corresponding to each training sample output by the student network, calculates the loss value based on the third image feature, the fourth image feature and the preset second loss function, adjusts the parameters of the student network according to the loss value, until it is determined that the preset stop training condition is met, and determines the corresponding student network as the student model.
[0083] Among them, the second loss function includes: a multi-classification loss function, a first distillation loss function and a second distillation loss function; the multi-classification loss function is used to classify the fourth image features output by the last layer of the student network; the first distillation loss function is used to characterize the degree of difference between the third image features output by the teacher model and the fourth image features output by the student network; the second distillation loss function is used to use the third image features output by the last layer of the teacher model to guide the learning process of each intermediate layer of the student network.
[0084] The second loss function can be expressed as:
[0085]
[0086] Among them, L total represents the total loss; A represents the teacher model, B represents the student network; li is the i-th layer of the student network, LB is the total number of layers of the student network; L ce (x, y) is a multi-classification loss function, which represents the classification result y of the second image feature x output by the last layer of the student network; L KD (f A , f B ) is the first distillation loss function, f A is the first image feature output by the teacher model, f BThe second image feature output by the student network; L KD-mse (F map-B-li ,Resize(F map-A-LA )) is the second distillation loss function, F map-B-1i Image features output by each intermediate layer of the student network; Resize(F map-A-LA ) is the first image feature output by the last layer of the teacher model.
[0087] Therefore, during the distillation training process, the first distillation loss function can be used to constrain the second image feature output by the student network to be as consistent as possible with the first image feature output by the teacher model. At the same time, since the information density of the first image feature output by the last layer of the teacher model is the largest, it is most suitable for distillation guidance. Therefore, in this specification, the learning process of each intermediate layer of the student network is guided by the first image feature output by the last layer of the teacher model, that is, one-to-many guidance; compared with the existing student model training process, the image features output by each intermediate layer of the teacher network are used to guide the learning of the intermediate layer of the student network, that is, one-to-one guidance; the distillation training method in this specification has a better effect.
[0088] Further, determining that a preset stop training condition is met may include: if it is determined that the loss value calculated based on the second loss function reaches a preset loss value, then determining that the preset stop training condition is met; or, if it is determined that the number of training times for each training subset reaches a preset number of times, then determining that the preset stop training condition is met. The training process of the teacher model can refer to the existing model training process, and this specification does not make specific limitations on this.
[0089] Step S204, sending the student model to the image acquisition device, so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model, and when it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training conditions of the student model are met, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample to obtain an updated student model.
[0090] Among them, the processing process of the image acquisition device after receiving the student model can be found in the relevant description in the previous article, and the repeated parts will not be repeated here.
[0091] In order to improve the performance of the student model deployed in the image acquisition device, in one or more embodiments of this specification, the server can also generate label data for the biometric image that is difficult for the student model to recognize based on the teacher model, so that the image acquisition device can perform self-distillation training on the student model based on the biometric image and its label data. Figure 7 As shown, the method may further include the following steps S206 to S210:
[0092] Step S206, receiving a label data acquisition request sent by the image acquisition device; wherein the label data request includes a second target sample of the label data to be annotated;
[0093] The label data acquisition request may also include a sample identifier of each second target sample. The sample identifier may be determined by the image acquisition device according to a preset method when saving the second target sample. The sample identifier may be, for example, a number.
[0094] Step S208, generating label data of a second target sample based on the teacher model;
[0095] Specifically, the second target sample is input into the teacher model for recognition processing, and the label data of the second target sample is determined according to the recognition result; wherein the label data is used to characterize the user identity corresponding to the biometric feature in the second target sample.
[0096] Step S210, sending the label data to the image acquisition device, so that the image acquisition device uses the first target sample, the label data of the first target sample, the second target sample and the label data of the second target sample to perform self-distillation training processing on the student model.
[0097] Specifically, the label data is associated with the sample identifier of the corresponding second target sample and sent to the image acquisition device.
[0098] In one or more embodiments of the present specification, a student model is obtained by performing distillation training based on a teacher model on the server side. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and it has a faster recognition rate. Therefore, the server side sends the student model to the image acquisition device, so that the image acquisition device can perform biometric processing based on the student model with limited computing resources, and performs self-distillation training on the student model based on the accumulated first target samples; not only biometric recognition on the image acquisition device side is realized, and the risk of user privacy leakage caused by the transmission of biometric images across devices is avoided; but also periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side.
[0099] Taking into account the characteristics of blockchain such as immutability and automatic execution of smart contracts, in one or more embodiments of this specification, the student model can also be trained through the blockchain system. Figure 8 A schematic diagram of another application scenario of model training provided in one or more embodiments of this specification, such as Figure 8 As shown, the scenario may include: a blockchain system and an image acquisition device. The blockchain system includes at least one blockchain node ( Figure 8 Only one is shown in the figure). The image acquisition device can be an IoT device with a biometric acquisition function, such as a smart attendance device, a smart access control device, a smart camera device, etc. ( Figure 8 The image acquisition device is only a smart camera device); the image acquisition device can also be a terminal device with a biometric acquisition function, such as a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, etc. ( Figure 8 Only mobile phones are shown).
[0100] Specifically, the blockchain node performs distillation training on the student network to be trained based on the acquired training sample set and the pre-trained teacher model based on the smart contract in the blockchain system to obtain the student model; wherein the training samples in the training sample set include the user's biometric features; the blockchain node sends the student model to the image acquisition device, generates training record information of the student model and saves it in the blockchain. After receiving the student model sent by the blockchain node, the image acquisition device deploys the student model in the image acquisition device, and when the biometric image of the user to be identified is acquired, the biometric image is identified based on the student model deployed by itself to obtain the identification result. If the image acquisition device determines that the biometric image meets the preset sample accumulation condition based on the identification result, the biometric image is determined as the first target sample and saved. In addition, the image acquisition device determines whether the self-distillation training condition of the student model is met. If so, the self-distillation training method based on the fusion guidance and one-to-many guidance is used to perform self-distillation training on the student model using the saved first target sample to obtain an updated student model. Wherein, the biometrics included in the biometric image can be one or more of face, fingerprint, palm print, iris, etc.
[0101] based on Figure 8 The application scenario architecture shown corresponds to the model training method described above. Based on the same technical concept, one or more embodiments of this specification also provide another model training method. Fig. 9 A flowchart of another model training method provided for one or more embodiments of this specification, Fig. 9 The method in can be Figure 8 The blockchain system in Fig. 9 As shown, the method comprises the following steps:
[0102] Step S302, based on the smart contract in the blockchain system, performing distillation training processing on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; wherein the training samples in the training sample set include the user's biometric features;
[0103] Specifically, when it is determined that the distillation training conditions are met (for example, when a distillation training instruction is received), the smart contract deployed in the blockchain system is called, and the student network to be trained is subjected to distillation training based on the obtained training sample set and the pre-trained teacher model to obtain the student model. The process of performing distillation training on the student network to be trained according to the obtained training sample set and the pre-trained teacher model to obtain the student model can be referred to the above-mentioned related description, and the repeated parts will not be repeated here.
[0104] Step S304, sending the student model to the image acquisition device, so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model, and when it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training condition of the student model is met, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample to obtain an updated student model;
[0105] Among them, the operations after the image acquisition device receives the student model can be found in the relevant description above, and the repeated parts will not be repeated here.
[0106] Step S306, generate training record information of the student model and save it to the blockchain system.
[0107] Specifically, the training record information of the student model is generated and saved in the blockchain system according to the training time of the student model, the version information of the determined student model, etc. Among them, the specific content of the training record information can be set according to the actual application as needed, and this specification does not make specific restrictions on this.
[0108] In one or more embodiments of this specification, a student model is obtained by distillation training based on a teacher model in a blockchain system. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and the student model has a faster recognition rate. Therefore, the blockchain system sends the student model to the image acquisition device, so that the image acquisition device can perform biometric processing based on the student model under limited computing resources, and self-distill the student model based on the accumulated first target sample; not only the biometric recognition on the image acquisition device side is realized, but also the risk of user privacy leakage caused by the cross-device transmission of biometric images is avoided; and periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side. Furthermore, distillation training based on smart contracts can improve the efficiency of distillation training and the accuracy of the student model based on the characteristics of automatic execution of smart contracts and no human participation. By saving the training record information of the student model to the blockchain system, the distillation training of the student model can be traced based on the characteristics of the blockchain such as non-tamperability.
[0109] Corresponding to the model training method described above, based on the same technical concept, one or more embodiments of this specification also provide a model training device, which is applied to an image acquisition device. Fig.10 A schematic diagram of the module composition of a model training device provided in one or more embodiments of this specification, such as Fig.10 As shown, the device comprises:
[0110] The acquisition module 401 acquires a biometric image of a user to be identified;
[0111] The recognition module 402 performs recognition processing on the biometric image based on the student model to obtain a recognition result; wherein the student model is obtained by the server performing distillation training on the student network to be trained based on the pre-trained teacher model;
[0112] A first determination module 403, if it is determined according to the recognition result that the biometric image meets a preset sample accumulation condition, then the biometric image is determined as a first target sample and saved;
[0113] A second determination module 404 determines whether the self-distillation training condition of the student model is met;
[0114] Self-distillation training module 405, if the determination result of the second determination module is yes, then based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample to obtain an updated student model.
[0115] Optionally, the device further includes a third determining module;
[0116] The third determination module obtains a first image feature of the biometric image corresponding to the recognition result and a second image feature of the reference biometric image of the user to be recognized; and determines a recognition score of the recognition result according to the first image feature and the second image feature;
[0117] Correspondingly, the second determination module 404 determines that the biometric image satisfies a preset sample accumulation condition if it is determined that the recognition score is within a preset first score interval.
[0118] Optionally, the self-distillation training module 405 divides the first target sample into at least one training set; and
[0119] Based on the training set and a preset first loss function, performing self-distillation training processing on the student model to obtain an updated student model;
[0120] Among them, the first loss function includes: a multi-classification loss function, a first self-distillation loss function and a second self-distillation loss function; the multi-classification loss function is used to classify the image features output by each layer of the student model; the first self-distillation loss function is used to use the fusion classification result obtained by fusing the classification results of each layer of the student model to guide the classification result of each layer of the student model; the second self-distillation loss function is used to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
[0121] The model training device provided by one or more embodiments of the present specification uses a student model to perform recognition processing on the biometric image of the user to be recognized, and when it is determined that the self-distillation training conditions of the student model are met, the student model is self-distilled and trained using the first target sample saved to obtain an updated student model; wherein the student model is obtained by the server through distillation training based on the teacher model. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and the student model has a faster recognition rate. Therefore, by deploying the student model on the image acquisition device, the model training device can perform biometric processing based on the student model under the condition of limited computing resources of the image acquisition device, and self-distill the student model based on the accumulated first target sample; not only the biometric recognition on the image acquisition device side is realized, and the risk of user privacy leakage caused by the cross-device transmission of the biometric image is avoided; but also the periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side.
[0122] Corresponding to the model training method described above, based on the same technical concept, one or more embodiments of this specification also provide another model training device, which is applied to the server. Fig.11 A schematic diagram of the module composition of another model training device provided in one or more embodiments of this specification, such as Fig.11 As shown, the device comprises:
[0123] A distillation training module 501 performs distillation training processing on a student network to be trained according to an acquired training sample set and a pre-trained teacher model to obtain a student model; the training samples in the training sample set include biometric features of the user;
[0124] The sending module 502 sends the student model to the image acquisition device, so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model, and when it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training condition of the student model is met, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample to obtain an updated student model.
[0125] Optionally, the distillation training module 501 divides the training sample set into a plurality of training subsets; and
[0126] Input each of the training subsets into the teacher model for feature extraction processing to obtain a third image feature corresponding to each training sample in the training subset;
[0127] Based on the training subset, the third image feature and a preset second loss function, performing a distillation training process on the student network to be trained;
[0128] Among them, the second loss function includes: a multi-classification loss function, a first distillation loss function and a second distillation loss function; the multi-classification loss function is used to classify the fourth image features output by the last layer of the student network; the first distillation loss function is used to characterize the degree of difference between the third image features output by the teacher model and the fourth image features output by the student network; the second distillation loss function is used to use the third image features output by the last layer of the teacher model to guide the learning process of each intermediate layer of the student network.
[0129] The model training device provided in one or more embodiments of the present specification performs distillation training based on the teacher model to obtain a student model. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and it has a faster recognition rate. Therefore, by sending the student model to the image acquisition device, the image acquisition device can perform biometric processing based on the student model with limited computing resources, and perform self-distillation training on the student model based on the accumulated first target samples; not only biometric recognition on the image acquisition device side is realized, and the risk of user privacy leakage caused by the cross-device transmission of biometric images is avoided; but also periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side.
[0130] Corresponding to the model training method described above, based on the same technical concept, one or more embodiments of this specification also provide another model training device applied to the blockchain system. Fig.12 A schematic diagram of the module composition of another model training device provided in one or more embodiments of this specification, such as Fig.12 As shown, the device comprises:
[0131] The distillation training module 601 performs distillation training processing on the student network to be trained according to the acquired training sample set and the pre-trained teacher model based on the smart contract in the blockchain system to obtain a student model; the training samples in the training sample set include the user's biometric features;
[0132] The sending module 602 sends the student model to the image acquisition device, so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model, and when it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training condition of the student model is met, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the first target sample saved to obtain an updated student model.
[0133] The saving module 603 generates the training record information of the student model and saves it to the blockchain system.
[0134] The model training device provided by one or more embodiments of this specification performs distillation training based on the teacher model in the blockchain system to obtain a student model. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and has a faster recognition rate. Therefore, by sending the student model to the image acquisition device, the image acquisition device can perform biometric processing based on the student model under limited computing resources, and self-distill the student model based on the accumulated first target sample; not only the biometric recognition on the image acquisition device side is realized, and the risk of user privacy leakage caused by the cross-device transmission of biometric images is avoided; but also the periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side. Furthermore, the distillation training processing based on the smart contract can improve the efficiency of the distillation training and the accuracy of the student model based on the characteristics of automatic execution of the smart contract and no human participation. By saving the training record information of the student model in the blockchain system, the distillation training of the student model can be traced based on the characteristics of the blockchain such as the non-tamperability.
[0135] It should be noted that the embodiments of the model training device in this specification and the embodiments of the model training method in this specification are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0136] Furthermore, corresponding to the model training method described above, based on the same technical concept, one or more embodiments of this specification also provide a model training system. Fig.13 A schematic diagram of the composition of a model training system provided in one or more embodiments of this specification, such as Fig.13 As shown, the system includes: a server 701 and an image acquisition device 702;
[0137] The server 701 performs distillation training on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; sends the student model to the image acquisition device 702; the training samples in the training sample set include the user's biometric features;
[0138] The image acquisition device 702 acquires a biometric image of a user to be identified; performs identification processing on the biometric image based on the received student model to obtain an identification result; if it is determined according to the identification result that the biometric image satisfies a preset sample accumulation condition, the biometric image is determined as a first target sample and saved; determines whether the self-distillation training condition of the student model is met; if so, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample to obtain an updated student model.
[0139] The model training system provided by one or more embodiments of the present specification performs distillation training based on the teacher model on the server side to obtain a student model. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and it has a faster recognition rate. Therefore, the server side sends the student model to the image acquisition device, so that the image acquisition device can perform biometric processing based on the student model under limited computing resources, and performs self-distillation training on the student model based on the accumulated first target samples; not only biometric recognition on the image acquisition device side is realized, and the risk of user privacy leakage caused by the cross-device transmission of biometric images is avoided; but also periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side.
[0140] Furthermore, corresponding to the model training method described above, based on the same technical concept, one or more embodiments of this specification also provide a model training system. Fig.14 A schematic diagram of the composition of a model training system provided in one or more embodiments of this specification, such as Fig.14 As shown, the system includes: a blockchain system 801 and an image acquisition device 802;
[0141] The blockchain system 801, based on the smart contract in the blockchain system, performs distillation training processing on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; sends the student model to the image acquisition device 802; and generates training record information of the student model and saves it in the blockchain system 801; the training samples in the training sample set include the user's biometric features;
[0142] The image acquisition device 802 acquires a biometric image of a user to be identified; performs identification processing on the biometric image based on the received student model to obtain an identification result; if it is determined according to the identification result that the biometric image meets a preset sample accumulation condition, the biometric image is determined as a first target sample and saved; determines whether the self-distillation training condition of the student model is met; if so, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample to obtain an updated student model.
[0143] The model training system provided by one or more embodiments of this specification performs distillation training based on the teacher model in the blockchain system to obtain a student model. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and has a faster recognition rate, the blockchain system sends the student model to the image acquisition device, so that the image acquisition device can perform biometric processing based on the student model under limited computing resources, and self-distill the student model based on the accumulated first target sample; not only the biometric recognition on the image acquisition device side is realized, and the risk of user privacy leakage caused by the cross-device transmission of biometric images is avoided; but also the periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side. Furthermore, the distillation training processing based on the smart contract can improve the efficiency of the distillation training and the accuracy of the student model based on the characteristics of automatic execution of the smart contract and no human participation. By saving the training record information of the student model to the blockchain system, the distillation training of the student model can be traced based on the characteristics of the blockchain such as the non-tamperability.
[0144] It should be noted that the embodiments of the model training system in this specification and the embodiments of the model training method in this specification are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0145] Furthermore, corresponding to the model training method described above, based on the same technical concept, one or more embodiments of this specification also provide a model training device, which is used to execute the above-mentioned model training method. Fig.15 A schematic diagram of the structure of a model training device provided for one or more embodiments of this specification.
[0146] like Fig.15 As shown, the model training device may have relatively large differences due to different configurations or performances, and may include one or more processors 901 and memory 902, and the memory 902 may store one or more storage applications or data. Among them, the memory 902 can be a short-term storage or a persistent storage. The application stored in the memory 902 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the model training device. Furthermore, the processor 901 can be configured to communicate with the memory 902 and execute a series of computer executable instructions in the memory 902 on the model training device. The model training device may also include one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input and output interfaces 905, one or more keyboards 906, etc.
[0147] In a specific embodiment, the model training device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the model training device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0148] Collecting biometric images of the user to be identified;
[0149] The biometric image is recognized and processed based on the student model to obtain a recognition result; wherein the student model is obtained by the server performing distillation training on the student network to be trained based on the pre-trained teacher model;
[0150] If it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as a first target sample and saved;
[0151] Determine whether the self-distillation training conditions of the student model are met. If so, based on the self-distillation training method of fusion guidance and one-to-many guidance, use the saved first target sample to perform self-distillation training on the student model to obtain an updated student model.
[0152] Optionally, when the computer executable instructions are executed, the self-distillation training method based on fusion guidance and one-to-many guidance uses the saved first target sample to perform self-distillation training on the student model to obtain an updated student model, including:
[0153] Dividing the first target sample into at least one training set;
[0154] Based on the training set and a preset first loss function, performing self-distillation training processing on the student model to obtain an updated student model;
[0155] Among them, the first loss function includes: a multi-classification loss function, a first self-distillation loss function and a second self-distillation loss function; the multi-classification loss function is used to classify the image features output by each layer of the student model; the first self-distillation loss function is used to use the fusion classification result obtained by fusing the classification results of each layer of the student model to guide the classification result of each layer of the student model; the second self-distillation loss function is used to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
[0156] The model training device provided by one or more embodiments of the present specification uses a student model to perform recognition processing on the biometric image of the user to be recognized, and when it is determined that the self-distillation training conditions of the student model are met, the student model is self-distilled and trained using the first target sample saved to obtain an updated student model; wherein the student model is obtained by the server through distillation training based on the teacher model. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and it has a faster recognition rate. Therefore, by deploying the student model on the model training device, the model training device can perform biometric processing based on the student model under limited computing resources, and self-distill the student model based on the accumulated first target sample; not only biometric recognition on the device side is realized, the risk of user privacy leakage caused by the cross-device transmission of biometric images is avoided; but also periodic model training on the device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side.
[0157] In another specific embodiment, the model training device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the model training device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0158] Performing distillation training on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; the training samples in the training sample set include the user's biometric features;
[0159] The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model; when it is determined according to the recognition result that the biometric image meets a preset sample accumulation condition, the biometric image is determined as a first target sample and saved; and when it is determined that the self-distillation training conditions of the student model are met, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample to obtain an updated student model.
[0160] Optionally, when the computer executable instructions are executed, performing distillation training processing on the student network to be trained according to the acquired training samples and the pre-trained teacher model includes:
[0161] Dividing the training sample set into a plurality of training subsets;
[0162] Input each of the training subsets into the teacher model for feature extraction processing to obtain a third image feature corresponding to each training sample in the training subset;
[0163] Based on the training subset, the third image feature and a preset second loss function, performing a distillation training process on the student network to be trained;
[0164] Among them, the second loss function includes: a multi-classification loss function, a first distillation loss function and a second distillation loss function; the multi-classification loss function is used to classify the fourth image features output by the last layer of the student network; the first distillation loss function is used to characterize the degree of difference between the third image features output by the teacher model and the fourth image features output by the student network; the second distillation loss function is used to use the third image features output by the last layer of the teacher model to guide the learning process of each intermediate layer of the student network.
[0165] The model training device provided in one or more embodiments of the present specification performs distillation training based on the teacher model to obtain a student model. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and it has a faster recognition rate. Therefore, by sending the student model to the image acquisition device, the image acquisition device can perform biometric processing based on the student model with limited computing resources, and perform self-distillation training on the student model based on the accumulated first target samples; not only biometric recognition on the image acquisition device side is realized, and the risk of user privacy leakage caused by the cross-device transmission of biometric images is avoided; but also periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side.
[0166] In another specific embodiment, the model training device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the model training device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0167] Based on the smart contract in the blockchain system, a student network to be trained is subjected to distillation training processing according to the acquired training sample set and the pre-trained teacher model to obtain a student model; the training samples in the training sample set include the user's biometric features;
[0168] Sending the student model to an image acquisition device so that the image acquisition device performs recognition processing on the collected biometric image of the user to be recognized based on the student model, and when it is determined according to the recognition result that the biometric image meets a preset sample accumulation condition, determining the biometric image as a first target sample and saving it; and when it is determined that the self-distillation training condition of the student model is met, based on the self-distillation training method of fusion guidance and one-to-many guidance, using the saved first target sample to perform self-distillation training processing on the student model to obtain an updated student model;
[0169] Generate training record information of the student model and save it in the blockchain system.
[0170] The model training device provided by one or more embodiments of this specification performs distillation training based on the teacher model in the blockchain system to obtain a student model. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and has a faster recognition rate. Therefore, by sending the student model to the image acquisition device, the image acquisition device can perform biometric processing based on the student model under limited computing resources, and self-distill the student model based on the accumulated first target sample; not only the biometric recognition on the image acquisition device side is realized, and the risk of user privacy leakage caused by the cross-device transmission of biometric images is avoided; but also the periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side. Furthermore, the distillation training processing based on the smart contract can improve the efficiency of the distillation training and the accuracy of the student model based on the characteristics of automatic execution of the smart contract and no human participation. By saving the training record information of the student model in the blockchain system, the distillation training of the student model can be traced based on the characteristics of the blockchain such as the non-tamperability.
[0171] It should be noted that the embodiments of the model training device in this specification and the embodiments of the model training method in this specification are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0172] Furthermore, corresponding to the model training method described above, based on the same technical concept, one or more embodiments of this specification further provide a storage medium for storing computer executable instructions. In a specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instructions stored in the storage medium are executed by the processor, the following process can be implemented:
[0173] Collecting biometric images of the user to be identified;
[0174] The biometric image is recognized and processed based on the student model to obtain a recognition result; wherein the student model is obtained by the server performing distillation training on the student network to be trained based on the pre-trained teacher model;
[0175] If it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as a first target sample and saved;
[0176] Determine whether the self-distillation training conditions of the student model are met. If so, based on the self-distillation training method of fusion guidance and one-to-many guidance, use the saved first target sample to perform self-distillation training on the student model to obtain an updated student model.
[0177] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, the self-distillation training method based on fusion guidance and one-to-many guidance uses the first target sample stored to perform self-distillation training on the student model to obtain an updated student model, including:
[0178] Dividing the first target sample into at least one training set;
[0179] Based on the training set and a preset first loss function, performing self-distillation training processing on the student model to obtain an updated student model;
[0180] Among them, the first loss function includes: a multi-classification loss function, a first self-distillation loss function and a second self-distillation loss function; the multi-classification loss function is used to classify the image features output by each layer of the student model; the first self-distillation loss function is used to use the fusion classification result obtained by fusing the classification results of each layer of the student model to guide the classification result of each layer of the student model; the second self-distillation loss function is used to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
[0181] When the computer executable instructions stored in the storage medium provided in one or more embodiments of the present specification are executed by the processor, the student model is used to perform recognition processing on the biometric image of the user to be recognized, and when it is determined that the self-distillation training conditions of the student model are met, the student model is self-distilled and trained using the first target sample saved to obtain an updated student model; wherein the student model is obtained by the server through distillation training based on the teacher model. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and the student model has a faster recognition rate. Therefore, by deploying the student model on the image acquisition device, the image acquisition device can perform biometric processing based on the student model under limited computing resources, and self-distill the student model based on the accumulated first target sample; not only the biometric recognition on the image acquisition device side is realized, but also the risk of user privacy leakage caused by the cross-device transmission of the biometric image is avoided; and periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side.
[0182] In another specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instructions stored in the storage medium are executed by the processor, the following process can be implemented:
[0183] Performing distillation training on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; the training samples in the training sample set include the user's biometric features;
[0184] The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model; when it is determined according to the recognition result that the biometric image meets a preset sample accumulation condition, the biometric image is determined as a first target sample and saved; and when it is determined that the self-distillation training conditions of the student model are met, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample to obtain an updated student model.
[0185] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, performing distillation training processing on the student network to be trained according to the acquired training samples and the pre-trained teacher model includes:
[0186] Dividing the training sample set into a plurality of training subsets;
[0187] Input each of the training subsets into the teacher model for feature extraction processing to obtain a third image feature corresponding to each training sample in the training subset;
[0188] Based on the training subset, the third image feature and a preset second loss function, performing a distillation training process on the student network to be trained;
[0189] Among them, the second loss function includes: a multi-classification loss function, a first distillation loss function and a second distillation loss function; the multi-classification loss function is used to classify the fourth image features output by the last layer of the student network; the first distillation loss function is used to characterize the degree of difference between the third image features output by the teacher model and the fourth image features output by the student network; the second distillation loss function is used to use the third image features output by the last layer of the teacher model to guide the learning process of each intermediate layer of the student network.
[0190] The computer executable instructions stored in the storage medium provided in one or more embodiments of the present specification, when executed by the processor, perform distillation training based on the teacher model to obtain a student model. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and it has a faster recognition rate. Therefore, by sending the student model to the image acquisition device, the image acquisition device can perform biometric processing based on the student model with limited computing resources, and perform self-distillation training on the student model based on the accumulated first target samples; not only biometric recognition on the image acquisition device side is realized, and the risk of user privacy leakage caused by the cross-device transmission of biometric images is avoided; but also periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric recognition on the image acquisition device side.
[0191] In another specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instructions stored in the storage medium are executed by the processor, the following process can be implemented:
[0192] Based on the smart contract in the blockchain system, a student network to be trained is subjected to distillation training processing according to the acquired training sample set and the pre-trained teacher model to obtain a student model; the training samples in the training sample set include the user's biometric features;
[0193] Sending the student model to an image acquisition device so that the image acquisition device performs recognition processing on the collected biometric image of the user to be recognized based on the student model, and when it is determined according to the recognition result that the biometric image meets a preset sample accumulation condition, determining the biometric image as a first target sample and saving it; and when it is determined that the self-distillation training condition of the student model is met, based on the self-distillation training method of fusion guidance and one-to-many guidance, using the saved first target sample to perform self-distillation training processing on the student model to obtain an updated student model;
[0194] Generate training record information of the student model and save it in the blockchain system.
[0195] When the computer executable instructions stored in the storage medium provided in one or more embodiments of this specification are executed by the processor, a student model is obtained by distillation training based on the teacher model in the blockchain system. Since the student model has similar biometric performance to the teacher model, but the structure of the student model is simpler than that of the teacher model, the number of parameters required by the student model in the recognition process is much smaller than that of the teacher model, and it has a faster recognition rate. Therefore, by sending the student model to the image acquisition device, the image acquisition device can perform biometric processing based on the student model under limited computing resources, and self-distill the student model based on the accumulated first target sample; not only biometric identification on the image acquisition device side is realized, and the risk of user privacy leakage caused by the cross-device transmission of biometric images is avoided; but also periodic model training on the image acquisition device side is realized, which can continuously improve the performance of the student model, thereby improving the accuracy of biometric identification on the image acquisition device side. Furthermore, distillation training processing based on smart contracts can improve the efficiency of distillation training and the accuracy of student models based on the characteristics of automatic execution of smart contracts and no human participation. By saving the training record information of the student model in the blockchain system, the distillation training of the student model can be traced based on the blockchain's immutable characteristics.
[0196] It should be noted that the embodiments of the storage medium in this specification and the embodiments of the model training method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0197] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0198] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0199] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0200] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0201] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0202] It should be understood by those skilled in the art that one or more embodiments of this specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0203] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0204] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0205] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0206] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0207] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0208] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0209] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0210] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0211] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0212] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. A model training method, applied to an image acquisition device, comprising: Collecting biometric images of the user to be identified; The biometric image is recognized and processed based on the student model to obtain a recognition result; wherein the student model is obtained by the server performing distillation training on the student network to be trained based on the pre-trained teacher model; If it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as a first target sample and saved; Determine whether the self-distillation training conditions of the student model are met. If so, based on the self-distillation training method of fusion guidance and one-to-many guidance, use the first target sample saved to perform self-distillation training on the student model to obtain an updated student model; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification result of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
2. The method according to claim 1, after performing recognition processing on the biometric image based on the student model and obtaining the recognition result, further comprises: Acquire a first image feature of the biometric image corresponding to the recognition result and a second image feature of a reference biometric image of the user to be recognized; determining a recognition score of the recognition result according to the first image feature and the second image feature; If it is determined according to the recognition result that the biometric image meets a preset sample accumulation condition, it includes: If it is determined that the recognition score is within a preset first score interval, it is determined that the biometric image meets a preset sample accumulation condition.
3. The method according to claim 2, wherein determining the recognition score of the recognition result according to the first image feature and the second image feature comprises: Calculating the cosine similarity between the first image feature and the second image feature; According to a preset recognition score calculation method, a recognition score of the recognition result is calculated based on the cosine similarity.
4. According to the method of claim 1, the self-distillation training method based on fusion guidance and one-to-many guidance, using the first target sample saved to perform self-distillation training on the student model to obtain an updated student model, comprises: Dividing the first target sample into at least one training set; Based on the training set and a preset first loss function, performing self-distillation training processing on the student model to obtain an updated student model; Among them, the first loss function includes: a multi-classification loss function, a first self-distillation loss function and a second self-distillation loss function; the multi-classification loss function is used to classify the image features output by each layer of the student model; the first self-distillation loss function is used to use the fusion classification result obtained by fusing the classification results of each layer of the student model to guide the classification result of each layer of the student model; the second self-distillation loss function is used to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
5. The method according to claim 2, after determining the recognition score of the recognition result according to the first image feature and the second image feature, further comprising: If it is determined that the recognition score is less than the preset score, and the number of times that the recognition score is continuously less than the preset score after the user to be recognized is re-recognized reaches the preset number of times, the biometric feature image collected by the last recognition process is determined as the second target sample and saved; If it is determined that the preset label acquisition condition is met, the label data of the second target sample is acquired from the server according to the saved second target sample; wherein the label data is generated by the teacher model; Associating the label data with the second target sample and saving it; The method of performing self-distillation training on the student model by using the first target sample saved to obtain an updated student model includes: Determine whether the second target sample and the label data exist; If so, the student model is self-distilled using the saved first target sample, the determined label data of the first target sample, the second target sample, and the label data of the second target sample to obtain an updated student model.
6. The method according to claim 1, after obtaining the updated student model, further comprising: Based on the updated student model, recognition processing is performed on the collected biometric image of the user to be recognized to obtain a recognition result.
7. The method according to claim 1, before performing recognition processing on the collected biometric feature image of the user to be recognized based on the student model, further comprising: Receiving the student model sent by the server; The student model is deployed in the image acquisition device.
8. A model training method, comprising: Performing distillation training on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; The training samples in the training sample set include biometric features of the user; The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training condition of the student model is met, the student model is self-distilled using the first target sample saved to obtain an updated student model based on the self-distillation training method of fusion guidance and one-to-many guidance; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification result of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
9. The method according to claim 8, wherein the step of performing distillation training on the student network to be trained based on the acquired training samples and the pre-trained teacher model comprises: Dividing the training sample set into a plurality of training subsets; Input each of the training subsets into the teacher model for feature extraction processing to obtain a third image feature corresponding to each training sample in the training subset; Based on the training subset, the third image feature and a preset second loss function, performing a distillation training process on the student network to be trained; Among them, the second loss function includes: a multi-classification loss function, a first distillation loss function and a second distillation loss function; the multi-classification loss function is used to classify the fourth image features output by the last layer of the student network; the first distillation loss function is used to characterize the degree of difference between the third image features output by the teacher model and the fourth image features output by the student network; the second distillation loss function is used to use the third image features output by the last layer of the teacher model to guide the learning process of each intermediate layer of the student network.
10. The method according to claim 8, further comprising: Receiving a label data acquisition request sent by the image acquisition device; The label data request includes a second target sample of the label data to be labeled; Generate label data of the second target sample based on the teacher model; The label data is sent to the image acquisition device so that the image acquisition device performs self-distillation training processing on the student model using the first target sample, the label data of the first target sample, the second target sample and the label data of the second target sample.
11. A model training method, comprising: Based on the smart contract in the blockchain system, the student network to be trained is distilled and trained according to the acquired training sample set and the pre-trained teacher model to obtain the student model; The training samples in the training sample set include biometric features of the user; The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training condition of the student model is met, the student model is self-distilled using the first target sample saved to obtain an updated student model based on the self-distillation training method of fusion guidance and one-to-many guidance; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification results of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer; Generate training record information of the student model and save it in the blockchain system.
12. A model training device, applied to an image acquisition device, comprising: A collection module, which collects biometric images of the user to be identified; A recognition module performs recognition processing on the biometric image based on a student model to obtain a recognition result; wherein the student model is obtained by performing distillation training on a student network to be trained based on a pre-trained teacher model at the server end; a first determination module, which determines the biometric image as a first target sample and saves it if it is determined according to the recognition result that the biometric image meets a preset sample accumulation condition; A second determination module determines whether the self-distillation training conditions of the student model are met; Self-distillation training module, if the determination result of the second determination module is yes, then based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled and trained using the first target sample saved to obtain an updated student model; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification result of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
13. A model training device, comprising: The distillation training module performs distillation training on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; The training samples in the training sample set include biometric features of the user; A sending module sends the student model to an image acquisition device so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training condition of the student model is met, the student model is self-distilled using the first target sample saved to obtain an updated student model based on the self-distillation training method of fusion guidance and one-to-many guidance; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification results of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
14. A model training device, comprising: A distillation training module, based on the smart contract in the blockchain system, performs distillation training processing on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; the training samples in the training sample set include the user's biometric features; A sending module sends the student model to an image acquisition device, so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model, and when it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training condition of the student model is met, the student model is self-distilled using the first target sample saved to obtain an updated student model based on the self-distillation training method of fusion guidance and one-to-many guidance; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification results of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer; The saving module generates the training record information of the student model and saves it to the blockchain system.
15. A model training system, comprising: Server and image acquisition device; The server performs distillation training on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; sends the student model to the image acquisition device; the training samples in the training sample set include the user's biometric features; The image acquisition device acquires a biometric image of a user to be identified; performs identification processing on the biometric image based on the received student model to obtain an identification result; if it is determined according to the identification result that the biometric image meets a preset sample accumulation condition, the biometric image is determined as a first target sample and saved; determines whether the self-distillation training condition of the student model is met; if so, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample to obtain an updated student model; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification results of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
16. A model training system, comprising: Blockchain system and image acquisition equipment; The blockchain system, based on the smart contract in the blockchain system, performs distillation training processing on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; sends the student model to the image acquisition device; and generates training record information of the student model and saves it to the blockchain system; the training samples in the training sample set include the user's biometric features; The image acquisition device acquires a biometric image of a user to be identified; performs identification processing on the biometric image based on the received student model to obtain an identification result; if it is determined according to the identification result that the biometric image meets a preset sample accumulation condition, the biometric image is determined as a first target sample and saved; determines whether the self-distillation training condition of the student model is met; if so, based on the self-distillation training method of fusion guidance and one-to-many guidance, the student model is self-distilled using the saved first target sample to obtain an updated student model; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification results of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
17. A model training device, comprising: processor; as well as, a memory arranged to store computer executable instructions which, when executed, cause the processor to: Collecting biometric images of the user to be identified; The biometric image is recognized and processed based on the student model to obtain a recognition result; wherein the student model is obtained by the server performing distillation training on the student network to be trained based on the pre-trained teacher model; If it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as a first target sample and saved; Determine whether the self-distillation training conditions of the student model are met. If so, based on the self-distillation training method of fusion guidance and one-to-many guidance, use the first target sample saved to perform self-distillation training on the student model to obtain an updated student model; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification result of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
18. A model training device, comprising: processor; as well as, a memory arranged to store computer executable instructions which, when executed, cause the processor to: Performing distillation training on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; the training samples in the training sample set include the user's biometric features; The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training condition of the student model is met, the student model is self-distilled using the first target sample saved to obtain an updated student model based on the self-distillation training method of fusion guidance and one-to-many guidance; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification result of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
19. A model training device, comprising: processor; as well as, a memory arranged to store computer executable instructions which, when executed, cause the processor to: Based on the smart contract in the blockchain system, a student network to be trained is subjected to distillation training processing according to the acquired training sample set and the pre-trained teacher model to obtain a student model; the training samples in the training sample set include the user's biometric features; The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training condition of the student model is met, the student model is self-distilled using the first target sample saved to obtain an updated student model based on the self-distillation training method of fusion guidance and one-to-many guidance; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification results of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer; Generate training record information of the student model and save it in the blockchain system.
20. A storage medium for storing computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the following process: Collecting biometric images of the user to be identified; The biometric image is identified and processed based on the student model to obtain an identification result; wherein, The student model is obtained by performing distillation training on the student network to be trained based on the pre-trained teacher model by the server; If it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as a first target sample and saved; Determine whether the self-distillation training conditions of the student model are met. If so, based on the self-distillation training method of fusion guidance and one-to-many guidance, use the first target sample saved to perform self-distillation training on the student model to obtain an updated student model; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification result of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
21. A storage medium for storing computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the following process: Performing distillation training on the student network to be trained according to the acquired training sample set and the pre-trained teacher model to obtain a student model; the training samples in the training sample set include the user's biometric features; The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training condition of the student model is met, the student model is self-distilled using the first target sample saved to obtain an updated student model based on the self-distillation training method of fusion guidance and one-to-many guidance; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification result of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer.
22. A storage medium for storing computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the following process: Based on the smart contract in the blockchain system, a student network to be trained is subjected to distillation training processing according to the acquired training sample set and the pre-trained teacher model to obtain a student model; the training samples in the training sample set include the user's biometric features; The student model is sent to an image acquisition device so that the image acquisition device performs recognition processing on the collected biometric image of the user to be identified based on the student model. When it is determined according to the recognition result that the biometric image meets the preset sample accumulation condition, the biometric image is determined as the first target sample and saved; and when it is determined that the self-distillation training condition of the student model is met, the student model is self-distilled using the first target sample saved to obtain an updated student model based on the self-distillation training method of fusion guidance and one-to-many guidance; the self-distillation training process includes classification processing of image features output by each layer of the student model; the fusion guidance is to guide the classification results of each layer of the student model by adopting the fusion classification result obtained by fusing the classification results of each layer of the student model; the one-to-many guidance is to use the image features output by the last layer of the student model to guide the learning process of each layer of the student model except the last layer; Generate training record information of the student model and save it in the blockchain system.
