Training methods, devices, equipment, and storage media for face recognition models

CN114463798BActive Publication Date: 2026-08-14BEIJING 360 INTELLIGENT TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-22
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]本发明的主要目的在于提供一种人脸识别模型的训练方法、装置、设备及存储介质,旨在解决现有人脸识别技术的训练方法无法很好的满足适用嵌入式或移动端小模型的训练速度和精度的技术问题

Benefits of technology

[0070]本发明通过根据初始学生检测模型对人脸样本图像进行识别,获得第一输出特征;根据初始教师检测模型对所述人脸样本图像进行识别,获得第二输出特征;根据预设三元损失函数确定所述第一输出特征与所述第二输出特征之间的损失参数;根据所述损失参数更新所述初始学生检测模型的参数,以获得目标人脸识别模型。本发明中,知识蒸馏技术为通过引入初始教师检测模型对低复杂度的初始学生检测模型进行训练,实现知识迁移,结合三元损失和知识蒸馏技术训练小模型即初始学生检测模型,以获得目标人脸识别模型,可以减少目标人脸识别模型的训练迭代时间,可以提高目标人脸识别模型精度,解决了现有人脸识别技术的训练方法无法很好的满足适用嵌入式或移动端小模型的训练速度和精度的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114463798B_ABST
    Figure CN114463798B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of face recognition technology and discloses a training method, apparatus, device, and storage medium for a face recognition model. The method involves recognizing face sample images using an initial student detection model to obtain a first output feature; recognizing face sample images using an initial teacher detection model to obtain a second output feature; determining a loss parameter between the first and second output features based on a preset ternary loss function; and updating the parameters of the initial student detection model based on the loss parameter to obtain a target face recognition model. The knowledge distillation technique in this invention involves introducing an initial teacher detection model to train a low-complexity initial student detection model, achieving knowledge transfer. Combining ternary loss and knowledge distillation techniques to train a small model, i.e., the initial student detection model, to obtain the target face recognition model can reduce the training iteration time of the target face recognition model and improve its accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of facial recognition technology, and in particular to a method, apparatus, device, and storage medium for training a facial recognition model. Background Technology

[0002] Facial recognition is a biometric technology that identifies individuals based on their facial features. It is primarily used in security, finance, and entertainment. Deep learning-based facial recognition relies on massive amounts of data for training. Limited by machine memory, classification-based training methods cannot support training with hundreds of millions of face IDs. While ternary loss-based methods can support an infinite number of face IDs, their convergence speed is slow. Furthermore, considering user privacy, many applications require extracting facial recognition features from embedded devices or mobile devices. Existing training methods cannot adequately meet the speed and accuracy requirements for training small models suitable for embedded or mobile devices.

[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main objective of this invention is to provide a training method, apparatus, device, and storage medium for a face recognition model, aiming to solve the technical problem that existing face recognition technology training methods cannot adequately meet the training speed and accuracy requirements for small embedded or mobile models.

[0005] To achieve the above objectives, the present invention provides a method for training a face recognition model, the method comprising the following steps:

[0006] The face sample images are identified based on the initial student detection model to obtain the first output feature;

[0007] The face sample image is identified based on the initial teacher detection model to obtain the second output feature;

[0008] The loss parameters between the first output feature and the second output feature are determined according to a preset ternary loss function;

[0009] The parameters of the initial student detection model are updated based on the loss parameters to obtain the target face recognition model.

[0010] Optionally, the step of determining the loss parameter between the first output feature and the second output feature according to a preset ternary loss function includes:

[0011] The mean squared error loss parameter between the initial student detection model and the initial teacher detection model is determined based on the first output feature and the second output feature.

[0012] The similarity between the first output feature and the preset positive and negative samples is calculated to determine the ternary loss parameters;

[0013] Based on the preset ternary loss function, the distillation loss parameter is determined according to the mean squared error loss parameter and the ternary loss parameter, and the distillation loss parameter is used as the loss parameter.

[0014] Optionally, the step of calculating the similarity between the first output feature and the preset positive and negative samples to determine the ternary loss parameter includes:

[0015] Select the first output feature map corresponding to the first output feature from the output feature map of the initial student detection model;

[0016] The similarity is calculated based on the first output feature map and the preset positive and negative samples to determine the ternary loss parameters.

[0017] Optionally, the step of calculating the similarity between the first output feature map and preset positive and negative samples to determine the ternary loss parameter includes:

[0018] Determine the positive distance between the first output feature map and the preset positive sample;

[0019] Determine the negative example distance between the first output feature map and the preset negative sample;

[0020] The ternary loss parameters are determined based on the positive example distance, the negative example distance, and the preset interval.

[0021] Optionally, the step of selecting the first output feature map corresponding to the first output feature from the output feature map of the initial student detection model includes:

[0022] Obtain the output feature maps of each output layer in the initial student detection model, and determine the number of features in each student output feature map;

[0023] The student output feature map with the largest number of features is selected as the first output feature map corresponding to the first output feature.

[0024] Optionally, before the step of determining the loss parameter between the first output feature and the second output feature according to a preset ternary loss function, the method further includes:

[0025] Construct sample triples based on the face sample images;

[0026] Based on the initial student detection model, obtain similar facial features of the sample triplet;

[0027] A pre-defined ternary loss function is constructed based on the similar facial features of the obtained sample triples.

[0028] Optionally, the step of constructing sample triples based on the face sample image includes:

[0029] The labeled face image is determined based on the face sample image;

[0030] Obtain positive examples and negative examples of the labeled face images;

[0031] Construct sample triples based on the labeled face image, positive examples of the labeled face image, and negative examples of the labeled face image.

[0032] Optionally, before the step of determining the loss parameter between the first output feature and the second output feature according to a preset ternary loss function, the method further includes:

[0033] Determine the prediction difference between the first output feature and the second output feature, and compare the prediction difference with the preset difference threshold;

[0034] When the prediction difference is greater than the preset difference threshold, the step of determining the loss parameter between the first output feature and the second output feature according to the preset ternary loss function is executed.

[0035] Optionally, after the step of determining the prediction difference between the first output feature and the second output feature, and comparing the prediction difference with the preset difference threshold, the method further includes:

[0036] When the predicted difference is less than or equal to the preset difference threshold, the true label value of the face sample image is obtained;

[0037] Determine the true difference between the true labeled value and the first predicted value;

[0038] The parameters of the initial student detection model are updated based on the true difference to obtain the target face recognition model.

[0039] Optionally, before the step of recognizing the face sample image based on the initial student detection model to obtain the first output feature, the method further includes:

[0040] Obtain a first target detection network and a second target detection network, wherein the number of parameters in the first target detection network is less than the number of parameters in the second target detection network;

[0041] A face image training set is obtained, and the first target detection network and the second target detection network are trained using the face image training set to obtain the trained first target detection network and the trained second target detection network.

[0042] When the trained first object detection network satisfies the first preset convergence condition, the trained first object detection network is used as the initial student detection model.

[0043] When the second target detection network after training satisfies the second preset convergence condition, the trained second target detection network is used as the initial teacher detection model.

[0044] Optionally, before the step of obtaining the first target detection network and the second target detection network, the method further includes:

[0045] Obtain the initial face image training set;

[0046] The initial face image training set is subjected to horizontal flipping and / or scaling operations based on data augmentation techniques to obtain a face image training set.

[0047] Optionally, after the step of updating the parameters of the initial student detection model according to the loss parameters to obtain the target face recognition model, the method further includes:

[0048] Upon detecting a face recognition request, the image of the face to be recognized is obtained according to the face recognition request;

[0049] The target face recognition model is used to identify the face image to obtain the face recognition result.

[0050] Furthermore, to achieve the above objectives, the present invention also proposes a training device for a face recognition model, the training device for the face recognition model comprising:

[0051] The recognition module is used to recognize face sample images based on the initial student detection model and obtain the first output feature;

[0052] The recognition module is also used to recognize the face sample image based on the initial teacher detection model to obtain a second output feature;

[0053] The determination module is used to determine the loss parameters between the first output feature and the second output feature according to a preset ternary loss function;

[0054] An update module is used to update the parameters of the initial student detection model according to the loss parameters to obtain the target face recognition model.

[0055] Optionally, the determining module is further configured to determine the mean squared error loss parameter between the initial student detection model and the initial teacher detection model based on the first output feature and the second output feature;

[0056] The similarity between the first output feature and the preset positive and negative samples is calculated to determine the ternary loss parameters;

[0057] Based on the preset ternary loss function, the distillation loss parameter is determined according to the mean squared error loss parameter and the ternary loss parameter, and the distillation loss parameter is used as the loss parameter.

[0058] Optionally, the determining module is further configured to select a first output feature map corresponding to the first output feature from the output feature map of the initial student detection model;

[0059] The similarity is calculated based on the first output feature map and the preset positive and negative samples to determine the ternary loss parameters.

[0060] Optionally, the determining module is further configured to determine the positive distance between the first output feature map and the preset positive sample;

[0061] Determine the negative example distance between the first output feature map and the preset negative sample;

[0062] The ternary loss parameters are determined based on the positive example distance, the negative example distance, and the preset interval.

[0063] Optionally, the determining module is further configured to obtain the output feature maps of each output layer in the initial student detection model, and determine the number of features in each student output feature map;

[0064] The student output feature map with the largest number of features is selected as the first output feature map corresponding to the first output feature.

[0065] Optionally, the determining module is further configured to construct sample triples based on the face sample images;

[0066] Based on the initial student detection model, obtain similar facial features of the sample triplet;

[0067] A pre-defined ternary loss function is constructed based on the similar facial features of the obtained sample triples.

[0068] Furthermore, to achieve the above objectives, the present invention also proposes a training device for a face recognition model, the training device for the face recognition model comprising: a memory, a processor, and a training program for the face recognition model stored in the memory and executable on the processor, the training program for the face recognition model being configured with steps for implementing the training method for the face recognition model as described above.

[0069] Furthermore, to achieve the above objectives, the present invention also proposes a storage medium storing a training program for a face recognition model, wherein when the training program for the face recognition model is executed by a processor, the training program for the face recognition model implements the steps of the face recognition model training method described above.

[0070] This invention identifies face sample images using an initial student detection model to obtain a first output feature; identifies the face sample images using an initial teacher detection model to obtain a second output feature; determines a loss parameter between the first and second output features using a preset ternary loss function; and updates the parameters of the initial student detection model based on the loss parameter to obtain a target face recognition model. In this invention, knowledge distillation technology is used to train a low-complexity initial student detection model by introducing an initial teacher detection model, achieving knowledge transfer. Combining ternary loss and knowledge distillation techniques to train a small model, i.e., the initial student detection model, to obtain the target face recognition model reduces the training iteration time of the target face recognition model and improves its accuracy. This solves the technical problem that existing face recognition training methods cannot adequately meet the training speed and accuracy requirements of small models applicable to embedded or mobile devices. Attached Figure Description

[0071] Figure 1 This is a schematic diagram of the structure of a training device for a face recognition model in the hardware operating environment involved in the embodiments of the present invention;

[0072] Figure 2 This is a flowchart illustrating the first embodiment of the training method for the face recognition model of the present invention.

[0073] Figure 3 This is a flowchart illustrating the second embodiment of the training method for the face recognition model of the present invention.

[0074] Figure 4 This is a flowchart illustrating the third embodiment of the training method for the face recognition model of the present invention.

[0075] Figure 5 This is a structural block diagram of the first embodiment of the training device for the face recognition model of the present invention.

[0076] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0077] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0078] Reference Figure 1 , Figure 1This is a schematic diagram of the training device structure for the face recognition model in the hardware operating environment involved in the embodiments of the present invention.

[0079] like Figure 1 As shown, the training device for this face recognition model may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to establish communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0080] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the training device for the face recognition model and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0081] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a training program for a face recognition model.

[0082] exist Figure 1 In the face recognition model training device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the face recognition model training device of the present invention can be set in the face recognition model training device, and the face recognition model training device calls the face recognition model training program stored in the memory 1005 through the processor 1001 and executes the face recognition model training method provided in the embodiment of the present invention.

[0083] This invention provides a method for training a face recognition model, referring to... Figure 2 , Figure 2This is a flowchart illustrating the first embodiment of a face recognition model training method according to the present invention.

[0084] In this embodiment, the training method for the face recognition model includes the following steps:

[0085] Step S10: Recognize the face sample image based on the initial student detection model to obtain the first output feature.

[0086] It should be noted that the execution subject in this embodiment is the training device of the face recognition model. The training device of the face recognition model has functions such as image processing, data analysis and program execution. The training device of the face recognition model can be a computer, server or other computer equipment. Of course, it can also be other devices with similar functions. This embodiment does not limit it.

[0087] It should be understood that face recognition models can typically be computed on embedded devices or mobile devices. Considering user privacy, machine memory limitations, and the computational power limitations of embedded devices or mobile devices, face recognition models usually employ lightweight networks, which may result in lower accuracy. The initial student detection model can be a lightweight neural network with a small number of parameters, ensuring that the converged initial student detection model can be computed on embedded devices or mobile devices.

[0088] Specifically, the initial student detection model identifies face sample images to obtain a first output feature. The face sample images can be obtained from a known training set of face images, or from an embedded device or a camera mounted on a mobile device. Of course, other types of face sample images can also be used. The process of the initial student detection model identifying face sample images can include feature extraction and recognition of the face sample images. The first output feature can include the extracted feature map or the recognition result.

[0089] Step S20: Recognize the face sample image according to the initial teacher detection model to obtain the second output feature.

[0090] Understandably, to ensure the effective supervised training of the initial teacher detection model on the initial student detection model, the initial teacher detection model can have high accuracy, such as 95%. This also results in a large number of parameters in the initial teacher detection model. During supervised training of the initial student detection model, the parameters of the initial teacher detection model need to be kept constant. The process of the initial teacher detection model recognizing face sample images can include feature extraction and recognition of the face sample images. The second output feature can include the extracted feature map or the recognition result.

[0091] It should be noted that, to improve training speed, neural networks can be pre-trained separately to obtain initially converged initial student detection models and initial teacher detection models. In specific implementation, a first object detection network and a second object detection network are obtained, wherein the number of parameters in the first object detection network is less than the number of parameters in the second object detection network; a face image training set is obtained, and the first object detection network and the second object detection network are trained using the face image training set respectively to obtain trained first object detection networks and trained second object detection networks; when the trained first object detection network meets a first preset convergence condition, the trained first object detection network is used as the initial student detection model; when the trained second object detection network meets a second preset convergence condition, the trained second object detection network is used as the initial teacher detection model.

[0092] Specifically, the initial student detection model and the initial teacher detection model can employ anchor-free (object detection) models. In practice, the initial student detection model can use the MobileNet-V2 network, and the initial teacher detection model can use the ResNet152 network. Of course, other networks can also be used; this embodiment does not impose any restrictions. To ensure the effective supervised training of the initial student detection model by the subsequent initial teacher detection model, the prediction accuracy of the initial teacher detection model can be greater than that of the initial student detection model. For example, the prediction accuracy of the initial teacher detection model can be 95%, and the prediction accuracy of the initial student detection model can be 70%. The first and second preset convergence conditions can be prediction accuracy or the number of iterations. Of course, the preset convergence conditions can be freely set according to user needs; this embodiment does not impose any restrictions on this.

[0093] It is understood that the aforementioned face image training set can be obtained by preprocessing an initial face image training set. The preprocessing process can be as follows: obtaining an initial face image training set; performing a horizontal flip operation and / or a scale transformation operation on the initial face image training set based on data augmentation technology to obtain a face image training set. The preprocessing methods can include rotation operation and / or color dithering operation and / or random cropping operation and / or horizontal flip operation and / or scale transformation operation.

[0094] Step S30: Determine the loss parameters between the first output feature and the second output feature according to the preset ternary loss function.

[0095] It should be noted that the process of the initial student detection model and the initial teacher detection model recognizing face sample images may include feature extraction and recognition of the face sample images. The first output feature may include the extracted feature map or recognition result, and the second output feature may include the extracted feature map or recognition result. The mean squared error loss parameter between the initial student detection model and the initial teacher detection model is determined based on the first output feature and the second output feature; similarity is calculated between the first output feature and preset positive and negative samples to determine the ternary loss parameter; a distillation loss parameter is determined based on the preset ternary loss function according to the mean squared error loss parameter and the ternary loss parameter, and the distillation loss parameter is used as the loss parameter.

[0096] Specifically, the mean squared error of the output features of the initial teacher detection model and the initial student detection model is calculated to obtain the mean squared error loss parameter between the initial student detection model and the initial teacher detection model; from the output feature map of the initial student detection model, the first output feature map corresponding to the first output feature is selected, and preset positive samples and preset negative samples are determined according to preset positive and negative samples; the positive example distance between the first output feature map and the preset positive sample is determined; the negative example distance between the first output feature map and the preset negative sample is determined; and the ternary loss parameter is determined according to the positive example distance, the negative example distance and the preset interval.

[0097] Step S40: Update the parameters of the initial student detection model according to the loss parameters to obtain the target face recognition model.

[0098] Understandably, when supervising the training of the initial student detection model, it is necessary to keep the parameters of the initial teacher detection model fixed and update the parameters of the initial student detection model according to the distillation loss parameters in order to obtain the target face recognition model.

[0099] It should be noted that after obtaining the target face recognition model, the process further includes: upon detecting a face recognition request, acquiring a face image to be recognized based on the face recognition request; and recognizing the face image to be recognized based on the target face recognition model to obtain a face recognition result. The target face recognition model is obtained by optimizing the initial student detection model using distillation loss parameters.

[0100] Specifically, upon detecting a face recognition request, the system acquires a face image to be recognized based on the request. Features are extracted from the face image based on a target face recognition model. The output of the third-to-last layer of the target face recognition model is used as the first similar face feature of the face image. For each face image in the face database, the distance information between the first similar face feature and the second similar face feature of each face image in the feature space is obtained. The second similar face feature is obtained after feature extraction from each face image using the target face recognition model. Based on the obtained distance information, the target face image with the highest similarity to the face image to be recognized is determined from the face database as the face recognition result. This target face recognition model can map face images to a similarity feature space, ensuring that similar faces are closer in the feature space.

[0101] It is understandable that the recognition accuracy of the initial student detection model is often worse than that of the initial teacher detection model. This difference is mainly due to the complexity of the face samples; for example, face sample images often contain more noise or other features. However, since there are often many face sample images, some of which are less complex, the initial student detection model can usually achieve high recognition accuracy for these samples. Therefore, the guided training effect of the initial teacher detection model is lower for less complex samples. In this embodiment, to further improve the training speed of the face recognition model, guided training for less complex samples may not be performed using a teacher network. Of course, the initial student detection model may also have high recognition accuracy for more complex face samples. Therefore, this embodiment determines whether to use a teacher network for guided training by judging the prediction difference between the first predicted value and the second predicted value.

[0102] It should be noted that before determining the loss parameters between the first output feature and the second output feature according to the preset ternary loss function, the prediction difference between the first output feature and the second output feature can also be determined, and the prediction difference can be compared with a preset difference threshold. When the prediction difference is greater than the preset difference threshold, the step of determining the loss parameters between the first output feature and the second output feature according to the preset ternary loss function is executed. Specifically, taking probability as an example, the preset difference threshold can be set to 5%, but it can also be other values, which are not limited in this embodiment. When the prediction difference is greater than the preset difference threshold, it indicates that for this sample, the recognition accuracy of the initial student detection model is significantly different from that of the initial teacher detection model, and the initial teacher detection model needs to be trained.

[0103] Specifically, when the predicted difference is less than or equal to the preset difference threshold, the true label value of the face sample image is obtained; the true difference between the true label value and the first predicted value is determined; and the parameters of the initial student detection model are updated according to the true difference to obtain the target face recognition model. It can be understood that when the predicted difference is less than or equal to the preset difference threshold, it means that for the face sample image, the recognition accuracy of the initial student detection model is not much different from that of the initial teacher detection model, and the initial teacher detection model does not need to guide the training, thereby improving the training speed of the initial student detection model.

[0104] In this embodiment, a face sample image is identified using an initial student detection model to obtain a first output feature; the face sample image is then identified using an initial teacher detection model to obtain a second output feature; a loss parameter between the first and second output features is determined using a preset ternary loss function; and the parameters of the initial student detection model are updated based on the loss parameter to obtain a target face recognition model. In this embodiment, knowledge distillation technology is used to train a low-complexity initial student detection model by introducing an initial teacher detection model, achieving knowledge transfer. Combining ternary loss and knowledge distillation techniques to train a small model, i.e., the initial student detection model, to obtain the target face recognition model reduces the training iteration time of the target face recognition model and improves its accuracy. This solves the technical problem that existing face recognition training methods cannot adequately meet the training speed and accuracy requirements of small models applicable to embedded or mobile devices.

[0105] refer to Figure 3 , Figure 3 This is a flowchart illustrating a second embodiment of a face recognition model training method according to the present invention. Based on the first embodiment described above, the face recognition model training method in this embodiment specifically includes the following in step S30:

[0106] Step S301: Determine the mean squared error loss parameter between the initial student detection model and the initial teacher detection model based on the first output feature and the second output feature.

[0107] It should be noted that the process of the initial student detection model and the initial teacher detection model recognizing face sample images can include features extraction and recognition of the face sample images. The first output feature can include the extracted feature map or recognition result, and the second output feature can also include the extracted feature map or recognition result. The mean squared error loss parameter between the initial student detection model and the initial teacher detection model is determined based on the first and second output features. Specifically, the mean squared error of the output features of the initial teacher detection model and the initial student detection model is taken to obtain the mean squared error loss parameter between them.

[0108] In the specific implementation, the mean squared error loss parameter between the initial student detection model and the initial teacher detection model is determined by formula (1):

[0109] L mse =MSE(E teacher +E student ) Formula (1)

[0110] Among them, E teacher E represents the output features of the initial teacher detection model. student For the initial student detection model's output features, MSE refers to the mean squared error, L mse This is the mean squared error loss parameter.

[0111] Step S302: Calculate the similarity between the first output feature and the preset positive and negative samples to determine the ternary loss parameters.

[0112] It is understandable that, from the output feature map of the initial student detection model, the first output feature map corresponding to the first output feature is selected, and preset positive samples and preset negative samples are determined according to preset positive and negative samples; the positive example distance between the first output feature map and the preset positive sample is determined; the negative example distance between the first output feature map and the preset negative sample is determined; and the ternary loss parameter is determined according to the positive example distance, the negative example distance and the preset interval.

[0113] In the specific implementation, the similarity between the first output feature and the preset positive and negative samples is calculated using formula (2) to determine the ternary loss parameters:

[0114] L tri =D p +D n +margin formula(2)

[0115] Among them, L tri For the ternary loss parameter, D p For positive example distances, D nThe distance is the negative example distance, and the margin is the preset interval. In this embodiment, the margin can be 0.5.

[0116] Step S303: Based on the preset ternary loss function, determine the distillation loss parameter according to the mean squared error loss parameter and the ternary loss parameter, and use the distillation loss parameter as the loss parameter.

[0117] It should be noted that the process of determining the distillation loss parameter based on the mean squared error loss parameter and the ternary loss parameter according to the preset ternary loss function can be as follows: add the mean squared error loss parameter and the ternary loss parameter to obtain the distillation loss parameter, and use the distillation loss parameter as the loss parameter.

[0118] Specifically, the process of constructing the preset triplet loss function can be as follows: constructing sample triplets based on the face sample images; obtaining similar face features of the sample triplets based on the initial student detection model; and constructing the preset triplet loss function based on the obtained similar face features of the sample triplets. The process of constructing sample triplets based on the face sample images can be as follows: determining labeled face images based on the face sample images; obtaining positive examples and negative examples of the labeled face images; and constructing sample triplets based on the labeled face images, the positive examples of the labeled face images, and the negative examples of the labeled face images.

[0119] In this embodiment, the mean squared error loss parameter between the initial student detection model and the initial teacher detection model is determined based on the first output feature and the second output feature; similarity is calculated between the first output feature and the second output feature to determine the ternary loss parameter; a distillation loss parameter is determined based on the mean squared error loss parameter and the ternary loss parameter according to a preset ternary loss function, and the distillation loss parameter is used as the loss parameter. In this embodiment, the knowledge distillation technique involves training a low-complexity initial student detection model by introducing the initial teacher detection model to achieve knowledge transfer. The small model, i.e., the initial student detection model, is trained using the ternary loss and knowledge distillation techniques to obtain the target face recognition model. This reduces the training iteration time of the target face recognition model and improves its accuracy, solving the technical problem that existing face recognition training methods cannot adequately meet the training speed and accuracy requirements of small models applicable to embedded or mobile devices.

[0120] refer to Figure 4 , Figure 4 This is a flowchart illustrating a third embodiment of a face recognition model training method according to the present invention. Based on the first and second embodiments described above, the face recognition model training method in this embodiment specifically includes the following in step S302:

[0121] S3021: Select the first output feature map corresponding to the first output feature from the output feature map of the initial student detection model.

[0122] It is understandable that neural networks typically have multiple output layers, each with a corresponding output feature map. To improve the calculation of the ternary loss parameter for the feature map, this implementation acquires the output features of each output layer in the initial student detection model and selects the first output feature map corresponding to the first output feature.

[0123] Specifically, the output feature maps of each output layer in the initial student detection model are obtained, and the number of features in each student output feature map is determined; the student output feature map with the largest number of features is selected as the first output feature map corresponding to the first output feature.

[0124] S3022: Calculate the similarity based on the first output feature map and the preset positive and negative samples to determine the ternary loss parameters.

[0125] It should be noted that preset positive samples and preset negative samples are determined based on preset positive and negative samples; the positive example distance between the first output feature map and the preset positive samples is determined; the negative example distance between the first output feature map and the preset negative samples is determined; and the ternary loss parameter is determined based on the positive example distance, the negative example distance, and the preset interval.

[0126] Understandably, the face sample image is identified based on the initial student detection model to obtain the first output feature; the first output feature map corresponding to the first output feature is obtained; preset positive samples and preset negative samples are determined through preset positive and negative samples; the positive example distance between the first output feature map and the preset positive samples is determined; the first feature expression vector of the first output feature map, the second feature expression vector of the preset positive samples, and the third feature expression vector of the preset negative samples are determined; the positive example distance between the first output feature map and the preset positive samples is determined based on the first feature expression vector and the second feature expression vector; and the negative example distance between the first output feature map and the preset negative samples is determined based on the first feature expression vector and the third feature expression vector.

[0127] It should be understood that, in one possible implementation, the similarity between the first output feature and the preset positive and negative samples is calculated using formula (2) to determine the ternary loss parameters:

[0128] L tri =D p +D n +margin formula(2)

[0129] Among them, L tri For the ternary loss parameter, D pFor positive example distances, D n The distance is the negative example distance, and the margin is the preset interval. In this embodiment, the margin can be 0.5.

[0130] In one possible implementation, similar face features of sample triplets are obtained based on the initial student detection model. A preset triplet loss function is constructed based on the obtained similar face features of the sample triplets. The process of constructing sample triplets based on the face sample images can be as follows: determining labeled face images based on the face sample images; obtaining positive and negative examples of the labeled face images; and constructing sample triplets based on the labeled face images, the positive examples of the labeled face images, and the negative examples of the labeled face images. Based on the initial student detection model, face features of the sample triplets are obtained, with each sample triplet including a labeled face image, positive examples of the labeled face images, and negative examples. Triplet loss parameters are constructed based on the obtained face features of the sample triplets. The triplet loss parameters can be optimized using a stochastic gradient descent algorithm until convergence, thereby determining the triplet loss parameters. In one possible implementation, the convergence condition of the ternary loss parameter can be: the first distance is less than the second distance; where the first distance refers to the distance in the feature space between the face features of the labeled face image and the face features of the positive sample in the same sample triplet, and the second distance refers to the distance in the feature space between the face features of the labeled face image and the face features of the negative sample.

[0131] This embodiment selects a first output feature map corresponding to the first output feature from the output feature map of the initial student detection model; selects a second output feature map corresponding to the second output feature from the output feature map of the initial teacher detection model; determines positive and negative samples from the first and second output feature maps; and determines the ternary loss parameters based on the distance between the positive samples, the distance between the negative samples, and a preset interval. In this embodiment, knowledge distillation technology is used to train a low-complexity initial student detection model by introducing the initial teacher detection model, achieving knowledge transfer. The ternary loss and knowledge distillation techniques are combined to train a small model, i.e., the initial student detection model, to obtain the target face recognition model. This reduces the training iteration time of the target face recognition model and improves its accuracy, solving the technical problem that existing face recognition training methods cannot adequately meet the training speed and accuracy requirements of small models applicable to embedded or mobile devices.

[0132] Furthermore, this embodiment of the invention also proposes a storage medium storing a training program for a face recognition model, wherein the training program for the face recognition model is executed by a processor using the steps of the face recognition model training method described above.

[0133] Since this storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.

[0134] Reference Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the training device for the face recognition model of the present invention.

[0135] like Figure 5 As shown, the training device for the face recognition model in this embodiment of the invention includes:

[0136] The recognition module 10 is used to recognize the face sample image based on the initial student detection model and obtain the first output feature.

[0137] It should be noted that face recognition models can typically be computed on embedded devices or mobile devices. Considering user privacy, machine memory limitations, and the computational power limitations of embedded devices or mobile devices, face recognition models usually employ lightweight networks, which may result in lower accuracy. The initial student detection model can be a lightweight neural network with a small number of parameters, ensuring that the converged initial student detection model can be computed on embedded devices or mobile devices.

[0138] Specifically, the initial student detection model identifies face sample images to obtain a first output feature. The face sample images can be obtained from a known training set of face images, or from an embedded device or a camera mounted on a mobile device. Of course, other types of face sample images can also be used. The process of the initial student detection model identifying face sample images can include feature extraction and recognition of the face sample images. The first output feature can include the extracted feature map or the recognition result.

[0139] The recognition module 10 is also used to recognize the face sample image according to the initial teacher detection model to obtain the second output feature.

[0140] Understandably, to ensure the effective supervised training of the initial teacher detection model on the initial student detection model, the initial teacher detection model can have high accuracy, such as 95%. This also results in a large number of parameters in the initial teacher detection model. During supervised training of the initial student detection model, the parameters of the initial teacher detection model need to be kept constant. The process of the initial teacher detection model recognizing face sample images can include feature extraction and recognition of the face sample images. The second output feature can include the extracted feature map or the recognition result.

[0141] It should be noted that, to improve training speed, neural networks can be pre-trained separately to obtain initially converged initial student detection models and initial teacher detection models. In specific implementation, a first object detection network and a second object detection network are obtained, wherein the number of parameters in the first object detection network is less than the number of parameters in the second object detection network; a face image training set is obtained, and the first object detection network and the second object detection network are trained using the face image training set respectively to obtain trained first object detection networks and trained second object detection networks; when the trained first object detection network meets a first preset convergence condition, the trained first object detection network is used as the initial student detection model; when the trained second object detection network meets a second preset convergence condition, the trained second object detection network is used as the initial teacher detection model.

[0142] Specifically, the initial student detection model and the initial teacher detection model can employ anchor-free (object detection) models. In practice, the initial student detection model can use the MobileNet-V2 network, and the initial teacher detection model can use the ResNet152 network. Of course, other networks can also be used; this embodiment does not impose any restrictions. To ensure the effective supervised training of the initial student detection model by the subsequent initial teacher detection model, the prediction accuracy of the initial teacher detection model can be greater than that of the initial student detection model. For example, the prediction accuracy of the initial teacher detection model can be 95%, and the prediction accuracy of the initial student detection model can be 70%. The first and second preset convergence conditions can be prediction accuracy or the number of iterations. Of course, the preset convergence conditions can be freely set according to user needs; this embodiment does not impose any restrictions on this.

[0143] It is understood that the aforementioned face image training set can be obtained by preprocessing an initial face image training set. The preprocessing process can be as follows: obtaining an initial face image training set; performing a horizontal flip operation and / or a scale transformation operation on the initial face image training set based on data augmentation technology to obtain a face image training set. The preprocessing methods can include rotation operation and / or color dithering operation and / or random cropping operation and / or horizontal flip operation and / or scale transformation operation.

[0144] The determination module 20 is used to determine the loss parameters between the first output feature and the second output feature according to a preset ternary loss function.

[0145] It should be noted that the process of the initial student detection model and the initial teacher detection model recognizing face sample images may include feature extraction and recognition of the face sample images. The first output feature may include the extracted feature map or recognition result, and the second output feature may include the extracted feature map or recognition result. The mean squared error loss parameter between the initial student detection model and the initial teacher detection model is determined based on the first output feature and the second output feature; similarity is calculated between the first output feature and preset positive and negative samples to determine the ternary loss parameter; a distillation loss parameter is determined based on the preset ternary loss function according to the mean squared error loss parameter and the ternary loss parameter, and the distillation loss parameter is used as the loss parameter.

[0146] Specifically, the mean squared error of the output features of the initial teacher detection model and the initial student detection model is calculated to obtain the mean squared error loss parameter between the initial student detection model and the initial teacher detection model; from the output feature map of the initial student detection model, the first output feature map corresponding to the first output feature is selected, and preset positive samples and preset negative samples are determined according to preset positive and negative samples; the positive example distance between the first output feature map and the preset positive sample is determined; the negative example distance between the first output feature map and the preset negative sample is determined; and the ternary loss parameter is determined according to the positive example distance, the negative example distance and the preset interval.

[0147] The update module 30 is used to update the parameters of the initial student detection model according to the loss parameters to obtain the target face recognition model.

[0148] Understandably, when supervising the training of the initial student detection model, it is necessary to keep the parameters of the initial teacher detection model fixed and update the parameters of the initial student detection model according to the distillation loss parameters in order to obtain the target face recognition model.

[0149] It should be noted that after obtaining the target face recognition model, the process further includes: upon detecting a face recognition request, acquiring a face image to be recognized based on the face recognition request; and recognizing the face image to be recognized based on the target face recognition model to obtain a face recognition result. The target face recognition model is obtained by optimizing the initial student detection model using distillation loss parameters.

[0150] Specifically, upon detecting a face recognition request, the system acquires a face image to be recognized based on the request. Features are extracted from the face image based on a target face recognition model. The output of the third-to-last layer of the target face recognition model is used as the first similar face feature of the face image. For each face image in the face database, the distance information between the first similar face feature and the second similar face feature of each face image in the feature space is obtained. The second similar face feature is obtained after feature extraction from each face image using the target face recognition model. Based on the obtained distance information, the target face image with the highest similarity to the face image to be recognized is determined from the face database as the face recognition result. This target face recognition model can map face images to a similarity feature space, ensuring that similar faces are closer in the feature space.

[0151] It is understandable that the recognition accuracy of the initial student detection model is often worse than that of the initial teacher detection model. This difference is mainly due to the complexity of the face samples; for example, face sample images often contain more noise or other features. However, since there are often many face sample images, some of which are less complex, the initial student detection model can usually achieve high recognition accuracy for these samples. Therefore, the guided training effect of the initial teacher detection model is lower for less complex samples. In this embodiment, to further improve the training speed of the face recognition model, guided training for less complex samples may not be performed using a teacher network. Of course, the initial student detection model may also have high recognition accuracy for more complex face samples. Therefore, this embodiment determines whether to use a teacher network for guided training by judging the prediction difference between the first predicted value and the second predicted value.

[0152] It should be noted that before determining the loss parameters between the first output feature and the second output feature according to the preset ternary loss function, the prediction difference between the first output feature and the second output feature can also be determined, and the prediction difference can be compared with a preset difference threshold. When the prediction difference is greater than the preset difference threshold, the step of determining the loss parameters between the first output feature and the second output feature according to the preset ternary loss function is executed. Specifically, taking probability as an example, the preset difference threshold can be set to 5%, but it can also be other values, which are not limited in this embodiment. When the prediction difference is greater than the preset difference threshold, it indicates that for this sample, the recognition accuracy of the initial student detection model is significantly different from that of the initial teacher detection model, and the initial teacher detection model needs to be trained.

[0153] Specifically, when the predicted difference is less than or equal to the preset difference threshold, the true label value of the face sample image is obtained; the true difference between the true label value and the first predicted value is determined; and the parameters of the initial student detection model are updated according to the true difference to obtain the target face recognition model. It can be understood that when the predicted difference is less than or equal to the preset difference threshold, it means that for the face sample image, the recognition accuracy of the initial student detection model is not much different from that of the initial teacher detection model, and the initial teacher detection model does not need to guide the training, thereby improving the training speed of the initial student detection model.

[0154] The training device for the face recognition model in this embodiment includes: a recognition module 10, used to recognize face sample images according to an initial student detection model to obtain a first output feature; the recognition module 10 is also used to recognize the face sample images according to an initial teacher detection model to obtain a second output feature; a determination module 20, used to determine a loss parameter between the first output feature and the second output feature according to a preset ternary loss function; and an update module 30, used to update the parameters of the initial student detection model according to the loss parameter to obtain a target face recognition model. In this embodiment, the knowledge distillation technique is used to train a low-complexity initial student detection model by introducing an initial teacher detection model to achieve knowledge transfer. The small model, i.e., the initial student detection model, is trained using ternary loss and knowledge distillation techniques to obtain the target face recognition model. This reduces the training iteration time of the target face recognition model and improves its accuracy, solving the technical problem that existing face recognition technology training methods cannot adequately meet the training speed and accuracy requirements of small models applicable to embedded or mobile devices.

[0155] In one embodiment, the determining module 20 is further configured to determine the mean squared error loss parameter between the initial student detection model and the initial teacher detection model based on the first output feature and the second output feature;

[0156] The similarity between the first output feature and the preset positive and negative samples is calculated to determine the ternary loss parameters;

[0157] Based on the preset ternary loss function, the distillation loss parameter is determined according to the mean squared error loss parameter and the ternary loss parameter, and the distillation loss parameter is used as the loss parameter.

[0158] In one embodiment, the determining module 20 is further configured to select a first output feature map corresponding to the first output feature from the output feature map of the initial student detection model;

[0159] The similarity is calculated based on the first output feature map and the preset positive and negative samples to determine the ternary loss parameters.

[0160] In one embodiment, the determining module 20 is further configured to determine the positive example distance between the first output feature map and the preset positive sample;

[0161] Determine the negative example distance between the first output feature map and the preset negative sample;

[0162] The ternary loss parameters are determined based on the positive example distance, the negative example distance, and the preset interval.

[0163] In one embodiment, the determining module 20 is further configured to obtain the output feature maps of each output layer in the initial student detection model, and determine the number of features in each student output feature map;

[0164] The student output feature map with the largest number of features is selected as the first output feature map corresponding to the first output feature.

[0165] In one embodiment, the determining module 20 is further configured to construct sample triples based on the face sample image;

[0166] Based on the initial student detection model, obtain similar facial features of the sample triplet;

[0167] A pre-defined ternary loss function is constructed based on the similar facial features of the obtained sample triples.

[0168] Other embodiments or specific implementations of the training device for the face recognition model described in this invention can be found in the above-described embodiments of the training methods for each face recognition model, and will not be repeated here.

[0169] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.

[0170] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.

[0171] In addition, for technical details not described in detail in this embodiment, please refer to the training method of the face recognition model provided in any embodiment of the present invention, which will not be repeated here.

[0172] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0173] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0174] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0175] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for training a face recognition model, characterized in that, The training method for the face recognition model includes: The face sample image is identified based on the initial student detection model to obtain the first output feature. The initial student detection model is a lightweight neural network. The face sample image is identified based on the initial teacher detection model to obtain the second output feature; The loss parameters between the first output feature and the second output feature are determined according to a preset ternary loss function; The parameters of the initial student detection model are updated based on the loss parameters to obtain the target face recognition model; The step of determining the loss parameter between the first output feature and the second output feature according to the preset ternary loss function includes: The mean squared error loss parameter between the initial student detection model and the initial teacher detection model is determined based on the first output feature and the second output feature. The similarity between the first output feature and the preset positive and negative samples is calculated to determine the ternary loss parameters; Based on the preset ternary loss function, the distillation loss parameter is determined according to the mean squared error loss parameter and the ternary loss parameter, and the distillation loss parameter is used as the loss parameter.

2. The training method for the face recognition model as described in claim 1, characterized in that, The step of calculating the similarity between the first output feature and the preset positive and negative samples to determine the ternary loss parameters includes: Select the first output feature map corresponding to the first output feature from the output feature map of the initial student detection model; The similarity is calculated based on the first output feature map and the preset positive and negative samples to determine the ternary loss parameters.

3. The training method for the face recognition model as described in claim 2, characterized in that, The step of calculating the similarity between the first output feature map and preset positive and negative samples to determine the ternary loss parameters includes: Determine the positive distance between the first output feature map and the preset positive sample; Determine the negative example distance between the first output feature map and the preset negative sample; The ternary loss parameters are determined based on the positive example distance, the negative example distance, and the preset interval.

4. The training method for the face recognition model as described in claim 2, characterized in that, The step of selecting the first output feature map corresponding to the first output feature from the output feature map of the initial student detection model includes: Obtain the output feature maps of each output layer in the initial student detection model, and determine the number of features in each student output feature map; The student output feature map with the largest number of features is selected as the first output feature map corresponding to the first output feature.

5. The training method for the face recognition model as described in claim 1, characterized in that, Before the step of determining the loss parameter between the first output feature and the second output feature according to the preset ternary loss function, the method further includes: Construct sample triples based on the face sample images; Based on the initial student detection model, obtain similar facial features of the sample triplet; A pre-defined ternary loss function is constructed based on the similar facial features of the obtained sample triples.

6. The training method for the face recognition model as described in claim 5, characterized in that, The step of constructing sample triples based on the face sample images includes: The labeled face image is determined based on the face sample image; Obtain positive examples and negative examples of the labeled face images; Construct sample triples based on the labeled face image, positive examples of the labeled face image, and negative examples of the labeled face image.

7. The training method for the face recognition model as described in claim 1, characterized in that, Before the step of determining the loss parameter between the first output feature and the second output feature according to the preset ternary loss function, the method further includes: Determine the prediction difference between the first output feature and the second output feature, and compare the prediction difference with a preset difference threshold; When the prediction difference is greater than the preset difference threshold, the step of determining the loss parameter between the first output feature and the second output feature according to the preset ternary loss function is executed.

8. The training method for the face recognition model as described in claim 7, characterized in that, After the step of determining the prediction difference between the first output feature and the second output feature, and comparing the prediction difference with the preset difference threshold, the method further includes: When the predicted difference is less than or equal to the preset difference threshold, the true label value of the face sample image is obtained; Determine the true difference between the true labeled value and the first predicted value; The parameters of the initial student detection model are updated based on the true difference to obtain the target face recognition model.

9. The training method for the face recognition model according to any one of claims 1 to 8, characterized in that, Before the step of recognizing the face sample image based on the initial student detection model to obtain the first output feature, the method further includes: Obtain a first target detection network and a second target detection network, wherein the number of parameters in the first target detection network is less than the number of parameters in the second target detection network; A face image training set is obtained, and the first target detection network and the second target detection network are trained using the face image training set to obtain the trained first target detection network and the trained second target detection network. When the trained first object detection network satisfies the first preset convergence condition, the trained first object detection network is used as the initial student detection model. When the second target detection network after training satisfies the second preset convergence condition, the trained second target detection network is used as the initial teacher detection model.

10. The training method for the face recognition model as described in claim 9, characterized in that, Before the step of obtaining the first target detection network and the second target detection network, the method further includes: Obtain the initial face image training set; The initial face image training set is subjected to horizontal flipping and / or scaling operations based on data augmentation techniques to obtain a face image training set.

11. The training method for the face recognition model as described in claim 10, characterized in that, After the step of updating the parameters of the initial student detection model according to the loss parameters to obtain the target face recognition model, the method further includes: Upon detecting a face recognition request, the image of the face to be recognized is obtained according to the face recognition request; The target face recognition model is used to identify the face image to obtain the face recognition result.

12. A training device for a face recognition model, characterized in that, The training device for the face recognition model includes: The recognition module is used to recognize face sample images based on the initial student detection model and obtain the first output feature. The initial student detection model is a lightweight neural network. The recognition module is also used to recognize the face sample image based on the initial teacher detection model to obtain a second output feature; The determination module is used to determine the loss parameters between the first output feature and the second output feature according to a preset ternary loss function; The determining module is further configured to determine the mean squared error loss parameter between the initial student detection model and the initial teacher detection model based on the first output feature and the second output feature; The similarity between the first output feature and the preset positive and negative samples is calculated to determine the ternary loss parameters; Based on the preset ternary loss function, the distillation loss parameter is determined according to the mean squared error loss parameter and the ternary loss parameter, and the distillation loss parameter is used as the loss parameter; An update module is used to update the parameters of the initial student detection model according to the loss parameters to obtain the target face recognition model.

13. The training apparatus for the face recognition model as described in claim 12, characterized in that, The determining module is further configured to select a first output feature map corresponding to the first output feature from the output feature map of the initial student detection model; The similarity is calculated based on the first output feature map and the preset positive and negative samples to determine the ternary loss parameters.

14. The training apparatus for the face recognition model as described in claim 13, characterized in that, The determining module is further configured to determine the positive example distance between the first output feature map and the preset positive sample; Determine the negative example distance between the first output feature map and the preset negative sample; The ternary loss parameters are determined based on the positive example distance, the negative example distance, and the preset interval.

15. The training apparatus for the face recognition model as described in claim 13, characterized in that, The determining module is further configured to obtain the output feature maps of each output layer in the initial student detection model, and determine the number of features in each student output feature map; The student output feature map with the largest number of features is selected as the first output feature map corresponding to the first output feature.

16. The training apparatus for the face recognition model as described in claim 13, characterized in that, The determining module is further configured to construct sample triples based on the face sample image; Based on the initial student detection model, obtain similar facial features of the sample triplet; A pre-defined ternary loss function is constructed based on the similar facial features of the obtained sample triples.

17. A training device for a face recognition model, characterized in that, The training device for the face recognition model includes: a memory, a processor, and a training program for the face recognition model stored in the memory and executable on the processor. The training program for the face recognition model is configured to implement the training method for the face recognition model as described in any one of claims 1 to 11.

18. A storage medium, characterized in that, The storage medium stores a training program for a face recognition model, which, when executed by a processor, implements the steps of the face recognition model training method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Encoder training and representation information extraction method and device

    CN110009013A

  • Human face living body detection method and device, equipment and medium

    CN111709409A