Patent Description:
Federated learning may train a machine learning model by combining data sources of multiple participants and provide model-based reasoning service while keeping data within the domain. It makes multi-department, multi-company, and even multi-industry data cooperation possible, and may also meet requirements of data protection laws and regulations.

Multi-participant vertical federated learning in the related art depends on the participation of a trusted central node. The central node keeps a private key, and each participant keeps a public key, so as to implement encrypted transmission of data between the participants.

Keeping a private key by a central node may bring a high security risk concentrated in the central node.

<NPL>), describes a three-party end-to-end solution in two phases-privacy-preserving entity resolution and federated logistic regression over messages encrypted with an additively homomorphic scheme, secure against a honest-but-curious adversary.

First, several terms described in the embodiments of this disclosure are briefly introduced.

Federated learning: it trains a machine learning model by combining data sources of multiple participants and provides model-based reasoning service while keeping data within the domain. Federated learning improves the performance of the machine learning model by full use of the data sources of the multiple participants while protecting user privacy and data security. It makes multi-department, multi-company, and even multi-industry data cooperation possible, and may also meet requirements of data protection laws and regulations.

Federated learning may be divided into three types: horizontal federated learning, vertical federated learning, and federated transfer learning.

Vertical federated learning: it is federated learning used when training sample Identifiers (IDs) of participants overlap more while data features overlap less. For example, a bank and e-commerce merchant of the same region have different feature data of the same customer A. For example, the bank has financial data of the customer A, while the e-commerce merchant has shopping data of the customer A. "Vertical" is derived from "vertical partitioning" of data. As shown in <FIG>, different feature data of user samples with overlaps in multiple participants is combined for federated learning. That is, training samples of each participant are vertically partitioned.

Homomorphic encryption: it is a cryptographic technology based on based on the computational complexity theory of mathematical problems. A result obtained by processing data subjected to homomorphic encryption to obtain an output and decrypting the output is the same as an output result obtained by processing unencrypted original data by the same method.

With the research and progress of the AI technology, the AI technology is studied and applied in a plurality of fields such as a common smart home, a smart wearable device, a virtual assistant, a smart speaker, smart marketing, unmanned driving, automatic driving, an unmanned aerial vehicle, a robot, smart medical care, smart customer service, digital credit, and financial credit. It is believed that with the development of technologies, the AI technology will be applied to more fields, and play an increasingly important role.

This disclosure provides a technical solution of vertical federated learning. The vertical federated learning does not need a central node for keeping a private key, and each participant may complete model training service by a central-node-free solution. The vertical federated learning may support vertical federated learning of any multiple parties for model training service and model reasoning service of a federated learning task.

<FIG> is a block diagram of a vertical federated learning system <NUM> according to an exemplary embodiment of this disclosure. The vertical federated learning system supports vertical federated learning collaboratively implemented by N participation nodes (also referred to as participants). The vertical federated learning system <NUM> includes: an upper-layer participation node P<NUM>, and a lower-layer participation node P<NUM> to a lower-layer participation node PN-<NUM>.

The upper-layer partition node P<NUM> and the lower-layer participation nodes (the lower-layer participation node P<NUM> to the lower-layer participation node PN-<NUM>) are deployed in a multi-way tree topology. Any participation node may be a server, or multiple servers, or a logical computation module in cloud computing service. Any two participation nodes belong to different data sources, such as data sources of different companies or data sources of different subsidiary companies of the same company.

The upper-layer participation node P<NUM> is a participation node with label information y. The upper-layer participation node P<NUM> may have feature data X<NUM>, or may not have feature data X<NUM>. For example, the upper-layer participation node P<NUM> is a bank that has a phone number of each user and whether there is any overdue payment record of the user. The phone number of the user is taken as a sample ID, and whether there is any overdue payment record is taken as label information y. Exemplarily, when there are multiple participation nodes with label information, these participation nodes serve as the upper-layer participation node P<NUM> in turn.

The lower-layer participation node Pi has feature data Xi, i=<NUM>, <NUM>,. The lower-layer participation node Pi may have label information y, or may not have label information y.

The vertical federated learning system <NUM> supports collaboration of N participation nodes for safe training of a neural network model. The neural network model includes, but not limited to: a linear regression (LR) model, or a logistic regression (LogR) model, or a support vector machine (SVM) model.

The neural network model is also referred to as a federated model. The federated model includes N submodels. A submodel is locally deployed in each participation node. Network parameters in each submodel may be different. Taking the neural network model being a multiple linear regression model y=W<NUM>X<NUM>+W<NUM>X<NUM>+W<NUM>X<NUM>+W<NUM>X<NUM>+W<NUM>X<NUM>+W<NUM>X<NUM> as an example, the submodel deployed in the first participation node has a first part of network parameter W<NUM> of the multiple linear regression model, the submodel deployed in the second participation node has a second part of parameters W<NUM> and W<NUM> of the multiple linear regression model, the submodel deployed in the third participation node has a third part of network parameters W<NUM> and W<NUM> of the multiple linear regression model, and so on. The network parameters of the submodels deployed in all the participation nodes form all network parameters of the multiple linear regression model.

The upper-layer participation node P<NUM> has a second public key PKi, i = <NUM>, <NUM>,. , N - <NUM> of the lower-layer participation node Pi. The second public keys PKi of different lower-layer participation nodes are different. The lower-layer participation node Pi (i = <NUM>, <NUM>,. , N - <NUM>) has a first public key PK<NUM> of the upper-layer participation node P<NUM>. Each lower-layer participation node has the same first public key PK<NUM>. Any participation node does not disclose its own private key to the other participation nodes. The public key is used for encrypting an intermediate computation result in model training. An encryption algorithm used in this disclosure is an additive homomorphic encryption algorithm. The additive homomorphic encryption algorithm may be a Paillier homomorphic encryption algorithm.

The upper-layer participation node P<NUM> generates a first random mask Ri, i = <NUM>, <NUM>,. , N - <NUM> for the lower-layer participation node Pi. Different lower-layer participation nodes correspond to different first random masks. The lower-layer participation node Pi (i = <NUM>, <NUM>,. , N - <NUM>) generates a second random mask R<NUM>,i for the upper-layer participation node P<NUM>. Different lower-layer participation nodes correspond to different second random masks. Any participation node does not disclose a plain text of any random mask to the other participation nodes. The random mask is used for protecting the intermediate computation result in model training to avoid the network parameters of the neural network model being reversely computed according to model output values of multiple sets of training samples.

In model training, the upper-layer participation P<NUM> collaborates with the lower-layer participation node Pi to perform secure two-party joint computation without disclosing any training sample: <MAT>.

where {Wi, i = <NUM>, <NUM>,. , N - <NUM>} represents a model parameter of the neural network model. The secure two-party joint computation {z<NUM>,i, i = <NUM>,<NUM>,. , N - <NUM>} between the upper-layer participation node P<NUM> and the lower-layer participation node Pi may be performed in parallel at (N - <NUM>) parties, so as to improve the efficiency.

In another possible implementation, zo,i is computed through the following formula: <MAT>.

That is, a weight <MAT> in the above implementation is an optional weight.

The upper-layer participation node P<NUM> computes a joint model output <MAT> and predicted model output ŷ of the neural network model, and computes and transmits a residual δ = ŷ - y (also referred to as an error) to the lower-layer participation node.

The lower-layer participation node Pi locally computes a gradient g; according to the residual δ, and locally updates the model parameter W;, i = <NUM>, <NUM>,. , N - <NUM>.

Optionally, in this disclosure, multiple participation nodes are organized according to a topological structure like a multi-way tree (including a binary tree), so as to reduce requirements for computation and communication capabilities of a single participation node P<NUM>.

<FIG> is a flowchart of a calculation method for vertical federated learning according to an exemplary embodiment of this disclosure. The method is applied to at least two layers (all layers or part of layers) of participation nodes deployed in a multi-way tree topology. A star topology is formed between an upper-layer participation node and lower-layer participation nodes. The at least two layers of participation nodes include an upper-layer participation node and k lower-layer participation nodes connected with the upper-layer participation node. The method includes the following steps:.

In step <NUM>, the upper-layer participation node distributes a first public key corresponding to the upper-layer participation node to the k lower-layer participation nodes, and the k lower-layer participation nodes acquire the first public key corresponding to the upper-layer participation node.

An upper-layer participation node P<NUM> generates a first public key PK<NUM> and a first private key SK<NUM>, and transmits the first public key PK<NUM> to N-<NUM> lower-layer participation nodes Pi. The first public key PK<NUM> and the first private key SK<NUM> form a key pair. A cipher text obtained by encryption with the first pubic key PK<NUM> may be decrypted with the first private key SK<NUM> to obtain an original text. A cipher text obtained by encryption with the first private key SK<NUM> may be decrypted with the first public key PK<NUM> to obtain an original text. The first public key PK<NUM> is visible to the lower-layer participation node Pi, and the first private key SK<NUM> is invisible to the lower-layer participation node Pi.

It is assumed that N is the total number of participation nodes, k is a positive integer greater than N, and N is a positive integer greater than <NUM>.

In step <NUM>, the k lower-layer participation nodes report second public keys to the upper-layer participation node, and the upper-layer participation node acquires the k second public keys corresponding to the k lower-layer participation nodes respectively.

Each lower-layer participation node Pi generates a second public key PKi and a second private key SKi, and transmits the second public key PKi to the upper-layer participation node P<NUM>. The second public key PKi and the second private key SKi form a key pair. A cipher text obtained by encryption with the second pubic key PKi may be decrypted with the second private key SKi to obtain an original text. A cipher text obtained by encryption with the second private key SKi may be decrypted with the second public key PKi to obtain an original text. The second public key PKi is visible to the lower-layer participation node, and the second private key SKi is invisible to the lower-layer participation node. A value of i ranges from <NUM> to k.

In this embodiment of this disclosure, a sequence of the above two steps is not limited. Steps <NUM> and <NUM> may be performed at the same time. Alternatively, step <NUM> may be performed before or after step <NUM>.

In step <NUM>, the upper-layer participation node performs secure two-party joint computation with the k lower-layer participation nodes respectively taking the first public key and the second public keys as encryption parameters to obtain k two-party joint outputs of a federated model; and.

correspondingly, each lower-layer participation node performs secure two-party joint computation with the upper-layer participation node taking the first public key and the second public key as encryption parameters to obtain a two-party joint output of the federated model.

The first public key and the second public key are used for encrypting intermediate computation results between the upper-layer participation node and the lower-layer participation node.

The secure two-party joint computation includes forward computation performed on submodels of the two nodes by the upper-layer participation node and the lower-layer participation node by use of respective data in a manner of homomorphic encryption. In a model training phase, data refers to feature data X that the participation node has. In a model prediction phase, data refers to data to be predicted of the participation node.

In step <NUM>, the upper-layer participation node aggregates the k two-party joint outputs to obtain a first joint model output corresponding to the upper-layer participation node and the k lower-layer participation nodes.

The first joint model output is an output obtained by performing forward computation on k submodels according to feature data X corresponding to the upper-layer participation node and the k lower-layer participation nodes.

In summary, according to the method provided in this embodiment, in multiple participation nodes deployed in a multi-way tree topology, an upper-layer participation node corresponds to k lower-layer participation nodes. After the upper-layer participation node and the k lower-layer participation nodes exchange public keys with each other, the upper-layer participation node performs secure two-party j oint computation with the lower-layer participation nodes taking a first public key and second public keys as encryption parameters to obtain k two-party joint outputs of a federated model. Further, the upper-layer participation node aggregates the k two-party joint outputs to obtain a first joint model output corresponding to the federated model. As such, a multi-way tree topology deployment-based vertical federated learning architecture is provided, improving the equality of each participation node in a vertical federated learning process. The upper-layer participation node and the lower-layer participation node exchange the public keys with each other, and keep their own private keys, so that the security risk may be shared by each participation node.

<FIG> is a flowchart of secure joint computation between two participation nodes according to an exemplary embodiment of this disclosure. An upper-layer participation node P<NUM> performs secure two-party j oint computation with an ith lower-layer participation node Pi (<FIG> takes a first lower-layer participation node as an example), a value of i ranging from <NUM> to k. The method includes the following substeps:.

In step <NUM>, the upper-layer participation node P<NUM> generates a first public key PK<NUM> and a first private key SK<NUM>, and the ith lower-layer participation node Pi generates a second public key PKi and a second private key SKi.

In step <NUM>, the upper-layer participation node P<NUM> transmits the first public key PK<NUM> to the ith lower-layer participation node Pi, and the ith lower-layer participation node Pi transmits the second public key PKi to the upper-layer participation node P<NUM>; and.

the ith lower-layer participation node Pi stores the first public key PK<NUM>, and the upper-layer participation node P<NUM> stores the second public key PKi.

Steps <NUM> and <NUM> complete the processes of steps <NUM> and <NUM>, and will not be elaborated. Step <NUM> optionally includes the following substeps:.

In step <NUM>, the upper-layer participation node P<NUM> generates a first network parameter W<NUM> and a first random mask Ri randomly, and the ith lower-layer participation node Pi generates a second network parameter Wi and a second random mask R<NUM>,i randomly.

The first network parameter W<NUM> is a network parameter of a submodel locally deployed in the upper-layer participation node P<NUM>. The second network parameter Wi is a network parameter of a submodel locally deployed in the ith lower-layer participation node Pi.

The first random mask Ri is generated by the upper-layer participation node P<NUM>, so the first random masks generated by the upper-layer participation node P<NUM> for different lower-layer participation nodes may be the same or different. The second random mask R<NUM>,i is generated by each lower-layer participation node, so second random masks generated by different lower-layer participation nodes for the upper-layer participation node P<NUM> are generally different.

In step <NUM>, the upper-layer participation node P<NUM> encrypts the first random mask Ri with the first public key PK<NUM> in a manner of homomorphic encryption to obtain a first encrypted value PK<NUM>(Ri); and the ith lower-layer participation node Pi encrypts the second random mask R<NUM>,i with the second public key PKi in a manner of homomorphic encryption to obtain a second encrypted value PKi(R<NUM>,i).

In step <NUM>, the upper-layer participation node P<NUM> transmits the first encrypted value PK<NUM>(Ri) to the ith lower-layer participation node Pi, and the ith lower-layer participation node Pi transmits the second encrypted value PKi(R<NUM>,i) to the upper-layer participation node; and.

the ith lower-layer participation node Pi receives the first encrypted value PK<NUM>(Ri) transmitted by the upper-layer participation node P<NUM>, and the upper-layer participation node P<NUM> receives the second encrypted value PKi(R<NUM>,i) transmitted by the ith lower-layer participation node Pi.

In step <NUM>, the upper-layer participation node P<NUM> computes a product PKi(R<NUM>,i)·W<NUM> of the second encrypted value PKi(R<NUM>,i) and the first network parameter W<NUM>, and the ith lower-layer participation node computes a product PKi(R<NUM>,i)·Wi of the first encrypted value PK<NUM>(Ri) and the second network parameter Wi.

The second network parameter is a network parameter of the submodel locally deployed in the ith lower-layer participation node.

In step <NUM>, the upper-layer participation node P<NUM> generates a second random number r<NUM>,i, and the ith lower-layer participation node Pi generates a first random number ri.

The second random number is generated by the upper-layer participation node P<NUM>, so the second random numbers generated by the upper-layer participation node P<NUM> for different lower-layer participation nodes may be the same or different. The first random number is generated by each lower-layer participation node, so first random numbers generated by different lower-layer participation nodes for the upper-layer participation node P<NUM> are generally different.

In step <NUM>, the upper-layer participation node P<NUM> transmits a third encrypted value to the ith lower-layer participation node Pi, and the upper-layer participation node receives a fourth encrypted value transmitted by the ith lower-layer participation node Pi.

The third encrypted value is a value obtained by encrypting first data X<NUM> with the second encrypted value PKi(R<NUM>,i) and the second random number r<NUM>,<NUM>. Exemplarily, the third encrypted value is PKi(R<NUM>,i)·X<NUM>-r<NUM>,i.

The fourth encrypted value is a value obtained by the ith lower-layer participation node Pi by encrypting second data Xi with the first encrypted value PK<NUM>(Ri) and the first random number ri. Exemplarily, the fourth encrypted value is PK<NUM>(Ri)·Xi-ri.

In step <NUM>, the upper-layer participation node P<NUM> decrypts the fourth encrypted value PKi(R<NUM>,i)·Xi-ri with the first private key to obtain a masked value R;X;-r; of the second data, and the ith lower-layer participation node Pi decrypts the third encrypted value with the second private key to obtain a masked value R<NUM>X<NUM>-r<NUM>,i of the first data.

In step <NUM>, the upper-layer participation node P<NUM> computes a first local output s<NUM>, and the ith lower-layer participation node Pi computes a second local output s<NUM>.

The upper-layer participation node P<NUM> computes the first local output s<NUM>: <MAT>.

The ith lower-layer participation node Pi computes the second local output s<NUM>: <MAT>.

A weight <NUM>/k in the above formulas is an optional weight. In some embodiments, the weight is not needed. That is,
the upper-layer participation node P<NUM> computes the first local output s<NUM>: <MAT>.

In step <NUM>, the ith lower-layer participation node Pi reports the second local output s<NUM> to the upper-layer participation node P<NUM>.

In step <NUM>, the upper-layer participation node P<NUM> adds the first local output and the second local output to obtain an ith two-party joint output z<NUM>,i.

In a possible design, the secure two-party joint computation between the upper-layer participation node and the k lower-layer participation nodes is performed in parallel. By performing the above steps in parallel, the upper-layer participation node obtains totally k two-party joint outputs of a federated model.

In summary, according to the method provided in this embodiment, a multiple encryption mechanism of public key, random mask and random number is used, so that there is provided a secure two-party joint calculation method where an upper-layer participation node and a lower-layer participation node are substantially in an equal relationship, and in addition, the security of feature data between the upper-layer participation node and a lower-layer participation node may be ensured.

In an optional embodiment based on <FIG>, when the N participation nodes are deployed in a multi-way tree topology, there are at least two deployment manners.

The upper-layer participation node is a root node in two layers of participation nodes. The lower-layer participation node is a leaf node in the two layers of participation nodes. Each leaf node is connected with the root node.

As shown in <FIG>, a participation node P<NUM> serves as an upper-layer participation node, i.e., a root node. N-<NUM> participation nodes Pi serve as lower-layer participation nodes, i = <NUM>, <NUM>,. , N - <NUM>. There is a network connection between the root node and each lower-layer participation node.

The N participation nodes are deployed in a multi-way topology of at least three layers. Two adjacent layers of participation nodes include upper-layer participation nodes and lower-layer participation nodes. The upper-layer participation node is a participation node of the higher layer in the two adjacent layers of participation nodes. The lower-layer participation node is a participation layer of the lower layer in the two adjacent layers of participation nodes. Each lower-layer participation node is connected with the corresponding upper-layer participation node. Each upper-layer participation node corresponds to at least two lower-layer participation nodes. As shown in <FIG>, taking deploying seven participation nodes in a three-layer multi-way tree topology as an example, a participation node P<NUM> is a first-layer participation node, i.e., a root node, a participation node P<NUM> and a participation node P<NUM> are second-layer participation nodes, and a participation node P<NUM>, a participation node P<NUM>, a participation node P<NUM>, and a participation node P<NUM> are third-layer participation nodes.

The participation node P<NUM> is an upper-layer participation node (or referred to as a higher-layer participation node) of the participation node P<NUM> and the participation node P<NUM>. The participation node P<NUM> and the participation node P<NUM> are lower-layer participation nodes of the participation node P<NUM>.

The participation node P<NUM> is an upper-layer participation node of the participation node P<NUM> and the participation node P<NUM>. The participation node P<NUM> and the participation node P<NUM> are lower-layer participation nodes of the participation node P<NUM>. The participation node P<NUM> is an upper-layer participation node of the participation node P<NUM> and the participation node P<NUM>. The participation node P<NUM> and the participation node P<NUM> are lower-layer participation nodes of the participation node P<NUM>.

<FIG> is a flowchart of a calculation method for vertical federated learning according to an exemplary embodiment of this disclosure. The method is applied to the upper-layer participation node and N-<NUM> lower-layer participation nodes shown in <FIG>. Taking a federated model being a logistic regression (LogR) model as an example, the method includes the following steps:.

In step <NUM>, the upper-layer participation node P<NUM> generates a first public key PK<NUM> and a first private key SK<NUM>, and transmits the first public key PK<NUM> to the N-<NUM> lower-layer participation nodes Pi.

The upper-layer participation node P<NUM> generates a public key and private key pair (PK<NUM>, SK<NUM>), and transmits a first public key PK<NUM> to each lower-layer participation node Pi. The N-<NUM> lower-layer participation nodes Pi receive the first public key PK<NUM> transmitted by the upper-layer participation node P<NUM>. The N-<NUM> lower-layer participation nodes Pi store the first public key PK<NUM>.

The first public key PK<NUM> is used for performing additive homomorphic encryption on an intermediate computation result. For example, a Paillier homomorphic encryption algorithm is used.

In step <NUM>, each lower-layer participation node Pi generates a second public key PKi and a second private key SKi, and transmits the second public key PKi to the upper-layer participation node P<NUM>; and.

the upper-layer participation node P<NUM> stores the N-<NUM> public keys PKi, i=<NUM>, <NUM>,. Schematically, the N-<NUM> second public keys PKi are different.

The second public key PKi is used for performing additive homomorphic encryption on an intermediate computation result. For example, the Paillier homomorphic encryption algorithm is used.

In step <NUM>, each participation node performs encrypted sample alignment.

It is assumed that the participation node Pi has a training feature data set Xi, i = <NUM>, <NUM>, <NUM>,. , N - <NUM>. The participation node P<NUM> has label information y. The participation node P<NUM> may have no feature data, namely X<NUM> is null.

The N participation nodes of vertical federated learning need to align training samples they have so as to screen out an ID intersection of the training samples they have. That is, an intersection of the training samples corresponding to the same sample ID in the multiple training feature data sets Xi, i = <NUM>, <NUM>, <NUM>,. , N - <NUM> is computed. Disclosure of the training samples beyond the intersection is not allowed. Schematically, this step is to align training samples of multiple participation nodes by use of a Freedman-protocol-based algorithm.

In step <NUM>, the upper-layer participation node P<NUM> performs secure two-party joint computation with each lower-layer participation node Pi taking the first public key and the second public key as encryption parameters to obtain a two-party joint output z<NUM>,i between the upper-layer participation node P<NUM> and each lower-layer participation node Pi: <MAT>
where [Wi, i = <NUM>, <NUM>, <NUM>,. , N - <NUM>} represents a parameter of the federated model.

An algorithm for the secure two-party joint computation between the upper-layer participation node P<NUM> and each lower-layer participation node Pi is not limited. Any secure two-party joint calculation method is available. In this disclosure, the secure two-party joint computation is exemplified with steps <NUM> to <NUM> shown in <FIG>.

Computation of {z<NUM>,i, i = <NUM>,<NUM>,. , N - <NUM>} by the upper-layer participation node P<NUM> and each lower-layer participation node Pi may be performed in parallel at the (N - <NUM>) lower-layer participation nodes Pi, so as to reduce training time of the federated model and improve the efficiency of multi-participant federated learning.

In step <NUM>, the upper-layer participation node P<NUM> computes a multi-party joint output z<NUM>,i.

After the upper-layer participation node P<NUM> obtains {z<NUM>,i, i = <NUM>,<NUM>,. , N - <NUM>} of each lower-layer participation node Pi in a plain text form, the participation node P<NUM> may compute a multi-party joint output z corresponding to the N participation nodes: <MAT>.

In another possible implementation, z is computed through the following formula: <MAT>.

That is, <MAT> in the above implementation is an optional weight.

Further, the upper-layer participation node P<NUM> may compute a multi-party joint output of the federated model as follows: <MAT>
where sigmoid is an S function, also referred to as an activation function. E is a natural constant.

In step <NUM>, the upper-layer participation node P<NUM> computes a forward prediction error δ of a federated model according to a difference between the multi-party joint output ŷ and label information y: <MAT>.

In step <NUM>, the upper-layer participation node P<NUM> updates a first network parameter iteratively according to the forward prediction error δ.

After obtaining the forward prediction error δ, the upper-layer participation node Pi locally computes a gradient of a loss function of the federated model for a first network parameter W<NUM>. For the federated logistic regression model, the gradient of the loss function for the first network parameter W<NUM> is: g<NUM> = δX<NUM>.

The upper-layer participation node P<NUM> locally updates the first network parameter of the federated model: W<NUM> ← W<NUM> - ηg<NUM>, where η represents a learning rate. For example, η = <NUM>.

In step <NUM>, the upper-layer participation node P<NUM> transmits the forward prediction error δ; to each lower-layer participation node Pi.

In step <NUM>, the lower-layer participation node Pi updates a second network parameter iteratively according to the forward prediction error δ.

Schematically, the upper-layer participation node P<NUM> transmits the forward prediction error δ = ŷ - y to the lower-layer participation node Pi in a plain text or cipher text form, i = <NUM>, <NUM>,. , N - <NUM>.

After obtaining the forward prediction error δ, the lower-layer participation node Pi locally computes a gradient of the loss function of the federated model for a first network parameter Wi. For the logistic regression model, the gradient of the loss function for the second network parameter Wi is: gi = δXi, i = <NUM>, <NUM>,. , N - <NUM>.

The lower-layer participation node Pi locally updates the second network parameter of the federated model: Wi ← Wi - ηgi, where η represents a learning rate. For example, η = <NUM>.

In step <NUM>, step <NUM> is performed when an iteration ending condition is not satisfied.

The iteration ending condition includes that: an iteration count is greater than a maximum iteration count, or, the network parameter of the federated model converges.

In step <NUM>, the training process is stopped when the iteration ending condition is satisfied.

In summary, according to the method provided in this embodiment, in multiple participation nodes deployed in a multi-way tree topology, an upper-layer participation node corresponds to k lower-layer participation nodes. After the upper-layer participation node and the k lower-layer participation nodes exchange public keys with each other, the upper-layer participation node performs secure two-party joint computation with the lower-layer participation nodes taking a first public key and second public keys as encryption parameters to obtain k two-party joint outputs of a federated model. Further, the upper-layer participation node aggregates the k two-party joint outputs to obtain a first joint output corresponding to the federated model. As such, a multi-way tree topology deployment-based vertical federated learning architecture is provided, improving the equality of each participation node in a vertical federated learning process. The upper-layer participation node and the lower-layer participation node exchange the public keys with each other, and keep their own private keys, so that the security risk may be shared by each participation node.

According to the method provided in this method, a root node and N-<NUM> leaf nodes are constructed in a star topology, which is prone to the implementation of the service in actual scenarios. The whole vertical federated learning process may be completed equally only if any participation node with label information communicates with the other participation nodes as a root node.

In an optional embodiment based on <FIG>, when an upper-layer participation node is unable to meet requirements for computation and communication capabilities, multiple different upper-layer participation nodes may be used to share computation and communication tasks. Multiple participation nodes are organized according to a topological structure like a multilayer multi-way tree.

<FIG> is a flowchart of a calculation method for vertical federated learning according to an exemplary embodiment of this disclosure. The method is applied to the upper-layer participation node and lower-layer participation nodes shown in <FIG>. The method includes the following steps:.

In step <NUM>, the upper-layer participation node generates a first public key and a first private key, and transmits the first public key to the k lower-layer participation nodes.

Taking the second-layer participation nodes as upper-layer participation nodes as an example, the upper-layer participation node includes: the participation node P<NUM> and the participation node P<NUM>.

For the upper-layer participation node P<NUM>, the upper-layer participation node P<NUM> generates a public key and private key pair (PK<NUM>, SK<NUM>), and transmits a first public key PK<NUM> to the lower-layer participation node P<NUM> and P<NUM>. The lower-layer participation nodes P<NUM> and P<NUM> receive the first public key PK<NUM> transmitted by the upper-layer participation node P<NUM>. The lower-layer participation nodes P<NUM> and P<NUM> store the first public key PK<NUM>.

In step <NUM>, each lower-layer participation node Pi generates a second public key PKi and a second private key SKi, and transmits the second public key PKi to the upper-layer participation node.

For the upper-layer participation node P<NUM>, the lower-layer participation node P<NUM> generates a public key and private key pair (PK<NUM>, SK<NUM>), and transmits a second public key PK<NUM> to the upper-layer participation node P<NUM>. The lower-layer participation node P<NUM> generates a public key and private key pair (PK<NUM>, SK<NUM>), and transmits a second public key PK<NUM> to the upper-layer participation node P<NUM>. The upper-layer participation nodes P<NUM> receives the second public key PK<NUM> transmitted by the lower-layer participation node P<NUM> and the second public key PK<NUM> transmitted by the lower-layer participation node P<NUM>. The upper-layer participation node P<NUM> stores the second public keys PK<NUM> and PK<NUM>.

The second public keys PK<NUM> and PK<NUM> are used for performing additive homomorphic encryption on an intermediate computation result. For example, the Paillier homomorphic encryption algorithm is used.

For the upper-layer participation node P<NUM>, the lower-layer participation node P<NUM> generates a public key and private key pair (PK<NUM>, SK<NUM>), and transmits a second public key PK<NUM> to the upper-layer participation node P<NUM>. The lower-layer participation node P<NUM> generates a public key and private key pair (PK<NUM>, SK<NUM>), and transmits a second public key PK<NUM> to the upper-layer participation node P<NUM>. The upper-layer participation node P<NUM> receives the second public key PK<NUM> transmitted by the lower-layer participation node P<NUM> and the second public key PK<NUM> transmitted by the lower-layer participation node P<NUM>. The upper-layer participation node P<NUM> stores the second public keys PK<NUM> and PK<NUM>.

It is assumed that a participation node Pi has a training feature data set Xi, i = <NUM>, <NUM>, <NUM>,. , N - <NUM>. A participation node P<NUM> has label information y. The participation node P<NUM> may have no feature data, namely X<NUM> is null.

The N participation nodes of vertical federated learning need to align training samples they have so as to screen out an ID intersection of the training samples they have. That is, an intersection of the training samples corresponding to the same sample ID in the multiple training feature data sets Xi, i = <NUM>, <NUM>, <NUM>,. , N - <NUM> is computed. Disclosure of the training samples beyond the intersection is not allowed. This step is to align training samples of multiple participation nodes by use of a Freedman-protocol-based algorithm.

In step <NUM>, the upper-layer participation node performs secure two-party joint computation with each lower-layer participation node taking the first public key and the second public key as encryption parameters to obtain a two-party joint output zj,i between the upper-layer participation node Pj and each lower-layer participation node Pi: <MAT>
where {Wj, i = <NUM>, <NUM>, <NUM>,. , k} represents a parameter of a federated model. Similarly, Wj also represents a parameter of the federated model.

The upper-layer participation node P<NUM> performs secure two-party joint computation with the lower-layer participation nodes P<NUM> and P<NUM> respectively to obtain submodel outputs z<NUM>,<NUM> and z<NUM>,<NUM>, where <MAT> <MAT>.

An algorithm for the secure two-party joint computation between the upper-layer participation node Pj and each lower-layer participation node Pi is not limited. Any secure two-party joint calculation method is available. In this disclosure, the secure two-party joint computation is exemplified with steps <NUM> to <NUM> shown in <FIG>.

The process of performing the secure two-party joint computation by the upper-layer participation node and each lower-layer participation node may be performed in parallel at the k lower-layer participation nodes, so as to reduce training time of the federated model and improve the efficiency of multi-participant federated learning.

In step <NUM>, the upper-layer participation node computes a multi-party joint output.

The upper-layer participation node P<NUM> aggregates the submodel outputs z<NUM>,<NUM> and z<NUM>,<NUM> to obtain a multi-party joint output Z<NUM> corresponding to the participation node P<NUM>, the participation node P<NUM>, and the participation node P<NUM>. The multi-party joint output Z<NUM> represents a multi-party joint output corresponding to k+<NUM>=<NUM> participants.

The upper-layer participation node P<NUM> aggregates the submodel outputs z<NUM>,<NUM> and z<NUM>,<NUM> to obtain a multi-party j oint output Z<NUM> corresponding to the participation node P<NUM>, the participation node P<NUM>, and the participation node P<NUM>. The multi-party joint output Z<NUM> represents a multi-party joint output corresponding to k+<NUM>=<NUM> participants.

In step <NUM>, the multi-party joint output is reported, when the upper-layer participation node is a lower-layer participation node of a higher-layer participation node in the multi-way tree topology, to the higher-layer participation node.

The higher-layer participation node is an upper-layer participation node of the upper-layer participation node. The upper-layer participation node reports the first joint output to the higher-layer participation node in a plain text or cipher text form.

The upper-layer participation node P<NUM> reports the first joint output Z<NUM> to the higher-layer participation node P<NUM>.

In step <NUM>, the higher-layer participation node obtains a multi-party joint model output corresponding to the higher-layer participation node by aggregating according to a single-party model output corresponding to the higher-layer participation node and a multi-party joint model output corresponding to each lower-layer participation node subordinate to the higher-layer participation node.

After obtaining z<NUM> and z<NUM> in the plain text form, the upper-layer participation node P<NUM> aggregates its own single-party model output W<NUM>X<NUM>, and computes a multi-party joint output corresponding to the upper-layer participation node P<NUM> and all of its subordinate lower-layer participation nodes: z = z<NUM> + z<NUM> + W<NUM>X<NUM>.

The multi-party joint output represents a joint output corresponding to seven participation nodes.

Further, the upper-layer participation node P<NUM> may compute a multi-party joint output of the federated model as follows: <MAT>.

where sigmoid is an S function, also referred to as an activation function. E is a natural constant.

In step <NUM>, the upper-layer participation node computes, when the upper-layer participation node is a root node with label information, a forward prediction error of a federated model according to a difference between the multi-party joint output and the label information.

The upper-layer participation node P<NUM> computes a forward prediction error δ of the federated model according to a difference between the multi-party joint output ŷ and label information y: <MAT>.

After obtaining the forward prediction error δ, the upper-layer participation node Pi locally computes a gradient of a loss function of the federated model for a first network parameter W<NUM>. For the federated model, the gradient of the loss function for the first network parameter W<NUM> is: g<NUM> = δX<NUM>.

After obtaining the forward prediction error δ, the lower-layer participation node Pi locally computes a gradient of the loss function of the federated model for a first network parameter Wi. For the federated model, the gradient of the loss function for the second network parameter Wi is: gi = δXi, i = <NUM>, <NUM>, <NUM>,. , N - <NUM>.

Since the outputs of the participation nodes P<NUM> and P<NUM> are already mixed with multi-party outputs, in the above-mentioned embodiment, the participation node P<NUM> may implement computation with the participation nodes P<NUM> and P<NUM> directly in the plain text form without sharing the public keys and using additive homomorphic encryption or random masks. Certainly, the participation node P<NUM> may still select to compute z with the participation nodes P<NUM> and P<NUM> by secure two-party joint computation. That is, the participation node P<NUM> still shares the public keys and random masks with the participation nodes P<NUM> and P<NUM> to compute z by secure two-party joint computation shown in <FIG>, except that the participation node P<NUM> determines the three-party joint output corresponding to the "participation nodes P<NUM>, P<NUM>, and P<NUM>" as its own model output and the participation node P<NUM> determines the three-party joint output corresponding to the "participation nodes P<NUM>, P<NUM>, and P<NUM>" as its own model output.

In summary, according to the method provided in this embodiment, N participation nodes are deployed in a multilayer multi-way tree topology, so that computation and communication are shared by different upper-layer participation nodes. Therefore, the computation and communication pressure of a participation node serving as a root node is alleviated.

In addition, since an upper-layer participation node has collects a multi-party joint output of k+<NUM> parties, communication between the upper-layer participation node and a higher-layer participation node does not need encrypted communication and encrypted computation. Therefore, the computation overhead and communication overhead of each upper-layer participation node are reduced.

The model training process is illustrated in the embodiments shown in <FIG> and <FIG>. In the model prediction phase, it is only necessary to replace the feature data X with input data and perform the same process ending with the forward computation process, and it is unnecessary to perform the error back propagation process.

In a schematic example, the method is applied to the field of finance, and the federated model is a financial risk control model constructed by use of a multiple linear regression equation. The label information is whether there is any overdue payment record of a user. The participation nodes represent different companies, such as a bank, an e-commerce company, an instant messaging company, and an enterprise the user works for. The feature data includes, but not limited to: basic attribute information and deposit record of the user (bank), a shopping record of the user (e-commerce company), a social relation chain of the user (instant messaging company), and salary data of the user (enterprise the user works for).

Vertical federated learning makes multi-department, multi-company, and even multi-industry data cooperation possible, and may also meet requirements of data protection laws and regulations. Therefore, an application scenario of vertical federated learning is not limited in this disclosure.

<FIG> shows a vertical federated learning system involved in an exemplary embodiment of this disclosure. The system may be a distributed system formed by connecting a client and multiple participation nodes (computation devices in any form in an access network, such as servers and user terminals) in a network communication form. For example, the distributed system is a blockchain system. Referring to <FIG> is a schematic structural diagram of a distributed system <NUM> applied to a blockchain system according to an exemplary embodiment of this disclosure. The distributed system is formed of a plurality of participation nodes (computing devices in any form in an access network, such as, servers and user terminals) <NUM> and a client <NUM>. A peer-to-peer (P2P) network is formed between the participation nodes <NUM>. The P2P protocol is an application-layer protocol running over the Transmission Control Protocol (TCP). Any machine such as a server or a terminal may be added to the distributed system to become a participation node. The participation nodes include a hardware layer, an intermediate layer, an operating system layer, and an application layer.

Referring to functions of the participation nodes <NUM> in the blockchain system shown in <FIG>, the related functions include the following:.

In addition to the routing function, the participation node <NUM> may further have the following functions:
(<NUM>) Application: which is deployed in a blockchain, and is used for implementing a particular service according to an actual service requirement, recording data related to function implementation to form recorded data, adding a digital signature to the recorded data to indicate a source of task data, and transmitting the recorded data to another participation node <NUM> in the blockchain system, so that the another participation node <NUM> adds the recorded data to a temporary block when successfully verifying a source and integrity of the recorded data.

For example, services implemented by the disclosure include, but not limited to:.

Referring to <FIG> is an optional schematic diagram of a block structure according to an exemplary embodiment of this disclosure. Each block includes a hash value of a transaction record stored in the current block (a hash value of the current block) and a hash value of a previous block. Blocks are connected according to hash values to form a blockchain. In addition, the block may further include information such as a timestamp indicating a block generation time. A blockchain is a decentralized database essentially, and is a series of associated data blocks generated by using a cryptographic method. Each data block includes related information, and is configured to verify the validity (anti-counterfeiting) of the information of the data block, and generate a next block.

<FIG> is a block diagram of an upper-layer participation node (or referred to as an upper-layer participation apparatus) according to an exemplary embodiment of this disclosure. The upper-layer participation node corresponds to k lower-layer participation nodes in multiple participation nodes deployed in a multi-way tree topology, and a submodel in a federated model is locally deployed in each participation node, k being an integer greater than <NUM>. The upper-layer participation node includes:.

In an optional design of this embodiment, the joint computation module <NUM> is configured to:.

In an optional design of this embodiment, the secure two-party joint computation between the upper-layer participation node and the k lower-layer participation nodes is performed in parallel.

In an optional design of this embodiment, the upper-layer participation node is a root node with label information, and the apparatus further includes:
an error back propagation module <NUM>, configured to compute a forward prediction error of the federated model according to a difference between the multi-party joint model output and the label information, and transmit the forward prediction error to the k lower-layer participation nodes, the forward prediction error being used for the k lower-layer participation nodes to perform back propagation to update second network parameters of the submodels in the k lower-layer participation nodes.

In an optional design of this embodiment, the upper-layer participation node is a lower-layer participation node of a higher-layer participation node in the multi-way tree topology. The communication module <NUM> is further configured to report the multi-party joint model output to the higher-layer participation node, the higher-layer participation node being configured to obtain a multi-party joint model output corresponding to the higher-layer participation node by aggregating according to the multi-party joint model output, a single-party model output corresponding to the higher-layer participation node, and a multi-party joint model output corresponding to another lower-layer participation node subordinate to the higher-layer participation node.

In an optional design of this embodiment, the upper-layer participation node is a lower-layer participation node of a higher-layer participation node in the multi-way tree topology. The communication module <NUM> is further configured to report the first public key to the higher-layer participation node, and acquire a third public key corresponding to the higher-layer participation node.

The joint computation module <NUM> is configured to perform, by the upper-layer participation node as a lower-layer participation node, secure two-party j oint computation with the higher-layer participation node taking the first public key and the third public key as encryption parameters to obtain a two-party joint output of the federated model.

<FIG> is a block diagram of a lower-layer participation node (or referred to as a lower-layer participation apparatus) according to an exemplary embodiment of this disclosure. The lower-layer participation node corresponds to an upper-layer participation node in multiple participation nodes deployed in a multi-way tree topology, and a submodel in a federated model is locally deployed in each participation node. The lower-layer participation node includes:.

In an optional design of this embodiment, the joint computation module <NUM> is configured to generate a second network parameter and a second random mask, the second network parameter being a network parameter of the submodel locally deployed in the lower-layer participation node;.

In an optional design of this embodiment, the communication module <NUM> is configured to receive a forward prediction error transmitted by the upper-layer participation node. The error back propagation module <NUM> is configured to perform back propagation according to the forward prediction error to update the second network parameter of the submodel in the lower-layer participation node.

The upper-layer participation node and the lower-layer participation node provided in the foregoing embodiments is described only by using division into the foregoing functional modules as an example. In actual applications, the foregoing functions may be allocated to and completed by different functional modules according to requirements, that is, the internal structure of the device is divided into different functional modules, to complete all or some of the foregoing described functions. In addition, the upper-layer participation node and the lower-layer participation node provided in the foregoing embodiments and the embodiments of the calculation method for vertical federated learning belong to the same concept. For the specific implementation process, reference may be made to the method embodiments, and details are not described herein again.

This disclosure also provides a computer device (terminal or server). The computer device may be implemented as the above-mentioned participation node. The computer device includes a processor and a memory, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to implement the calculation method for vertical federated learning provided in the foregoing method embodiments.

<FIG> is a structural block diagram of a computer device <NUM> according to an exemplary embodiment of this disclosure. The computer device <NUM> may be: a smartphone, a tablet computer, a moving picture experts group audio layer III (MP3) player, a moving picture experts group audio layer IV (MP4) player, a notebook computer, or a desktop computer. The computer device <NUM> may also be referred to as user equipment (UE), a portable computer device, a laptop computer device, a desktop computer device, or another name.

The computer device <NUM> usually includes: a processor <NUM> and a memory <NUM>.

The processor <NUM> may include one or more processing cores, and may be, for example, a <NUM>-core processor or an <NUM>-core processor. The processor <NUM> may be implemented by at least one hardware form in a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor <NUM> may also include a main processor and a co-processor. The main processor is a processor for processing data in a wake-up state, also referred to as a central processing unit (CPU). The coprocessor is a low power consumption processor configured to process data in a standby state. In some embodiments, the processor <NUM> may be integrated with a GPU. The GPU is configured to be responsible for rendering and drawing content that a display needs to display. In some embodiments, the processor <NUM> may further include an artificial intelligence (AI) processor. The AI processor is configured to process a calculation operation related to machine learning.

The memory <NUM> may include one or more computer-readable storage media that may be non-transitory. The memory <NUM> may further include a high-speed random access memory and a non-transitory memory, for example, one or more magnetic disk storage devices or flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory <NUM> is configured to store at least one instruction, and the at least one instruction being configured to be executed by the processor <NUM> to implement the calculation method for vertical federated learning provided in the method embodiments of this disclosure.

A person skilled in the art may understand that the structure shown in <FIG> does not constitute any limitation on the computer device <NUM>, and the computer device may include more components or fewer components than those shown in the figure, or some components may be combined, or a different component deployment may be used.

The memory further includes one or more programs. The one or more programs are stored in the memory. The one or more programs include a program for performing the calculation method for vertical federated learning provided in the embodiments of this disclosure.

This disclosure further provides a computer-readable storage medium, the storage medium storing at least one instruction, the at least one instruction being loaded and executed by a processor to implement the calculation method for vertical federated learning provided in the foregoing method embodiments.

Claim 1:
A calculation method for vertical federated learning, applied to an upper-layer participation node (P<NUM>) in multiple participation nodes deployed in a multi-way tree topology, the upper-layer participation node (P<NUM>) corresponding to k lower-layer participation nodes (P<NUM>, P<NUM>,..., PN-<NUM>), a submodel in a federated model being locally deployed in each participation node, k being an integer greater than <NUM>, the method comprising:
distributing (<NUM>, <NUM>) a first public key (PK<NUM>) corresponding to the upper-layer participation node (P<NUM>) to the k lower-layer participation nodes (P<NUM>, P<NUM>,..., PN-<NUM>), and acquiring k second public keys (PK<NUM>, PK<NUM>,..., PKN-<NUM>) corresponding to the k lower-layer participation nodes (P<NUM>, P<NUM>,..., PN-<NUM>) respectively;
performing (<NUM>, <NUM>), by the upper-layer participation node (P<NUM>), secure two-party joint computation with the k lower-layer participation nodes (P<NUM>, P<NUM>,..., PN-<NUM>) respectively with the first public key (PK<NUM>) and the k second public keys (PK<NUM>, PK<NUM>,..., PKN-<NUM>) as encryption parameters, to obtain k two-party joint outputs (Z<NUM>,<NUM>, Z<NUM>,<NUM>,..., Z<NUM>,N-<NUM>) of the federated model, the secure two-party joint computation comprising forward computation for the submodel performed, in a manner of homomorphic encryption, by the upper-layer participation node (P<NUM>) and a lower-layer participation node jointly using respective data of the upper-layer participation node (P<NUM>) and the lower-layer participation node; and
aggregating (<NUM>) the k two-party joint outputs (Z<NUM>,<NUM>, Z<NUM>,<NUM>,..., Z<NUM>,N-<NUM>) to obtain (<NUM>) a multi-party joint output corresponding to the upper-layer participation node (P<NUM>) and the k lower-layer participation nodes (P<NUM>, P<NUM>,..., PN-<NUM>).