Model training method, device, storage medium and electronic device
Protecting the privacy of data in federated learning through differential privacy processing solves the problems of high computational complexity and ciphertext expansion in homomorphic encryption, and improves the efficiency and accuracy of federated learning.
Patent Information
- Application Number
- CN202111176309.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-09
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2041-10-09
AI Technical Summary
In federated learning, homomorphic encryption has high computational complexity and has problems with ciphertext expansion, which requires a large amount of computing resources, memory resources, and communication resources during model training, affecting efficiency.
Protect the privacy of the data during the joint training process through differential privacy processing. It determines whether the first gradient and the second gradient meet the preset gradient conditions and then performs differential privacy processing, reducing computational complexity and communication resource consumption, and improving the accuracy of model training. Spend.
It reduces computational complexity and communication resource consumption, reduces data distortion, improves the efficiency and accuracy of joint training, ensures data privacy and improves model training effects.
Smart Images

Figure CN115965093B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of machine learning, and in particular, to a model training method, device, storage medium and electronic device. Background Art
[0002] Federated Learning is a "privacy protection + distributed" machine learning technology that solves the problem of how to jointly train a global model based on virtual "aggregated" data while protecting privacy when sensitive data exists in multiple independent institutions, groups or individuals. During the training process of this global model, homomorphic encryption is usually used to protect data privacy. However, the computational complexity of homomorphic encryption is high, and there is a problem of ciphertext expansion, so more computing resources, memory resources and communication resources are required during the model training process. Summary of the invention
[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, the present disclosure provides a model training method, the method comprising:
[0005] Obtaining sample data and determining a label value corresponding to the sample data;
[0006] Determine the prediction value corresponding to the sample data through a joint training model;
[0007] Determining a first gradient and a second gradient of a model parameter of the joint training model according to the label value and the predicted value, wherein a derivative corresponding to the first gradient is different from a derivative corresponding to the second gradient;
[0008] If the first gradient and the second gradient meet the preset gradient condition, differential privacy processing is performed on the first gradient to obtain a first target gradient, and differential privacy processing is performed on the second gradient to obtain a second target gradient;
[0009] Sending the first target gradient and the second target gradient to the other end participating in the joint training, wherein the first target gradient and the second target gradient are used by the other end to adjust the parameters of the joint training model;
[0010] The preset gradient condition includes any of the following conditions:
[0011] The variance of the first gradient is less than or equal to a first preset threshold, and the variance of the second gradient is less than or equal to the first preset threshold;
[0012] The standard deviation of the first gradient is less than or equal to a second preset threshold, and the standard deviation of the second gradient is less than or equal to the second preset threshold;
[0013] The information entropy of the first gradient is less than or equal to a third preset threshold, and the information entropy of the second gradient is less than or equal to the third preset threshold.
[0014] In a second aspect, the present disclosure further provides a model training device, the device comprising:
[0015] A first determination module, used to obtain sample data and determine a label value corresponding to the sample data;
[0016] A second determination module, used to determine the prediction value corresponding to the sample data through a joint training model;
[0017] A third determination module is used to determine a first gradient and a second gradient of a model parameter of the joint training model according to the label value and the predicted value, wherein a derivative corresponding to the first gradient is different from a derivative corresponding to the second gradient;
[0018] A first processing module, configured to perform differential privacy processing on the first gradient to obtain a first target gradient, and perform differential privacy processing on the second gradient to obtain a second target gradient when both the first gradient and the second gradient meet a preset gradient condition;
[0019] A sending module, used to send the first target gradient and the second target gradient to the other end participating in the joint training, wherein the first target gradient and the second target gradient are used by the other end to adjust the parameters of the joint training model;
[0020] The preset gradient condition includes any of the following conditions:
[0021] The variance of the first gradient is less than or equal to a first preset threshold, and the variance of the second gradient is less than or equal to the first preset threshold;
[0022] The standard deviation of the first gradient is less than or equal to a second preset threshold, and the standard deviation of the second gradient is less than or equal to the second preset threshold;
[0023] The information entropy of the first gradient is less than or equal to a third preset threshold, and the information entropy of the second gradient is less than or equal to the third preset threshold.
[0024] In a third aspect, the present disclosure further provides a computer-readable medium having a computer program stored thereon, which implements the steps of the method described in the first aspect when the program is executed by a processing device.
[0025] In a fourth aspect, the present disclosure further provides an electronic device, including:
[0026] a storage device having a computer program stored thereon;
[0027] A processing device is used to execute the computer program in the storage device to implement the steps of the method in the first aspect.
[0028] Through the above technical solution, the privacy of data in the joint training process can be protected by differential privacy. Compared with homomorphic encryption, differential privacy is a plaintext calculation, so it can reduce the computational complexity, thereby improving the efficiency of joint training, and can reduce the consumption of memory resources and the consumption of communication resources during joint training. On the other hand, before differential privacy, it can be determined whether the first gradient and the second gradient meet the preset gradient conditions. If the first gradient and the second gradient meet the preset gradient conditions, differential privacy processing is performed on the first gradient and the second gradient. In this way, data distortion caused by differential privacy processing can be reduced, thereby improving the effect of joint training while ensuring data privacy. In addition, the gradient used by the other end participating in the joint training to adjust the model parameters is calculated based on the original data features, which can improve the accuracy of model training compared to the method of estimating the gradient at the other end.
[0029] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:
[0031] Figure 1 It is a schematic diagram of the data content possessed by each participant in federated learning;
[0032] Figure 2 is a flowchart of a model training method according to an exemplary embodiment of the present disclosure;
[0033] Figure 3 is a schematic diagram of data at one end and another end in a model training method according to an exemplary embodiment of the present disclosure;
[0034] Figure 4is a block diagram of a model training device according to an exemplary embodiment of the present disclosure;
[0035] Figure 5 It is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0036] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0037] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0038] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0039] It should be noted that the concepts of "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should also be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0040] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0041] Federated Learning is a "privacy protection + distributed" machine learning technology that solves the problem of how to jointly train a global model based on virtual "aggregated" data while protecting privacy when sensitive data exists in multiple independent institutions, groups or individuals. The concept of federated learning has been expanded to horizontal federation, vertical federation and federated migration. Among them, horizontal federation means that there is a large amount of feature overlap in multi-party data sets, but the samples are complementary. Vertical federation means that there is a large amount of sample overlap in multi-party data sets, but the features are complementary. Vertical federation is suitable for scenarios where multiple features from finance, social, games, education, etc. serve a business party label.
[0042] For example, the application scenario of vertical federation may include Participant A, Participant B, and Participant C, where Participant A is a social media company with social features of many people, as shown in Table 1. Participant B is an online education company with education-related features of many people, as shown in Table 2. Participant C is a credit company with credit records of a small group of people and a small number of related features, as shown in Table 3.
[0043] Table 1
[0044]
[0045] Table 2
[0046]
[0047]
[0048] Table 3
[0049]
[0050] In this case, the data owned by each participant can also be referred to Figure 1 .
[0051] If participant C wants to jointly train the model with the user features of participants A and B and the credit features and default labels of participant C itself, the privacy of each party's data (such as features, labels, etc.) needs to be protected during the training process so that it is not leaked to other participants. After the training is completed, participant C can use the trained model to make default predictions for a large number of people, determine whether new users default based on the prediction results, and make subsequent decisions to reduce the bad debt rate.
[0052] In related technologies, homomorphic encryption is usually used to protect the privacy of data in the joint training process. Homomorphic encryption is one of the core technologies in the field of secure multi-party computing, and homomorphism is a property of certain cryptographic systems. Specifically, if a cryptographic system has homomorphism, ciphertext operations (such as addition and multiplication) in the ciphertext space can be mapped to the plaintext space. In this case, <x>represents the ciphertext of the plaintext x. For example, the famous RSA cryptosystem is multiplicatively homomorphic in the unpadded state, that is, it satisfies <x1x2> = <x1> <x2>.
[0053] However, the computational complexity of homomorphic encryption is high, so more computing resources and memory resources are needed in the joint model training process. In addition, since joint training involves multiple participants, the homomorphic encrypted data needs to be transmitted between the corresponding participants, and the homomorphic encryption method has the problem of ciphertext expansion, so the transmission of homomorphic encrypted data between participants requires more communication resources.
[0054] In view of this, the present disclosure provides a model training method to reduce computing resources, memory resources and communication resources in the joint training process while protecting data privacy, thereby improving the efficiency of joint training.
[0055] Figure 2 is a flow chart of a model training method according to an exemplary embodiment of the present disclosure. Figure 2 , the model training method can be applied to one end participating in joint training, including:
[0056] Step 201: Obtain sample data and determine the label value corresponding to the sample data.
[0057] Step 202: Determine the prediction value corresponding to the sample data through the joint training model.
[0058] Step 203: Determine a first gradient and a second gradient of a model parameter of the joint training model according to the label value and the predicted value, wherein the derivative corresponding to the first gradient is different from the derivative corresponding to the second gradient.
[0059] Step 204: If the first gradient and the second gradient meet the preset gradient condition, differential privacy processing is performed on the first gradient to obtain a first target gradient, and differential privacy processing is performed on the second gradient to obtain a second target gradient.
[0060] Step 205: Send the first target gradient and the second target gradient to the other end participating in the joint training. The first target gradient and the second target gradient are used by the other end to adjust the parameters of the joint training model.
[0061] Through the above technical solution, the privacy of data in the joint training process can be protected by differential privacy processing. Compared with homomorphic encryption, differential privacy is a plaintext calculation, so it can reduce the computational complexity, thereby improving the efficiency of joint training, and can reduce the consumption of memory resources, and reduce the consumption of communication resources during joint training. On the other hand, before performing differential privacy processing, it can be determined whether the first gradient and the second gradient meet the preset gradient conditions. If the first gradient and the second gradient meet the preset gradient conditions, differential privacy processing is performed on the first gradient and the second gradient. In this way, data distortion caused by differential privacy processing can be reduced, thereby improving the effect of joint training while ensuring data privacy.
[0062] In addition, compared with the method in the related art where the first participant calculates the first gradient and the second participant estimates the second gradient and then sends it to the first participant, in the model training method provided by the present disclosure, the first participant can calculate the first gradient and the second gradient based on real data and then perform local differential privacy and send them to the second participant. That is, the gradient used by the other end participating in the joint training to adjust the model parameters is calculated based on the original data features, which can improve the accuracy of model training compared with the method of estimating the gradient at the other end.
[0063] In order to enable those skilled in the art to better understand the model training method provided by the present invention, the above steps are described in detail with examples below.
[0064] First of all, it should be understood that each end of the joint training model can maintain a global template respectively, that is, the joint training model in the embodiment of the present disclosure. Then, during the training process, either end can synchronize the respective model training results to the other ends based on the privacy-protected data. Among them, the end with the true label value of the sample data (such as the first participant in the present disclosure) can send the calculation result of the loss function to the other ends (such as the second participant in the present disclosure) for model training after privacy protection. The end with data features (such as the second participant in the present disclosure) can synchronize the model information after model training to other ends (such as the first participant in the present disclosure). In this way, federated learning can be achieved.
[0065] For example, the joint training model can be a gradient boosting tree model, such as XGBoost. Of course, the joint training model can also be any other type of machine learning model, which is not limited in the embodiments of the present disclosure. The training participants of the joint training model may include a first participant and a second participant. Among them, the first participant may have the true label value of the sample data, that is, one end that executes the model training method in the present disclosure. For example, the participant C in the example above has a default label and related characteristics of a small number of people, and the default label is used to characterize whether the user has a default. The second participant may have data features associated with the sample data, that is, the other end participating in the joint training. For example, the participant A in the example above has social features associated with the sample data, or the participant B has educational features of the sample data.
[0066] It should be understood that the other end participating in the joint training may include all the other ends of the participants involved in the joint training model except the end that executes the above-mentioned model training method. Therefore, in a possible manner, the other end participating in the joint training can be one participant or multiple participants, and the embodiments of the present disclosure are not limited to this. For the sake of convenience, the following example takes the other end as a participant, and assumes that the one end that executes the above-mentioned model training method does not master any data features, but only masters the real label value, and the other end masters the data features, that is, the data content of the one end and the other end participating in the joint training below can be as follows: Figure 3 shown.
[0067] For example, the predicted value is used to represent the prediction result of the joint training model for the sample data, and the label value is used to represent the actual result of the sample data. Therefore, the loss function is calculated based on the predicted value and the label value, and the joint training model is adjusted according to the result of the loss function, so that the predicted value of the model is close to the actual value, thereby achieving the purpose of model training.
[0068] In a possible manner, the model information synchronized by the other end may be obtained first, and the model information includes the sample space information corresponding to each split node in the joint training model after the other end adjusts the model parameters of the joint training model. Accordingly, the prediction value corresponding to the sample data is determined by the joint training model, which may be: updating the sample space information corresponding to each split node in the joint training model according to the model information, and determining the target prediction value of the joint training model for the sample data based on the updated joint training model, and then determining the sum of the target prediction value and the historical prediction value of the sample data as the prediction value of the sample data.
[0069] In a possible manner, the model information may be obtained by the other end substituting the received first target gradient and second target gradient into the splitting gain calculation formula of the joint training model, and adjusting the parameters of the joint training model according to the calculation result of the splitting gain calculation formula.
[0070] For example, after the other end receives the first target gradient and the second target gradient corresponding to the multiple sample data, the first target total gradient, the second target total gradient, the third target total gradient and the fourth target total gradient can be determined based on the multiple first target gradients and the multiple second target gradients. Among them, the first target total gradient is the sum of the first target gradients of the sample data whose eigenvalue is less than the target eigenvalue, the second target total gradient is the sum of the first target gradients of the sample data whose eigenvalue is greater than or equal to the target eigenvalue, the third target total gradient is the sum of the second target gradients of the sample data whose eigenvalue is less than the target eigenvalue, and the fourth target total gradient is the sum of the second target gradients of the sample data whose eigenvalue is greater than or equal to the target eigenvalue, and the target eigenvalue is the eigenvalue corresponding to each binning point after the eigenvalues of the multiple sample data are binned with equal frequency. Then, the first target total gradient, the second target total gradient, the third target total gradient and the fourth target total gradient can be substituted into the splitting gain calculation formula of the joint training model, and the parameters of the joint training model can be adjusted according to the result of the splitting gain calculation formula to obtain the model information to be synchronized.
[0071] For example, first perform equal frequency binning on each data feature j (j=1, ..., m) at the other end to obtain k binning points: s j1 <… jk Taking the age characteristics shown in Table 4 as an example, by performing equal frequency binning with k=2, we can obtain binning points s1=23 and s2=55.
[0072] Table 4
[0073] age Box No. 15 0 16 0 23 1 50 1 55 2 60 2
[0074] In this case, the target eigenvalue s jk Includes two age characteristic values: 23 and 55.
[0075] After receiving the first target gradient and the second target gradient, the other end can summarize all eigenvalues less than s jk A sample collection And calculate the sum of the first objective gradients of these samples: And calculate the sum of the second objective gradients of these samples: Similarly, we can sum up all eigenvalues greater than or equal to s jk A sample collection And calculate the sum of the first objective gradients of these samples: And calculate the sum of the second objective gradients of these samples: That is to say, the total gradient of the first objective is The total gradient of the second objective is The total gradient of the third objective is The total gradient of the fourth objective is
[0076] Afterwards, the first target total gradient, the second target total gradient, the third target total gradient, and the fourth target total gradient can be substituted into the split gain calculation formula of the joint training model, and the parameters of the joint training model can be adjusted according to the result of the split gain calculation formula. For example, if the joint training model is a decision tree model, the first target total gradient, the second target total gradient, the third target total gradient, and the fourth target total gradient can be substituted into the following split gain calculation formula:
[0077]
[0078] in, λ is the preset regularization coefficient, λ≥0.
[0079] Finally, the split point with the largest gain can be selected as the optimal split point:
[0080] As a result, the other end can perform model training based on the received first target gradient and second target gradient. In addition, since privacy is protected by differential privacy, and differential privacy is a plaintext calculation, the other end can directly use the first target gradient and the second target gradient for model training during the model training process without decryption operations. Compared with homomorphic encryption, it can reduce computational complexity and improve model training efficiency.
[0081] For example, in practical applications, the joint training model is a decision tree model, and the model training process may include multiple iterations. Accordingly, in each iteration, the model information synchronized by the other end is obtained, and the model information may include the sample space information corresponding to each split node in the joint training model after the other end adjusts the parameters of the joint training model. Accordingly, in each iteration, the sample space information corresponding to each split node in the joint training model can be updated according to the model information, and based on the updated joint training model, the target prediction value of the joint training model for the sample data in this iteration is determined, and then the target prediction value and the sum of the historical prediction values of the sample data in each iteration before this iteration are determined as the prediction value of the joint training model for the sample data in this iteration.
[0082] For example, in the first training process, the predicted value can be a pre-set value, such as set to 0.5, which is not limited in the embodiments of the present disclosure. Then, the model training method provided by the present disclosure can be executed according to the initially set predicted value and the label value of the sample data to obtain the first target gradient and the second target gradient, and the first target gradient and the second target gradient are sent to the second participant (i.e., the other end participating in the joint training). After the second participant adjusts the parameters of the joint training model according to the first target gradient and the second gradient, the data features of the second participant can be input into the joint training model to obtain the sample space information corresponding to each split node in the joint training model, and the sample space information can be synchronized to the first participant (i.e., one end executing the model training method in the present disclosure). Afterwards, the first participant can calculate the weight value (i.e., predicted value) of each leaf node in the joint training model maintained by itself according to the synchronized sample space information and the first gradient and second gradient corresponding to each sample data in the sample space information.
[0083] During the second training process, the first participant can determine the prediction value of the joint training model for the sample data in this iteration based on the sum of the weight values of each leaf node in the joint training model maintained by itself and the historical prediction value of the sample data in the last process (i.e., the prediction value 0.5 in the first iteration process). Then, the model training method provided by the present disclosure is executed again according to the prediction value and the label value to obtain the first target gradient and the second target gradient, and the first target gradient and the second target gradient are sent to the second participant for model training. Similarly, each iteration process can determine the prediction value of this iteration process according to the historical prediction values of all previous iteration processes until the preset number of iterations is reached or the model parameters meet the preset conditions, and the iterative training is stopped. In this way, joint training between the first participant and the second participant can be achieved.
[0084] It should be understood that in the above-mentioned joint training process, since multiple parties are involved, data privacy protection is required. Specifically, the first gradient and the second gradient of the model parameters of the joint training model can be determined according to the label value and the predicted value, and then the first gradient and the second gradient can be privacy protected.
[0085] Among them, the gradient is a vector (vector), which means that the directional derivative of a function at this point reaches the maximum value along this direction, that is, the function changes fastest along this direction (the direction of this gradient) at this point, and the rate of change is the largest (which is the modulus of the gradient).
[0086] In a possible manner, a loss function of the joint training model may be calculated based on the label value and the predicted value, and then a first-order derivative of the loss function may be determined as a first gradient, and a second-order derivative of the loss function may be determined as a second gradient.
[0087] For example, according to the label value y of the i-th sample i And the predicted value of the i-th sample in the t-th training process The loss function for calculating the joint training model is: Further, the first-order derivative of the loss function is calculated as: The second-order derivative of the loss function is calculated as: Among them, the loss function of the embodiment of the present disclosure is The form of is not limited, for example, the mean square error can be selected, that is, Correspondingly, the first and second order derivatives are: h i =1.
[0088] In the disclosed embodiment, after obtaining the first gradient and the second gradient, data privacy protection can be performed by replacing the homomorphic encryption method with differential privacy, so as to reduce the computing resources, memory resources and communication resources in the joint training process while protecting data privacy, thereby improving the efficiency of joint training.
[0089] However, the inventors have found that the differential privacy method may cause excessive data distortion. Therefore, before performing data privacy protection, it is also possible to first determine whether the first gradient and the second gradient meet the preset gradient conditions. If the first gradient and the second gradient meet the preset gradient conditions, the first gradient is differentially privacy processed to obtain the first target gradient, and the second gradient is differentially privacy processed to obtain the second target gradient. In this way, data distortion caused by differential privacy processing can be reduced, thereby ensuring the accuracy of the joint training results while ensuring data privacy, and improving the joint training effect.
[0090] In a possible manner, the preset gradient condition may include any of the following conditions: the variance of the first gradient is less than or equal to a first preset threshold, and the variance of the second gradient is less than or equal to the first preset threshold; the standard deviation of the first gradient is less than or equal to the second preset threshold, and the standard deviation of the second gradient is less than or equal to the second preset threshold; the information entropy of the first gradient is less than or equal to a third preset threshold, and the information entropy of the second gradient is less than or equal to the third preset threshold.
[0091] For example, the first preset threshold, the second preset threshold, and the third preset threshold can be set according to actual conditions, and the embodiments of the present disclosure do not limit this. It should be understood that the larger the first preset threshold, the second preset threshold, and the third preset threshold, the lower the requirement for data fidelity, and vice versa, the smaller the first preset threshold, the second preset threshold, and the third preset threshold, the higher the requirement for data fidelity. In specific applications, the first preset threshold, the second preset threshold, and the third preset threshold can be set according to actual needs.
[0092] It should be understood that differential privacy processing can be understood as adding noise to the data so that other users cannot tell whether a sample is in the data set. Therefore, differential privacy processing of the first gradient can be achieved by adding noise to the first gradient, that is, the first target gradient can be: Similarly, differential privacy processing of the second gradient can be achieved by adding noise to the second gradient, that is, the second target gradient can be:
[0093] In a possible manner, a preset correspondence between the noise type and the privacy budget may be first obtained, and then a target noise type for performing differential privacy processing on the first gradient and the second gradient may be determined based on the preset privacy budget and the preset correspondence. Finally, differential privacy processing is performed on the first gradient based on the noise corresponding to the target noise type to obtain a first target gradient, and differential privacy processing is performed on the second gradient based on the noise corresponding to the target noise type to obtain a second target gradient.
[0094] For example, a preset correspondence between noise type and privacy budget can be set first, such as setting the first privacy budget to correspond to the first noise type, the second privacy budget to correspond to the second noise type, and so on. In the subsequent process, the target noise type for differential privacy processing of the first gradient and the second gradient can be determined based on the preset correspondence according to the given privacy budget. For example, based on the given privacy budget, the target noise type is determined to be Laplace noise. In this case, the variance of the first gradient is: (ε represents the preset privacy budget), the variance of the second gradient is: If the variance of the first gradient is less than or equal to the first preset threshold, and the variance of the second gradient is less than or equal to the first preset threshold, differential privacy processing is performed on the first gradient based on the noise of the Laplace distribution with a mean of zero to obtain the first target gradient, and differential privacy processing is performed on the second gradient based on the noise of the Laplace distribution with a mean of zero to obtain the second target gradient.
[0095] In other possible ways, if the first gradient and the second gradient do not meet the preset gradient conditions, the first gradient can be homomorphically encrypted or secret shared to obtain the first target gradient, and the second gradient can be homomorphically encrypted or secret shared to obtain the second target gradient.
[0096] It should be understood that if the first gradient and the second gradient do not meet the preset gradient gradient conditions, it means that the differential privacy-based approach will cause excessive data distortion, so homomorphic encryption or secret sharing can be used to protect data privacy and ensure data integrity. On the contrary, if the first gradient and the second gradient meet the preset gradient gradient conditions, it means that the differential privacy-based approach will not cause excessive data distortion, so differential privacy can be used to protect data privacy and improve training efficiency.
[0097] Therefore, during the joint training process, if it is expected that the use of local differential privacy will increase the loss of precision, then switch to homomorphic encryption or secret sharing to improve accuracy. Conversely, if it is expected that the use of local differential privacy will not increase the loss of precision, then use local differential privacy to improve speed. That is, the disclosed embodiment can adaptively switch between lossless but slow homomorphic encryption or secret sharing and lossy but fast local differential privacy, thereby ensuring efficient computing while improving model accuracy.
[0098] After obtaining the first target gradient and the second target gradient, the first target gradient and the second target gradient can be sent to the second participant of the joint training model (i.e., the other end participating in the joint training), so that the second participant adjusts the parameters of the joint training model maintained by itself based on the first target gradient and the second target gradient, and synchronizes the model information of the adjusted joint training model to the first participant (i.e., the end executing the model training method in the present disclosure). In this way, federated learning based on local differential privacy can be implemented to improve the efficiency of joint training. In addition, the first target gradient and the second target gradient are obtained by processing in a local differential privacy manner, and their corresponding true values g i and h i The privacy of the i and h i Contains the true label value y i Therefore, the privacy of the true label value is also protected.
[0099] Through any of the above model training methods, the privacy of the first gradient and the second gradient can be protected by local differential privacy, and the privacy of the true label value can be further protected. Secondly, local differential privacy is a pure plaintext calculation, which can greatly optimize the calculation efficiency compared to the high-complexity cryptographic method. In addition, the receiver does not need to decrypt, which can optimize the calculation process and thus improve the efficiency of joint training.
[0100] Taking XGBoost as an example, the joint training model is trained on the data of the same public data set. The model training method provided by the present disclosure takes 70 seconds to train each tree, while the SecureBoost algorithm based on homomorphic encryption takes 421 seconds to train each tree. It can be seen that the model training method provided by the present disclosure can greatly improve the efficiency of joint training.
[0101] In addition, after testing, for the data of the same public data set, the non-privacy protection method that sends the data to a certain end for model training has a model index AUC of 0.675. The model training method provided by the present disclosure uses the Duchi method for differential privacy when the preset privacy budget ε is 1, 3, 5, 8 and 10 respectively, and the model index AUC is shown in Table 5.
[0102] Table 5
[0103] ε=1 ε=3 ε=5 ε=8 ε=10 0.699 0.699 0.695 0.686 0.691
[0104] Referring to Table 5, it can be seen that compared with the non-privacy protection method, the model training method provided by the present disclosure can not only achieve data privacy, but also improve the model AUC. In other words, the model training method provided by the present disclosure can improve the model accuracy while ensuring data privacy and efficient calculation.
[0105] Based on the same inventive concept, the present disclosure provides a model training device, which can be part or all of an electronic device through software, hardware, or a combination of both. Figure 4 The model training device 400 is applied to a first participant of a joint training model, and includes:
[0106] A first determination module 401 is used to obtain sample data and determine a label value corresponding to the sample data;
[0107] A second determination module 402, configured to determine a prediction value corresponding to the sample data through a joint training model;
[0108] The third determination module 403 is used to determine a first gradient and a second gradient of a model parameter of the joint training model according to the label value and the predicted value, wherein the derivative corresponding to the first gradient is different from the derivative corresponding to the second gradient.
[0109] A first processing module 404 is used to perform differential privacy processing on the first gradient to obtain a first target gradient, and perform differential privacy processing on the second gradient to obtain a second target gradient when both the first gradient and the second gradient meet a preset gradient condition;
[0110] The sending module 405 is used to send the first target gradient and the second target gradient to the other end participating in the joint training, and the first target gradient and the second target gradient are used by the other end to adjust the parameters of the joint training model.
[0111] Optionally, the device 400 further includes:
[0112] The second processing module is used to perform homomorphic encryption processing or secret sharing processing on the first gradient to obtain a first target gradient, and perform homomorphic encryption processing or secret sharing processing on the second gradient to obtain a second target gradient when the first gradient and the second gradient do not meet the preset gradient condition.
[0113] Optionally, the preset gradient condition includes any of the following conditions:
[0114] The variance of the first gradient is less than or equal to a first preset threshold, and the variance of the second gradient is less than or equal to the first preset threshold;
[0115] The standard deviation of the first gradient is less than or equal to a second preset threshold, and the standard deviation of the second gradient is less than or equal to the second preset threshold;
[0116] The information entropy of the first gradient is less than or equal to a third preset threshold, and the information entropy of the second gradient is less than or equal to the third preset threshold.
[0117] Optionally, the first processing module 404 is used to:
[0118] Obtaining a preset correspondence between noise types and privacy budgets;
[0119] Determining a target noise type for performing differential privacy processing on the first gradient and the second gradient according to a preset privacy budget and the preset corresponding relationship;
[0120] The first gradient is differentially privately processed based on the noise corresponding to the target noise type to obtain a first target gradient, and the second gradient is differentially privately processed based on the noise corresponding to the target noise type to obtain a second target gradient.
[0121] Optionally, the device further comprises:
[0122] An acquisition module, used to acquire the model information synchronized by the other end, wherein the model information includes sample space information corresponding to each split node in the joint training model after the other end adjusts the parameters of the joint training model;
[0123] The second determining module 402 is used for:
[0124] updating the sample space information corresponding to each splitting node in the joint training model according to the model information, and determining a target prediction value for the sample data based on the updated joint training model;
[0125] The sum of the target prediction value and the historical prediction value of the sample data is determined as the prediction value of the sample data.
[0126] Optionally, the model information is obtained by the other end substituting the received first target gradient and the second target gradient into the splitting gain calculation formula of the joint training model, and adjusting the parameters of the joint training model according to the calculation result of the splitting gain calculation formula.
[0127] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0128] Based on the same inventive concept, an embodiment of the present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any of the above-mentioned model training methods are implemented.
[0129] Based on the same inventive concept, the present disclosure also provides an electronic device, including:
[0130] a memory having a computer program stored thereon;
[0131] A processor is used to execute the computer program in the memory to implement the steps of any of the above-mentioned model training methods.
[0132] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device 500 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0133] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0134] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0135] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0136] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0137] In some embodiments, any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) can be used for communication, and can be interconnected with any form or medium of digital data communication (e.g., communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), internets (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
[0138] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0139] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains sample data and determines the label value corresponding to the sample data; determines the predicted value corresponding to the sample data through a joint training model; determines the first gradient and the second gradient of the model parameters of the joint training model according to the label value and the predicted value, wherein the derivative corresponding to the first gradient is different from the derivative corresponding to the second gradient; if the first gradient and the second gradient meet the preset gradient condition, differential privacy processing is performed on the first gradient to obtain a first target gradient, and differential privacy processing is performed on the second gradient to obtain a second target gradient; the first target gradient and the second target gradient are sent to the other end participating in the joint training, and the first target gradient and the second target gradient are used by the other end to adjust the parameters of the joint training model.
[0140] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0141] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0142] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.
[0143] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0144] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0145] According to one or more embodiments of the present disclosure, Example 1 provides a model training method, including:
[0146] Obtaining sample data and determining a label value corresponding to the sample data;
[0147] Determine the prediction value corresponding to the sample data through a joint training model;
[0148] Determining a first gradient and a second gradient of a model parameter of the joint training model according to the label value and the predicted value, wherein a derivative corresponding to the first gradient is different from a derivative corresponding to the second gradient;
[0149] If the first gradient and the second gradient meet the preset gradient condition, differential privacy processing is performed on the first gradient to obtain a first target gradient, and differential privacy processing is performed on the second gradient to obtain a second target gradient;
[0150] The first target gradient and the second target gradient are sent to the other end participating in the joint training, and the first target gradient and the second target gradient are used by the other end to adjust the parameters of the joint training model.
[0151] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein the method further includes:
[0152] If the first gradient and the second gradient do not meet the preset gradient condition, the first target gradient is homomorphically encrypted or secret shared to obtain the first target gradient, and the second gradient is homomorphically encrypted or secret shared to obtain the second target gradient.
[0153] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1 or 2, wherein the preset gradient condition includes any of the following conditions:
[0154] The variance of the first gradient is less than or equal to a first preset threshold, and the variance of the second gradient is less than or equal to the first preset threshold;
[0155] The standard deviation of the first gradient is less than or equal to a second preset threshold, and the standard deviation of the second gradient is less than or equal to the second preset threshold;
[0156] The information entropy of the first gradient is less than or equal to a third preset threshold, and the information entropy of the second gradient is less than or equal to the third preset threshold.
[0157] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 1 or 2, wherein the first gradient is subjected to differential privacy processing to obtain a first target gradient, and the second gradient is subjected to differential privacy processing to obtain a second target gradient, including:
[0158] Obtaining a preset correspondence between noise types and privacy budgets;
[0159] Determining a target noise type for performing differential privacy processing on the first gradient and the second gradient according to a preset privacy budget and the preset corresponding relationship;
[0160] The first gradient is differentially privately processed based on the noise corresponding to the target noise type to obtain a first target gradient, and the second gradient is differentially privately processed based on the noise corresponding to the target noise type to obtain a second target gradient.
[0161] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 1 or 2, wherein the method further includes:
[0162] Acquire model information synchronized by the other end, the model information including sample space information corresponding to each split node in the joint training model after the other end adjusts the parameters of the joint training model;
[0163] The determining the predicted value corresponding to the sample data by the joint training model includes:
[0164] updating the sample space information corresponding to each splitting node in the joint training model according to the model information, and determining the target prediction value of the joint training model for the sample data based on the updated joint training model;
[0165] The sum of the target prediction value and the historical prediction value of the sample data is determined as the prediction value of the sample data.
[0166] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein the model information is obtained by adjusting the parameters of the joint training model according to the calculation result of the splitting gain calculation formula after the other end substitutes the received first target gradient and the second target gradient into the splitting gain calculation formula of the joint training model.
[0167] According to one or more embodiments of the present disclosure, Example 7 provides a model training device, the device comprising:
[0168] A first determination module, used to obtain sample data and determine a label value corresponding to the sample data;
[0169] A second determination module, used to determine the prediction value corresponding to the sample data through a joint training model;
[0170] A third determination module is used to determine a first gradient and a second gradient of a model parameter of the joint training model according to the label value and the predicted value, wherein a derivative corresponding to the first gradient is different from a derivative corresponding to the second gradient;
[0171] A first processing module, configured to perform differential privacy processing on the first gradient to obtain a first target gradient, and perform differential privacy processing on the second gradient to obtain a second target gradient when both the first gradient and the second gradient meet a preset gradient condition;
[0172] A sending module is used to send the first target gradient and the second target gradient to the other end participating in the joint training, and the first target gradient and the second target gradient are used by the other end to adjust the parameters of the joint training model.
[0173] According to one or more embodiments of the present disclosure, Example 8 provides the apparatus of Example 7, wherein the apparatus further includes:
[0174] The second processing module is used to perform homomorphic encryption processing or secret sharing processing on the first target gradient to obtain the first target gradient, and perform homomorphic encryption processing or secret sharing processing on the second gradient to obtain the second target gradient when the first gradient and the second gradient do not meet the preset gradient condition.
[0175] According to one or more embodiments of the present disclosure, Example 9 provides a computer-readable medium having a computer program stored thereon, which implements the steps of any of the methods described in Examples 1-6 when executed by a processing device.
[0176] According to one or more embodiments of the present disclosure, Example 10 provides an electronic device, including:
[0177] a storage device having a computer program stored thereon;
[0178] A processing device is used to execute the computer program in the storage device to implement the steps of any one of the methods described in Examples 1-6.
[0179] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0180] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0181] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here. < / x1> < / x1x2> < / x>
Claims
1. A model training method, characterized in that: The method comprises: Obtaining sample data and determining a label value corresponding to the sample data; Determine the prediction value corresponding to the sample data through a joint training model; Determining a first gradient and a second gradient of a model parameter of the joint training model according to the label value and the predicted value, wherein a derivative corresponding to the first gradient is different from a derivative corresponding to the second gradient; If the first gradient and the second gradient meet the preset gradient condition, differential privacy processing is performed on the first gradient to obtain a first target gradient, and differential privacy processing is performed on the second gradient to obtain a second target gradient; Sending the first target gradient and the second target gradient to the other end participating in the joint training, wherein the first target gradient and the second target gradient are used by the other end to adjust the parameters of the joint training model; The preset gradient condition includes any of the following conditions: The variance of the first gradient is less than or equal to a first preset threshold, and the variance of the second gradient is less than or equal to the first preset threshold; The standard deviation of the first gradient is less than or equal to a second preset threshold, and the standard deviation of the second gradient is less than or equal to the second preset threshold; The information entropy of the first gradient is less than or equal to a third preset threshold, and the information entropy of the second gradient is less than or equal to the third preset threshold.
2. The method according to claim 1, characterized in that The method further comprises: If the first gradient and the second gradient do not satisfy the preset gradient condition, homomorphic encryption processing or secret sharing processing is performed on the first gradient to obtain a first target gradient, and homomorphic encryption processing or secret sharing processing is performed on the second gradient to obtain a second target gradient.
3. The method according to claim 1 or 2, characterized in that: The performing differential privacy processing on the first gradient to obtain a first target gradient, and performing differential privacy processing on the second gradient to obtain a second target gradient, includes: Obtaining a preset correspondence between noise types and privacy budgets; Determining a target noise type for performing differential privacy processing on the first gradient and the second gradient according to a preset privacy budget and the preset corresponding relationship; The first gradient is differentially privately processed based on the noise corresponding to the target noise type to obtain a first target gradient, and the second gradient is differentially privately processed based on the noise corresponding to the target noise type to obtain a second target gradient.
4. The method according to claim 1 or 2, characterized in that: The method further comprises: Acquire model information synchronized by the other end, the model information including sample space information corresponding to each split node in the joint training model after the other end adjusts the model parameters of the joint training model; The determining the predicted value corresponding to the sample data by the joint training model includes: updating the sample space information corresponding to each splitting node in the joint training model according to the model information, and determining the target prediction value of the joint training model for the sample data based on the updated joint training model; The sum of the target prediction value and the historical prediction value of the sample data is determined as the prediction value of the sample data.
5. The method according to claim 4, characterized in that The model information is obtained by the other end substituting the received first target gradient and the second target gradient into the splitting gain calculation formula of the joint training model, and adjusting the parameters of the joint training model according to the calculation result of the splitting gain calculation formula.
6. A model training device, characterized in that: The device comprises: A first determination module, used to obtain sample data and determine a label value corresponding to the sample data; A second determination module, used to determine the prediction value corresponding to the sample data through a joint training model; A third determination module is used to determine a first gradient and a second gradient of a model parameter of the joint training model according to the label value and the predicted value, wherein a derivative corresponding to the first gradient is different from a derivative corresponding to the second gradient; A first processing module, configured to perform differential privacy processing on the first gradient to obtain a first target gradient, and perform differential privacy processing on the second gradient to obtain a second target gradient when both the first gradient and the second gradient meet a preset gradient condition; A sending module, used to send the first target gradient and the second target gradient to the other end participating in the joint training, wherein the first target gradient and the second target gradient are used by the other end to adjust the parameters of the joint training model; The preset gradient condition includes any of the following conditions: The variance of the first gradient is less than or equal to a first preset threshold, and the variance of the second gradient is less than or equal to the first preset threshold; The standard deviation of the first gradient is less than or equal to a second preset threshold, and the standard deviation of the second gradient is less than or equal to the second preset threshold; The information entropy of the first gradient is less than or equal to a third preset threshold, and the information entropy of the second gradient is less than or equal to the third preset threshold.
7. The device according to claim 6, characterized in that The device also includes: The second processing module is used to perform homomorphic encryption processing or secret sharing processing on the first gradient to obtain a first target gradient, and perform homomorphic encryption processing or secret sharing processing on the second gradient to obtain a second target gradient when the first gradient and the second gradient do not meet the preset gradient condition.
8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 5 are implemented.
9. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Model training method based on federated learning
CN111046433A
Federated learning method and device based on differential privacy and storage medium
CN111091199A
Method and device for jointly training business models
CN111723404A
Longitudinal federation modeling optimization method and device and readable storage medium
CN111860864A
Data protection method and device, medium and equipment
CN112347476A
