Transverse federated learning-oriented multi-party data feature completion method
Through distributed GAN technology, the coordinator generates sample data that contains the data characteristics of all participants, and uses feature correspondence tables and loss function optimization to solve the problem of data feature differences in horizontal federated learning, achieving data privacy protection and feature completion. Improved application versatility and safety.
Patent Information
- Application Number
- CN202410727896.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-24
AI Technical Summary
In horizontal federated learning, the data characteristics of each participant are different, making it difficult to achieve effective feature completion, which affects data privacy protection and the wide application of the model.
Using distributed generative adversarial network (GAN) technology, through generative models and multiple discriminant models, the coordinator generates sample data containing the data characteristics of all participants, and optimizes the data characteristics of each participant through feature correspondence tables and loss functions. Complete.
On the premise of protecting data privacy, it successfully realized the completion of multi-party data features, improved the application breadth and security of horizontal federated learning, and is suitable for scenarios with similar business models but large differences in feature sets.
Smart Images

Figure FDA0004879261040000026 
Figure FDA00048792610400000210 
Figure FDA0004879261040000022
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of horizontal federated learning, and in particular to a multi-party data feature completion method for horizontal federated learning. Background Art
[0002] Generative adversarial network is a deep learning framework that completes model training through a mutual adversarial process. A typical GAN consists of two parts, a generative model and a discriminative model. The generative model is responsible for generating data that is consistent with the distribution of real data. The goal is to deceive the discriminative model and make it think that the generated data is real; the discriminative model attempts to distinguish the generated data from the real data. The generative model and the discriminative model confront and promote each other. Ultimately, the generative model can generate data that is indistinguishable from the real data, and the discriminative model cannot distinguish whether it is generated data or real data. In this way, the generative model can be used to generate very realistic sample data.
[0003] In the era of big data, a large amount of data has provided impetus for the development of science and technology, but the corresponding data privacy issues have also attracted people's attention. The essence of federated learning is a distributed machine learning technology or machine learning framework based on data privacy protection. Its goal is to achieve joint modeling on the premise of lossless model while ensuring data privacy security and legal compliance, improve the effect of AI models, and empower businesses.
[0004] However, in the actual application of horizontal federated learning, the problems solved by each participant are similar, that is, the business models are similar, but the data characteristics owned by each participant may be different, which makes horizontal federated learning difficult to be widely used. Take the training of perceived product quality models on various online shopping platforms as an example. Although the business models of each platform are very similar, different platforms may describe or characterize product characteristics in different ways or standards. For example, one platform may use "product experience points" as a feature, while another platform may use "description match points." These features are similar in nature, but they do not have a corresponding relationship or convertibility. Therefore, how to effectively complement and integrate the data characteristics of different participants while protecting data privacy is an urgent problem that needs to be solved in the widespread application of horizontal federated learning. Summary of the invention
[0005] In order to solve the above problems, the present invention provides a multi-party data feature completion method for horizontal federated learning, which aims to achieve data feature completion between different participants through distributed generative adversarial network technology under the premise of protecting data privacy.
[0006] Specifically, the distributed GAN of the present invention is composed of a generative model and multiple discriminant models. Among them, the coordinator corresponds to the generative model, which can generate sample data containing the data features of all participants and divide the sample data according to the data features of each participant. Each participant corresponds to a discriminant model, and each discriminant model determines whether the assigned sample data is true. By continuously training and optimizing the distributed GAN network, the generative model can generate very realistic sample data containing the data features of all participants. Finally, a feature completion model is trained based on the sample data set to effectively solve the problem that it is difficult to complete the features of multiple parties.
[0007] S1. Each participant determines relevant features based on their own business model to form a feature set U1, U2, ..., U n , where n is the number of parties.
[0008] S2. The coordinator aggregates the feature sets of all participants to form a total feature set U g . And a feature correspondence table is established based on the total feature set and the feature sets of each participant for subsequent feature completion and sample data division.
[0009] Specifically, step S2 is as follows:
[0010] S201. The coordinator classifies the feature sets uploaded by each participant and identifies the same features, similar features, and different features.
[0011] S202: assign a unified name to similar features and establish conversion rules such as determining a unified unit or format.
[0012] S203, the coordinator forms a total feature set U with different features, same features and converted similar features g And feature correspondence table.
[0013] S3. The coordinator generates sample data G by generating model G g , and according to the feature correspondence table, the sample data G g Divide into multiple directional sample data Then send it to each participant separately.
[0014] S4. Each participant uses local real data and the directional sample data sent by the coordinator to train their own discriminant model D 1 ,...,D n .
[0015] S5. Each participant calculates the loss function of the generative model and its discriminant model based on the output of its discriminant model, which is used to optimize the generative model and its discriminant model. The generative model and each discriminant model are optimized alternately until the network training is completed.
[0016] Specifically, step S5 is as follows:
[0017] S501 , input directional sample data and real data to each discriminant model, and each discriminant model determines whether it is real data or sample data.
[0018] S502. Further, a binary cross entropy loss function is used to optimize the loss function of the generative adversarial network in the training model. The final loss function is:
[0019]
[0020] S503. The loss function of the discriminant model of each participant is:
[0021]
[0022] S504, using the gradient descent method to first train each discriminant model K times, so that the discrimination accuracy of each discriminant model can meet the standard requirements, and then train the generated model.
[0023] S505. The loss function of the generation model of each participant is:
[0024] L G
[0025] S506: The parameters of the generation model are updated based on the judgment results of each discriminant model on the sample data, that is, the total loss function of the generation model is the loss function of the generation model uploaded by each participant. The total loss function is:
[0026] L 生
[0027] S507, continuously iterate and optimize each discriminant model and generative model until the loss function of each discriminant model and generative model converges or reaches the upper limit of the number of iterations or exceeds the maximum iteration time. According to steps S3, S4, and S5, the generative model can generate very realistic sample data that contains the data features of all participants.
[0028] S6. Use the sample data set generated by the generative model to train the feature completion model. Each participant can use the model to complete the feature set of local data to the total feature set, thereby completing the data features of each participant.
[0029] S7. Each participant uses the data processed by the feature completion model to train the horizontal federated learning model.
[0030] Beneficial effects of the present invention: The present invention provides a multi-party data feature completion method for horizontal federated learning. It is particularly suitable for federated learning scenarios where the business models of multiple participants are similar but the data features are different. The data features of each party are completed by training a distributed generative adversarial network and a feature completion model. And through the mechanism of local training and uploading loss functions, the data privacy of each participant is effectively protected. The method has high security and strong scalability, and is still applicable when the feature sets of each participant are quite different.
[0031] Based on the following detailed description of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is a flow chart of a multi-party data feature completion method for horizontal federated learning in this application.
[0033] Figure 2 This is an example diagram of a generative model of an example of this application. The generative model can be regarded as a multi-task model, and can be regarded as three generative models corresponding to three discriminative models respectively.
[0034] Figure 3 This is an example diagram of the correspondence table between the total feature set of an example of this application and the feature set of each participant. In the feature correspondence table, the same and similar features shared by each participant are marked as 1, and the corresponding conversion rules are recorded next to the similar features, and the unique different features of each participant are marked as 0.
[0035] Figure 4 This is an example diagram of a distributed generative adversarial network structure for this application.
[0036] Figure 5 Example diagram of the horizontal federated learning model structure for feature completion of an example of this application DETAILED DESCRIPTION
[0037] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific examples.
[0038] S1. Each participant determines relevant features based on their own business model to form feature sets U1, U2, ..., U n , where n is the number of parties.
[0039] Specifically, step S1 is as follows:
[0040] S101. Assume that there are three participants A, B, C and a coordinator.
[0041] S102. Assume that the real data sets of participants A, B, and C are m1, m2, and m3, and the corresponding feature sets are U1 = {x1, x2, x3}, U2 = {x1, x2, x4}, and U3 = {x1, x2, x5}.
[0042] S2. The coordinator aggregates the feature sets of all participants to form a total feature set U g , and establish a feature correspondence table based on the total feature set and the feature sets of each participant for subsequent feature completion and sample data division.
[0043] Specifically, step S2 is as follows:
[0044] S201. The coordinator classifies the feature sets uploaded by each participant and identifies the same features, similar features and different features. The same features refer to features with the same substantive content, naming, data type and format, similar features refer to features with the same substantive content but different naming, data type and format, and different features refer to features with inconsistent substantive content.
[0045] S202: assign a unified name to similar features and establish conversion rules such as determining a unified unit or format.
[0046] S203, the coordinator summarizes different features, the same features and unified similar features to form a total feature set U g And feature correspondence table. In the feature correspondence table, the same and similar features shared by all participants are marked as 1, and the corresponding conversion rules are recorded next to the similar features, and the different features unique to each participant are marked as 0.
[0047] S3. The coordinator generates sample data G by generating model G g , and according to the feature correspondence table, the sample data G g Divide into multiple directional sample data Then send it to each participant separately.
[0048] Specifically, step S3 is as follows:
[0049] S301. The input of the generative model G is Gaussian white noise z, that is, a 1*100 random vector.
[0050] S302, the generative model G is a fully connected network with two hidden layers, the number of neurons is 128 and 256 respectively, and the ReLU activation function is used. The output layer has 5 units, corresponding to x1, x2, x3, x4, x5, and uses a linear activation function to allow output values in any range. The ReLU function is:
[0051] f(x)=max(0,x)
[0052] S303: Model G generates sample data The comparison feature correspondence table is divided into three subsets Sent to participants A, B, and C respectively.
[0053] S4. Each participant uses local real data and the directional sample data sent by the coordinator to train their own discriminant model D 1 ,D 2 ,...,D n .
[0054] Specifically, step S4 is as follows:
[0055] Taking participant A as an example, the training process of the discriminant model is:
[0056] S401. The input of the discriminant model is the directional sample data sent by the coordinator or the local data of participant A.
[0057] S402, the discriminant model is a fully connected network, corresponding to the data of three variables, the input layer has three units. Two hidden layers, the number of neurons is 256 and 128 units respectively, using the leakyrelu activation function. The output layer is one unit, using the sigmoid activation function to output a value representing the probability of the true data. The leakyrelu function is:
[0058] f(x)=max(ax,x)
[0059] In the formula, a is a very small constant, such as 0.01.
[0060] The sigmoid function is:
[0061]
[0062] S5. Each participant calculates the loss function of the generative model and its discriminant model based on the output of its discriminant model, which is used to optimize the generative model and its discriminant model. The generative model and each discriminant model are optimized alternately until the network training is completed.
[0063] Specifically, step S5 is as follows:
[0064] S501 , input directional sample data and real data to each discriminant model, and each discriminant model determines whether it is real data or sample data.
[0065] S502. Further, a binary cross entropy loss function is used to optimize the loss function of the generative adversarial network in the training model. The final loss function is:
[0066]
[0067] Among them, the discriminant model D i Try to minimize the loss, and the generative model G tries to maximize the loss. i represents the i-th participant, x represents the real data, z represents the noise input to the generative model G, G (z) Represents the sample data generated by the generative model G. Denotes the discriminant model D of the i-th participant i The probability of judging whether the real data is real, represents the probability that the discriminant model of the i-th participant judges whether the sample data is true or not, It indicates the probability that the discriminant model believes that x comes from the real data. represents the expectation of x from the probability distribution of the real data, Represents the expectation of the probability distribution from which the data are generated.
[0068] S503. The loss function of the discriminant model of each participant is:
[0069]
[0070] S504, using the gradient descent method to first train each discriminant model K times, so that the discrimination accuracy of each discriminant model can meet the standard requirements, and then train the generated model.
[0071] S505. The loss function of the generation model of each participant is:
[0072]
[0073] S506: The parameters of the generation model are updated based on the judgment results of each discriminant model on the generated sample data, that is, the total loss function of the generation model is the loss function of the generation model uploaded by each participant. The total loss function L 生 for:
[0074]
[0075]
[0076] in, is the discriminant model D 1 The loss function of the generative model at round t is The gradient with respect to the parameters θ of the generative model. Denotes the discriminant model D 1The modulus of the gradient of the model loss function generated in real time in the tth round. The weights are set according to the gradient state with scale invariance and translation invariance, and the more difficult tasks (the more difficult discriminative model tasks) are given smaller weights, and the less difficult tasks (the less difficult discriminative model tasks) are given larger weights, which helps to balance the contribution of the loss functions uploaded by different discriminative models in model training. Represents normalized weights so that the sum of all weights is 1.
[0077] S507, continuously iterate and optimize each discriminant model and generative model until the loss function of each discriminant model and generative model converges or reaches the upper limit of the number of iterations or exceeds the maximum iteration time. According to steps S3, S4, and S5, the generative model can generate very realistic sample data that contains the data features of all participants.
[0078] S6. Use the sample data set generated by the generative model to train the feature completion model. Each participant can use the model to complete the feature set of local data to the total feature set, thereby completing the data features of each participant.
[0079] Specifically, step S6 is as follows:
[0080] S601. Generate a sample data set using a generative model. The sample data has five variables x1, x2, x3, x4, and x5. Assume that all variables are numerical, and normalize or standardize the variables so that they range between 0 and 1 or have a mean of 0 and a unit variance.
[0081] S602, divide the sample data set into 70% training set, 15% test set, and 15% validation set.
[0082] S603. Randomly select 30% of the data in the training set, and set the values of x3, x4, and x5 to Nall respectively to simulate the missing state of these variables.
[0083] S604, the feature completion model is a fully connected neural network, including two hidden layers, each with 64 neurons, and ReLU as the activation function. The output layer is set with three neurons, which output the predicted values of x3, x4, and x5 respectively.
[0084] S605. Input features are all other non-missing variables and their own values (if non-missing). For example, if x3 is missing, the input is the values of x1, x2, x4, x5 variables, and the input of x3 is set to 0. For each possibly missing variable x3, x4, x5, use a binary indicator (0 or 1) to indicate whether it is missing. Use the true x3, x4, x5 values as labels for supervised learning.
[0085] S606: Use the training set data to train the model, monitor the loss and accuracy on the validation set, and apply an early stopping strategy (i.e., terminate the training when the validation performance of the model no longer improves) to avoid overfitting.
[0086] S607. Use the test set to evaluate model performance.
[0087] S608. The trained feature completion model can complete the feature set of each participant's local data to the total feature set.
[0088] Taking participant A as an example, the feature set U1={x1,x2,x3} of participant A’s data set is completed to U1={x1,x2,x3,x4,x5} through the feature completion model.
[0089] S7. Each participant uses the data processed by the feature completion model to train the horizontal federated learning model.
[0090] The above are only preferred embodiments of the present invention, and are not intended to limit the implementation and protection scope of the present invention. Those skilled in the art should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the description and illustrations of the present invention should be included in the scope of the present invention.
Claims
1. A multi-party data feature completion method for horizontal federated learning, characterized by The method comprises: Each participant determines relevant features based on their respective business models to form a feature set; The coordinator aggregates the feature sets of all participants to form a total feature set. A feature correspondence table is established based on the total feature set and the feature sets of each participant for subsequent feature completion and sample data division; The coordinator generates sample data through the generation model, divides the sample data into multiple directional sample data according to the feature correspondence table, and then sends them to each participant respectively; Each participant trains their own discriminant model using local real data and directional sample data sent by the coordinator; Each participant calculates the loss function of the generative model and its discriminant model based on the output of its discriminant model, which is used to optimize the generative model and its discriminant model. The generative model and each discriminant model are optimized alternately until the network training is completed; Use the sample data set generated by the generative model to train the feature completion model; Each participant uses the data processed by the feature completion model to train the horizontal federated learning model.
2. The method of forming a total feature set and constructing a feature correspondence table according to claim 1, characterized in that: The steps of forming a total feature set and constructing a feature correspondence table specifically include: The coordinator classifies the feature sets uploaded by each participant and identifies the same features, similar features, and different features. The same features refer to features with the same substantive content, naming, data type, and format, similar features refer to features with the same substantive content but different naming, data type, and format, and different features refer to features with inconsistent substantive content. Assign uniform names to similar features and establish conversion rules such as determining uniform units or formats; The coordinator summarizes different features, identical features, and unified similar features to form a total feature set and a feature correspondence table. In the feature correspondence table, identical and similar features shared by all participants are marked as 1, and the corresponding conversion rules are recorded next to the similar features. Different features unique to each participant are marked as 0.
3. The optimization generation model and each discriminant model according to claim 1, characterized in that The loss functions of the generative model and each discriminant model are calculated based on the output of each discriminant model to optimize the generative model and each discriminant model. The generative model and each discriminant model are optimized alternately until the network training is completed, including: Input directional sample data and real data to each discriminant model, and each discriminant model determines whether it is real data or sample data; Furthermore, the binary cross entropy loss function is used to optimize the loss function of the generative adversarial network in the training model, and the final loss function is: In the formula, the discriminant model D i Try to minimize the loss, and the generative model G tries to maximize the loss. i represents the i-th participant, x represents the real data, z represents the noise input to the generative model G, G (z) Represents the sample data generated by the generative model G. Denotes the discriminant model D of the i-th participant i The probability of judging whether the real data is real, represents the probability that the discriminant model of the i-th participant judges whether the sample data is true or not, It indicates the probability that the discriminant model believes that x comes from the real data. represents the expectation of x from the probability distribution of the real data, Represents the expectation of the probability distribution of the generated sample data; The loss function of the discriminant model of each participant is: Use the gradient descent method to first train each discriminant model K times, so that the discrimination accuracy of each discriminant model can meet the standard requirements, and then train the generated model; The loss function of the generative model of each participant is: The parameter update of the generative model is based on the judgment results of each discriminant model on the generated sample data, that is, the total loss function of the generative model is the loss function of the generative model uploaded by each participant. The total loss function L 生 for: Where n is the number of participants, is the discriminant model D 1 The loss function of the generative model at round t is The gradient with respect to the parameters θ of the generative model. Denotes the discriminant model D 1 The modulus of the gradient of the model loss function generated in real time in the tth round. The weights are set according to the gradient state with scale invariance and translation invariance, and the more difficult tasks (the more difficult discriminative model tasks) are given smaller weights, and the less difficult tasks (the less difficult discriminative model tasks) are given larger weights, which helps to balance the contribution of the loss functions uploaded by different discriminative models in model training. represents the normalized weight so that the sum of all weights is 1; Continuously iterate and optimize each discriminant model and generative model until the loss function of each discriminant model and generative model converges or reaches the upper limit of the number of iterations or exceeds the maximum iteration time.
