Identification model training method, device, computer equipment and storage medium

By training the face recognition model locally on the terminal device and sending the training results to the server for update processing, the problems of privacy leakage and poor model stability in face recognition model training are solved, and personal privacy protection and model accuracy are achieved. promote.

CN113792759BActive Publication Date: 2024-08-23BEIJING AIBI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110955282.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-19
Publication Date
2024-08-23
Estimated Expiration
2041-08-19

AI Technical Summary

Technical Problem

In the face recognition model training process, sharing facial image information involves the risk of privacy leakage. When building a model based on only a small number of images, the model stability is poor, the output results are inaccurate, and there is a lack of privacy-protecting recognition model training methods.

Method used

By performing recognition model training locally on the terminal device, the initial model parameters and image training samples are used to calculate the recognition loss, the model parameters are adjusted until the loss conditions are met, and the training model parameters are sent to the server for update processing to form comprehensive model parameters to ensure personal privacy. Safe and improve model accuracy.

Benefits of technology

It achieves the security of protecting personal privacy data in local training samples, and at the same time improves the sharing of training information of the recognition model and the accuracy of the model results through server update processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113792759B
    Figure CN113792759B
Patent Text Reader

Abstract

The present application relates to a recognition model training method, device, computer equipment and storage medium. The method comprises: training the recognition model according to the initial model parameters and image training samples to obtain the recognition loss of the recognition model; when the recognition loss does not meet the loss condition, adjusting the initial model parameters to obtain the training model parameters, and sending the training model parameters to the server, instructing the server to update the training model parameters to obtain the comprehensive model parameters; receiving the comprehensive model parameters, and training the recognition model according to the comprehensive model parameters and image training samples until the recognition loss of the recognition model meets the loss condition, and the recognition model training is completed. The present method can realize accurate training of the recognition model under the premise of ensuring the security of privacy data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a recognition model training method, apparatus, computer equipment and storage medium. Background Art

[0002] With the rapid development of image processing technology, face recognition technology is being applied in more and more scenarios in life. Among them, face recognition technology based on machine learning requires pre-construction of training samples to train the recognition model.

[0003] However, in the process of constructing training samples, if facial image information is allowed to be shared, it is easy to cause the leakage of personal information and is not secure. If training samples are constructed based on only a small number of facial images for model training, the amount of information is limited, the trained recognition model is unstable, and the output results are inaccurate. Therefore, a privacy-protecting recognition model training method is urgently needed. Summary of the invention

[0004] Based on this, it is necessary to provide a recognition model training method, device, computer equipment and storage medium to address the above technical problems.

[0005] A recognition model training method, the method is applied to a terminal device, the method comprising:

[0006] Training the recognition model according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model;

[0007] When the recognition loss does not satisfy the loss condition, the initial model parameters are adjusted to obtain training model parameters, and the training model parameters are sent to the server, instructing the server to update the training model parameters to obtain comprehensive model parameters;

[0008] The comprehensive model parameters are received, and the recognition model is trained according to the comprehensive model parameters and the image training samples until the recognition loss of the recognition model meets the loss condition, and the recognition model training is completed.

[0009] In one embodiment, the training of the recognition model according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model includes:

[0010] Extract features from the image training samples according to the initial feature extractor in the initial model parameters to obtain local image features and cluster centers of the local image features;

[0011] Calculating the recognition loss of the recognition model according to the local image features and the cluster centers of the local image features;

[0012] According to the recognition loss and the loss condition, it is determined whether to adjust the cluster center of the initial feature extractor and the local image feature.

[0013] In one embodiment, the training model parameters include a training feature extractor and a class center of encrypted local image features, and when the recognition loss does not meet the loss condition, the initial model parameters are adjusted to obtain the training model parameters, including:

[0014] If the recognition loss of the recognition model does not meet the loss condition, adjusting the parameters of the initial feature extractor to obtain a training feature extractor;

[0015] extracting local image features from the image training samples according to the training feature extractor;

[0016] The local image features are subjected to differential privacy clustering in the recognition model to obtain encrypted cluster centers of the local image features.

[0017] In one embodiment, performing differential privacy clustering on the local image features in the recognition model to obtain encrypted cluster centers of the local image features includes:

[0018] Performing cluster analysis on the local image features according to the recognition model to obtain clustering results of the local image features;

[0019] According to the differential privacy algorithm, each of the clustering results is covered in the form of a cluster set, and the center of each of the cluster sets is determined;

[0020] The center of the cluster set corresponding to each clustering result is randomly perturbed to obtain the encrypted class center of the local image feature.

[0021] In one embodiment, the comprehensive model parameters include an updated feature extractor and image feature class centers encrypted by at least two training parties, and the method for generating a loss function corresponding to the loss condition includes:

[0022] For each local image feature, a comprehensive recognition loss is calculated based on the classification loss between the local image feature and the cluster center of the local image feature, the difference loss between the local image feature and other cluster centers in the image training sample, and the difference loss between the encrypted image feature class center of the image training sample and the encrypted image feature class centers of other training samples included in the comprehensive model parameters;

[0023] The image recognition loss of each local image is calculated according to the classification loss between each local image feature and the cluster center of the local image feature in the image training sample and the comprehensive recognition loss.

[0024] In one embodiment, the method further comprises:

[0025] The face image to be recognized is input into the trained recognition model, and the face recognition result is obtained according to the operation processing of the recognition model.

[0026] A recognition model training method, the method is applied to a server, and the method further includes:

[0027] Receiving training model parameters sent by at least two training parties, each of the training model parameters includes a training feature extractor and a class center of the encrypted local image features of the training party;

[0028] Calculate the mean of each of the training feature extractors to obtain an updated feature extractor;

[0029] Aggregating the encrypted class centers of the local image features of each training party to obtain a set of encrypted image class centers of each training party;

[0030] The updated feature extractor and the set of encrypted image class centers are sent to each training party as comprehensive model parameters, instructing the terminal device of each training party to train the recognition model according to the comprehensive model parameters and the image training samples.

[0031] A recognition model training device, the device comprising:

[0032] A loss calculation module, used to train the recognition model according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model;

[0033] A parameter updating module, configured to adjust the initial model parameters to obtain training model parameters when the recognition loss does not meet the loss condition, and send the training model parameters to the server, instructing the server to update the training model parameters to obtain comprehensive model parameters;

[0034] The training module is used to receive the comprehensive model parameters, and train the recognition model according to the comprehensive model parameters and the image training samples until the recognition loss of the recognition model meets the loss condition, and the recognition model training is completed.

[0035] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0036] Training the recognition model according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model;

[0037] When the recognition loss does not satisfy the loss condition, the initial model parameters are adjusted to obtain training model parameters, and the training model parameters are sent to the server, instructing the server to update the training model parameters to obtain comprehensive model parameters;

[0038] The comprehensive model parameters are received, and the recognition model is trained according to the comprehensive model parameters and the image training samples until the recognition loss of the recognition model meets the loss condition, and the recognition model training is completed.

[0039] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0040] Training the recognition model according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model;

[0041] When the recognition loss does not satisfy the loss condition, the initial model parameters are adjusted to obtain training model parameters, and the training model parameters are sent to the server, instructing the server to update the training model parameters to obtain comprehensive model parameters;

[0042] The comprehensive model parameters are received, and the recognition model is trained according to the comprehensive model parameters and the image training samples until the recognition loss of the recognition model meets the loss condition, and the recognition model training is completed.

[0043] The above-mentioned recognition model training method, device, computer equipment and storage medium train the recognition model according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model; when the recognition loss does not meet the first loss condition, the initial model parameters are adjusted to obtain the training model parameters, and the training model parameters are sent to the server, instructing the server to update the training model parameters to obtain the comprehensive model parameters; receiving the comprehensive model parameters, and training the recognition model according to the comprehensive model parameters and the image training samples until the recognition loss of the recognition model meets the second loss condition, and the recognition model training is completed. With this method, the recognition model is trained locally through local training samples, which ensures the security of personal privacy data. At the same time, for the training model parameters obtained during the training process, the server is instructed to update the training model parameters to obtain the comprehensive model parameters, which realizes the sharing of training information of multiple training parties in model training and improves the accuracy of the results of the trained recognition model. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 An application environment diagram of a recognition model training method in one embodiment;

[0045] Figure 2 A schematic diagram of a flow chart of a recognition model training method in one embodiment;

[0046] Figure 3 A schematic diagram of a flow chart of a model training step according to initial model data in one embodiment;

[0047] Figure 4 A schematic diagram of a flow chart of model parameter adjustment and differential privacy encryption steps in one embodiment;

[0048] Figure 5 A schematic diagram of a process for determining a cluster center using differential privacy in one embodiment;

[0049] Figure 6 A schematic diagram of determining cluster centers using differential privacy in one embodiment;

[0050] Figure 7 A schematic diagram of a flow chart of a recognition model training method in another embodiment;

[0051] Figure 8 An example flow chart of a recognition model training method in one embodiment;

[0052] Fig. 9 It is a structural block diagram of a recognition model training device in one embodiment;

[0053] Fig.10FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0055] The recognition model training method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 trains the recognition model on the local terminal device according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model. When the recognition loss does not meet the loss condition, the initial model parameters are adjusted to obtain the training model parameters, and the training model parameters are sent to the server 104, instructing the server 104 to update the training model parameters to obtain the comprehensive model parameters. Then, the terminal 102 receives the comprehensive model parameters sent by the server 104, and continues to train the recognition model according to the comprehensive model parameters and the image training samples until the recognition loss of the recognition model meets the loss condition, and the local recognition model training is completed. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones and tablet computers, and the server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0056] In one embodiment, Figure 2 As shown, a recognition model training method is provided, which is applied to Figure 1 The terminal device in the example is used to illustrate, including the following steps:

[0057] Step 201: train the recognition model according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model.

[0058] Among them, the image training sample is a sample for local model training constructed by the terminal device based on internal data. For example, the image training sample is a face image training sample, which is only used to train the internal model (corresponding to the face image recognition model). The personal privacy content involved in the image training sample (for example, involving face image information) is kept confidential by the training party where the terminal device is located. The initial model parameters are the starting parameters set during the operation of the recognition model. The initial model parameters include initial feature extraction parameters. The initial model parameters will be pre-stored in the database of the terminal device. When model training of the local recognition model is required, the initial model parameters are obtained in the database for model training.

[0059] Optionally, the image training samples may also be vehicle image training samples, pedestrian image training samples, etc., wherein the vehicle image training samples are composed of a vehicle image set corresponding to a plurality of target vehicles. The vehicle image training samples are used to train a vehicle recognition model; the pedestrian image training samples are composed of a pedestrian image set corresponding to a plurality of target pedestrians. The pedestrian image training samples are used to train a pedestrian re-identification model. Therefore, the embodiments of the present application do not limit the image content contained in the image training samples.

[0060] In implementation, when the terminal device first performs recognition model training, it can integrate the initial feature extractor into the recognition model through the recognition model and the initial feature extraction parameters (thereby, the initial feature extraction parameters are equivalent to the initial feature extractor) to extract image features from local image training samples. Then, according to the extracted image features and the loss function of the preset recognition model, the recognition loss of the recognition model is calculated.

[0061] In the subsequent parameter adjustment process of the recognition model, the recognition model will extract image features and determine image clustering centers for image training samples based on the model data sent by the server to implement the parameter adjustment process of model training.

[0062] Step 202, when the recognition loss does not meet the loss condition, the initial model parameters are adjusted to obtain training model parameters, and the training model parameters are sent to the server, instructing the server to update the training model parameters to obtain comprehensive model parameters.

[0063] In the implementation, according to the recognition loss of the recognition model and the preset loss condition, it is determined whether the terminal device needs to train the recognition model. If the loss condition is met, the model training process ends; if the loss condition is not met, the model parameters are adjusted. Specifically, when the recognition loss does not meet the loss condition, the terminal device adjusts the initial model parameters to obtain the training model parameters, wherein the training model parameters include the training feature extractor and the class center of the encrypted local image features. Then, the terminal device sends the training model parameters to the server, instructing the server to further update the training model parameters to obtain the comprehensive model parameters.

[0064] For example, in the case where the image training sample is a face image training sample: when the face recognition loss does not meet the loss condition, the terminal device adjusts the initial model parameters to obtain the training model parameters, wherein the training model parameters include the training feature extractor and the type center of the encrypted face image features. Then, the terminal device sends the training model parameters to the server, instructing the server to further update the training model parameters to obtain the comprehensive model parameters.

[0065] Step 203, receiving comprehensive model parameters, and training the recognition model according to the comprehensive model parameters and the image training samples, until the recognition loss of the recognition model meets the loss condition, and the recognition model training is completed.

[0066] Among them, the comprehensive model parameters include an updated feature extractor (parameter data) for image feature extraction and encrypted image class center information of each training party that needs to perform model training.

[0067] During implementation, the terminal device receives the comprehensive model parameters sent by the server, and trains the recognition model based on the comprehensive model parameters and image training samples. The model parameters (that is, model data) are adjusted through the interaction between the terminal device and the server until the recognition loss of the recognition model meets the preset loss conditions, and the recognition model training is completed.

[0068] In the above-mentioned recognition model training method, the terminal trains the recognition model according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model; when the recognition loss does not meet the loss condition, the initial model parameters are adjusted to obtain the training model parameters, and the training model parameters are sent to the server for parameter update. The recognition model is trained according to the comprehensive model parameters and image training samples updated by the server until the recognition loss of the recognition model meets the loss condition, and the recognition model training is completed. With this method, the recognition model is trained locally through local training samples, which ensures the security of personal privacy data. At the same time, for the training model parameters obtained during the training process, the server is instructed to update the training model parameters to obtain the comprehensive model parameters, which realizes the sharing of training information of multiple training parties in model training and improves the accuracy of the results of the trained recognition model.

[0069] In one embodiment, Figure 3 As shown, the specific processing process of performing initial model training according to the local initial model parameters of the terminal device in step 201 includes:

[0070] Step 301 , extracting features from image training samples according to the initial feature extractor in the initial model parameters to obtain local image features and cluster centers of the local image features.

[0071] In the implementation, the terminal device runs the initial feature extractor in the recognition model based on the initial model parameters, and extracts features from the locally stored image training samples through the initial feature extractor to obtain the image features corresponding to each image (which can be used to extract features from the image). j Represented), cluster analysis is performed on all image features through the recognition model to obtain the cluster center of local image features, using W = [w1, w2, … w n] is represented. The number of cluster centers of local image features is not limited, and can be one or more. For example, the initial feature extractor is used to extract features from the locally stored face image training samples to obtain the face image features corresponding to each face image, and then the recognition model can be used to perform cluster analysis on the face image features corresponding to all face images. The face image processing implementation process is the same as the local image processing process described above, and will not be described in detail in this embodiment.

[0072] Among them, the initial model parameters of the local recognition model when the model is trained for the first time only include the initial feature extractor, but after the subsequent interaction with the server, the initial model parameters are updated and updated to comprehensive model parameters based on the server's distribution. The comprehensive model parameters include the updated feature extractor and the encrypted image feature class centers of each training party (at least two).

[0073] Step 302: Calculate the recognition loss of the recognition model according to the local image features and the cluster center of the local image features.

[0074] In implementation, the terminal device calculates the recognition loss of the recognition model based on the extracted local image features and the clustering centers of the local image features.

[0075] Specifically, taking the image training sample as a face image training sample as an example, when the terminal device performs model training based on the initial model parameters, the features calculated in the recognition model only include local face image feature information (that is, only include image feature information extracted from the local face image training sample). Therefore, the initial loss function only includes the extraction loss information generated by each face object in the training sample for its own feature extraction, and the difference loss information of the face object relative to other objects in the training sample. Specifically, the loss function formula corresponding to the initial model parameters is as follows:

[0076]

[0077] Among them, L c (φ c ,W c ,D c ) is the loss function, and the superscript c of the parameters in the formula represents the cth face object contained in the image training sample (face image training sample). c is the initial feature extractor included in the recognition model. c is the cluster center of the clustering result of the cth face object (also called the target object) in the local face image training sample, D c represents the local image training sample, D c The training samples contain n c Individual face objects, each of which corresponds to NC A face image. u and v are both similarity discriminant functions (for example, the output value of the similarity discriminant function can be 0 or 1, similarity is 0, and dissimilarity is 1), f i c is the image feature extracted from the face image of the cth face object, It is the cluster center of all face images clustered corresponding to the c-th face object.

[0078] Step 303, determining whether to adjust the cluster center of the initial feature extractor and the local image features according to the recognition loss and the loss condition.

[0079] In implementation, the loss condition of the model can be a preset loss threshold, and the terminal device can then determine whether the recognition loss output by the model meets the model accuracy requirements based on the loss condition, thereby determining whether to adjust the clustering center of the initial feature extractor and local image features.

[0080] The initial feature extractor is associated with the cluster center of the local image, that is, the cluster center is adjusted along with the initial feature extractor. Specifically, after the initial feature extractor is adjusted, the image feature extraction is performed again according to the adjusted feature extractor, and the extracted new image features are clustered to obtain the adjusted cluster center.

[0081] In one embodiment, Figure 4 As shown, the training model parameters include the training feature extractor and the encrypted class center of the local image feature. The specific processing process of step 202 includes:

[0082] Step 401, if the recognition loss of the recognition model does not meet the loss condition, the parameters of the initial feature extractor are adjusted to obtain a training feature extractor;

[0083] Step 402: extract local image features from the image training samples according to the training feature extractor.

[0084] Step 403: Perform differential privacy clustering on the local image features in the recognition model to obtain the encrypted cluster center of the local image features.

[0085] In implementation, if the recognition loss of the recognition model does not meet the preset loss condition (for example, the recognition loss is greater than the preset loss threshold), the parameters of the initial feature extractor are adjusted to obtain an adjusted training feature extractor. Then, the terminal device re-extracts image features from the local image training sample according to the adjusted training feature extractor. Furthermore, differentially private local clustering (DPLC) clustering is performed on the re-extracted image features to obtain the class center of the encrypted local image features.

[0086] In this embodiment, by means of differential privacy cluster analysis, the difference information of image recognition can be transmitted between the terminal training parties through the server, and differential privacy can be used to ensure that the local personal information of each terminal is not leaked.

[0087] In one embodiment, Figure 5 As shown, in order to prevent the leakage of information involving personal privacy such as image features, during the image recognition process, the image features can be encrypted using a differential privacy method. The specific processing process of step 403 includes the following steps:

[0088] Step 501: Perform cluster analysis on local image features according to the recognition model to obtain clustering results of local image features.

[0089] In implementation, the terminal device performs cluster analysis on the extracted local image features according to the local recognition model to obtain the clustering results of the local image features. The clustering results are shared or processed as an overall feature to avoid the leakage of personal privacy information.

[0090] Among them, the clustering results of local image features (using [w1,w2…w n ] indicates) can be one or more. When the clustering result is one, there is only one clustering center W1 corresponding to one image feature. When the clustering result is multiple, there are multiple clustering centers corresponding to multiple image features. For example, if three classes are obtained, there are three corresponding clustering centers, namely W1, W2, and W3.

[0091] Step 502: Cover each clustering result in the form of a cluster set according to the differential privacy algorithm, and determine the center of each cluster set.

[0092] In implementation, Figure 6 As shown in (a) in FIG. 1 , after clustering the local image features (e.g., face image features), each clustering result of the local image features includes multiple image feature points. Then, the terminal device covers each clustering result of the local image features in the form of a cluster, i.e., a cluster with p as the center and a radius of p, as shown in FIG. Figure 6 As shown in (b), the cluster coverage standard is to include as many image feature points as possible. Then, for each clustering result, the center of each cluster set can be determined, and the center of the cluster set can also be called the cluster center. Figure 6 As shown in (c) in FIG. 1 , there are differences in the cluster centers formed locally by each terminal. The specific differences are reflected in the cluster diagram as angles between each cluster center and each straight line where the p center is located.

[0093] Step 503: Randomly perturb the center of the cluster set corresponding to each clustering result to obtain the encrypted class center of the local image feature.

[0094] In the implementation, the center of the cluster set corresponding to each clustering result is randomly disturbed. For example, noise can be added to the center of the obtained cluster set to obtain the class center of the encrypted local image feature (using Specifically, the encrypted class center of the local image feature is the class center obtained by performing privacy protection on the real class center of the local image feature through differential privacy. Its encryption method is the differential privacy encryption method. The encrypted class center of the local image feature can reach (∈, δ)-DP (differential privacy standard), where ∈ and δ are parameters of differential privacy. N is the number of samples in the local dataset. Where ∈ is the privacy level, the smaller the parameter, the better. In order to achieve this requirement, for the noise added to the cluster center, for example, the variance δ of the Gaussian noise satisfies The greater the noise, the less information is shared and the higher the privacy level.

[0095] In one embodiment, it is worth noting that when the recognition model calculates the loss based on the local initial model parameters, the loss function of the model is as shown in the above formula (1). When the recognition model first receives the comprehensive model parameters updated by the server until the subsequent training process, its corresponding loss function needs to include the difference loss between the encrypted image feature class center of the local image training sample and the encrypted image feature class center of other training parties in the comprehensive model parameters (that is, the face recognition difference between each training party needs to participate in the training). Specifically, the comprehensive model parameters include the updated feature extractor and the encrypted image feature class center of at least two training parties. The method for generating the loss function corresponding to the loss condition includes:

[0096] Step 1: For each local image feature, the comprehensive recognition loss is calculated based on the classification loss between the local image feature and the cluster center of the local image feature, the difference loss between the local image feature and other cluster centers in the image training sample, and the difference loss between the encrypted image feature class center of the image training sample and the encrypted image feature class centers of other training samples included in the comprehensive model parameters.

[0097] Step 2: The classification loss and comprehensive recognition loss between the local image features and the clustering centers of the local image features are used to calculate the image recognition loss of each local image.

[0098] In the implementation, the model training is carried out for the comprehensive model parameters, and the corresponding loss function formula of the recognition model is as follows:

[0099]

[0100] Among them, L c (φ c ,W c ,D c ,p) is the loss function, and the superscript c of the parameters in the formula represents the cth face object contained in the image training sample. c is the comprehensive feature extractor included in the recognition model. c The cth face object extracted by the comprehensive feature extractor in the local image training sample is the cluster center of the image feature clustering result. c represents the local image training sample, D c The training samples contain n c Individual face objects, each of which corresponds to N c face images. i is N c The starting point of the individual face image is the class center of the encrypted image features of each training party contained in the comprehensive model parameters. u and v are both similarity discriminant functions (for example, the output value of the similarity discriminant function can be 0 or 1, similarity is 0, and dissimilarity is 1), f i c is the image feature extracted from the face image of the cth face object, is the cluster center of all face images corresponding to the cth face object. C is the number of training parties interacting with the server to be trained for the recognition model. The current image feature f i c and The clusters are distinguished based on the center (i.e., the encrypted image feature center). Indicates that the cluster is the kth cluster generated by training method l. Among them, (The subscripts and superscripts of the parameters in this parameter are omitted and not shown), where θ represents and the angle between f.

[0101] In one embodiment, for a trained recognition model obtained through local training on a terminal device and interactive training with a server, the method further includes: inputting a facial image to be recognized into the trained recognition model, and obtaining a facial recognition result based on calculation processing of the recognition model.

[0102] In implementation, for a trained recognition model, the terminal device can obtain a face image to be recognized, input it into the trained recognition model, and obtain a face recognition result based on the calculation and processing of the recognition model.

[0103] In one embodiment, Figure 7 As shown, a recognition model training method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0104] Step 701, receiving training model parameters sent by at least two training parties, each training model parameter includes a training feature extractor and a class center of encrypted local image features of the training party.

[0105] In implementation, the server receives the training model parameters of each training party participating in the model training, where the number of training parties participating in the model training is at least two. The training model parameters sent by each training party to the server include the training feature extractor and the class center of the encrypted local image feature (also called the cluster center of differential privacy).

[0106] Step 702, calculate the mean of each training feature extractor to obtain an updated feature extractor.

[0107] Step 703, the class centers of the encrypted local image features of each training party are aggregated to obtain a set of the encrypted face image class centers of each training party.

[0108] In the implementation, the server calculates the mean of each training feature extractor to obtain an updated feature extractor, and aggregates and packages the encrypted class centers (i.e., cluster centers) of the local image features of each training party to obtain a set of cluster centers containing all training parties.

[0109] Step 704, the updated feature extractor and the set of encrypted image class centers are sent to each training party as comprehensive model parameters, instructing the terminal device of each training party to train the recognition model according to the comprehensive model parameters and image training samples.

[0110] During implementation, the server sends the updated feature extractor and the set of encrypted image class centers (set of cluster centers) as comprehensive model parameters to each training party, instructing the terminal device of each training party to train the recognition model according to the comprehensive model parameters and image training samples.

[0111] The above-mentioned recognition model training method realizes the update of the feature extractor and the packaging of the encrypted local image class centers between each training party through the update processing of the training model parameters by the server. The server then sends the processed comprehensive model parameters to each terminal device respectively, realizes the sharing of training data among the training parties, and ensures the accuracy and stability of the recognition model training.

[0112] In one embodiment, an example of a recognition model training method is provided, the method comprising:

[0113] Step 801: The terminal device trains the recognition model according to the initial model parameters and the face image training samples to obtain the recognition loss of the face recognition model.

[0114] Step 802: When the recognition loss does not satisfy the loss condition, the terminal device adjusts the initial model parameters to obtain training model parameters, and sends the training model parameters to the server.

[0115] Step 803, the server receives training model parameters sent by at least two training parties. Each training model parameter includes a training feature extractor and a class center of the encrypted local face image features of the training party. Then, the server calculates the mean of each training feature extractor to obtain an updated feature extractor; and aggregates the class centers of the encrypted local face image features of each training party to obtain a set of encrypted image class centers of each training party.

[0116] In step 804, the server uses the updated feature extractor and the encrypted set of image class centers as comprehensive model parameters and sends them to the terminal devices of each training party respectively.

[0117] Step 805: Each training terminal device receives the comprehensive model parameters, and trains the face recognition model according to the comprehensive model parameters and the face image training samples to obtain the recognition loss of the face recognition model.

[0118] Step 806: If the recognition loss of the face recognition model does not meet the loss condition, execute steps 802 to 805.

[0119] Step 807: If the recognition loss of the face recognition model meets the loss condition, the face recognition model training ends.

[0120] It should be understood that although Figures 2 to 5 , Figure 7 and Figure 8The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figures 2 to 5 , Figure 7 and Figure 8 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0121] In one embodiment, Fig. 9 As shown, a recognition model training device 900 is provided, comprising: a loss calculation module 910, a parameter updating module 920 and a training module 930, wherein:

[0122] The loss calculation module 910 is used to train the recognition model according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model;

[0123] The parameter updating module 920 is used to adjust the initial model parameters to obtain the training model parameters when the recognition loss does not meet the loss condition, and send the training model parameters to the server to instruct the server to update the training model parameters to obtain the comprehensive model parameters;

[0124] The training module 930 is used to receive the comprehensive model parameters, and train the recognition model according to the comprehensive model parameters and the image training samples until the recognition loss of the recognition model meets the loss condition, and the recognition model training is completed.

[0125] In one embodiment, the loss calculation module 910 is specifically used to extract features from the image training samples according to the initial feature extractor in the initial model parameters to obtain local image features and cluster centers of the local image features;

[0126] Calculate the recognition loss of the recognition model based on the local image features and the clustering center of the local image features;

[0127] According to the recognition loss and the loss condition, it is determined whether to adjust the clustering centers of the initial feature extractor and the local image features.

[0128] In one embodiment, the training model parameters include the training feature extractor and the class center of the encrypted local image features, and the parameter updating module 920 is specifically used to adjust the parameters of the initial feature extractor to obtain the training feature extractor if the recognition loss of the recognition model does not meet the loss condition;

[0129] extracting local image features from image training samples according to the trained feature extractor;

[0130] In the recognition model, differential privacy clustering is performed on the local image features to obtain the class center of the encrypted local image features.

[0131] In one embodiment, the loss calculation module 910 is specifically used to perform cluster analysis on the local image features according to the recognition model to obtain the clustering results of the local image features;

[0132] According to the differential privacy algorithm, each clustering result is covered in the form of a cluster set, and the center of each cluster set is determined;

[0133] The center of the cluster set corresponding to each clustering result is randomly perturbed to obtain the class center of the encrypted local image feature.

[0134] In one embodiment, the apparatus 900 further includes

[0135] The recognition module is used to input the face image to be recognized into the trained recognition model, and obtain the face recognition result according to the calculation processing of the recognition model.

[0136] In one embodiment, the comprehensive model parameters include an updated feature extractor and image feature class centers encrypted by at least two training parties, and the device also includes a generation module, the generation module is used to sum the difference loss between each face image and other face images in the image training sample, and the difference loss between the encrypted image feature class center of the image training sample and the encrypted image feature class centers of other training parties included in the comprehensive model parameters, to obtain a comprehensive recognition loss;

[0137] The image recognition loss of each face image is calculated based on the feature loss and comprehensive recognition loss of each face image in the image training sample.

[0138] In another embodiment, a recognition model training device is provided, comprising: a receiving module, an updating module, a summarizing module and a sending module, wherein:

[0139] A receiving module, used to receive training model parameters sent by at least two training parties, each training model parameter including a training feature extractor and a class center of encrypted local image features of the training party;

[0140] An updating module, used for calculating the mean of each training feature extractor to obtain an updated feature extractor;

[0141] A summarizing module is used to summarize the encrypted class centers of the local image features of each training party to obtain a set of encrypted image class centers of each training party;

[0142] The sending module is used to send the updated feature extractor and the set of encrypted image class centers as comprehensive model parameters to each training party respectively, instructing the terminal device of each training party to train the recognition model based on the comprehensive model parameters and image training samples.

[0143] For the specific definition of the recognition model training device, please refer to the definition of the recognition model training method above, which will not be repeated here. Each module in the above-mentioned recognition model training device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0144] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a recognition model training method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0145] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0146] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0147] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0148] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0149] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0150] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A recognition model training method, characterized in that: The method is applied to a terminal device, and the method includes: Training the recognition model according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model; When the recognition loss does not satisfy the loss condition, the initial model parameters are adjusted to obtain training model parameters, and the training model parameters are sent to the server, instructing the server to update the training model parameters to obtain comprehensive model parameters; the initial model parameters include starting parameters in the recognition model operation process, including an initial feature extractor for the image training sample; the training model parameters include the training feature extractor and the class center of the encrypted local image feature; The comprehensive model parameters are received, and the recognition model is trained according to the comprehensive model parameters and the image training samples until the recognition loss of the recognition model meets the loss condition, and the recognition model training is completed.

2. The method according to claim 1, characterized in that The step of training the recognition model according to the initial model parameters and the image training samples to obtain the recognition loss of the recognition model includes: Extract features from the image training samples according to the initial feature extractor in the initial model parameters to obtain local image features and cluster centers of the local image features; Calculating the recognition loss of the recognition model according to the local image features and the cluster centers of the local image features; According to the recognition loss and the loss condition, it is determined whether to adjust the cluster center of the initial feature extractor and the local image feature.

3. The method according to claim 1, characterized in that The training model parameters include a training feature extractor and a class center of the encrypted local image feature. When the recognition loss does not meet the loss condition, the initial model parameters are adjusted to obtain the training model parameters, including: If the recognition loss of the recognition model does not meet the loss condition, adjusting the parameters of the initial feature extractor to obtain a trained feature extractor; extracting local image features from the image training samples according to the training feature extractor; Perform differential privacy clustering on the local image features in the recognition model to obtain encrypted cluster centers of the local image features.

4. The method according to claim 3, characterized in that The performing differential privacy clustering on the local image features in the recognition model to obtain encrypted cluster centers of the local image features includes: performing cluster analysis on the local image features according to the recognition model to obtain clustering results of the local image features; According to the differential privacy algorithm, each clustering result is covered in the form of a cluster set, and the center of each cluster set is determined; The center of the cluster set corresponding to each clustering result is randomly perturbed to obtain the encrypted class center of the local image feature.

5. The method according to claim 1, wherein The comprehensive model parameters include an updated feature extractor and image feature class centers encrypted by at least two training parties, and a method for generating a loss function corresponding to the loss condition includes: For each local image feature, a comprehensive recognition loss is calculated based on the classification loss between the local image feature and the cluster center of the local image feature, the difference loss between the local image feature and other cluster centers in the image training sample, and the difference loss between the encrypted image feature class center of the image training sample and the encrypted image feature class centers of other training samples included in the comprehensive model parameters; The image recognition loss of each local image is calculated according to the classification loss between each local image feature and the cluster center of the local image feature in the image training sample and the comprehensive recognition loss.

6. The method according to claim 1, wherein The method further comprises: The image to be recognized is input into the trained recognition model, and the image recognition result is obtained according to the calculation processing of the recognition model.

7. A recognition model training method, characterized in that: The method is applied to a server, and further comprises: Receiving training model parameters sent by at least two training parties, each of the training model parameters including a training feature extractor and a class center of the encrypted local image features of the training party; the training model parameters are obtained by training a recognition model based on initial model parameters and image training samples to obtain a recognition loss of the recognition model, and adjusting the initial model parameters when the recognition loss does not meet a loss condition; the initial model parameters include starting parameters during the operation of the recognition model; Calculating the mean of each of the training feature extractors to obtain an updated feature extractor; Aggregating the encrypted class centers of the local image features of each training party to obtain a set of encrypted class centers of the image of each training party; The updated feature extractor and the set of encrypted image class centers are sent as comprehensive model parameters to each training party respectively, instructing the terminal device of each training party to train the recognition model according to the comprehensive model parameters and the image training samples.

8. A recognition model training device, characterized in that: The device comprises: A loss calculation module is used to train the recognition model based on the initial model parameters and the image training samples to obtain the recognition loss of the recognition model; a parameter updating module, configured to adjust the initial model parameters to obtain training model parameters when the recognition loss does not satisfy the loss condition, and send the training model parameters to the server, instructing the server to update the training model parameters to obtain comprehensive model parameters; the initial model parameters include starting parameters in the recognition model operation process, including an initial feature extractor for the image training sample; the training model parameters include the training feature extractor and the class center of the encrypted local image features; A training module is used to receive the comprehensive model parameters and train the recognition model according to the comprehensive model parameters and the image training samples until the recognition loss of the recognition model meets the loss condition and the recognition model training is completed.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 or claim 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 or claim 7 are implemented.