Federated learning method, device, equipment and readable storage medium

By allowing the proactive party and participants to calculate the gain of split information locally in federated learning, and through multi-party security calculation comparison, the problem of high communication costs during federated learning training in the existing technology is solved, and the effect of reducing communication costs and protecting privacy is achieved.

CN114696989BActive Publication Date: 2025-04-15JINGDONG TECH HLDG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210310843.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-04-15
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

During the training process of existing federated learning technology, the communication cost of passing homomorphic ciphertext between the proactive party and the participant is too high, resulting in a significant increase in model training costs.

Method used

The active party shares the first component of the sample tag with the participant, so that the active party and the participant can calculate the information gain of all splits locally, and then obtain the optimal split and split information through multi-party security calculation comparison, reducing communication between the active party and the participant.

Benefits of technology

It reduces the communication costs between the proactive party and the participants during the federal learning training process, while protecting the privacy of the proactive party sample tags.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114696989B_ABST
    Figure CN114696989B_ABST
Patent Text Reader

Abstract

The present application provides a method, apparatus, device and readable storage medium for federated learning, wherein the method includes: sharing the first component of the sample encryption label with the participating parties, calculating the information gain component of each split of the active party according to the second component, determining the optimal split from the split according to the information gain component of each split of the participating parties and the information gain component of each split of the active party, and constructing the split information of the optimal split with the participating parties according to the optimal split. In this technical solution, the active party shares the components in the sample encryption label with the participating parties, and the active party and the participating parties respectively calculate the information gain of all splits locally, compare locally to obtain the optimal split, and then the active party communicates with the participating parties to construct the plain text of the split information, which can reduce the communication cost in the training process of federated learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of federated learning, and in particular to a federated learning method, apparatus, device and readable storage medium. Background Art

[0002] Vertical federated learning is a category of federated learning. Different data holders have different feature dimensions of the same sample, but the sample label is only held by one party, and the other parties only have partial data features. Among them, the party holding the sample label is called the active party, and the party that only has partial data features is called the participating party. The active party usually hopes to improve the effect of the federated learning model by cooperating with the participating parties and utilizing the data features of the participating parties.

[0003] In the prior art, the training of federated learning models mainly involves building a decision tree and deciding whether and how to split each node in the decision tree. In the process of building the decision tree, the active party and the participating parties usually need to communicate to transmit homomorphic ciphertext to protect the active party's sample labels and the participating party's feature information to prevent leakage.

[0004] However, the number of homomorphic ciphertexts transmitted in each round of training with existing technologies is very large, which will occupy a large communication cost and cause a significant increase in the training cost of the model. Summary of the invention

[0005] The present application provides a federated learning method, apparatus, device and readable storage medium, which are used to solve the problem of high communication costs in transmitting homomorphic ciphertext between the active party and the participating parties during the training process of existing federated learning.

[0006] In a first aspect, an embodiment of the present application provides a federated learning method, which is applied to an active party in federated learning, wherein the active party includes first sample data and a sample label, and the method includes:

[0007] Sharing the first component of the sample encrypted label with the participating party, the sample encrypted label is obtained by the active party encrypting the sample label, the sample encrypted label includes a first component and a second component, the first component is used by the participating party to calculate the information gain component of each split of the split node in the model to be constructed;

[0008] According to the second component, calculating the information gain component of each split of the active party;

[0009] According to the information gain component of each split of the participating party and the information gain component of each split of the active party, determining an optimal split from the splits, wherein the information gain component value of the optimal split is the largest;

[0010] According to the optimal split, the split information of the optimal split is jointly constructed with the participating parties, and the split information of the optimal split is used to construct the left node and the right node of the split node in the model to be constructed.

[0011] In a possible design of the first aspect,

[0012] The step of sharing the first component of the sample encrypted tag with a participant includes:

[0013] Generate public and private keys together with the participating parties, each participating party and the active party holding at least one private key;

[0014] The first component of the sample encrypted tag is shared with the participant according to the public key and the private key.

[0015] In another possible design of the first aspect, sharing the first component of the sample encryption tag with the participant according to the public key and the private key includes:

[0016] Obtaining a first encryption result sent by each participant, where the first encryption result is obtained by the participant using the public key to encrypt a random secret message held by the participant;

[0017] Using the public key to encrypt the random secret message held by the active party, to obtain a second encryption result;

[0018] Encrypt the sample label according to the first encryption result and the second encryption result to obtain a ciphertext value;

[0019] Decrypting the ciphertext value together with the participant to obtain a decryption result;

[0020] According to the private key held by each participant, a first component is obtained from the decryption result and shared with the participants.

[0021] In yet another possible design of the first aspect, before calculating, according to the second component, the information gain component of each split of the active party, the method further includes:

[0022] A second component is obtained from the decryption result according to the private key held by the active party.

[0023] In yet another possible design of the first aspect, calculating, according to the second component, the information gain component of each split of the active party includes:

[0024] Get the sample vector of the left node and the sample vector of the right node of each split;

[0025] The information gain component of each split of the active party is calculated according to the second component, the sample component of the left node and the sample vector of the right node.

[0026] In another possible design of the first aspect, calculating the information gain component of each split of the active party according to the second component, the sample component of the left node, and the sample vector of the right node includes:

[0027] Calculate a label vector of the left node and a label vector of the right node according to the second component, a sample vector of the left node and a sample vector of the right node;

[0028] According to the label vector of the left node and the label vector of the right node, obtaining the label ratio of the left node and the label ratio of the right node;

[0029] According to the sample vector of the left node and the sample vector of the right node, obtaining the sample ratio of the left node and the sample ratio of the right node;

[0030] The information gain component of each split of the active party is calculated according to the label ratio of the left node, the sample ratio of the left node, the label ratio of the right node and the sample ratio of the right node.

[0031] In another possible design of the first aspect, determining the optimal split from the splits according to the information gain component of each split of the participating party and the information gain component of each split of the active party includes:

[0032] Obtaining an optimal split component of the participant, where the optimal split component is calculated locally by the participant according to an information gain component of each split;

[0033] According to the information gain component of each split of the active party, obtaining the optimal split component of the active party;

[0034] An optimal split is determined from the splits according to the optimal split components of the participating parties and the optimal split components of the active party.

[0035] In yet another possible design of the first aspect, determining the optimal split from the splits includes:

[0036] Based on multi-party secure computation, the optimal splitting component of the active party is compared with the optimal splitting component of the participating party through communication with the participating party to determine the optimal splitting.

[0037] In another possible design of the first aspect, constructing with the participant the splitting information of the optimal splitting according to the optimal splitting includes:

[0038] Obtaining an index corresponding to the optimal split, the index at least including a feature component, a split component, and an information gain component;

[0039] According to the indicator corresponding to the optimal split, the split information of the optimal split is constructed with the participating party.

[0040] In yet another possible design of the first aspect, after constructing with the participant the splitting information of obtaining the optimal split according to the optimal split, the method further includes:

[0041] Determine whether the left node / right node meets a preset splitting condition;

[0042] If the left node / right node meets the preset splitting condition, the left node / right node is used as the leaf node of the model to be constructed;

[0043] Obtaining the node number of the leaf node and the label vector of the leaf node sent by the participant;

[0044] According to the label vector of the leaf node, the sample label of the leaf node is obtained.

[0045] In a second aspect, an embodiment of the present application provides a federated learning method, which is applied to a participant in federated learning, and the method includes:

[0046] Obtain the first component of the active party's encrypted share, the left node sample vector and the right node sample vector of each split of the split node in the model to be constructed;

[0047] Calculate the information gain component of each split of the participant according to the first component, the sample vector of the left node and the sample vector of the right node;

[0048] According to the information gain component of each split of the active party and the information gain component of each split of the participating party, determining an optimal split from the splits, wherein the information gain component value of the optimal split is the largest;

[0049] According to the optimal split, the split information of the optimal split is constructed together with the active party.

[0050] In a possible design of the second aspect, obtaining the first component of the active party's encrypted share includes:

[0051] Generate a public key and a private key together with the active party, each participating party and the active party holding at least one private key;

[0052] Encrypting the held random secret message according to the public key to obtain a first encryption result;

[0053] Sending the first encryption result to the active party, where the first encryption result is used to be combined with the sample label encryption result of the active party to obtain a ciphertext value;

[0054] Decrypting the ciphertext value together with the active party to obtain a decryption result;

[0055] A first component is obtained from the decryption result according to the held private key.

[0056] In another possible design of the second aspect,

[0057] The calculating, according to the first component, the sample vector of the left node and the sample vector of the right node, the information gain component of each split of the participant comprises:

[0058] Calculate a label vector of the left node and a label vector of the right node according to the first component, a sample vector of the left node and a sample vector of the right node;

[0059] According to the label vector of the left node and the label vector of the right node, obtaining the label ratio of the left node and the label ratio of the right node;

[0060] According to the sample vector of the left node and the sample vector of the right node, obtaining the sample ratio of the left node and the sample ratio of the right node;

[0061] The information gain component of each split of the participant is calculated based on the label ratio of the left node, the sample ratio of the left node, the label ratio of the right node and the sample ratio of the right node.

[0062] In a third aspect, an embodiment of the present application provides a federated learning device, including:

[0063] A label sharing module, used to share the first component of the sample encrypted label with the participating party, the sample encrypted label is obtained by the active party encrypting the sample label, the sample encrypted label includes a first component and a second component, the first component is used by the participating party to calculate the information gain component of each split of the split node in the model to be constructed;

[0064] A component calculation module, used for calculating the information gain component of each split of the active party according to the second component;

[0065] A first split determination module, configured to determine an optimal split from the splits according to the information gain component of each split of the participating party and the information gain component of each split of the active party, wherein the information gain component value of the optimal split is the largest;

[0066] The first information construction module is used to construct, together with the participating parties, the splitting information of the optimal splitting according to the optimal splitting, and the splitting information of the optimal splitting is used to construct the left node and the right node of the splitting node in the model to be constructed.

[0067] In a fourth aspect, an embodiment of the present application provides a federated learning device, including:

[0068] A component acquisition module, used to acquire the first component of the active party's encrypted sharing, the left node sample vector and the right node sample vector of each split of the split node in the model to be constructed;

[0069] A gain calculation module, used for calculating the information gain component of each split of the participant based on the first component, the sample vector of the left node and the sample vector of the right node;

[0070] A second split determination module is used to determine an optimal split from the splits according to the information gain component of each split of the active party and the information gain component of each split of the participating party, wherein the information gain component value of the optimal split is the largest;

[0071] The second information construction module is used to construct the splitting information of the optimal splitting together with the active party according to the optimal splitting.

[0072] In a fifth aspect, an embodiment of the present application provides a computer device, comprising: a processor, and a memory communicatively connected to the processor;

[0073] The memory stores computer-executable instructions;

[0074] The processor executes the computer-executable instructions stored in the memory to implement the above method.

[0075] In a sixth aspect, an embodiment of the present application provides a computer device, comprising: a processor, and a memory communicatively connected to the processor;

[0076] The memory stores computer-executable instructions;

[0077] The processor executes the computer-executable instructions stored in the memory to implement the above method.

[0078] In a seventh aspect, an embodiment of the present application provides a readable storage medium, in which computer instructions are stored. When the computer instructions are executed by a processor, they are used to implement the method as described above.

[0079] In an eighth aspect, an embodiment of the present application provides a program product, including computer instructions, which implement the method described above when executed by a processor.

[0080] The federated learning method, apparatus, device and readable storage medium provided in the embodiments of the present application share the label component in the sample label with the participating parties through the active party, and the active party and the participating parties directly calculate the information gain of all splits locally. The active party then communicates with the participating parties to compare and obtain the optimal split and split information, thereby reducing the communication cost between the active party and the participating parties during the training process of federated learning. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the description, are used to explain the principles of the present application;

[0082] Figure 1 A schematic diagram of a gradient boosting tree model framework for vertical federated learning provided in an embodiment of the present application;

[0083] Figure 2 A flowchart of the first embodiment of the federated learning method provided in the embodiment of the present application;

[0084] Figure 3 A flowchart of the second embodiment of the federated learning method provided in the embodiment of the present application;

[0085] Figure 4 An interactive schematic diagram of the federated learning method provided in the embodiment of the present application;

[0086] Figure 5 A schematic diagram of the structure of a first embodiment of a federated learning device provided in an embodiment of the present application;

[0087] Figure 6 A schematic diagram of the structure of a second embodiment of a federated learning device provided in an embodiment of the present application;

[0088] Figure 7 A schematic diagram of the structure of a computer device embodiment 1 provided in an embodiment of the present application;

[0089] Figure 8 A schematic diagram of the structure of a second embodiment of a computer device provided in an embodiment of the present application.

[0090] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0091] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0092] First, the terms involved in this application are explained:

[0093] Federated learning: refers to a machine learning framework that can effectively help multiple institutions use data and conduct machine learning modeling to improve the effectiveness of the model while meeting the requirements of user privacy protection, data security and government regulations. Federated learning enables multiple participants to achieve the purpose of joint modeling without sharing data, only sharing intermediate results, and unable to reverse the data. Among them, the realization of being unable to reverse the data is generally achieved through certain security technologies to ensure that each party cannot obtain the data information of other parties.

[0094] According to the different characteristics of the data held by different participants in federated learning, it can be classified into horizontal federated learning, vertical federated learning, and federated transfer learning. Horizontal federated learning is the segmentation of samples. Due to its good characteristics, a more general federated learning solution can be designed. Vertical federated learning is more difficult and has been widely used in the industry. Its characteristic is that different data holders have different feature dimensions of the same sample (such as a customer), which is caused by the different businesses of different companies.

[0095] Figure 1 Schematic diagram of the gradient boosting tree model framework for vertical federated learning provided in the embodiment of the present application. Vertical federated learning has been more widely used and developed in risk control scenarios. Its characteristics are that the label is only held by one of the participants (hereinafter referred to as the active party), while the other parties own some features of the data (hereinafter referred to as the participants). The active party hopes to improve the effect of the model by cooperating with the participating parties to achieve the purpose of reducing risks. In this process, both the active party and the participating parties need to ensure the security of their own data. Figure 1 As shown in the figure, taking A as a bank (as the active party) and B and C as supermarkets (as participating parties) as an example, A, B and C are all in the same region, and the users they reach are all residents of the region (ie samples), but the businesses they are involved in are different (ie different characteristics).

[0096] In risk control scenarios, tree models are widely used due to their good interpretability and strong learning ability. The recursive federated learning model represented by Secureboost is based on the principle of constructing M tree models through M-step boosting. , The construction of these M tree models uses a step-by-step method. At the mth step, The m-1 tree models have been established. Secureboost specifically includes two processes, see Figure 1 ,First, the encrypted samples are aligned, and then the encrypted model training is performed.

[0097] Among them, in the process of training the encrypted model, the key to establishing the gradient boosting tree model is that (1) the construction of the mth tree is based on the m-1th label residual as the target for learning. (2) In the construction of each tree, it is decided how to split each node and whether to split it. This process is achieved by multi-party cooperation and information exchange to obtain the score of each feature after each threshold split, and the result with the maximum score is taken for splitting.

[0098] In the prior art, when performing encrypted model training, the active party calculates the predicted value after each m-1 iterations. The first derivative (initially 0) and the second derivative ,right and After homomorphic encryption, it is transmitted to each participant. The participant uses the public key to calculate the sum of the first-order derivative and the second-order derivative of each feature and each split and sends it to the active party for decryption. The active party directly calculates the plaintext of the gradient aggregation value of each feature and each split, and then calculates the score of each feature that has not been split based on all the first-order derivatives and second-order derivative aggregation values. If the maximum score is less than the threshold, it will not be split. Otherwise, the current node will be split according to the corresponding attributes and thresholds to obtain the corresponding two leaf nodes and their respective sample id sets. and For each leaf node of the mth tree, the above steps are executed repeatedly until all leaf nodes cannot be split or the depth of the tree reaches the maximum depth set. The active party calculates the optimal weight of each leaf node. , then the construction of the mth tree is completed.

[0099] However, in the existing technology, during the modeling process, in each node construction process of each tree, the active party needs to calculate the first-order and second-order gradients of the node samples and transmit the first-order and second-order gradients to all participants. The splitting of all the participants' features needs to send the calculated gradient aggregation value back to the active party for decryption to obtain the optimal split. In this process, the active party and the participants need to communicate through a large amount of encrypted text to find the feature information of the optimal split, which will cause the communication cost of the federated model to be very high.

[0100] In response to the above problems, the federated learning method, apparatus, device and readable storage medium provided in the embodiments of the present application use multi-party secure computing to share part of the active party's sample labels with the participating parties before the training starts, so that the active party and the participating parties can locally calculate the information gain of all splits. After that, the active party and the participating parties compare and obtain the optimal split through multi-party secure computing, and cooperate to jointly construct the split information of the optimal split. While protecting the security of the active party's sample labels, the communication cost between the active party and the participating parties can be reduced.

[0101] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0102] Figure 2 The flowchart of the first embodiment of the federated learning method provided in the present application is shown in FIG. The method can be applied to a participant with labeled data. For the sake of distinction, the participant with labeled data will be referred to as the active party in the following. Figure 2 As shown, the federated learning method may specifically include the following steps:

[0103] S201. Share the first component of the sample encryption label with the participants.

[0104] Among them, the sample encryption label is obtained by the active party encrypting the sample label, and the sample encryption label includes a first component and a second component. The first component is used by the participating party to calculate the information gain component of each split of the split node in the model to be constructed, wherein the sample label is the sample label of the split node.

[0105] In this embodiment, the number of participants may be one or more than two, and the sample encryption tag may include several different first components, and each participant may obtain a first component shared by the active party.

[0106] For example, the number of participants is i, where i is a positive integer not less than 1. The sample encryption label can be obtained by the sample label vector It indicates that, = The second component can be , the first component can be .

[0107] Exemplarily, the secret security sharing of multi-party secure computing can be performed on all participants, so that the i-th participant can obtain a first component .

[0108] In this embodiment, the model to be constructed may be a decision tree, which includes at least one root node and leaf nodes corresponding to the root node. A split node refers to a node in the decision tree that has not reached the stop splitting condition and can continue to split into a left node and a right node. For example, refer to Figure 1 , tree model The depth is 4, which includes a root node. The root node splits into a left node and a right node. The right node can be split into a left leaf node and a right leaf node. The root node can be regarded as a split node.

[0109] In this embodiment, after the active party shares the first component with the participating parties, for each split node, the sample vectors of the left and right nodes corresponding to all splits can be broadcast. represents the sample vector of the left node, Taking the sample vector representing the right node as an example, the participants can , And the first component, the information gain of each split is calculated locally without communicating with the active party, reducing the communication cost.

[0110] S202: Calculate the information gain component of each split of the active party according to the second component.

[0111] In this embodiment, after the active party performs the secret security sharing of the multi-party secure computation on all the participants, the active party will be allocated a second component from the sample label vector The participants can obtain the first share of , the information gain of each split is calculated locally, and the active party can also calculate the information gain of each split based on the second component , the information gain of each split is calculated locally.

[0112] For example, represents the sample vector of the left node, For example, the active party can use , And the second component is calculated locally to obtain the information gain of each split.

[0113] Among them, the sample vector of the left node and the sample vector of the right node need to be divided according to the value. For example, taking the value of 0.5 as an example, the sample vector divided to the left node is less than 0.5, and the sample vector divided to the right node is greater than 0.5.

[0114] In this embodiment, the split information includes features, feature values, information indicating whether to split to the left or right, and information gain components. The information gain component indicates node information, and specifically can be a score indicating whether the split node is split according to the split information to obtain a left node and a right node, which indicates whether the label result can be better after the left node and the right node are divided according to the split information.

[0115] Exemplarily, the information gain component of each split can be calculated by the following formula:

[0116]

[0117] In the above formula, is the information gain component, is the left node sample ratio, is the right node sample ratio, represents the amount of information divided into the left node, represents the amount of information divided into the right node, Indicates the amount of information when there is no division between left and right nodes.

[0118] S203: Determine the optimal split from the splits according to the information gain component of each split of the participating party and the information gain component of each split of the active party.

[0119] Among them, the information gain component value of the optimal split is the largest.

[0120] For example, in this embodiment, all active parties and participants can obtain the index corresponding to the optimal split through the maximum value security calculation and local security comparison. ,in, Characterized by For division, is the information gain component.

[0121] For example, for the active party and the participating party, To traverse, Set logo vector , is the ith participant, Characterized by For splitting, initialize four shared components , and assign , using the secure comparison algorithm, compare the size of all information gain components:

[0122] set up ,Compare and The size of the information gain of the optimal split is updated by the following algorithm to obtain the information gain with the largest information gain component value. :

[0123] Sign=1 if

[0124] Sign=0 otherwise

[0125] renew

[0126]

[0127] S204. Based on the optimal split, jointly construct with the participants the split information for obtaining the optimal split.

[0128] The split information of the optimal split is used to construct the left node and the right node of the split node in the model to be constructed.

[0129] In this embodiment, the sample encrypted label is divided into several label components, which are respectively allocated to each participant and the active party. After the participant and the active party calculate locally according to the label components allocated to them, what is actually obtained is a part of the split information of the optimal split. The calculation results of each participant and the active party need to be merged and decrypted together to reconstruct the complete split information.

[0130] Exemplarily, after obtaining the split information, a node can be added under the split node to complete the node splitting once, and then the above steps are repeated until each node in the decision tree meets the split condition and no further splitting is required.

[0131] In the embodiment of the present application, the active party shares the label component in the sample label with the participating parties, and the active party and the participating parties directly calculate the information gain of all splits locally. After comparing the optimal split and the split information locally, the active party communicates with the participating parties to calculate the plain text of the optimal split and the split information, thereby reducing the communication cost between the active party and the participating parties during the training process of federated learning.

[0132] In some embodiments, the above step S201 can be implemented by the following steps:

[0133] Generate public and private keys together with the participating parties;

[0134] According to the public key and the private key, the first component in the sample tag is encrypted and shared with the participants.

[0135] Each participant and active party holds at least one private key. For example, the active party and the participant can share part of the private key information (threshold encryption), and then use the public key to encrypt the sample label. The decryption process requires the active party and the participant to cooperate.

[0136] Exemplarily, the active party cooperates with the participating party to generate a threshold public-private key pair, where the public key can be represented by PK and the private key includes , the active party holds , the participants hold , i is a positive integer not less than 1. After the sample label is encrypted, we can get , the active party and the participating party use their respective private keys to Decryption obtains the corresponding tag component. For example, the active party allocates , the i-th participant is allocated .

[0137] Further, based on the above embodiment, in some embodiments, the above step of "encrypting the first component in the sample tag and sharing it with the participants according to the public key and the private key" can be implemented by the following steps:

[0138] Obtaining a first encryption result sent by each participant;

[0139] Encrypting the random secret message held by the active party using the public key to obtain a second encryption result;

[0140] Encrypting the sample label according to the first encryption result and the second encryption result to obtain a ciphertext value;

[0141] Decrypt the ciphertext value together with the participants to obtain the decryption result;

[0142] According to the private key held by each participant, a first component is obtained from the decryption result and shared with the participants.

[0143] Among them, the first encryption result is obtained by the participating party using the public key to encrypt the random secret message held.

[0144] In this embodiment, the participating party and the active party use the public key to encrypt the random secret message they hold. After encryption, the second encryption result generated by the active party is , the first encryption result generated by the i-th participant is Each participant sends its first encryption result to the active party.

[0145] Exemplarily, the active party calculates the ciphertext value according to the first encryption result sent by each participant as follows:

[0146]

[0147] in, Represents the ciphertext value, Represents the sample label.

[0148] After the active party obtains the ciphertext value, it can cooperate with the participating parties to Decrypted to get e.

[0149] The participants obtain the first portion of the distribution through their private keys:

[0150]

[0151] In the above formula, q can be a preset value.

[0152] In some embodiments, the active party may obtain the second component from the decryption result by using the private key it holds:

[0153]

[0154] The embodiment of the present application realizes encrypted sharing of sample label components by using multi-party secure computing, which enables the active party and the participating parties to locally calculate the information gain component of each split, reducing the communication cost in the federated learning training process. At the same time, encryption can also avoid the leakage of the privacy of the active party's sample labels.

[0155] Based on the above embodiments, in some embodiments, when the active party calculates the information gain component of each split, it can be implemented by the following steps:

[0156] Calculate the label vector of the left node and the label vector of the right node according to the second component, the sample vector of the left node and the sample vector of the right node;

[0157] According to the label vector of the left node and the label vector of the right node, obtain the label ratio of the left node and the label ratio of the right node;

[0158] According to the sample vector of the left node and the sample vector of the right node, obtain the sample ratio of the left node and the sample ratio of the right node;

[0159] The information gain component of each split of the active party is calculated according to the label ratio of the left node, the sample ratio of the left node, the label ratio of the right node, and the sample ratio of the right node.

[0160] Specifically, the active party can obtain the sample vector of each split left node based on the features and classifications. and the sample vector of the right node The label vector of the left node can be Indicates that the label vector of the right node can be expressed as Indicates. For example, when it is a binary classification, Specific examples include and , Specific examples include , .

[0161] in, represents the label vector of the sample label 1 in the left node, represents the label vector of the sample label 2 in the left node, represents the label vector of the sample label 1 in the right node, The label vector representing the sample label 2 in the right node. , , , The specific calculation process is as follows:

[0162] ,

[0163] ,

[0164] In this example, the label ratio of the left node can be expressed as Indicates that the label ratio of the right node can be expressed as Indicates. Exemplarily, the label ratio of the left node and the label ratio of the right node can be calculated by the following formula:

[0165]

[0166]

[0167] In this embodiment, the sample ratio of the left node and the sample ratio of the right node can be calculated by the following formula:

[0168]

[0169]

[0170] In the above formula, represents the sample ratio of the left node, Represents the sample ratio of the right node.

[0171] In this embodiment, the information gain component of each split can be calculated by the above formula:

[0172]

[0173] The embodiment of the present application utilizes the second component allocated to the active party, so that the active party can locally calculate the information gain component of each split, without the need for the active party to perform a large amount of encrypted communication with the participating parties, thereby reducing communication costs.

[0174] Further, based on the above embodiments, in some embodiments, when a participant locally calculates the information gain component of each split, it can be calculated based on the first component, the sample vector of the left node, and the sample vector of the right node.

[0175] Specifically, the participants can obtain the sample vector of each split left node based on the characteristics and classification and the sample vector of the right node The label vector of the left node can be Indicates that the label vector of the right node can be expressed as Indicates. For example, when it is a binary classification, Specific examples include and , Specific examples include , .

[0176] in, represents the label vector of the sample label 1 in the left node, represents the label vector of the sample label 2 in the left node, represents the label vector of the sample label 1 in the right node, The label vector representing the sample label 2 in the right node. , , , The specific calculation process is as follows:

[0177] ,

[0178] ,

[0179] In this example, the label ratio of the left node can be expressed as Indicates that the label ratio of the right node can be expressed as Indicates. Exemplarily, the label ratio of the left node and the label ratio of the right node can be calculated by the following formula:

[0180]

[0181]

[0182] In this embodiment, the sample ratio of the left node and the sample ratio of the right node can be calculated by the following formula:

[0183]

[0184]

[0185] In the above formula, represents the sample ratio of the left node, Represents the sample ratio of the right node.

[0186] In this embodiment, the information gain component of each split can be calculated by the above formula:

[0187]

[0188] In the above formula, is the information gain component, is the left node sample ratio, is the right node sample ratio, represents the amount of information divided into the left node, represents the amount of information divided into the right node, Indicates the amount of information when there is no division between left and right nodes.

[0189] In this embodiment, after the active party and the participating party complete the calculation of the information gain of each split locally, they will compare the optimal split and split information locally, and then communicate, and the active party and the participating party will cooperate to reconstruct the plaintext of the split information of the optimal split.

[0190] By sharing the first component with the participating parties, the embodiment of the present application enables the participating parties to locally calculate the information gain of each split. After that, the active party and the participating parties only need to perform local comparison through multi-party secure calculation to obtain the optimal split. Finally, the active party and the participating parties communicate and cooperate to jointly construct the split information plaintext of the optimal split, which can avoid the use of a large amount of ciphertext communication between the active party and the participating parties and reduce communication costs.

[0191] In some embodiments, the above step S203 can be implemented by the following steps:

[0192] Obtain the optimal split components of the participants;

[0193] According to the information gain component of each split of the active party, the optimal split component of the active party is obtained;

[0194] According to the optimal splitting components of the participating parties and the optimal splitting components of the active party, the optimal splitting is determined from the splitting.

[0195] The optimal split component is calculated locally by the participating party based on the information gain component of each split.

[0196] In this implementation, the active party and the participating party calculate the optimal split component based on the information gain component of each split locally based on the comparison algorithm of multi-party computing, and then merge to obtain the optimal split and the split information of the optimal split. Finally, the active party communicates with the participating party and cooperates to recover the split information plaintext of the optimal split, which is used to construct the left node and the right node of the split node in the model to be constructed.

[0197] In some embodiments, in the above step S203, “determining the optimal split from the splits” can be specifically implemented by the following steps:

[0198] Based on multi-party secure computation, the optimal splitting components of the active party and the optimal splitting components of the participating parties are compared with each other to determine the optimal splitting.

[0199] In this embodiment, the goal of multi-party secure computing is to calculate a target result for a group of computing participants, each of whom owns his or her own data and does not trust other participants or any third party. Under this premise, multi-party secure computing can be used to calculate the target result for each participant's private data.

[0200] For example, take three participants with different wealth as an example. The three participants want to determine which one has the most wealth. At this time, multi-party secure computing can be used to find the participant with the largest wealth value without exposing their respective wealth values ​​to each other.

[0201] The embodiment of the present application uses multi-party secure computing to compare and obtain the optimal split, so that the active party and the participating party can calculate the information gain of the optimal split locally, thereby reducing the communication cost of federated learning.

[0202] In some embodiments, the above step S204 can be implemented by the following steps:

[0203] Obtain the indicator corresponding to the optimal split, and build the split information of the optimal split with the participants based on the indicator corresponding to the optimal split.

[0204] Among them, the index includes at least characteristic component, split component and information gain component. Specifically, the characteristic component refers to the above , the split increment refers to the above , the information gain component refers to the above .

[0205] In this embodiment, for the participants and the active party, i can be traversed, where i is a positive integer not less than 1. Initialize the four shared components , and assign , set up , use the safe comparison algorithm to compare the size of all information gain components, and update the information gain of the optimal split through the following algorithm:

[0206] Compare and :

[0207] Sign=1 if

[0208] Sign=0 otherwise

[0209] renew

[0210]

[0211] Among them, the index corresponding to the optimal split is Afterwards, the participants and the active party can use their respective private keys to and , according to the indicators corresponding to the optimal split, cooperate to construct the split information of the optimal split .

[0212] In some embodiments, the above-mentioned federated learning method may further include the following steps:

[0213] Determine whether the left node / right node meets the preset splitting condition;

[0214] If the left node / right node meets the preset splitting condition, the left node / right node will be used as the leaf node of the model to be constructed;

[0215] Get the node number and label vector of the leaf node sent by the participant;

[0216] According to the label vector of the leaf node, the sample label of the leaf node is obtained.

[0217] In this embodiment, a leaf node means a node that will not be split any more and has reached a preset splitting condition. Exemplarily, the preset splitting condition may be the maximum depth of the decision tree.

[0218] For example, for nodes that do not meet the preset splitting conditions, they can be regarded as split nodes, and the splitting can continue to be performed to obtain the left node and the right node corresponding to the split node, and then it is determined whether the left node and the right node meet the preset splitting conditions. If not, they continue to be split as split nodes until the entire decision tree model is constructed.

[0219] In this embodiment, during the inference process of the decision tree model, the active party has the structure of the tree model, sample IDs and leaf node labels, and the participating parties include the split features and thresholds corresponding to their respective nodes.

[0220] Among them, the active party can initiate a query on the queried sample according to the tree model structure, and the participating parties will split the sample according to the feature information. If it is a leaf node, the node number of the leaf node will be sent to the active party, and the active party will infer the sample label based on the leaf node label.

[0221] Figure 3 The flowchart of the second embodiment of the federated learning method provided in the embodiment of the present application is as follows. The federated learning method can be applied to the participants. The federated learning method can specifically include the following steps:

[0222] S301, obtaining the first component of the active party's encrypted sharing, the left node sample vector and the right node sample vector of each split of the split node in the model to be constructed;

[0223] S302, calculating the information gain component of each split of the participant according to the first component, the sample vector of the left node and the sample vector of the right node;

[0224] S303: Determine the optimal split from the splits according to the information gain component of each split of the active party and the information gain component of each split of the participating party.

[0225] S304: Based on the optimal split, jointly construct split information of the optimal split with the active party.

[0226] Among them, the information gain component value of the optimal split is the largest.

[0227] In this embodiment, the participating party can calculate the information gain component of each split locally based on the first component shared by the active party, and then compare it with the active party using the "maximum calculation" of multi-party secure computing to obtain the optimal split and the index corresponding to the optimal split ( , ), and finally reconstruct the optimal split through multi-party secure computing with the active party ( ).

[0228] In some embodiments, the above step S301 can be implemented by the following steps:

[0229] Generate public and private keys together with the active party;

[0230] Encrypting the held random secret message according to the public key to obtain a first encryption result;

[0231] Sending the first encryption result to the active party;

[0232] Decrypt the ciphertext value together with the active party to obtain the decryption result;

[0233] The first component is obtained from the decryption result according to the held private key.

[0234] Among them, each participating party and the active party holds at least one private key, and the first encryption result is used to combine with the sample label encryption result of the active party to obtain a ciphertext value, wherein the active party will also encrypt the sample label to obtain a sample label encryption result.

[0235] In the embodiment of the present application, the process of securely sharing the secret value between the participating party and the active party can refer to the execution process of the active party mentioned above, which will not be repeated here.

[0236] In some embodiments, the above step S302 can be implemented by the following steps:

[0237] Calculate the label vector of the left node and the label vector of the right node according to the first component, the sample vector of the left node and the sample vector of the right node;

[0238] According to the label vector of the left node and the label vector of the right node, obtain the label ratio of the left node and the label ratio of the right node;

[0239] According to the sample vector of the left node and the sample vector of the right node, obtain the sample ratio of the left node and the sample ratio of the right node;

[0240] The information gain component of each split of the participant is calculated based on the label ratio of the left node, the sample ratio of the left node, the label ratio of the right node, and the sample ratio of the right node.

[0241] Figure 4 The interactive diagram of the federated learning method provided in the embodiment of the present application. Figure 4 As shown, it specifically includes the following steps:

[0242] S401, encrypt the node sample to obtain the label vector [X], perform secure sharing of the secret value of multi-party secure computation on all participants, and allocate the first component to the participants , assign the second label vector to the active party .

[0243] S402: Broadcast the sample vectors of the left node partition and the sample vectors of the right node partition corresponding to all the splits.

[0244] S403, the active party locally calculates the information gain component of each split;

[0245] S404, the participant locally calculates the information gain component of each split;

[0246] S405, the active party and the participating party respectively perform the “maximum value calculation” of the optimal split and the index corresponding to the optimal split based on the multi-party secure calculation locally;

[0247] S406: The active party and the participating party cooperate to reconstruct the optimal split information plaintext.

[0248] S407, adding the node to the split node, and broadcasting to start the next round.

[0249] In the embodiment of the present application, by using multi-party secure computing, the active party and the participating parties share the label component at the beginning of model training. The active party and the participating parties can calculate the information gain of the optimal split locally, reducing the communication cost of federated learning. At the same time, the federated model training is realized by sharing the active party sample label component, ensuring that the operation on the component is equal to the operation result on the plaintext after integration. This solution achieves the purpose of multi-party federated learning while ensuring the privacy of the active party sample label data.

[0250] The following are device embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

[0251] Figure 5 This is a structural diagram of the first embodiment of the federated learning device provided in the embodiment of the present application. The federated learning device can be integrated on the computer device provided by the active party, or can be independent of the computer device provided by the active party, and cooperate with the computer device of the active party to implement the above method. Figure 5 As shown, the federated learning device 50 includes a label sharing module 51, a component calculation module 52, a first split determination module 53, and a first information construction module 54.

[0252] Among them, the label sharing module 51 is used to share the first component of the sample encryption label with the participating parties. The component calculation module 52 is used to calculate the information gain component of each split of the active party based on the second component. The first split determination module 53 is used to determine the optimal split from the splits based on the information gain component of each split of the participating parties and the information gain component of each split of the active party. The first information construction module 54 is used to construct the split information of the optimal split together with the participating parties based on the optimal split.

[0253] The sample encryption label is obtained by encrypting the sample label by the active party, and the sample encryption label includes a first component and a second component. The first component is used by the participating party to calculate the information gain component of each split of the split node in the model to be constructed.

[0254] Optionally, in some embodiments, the tag sharing module 51 may be specifically used for:

[0255] Generate public and private keys together with the participating parties;

[0256] The first component of the sample encrypted tag is shared with the participants based on the public key and the private key.

[0257] Among them, each participating party and active party holds at least one private key.

[0258] Optionally, in some embodiments, the tag sharing module 51 may be specifically used for:

[0259] Obtaining a first encryption result sent by each participant;

[0260] Encrypting the random secret message held by the active party using the public key to obtain a second encryption result;

[0261] Encrypting the sample label according to the first encryption result and the second encryption result to obtain a ciphertext value;

[0262] Decrypt the ciphertext value together with the participants to obtain the decryption result;

[0263] According to the private key held by each participant, a first component is obtained from the decryption result and shared with the participants.

[0264] Among them, the first encryption result is obtained by the participating party using the public key to encrypt the random secret message held.

[0265] In some embodiments, the federated learning device 50 may further include a decryption module, configured to obtain the second component from the decryption result according to a private key held by the active party.

[0266] In some embodiments, the component calculation module 52 may be specifically used for:

[0267] Get the sample vector of the left node and the sample vector of the right node of each split;

[0268] According to the second component, the sample component of the left node and the sample vector of the right node, the information gain component of each split of the active party is calculated.

[0269] Optionally, in some embodiments, the component calculation module 52 may be specifically used for:

[0270] Calculate the label vector of the left node and the label vector of the right node according to the second component, the sample vector of the left node and the sample vector of the right node;

[0271] According to the label vector of the left node and the label vector of the right node, obtain the label ratio of the left node and the label ratio of the right node;

[0272] According to the sample vector of the left node and the sample vector of the right node, obtain the sample ratio of the left node and the sample ratio of the right node;

[0273] The information gain component of each split of the active party is calculated according to the label ratio of the left node, the sample ratio of the left node, the label ratio of the right node, and the sample ratio of the right node.

[0274] In some embodiments, the first split determination module is configured to:

[0275] Obtain the optimal split component of the participant, which is calculated by the participant locally based on the information gain component of each split;

[0276] According to the information gain component of each split of the active party, the optimal split component of the active party is obtained;

[0277] According to the optimal splitting components of the participating parties and the optimal splitting components of the active party, the optimal splitting is determined from the splitting.

[0278] The information gain component is calculated by the participant based on the first component, the sample vector of the left node, and the sample vector of the right node.

[0279] In some embodiments, the first split determination module 53 may be specifically used to:

[0280] Based on multi-party secure computation, the optimal splitting components of the active party and the optimal splitting components of the participating parties are compared with each other to determine the optimal splitting.

[0281] In some embodiments, the first information construction module 54 may be specifically used for:

[0282] Get the index corresponding to the optimal split;

[0283] According to the indicators corresponding to the optimal split, the split information of the optimal split is constructed with the participants.

[0284] Among them, the indicators include at least feature component, split component and information gain component.

[0285] In some embodiments, the above-mentioned federated learning apparatus may further include a determination module, which is used to:

[0286] Determine whether the left node / right node meets the preset splitting condition;

[0287] If the left node / right node meets the preset splitting condition, the left node / right node will be used as the leaf node of the model to be constructed;

[0288] Get the node number and label vector of the leaf node sent by the participant;

[0289] According to the label vector of the leaf node, the sample label of the leaf node is obtained.

[0290] Figure 6 This is a schematic diagram of the structure of the second embodiment of the federated learning device provided in the embodiment of the present application. The federated learning device can be integrated in the computer equipment of the participant, or it can be independent of the computer equipment of the participant and implement the above method with the computer equipment system of the participant. Figure 6 As shown, the federated learning device 60 includes a component acquisition module 61, a gain calculation module 62, a second split determination module 63 and a second information construction module 64.

[0291] Among them, the component acquisition module 61 is used to obtain the first component of the active party's encrypted sharing, the left node sample vector and the right node sample vector of each split of the split node in the model to be constructed. The gain calculation module 62 is used to calculate the information gain component of each split of the participating party based on the first component, the sample vector of the left node and the sample vector of the right node. The second split determination module 63 is used to determine the optimal split from the splits based on the information gain component of each split of the active party and the information gain component of each split of the participating party. The second information construction module 64 is used to construct the split information of the optimal split together with the active party based on the optimal split.

[0292] Among them, the information gain component value of the optimal split is the largest

[0293] In some embodiments, the component acquisition module 61 may be specifically used for:

[0294] Generate public and private keys together with the active party;

[0295] Encrypting the held random secret message according to the public key to obtain a first encryption result;

[0296] Sending the first encryption result to the active party;

[0297] Decrypt the ciphertext value together with the active party to obtain the decryption result;

[0298] The first component is obtained from the decryption result according to the held private key.

[0299] Each participant and active party holds at least one private key, and the first encryption result is used to be combined with the sample label encryption result of the active party to obtain a ciphertext value.

[0300] In some embodiments, the gain calculation module may be specifically used for:

[0301] Calculate the label vector of the left node and the label vector of the right node according to the first component, the sample vector of the left node and the sample vector of the right node;

[0302] According to the label vector of the left node and the label vector of the right node, obtain the label ratio of the left node and the label ratio of the right node;

[0303] According to the sample vector of the left node and the sample vector of the right node, obtain the sample ratio of the left node and the sample ratio of the right node;

[0304] The information gain component of each split of the participant is calculated based on the label ratio of the left node, the sample ratio of the left node, the label ratio of the right node, and the sample ratio of the right node.

[0305] The device provided in the embodiments of the present application can be used to execute the methods in the above corresponding embodiments. The implementation principles and technical effects are similar and will not be repeated here.

[0306] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the component calculation module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above component calculation module. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. In the implementation process, each step of the above method or each of the above modules can be completed by instructions in the form of software.

[0307] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.

[0308] Figure 7 This is a schematic diagram of the structure of the computer device embodiment 1 provided in the present application. The computer device can be used as the computer device of the active party, such as Figure 7 As shown, the computer device 70 includes: at least one processor 71 , a memory 72 , a bus 73 and a communication interface 74 .

[0309] The processor 71 , the communication interface 74 and the memory 72 communicate with each other via the bus 73 .

[0310] The communication interface 74 is used to communicate with other devices. The communication interface 74 includes a communication interface for data transmission and a display interface or an operation interface for human-computer interaction.

[0311] The processor 71 is used to execute the computer-executable instructions stored in the memory 72, and specifically can execute the relevant steps in the method described in the above embodiment.

[0312] The processor may be a central processing unit. The one or more processors included in the computer device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0313] The memory 72 is used to store computer-executable instructions. The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0314] Figure 8 This is a schematic diagram of the structure of the second embodiment of the computer device provided in the embodiment of the present application. The computer device can be used as a computer device of a participant, such as Figure 8 As shown, the computer device 80 includes: at least one processor 81 , a memory 82 , a bus 83 and a communication interface 84 .

[0315] The processor 81 , the communication interface 84 and the memory 82 communicate with each other via the bus 83 .

[0316] The communication interface 84 is used to communicate with other devices and includes a communication interface for data transmission and a display interface or operation interface for human-computer interaction.

[0317] The processor 81 is used to execute the computer-executable instructions stored in the memory 82, and specifically can execute the relevant steps in the method described in the above embodiment.

[0318] The processor may be a central processing unit. The one or more processors included in the computer device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0319] The memory 82 is used to store computer-executable instructions. The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0320] This embodiment further provides a readable storage medium, in which computer instructions are stored. When at least one processor of a computer device executes the computer instructions, the computer device executes the method steps provided in the above-mentioned various implementation modes.

[0321] This embodiment also provides a program product, which includes computer instructions, which are stored in a readable storage medium. At least one processor of a computer device can read the computer instructions from the readable storage medium, and at least one processor executes the computer instructions so that the computer device implements the method steps provided in the above various embodiments.

[0322] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in the formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0323] It is to be understood that the various numerical numbers involved in the embodiments of the present application are only for the convenience of description and are not intended to limit the scope of the embodiments of the present application. In the embodiments of the present application, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0324] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A federated learning method, characterized in that: Applied to an active party in federated learning, the active party includes first sample data and sample labels, and the method includes: Sharing the first component of the sample encryption label with the participating party, the sample encryption label is obtained by the active party encrypting the sample label, the sample encryption label includes a first component and a second component, the first component is used by the participating party to calculate the information gain component of each split of the split node in the model to be constructed; According to the second component, calculating the information gain component of each split of the active party; According to the information gain component of each split of the participating party and the information gain component of each split of the active party, determining an optimal split from the splits, wherein the information gain component value of the optimal split is the largest; According to the optimal split, jointly construct with the participating party the split information of the optimal split, wherein the split information of the optimal split is used to construct the left node and the right node of the split node in the model to be constructed; The step of sharing the first component of the sample encryption tag with the participant includes: Generate public and private keys together with the participating parties, each participating party and the active party holding at least one private key; Obtaining a first encryption result sent by each participant, where the first encryption result is obtained by the participant using the public key to encrypt a random secret message held by the participant; Using the public key to encrypt the random secret message held by the active party, obtaining a second encryption result; Encrypt the sample label according to the first encryption result and the second encryption result to obtain a ciphertext value; Decrypting the ciphertext value together with the participant to obtain a decryption result; According to the private key held by each participant, a first component is obtained from the decryption result and shared with the participants.

2. The method according to claim 1, characterized in that Before calculating the information gain component of each split of the active party according to the second component, the method further includes: A second component is obtained from the decryption result according to the private key held by the active party.

3. The method according to claim 1, characterized in that The calculating, according to the second component, the information gain component of each split of the active party comprises: Get the sample vector of the left node and the sample vector of the right node of each split; The information gain component of each split of the active party is calculated according to the second component, the sample component of the left node and the sample vector of the right node.

4. The method according to claim 3, characterized in that The calculating, according to the second component, the sample component of the left node and the sample vector of the right node, the information gain component of each split of the active party comprises: Calculate a label vector of the left node and a label vector of the right node according to the second component, a sample vector of the left node and a sample vector of the right node; According to the label vector of the left node and the label vector of the right node, obtaining the label ratio of the left node and the label ratio of the right node; According to the sample vector of the left node and the sample vector of the right node, obtaining the sample ratio of the left node and the sample ratio of the right node; The information gain component of each split of the active party is calculated according to the label ratio of the left node, the sample ratio of the left node, the label ratio of the right node and the sample ratio of the right node.

5. The method according to claim 1, characterized in that The determining the optimal split from the splits according to the information gain component of each split of the participating party and the information gain component of each split of the active party comprises: Obtaining an optimal split component of the participant, where the optimal split component is calculated locally by the participant according to an information gain component of each split; According to the information gain component of each split of the active party, obtaining the optimal split component of the active party; An optimal split is determined from the splits according to the optimal split components of the participating parties and the optimal split components of the active party.

6. The method according to claim 5, characterized in that Determining the optimal split from the splits includes: Based on multi-party secure computation, the optimal splitting component of the active party is compared with the optimal splitting component of the participating party through communication with the participating party to determine the optimal splitting.

7. The method according to claim 6, characterized in that The step of constructing, together with the participant, the splitting information for obtaining the optimal splitting according to the optimal splitting includes: Obtaining an index corresponding to the optimal split, the index at least including a feature component, a split component, and an information gain component; According to the indicator corresponding to the optimal split, the split information of the optimal split is constructed with the participating party.

8. The method according to claim 1, characterized in that After constructing the splitting information of the optimal splitting together with the participant according to the optimal splitting, the method further includes: Determine whether the left node / right node meets a preset splitting condition; If the left node / right node meets the preset splitting condition, the left node / right node is used as the leaf node of the model to be constructed; Obtaining the node number of the leaf node and the label vector of the leaf node sent by the participant; According to the label vector of the leaf node, the sample label of the leaf node is obtained.

9. A federated learning method, characterized in that: Applied to a participant in federated learning, the method includes: Obtain the first component of the active party's encrypted share, the left node sample vector and the right node sample vector of each split of the split node in the model to be constructed; Calculate the information gain component of each split of the participant according to the first component, the sample vector of the left node and the sample vector of the right node; According to the information gain component of each split of the active party and the information gain component of each split of the participating party, determining an optimal split from the splits, wherein the information gain component value of the optimal split is the largest; According to the optimal split, constructing with the active party the split information of obtaining the optimal split; The obtaining of the first component of the active party's encrypted sharing includes: Generate a public key and a private key together with the active party, each participating party and the active party holding at least one private key; Encrypting the held random secret message according to the public key to obtain a first encryption result; Sending the first encryption result to the active party, where the first encryption result is used to be combined with the sample label encryption result of the active party to obtain a ciphertext value; Decrypting the ciphertext value together with the active party to obtain a decryption result; A first component is obtained from the decryption result according to the held private key.

10. The method according to claim 9, characterized in that The calculating, according to the first component, the sample vector of the left node and the sample vector of the right node, the information gain component of each split of the participant comprises: Calculate a label vector of the left node and a label vector of the right node according to the first component, a sample vector of the left node and a sample vector of the right node; According to the label vector of the left node and the label vector of the right node, obtaining the label ratio of the left node and the label ratio of the right node; According to the sample vector of the left node and the sample vector of the right node, obtaining the sample ratio of the left node and the sample ratio of the right node; The information gain component of each split of the participant is calculated based on the label ratio of the left node, the sample ratio of the left node, the label ratio of the right node and the sample ratio of the right node.

11. A federated learning device, characterized in that: include: A label sharing module, used to share the first component of the sample encrypted label with the participating party, wherein the sample encrypted label is obtained by encrypting the sample label by the active party, and the sample encrypted label includes a first component and a second component, wherein the first component is used by the participating party to calculate the information gain component of each split of the split node in the model to be constructed; A component calculation module, used for calculating the information gain component of each split of the active party according to the second component; A first split determination module, configured to determine an optimal split from the splits according to the information gain component of each split of the participating party and the information gain component of each split of the active party, wherein the information gain component value of the optimal split is the largest; A first information construction module, used to construct, together with the participating party, the splitting information of the optimal splitting according to the optimal splitting, wherein the splitting information of the optimal splitting is used to construct the left node and the right node of the splitting node in the model to be constructed; A tag sharing module, specifically used to jointly generate a public key and a private key with the participating parties, each participating party and the active party holding at least one private key; Obtaining a first encryption result sent by each participant, where the first encryption result is obtained by the participant using the public key to encrypt a random secret message held by the participant; Using the public key to encrypt the random secret message held by the active party to obtain a second encryption result; according to the first encryption result and the second encryption result, encrypting the sample label to obtain a ciphertext value; Decrypting the ciphertext value together with the participant to obtain a decryption result; According to the private key held by each participant, a first component is obtained from the decryption result and shared with the participants.

12. A federated learning device, characterized in that: include: A component acquisition module, used to acquire the first component of the active party's encrypted sharing, the left node sample vector and the right node sample vector of each split of the split node in the model to be constructed; A gain calculation module, used to calculate the information gain component of each split of the participant according to the first component, the sample vector of the left node and the sample vector of the right node; A second split determination module is used to determine an optimal split from the splits according to the information gain component of each split of the active party and the information gain component of each split of the participating party, wherein the information gain component value of the optimal split is the largest; A second information construction module is used to construct, according to the optimal split, split information of the optimal split together with the active party; The component acquisition module is specifically used to jointly generate a public key and a private key with the active party, each participant and the active party holds at least one private key; encrypt the held random secret message according to the public key to obtain a first encryption result; send the first encryption result to the active party, and the first encryption result is used to combine with the sample label encryption result of the active party to obtain a ciphertext value; The ciphertext value is decrypted together with the active party to obtain a decryption result; and a first component is obtained from the decryption result according to the private key held.

13. A computer device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.

14. A computer device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 9 to 10.

15. A readable storage medium, characterized in that: The readable storage medium stores computer instructions, which are used to implement the method according to any one of claims 1 to 10 when executed by a processor.

16. A program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Multi-party joint decision tree construction method and device and readable storage medium

    CN111695697A

  • Multi-party joint decision tree construction method, device and readable storage medium

    WO2021249086A1