Method, device and electronic device for training an associative learning model

JP7584666B2Active Publication Date: 2024-11-15JINGDONG TECH HLDG CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2023540566
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-12-31
Filing Date
2021-12-31
Publication Date
2024-11-15
Estimated Expiration
2041-12-31

Smart Images

  • Figure 0007584666000018
    Figure 0007584666000018
  • Figure 0007584666000019
    Figure 0007584666000019
  • Figure 0007584666000020
    Figure 0007584666000020
Patent Text Reader

Abstract

This application discloses a method, device and electronic device for training a federated learning model applied to a server, the method includes the steps of: obtaining a target splitting scheme corresponding to a training node when the training node satisfies a preset splitting condition, the training node being a node of one of a plurality of boosting trees; notifying a client to perform node splitting based on the target splitting scheme; performing training in the next round with a left subtree node generated by splitting the training node as a new training node until the updated training node does not satisfy the preset splitting condition; performing training in the next round with another non-leaf node of one boosting tree as a new training node; and stopping training and generating a target federated learning model when the node data sets of the plurality of boosting trees are all empty. Thus, the application automatically selects the tendency of matching learning schemes by mixing horizontal and vertical splitting schemes, and improves the performance of the federated learning model without worrying about data distribution schemes.
Need to check novelty before this filing date? Find Prior Art

Description

Cross-references to related applications

[0001] This application claims priority to the invention filed by JD Digital Technology Holdings Co., Ltd. on December 31, 2020, titled "Method, apparatus and electronic device for training associative learning model", with Chinese patent application number "202011621994.0", and to the invention filed by JD Digital Technology Holdings Co., Ltd. on December 31, 2020, titled "Method, apparatus and electronic device for training associative learning model", with Chinese patent application number "202011617342.X". [Technical field]

[0002] The present application relates to the field of communication technology, and in particular to a method, apparatus and electronic device for training a federated learning model. [Background technology]

[0003] Federated learning is an emerging artificial intelligence platform technology designed to deploy efficient machine learning among multiple participants or multiple computing nodes, while ensuring information security during big data exchange, protecting the privacy of terminal data and personal data, and complying with regulations. Here, machine learning algorithms that can be used in federated learning are not limited to neural networks, but also include important algorithms such as random forests. Federated learning is expected to become the basis of next-generation artificial intelligence collaborative algorithms and collaborative networks.

[0004] According to the characteristics of data, federated learning is mainly divided into horizontal federated learning and vertical federated learning. Here, horizontal federated learning requires data to be homogeneous, and vertical federated learning requires data to be heterogeneous. However, since it is difficult for multiple data to cooperate for federated learning to be completely heterogeneous or homogeneous, when training a model based on federated learning, some homogeneous or heterogeneous data can only be discarded. If a lot of data is discarded, the performance of the model trained based on federated learning will be poor. Summary of the Invention

[0005] The present application aims to solve one of the technical problems in the related art to some extent.

[0006] Therefore, the first objective of the present application is to provide a method for training an associative learning model to solve the technical problems existing in the process of the conventional associative learning model training method, namely, that all data cannot be fully utilized for learning, and the training effect is poor due to insufficient utilization of data.

[0007] A second object of the present invention is to provide another method for training an associative learning model.

[0008] A third object of the present invention is to provide an apparatus for training an associative learning model.

[0009] A fourth object of the present invention is to provide an apparatus for training another associative learning model.

[0010] A fifth object of the present invention is to provide an electronic device.

[0011] A sixth object of the present invention is to provide a computer-readable storage medium. [Means for solving the problem]

[0012] In order to achieve the above object, an embodiment of a first aspect of the present application provides a training method for a federated learning model applied to a server, the method including: when a training node satisfies a preset splitting condition, a target splitting scheme corresponding to the training node is obtained, where the training node is a node of one boosted tree among a plurality of boosted trees; notifying a client to perform node splitting based on the target splitting scheme; performing a next round of training using a left subtree node generated by splitting the training node as the new training node until the updated training node no longer satisfies the preset splitting condition; performing a next round of training using another non-leaf node of the one boosted tree as the new training node; and when the node data sets of the plurality of boosted trees are all empty, stopping training and generating a target federated learning model.

[0013] In addition, the training method for the associative learning model according to the above embodiment of the present application may further have the following additional technical features.

[0014] According to one embodiment of the present application, the step of obtaining a target partitioning scheme corresponding to the training node includes the steps of: performing horizontal federated learning in cooperation with the client based on a first training set to obtain a first partitioning value corresponding to the training node; performing vertical federated learning in cooperation with the client based on a second training set to obtain a second partitioning value corresponding to the training node; and determining a target partitioning scheme corresponding to the training node based on the first partitioning value and the second partitioning value.

[0015] According to one embodiment of the present application, the step of determining a target splitting method corresponding to the training node based on the first split value and the second split value includes the step of determining the larger of the first split value and the second split value as a target splitting value corresponding to the training node, and the step of determining a splitting method corresponding to the training node based on the target splitting value.

[0016] According to one embodiment of the present application, the step of performing horizontal federated learning in cooperation with the client based on the first training set to obtain a first split value corresponding to the training node includes the steps of generating a first feature subset available to the training node from the first training set and transmitting it to the client, receiving feature values ​​of each feature in the first feature subset transmitted from the client, determining horizontal split values ​​corresponding to each of the features as split feature points based on the feature values ​​of each feature in the first feature subset, and determining the first split value of the training node based on the horizontal split values ​​corresponding to each of the features.

[0017] According to one embodiment of the present application, the step of determining a horizontal splitting value corresponding to each feature in the first feature subset as a splitting feature point based on the feature value of each feature includes: for any one feature in the first feature subset, determining a splitting threshold for the any one feature based on the feature value of the any one feature; obtaining a first data instance identifier set and a second data instance identifier set corresponding to the any one feature based on the splitting threshold, wherein the first data instance identifier set includes data instance identifiers belonging to a first left subtree space and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space; and determining the horizontal splitting value corresponding to the any one feature based on the first data instance identifier set and the second data instance identifier set.

[0018] According to one embodiment of the present application, the step of obtaining a first data instance identifier set and a second data instance identifier set corresponding to the one of the features based on the splitting threshold includes the steps of sending the splitting threshold to the client; receiving an initial data instance identifier set corresponding to the training node sent from the client, where the initial data instance identifier set is generated when the client performs node splitting on the one of the features based on the splitting threshold, and the initial data instance identifier set includes data instance identifiers belonging to the first left subtree space; and obtaining the first data instance identifier set and the second data instance identifier set based on the initial data instance identifier set and all data instance identifiers.

[0019] According to one embodiment of the present application, the step of obtaining the first data instance identifier set and the second data instance identifier set based on the initial data instance identifier set includes the steps of comparing each data instance identifier in the initial data instance identifier set with the data instance identifier of the client to obtain a data instance identifier in which an anomaly exists, pre-processing the data instance identifier in which an anomaly exists to obtain the first data instance identifier set, and obtaining the second data instance identifier set based on all data instance identifiers and the first data instance identifier set.

[0020] According to an embodiment of the present application, the step of performing vertical association learning in cooperation with the client based on the second training set to obtain a second split value corresponding to the training node includes the steps of: informing the client to perform vertical association learning based on the second training set; receiving first gradient information of at least one third data instance identifier set for each feature sent from the client, the third data instance identifier set including data instance identifiers belonging to a second left subtree space, the second left subtree space being a left subtree space formed by splitting according to one of the feature values ​​of the features, and different feature values ​​corresponding to different second left subtree spaces; determining a vertical split value for each feature based on the first gradient information for each feature and total gradient information of the training node; and determining the second split value of the training node based on the vertical split value corresponding to each feature.

[0021] According to an embodiment of the present application, the step of determining a vertical split value of each feature based on the first gradient information of each feature and total gradient information of the training node includes: for each feature, obtaining second gradient information corresponding to each first gradient information based on the total gradient information and each first gradient information; for each first gradient information, obtaining a candidate vertical split value of the one feature based on the first gradient information and the second gradient information corresponding to the first gradient information; and selecting a maximum value of the candidate vertical split values ​​as the vertical split value of the one feature.

[0022] According to an embodiment of the present application, the first gradient information includes a sum of first-order gradients of features corresponding to data instances belonging to the second left subtree space and a sum of second-order gradients of features corresponding to data instances belonging to the second left subtree space, and the second gradient information includes a sum of first-order gradients of features corresponding to data instances belonging to the second right subtree space and a sum of second-order gradients of features corresponding to data instances belonging to the second right subtree space.

[0023] According to one embodiment of the present application, the method further includes the steps of determining that the training node is a leaf node if the training node does not satisfy a predetermined splitting condition, and obtaining a weight value of the leaf node, and sending the weight value of the leaf node to the client.

[0024] According to one embodiment of the present application, the step of obtaining a weight value of the leaf node includes the steps of obtaining a data instance belonging to the leaf node; obtaining primary gradient information and secondary gradient information of the data instance belonging to the leaf node; and obtaining a weight value of the leaf node based on the primary gradient information and the secondary gradient information.

[0025] According to one embodiment of the present application, before the step of informing the client to perform node splitting based on the target splitting scheme, the step further includes a step of sending splitting information to the client, the splitting information including the target splitting scheme, a target split feature selected as a feature split point, and the target split value.

[0026] According to one embodiment of the present application, when the target partitioning scheme is a vertical partitioning scheme, before the step of informing the client to perform node partitioning based on the target partitioning scheme, the method includes the steps of: sending the partitioning information to a labeled client; receiving a left subtree space set sent from the labeled client; partitioning the second training set based on the left subtree space set; and associating the training node with an identifier of the labeled client.

[0027] According to one embodiment of the present application, before the step of obtaining a target splitting method corresponding to the training node when the training node satisfies a preset splitting condition, the method further includes the steps of receiving a data instance identifier sent from the client, and determining a common data instance identifier between clients based on the data instance identifier, wherein the common data instance identifier instructs the client to determine the first training set and the second training set.

[0028] According to one embodiment of the present application, after the step of informing the client to perform node splitting based on the target splitting scheme, the method further includes the steps of obtaining the updated training node, stopping training and generating a target federated learning model if it is determined that the updated training node satisfies a training stop condition, and obtaining a validation set and validating the target federated learning model in cooperation with a validation client, which is one of the clients participating in the training of the federated learning model.

[0029] According to one embodiment of the present application, the step of verifying the target model in cooperation with a validation client based on the validation set includes the steps of: sending a data instance identifier in the validation set and split information of a validation node to the validation client, where the validation node is a node of one of a plurality of boosting trees; receiving a node progression direction corresponding to the validation node sent from the validation client, where the node progression direction is determined by the validation client based on the data instance identifier and the split information; entering a next node based on the node progression direction and setting the next node as the updated validation node; and if the updated validation node satisfies the preset node split condition, returning to sending the data instance identifier and the split information to the validation client until all data instance identifiers in the validation set are verified.

[0030] According to one embodiment of the present application, the method further includes determining that the updated verification node is a leaf node if the updated verification node does not satisfy the preset node splitting condition, and obtaining a model predicted value of the data instance represented by the data instance identifier.

[0031] According to one embodiment of the present application, when all data instance identifiers in the validation set are validated, the method further includes the steps of: sending a model prediction value of the data instance to the validation client; receiving validation instruction information sent from the validation client, the validation instruction information being instruction information obtained based on the model prediction value and for instructing whether to suspend the model; and determining whether to suspend and use the target associative learning model based on the validation instruction information, and sending the decision result to the client.

[0032] According to one embodiment of the present application, the step of obtaining a target partitioning scheme corresponding to the training node includes the steps of: performing horizontal federated learning in cooperation with the client based on a first training set to obtain a first partitioning value corresponding to the training node; performing vertical federated learning in cooperation with the client based on a second training set to obtain a second partitioning value corresponding to the training node; and determining a target partitioning scheme corresponding to the training node based on the first partitioning value and the second partitioning value.

[0033] According to one embodiment of the present application, the step of determining a target splitting method corresponding to the training node based on the first split value and the second split value includes the step of determining the larger of the first split value and the second split value as a target splitting value corresponding to the training node, and the step of determining a splitting method corresponding to the training node based on the target splitting value.

[0034] According to one embodiment of the present application, the step of performing horizontal federated learning in cooperation with the client based on the first training set to obtain a first split value corresponding to the training node includes the steps of generating a first feature subset available to the training node from the first training set and transmitting it to the client, receiving feature values ​​of each feature in the first feature subset transmitted from the client, determining horizontal split values ​​corresponding to each of the features as split feature points based on the feature values ​​of each feature in the first feature subset, and determining the first split value of the training node based on the horizontal split values ​​corresponding to each of the features.

[0035] According to one embodiment of the present application, the step of determining a horizontal splitting value corresponding to each feature in the first feature subset as a splitting feature point based on the feature value of each feature includes: for any one feature in the first feature subset, determining a splitting threshold for the any one feature based on the feature value of the any one feature; obtaining a first data instance identifier set and a second data instance identifier set corresponding to the any one feature based on the splitting threshold, wherein the first data instance identifier set includes data instance identifiers belonging to a first left subtree space and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space; and determining the horizontal splitting value corresponding to the any one feature based on the first data instance identifier set and the second data instance identifier set.

[0036] According to one embodiment of the present application, the step of obtaining a first data instance identifier set and a second data instance identifier set corresponding to the one of the features based on the splitting threshold includes the steps of sending the splitting threshold to the client; receiving an initial data instance identifier set corresponding to the training node sent from the client, where the initial data instance identifier set is generated when the client performs node splitting on the one of the features based on the splitting threshold, and the initial data instance identifier set includes data instance identifiers belonging to the first left subtree space; and obtaining the first data instance identifier set and the second data instance identifier set based on the initial data instance identifier set and all data instance identifiers.

[0037] According to an embodiment of the present application, the step of performing vertical association learning in cooperation with the client based on the second training set to obtain a second split value corresponding to the training node includes the steps of: informing the client to perform vertical association learning based on the second training set; receiving first gradient information of at least one third data instance identifier set for each feature sent from the client, the third data instance identifier set including data instance identifiers belonging to a second left subtree space, the second left subtree space being a left subtree space formed by splitting according to one of the feature values ​​of the features, and different feature values ​​corresponding to different second left subtree spaces; determining a vertical split value for each feature based on the first gradient information for each feature and total gradient information of the training node; and determining the second split value of the training node based on the vertical split value corresponding to each feature.

[0038] According to an embodiment of the present application, the step of determining a vertical split value of each feature based on the first gradient information of each feature and total gradient information of the training node includes: for each feature, obtaining second gradient information corresponding to each first gradient information based on the total gradient information and each first gradient information; for each first gradient information, obtaining a candidate vertical split value of the one feature based on the first gradient information and the second gradient information corresponding to the first gradient information; and selecting a maximum value of the candidate vertical split values ​​as the vertical split value of the one feature.

[0039] According to one embodiment of the present application, the validation set is mutually exclusive with the first training set and the second training set, respectively.

[0040] An embodiment of the first aspect of the present application provides a method for training a federated learning model, in which a server automatically selects the tendency of a matching learning method by mixing a horizontal partitioning method and a vertical partitioning method, without paying attention to the data distribution method, thereby solving the problems existing in the traditional training process of the federated learning model, such as not being able to fully utilize all data for learning, and poor training effect due to insufficient data utilization, and reducing the loss of the federated learning model and improving the performance of the federated learning model.

[0041] In order to achieve the above object, an embodiment of a second aspect of the present application provides a training method for a federated learning model applied to a client, the method including: receiving a target splitting scheme sent from a server when it is determined that a training node satisfies a preset splitting condition, the training node being a node of one boosting tree among a plurality of boosting trees; and performing node splitting on the training node based on the target splitting scheme.

[0042] According to one embodiment of the present application, before the step of performing node splitting on the training node based on the target splitting scheme, the method further includes the steps of performing horizontal association learning based on a first training set to obtain a first split value corresponding to the training node, performing vertical association learning based on a second training set to obtain a second split value corresponding to the training node, and sending the first split value and the second split value to the server.

[0043] According to one embodiment of the present application, the step of performing horizontal federated learning based on the first training set to obtain a first split value corresponding to the training node includes the steps of receiving a first feature subset available to the training node generated from the first training set by the server; transmitting feature values ​​of each feature in the first feature subset to the server; receiving a split threshold for each feature transmitted from the server; obtaining an initial data instance identifier set corresponding to the training node based on the split threshold for each feature, and transmitting the initial data instance identifier set to the server, where the initial data instance identifier set instructs the server to generate a first data instance identifier set and a second data instance identifier set, both of which include data instance identifiers belonging to a first left subtree space, and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space.

[0044] According to one embodiment of the present application, the step of obtaining an initial data instance identifier set corresponding to the training node based on a splitting threshold for each of the features includes, for any one of the features, respectively comparing the splitting threshold for the any one of the features with a feature value of the any one of the features, and obtaining data instance identifiers whose feature values ​​are smaller than the splitting threshold to generate the initial data instance identifier set.

[0045] According to an embodiment of the present application, before the step of performing vertical federated learning based on the second training set to obtain a second split value corresponding to the training node, the method further includes the steps of receiving a gradient information request sent from the server; generating a second feature subset from the second training set based on the gradient information request; obtaining first gradient information of at least one third data instance identifier set for each feature in the second feature subset, where the third data instance identifier set includes data instance identifiers belonging to a second left subtree space, the second left subtree space is a left subtree space formed by splitting according to one of the feature values ​​of the features, and different feature values ​​correspond to different second left subtree spaces; and sending the first gradient information of the third data instance identifier set to the server.

[0046] According to one embodiment of the present application, the step of obtaining first gradient information of at least one third data instance identifier set for each feature in the second feature subset includes, for any one feature, obtaining all feature values ​​of the any one feature and packetizing the any one feature based on the feature values; and obtaining first gradient information of the third data instance identifier set for each packet of the any one feature.

[0047] According to one embodiment of the present application, the step of performing node splitting on the training node based on the target splitting scheme includes a step of receiving splitting information sent from the server, the splitting information including the target splitting scheme, target split features selected as feature split points, and the target split values, and a step of performing node splitting on the training node based on the splitting information.

[0048] According to an embodiment of the present application, after the step of performing node splitting on the training node, the method further includes the step of sending the left subtree space generated by the splitting to the server.

[0049] According to an embodiment of the present application, when the training node is a leaf node, the method includes the steps of receiving a weight value of the leaf node sent from the server; determining a residual of each data included in the leaf node based on the weight value of the leaf node; and setting the residual as a residual input of a next boosting tree.

[0050] According to one embodiment of the present application, after the step of performing node splitting on the training node based on the target splitting scheme, the method further includes a step of receiving a validation set sent from the server and validating the target federated learning model based on the validation set.

[0051] According to one embodiment of the present application, the step of verifying the target model in cooperation with a verification client based on the validation set includes the steps of receiving a data instance identifier in the validation set and split information of a verification node sent from the server, where the validation node is a node of one of a plurality of boosting trees; determining a node progression direction of the verification node based on the data instance identifier and the split information; and sending the node progression direction to the server, so that the server enters a next node based on the node progression direction and makes the next node the updated validation node.

[0052] According to one embodiment of the present application, the step of determining a node progression direction of the verification node based on the data instance identifier and the splitting information includes the steps of determining, based on the data instance identifier, feature values ​​of each feature corresponding to the data instance identifier, and determining the node progression direction based on the splitting information and the feature values ​​of each feature.

[0053] According to one embodiment of the present application, when all data instance identifiers in the validation set have been validated, the method further includes the steps of receiving a model prediction value of the data instance represented by the data instance identifier sent from the server, obtaining a final validation result based on the model prediction value, and generating validation instruction information for instructing whether to reserve and use the target associative learning model by comparing the validation result with a previous validation result, and sending the validation instruction information to the server.

[0054] According to one embodiment of the present application, before the step of performing node splitting on the training node based on the target splitting scheme, the method further includes the steps of performing horizontal association learning based on a first training set to obtain a first split value corresponding to the training node, performing vertical association learning based on a second training set to obtain a second split value corresponding to the training node, and sending the first split value and the second split value to the server.

[0055] According to an embodiment of the present application, the step of performing horizontal federated learning based on the first training set to obtain a first split value corresponding to the training node further includes the steps of receiving a first feature subset available to the training node generated from the first training set by the server; transmitting feature values ​​of each feature in the first feature subset to the server; receiving a split threshold for each feature transmitted from the server; obtaining an initial data instance identifier set corresponding to the training node based on the split threshold for each feature, and transmitting the initial data instance identifier set to the server, wherein the initial data instance identifier set instructs the server to generate a first data instance identifier set and a second data instance identifier set, both of which include data instance identifiers belonging to a first left subtree space, and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space.

[0056] According to one embodiment of the present application, the step of obtaining an initial data instance identifier set corresponding to the training node based on a splitting threshold for each of the features includes, for any one of the features, respectively comparing the splitting threshold for the any one of the features with a feature value of the any one of the features, and obtaining data instance identifiers whose feature values ​​are smaller than the splitting threshold to generate the initial data instance identifier set.

[0057] According to an embodiment of the present application, before the step of performing vertical federated learning based on the second training set to obtain a second split value corresponding to the training node, the method further includes the steps of receiving a gradient information request sent from the server; generating a second feature subset from the second training set based on the gradient information request; obtaining first gradient information of at least one third data instance identifier set for each feature in the second feature subset, where the third data instance identifier set includes data instance identifiers belonging to a second left subtree space, the second left subtree space is a left subtree space formed by splitting according to one of the feature values ​​of the features, and different feature values ​​correspond to different second left subtree spaces; and sending the first gradient information of the third data instance identifier set to the server.

[0058] According to one embodiment of the present application, the step of obtaining first gradient information of at least one third data instance identifier set for each feature in the second feature subset includes, for any one feature, obtaining all feature values ​​of the any one feature and packetizing the any one feature based on the feature values; and obtaining first gradient information of the third data instance identifier set for each packet of the any one feature.

[0059] An embodiment of the second aspect of the present application provides a training method for a federated learning model, in which a client receives a target splitting scheme sent from a server when it is determined that a training node, which is a node of one of a plurality of boosted trees, satisfies a preset splitting condition, and performs node splitting on the training node based on the target splitting scheme, thereby mixing horizontal and vertical splitting schemes to automatically select the tendency of a matching learning scheme, without worrying about the data distribution scheme. This solves the problems that exist in the training process of the traditional federated learning model, such as not being able to fully utilize all data for learning, and the poor training effect due to insufficient data utilization, and reduces the loss of the federated learning model, and improves the performance of the federated learning model.

[0060] In order to achieve the above object, an embodiment of a third aspect of the present application provides a training apparatus for a federated learning model applied to a server, the training apparatus for the federated learning model comprising: an acquisition module for acquiring a target splitting scheme corresponding to a training node when the training node satisfies a preset splitting condition, the training node being a node of one boosted tree among a plurality of boosted trees; a notification module for notifying a client to perform node splitting based on the target splitting scheme; a first training module for performing a next round of training using a left subtree node generated by splitting the training node as the new training node until the updated training node no longer satisfies the preset splitting condition; a second training module for performing a next round of training using another non-leaf node of the one boosted tree as the new training node; and a generation module for stopping training and generating a target federated learning model when the node datasets of the plurality of boosted trees are all empty.

[0061] According to one embodiment of the present application, the acquisition module includes a first learning submodule for performing horizontal associative learning in cooperation with the client based on a first training set to obtain a first split value corresponding to the training node, a second learning submodule for performing vertical associative learning in cooperation with the client based on a second training set to obtain a second split value corresponding to the training node, and a determination submodule for determining a target split method corresponding to the training node based on the first split value and the second split value.

[0062] According to one embodiment of the present application, the determination submodule includes a first determination unit for determining the larger of the first division value and the second division value as a target division value corresponding to the training node, and a second determination unit for determining a division method corresponding to the training node based on the target division value.

[0063] According to one embodiment of the present application, the first learning submodule includes a generating unit for generating a first feature subset available for the training node from the first training set and transmitting the first feature subset to the client; a first receiving unit for receiving feature values ​​of each feature in the first feature subset transmitted from the client; a third determination unit for determining horizontal split values ​​corresponding to the cases where each feature is used as a split feature point based on the feature values ​​of each feature in the first feature subset; and a fourth determination unit for determining the first split value of the training node based on the horizontal split value corresponding to each feature.

[0064] According to one embodiment of the present application, the third determination unit includes: a first determination subunit for determining, for any one feature in the first feature subset, a splitting threshold for the any one feature based on a feature value of the any one feature; a first acquisition subunit for acquiring a first data instance identifier set and a second data instance identifier set corresponding to the any one feature based on the splitting threshold, wherein the first data instance identifier set includes data instance identifiers belonging to a first left subtree space and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space; and a second determination subunit for determining the horizontal splitting value corresponding to the any one feature based on the first data instance identifier set and the second data instance identifier set.

[0065] According to one embodiment of the present application, the first acquisition subunit further sends the splitting threshold to the client and receives an initial data instance identifier set corresponding to the training node sent from the client, where the initial data instance identifier set is generated when the client performs node splitting for any one of the features based on the splitting threshold, where the initial data instance identifier set includes data instance identifiers belonging to the first left subtree space, and acquires the first data instance identifier set and the second data instance identifier set based on the initial data instance identifier set and all data instance identifiers.

[0066] According to one embodiment of the present application, the acquisition subunit further compares each data instance identifier in the initial data instance identifier set with the data instance identifier of the client to acquire data instance identifiers in which anomalies exist, pre-processes the data instance identifiers in which anomalies exist to acquire the first data instance identifier set, and acquires the second data instance identifier set based on all data instance identifiers and the first data instance identifier set.

[0067] According to an embodiment of the present application, the second learning submodule includes: a notification unit for notifying the client to perform vertical association learning based on the second training set; a receiving unit for receiving first gradient information of at least one third data instance identifier set of each feature sent from the client, where the third data instance identifier set includes data instance identifiers belonging to a second left subtree space, the second left subtree space is a left subtree space formed by dividing according to one of the feature values ​​of the features, and different feature values ​​correspond to different second left subtree spaces; a fifth determination unit for respectively determining a vertical division value of each feature based on the first gradient information of each feature and total gradient information of the training node; and a sixth determination unit for determining the second division value of the training node based on the vertical division value corresponding to each feature.

[0068] According to one embodiment of the present application, the fifth determination unit includes: a second acquisition subunit for acquiring, for any one of the features, second gradient information corresponding to each of the first gradient information based on the total gradient information and each of the first gradient information; a third acquisition subunit for acquiring, for each of the first gradient information, candidate vertical division values ​​of the any one of the features based on the first gradient information and second gradient information corresponding to the first gradient information; and a selection subunit for selecting a maximum value among the candidate vertical division values ​​as the vertical division value of the any one of the features.

[0069] According to an embodiment of the present application, the first gradient information includes a sum of first-order gradients of features corresponding to data instances belonging to the second left subtree space and a sum of second-order gradients of features corresponding to data instances belonging to the second left subtree space, and the second gradient information includes a sum of first-order gradients of features corresponding to data instances belonging to the second right subtree space and a sum of second-order gradients of features corresponding to data instances belonging to the second right subtree space.

[0070] According to one embodiment of the present application, the method further includes a determination module for determining that the training node is a leaf node and obtaining a weight value of the leaf node if the training node does not satisfy a predetermined splitting condition, and a transmission module for transmitting the weight value of the leaf node to the client.

[0071] According to an embodiment of the present application, the determination module includes: a first acquisition unit for acquiring data instances belonging to the leaf node; and a second acquisition unit for acquiring primary gradient information and secondary gradient information of the data instances belonging to the leaf node, and acquiring a weight value of the leaf node based on the primary gradient information and the secondary gradient information.

[0072] According to an embodiment of the present application, the determination submodule further includes a sending unit for sending split information to the client, the split information including the target split method, the target split features selected as feature split points, and the target split values.

[0073] According to an embodiment of the present application, the sending unit further sends the partitioning information to a labeled client, receives a left subtree space set sent from the labeled client, partitions the second training set based on the left subtree space set, and associates the training node with an identifier of the labeled client.

[0074] According to one embodiment of the present application, the acquisition module further receives a data instance identifier sent from the client, determines a common data instance identifier between clients based on the data instance identifier, and instructs the client to use the common data instance identifier to determine the first training set and the second training set.

[0075] According to one embodiment of the present application, the notification module further obtains the updated training nodes, and the generation module further stops training and generates a target federated learning model if it is determined that the updated training nodes satisfy a training stop condition, and the apparatus further includes a verification module for obtaining a validation set and verifying the target federated learning model in cooperation with a verification client that is one of the clients participating in the training of the federated learning model.

[0076] According to one embodiment of the present application, the verification module includes: a first sending submodule for sending one data instance identifier in the verification set and split information of a verification node to the verification client, where the verification node is a node of one boosting tree among a plurality of boosting trees; a first receiving submodule for receiving a node progression direction corresponding to the verification node sent from the verification client, where the node progression direction is determined by the verification client based on the data instance identifier and the split information; a node updating submodule for entering a next node based on the node progression direction and making the next node the updated verification node; and a second sending submodule for returning to sending the data instance identifier and the split information to the verification client if the updated verification node satisfies the preset node split condition until all data instance identifiers in the validation set are verified.

[0077] According to one embodiment of the present application, the verification module further includes an acquisition submodule for determining that the updated verification node is a leaf node if the updated verification node does not satisfy the preset node splitting condition, and acquiring a model predicted value of the data instance represented by the data instance identifier.

[0078] According to one embodiment of the present application, the verification module further includes a third sending submodule for sending a model predicted value of the data instance to the verification client when all data instance identifiers in the verification set are verified; a second receiving submodule for receiving verification instruction information sent from the verification client, where the verification instruction information is instruction information for instructing whether to suspend a model, obtained based on the model predicted value; and a decision submodule for deciding whether to suspend and use the target associative learning model based on the verification instruction information, and sending the decision result to the client.

[0079] According to one embodiment of the present application, the acquisition module includes a first learning submodule for performing horizontal associative learning in cooperation with the client based on a first training set to obtain a first split value corresponding to the training node, a second learning submodule for performing vertical associative learning in cooperation with the client based on a second training set to obtain a second split value corresponding to the training node, and a determination submodule for determining a target split method corresponding to the training node based on the first split value and the second split value.

[0080] According to one embodiment of the present application, the determination submodule includes a first determination unit for determining the larger of the first division value and the second division value as a target division value corresponding to the training node, and a second determination unit for determining a division method corresponding to the training node based on the target division value.

[0081] According to one embodiment of the present application, the first learning submodule includes a sending unit for generating a first feature subset available to the training node from the first training set and sending the first feature subset to the client; a first receiving unit for receiving feature values ​​of each feature in the first feature subset sent from the client; a third determination unit for determining horizontal split values ​​corresponding to each of the features as split feature points based on the feature values ​​of each feature in the first feature subset; and a fourth determination unit for determining the first split value of the training node based on the horizontal split value corresponding to each of the features.

[0082] According to one embodiment of the present application, the third determination unit includes a first determination subunit for determining, for any one feature in the first feature subset, a splitting threshold for the any one feature based on a feature value of the any one feature; a first acquisition subunit for acquiring a first data instance identifier set and a second data instance identifier set corresponding to the any one feature based on the splitting threshold, wherein the first data instance identifier set includes data instance identifiers belonging to a first left subtree space and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space; and a second determination subunit for determining the horizontal splitting value corresponding to the any one feature based on the first data instance identifier set and the second data instance identifier set.

[0083] According to one embodiment of the present application, the first acquisition subunit further sends the splitting threshold to the client and receives an initial data instance identifier set corresponding to the training node sent from the client, where the initial data instance identifier set is generated when the client performs node splitting for any one of the features based on the splitting threshold, where the initial data instance identifier set includes data instance identifiers belonging to the first left subtree space, and acquires the first data instance identifier set and the second data instance identifier set based on the initial data instance identifier set and all data instance identifiers.

[0084] According to an embodiment of the present application, the second learning submodule includes: a notification unit for notifying the client to perform vertical association learning based on the second training set; a second receiving unit for receiving first gradient information of at least one third data instance identifier set of each feature sent from the client, the third data instance identifier set including data instance identifiers belonging to a second left subtree space, the second left subtree space being a left subtree space formed by dividing according to one of the feature values ​​of the features, and different feature values ​​corresponding to different second left subtree spaces; a fifth determination unit for respectively determining a vertical division value of each feature based on the first gradient information of each feature and total gradient information of the training node; and a sixth determination unit for determining the second division value of the training node based on the vertical division value corresponding to each feature.

[0085] According to one embodiment of the present application, the fifth determination unit includes: a second acquisition subunit for acquiring, for any one of the features, second gradient information corresponding to each of the first gradient information based on the total gradient information and each of the first gradient information; a third acquisition subunit for acquiring, for each of the first gradient information, candidate vertical division values ​​of the any one of the features based on the first gradient information and second gradient information corresponding to the first gradient information; and a selection subunit for selecting a maximum value among the candidate vertical division values ​​as the vertical division value of the any one of the features.

[0086] According to one embodiment of the present application, the validation set is mutually exclusive with the first training set and the second training set, respectively.

[0087] An embodiment of the third aspect of the present application provides a training apparatus for a federated learning model, in which the server automatically selects the tendency of a matching learning method by mixing a horizontal partitioning method and a vertical partitioning method, without paying attention to the data distribution method, thereby solving the problems existing in the training process of the traditional federated learning model, that is, not being able to fully utilize all data for learning, and the training effect being poor due to insufficient data utilization, and reducing the loss of the federated learning model and improving the performance of the federated learning model.

[0088] In order to achieve the above object, an embodiment of a fourth aspect of the present application provides a training apparatus for a federated learning model applied to a client, comprising: a first receiving module for receiving a target splitting scheme sent from a server when it is determined that a training node satisfies a preset splitting condition, where the training node is a node of one boosting tree among a plurality of boosting trees; and a splitting module for performing node splitting on the training node based on the target splitting scheme.

[0089] According to one embodiment of the present application, the division module includes a first learning sub-module for performing horizontal association learning based on a first training set to obtain a first division value corresponding to the training node, a second learning sub-module for performing vertical association learning based on a second training set to obtain a second division value corresponding to the training node, and a transmission sub-module for transmitting the first division value and the second division value to the server.

[0090] According to one embodiment of the present application, the first learning submodule includes: a first receiving unit for receiving a first feature subset available to the training node, generated from the first training set by the server; a first sending unit for sending feature values ​​of each feature in the first feature subset to the server; a second receiving unit for receiving a splitting threshold for each of the features sent from the server; and a first acquiring unit for obtaining an initial data instance identifier set corresponding to the training node based on the splitting threshold for each of the features, and sending the initial data instance identifier set to the server, where the initial data instance identifier set instructs a server to generate a first data instance identifier set and a second data instance identifier set, both of which include data instance identifiers belonging to a first left subtree space, and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space.

[0091] According to one embodiment of the present application, the first acquisition unit further compares, for any one feature, a division threshold of the any one feature with a feature value of the any one feature, respectively, to acquire data instance identifiers whose feature values ​​are smaller than the division threshold, thereby generating the initial data instance identifier set.

[0092] According to an embodiment of the present application, the second learning sub-module includes: a third receiving unit for receiving a gradient information request sent from the server; a generating unit for generating a second feature subset from a second training set based on the gradient information request; a second acquiring unit for acquiring first gradient information of at least one third data instance identifier set for each feature in the second feature subset, where the third data instance identifier set includes data instance identifiers belonging to a second left subtree space, the second left subtree space is a left subtree space formed by dividing according to one of the feature values ​​of the features, and different feature values ​​correspond to different second left subtree spaces; and a second sending unit for sending the first gradient information of the third data instance identifier set to the server.

[0093] According to one embodiment of the present application, the second acquisition unit includes, for any one feature, a packetization subunit for acquiring all feature values ​​of the any one feature and packetizing the any one feature based on the feature values, and a first acquisition subunit for acquiring first gradient information of the third data instance identifier set for each packet of the any one feature.

[0094] According to one embodiment of the present application, the splitting module includes a receiving sub-module for receiving splitting information sent from the server, where the splitting information includes the target splitting method, target splitting features selected as feature split points, and the target splitting values, and a splitting sub-module for performing node splitting on the training node based on the splitting information.

[0095] According to an embodiment of the present application, the splitting sub-module further sends the left subtree space generated by the splitting to the server.

[0096] According to an embodiment of the present application, when the training node is a leaf node, the training node further includes: a second receiving module for receiving a weight value of the leaf node sent from the server; a determination module for determining a residual of each data included in the leaf node based on the weight value of the leaf node; and an input module for setting the residual as a residual input of a next boosting tree.

[0097] According to an embodiment of the present application, the apparatus further comprises a validation module for receiving a validation set sent from the server, and validating the target associative learning model based on the validation set.

[0098] According to one embodiment of the present application, the verification module includes: a first receiving sub-module for receiving one data instance identifier in the verification set and split information of a verification node sent from the server, where the verification node is a node of one boosting tree among a plurality of boosting trees; a first determination sub-module for determining a node progression direction of the verification node based on the data instance identifier and the split information; and a first sending sub-module for sending the node progression direction to the server, so that the server enters a next node based on the node progression direction and makes the next node the updated verification node.

[0099] According to one embodiment of the present application, the first determination submodule includes: a first determination unit for determining, based on the data instance identifier, a feature value of each feature corresponding to the data instance identifier; and a second determination unit for determining the node progression direction based on the division information and the feature value of each feature.

[0100] According to one embodiment of the present application, the validation module further includes a second receiving submodule for receiving a model prediction value of a data instance represented by the data instance identifier sent from the server when all data instance identifiers in the validation set are validated; a generating submodule for obtaining a final validation result based on the model prediction value and generating validation instruction information for instructing whether to reserve and use the target associative learning model by comparing the validation result with a previous validation result; and a second sending submodule for sending the validation instruction information to the server.

[0101] According to one embodiment of the present application, the division module includes a first learning sub-module for performing horizontal association learning based on a first training set to obtain a first division value corresponding to the training node, a second learning sub-module for performing vertical association learning based on a second training set to obtain a second division value corresponding to the training node, and a third transmission sub-module for transmitting the first division value and the second division value to the server.

[0102] According to one embodiment of the present application, the first learning submodule includes: a first receiving unit for receiving a first feature subset available to the training node, generated from the first training set by the server; a first sending unit for sending feature values ​​of each feature in the first feature subset to the server; a second receiving unit for receiving a splitting threshold for each of the features sent from the server; and a first acquiring unit for obtaining an initial data instance identifier set corresponding to the training node based on the splitting threshold for each of the features, and sending the initial data instance identifier set to the server, where the initial data instance identifier set instructs a server to generate a first data instance identifier set and a second data instance identifier set, both of which include data instance identifiers belonging to a first left subtree space, and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space.

[0103] According to one embodiment of the present application, the first acquisition unit further compares, for any one feature, a division threshold of the any one feature with a feature value of the any one feature, respectively, to acquire data instance identifiers whose feature values ​​are smaller than the division threshold, thereby generating the initial data instance identifier set.

[0104] According to an embodiment of the present application, the second learning sub-module includes: a third receiving unit for receiving a gradient information request sent from the server; a generating unit for generating a second feature subset from a second training set based on the gradient information request; a second acquiring unit for acquiring first gradient information of at least one third data instance identifier set for each feature in the second feature subset, where the third data instance identifier set includes data instance identifiers belonging to a second left subtree space, the second left subtree space is a left subtree space formed by dividing according to one of the feature values ​​of the features, and different feature values ​​correspond to different second left subtree spaces; and a second sending unit for sending the first gradient information of the third data instance identifier set to the server.

[0105] According to one embodiment of the present application, the second acquisition unit includes, for any one feature, a packetization subunit for acquiring all feature values ​​of the any one feature and packetizing the any one feature based on the feature values, and a second acquisition subunit for acquiring first gradient information of the third data instance identifier set for each packet of the any one feature.

[0106] An embodiment of the fourth aspect of the present application provides a training device for a federated learning model, in which a client receives a target splitting scheme sent from a server when it is determined that a training node, which is a node of one of a plurality of boosting trees, satisfies a preset splitting condition, and performs node splitting on the training node based on the target splitting scheme, thereby mixing horizontal and vertical splitting schemes to automatically select the tendency of a matching learning scheme, without worrying about the data distribution scheme. This solves the problems that exist in the training process of the traditional federated learning model, such as not being able to fully utilize all data for learning, and the poor training effect due to insufficient data utilization, and reduces the loss of the federated learning model, and improves the performance of the federated learning model.

[0107] In order to achieve the above object, an embodiment of a fifth aspect of the present application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, realizes a method for training an associative learning model described in any one of the embodiments of the first aspect of the present application or the embodiments of the third aspect of the present application.

[0108] To achieve the above object, an embodiment of a sixth aspect of the present application provides a computer-readable storage medium, which, when executed by a processor, realizes a method for training an associative learning model described in any one of the embodiments of the first aspect of the present application or the embodiments of the third aspect of the present application. [Brief description of the drawings]

[0109] [Figure 1] FIG. 2 is a schematic diagram of an application scenario of federated learning provided by an embodiment of the present application; [Diagram 2] 1 is a schematic flowchart of a method for training a federated learning model disclosed according to an embodiment of the present application; [Diagram 3] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 4] FIG. 2 is a schematic diagram of a data distribution disclosed according to an embodiment of the present application; [Diagram 5] FIG. 2 is a schematic diagram of node splitting disclosed according to an embodiment of the present application; [Figure 6] FIG. 2 is a schematic diagram of a data distribution disclosed according to an embodiment of the present application; [Figure 7] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 8] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 9]1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 10] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 11] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 12] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 13] FIG. 2 is a schematic diagram of packetization according to a bucket mapping rule disclosed by an embodiment of the present application; [Figure 14] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 15] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 16] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 17] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 18] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 19] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 20] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 21] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 22] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Diagram 23] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 24] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Diagram 25] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 26] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 27] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 28] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Figure 29] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Diagram 30] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Diagram 31] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Diagram 32] 1 is a schematic flowchart of a method for training an associative learning model disclosed according to another embodiment of the present application. [Diagram 33] FIG. 1 is a schematic structural diagram of a training apparatus for a federated learning model disclosed by an embodiment of the present application; [Diagram 34] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Diagram 35] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Diagram 36] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Figure 37] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Figure 38] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Figure 39] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Diagram 40] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Diagram 41] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Diagram 42] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Diagram 43] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Diagram 44] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Diagram 45] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Figure 46] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Figure 47] FIG. 1 is a schematic structural diagram of a training apparatus for an associative learning model disclosed by another embodiment of the present application; [Figure 48] FIG. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0110] In order to better understand the above technical solution, the following will more specifically describe exemplary embodiments of the present disclosure with reference to the drawings. Although exemplary embodiments of the present disclosure are disclosed in the drawings, it should be understood that the present disclosure can be realized in various forms and should not be limited to the embodiments described herein. Rather, these embodiments are provided to more fully understand the present disclosure and fully convey the scope of the present disclosure to those skilled in the art.

[0111] It should be understood that "and / or" in the embodiments of the present application describes the relation between related objects and indicates that three kinds of relations may exist. For example, A and / or B can indicate that A exists alone, that A and B exist simultaneously, or that B exists alone, where A and B may be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship.

[0112] First, some terms used in the embodiments of the present application will be explained.

[0113] Homogeneous data: Data records owned by different data providers have the same feature attributes.

[0114] Heterogeneous Data: Data records owned by different data providers only have the same data instance identifier (ID) and all other characteristic attributes are different.

[0115] XGBoost: Abbreviated as XGB, it is a machine learning system that uses scalable boosting trees.

[0116] Before describing the technical solution of the present application, the following will first draw out the problems existing in the prior art and the technical concept of the present application in accordance with one specific application scenario of the present application.

[0117] In practical applications, it is difficult to completely ensure that all of the multiple data that cooperate in associative learning are heterogeneous or homogeneous, so when associative learning training is performed using a boosting tree, some homogeneous or heterogeneous data must be discarded before horizontal associative learning or vertical associative learning can be adopted. However, since a large amount of discarded data is used, the performance of the model obtained based on the associative learning training is poor. Furthermore, even if horizontal associative learning or vertical associative learning is used, the label of the data must exist on a specific side and cannot exist randomly on multiple sides, which is practically impossible, and therefore the prior art also limits the practical application of associative learning.

[0118] In response to the above problems, the inventor has found through research that by utilizing an associative learning design that combines horizontal associative learning and vertical associative learning, the problem that traditional associative learning requires attention to the data distribution method can be solved, and the problem that not all data can be fully utilized for learning can also be solved. At the same time, the problem that the effectiveness of the trained model is poor due to insufficient data utilization can also be solved.

[0119] According to the design of the solution, when there is a lot of heterogeneous data, the solution tends to use the method of vertical association learning (i.e., vertical boosting tree), so that the trained model has the characteristic of losslessness and can also use homogeneous data; when there is a lot of homogeneous data, the solution tends to use the method of horizontal association learning (i.e., horizontal boosting tree), and heterogeneous data is used to train the model, so that the trained model has the ability of vertical losslessness, improving the model performance.

[0120] Illustratively, Fig. 1 is a schematic diagram of an application scenario of the model training method based on federated learning provided by the present application. As shown in Fig. 1, the application scenario may include at least one client (three clients, namely client 111, client 112, and client 113, are shown in Fig. 1), a network 12, and a server 13. Here, each client and the server 13 can communicate with each other via the network 12.

[0121] It should be noted that Fig. 1 is merely a schematic diagram of an application scenario provided by an embodiment of the present application, and the embodiment of the present application does not limit the devices included in Fig. 1, nor does it limit the positional relationship between the devices in Fig. 1. For example, the application scenario shown in Fig. 1 may further include a data storage device, which may be an external memory to the server 13, or an internal memory integrated in the server 13.

[0122] The present application provides a model training method, device and storage medium based on associative learning, and improves the performance of the trained model by a design that combines horizontal associative learning and vertical associative learning. The technical solution of the present application is described in detail below through specific examples. It should be noted that some of the following examples can be combined with each other, and the same or similar concepts or processes may be omitted in some examples.

[0123] Hereinafter, a method, apparatus and electronic device for training an associative learning model provided by an embodiment of the present application will be described with reference to the drawings.

[0124] FIG. 2 is a schematic flowchart of a method for training a federated learning model disclosed according to an embodiment of the present application.

[0125] As shown in FIG. 2, the training method for the federated learning model proposed in the embodiment of the present application is described with the server as the execution entity, and specifically includes the following steps S201 to S205.

[0126] S201, when a training node satisfies a preset splitting condition, obtain a target splitting method corresponding to the training node, and the training node is a node of one boosting tree among a plurality of boosting trees.

[0127] In the embodiment of the present application, if the training node meets the preset splitting condition, it indicates that the current training node needs to be further split, and in such a case, a target splitting method corresponding to the training node can be obtained.

[0128] Here, the preset splitting condition can be set according to the actual situation. For example, the preset splitting condition can be set as follows: the level where the currently processed training node is located does not meet the maximum tree depth requirement, the loss function does not meet the promise condition, etc.

[0129] Here, the target division method includes a horizontal division method and a vertical division method.

[0130] Here, the Boosting Tree refers to a boosting method that uses an additive model and a forward distribution algorithm and uses a decision tree as a basis function.

[0131] S202, notifying the client to perform node splitting based on a target splitting method.

[0132] In an embodiment of the present application, after the target splitting scheme corresponding to the training node is obtained, the server can send the obtained target splitting scheme to the client and notify the client to perform node splitting according to the target splitting scheme. Correspondingly, the client can receive the target splitting scheme of the server and perform node splitting for the training node according to the target splitting scheme.

[0133] S203: The training node is divided, and the left subtree node generated is used as a new training node to perform the next round of training until the updated training node no longer satisfies the preset division condition.

[0134] In an embodiment of the present application, the server may perform the next round of training using the left subtree node generated by splitting the training node as a new training node, and may determine whether the level of the updated training node satisfies a preset splitting condition, and when it is determined that the updated training node needs to be further split, i.e., when the preset splitting condition is satisfied, may notify the client to continue to obtain a target splitting scheme corresponding to the updated training node and continue to split the node based on the target splitting scheme until the updated training node no longer satisfies the preset splitting condition. Here, the preset splitting condition may include a tree depth threshold, a threshold for the number of samples after splitting, or an error threshold for the federated learning model, etc.

[0135] S204: The other non-leaf nodes of one boosting tree are newly set as training nodes for the next round of training.

[0136] In an embodiment of the present application, the server can go back to another non-leaf node of the current boosted tree and perform the next round of training as the new current training node.

[0137] S205, if the node data sets of the multiple boosting trees are all empty, stop training and generate a target association learning model.

[0138] In the embodiment of the present application, when the node data sets of the multiple boosting trees are all empty, the training can be stopped and a target association learning model can be generated. Furthermore, the generated target association learning model can be verified, and after a preset number of training times, the information can be cleaned up and the model can be suspended.

[0139] As a result, in the training method for the federated learning model provided by the present application, the server can automatically select the tendency of the matching learning method by mixing the horizontal partitioning method and the vertical partitioning method, without worrying about the data distribution method, which solves the problems existing in the training process of the traditional federated learning model, that is, not being able to fully utilize all the data for learning, and the poor training effect due to insufficient data utilization, and also reduces the loss of the federated learning model and improves the performance of the federated learning model.

[0140] In addition, in this application, when attempting to obtain a target splitting method corresponding to a training node, the corresponding split value can be obtained by collaborating with a client to perform federated learning, and then the target splitting method corresponding to the training node can be determined based on the split value.

[0141] As one possible implementation, as shown in FIG. 3, based on the above embodiment, in the above steps, the process of obtaining a target division scheme corresponding to a training node specifically includes the following steps S301 to S303.

[0142] S301, based on a first training set, cooperate with a client to perform horizontal federated learning to obtain a first divided value corresponding to a training node.

[0143] In addition, when the training node needs to be further split, a splitting method needs to be determined, i.e., horizontal or vertical splitting. For most nodes, two candidate splits are performed, one horizontal and one vertical, and then the splitting method with the larger splitting gain among the two candidate splits is selected as the final splitting method for the node.

[0144] When making a pre-determination, if a node satisfies the following conditions, only one of the vertical and horizontal divisions is performed and the result is directly used as the final division result. (1) The deeper the tree, the smaller the total number of samples that need to be split on a node. The ratio of common samples among the samples on a node is determined, and if it is smaller than a preset value, e.g., 10%, it indicates that the number of common samples is extremely small, and the data distribution situation on the node is treated as a horizontal distribution process, and only horizontal splitting can be performed. (2) If the proportion of common samples in samples on a node is greater than a preset value, e.g., 98%, then vertical splitting can only be performed.

[0145] Note that the above two pre-determination conditions are set to save training time, and the two proportions can be set by the training parameters.

[0146] Below, data relating to two types of division methods, horizontal division and vertical division, will be explained.

[0147] For example, as shown in Figure 4, there are a total of 10,000 samples to be trained, and there are 100 samples when a node with a split is reached. At this time, the data distribution is as follows: 70 of the 100 samples are common samples of the two platforms. Platform A has 90 samples (including 20 private samples and 70 shared samples), and platform B has 80 samples (including 10 private samples and 70 shared samples). Platform A has 18 features (including 10 private features and 8 shared features), and platform B has 18 features (including 10 private features and 8 shared features).

[0148] For horizontal partitioning, all samples of the node participate in the partition, and multiple candidate features and feature thresholds are selected by the server.

[0149] For a common feature f and a possible value v, platform A assigns 90 local samples to the left and right subtrees, and platform B assigns 80 local samples to the left and right subtrees. Each platform informs the server of the sample splitting status. The server calculates the splitting gain based on the left and right splitting of the 100 samples, and sets it as the gain of feature f.

[0150] For platform A's private feature f and possible values ​​v, platform A assigns 90 local samples to the left and right subtrees, platform B assigns 70 local common samples to the left and right subtrees, and assigns all 10 samples without possible values ​​of feature f to the left subtree or the right subtree, resulting in two types of splitting. The server is notified of the sample splitting status, and the server calculates the splitting gain based on the two types of splitting of the 100 samples, and the larger one is the gain of feature f.

[0151] Similarly as above for platform B's private feature f and possible values ​​v.

[0152] The server records the maximum gain value of all features as gain1.

[0153] For vertical splitting, only the 70 common samples of the node participate in the splitting. As in normal vertical association learning, we calculate the maximum feature splitting gain gain2 among the 70 samples.

[0154] The larger of the two gains, gain1, the maximum gain of horizontal division, and gain2, the maximum gain of vertical division, is taken, and the node is divided using the corresponding division method. Enter the next node.

[0155] Regardless of whether the method is horizontal or vertical splitting, the node sample set is split according to the following rule: the maximum gain is from the local feature f1 of platform A, the maximum gain is from the common feature f2, and the maximum gain is from the local feature f3 of platform B.

[0156] For example, as shown in Fig. 5(a), when a node is divided according to f1, the 90 samples of A are divided into samples whose possible feature values ​​are less than or equal to the threshold on the left and those whose possible feature values ​​are greater than the threshold on the right; the 10 samples of B have no feature values, and according to the method corresponding to the maximum gain, if the missing value samples belong to the right subtree, the 10 samples are divided into right and if the missing value samples belong to the left subtree, the 10 samples are divided into left.

[0157] As shown in FIG. 5(b), when a node is divided according to f2, all samples have feature values, and samples below the threshold are divided to the left and samples above the threshold are divided to the right.

[0158] As shown in FIG. 5(c), when a node is divided according to f3, the specific process is similar to the process when a node is divided according to f1, and therefore a detailed description is omitted.

[0159] In an embodiment of the present application, the client can perform horizontal federated learning based on the first training set to obtain a first divided value corresponding to the training node, and send it to the server. In response, the server can obtain the first divided value corresponding to the training node by receiving the first divided value corresponding to the training node.

[0160] S302, according to the second training set, perform vertical federated learning in cooperation with the client to obtain a second split value corresponding to the training node.

[0161] In an embodiment of the present application, the client can perform horizontal federated learning based on the second training set to obtain a second divided value corresponding to the training node, and send it to the server. In response, the server can obtain the second divided value corresponding to the training node by receiving the second divided value corresponding to the training node.

[0162] S303, determining a target division method corresponding to the training node according to the first division value and the second division value.

[0163] Incidentally, conventional federated learning mainly includes horizontal federated learning and vertical federated learning. Here, for horizontal federated learning, multi-platform data with completely identical features, i.e. horizontal data, for example, data (1.2)+(3)+(5.1) shown in FIG. 6, is used, and for vertical federated learning, multi-platform data with completely identical sample IDs (identity documents, identification identifiers), i.e. vertical data, for example, data (2)+(3)+(4) shown in FIG. 6, is used. As can be seen from the above, the conventional technology can only model data that is completely horizontal or completely vertical, i.e., only a portion of the data in FIG. 6 above can be used.

[0164] In the embodiment of the present application, the first training set, which is the data participating in horizontal federated learning, is all data samples of multiple clients, for example, data (1)+(2)+(3)+(4)+(5) shown in Figure 6, and the second training set, which is the data participating in vertical federated learning, is a common data sample of multiple clients, and all the features of these samples participate in training, for example, (2)+(3)+(4) shown in Figure 6. As can be seen from the above, the training method of the federated learning model provided by the present application can be applied to horizontally and vertically intersecting data, that is, all the data shown in Figure 6 is used.

[0165] As a result, in an embodiment of the present application, based on the first training set and the second training set, horizontal associative learning and vertical associative learning can be performed in cooperation with a client to obtain the first divided value and the second divided value corresponding to the training node.

[0166] In addition, in the present application, when determining a target division method corresponding to a training node based on the first division value and the second division value, the target division value can be determined by comparing the first division value and the second division value, and then the corresponding target division method can be determined based on the target division value.

[0167] As one possible implementation form, as shown in FIG. 7, based on the above embodiment, in the above step S303, the process of determining a target division method corresponding to the training node based on the first division value and the second division value specifically includes the following steps S501 to S502.

[0168] S501, the larger one of the first division value and the second division value is determined as a target division value corresponding to the training node.

[0169] In an embodiment of the present application, after the server obtains the first division value and the second division value corresponding to the training node, it can compare the first division value and the second division value, and the larger one of them can be set as the target division value corresponding to the training node.

[0170] For example, the first division value obtained is Gain1, the second division value is Gain2, and Gain1>Gain2, in this case, Gain1 can be the target division value corresponding to the training node.

[0171] S502, determining a division scheme corresponding to a training node according to a target division value.

[0172] In an embodiment of the present application, after the larger of the first division value and the second division value is set as the target division value corresponding to the training node, the server can determine the division method corresponding to the training node based on the target division value.

[0173] As a result, the training method for the federated learning model provided by the present application works in cooperation with a client to perform horizontal federated learning and vertical federated learning to obtain a first division value and a second division value, respectively, and sets the larger of the possible values ​​as the target division value corresponding to the training node. Furthermore, by determining a division method corresponding to the training node based on the target division value, the tendency of the matching learning method can be automatically selected based on the target division value, without having to worry about the data distribution method.

[0174] In addition, in this application, when horizontal associative learning is performed in cooperation with a client based on a first training set to obtain a first division value corresponding to a training node, a horizontal division value corresponding to each feature is obtained, and the first division value of the training node can be determined based on the horizontal division value.

[0175] As one possible implementation form, as shown in FIG. 8, based on the above embodiment, in the above step S301, the process of performing horizontal federated learning in cooperation with a client based on the first training set to obtain a first division value corresponding to the training node specifically includes the following steps S601 to S604.

[0176] S601, a first feature subset available to a training node is generated from a first training set and sent to a client.

[0177] Optionally, the server can randomly generate a first feature subset available to the current training node from the first training set, for example, randomly generate half of all features in the current first training set to construct one new feature set as the first feature subset, and send the generated first feature subset to each client. Correspondingly, each client can receive the first feature subset, traverse based on the obtained first feature subset to obtain feature values ​​for each feature in the set, and further send to the server based on local data, i.e., the feature values ​​of the features stored locally.

[0178] S602, receiving feature values ​​for each feature in the first feature subset sent from the client.

[0179] In an embodiment of the present application, the client can transmit a feature value for each feature in the first feature subset to the server, and in response, the server can receive the feature value for each feature in the first feature subset transmitted from the client.

[0180] S603: based on the feature values ​​of each feature in the first feature subset, a horizontal division value corresponding to each feature as a division feature point is determined.

[0181] As one possible implementation form, as shown in FIG. 9 , based on the above embodiment, in the above step S603, the process of determining horizontal division values ​​corresponding to the cases where each feature is used as a division feature point based on the feature values ​​of each feature in the first feature subset specifically includes the following steps S701 to S702.

[0182] S701, for any one feature in the first feature subset, determine a splitting threshold for the any one feature based on a feature value of the any one feature.

[0183] In an embodiment of the present application, after receiving the feature values ​​of each feature in the first feature subset sent by the client, the server can generate a feature value list based on the feature values, and for any one feature in the first feature subset, can randomly select one feature value from the feature value list as the global optimal splitting threshold of the current feature.

[0184] S702: based on a splitting threshold, obtain a first data instance identifier set and a second data instance identifier set corresponding to any one of the features, where the first data instance identifier set includes data instance identifiers belonging to a first left subtree space, and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space.

[0185] As one possible implementation form, as shown in FIG. 10, based on the above embodiment, in the above step S702, the process of obtaining a first data instance identifier set and a second data instance identifier set corresponding to any one of the features based on the division threshold specifically includes the following steps S801 to S803.

[0186] S801: A division threshold value is transmitted to a client.

[0187] In an embodiment of the present application, after the splitting threshold of any one of the features is determined, the splitting threshold can be broadcast to the client. Correspondingly, the client can receive the splitting threshold, obtain a set of initial data instance identifiers corresponding to the training nodes according to the splitting threshold of each feature, and send the set of initial data instance identifiers to the server.

[0188] S802, receiving an initial data instance identifier set corresponding to a training node sent from a client, where the initial data instance identifier set is generated when the client performs node splitting for any one feature based on a splitting threshold, and the initial data instance identifier set includes data instance identifiers belonging to a first left subtree space.

[0189] In an embodiment of the present application, the server can receive the IL sent from the client, that is, the initial data instance identifier set IL including data instance identifiers belonging to the first left subtree space.

[0190] S803, obtaining a first data instance identifier set and a second data instance identifier set based on the initial data instance identifier set and all the data instance identifiers.

[0191] As one possible implementation form, as shown in FIG. 11, based on the above embodiment, in the above step S803, the process of obtaining a first data instance identifier set and a second data instance identifier set based on the initial data instance identifier set specifically includes the following steps S901 to S903.

[0192] S901, each data instance identifier in the initial data instance identifier set is compared with a data instance identifier of a client to obtain a data instance identifier in which an anomaly exists.

[0193] Here, the data instance identifier in which an anomaly exists may be a duplicate data instance identifier or a contradictory data instance identifier.

[0194] S902, pre-processing the data instance identifiers in which anomalies exist to obtain a first set of data instance identifiers.

[0195] In an embodiment of the present application, after the server receives the IL, it can eliminate duplicate instance IDs from each IL set and determine the final IL by processing the conflicting ID information.

[0196] For example, for client A, if you add an instance ID to the IL, whereas for client B, the ID exists but you did not add the instance, you can assume that this ID should be in the IL.

[0197] S903, obtaining a second data instance identifier set based on all the data instance identifiers and the first data instance identifier set.

[0198] In an embodiment of the present application, after the first data instance identifier set is obtained, the second data instance identifier set IR can be obtained by excluding the first data instance identifier set IL from all data instance identifiers.

[0199] In addition, in the present application, when vertical association learning is performed in cooperation with the client based on the second training set to obtain a second division value corresponding to the training node, the second division value of the training node can be determined based on the vertical division value corresponding to each feature.

[0200] As one possible implementation, as shown in FIG. 12, based on the above embodiment, in the above steps, the process of obtaining a target division scheme corresponding to a training node specifically includes the following steps S1001 to S1004.

[0201] S1001, notifying the client to perform vertical association learning based on the second training set.

[0202] In the embodiment of the present application, after the server informs the client to perform vertical federation learning based on the second training set, the server can send a gradient information request to the client to obtain Gkv and Hkv information. Correspondingly, the client can obtain the unprocessed data of the current node based on the data of the common ID part, randomly obtain a feature set, and perform packetization mapping for each sample based on each feature k in the set and each value v of all possible values ​​of the corresponding feature, to calculate the Gkv and Hkv of the left subtree space as the first gradient information, which can be sent to the server after homomorphic encryption processing.

number

[0203] For example, a group whose possible values ​​are 1 to 100 years old is mapped into three packets: under 20 years old, 20 to 50 years old, and over 50 years old. The samples in one packet are either all on the left or all on the right. In theory, G and H sent to the server are cumulative sums, and in the above example, the G sent should be the sum of G for ages 1 to 20, the sum of G for ages 1 to 50, and the sum of G for ages 1 to 100 (corresponding to G in the left subtree, respectively). Because the calculation of the ciphertext in homomorphic encryption is slow and the ciphertext may become longer, increasing the amount of communication, in reality, the G sent by the client is the sum of G for each of these three packets, that is, the sum of G for ages 1 to 20, the sum of G for ages 20 to 50, and the sum of G for ages 50 and above. After receiving the G of these three packets, the labeled platform first decrypts them into plaintext, and then calculates the accumulated G for ages 1 to 20, 1 to 50, and 1 to 100. The above two equations show this process, and the calculation of the sum of g for each packet. sk,v is the maximum possible value of the current packet (age 50), and sk,v-1 is the maximum possible value of the previous packet's feature (age 20), thus eliminating x between 20 and 50 years old. The packetization of features allows us to reduce the amount of computation.

[0204] S1002, receiving first gradient information of at least one third data instance identifier set for each feature sent from the client, where the third data instance identifier set includes data instance identifiers belonging to a second left subtree space, the second left subtree space is a left subtree space formed by dividing according to one of the feature values ​​of the feature, and different feature values ​​correspond to different second left subtree spaces.

[0205] In an embodiment of the present application, for any one feature, the client can obtain all feature values ​​of the any one feature, packetize the any one feature based on the feature values, and obtain first gradient information of a third data instance identifier set of each packet of the any one feature. Correspondingly, the server can receive the first gradient information of at least one third data instance identifier set of each feature sent from the client.

[0206] S1003, respectively determining a vertical split value for each feature according to the first gradient information of each feature and the total gradient information of the training node.

[0207] S1004, determining a second split value for the training node based on the vertical split value corresponding to each feature.

[0208] The gradient information is explained below by way of an example.

[0209] For example, as shown in Fig. 13, taking a feature numbered k in client A, all samples in the current node can be sorted and the possible feature values ​​of feature k can be sorted in ascending order. Furthermore, these samples can be divided into multiple data packets (corresponding to multiple feature thresholds from small to large) in order according to the bucket mapping rule. Furthermore, the sum G of the first-order gradients g and the sum H of the second-order gradients h of the samples contained in the vth packet can be calculated, i.e., Gkv and Hkv corresponding to the vth feature threshold v.

[0210] Here, Gkv represents the sum of the linear gradient g of all samples in the vth packet after sorting the node samples based on the possible values ​​of the feature number k and dividing them into multiple data packets in turn.

[0211] where Hkv is the sum of the quadratic gradients h of these samples.

[0212] In addition, there are multiple types of the bucket mapping rule mentioned above, and the present application does not limit the specific method of the bucket mapping rule, as long as samples with the same feature value, such as the two samples in Figure 11 each having a possible value of 1, are separated into the same data packet.

[0213] For example, samples with the same possible value can be grouped into one packet, i.e., n samples are split into m packets if there are m possible values ​​for a feature, and the corresponding feature thresholds are the m possible values.

[0214] Also, for example, the number of packets can be limited, for example, by limiting the number of packets to be divided into m packets as much as possible. In this case, if the number of possible values ​​of feature k is smaller than m, the packets can be divided according to the previous method, and if the number of possible values ​​is greater than m, the packets can be divided into m packets according to the method of approximately equal division.

[0215] When determining the vertical split value for each feature, the maximum value among the candidate vertical split values ​​can be selected as the vertical split value for any one of the features.

[0216] As one possible implementation, as shown in FIG. 14, based on the above embodiment, in the above step S1003, the process of respectively determining the vertical split value of each feature based on the first gradient information of each feature and the total gradient information of the training node specifically includes the following steps S1201 to S1203.

[0217] S1201: for any one feature, second gradient information corresponding to each piece of first gradient information is obtained based on total gradient information and each piece of first gradient information.

[0218] S1202: for each piece of first gradient information, a candidate vertical division value of any one of the features is obtained based on the first gradient information and second gradient information corresponding to the first gradient information.

[0219] S1203: The maximum value among the candidate vertical division values ​​is selected as the vertical division value of any one of the features.

[0220] Here, the first gradient information includes a sum of first-order gradients of features corresponding to data instances belonging to the second left subtree space and a sum of second-order gradients of features corresponding to data instances belonging to the second left subtree space, and the second gradient information includes a sum of first-order gradients of features corresponding to data instances belonging to the second right subtree space and a sum of second-order gradients of features corresponding to data instances belonging to the second right subtree space.

[0221] As one possible implementation, in the embodiment of the present application, the server requests each client to obtain Gkv and Hkv information. Correspondingly, the client obtains the unprocessed data of the current node based on the data of the common ID part, randomly obtains a feature set, and performs packet mapping for each sample based on each feature k in the set and each value v of all possible values ​​of the corresponding feature to calculate the Gkv and Hkv of the left subtree space, and sends them to the server after homomorphic encryption processing. In addition, the client can calculate some intermediate results of the loss function based on the common data identifier and local data, such as the first derivative gi and second derivative hi of the loss function, and send them to the server.

[0222] Furthermore, the server can decrypt the Gkv and Hkv sent by the client, and calculate the sum GL of all gi in the left subtree space of the current node, the sum GR of all gi in the right subtree space, the sum HL of all hi in the left subtree space, and the sum HR of all hi in the right subtree space based on the data corresponding to the common ID of the current node and all the obtained gi and hi.

[0223] Taking XGB as an example, the target function is as shown in the following formula.

number

[0224] XGB proposes to approximate the above equation using a second-order Taylor expansion. The second-order form of the Taylor expansion is as follows:

number

[0225] Here, the calculation formula for gi and hi is as follows:

number

[0226] As can be seen from the above Taylor expansion, gi is the first derivative and hi is the second derivative. Here, GL and HL can be calculated using the following formulas.

number

[0227] Here, n represents the number of instances in the left subtree space, i.e., in this case, the left subtree space has a total of n instances.

[0228] Furthermore, the server can calculate the optimal split point of each feature based on the above results, and then determine the global optimal split point (k, v, Gain) based on these split point information. Here, if several clients have the same feature, the server will randomly select one from the received Gkv to be the current feature Gkv, and similarly process Hkv.

[0229] Furthermore, the server can request IL information from the corresponding client according to (k,v,Gain). In response, the client receives the division point information (k,v,Gain), searches to obtain the division point threshold value, and records the division point (k,value) information. The client divides the local dataset according to the division point to obtain an IL set, and sends (record,IL,value) to the server, where record represents the index of the record in the client.

[0230] In addition, the server receives the (record,IL,value) information sent by the client, splits all common ID instances in the node space, and associates the current node with the client via (client id,record). It records the information (client id,record_id,IL,feature_name,feature_value) as the vertical split information, i.e., the vertical split value of one of the features.

[0231] Note that node splitting involves selecting a feature and possible values ​​that correspond to an optimal split point, where the samples of the current node can be divided into left and right subtree nodes according to the possible values ​​of this feature.

[0232] S604, determining a first split value for the training node based on the horizontal split value corresponding to each feature.

[0233] In an embodiment of the present application, the horizontal division may be selectively performed first, followed by the vertical division, or the vertical division may be selectively performed first, followed by the horizontal division.

[0234] Furthermore, as can be seen from the fact that the horizontal partitioning method uses all data, while the vertical partitioning method only uses data with the same ID, the horizontal partitioning method uses more data and is more likely to obtain better results, and the vertical partitioning method exchanges less data between the client and the server and is faster. Therefore, when training is interrupted, horizontal partitioning can be performed first, followed by vertical partitioning, in order to obtain a provisional training result as deep as possible.

[0235] In addition, in the embodiment of the present application, if the training node satisfies the preset splitting conditions, the currently located training node needs to be further split, and in this case, a target splitting method corresponding to the training node can be obtained. If the training node does not satisfy the preset splitting conditions, the currently located training node does not need to be further split, and in this case, a leaf node can be determined and the weight value of the leaf node can be sent to the client.

[0236] As one possible embodiment, as shown in FIG. 15, based on the above embodiment, the embodiment specifically includes the following steps S1301 to S1302.

[0237] S1301: if the training node does not satisfy a preset splitting condition, the training node is determined to be a leaf node, and a weight value of the leaf node is obtained.

[0238] In an embodiment of the present application, if a training node does not satisfy the preset splitting condition, the server treats the node in which it is located as a leaf node, calculates the weight value wj of the leaf node, stores the value of wj, and sets it as the weight value of the vertical leaf node.

[0239] Here, the weight value Wj of the leaf node is used to calculate the sample prediction fraction, which can be calculated by the following formula:

number

[0240] S1302, the weight value of the leaf node is transmitted to the client.

[0241] In an embodiment of the present application, after obtaining the weight value of the leaf node, the client can send the weight value of the leaf node to the client and notify each client not to perform vertical leaf node splitting, that is, to complete the node splitting operation.

[0242] In addition, in an embodiment of the present application, before informing the client to perform node splitting based on the target splitting scheme, splitting information including the target splitting scheme, the target splitting features selected as feature split points, and the target splitting values ​​can be sent to the client.

[0243] As shown in FIG. 16, based on the above embodiment, when the target division method is a vertical division method, before notifying the client to perform node division based on the target division method, the process may specifically include the following steps S1401 to S1404.

[0244] S1401, transmits split information to a labeled client.

[0245] In an embodiment of the present application, the server can send split information to the labeled clients, and in response, the labeled clients can receive the split information and perform node splitting on the training nodes based on the split information.

[0246] For the vertical split method, optionally, the server notifies each client to perform a true node split operation based on the recorded vertical split information, including (client_id, record_id, IL, feature_name, feature_value). Here, the client corresponding to client_id knows all the information, i.e., (client_id, record_id, IL, feature_name, feature_value), so other clients only need to know the IL information. Furthermore, the server sets the left subtree node after the current split as the current processing node.

[0247] Correspondingly, the client receives the IL or all the information sent by the server, i.e. (client_id, record_id, IL, feature_name, feature_value), and performs a vertical node split operation, and if the (client_id, record_id, IL, feature_name, feature_value) information exists, the client needs to record and store this information when splitting. Furthermore, after the split is completed, the client can make the left subtree node after splitting the current processing node.

[0248] For the horizontal splitting method, optionally, the server can use the horizontal method to split the node, i.e., based on the (k,value) information obtained in the horizontal method, perform a splitting operation on the current node to obtain IL information, and broadcast the IL to each client.

[0249] Correspondingly, the client can receive the (k, value) information of the server, and perform node splitting for the data of the common ID. The splitting method is that for the feature k of the common ID data, if the value is less than value, then put the ID of the data into the IL set, otherwise put it into the IR set. If the feature k does not exist in the data, put it into the right subtree space.

[0250] S1402, receiving a left subtree space set sent from a labeled client.

[0251] In an embodiment of the present application, the labeled client can perform node splitting on the training node, and then transmit the left subtree space generated by the splitting to the server, and in response, the server can receive the left subtree space set transmitted from the labeled client.

[0252] S1403, split the second training set based on the left subtree space set.

[0253] S1404, associate the training node with the labeled client identifier.

[0254] In addition, in the present application, initialization can be performed before the current training node responds to satisfying the preset splitting condition.

[0255] As one possible embodiment, as shown in FIG. 17, based on the above embodiment, the embodiment specifically includes the following steps S1501 to S1502.

[0256] S1501, a data instance identifier transmitted from a client is received.

[0257] In an embodiment of the present application, a client can send a unique identifier ID for each of its data to a server, and in response, the client can receive a unique identifier ID, i.e., a data instance identifier, for each of its data.

[0258] S1502, based on the data instance identifier, determine a common data instance identifier among the clients, where the common data instance identifier instructs the clients to determine a first training set and a second training set.

[0259] In the embodiment of the present application, the server can collect all the instance IDs of each client to obtain a common ID between the clients and notify each client. Furthermore, the server can select one client as a validation client, select a part of the labeled data from the client as a validation dataset, and if this part of the dataset does not exist in the common ID dataset, then modify the training dataset list corresponding to the client to initialize the information of the validation dataset. Then, notify each client of the information of the validation ID list and the common ID list. Correspondingly, the client can receive the common ID list and the validation ID list (if they exist) sent from the server to initialize the global local data information.

[0260] Furthermore, the server can perform information initialization for each round of training for the current XGB forest list and training round, perform information initialization for each tree for the current tree node and the current XGB forest list, and notify the client to perform information initialization for each round of training or training initialization for each tree.

[0261] Furthermore, after the target association learning model is obtained, the generated target association learning model can be verified.

[0262] Optionally, the server can validate the target associative learning model in cooperation with a validation client based on a validation set, the validation client being one of the clients participating in the training of the associative learning model, and the validation set being mutually exclusive with the first training set and the second training set, respectively.

[0263] In one possible implementation, the server can notify the client to perform a verification initialization operation, and in response, the client performs the verification initialization.

[0264] In addition, the server can select one ID to start the verification, initialize the XGB tree, and notify the client to start the verification. In response, the client initializes the verification information.

[0265] In addition, the server can send split node information and the data ID to be verified to the verification client according to the current tree. In response, the client can obtain the corresponding data according to the data ID, and then determine whether to split into a left subtree or a right subtree according to the split node information sent by the server, and return the determination result to the server.

[0266] Furthermore, the server can enter the next node based on the direction returned by the client. Then, it determines whether the leaf node has been reached, and if the leaf node has not been reached, it selects one ID to start a new verification, initializes the XGB tree, and notifies the client to start a new verification. If the leaf node has been reached, it can record the weight of the leaf node, and calculate and store the predicted value. If the currently predicted ID is not the last one of all predicted IDs, it can select one ID to start a new verification, initializes the XGB tree, and notifies the client to start a new verification. If the currently predicted ID is the last one of all predicted IDs, it can send all the predicted results to the client. Correspondingly, the client can receive all the predicted results, calculate the final verification result, compare it with the previous verification result, and determine whether the current model needs to be reserved and used, and notify the server of the judgment result.

[0267] In addition, the server can determine whether to reserve and use the current model based on the verification result returned by the client, and broadcast the determination result to all clients. Correspondingly, each client receives and processes the server's broadcast information.

[0268] In addition, the server can determine whether the final prediction round has been reached, and if the final prediction round has not been reached, the server can perform new information initialization for each round of training for the current XGB forest list heat exchange training round, and if the final prediction round has been reached, the server can end all training, organize the information, and reserve the model. Correspondingly, the client can end all training, organize the information, and reserve the model.

[0269] As a result, the training method for the associative learning model proposed in this application can automatically select the tendency of the matching learning method by mixing the horizontal partitioning method and the vertical partitioning method, without worrying about the data distribution method, and solve the problems that exist in the training process of the traditional associative learning model, such as not being able to fully utilize all the data for learning, and the poor training effect due to insufficient data utilization, while reducing the loss of the associative learning model and improving the performance of the associative learning model.

[0270] FIG. 18 is a schematic flowchart of a method for training an associative learning model disclosed according to an embodiment of the present application.

[0271] As shown in FIG. 18, the training method for the federated learning model provided by the embodiment of the present application will be described with the client as the execution subject, and specifically includes the following steps S1601 to S1602.

[0272] S1601, receiving a target splitting method sent from a server when it is determined that a training node satisfies a preset splitting condition, the training node being a node of one boosting tree among a plurality of boosting trees.

[0273] In the embodiment of the present application, if the training node meets the preset splitting condition, it indicates that the currently located training node needs to be taken over and split, in which case the server can obtain a target splitting scheme corresponding to the training node and notify the client to perform node splitting according to the target splitting scheme. Correspondingly, the client can receive the target splitting scheme sent by the server when it is determined that the training node meets the preset splitting condition.

[0274] S1602, node splitting is performed on the training node based on the target splitting method.

[0275] In an embodiment of the present application, the server can determine a target splitting scheme corresponding to the training node according to the first splitting value and the second splitting value. Correspondingly, the client can receive the IL or (client_id, record_id, IL, feature_name, feature_value) information sent from the server, and perform node splitting on the training node according to the target splitting scheme. Here, if the (client_id, record_id, IL, feature_name, feature_value) information exists, the client needs to record and store this information when performing node splitting on the training node.

[0276] Furthermore, after the split is completed, the client can make the left subtree node after the split the current processing node.

[0277] Thus, in the training method for a federated learning model provided by the present application, the client receives a target splitting scheme sent from the server when it is determined that a training node, which is a node of one of a plurality of boosting trees, satisfies a preset splitting condition, and performs node splitting on the training node based on the target splitting scheme, thereby mixing horizontal and vertical splitting schemes to automatically select the tendency of a matching learning scheme, without worrying about the data distribution scheme, which exists in the training process of the conventional federated learning model, that is, not being able to fully utilize all data for learning, and the training effect is poor due to insufficient data utilization, and this solves the problem, reduces the loss of the federated learning model, and improves the performance of the federated learning model.

[0278] In addition, in this application, before performing node splitting on the training node based on the target splitting method, the client can cooperate with the server to perform federated learning to obtain the corresponding split value.

[0279] As one possible implementation, as shown in FIG. 19, based on the above embodiment, it specifically includes steps S1701 to S1703.

[0280] S1701, performing horizontal association learning based on a first training set to obtain a first division value corresponding to a training node.

[0281] In addition, in this application, when performing horizontal association learning based on the first training set to obtain a first division value corresponding to a training node, an initial data instance identifier set corresponding to the training node can be obtained, and the initial data instance identifier set can be sent to the server.

[0282] As one possible embodiment, as shown in FIG. 20, based on the above embodiment, the embodiment specifically includes the following steps S1801 to S1804.

[0283] S1801 receives a first feature subset available to a training node, generated by a server from a first training set.

[0284] In an embodiment of the present application, the server can randomly generate a first feature subset available to the current training node from the first training set, for example, randomly generate half of all features in the current first training set to construct one new feature set as the first feature subset, and send the generated first feature subset to each client, and in response, each client can receive the first feature subset.

[0285] S1802, sending a feature value for each feature in the first feature subset to the server.

[0286] In the embodiment of the present application, the client can traverse based on the obtained first feature subset to obtain the feature value of each feature in the set, and randomly select one of all possible values ​​of the feature based on the local data, i.e., the feature value of the feature stored locally, to send to the server. Correspondingly, the server receives the possible feature value information sent from each client, constructs one possible value list, randomly selects one from the list as the global optimal splitting threshold of the current feature, and broadcasts the splitting threshold to each client.

[0287] S1803, the division threshold for each feature transmitted from the server is received.

[0288] In an embodiment of the present application, the server can determine a split threshold for each feature based on the feature value of each feature in the received first feature subset, and send the split threshold to the client, and correspondingly, the client can receive the split threshold for each feature sent from the server.

[0289] S1804: obtain an initial data instance identifier set corresponding to the training node based on the splitting threshold of each feature, and send the initial data instance identifier set to a server, where the initial data instance identifier set instructs the server to generate a first data instance identifier set and a second data instance identifier set, where the first data instance identifier set and the initial data instance identifier set both include data instance identifiers belonging to a first left subtree space, and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space.

[0290] In the embodiment of the present application, when obtaining an initial data instance identifier set corresponding to a training node based on the splitting threshold of each feature, for any one feature, the splitting threshold of any one feature can be compared with the feature value of any one feature respectively to obtain data instance identifiers whose feature value is smaller than the splitting threshold to generate an initial data instance identifier set, where the splitting threshold can be set before starting training according to actual circumstances.

[0291] As one possible implementation, the client can perform node splitting for the current feature based on the received feature splitting threshold information, obtain IL, and notify the server; if the client does not have a corresponding feature, it returns an empty IL.

[0292] Here, IL is the instance ID set in the left subtree space, and the calculation method is as follows: after receiving the threshold value of feature k sent from the server, if the possible value of feature k corresponding to instance ID1 in the local data is smaller than value, add ID1 to the IL set, which is expressed by the following formula:

number

[0293] S1702, performing vertical association learning based on a second training set to obtain a second split value corresponding to the training node.

[0294] In addition, in the present application, before performing vertical association learning based on the second training set to obtain a second split value corresponding to the training node, first gradient information of at least one third data instance identifier set can be obtained, and the first gradient information of the third data instance identifier set can be sent to a server.

[0295] As one possible implementation, as shown in FIG. 21, based on the above embodiment, the following steps can be specifically included.

[0296] S1901: A gradient information request transmitted from a server is received.

[0297] In an embodiment of the present application, the server can send a gradient information request to the client to request to obtain Gkv and Hkv information, and in response, the client can receive the gradient information request sent from the server.

[0298] S1902, generating a second feature subset from a second training set based on the gradient information request.

[0299] S1903, obtain first gradient information of at least one third data instance identifier set for each feature in the second feature subset, where the third data instance identifier set includes data instance identifiers belonging to a second left subtree space, the second left subtree space is a left subtree space formed by dividing according to one of the feature values ​​of the feature, and different feature values ​​correspond to different second left subtree spaces.

[0300] As one possible implementation, as shown in FIG. 22, based on the above embodiment, the following steps S2001 to S2002 can be specifically included.

[0301] S2001, for any one feature, all feature values ​​of the one feature are obtained, and the one feature is packetized based on the feature values.

[0302] In an embodiment of the present application, a packet mapping can be performed for each sample based on each feature k in the set and each value v of all possible values ​​of the corresponding feature.

[0303] In addition, there are multiple bucket mapping rules as mentioned above, and the present application does not limit the specific method of the bucket mapping rule, but only ensures that samples with the same feature value, for example, two samples whose possible values ​​in Figure 11 are 1, are divided into the same data packet.

[0304] For example, samples with the same possible values ​​can be grouped into one packet, i.e., n samples are split into m packets if there are m possible values ​​for a feature, and the corresponding feature thresholds are the m possible values.

[0305] Also, for example, the number of packets may be limited, for example, limited to dividing into m packets as much as possible. In this case, if the number of possible values ​​of feature k is less than m, the division can be performed according to the previous method, and if the number of possible values ​​is more than m, the division can be performed according to the approximately equal division method into m packets.

[0306] S2002, obtaining first gradient information of a third data instance identifier set of each packet of any one feature.

[0307] In an embodiment of the present application, the client can obtain the first gradient information of the third data instance identifier set of each packet of any one feature, and correspondingly, the server can receive the first gradient information of at least one of the third data instance identifier sets of each feature sent from the client.

[0308] S1904, sending the first gradient information of the third data instance identifier set to the server.

[0309] In an embodiment of the present application, the client obtains the unprocessed data of the current node based on the data of the common ID part, randomly obtains a feature set, and performs packet mapping for each sample based on each feature k in the set and each value v of all possible values ​​of the corresponding feature, calculates the Gkv and Hkv of the left subtree space, and transmits them to the server after homomorphic encryption processing.

[0310] In step S1703, the first divided value and the second divided value are transmitted to the server.

[0311] In an embodiment of the present application, the client can perform horizontal federated learning and vertical federated learning based on the first training set and the second training set to obtain the second divided value corresponding to the training node, and then send the first divided value and the second divided value to the server. In response, the server can receive the first divided value and the second divided value.

[0312] In addition, in this application, when node splitting is performed on the training node based on the target splitting method, the node splitting can be performed based on the splitting information transmitted from the server.

[0313] As one possible embodiment, as shown in FIG. 23, based on the above embodiment, the embodiment specifically includes the following steps S2101 to S2102.

[0314] S2101, receiving split information sent from a server, the split information including a target split method, a target split feature selected as a feature split point, and a target split value.

[0315] In an embodiment of the present application, before informing the client to perform node splitting based on the target splitting scheme, the server can send splitting information to the client, including the target splitting scheme, the target splitting feature selected as the feature split point, and the target split value, and correspondingly, the client can receive the splitting information sent by the server.

[0316] As one possible implementation, the server can perform the node split using a horizontal approach, i.e., based on the (k,value) information obtained in the horizontal approach, it can perform a split operation on the current node, and then obtain the IL information and broadcast the IL to each client.

[0317] S2102: Node division is performed on the training node based on the division information.

[0318] As one possible implementation, the client can perform node splitting for the data of common ID based on the received server's (k, value) information, and the splitting method is that for the feature k of the common ID data, if the value is less than value, the ID of the data should be put into the IL set, otherwise, into the IR set. If the feature k does not exist in the data, put it into the right subtree space.

[0319] Furthermore, after performing node splitting on the training node, the client can transmit the left subtree space generated by the splitting to the server, and in response, the server can receive the left subtree space generated by the splitting.

[0320] In addition, in the embodiment of the present application, if the training node satisfies the preset splitting condition, it indicates that the currently located training node needs to be further split; if the training node does not satisfy the preset splitting condition, it indicates that the currently located training node does not need to be further split. In this case, the client can take the residual as the residual input of the next boosting tree and perform node backtracking.

[0321] As one possible embodiment, as shown in FIG. 24, based on the above embodiment, the embodiment specifically includes the following steps S2201 to S2203.

[0322] S2201, if the training node is a leaf node, receive the weight value of the leaf node sent from the server.

[0323] In the embodiment of the present application, if the training node does not satisfy the preset splitting condition, the server can take the node as a leaf node, calculate the weight value wj of the leaf node, and store the value of wj as the vertical leaf node weight value. Correspondingly, the client can receive the leaf node weight value wj sent by the server.

[0324] S2202, a residual of each data included in the leaf node is determined based on the weight value of the leaf node.

[0325] S2203, the residual is used as the residual input of the next boosting tree.

[0326] In an embodiment of the present application, the client can calculate a new y'(t-1)(i) based on [Ij(m),wj], and then trace back to other non-leaf nodes of the current tree as the current node, where y'(t-1)(i) represents the label residual corresponding to the i-th instance, t represents the current tree, and t-1 represents the previous tree.

[0327] Thus, in the training method for a federated learning model provided by the present application, the client receives a target splitting scheme sent from the server when it is determined that a training node, which is a node of one of a plurality of boosting trees, satisfies a preset splitting condition, and performs node splitting on the training node based on the target splitting scheme, thereby mixing horizontal and vertical splitting schemes to automatically select the tendency of a matching learning scheme, without worrying about the data distribution scheme, which exists in the training process of the conventional federated learning model, that is, not being able to fully utilize all data for learning, and the training effect is poor due to insufficient data utilization, and this solves the problem, reduces the loss of the federated learning model, and improves the performance of the federated learning model.

[0328] It should be noted that in the embodiment of the present application, the training process of the federated learning model mainly includes several stages such as node splitting, model generation, and model verification. Below, the training method of the federated learning model proposed in the embodiment of the present application will be described by taking as an example the node splitting, model generation, and model verification stages of the training of the federated learning model when the server is the execution subject and when the verification client is the execution subject.

[0329] When a server is used as an execution subject, as shown in FIG. 25, the training method for an federated learning model provided by the embodiment of the present application specifically includes the following steps S2301 to S2304.

[0330] S2301, if a training node satisfies a preset splitting condition, obtain a target splitting method corresponding to the training node, where the training node is a node of one boosting tree among a plurality of boosting trees.

[0331] S2302, notify the client to perform node splitting based on the target splitting method, and obtain the updated training nodes.

[0332] S2303, if it is determined that the updated training node satisfies a training stopping condition, stop the training and generate a target association learning model.

[0333] Note that the contents related to steps S2301 to S2303 can be referred to in the above embodiment, and detailed explanations will be omitted here.

[0334] S2304, obtain a validation set, and validate the target federated learning model in cooperation with a validation client, which is one of the clients participating in training the federated learning model.

[0335] Here, the validation set is usually a part of samples in the training set. Optionally, the validation set can be randomly sampled from the training set according to a predetermined ratio. In an embodiment of the present application, the validation set includes data instance identifiers, and the validation set is mutually exclusive with the first training set and the second training set, respectively.

[0336] Therefore, in the training method for a federated learning model provided by the present application, after generating the federated learning model, the server obtains a validation set and cooperates with the validation client to validate the target federated learning model. In this way, when there is a lot of user data isomorphism, the method of combining training and validation can reduce the validation loss of the federated learning model, improve the reasoning effect of the federated learning model, and further improve the effectiveness and reliability of the training process of the federated learning model.

[0337] In the embodiment of the present application, the updated training node includes a left subtree node generated by splitting the training node and other non-leaf nodes of one boosting tree. Here, the updated training node satisfies the training stopping condition including that the updated training node no longer satisfies the preset splitting condition or that the updated training node is the last node of multiple boosting trees.

[0338] In addition, in an embodiment of the present application, when a validation set is obtained and a target associative learning model is to be validated in cooperation with a validation client, the data instance identifiers in the validation set can be validated one by one until all data instance identifiers in the validation set are validated.

[0339] As one possible implementation form, as shown in FIG. 26, based on the above embodiment, the process of obtaining a validation set in step S2304 and validating the target associative learning model in cooperation with the validation client specifically includes the following steps S2401 to S2405.

[0340] S2401, sending one data instance identifier in the validation set and split information of a validation node to a validation client, where the validation node is a node of one boosting tree among the multiple boosting trees.

[0341] In an embodiment of the present application, the server can send any one of the data instance identifiers to the verification client, and can also send the division information of the verification node, in which case the verification client can receive the data instance identifier and the division information of the verification node, obtain corresponding data according to the data instance identifier, and determine the node progression direction corresponding to the verification node according to the division information, that is, whether the node progression direction is to the left subtree or to the right subtree.

[0342] Here, the splitting information includes splitting features and splitting thresholds.

[0343] S2402, receiving a node progression direction corresponding to a verification node sent from a verification client, where the node progression direction is determined by the verification client based on a data instance identifier and division information.

[0344] In an embodiment of the present application, after the verification client determines the node direction corresponding to the verification node, the verification client can send the node direction to the server, and in response, the server can receive the node direction corresponding to the verification node sent from the verification client.

[0345] S2403: Enter the next node based on the node proceeding direction, and set the next node as the updated verification node.

[0346] In the embodiment of the present application, the server can enter the next node according to the node proceeding direction returned from the verification client, and the next node can be the updated verification node. Furthermore, the server can determine whether the updated verification node satisfies a preset node splitting condition, and if the updated verification node satisfies the preset node splitting condition, it represents that a leaf node has not been reached, so the server can execute step S2404, and if the updated verification node does not satisfy the preset node splitting condition, it represents that a leaf node has been reached, so the server can execute step S2405.

[0347] S2404, if the updated validation node satisfies the preset node splitting condition, return to sending the data instance identifiers and splitting information to the validation client until all the data instance identifiers in the validation set are validated.

[0348] S2405, if the updated validation node does not satisfy the preset node splitting condition, determine that the updated validation node is a leaf node, and obtain a model predicted value of the data instance represented by the data instance identifier.

[0349] In an embodiment of the present application, after the server determines that the updated validation node is a leaf node, it can record the weight value of the leaf node and calculate and store the model predicted value of the data instance represented by the data instance identifier.

[0350] Here, the model prediction value of the data instance represented by the data instance identifier refers to the prediction value of each sample. During validation, when each sample reaches a leaf node in each tree, the Leaf Score of the leaf is the score of the sample in this tree, and the sum of the scores of one sample in all trees is the prediction value.

[0351] Furthermore, after completing the above step S2404, it can be determined whether to reserve and use the target associative learning model.

[0352] As one possible implementation, as shown in FIG. 27, based on the above embodiment, after the above step S2404, the following steps S2501 to S2503 are specifically included.

[0353] S2501, if all data instance identifiers in the validation set are validated, send the model predicted value of the data instance to a validation client.

[0354] In the embodiment of the present application, when all the data instance identifiers in the validation set have been validated, that is, when the currently predicted data instance identifier is the last one of all predicted data instance identifiers, the model prediction value of the data instance can be sent to the validation client. Correspondingly, the validation client can receive all the prediction results, calculate a final validation result, and compare it with the previous validation result to judge whether the current target associative learning model needs to be suspended and used, and generate validation instruction information according to the judgment result.

[0355] In addition, when the client wants to generate validation instruction information, it can calculate and obtain the predicted value for all samples in the validation set. Since the validation client has the true label value, in this case, the client can calculate the relevant difference indicators between the predicted value and the label value based on the two, such as accuracy (also called precision) and RMSE (Root Mean Squared Error), and determine the performance of the model in the current epoch based on the aforementioned indicators.

[0356] Here, the current epoch, also called the training of the current generation, refers to the process in which all training samples have undergone one forward propagation and one backward propagation in the neural network, that is, one epoch is the process of training all training samples once. In this way, if the obtained related difference index is better than the index of the previous epoch, the currently obtained model can be retained, and if the obtained related difference index is worse than the index of the previous epoch, the currently obtained model can be discarded.

[0357] S2502, receiving verification instruction information transmitted from the verification client, where the verification instruction information is instruction information for instructing whether to suspend the model obtained based on the model prediction value.

[0358] In an embodiment of the present application, the validation client can send validation instruction information to the server, and in response, the server can receive validation instruction information sent from the validation client.

[0359] S2503, determining whether to reserve and use the target associative learning model according to the verification instruction information, and sending the determination result to the client.

[0360] In the embodiment of the present application, the server can determine whether to reserve and use the target federated learning model based on the verification instruction information, and send the determination result to all clients.

[0361] When the verification client is the execution subject, as shown in FIG. 28, the training method for the federated learning model provided by the embodiment of the present application specifically includes the following steps S2601 to S2603.

[0362] S2601, receiving a target splitting method sent from a server when it is determined that a training node satisfies a preset splitting condition, the training node being a node of one boosting tree among a plurality of boosting trees.

[0363] S2602, node splitting is performed on the training node based on the target splitting method.

[0364] Incidentally, the contents relating to steps S2601 to S2602 can be referred to in the above embodiment, and detailed explanations will be omitted here.

[0365] S2603, receiving a validation set sent from the server, and validating the target association learning model based on the validation set.

[0366] In an embodiment of the present application, the server can obtain a validation set and send it to the validation client. Correspondingly, the validation client can receive the validation set sent from the server and validate the target federated learning model based on the validation set.

[0367] Here, the validation set sent from the server is received, and the target associative learning model is validated based on the validation set.

[0368] Therefore, in the training method for the federated learning model provided by the present application, after node splitting is performed on the training node based on the target splitting method, the verification client receives the validation set sent from the server, and verifies the target federated learning model based on the validation set. When there is a lot of user data isomorphism, by using a method that combines training and verification, the verification loss of the federated learning model is reduced, the reasoning effect of the federated learning model is improved, and the effectiveness and reliability of the training process of the federated learning model are further improved.

[0369] In addition, in an embodiment of the present application, when a verification client attempts to verify a target associative learning model based on a validation set, it can verify the data instance identifiers in the validation set one by one until all the data instance identifiers in the validation set are verified.

[0370] As one possible implementation form, as shown in FIG. 29, based on the above embodiment, the process of verifying the target associative learning model based on the validation set in the above step S2603 may specifically include the following steps S2701 to S2703.

[0371] S2701 receives one data instance identifier in a validation set sent from a server and split information of a validation node, where the validation node is a node of one boosting tree among a plurality of boosting trees.

[0372] In an embodiment of the present application, the server can send any one of the data instance identifiers to the verification client and also send the division information of the verification node, and in response, the verification client can receive the data instance identifier and the division information of the verification node.

[0373] Here, the splitting information includes splitting features and splitting thresholds.

[0374] S2702: Based on the data instance identifier and the division information, the node proceeding direction of the verification node is determined.

[0375] In an embodiment of the present application, the verification client obtains corresponding data based on the data instance identifier, and determines the node progression direction corresponding to the verification node based on the split information, i.e., whether the node progression direction is to the left subtree or to the right subtree.

[0376] As one possible implementation form, as shown in FIG. 30, the process of determining the node progression direction of the verification node based on the data instance identifier and the division information in the above step S2702 specifically includes the following steps S2801 to S2802.

[0377] S2801, based on the data instance identifier, determining a feature value for each feature corresponding to the data instance identifier.

[0378] Incidentally, the contents related to step S2801 can be referred to in the above embodiment, and detailed explanation will be omitted here.

[0379] S2802: A node progression direction is determined based on the division information and the feature values ​​of each feature.

[0380] In an embodiment of the present application, the verification client can determine a feature for splitting based on the splitting information, and determine a node progression direction based on the feature value of the feature and a splitting threshold.

[0381] S2703, the node direction is sent to the server so that the server enters the next node based on the node direction and makes the next node an updated verification node.

[0382] In an embodiment of the present application, after the verification client determines the node direction corresponding to the verification node, the verification client can send the node direction to the server, and in response, the server can receive the node direction corresponding to the verification node sent from the verification client.

[0383] Furthermore, after completing the above step S2703, it can be determined whether to reserve and use the target associative learning model.

[0384] As one possible implementation, as shown in FIG. 27, based on the above embodiment, after the above step S2703, the following steps S2901 to S2903 are specifically included.

[0385] S2901, if all data instance identifiers in the validation set have been validated, receiving a model predicted value of the data instance represented by the data instance identifier sent from the server.

[0386] In the embodiment of the present application, when all the data instance identifiers in the validation set have been validated, that is, when the currently predicted data instance identifier is the last one of all predicted data instance identifiers, the model prediction value of the data instance can be sent to the validation client. Correspondingly, the validation client can receive all the prediction results, calculate a final validation result, and compare with the previous validation result to judge whether the current target associative learning model needs to be suspended and used, and generate validation instruction information according to the judgment result.

[0387] In addition, when the validation client wants to generate validation instruction information, it can calculate and obtain the predicted value for all samples in the validation set. Since the validation client has the true label value, in this case, the client can calculate the relevant difference indicators between the predicted value and the label value based on the two, such as accuracy (also called precision) and RMSE (Root Mean Squared Error), and determine the performance of the model in the current epoch based on the aforementioned indicators.

[0388] Here, the current epoch, also called the training of the current generation, refers to the process in which all training samples have undergone one forward propagation and one backward propagation in the neural network, that is, one epoch is the process of training all training samples once. In this way, if the obtained related difference index is better than the index of the previous epoch, the currently obtained model can be retained, and if the obtained related difference index is worse than the index of the previous epoch, the currently obtained model can be discarded.

[0389] S2902, obtain a final validation result based on the model predicted value, compare the validation result with the previous validation result, and generate validation instruction information for instructing whether to reserve and use the target associative learning model.

[0390] In an embodiment of the present application, the verification client can send verification instruction information to the server, and in response, the server can receive the verification instruction information sent from the verification client.

[0391] In step S2903, verification instruction information is transmitted to the server.

[0392] In an embodiment of the present application, the server can determine whether to reserve and use the target associative learning model based on the verification instruction information sent from the verification client, and send the decision result to all clients.

[0393] FIG. 32 is a schematic flowchart of a method for training an associative learning model disclosed according to one embodiment of the present application.

[0394] As shown in Figure 32, taking XGB as an example, the entire process in which the server and the client (including the verification client) train the federated learning model is used to describe the training method for the federated learning model provided by the embodiments of the present application, which specifically includes the following steps S3001 to S3006.

[0395] S3001: The server and client each perform initialization processing.

[0396] Optionally, the client sends a data identifier to the server. Specifically, the client sends a data identifier for each of its data to the server, where the data identifier uniquely distinguishes each of the data. In response, the server receives the data identifier sent from each client.

[0397] Furthermore, the server determines a common data identifier among the clients based on the data identifiers it receives. The common data identifier is the same data identifier that different clients have, as determined by the server based on the data identifiers reported by each client.

[0398] In addition, the server transmits a common data identifier to the client.

[0399] In addition, the client obtains the derivative of the loss formula according to the common data identifier and the local data, and performs homomorphic encryption processing. Specifically, the client calculates some intermediate results of the loss function according to the common data identifier and the local data, such as calculating the first derivative gi and the second derivative hi of the loss function. Here, the calculation formulas for gi and hi are as follows:

number

[0400] Here, yi is the prediction result of sample i, and the meaning of each symbol can be found in the related art.

[0401] The formula for the loss function is as follows:

number

[0402] We propose to approximately express the above equation using the second-order Taylor expansion formula provided by XGB. The second-order form of the Taylor expansion formula is as follows.

number

[0403] Additionally, the client transmits the encrypted derivative to the server, and in response, the server receives the encrypted derivative transmitted by the client.

[0404] Furthermore, the server performs a decryption process on the received encrypted derivative, and performs an average process on the decrypted derivative to obtain the average value. For the same common data identifier, the average value is calculated by accumulating the derivatives corresponding to each client. For example, the calculation method is as described above, and then the average value is calculated after accumulating the first derivative gi and the second derivative hi corresponding to the common data identifier. The specific method is as follows.

number

[0405] Here, n represents the number of common data IDs, gi(j) represents the first derivative gi of data j, and hi(j) represents the second derivative hi of data j.

[0406] Further, the server transmits the average value to the client. Exemplarily, the server transmits the average value to the client in the form of a list. In one implementation, the first derivative gi and the second derivative hi can be commonly present in one list, and in another implementation, the first derivative gi and the second derivative hi are present in different lists, for example, the first derivative gi is present in list A and the second derivative hi is present in list B. Correspondingly, the client receives the average value transmitted from the server.

[0407] In addition, the client updates the locally stored average value.

[0408] S3002: The server and client start horizontal XGB processing.

[0409] Optionally, the server determines whether the currently located tree node needs to be further split. For example, the server determines whether the currently located tree node needs to be further split based on whether the level at which the currently located tree node is located has reached the maximum tree depth. If the tree node does not need to be further split, the server takes the currently located node as a leaf node, calculates a weight value wj of the leaf node, stores the wj value as the weight value of the leaf node of the horizontal XGB, and if the tree node needs to be further split, the server randomly generates a feature set available for the current node from all feature sets, and sends the feature set to each client.

[0410] Furthermore, the server randomly generates a feature set available for the current node from the set of all features and sends this feature set to each client.

[0411] Further, based on the obtained feature set, the client traverses each feature in the feature set and randomly selects one of all possible values ​​for that feature based on local data and sends it to the server.

[0412] Furthermore, the server receives the feature possible value information sent from each client, constructs a list of possible values, randomly selects one from the list of possible values ​​as the global optimal partitioning threshold for the current feature, and broadcasts this global optimal partitioning threshold to each client.

[0413] Furthermore, the client performs node splitting for the current feature based on the received global optimal splitting threshold, obtains an IL, and notifies the server; if the corresponding feature does not exist in the client, an empty IL is returned.

[0414] Here, IL is the instance ID set in the left subtree space, and the calculation formula is as follows: The client receives the global optimal partitioning threshold value of feature k sent from the server, and in the local data, if the possible value of feature k corresponding to instance ID1 is smaller than the global optimal partitioning threshold value, then ID1 is added to the IL set, as shown in the following formula.

number

[0415] Here, IDk represents the possible values ​​of feature k of instance ID, and SIL represents set IL.

[0416] In addition, the server receives the IL sent by each client for the current feature, filters out duplicate instance IDs from each IL, and processes conflicting ID information. For some clients, the instance ID is added to the IL, but some clients do not add the ID even if it exists. In this case, it is considered that this ID should be in the IL, and the final IL and IR are determined. If the current feature does not exist in the data of a client, the data instance ID of this client is put into the IR. After that, it calculates GL, GR, HL, and HR, and then calculates and obtains the division value Gain of the current feature.

number

[0417] where GL is the sum of all first derivatives g i in the left subtree space, GR is the sum of all first derivatives g i in the right subtree space, HL is the sum of all second derivatives h i in the left subtree space, and HR is the sum of all second derivatives h i in the right subtree space. The formula is as follows:

number

[0418] Here, n1 represents the number of instances in the left subtree space, and n2 represents the number of instances in the right subtree space.

[0419] The server cooperates with the client to traverse each feature in the randomly selected feature set, and each feature is taken as the split value calculated by the split node, and the feature with the largest split value is taken as the optimal effect feature of the current node. At the same time, the server also knows the threshold information corresponding to the split node, and the split threshold, the split value Gain, and the selected feature are taken as the optimal split information of the current node of the horizontal XGB.

[0420] In addition, the server performs a cleanup operation after the horizontal node split, and the server notifies each client not to perform any more horizontal node split operations, that is, to complete the horizontal node split operation.

[0421] Furthermore, the server regards the node as a leaf node, calculates a weight value wj of the leaf node, stores the value of wj, and sets it as the weight value of the leaf node of the horizontal XGB.

[0422] Where:

number

[0423] In addition, the server notifies each client not to perform any more horizontal node split operations, ie, to complete the horizontal node split operation.

[0424] Additionally, the client performs post processing to complete the horizontal node split.

[0425] S3003: The server and client start vertical XGB processing.

[0426] Optionally, the server notifies the client to process the vertical XGB.

[0427] In addition, the server requests each client to obtain Gkv and Hkv information.

[0428] In addition, the client obtains the unprocessed data of the current node based on the data of the common data identifier portion, randomly obtains a feature set, and performs packet mapping for each sample based on each feature k in the set and all possible values ​​v of the corresponding feature, calculates Gkv and Hkv of the left subtree space, and sends them to the server after homomorphic encryption processing. Optionally, the possible values ​​of feature k in the dataset can be sorted and then put into packets, which are divided into packets {sk,1,sk,2,sk,3,...,sk,v-1}, and the calculation formulas of Gkv and Hkv are as follows:

number

[0429] Here, xi,k represents the value of feature k of data xi.

[0430] Furthermore, the server can decode [[Gkv]] and [[Hkv]] sent from each client, and calculate G and H of the current node based on the data of the common data identifier part of the current node and all gi and hi obtained before. Optionally, if some clients have the same features, the server can randomly select one from the received Gkv to be the Gkv of the current feature, and do the same for Hkv. Furthermore, the server can calculate the optimal split point of each feature based on G, H, Gkv, and Hkv, and determine the global optimal split point (k, v, Gain) based on the above split point information.

[0431] In an embodiment of the present application, the received information can be compared with a preset threshold, and if the Gain is less than or equal to the threshold, no vertical node splitting can be performed and step S3027 can be executed, and if the Gain is greater than the threshold, step S3023 can be executed.

[0432] Furthermore, the server requests IL from the corresponding client based on (k, v, Gain).

[0433] Furthermore, client C receives the division point information (k, v, Gain), searches to obtain the division point threshold value, and records the division point (k, value) information. The local dataset is divided based on the division point, IL is obtained, and (record, IL, value) is sent to the server. Here, record represents the index of the record in the client, and the calculation method of IL is as described above.

[0434] In addition, the server receives the (record, IL, value) information sent from client C, divides all common ID instances in the node space where it is located, and associates them with the current node and client C by (client id, record). In the embodiment of the present application, the server can record (client id, record_id, IL, feature_name, feature_value) as the information of vertical division, and execute step S3027.

[0435] Furthermore, the server regards the node as a leaf node, calculates the weight value wj of the leaf node, stores the weight value wj, and sets it as the weight value of the vertical leaf node.

[0436] In addition, the server notifies each client not to perform any more vertical leaf node splits, ie, to complete the node split operation.

[0437] In addition, each client performs processing after completing the vertical node split.

[0438] In step S3004, the server and the client start mixed processing of horizontal XGB and vertical XGB.

[0439] Optionally, the server judges whether the current node needs to be split. In the embodiment of the present application, if the current node does not need to be split, the server takes the node where it is as a leaf node, calculates the weight value wj of the leaf node, and sends the information [Ij(m), wj] to all clients; if the current node needs to be split, the server determines the target gain based on the gain obtained in the horizontal XGB and the gain obtained in the vertical XGB, and thereby determines the node splitting method to perform node splitting.

[0440] Furthermore, the server determines a target gain based on the gain obtained in the horizontal XGB and the gain obtained in the vertical XGB, and determines a node splitting method based on the target gain, thereby performing node splitting. In the embodiment of the present application, in the case of the horizontal XGB method, the server performs the node splitting using the horizontal method, that is, performs a splitting operation on the current node based on the (k, value) information obtained in the horizontal method, obtains IL information, and broadcasts the IL to each client; in the case of the vertical XGB method, the client notifies each client to perform a true node splitting operation based on the (client_id, record_id, IL, feature_name, feature_value) of the vertical split recorded by the server.

[0441] In addition, the client notifies each client to perform a true node split operation based on the (client_id, record_id, IL, feature_name, feature_value) of the vertical split recorded by the server, where the client corresponding to the client_id must know all the information of (client_id, record_id, IL, feature_name, feature_value), and other clients only need to know the IL information.

[0442] The server sets the left subtree node after the current split as the current processing node.

[0443] In addition, the client receives the IL or (client_id, record_id, IL, feature_name, feature_value) sent by the server and performs a vertical node split operation. If (client_id, record_id, IL, feature_name, feature_value) information exists, the client needs to record and store this information when splitting. In the embodiment of the present application, after the split is completed, the left subtree node after splitting is the current processing node.

[0444] Furthermore, the server returns to step S3002 to perform subsequent processing, and the client returns to step S3002 to wait for a message from the server. At this point, the division of the current node is complete, so it is necessary to divide the left subtree and right subtree nodes in the next layer. Therefore, the process returns to step S3002 to divide the next node.

[0445] Furthermore, the server splits the node using the horizontal method, that is, based on the (k,value) information obtained by the horizontal method, it performs a split operation on the current node, obtains IL information, and broadcasts the IL to each client. Here, IL can be expressed as the following formula:

number

[0446] Here, IDk represents the possible values ​​of feature k of instance ID, and SIL represents set IL.

[0447] In addition, the client can receive the IL broadcast by the server, and determine the IL and IR of the current node based on the IL in combination with the data of the local unshared ID, and then perform the node split operation. Note that determining the IL and IR is equivalent to determining the ID of the local unshared ID data, and if it does not exist in the IL set sent by the server, it will exist in the IR set.

[0448] Furthermore, when the server uses the horizontal approach to perform node splitting, it broadcasts (k, value) to clients based on the selected feature k and threshold value.

[0449] In addition, each client receives the (k, value) information from the server and performs node splitting for the data of the common ID, and the splitting method is for the feature k of the common ID data. Here, if the value is less than the value, the ID of the data should be put into the IL set, otherwise it is put into the IR set. If the feature k does not exist in the data, it is put into the right subtree space.

[0450] Then, the server returns to step S3002 to perform the split operation on the next node, and the client returns to step S3002 to wait for a message from the server.

[0451] Furthermore, the server takes the node where it is located as a leaf node, calculates the weight value wj of the leaf node, and sends the information [Ij(m),wj] to all clients, where Ij(m) is the instance ID set in the current node space, and wj is the weight of the current node.

[0452] Furthermore, the client calculates a new y`(t-1)(i) based on [Ij(m),wj], and then backtracks to other non-leaf nodes in the current tree, making it the current node, where y`(t-1)(i) represents the label residual corresponding to the i-th instance, t represents the current tree being the t-th tree, and t-1 represents the previous tree.

[0453] Additionally, the server traverses the current tree to other non-leaf nodes and makes them the current node.

[0454] Furthermore, if the current node after going back exists and is not empty, the process returns to step S3002 to perform the next process, and the client returns to step S3002 to wait for a message from the server.

[0455] Additionally, if the current node is empty, a validation operation is performed on the model.

[0456] S3005, the server and the verification client verify the target associative learning model.

[0457] Optionally, the server notifies the verification client to perform a verification initialization operation.

[0458] Furthermore, the verification client performs verification initialization.

[0459] In addition, the server selects one ID to start the verification, initializes the XGB tree, and notifies the verification client to start the verification.

[0460] In addition, the verification client initializes the verification information.

[0461] In addition, the server sends split node information and the data ID to be verified to the verification client based on the current XGB tree.

[0462] Furthermore, the verification client obtains the corresponding data based on the data ID, and then determines whether to split the data into a left subtree or a right subtree based on the split node information sent from the server, and returns the determined result to the server.

[0463] Further, the server will enter the next node based on the direction returned by the verification client. After that, it will determine whether the leaf node has been reached or not, if it has been reached, the server will record the weight of the leaf node, calculate and store the predicted value, if not, the server will select one ID to start the verification, initialize the XGB tree, and notify the verification client to start the verification.

[0464] In addition, the server records the weights of leaf nodes, calculates and stores the predicted values. If the current predicted ID is the last one of all predicted IDs, the server sends all prediction results to the client, otherwise the server selects one ID to start verification. It initializes the XGB tree and notifies the verification client to start verification.

[0465] In addition, the server sends all prediction results to the client.

[0466] Furthermore, the validation client receives all prediction results, calculates the final validation result, compares it with the previous validation result, and decides whether the current model needs to be suspended and used, and notifies the server.

[0467] Furthermore, the server determines whether to reserve and use the current model based on the verification result returned from the verification clients, and notifies all clients.

[0468] In addition, each client receives and processes the server's broadcast information.

[0469] Furthermore, the server determines whether the final prediction round has been reached, and if so, executes step S3006.

[0470] S3006, the server and the client respectively finish training and reserve the target association learning model.

[0471] Optionally, the server will finish all training, clean up the information, and store the models.

[0472] Additionally, the client completes all training, organizes the information, and reserves the model.

[0473] As described above, the training method for the associative learning model in the embodiment of the present application can automatically select the tendency of the matching learning method by mixing the horizontal partitioning method and the vertical partitioning method, without worrying about the data distribution method. This solves the problems that exist in the training process of the traditional associative learning model, such as not being able to fully utilize all the data for learning, and the poor training effect due to insufficient data utilization, and reduces the loss of the associative learning model and improves the performance of the associative learning model.

[0474] Based on the same application concept, an embodiment of the present application further provides an apparatus corresponding to the method for training a federated learning model.

[0475] FIG. 33 is a schematic structural diagram of a training device for an associative learning model provided by an embodiment of the present application.

[0476] As shown in FIG. 33, the training apparatus 1000 for the federated learning model applied to the server includes an acquisition module 110, a notification module 120, a first training module 130, a second training module 140, and a generation module 150.

[0477] Here, the acquisition module 110 acquires a target splitting scheme corresponding to a training node, which is a node of one of a plurality of boosted trees, when the training node satisfies a preset splitting condition; the notification module 120 notifies a client to perform node splitting based on the target splitting scheme; the first training module 130 performs a next round of training using a left subtree node generated by splitting the training node as a new training node until the updated training node does not satisfy the preset splitting condition; the second training module 140 performs a next round of training using another non-leaf node of the one boosted tree as the new training node; and the generation module 150 stops training and generates a target associative learning model when the node data sets of the plurality of boosted trees are all empty.

[0478] According to one embodiment of the present application, as shown in FIG. 34, the acquisition module 110 in FIG. 33 includes a first learning submodule 111 for performing horizontal association learning in cooperation with the client based on a first training set to obtain a first division value corresponding to the training node, a second learning submodule 112 for performing vertical association learning in cooperation with the client based on a second training set to obtain a second division value corresponding to the training node, and a determination submodule 113 for determining a target division method corresponding to the training node based on the first division value and the second division value.

[0479] According to one embodiment of the present application, as shown in FIG. 35, the determination submodule 113 in FIG. 34 includes a first determination unit 1131 for determining the larger of the first division value and the second division value as a target division value corresponding to the training node, and a second determination unit 1132 for determining a division method corresponding to the training node based on the target division value.

[0480] According to one embodiment of the present application, as shown in FIG. 36, the first learning submodule 111 in FIG. 33 includes: a generation unit 1111 for generating a first feature subset available for the training node from the first training set, and sending the first feature subset to the client; a first receiving unit 1112 for receiving feature values ​​of each feature in the first feature subset sent from the client; a third determination unit 1113 for determining horizontal division values ​​corresponding to the cases where each feature is used as a division feature point based on the feature values ​​of each feature in the first feature subset; and a fourth determination unit 1114 for determining the first division value of the training node based on the horizontal division value corresponding to each feature.

[0481] According to one embodiment of the present application, as shown in FIG. 37, the third determination unit 1113 in FIG. 36 includes: a first determination subunit 11131 for determining, for any one feature in the first feature subset, a splitting threshold for the any one feature based on a feature value of the any one feature; a first acquisition subunit 11132 for acquiring a first data instance identifier set and a second data instance identifier set corresponding to the any one feature based on the splitting threshold, wherein the first data instance identifier set includes data instance identifiers belonging to a first left subtree space and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space; and a second determination subunit 11133 for determining the horizontal splitting value corresponding to the any one feature based on the first data instance identifier set and the second data instance identifier set.

[0482] According to one embodiment of the present application, the first acquisition subunit 11132 further sends the splitting threshold to the client, and receives an initial data instance identifier set corresponding to the training node sent from the client, where the initial data instance identifier set is generated when the client performs node splitting for any one of the features based on the splitting threshold, and the initial data instance identifier set includes data instance identifiers belonging to the first left subtree space, and obtains the first data instance identifier set and the second data instance identifier set based on the initial data instance identifier set and all data instance identifiers.

[0483] According to an embodiment of the present application, the first acquisition subunit 11132 further compares each data instance identifier in the initial data instance identifier set with the data instance identifier of the client to obtain data instance identifiers in which anomalies exist, pre-processes the data instance identifiers in which anomalies exist to obtain the first data instance identifier set, and obtains the second data instance identifier set based on all data instance identifiers and the first data instance identifier set.

[0484] According to an embodiment of the present application, as shown in FIG. 38, the second learning submodule 112 in FIG. 34 includes: a notification unit 1121 for notifying the client to perform vertical association learning based on the second training set; a second receiving unit 1122 for receiving first gradient information of at least one third data instance identifier set of each feature sent from the client, where the third data instance identifier set includes data instance identifiers belonging to a second left subtree space, the second left subtree space is a left subtree space formed by dividing according to one of the feature values ​​of the feature, and different feature values ​​correspond to different second left subtree spaces; a fifth determining unit 1123 for respectively determining a vertical division value of each feature based on the first gradient information of each feature and total gradient information of the training node; and a sixth determining unit 1124 for determining the second division value of the training node based on the vertical division value corresponding to each feature.

[0485] According to one embodiment of the present application, as shown in FIG. 39 , the fifth determination unit 1123 in FIG. 38 includes: a second acquisition subunit 11231 for acquiring, for any one feature, second gradient information corresponding to each first gradient information based on the total gradient information and each first gradient information; a third acquisition subunit 11232 for acquiring, for each first gradient information, candidate vertical division values ​​of the any one feature based on the first gradient information and second gradient information corresponding to the first gradient information; and a selection subunit 11233 for selecting the maximum value of the candidate vertical division values ​​as the vertical division value of the any one feature.

[0486] According to an embodiment of the present application, the first gradient information includes a sum of first-order gradients of features corresponding to data instances belonging to the second left subtree space and a sum of second-order gradients of features corresponding to data instances belonging to the second left subtree space, and the second gradient information includes a sum of first-order gradients of features corresponding to data instances belonging to the second right subtree space and a sum of second-order gradients of features corresponding to data instances belonging to the second right subtree space.

[0487] According to one embodiment of the present application, as shown in FIG. 40, the federated model training apparatus 1000 further includes a determination module 160 for determining that the training node is a leaf node and obtaining a weight value of the leaf node if the training node does not satisfy a preset splitting condition, and a sending module 170 for sending the weight value of the leaf node to the client.

[0488] According to an embodiment of the present application, as shown in FIG. 41 , the determination module 160 in FIG. 40 includes a first acquisition sub-module 161 for acquiring data instances belonging to the leaf node, and a second acquisition sub-module 162 for acquiring primary gradient information and secondary gradient information of the data instances belonging to the leaf node, and acquiring a weight value of the leaf node based on the primary gradient information and the secondary gradient information.

[0489] According to one embodiment of the present application, as shown in FIG. 35, the determination submodule 113 in FIG. 34 further includes a sending unit 1133 for sending split information to the client, including the target splitting method, the target splitting features selected as feature split points, and the target splitting values.

[0490] According to an embodiment of the present application, the sending unit 1133 further sends the partitioning information to a labeled client, receives a left subtree space set sent from the labeled client, partitions the second training set based on the left subtree space set, and associates the training node with an identifier of the labeled client.

[0491] According to an embodiment of the present application, the acquisition module 110 further receives a data instance identifier sent from the client, and determines a common data instance identifier between clients based on the data instance identifier, where the common data instance identifier instructs the clients to determine the first training set and the second training set.

[0492] As a result, in the federated learning model training device provided by the present application, the server can automatically select the tendency of the matching learning method by mixing the horizontal partitioning method and the vertical partitioning method, without worrying about the data distribution method. This solves the problems that exist in the traditional federated learning model training process, such as not being able to fully utilize all the data for learning, and the poor training effect due to insufficient data utilization, and reduces the loss of the federated learning model and improves the performance of the federated learning model.

[0493] Based on the same application concept, an embodiment of the present application further provides an apparatus corresponding to a model evaluation method of another associative learning model.

[0494] 42 is a schematic structural diagram of a training device for an associative learning model provided by an embodiment of the present application. As shown in FIG. 42, a model evaluation device 2000 for the associative learning model applied to a client includes a first receiving module 210 and a dividing module 220.

[0495] Here, the first receiving module 210 receives a target splitting scheme transmitted from a server when it is determined that a training node, which is a node of one of a plurality of boosting trees, satisfies a preset splitting condition, and the splitting module 220 performs node splitting on the training node based on the target splitting scheme.

[0496] According to one embodiment of the present application, as shown in FIG. 43, the division module 220 in FIG. 42 includes a first learning submodule 221 for performing horizontal association learning based on a first training set to obtain a first division value corresponding to the training node, a second learning submodule 222 for performing vertical association learning based on a second training set to obtain a second division value corresponding to the training node, and a transmission submodule 223 for transmitting the first division value and the second division value to the server.

[0497] According to an embodiment of the present application, as shown in FIG. 44, the first learning submodule 221 in FIG. 43 includes: a first receiving unit 2211 for receiving a first feature subset available for the training node generated from the first training set by the server; a first sending unit 2212 for sending feature values ​​of each feature in the first feature subset to the server; a second receiving unit 2213 for receiving a splitting threshold for each feature sent from the server; and a first acquiring unit 2214 for acquiring an initial data instance identifier set corresponding to the training node based on the splitting threshold for each feature, and sending the initial data instance identifier set to the server, where the initial data instance identifier set instructs the server to generate a first data instance identifier set and a second data instance identifier set, where the first data instance identifier set and the initial data instance identifier set both include data instance identifiers belonging to a first left subtree space, and the second data instance identifier set includes data instance identifiers belonging to a first right subtree space.

[0498] According to one embodiment of the present application, the first acquisition unit 2214 further compares, for any one feature, a splitting threshold of the any one feature with a feature value of the any one feature, respectively, to obtain data instance identifiers whose feature values ​​are smaller than the splitting threshold, and generates the initial data instance identifier set.

[0499] According to an embodiment of the present application, as shown in FIG. 45, the second learning sub-module 222 in FIG. 43 includes: a third receiving unit 2221 for receiving a gradient information request sent from the server; a generating unit 2222 for generating a second feature subset from a second training set based on the gradient information request; a second acquiring unit 2223 for acquiring first gradient information of at least one third data instance identifier set for each feature in the second feature subset, where the third data instance identifier set includes data instance identifiers belonging to a second left subtree space, the second left subtree space is a left subtree space formed by dividing according to one of the feature values ​​of the features, and different feature values ​​correspond to different second left subtree spaces; and a second sending unit 2224 for sending the first gradient information of the third data instance identifier set to the server.

[0500] According to one embodiment of the present application, as shown in FIG. 46, the second acquisition unit 2223 in FIG. 45 includes, for any one feature, a packetization subunit 22231 for acquiring all feature values ​​of the one feature and packetizing the one feature based on the feature values, and a first acquisition subunit 22232 for acquiring first gradient information of the third data instance identifier set of each packet of the one feature.

[0501] According to one embodiment of the present application, as shown in FIG. 43, the splitting module 220 in FIG. 42 further includes a receiving sub-module 224 for receiving splitting information sent from the server, where the splitting information includes the target splitting scheme, target splitting features selected as feature split points, and the target splitting values, and a splitting sub-module 225 for performing node splitting on the training node based on the splitting information.

[0502] According to an embodiment of the present application, the splitting submodule 225 further sends the split left subtree space to the server.

[0503] According to an embodiment of the present application, as shown in FIG. 47, when the training node is a leaf node, the training apparatus 1000 for the federated model further includes: a second receiving module 230 for receiving a weight value of the leaf node sent from the server; a determining module 240 for determining a residual of each data included in the leaf node according to the weight value of the leaf node; and an input module 250 for taking the residual as a residual input of a next boosting tree.

[0504] As a result, in the training device for a federated learning model provided by the present application, the client receives the target splitting scheme sent from the server when it is determined that a training node, which is a node of one of a plurality of boosting trees, satisfies a preset splitting condition, and performs node splitting on the training node based on the target splitting scheme, thereby mixing the horizontal splitting scheme and the vertical splitting scheme to automatically select the tendency of the matching learning scheme, without worrying about the data distribution scheme, which exists in the training process of the conventional federated learning model, that is, not being able to fully utilize all the data for learning, and the training effect is poor due to insufficient data utilization, and thus the loss of the federated learning model is reduced and the performance of the federated learning model is improved.

[0505] Based on the same application concept, an embodiment of the present application further provides an electronic device.

[0506] Fig. 48 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As shown in Fig. 48, the electronic device 3000 includes a memory 310, a processor 320, and a computer program stored in the memory 310 and executable by the processor 320, and when the processor executes the program, the above-mentioned method for training an associative learning model is realized.

[0507] It should be understood by those skilled in the art that the embodiments of the present application may be provided as a method, a system, or a computer program product. Thus, the present application may use an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware. And, the present application may use the form of a computer program product embodied in one or more computer usable storage media (including, but not limited to, disk storage, CD-ROM, optical memory, etc.) that contains computer usable program code.

[0508] The present application is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block of the flowcharts and / or block diagrams, and combinations of flows and / or blocks of the flowcharts and / or block diagrams, can be realized by computer program instructions. By providing these computer program instructions to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, the instructions executed by the processor of the computer or other programmable data processing device generate an apparatus for implementing the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams.

[0509] These computer program instructions may also be stored in a computer-readable memory that directs a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture that includes an instruction apparatus that implements the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams.

[0510] These computer program instructions, when loaded into a computer or other programmable data processing device, cause the computer or other programmable device to execute a series of operational steps to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device are provided in steps for implementing the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams.

[0511] It should be noted that in the claims, any reference signs placed between parentheses shall not be interpreted as limiting the claims. The word "comprise" does not exclude the presence of components or steps not listed in the claims. The word "a" or "one" preceding a component does not exclude the presence of a plurality of such components. The application can be implemented by means of hardware comprising a plurality of distinct components and by a suitably programmed computer. In a claim enumerating a plurality of devices, a plurality of these devices may be embodied in one and the same item of hardware. The use of words such as first, second, and third does not indicate any order. These words can be interpreted as names.

[0512] Although the preferred embodiments of the present application have been described, those skilled in the art can further change and modify these embodiments after learning the basic creative concept. Therefore, the appended claims should be interpreted as including the preferred embodiments and all changes and modifications within the scope of the present application.

[0513] It is obvious that those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these variations and variations.

Claims

1. A method for training a federated learning model, the method being applied to a server, obtaining a target splitting scheme corresponding to a training node when the training node satisfies a preset splitting condition, the training node being a node of one boosted tree among a plurality of boosted trees; notifying a client to perform node splitting based on the target splitting scheme; performing a next round of training using a left subtree node generated by splitting the training node as a new training node until the updated training node no longer satisfies the preset splitting condition; performing a next round of training on another non-leaf node of the one boosted tree as a new training node; If the node data sets of the plurality of boosted trees are all empty, stopping the training and generating a target association learning model; A method for training a federated learning model, including:

2. obtaining a target split scheme corresponding to the training node, According to a first training set, a horizontal federated learning is performed in cooperation with the client to obtain a first split value corresponding to the training node; According to a second training set, a vertical federated learning is performed in cooperation with the client to obtain a second split value corresponding to the training node; determining a target division scheme corresponding to the training node based on the first division value and the second division value; The method for training an associative learning model according to claim 1 , comprising:

3. determining a target division scheme corresponding to the training node based on the first division value and the second division value; determining a larger one of the first split value and the second split value as a target split value corresponding to the training node; determining a splitting scheme corresponding to the training node based on the target split value; The method for training an associative learning model according to claim 2 , comprising:

4. A step of performing horizontal federated learning in cooperation with the client based on the first training set to obtain a first split value corresponding to the training node, generating a first subset of features from the first training set available to the training node and transmitting the first subset of features to the client; receiving a feature value for each feature in the first feature subset transmitted from the client; determining a horizontal division value corresponding to each of the features in the first feature subset as a division feature point based on the feature value of each of the features; determining the first split value for the training node based on the horizontal split value corresponding to each of the features; The method for training an associative learning model according to claim 2 , comprising:

5. determining a horizontal division value corresponding to each of the features in the first feature subset as a division feature point based on the feature value of each of the features in the first feature subset, determining, for any one feature in the first subset of features, a splitting threshold for the one feature based on a feature value of the one feature; obtaining a first set of data instance identifiers and a second set of data instance identifiers corresponding to the one of the features based on the splitting threshold, the first set of data instance identifiers including data instance identifiers belonging to a first left subtree space, and the second set of data instance identifiers including data instance identifiers belonging to a first right subtree space; determining the horizontal split value corresponding to the one of the features based on the first set of data instance identifiers and the second set of data instance identifiers; The method for training an associative learning model according to claim 4, comprising:

6. obtaining a first set of data instance identifiers and a second set of data instance identifiers corresponding to the one of the features based on the splitting threshold, sending the split threshold to the client; receiving an initial data instance identifier set corresponding to the training node transmitted from the client, the initial data instance identifier set being generated when the client performs node splitting for the one of the features based on the splitting threshold, the initial data instance identifier set including data instance identifiers belonging to the first left subtree space; obtaining the first set of data instance identifiers and the second set of data instance identifiers based on the initial set of data instance identifiers and all data instance identifiers; The method for training an associative learning model according to claim 5, comprising:

7. performing vertical federated learning in cooperation with the client based on the second training set to obtain a second split value corresponding to the training node; notifying the client to perform vertical association learning based on the second training set; receiving first gradient information of at least one third set of data instance identifiers for each feature sent from the client, the third set of data instance identifiers including data instance identifiers belonging to a second left subtree space, the second left subtree space being a left subtree space formed by dividing according to one of the feature values ​​of the feature, different feature values ​​corresponding to different second left subtree spaces; determining a vertical split value for each feature based on the first gradient information for each feature and the total gradient information for the training nodes; determining the second split value for the training node based on a vertical split value corresponding to each feature; The method for training an associative learning model according to claim 2 , comprising:

8. determining a vertical split value for each feature based on the first gradient information for each feature and the total gradient information for the training nodes, For any one of the features, obtaining second gradient information corresponding to each of the first gradient information based on the total gradient information and each of the first gradient information; For each first gradient information, obtaining a candidate vertical division value of the one feature based on the first gradient information and a second gradient information corresponding to the first gradient information; selecting a maximum value of the candidate vertical split values ​​as a vertical split value for the one of the features; The method for training an associative learning model according to claim 7, comprising:

9. if the training node does not satisfy a preset splitting condition, determining that the training node is a leaf node and obtaining a weight value of the leaf node; sending the weight value of the leaf node to the client; The method for training an associative learning model according to claim 1 , comprising:

10. The step of obtaining a weight value of the leaf node comprises: obtaining a data instance belonging to the leaf node; obtaining primary gradient information and secondary gradient information of the data instances belonging to the leaf node, and obtaining a weight value of the leaf node based on the primary gradient information and the secondary gradient information; The method for training an associative learning model of claim 9, comprising:

11. before informing the client to perform node splitting based on the target splitting scheme, 4. The method for training a federated learning model of claim 3, further comprising the step of sending split information to the client, the split information including the target split scheme, target split features selected as feature split points, and the target split values.

12. When the target division method is a vertical division method, before informing the client to perform node splitting based on the target splitting scheme, sending said split information to the labeled clients; receiving a set of left subtree spaces sent from the labeled clients; splitting the second training set based on the left subtree space set; associating said training nodes with identifiers of said labeled clients; The method for training an associative learning model of claim 11, comprising:

13. After the step of informing the client to perform node splitting based on the target splitting method, obtaining the updated training nodes; if it is determined that the updated training node satisfies a training stopping condition, stopping the training and generating a target associative learning model; obtaining a validation set and validating the target federated learning model in cooperation with a validation client, the validation client being one of the clients participating in training the federated learning model; The method for training an associative learning model according to claim 1 .

14. A method for training an associative learning model, the method being applied to a client, receiving a target splitting scheme sent from a server when it is determined that a training node satisfies a preset splitting condition, the training node being a node of one boosting tree among a plurality of boosting trees; performing node splitting on the training nodes based on the target splitting scheme; A method for training a federated learning model, including:

15. After performing node splitting on the training nodes based on the target splitting scheme, The method for training an associative learning model of claim 14, further comprising the steps of receiving a validation set sent from the server, and validating a target associative learning model based on the validation set.

16. Validating a target associative learning model based on the validation set, receiving a data instance identifier in the validation set and split information of a validation node sent from the server, the validation node being a node of one boosting tree among a plurality of boosting trees; determining a node progression direction of the verification node based on the data instance identifier and the division information; sending the node direction to the server, so that the server enters a next node based on the node direction and makes the next node the updated verification node; 16. The method for training an associative learning model of claim 15, comprising:

17. determining a node progression direction of the verification node based on the data instance identifier and the division information, determining, based on the data instance identifier, a feature value for each feature corresponding to the data instance identifier; determining the node progression direction based on the division information and the feature value of each of the features; 20. The method for training an associative learning model of claim 16, comprising:

18. if all of the data instance identifiers in the validation set have been validated, receiving a model prediction value for the data instance represented by the data instance identifier transmitted from the server; obtaining a final validation result based on the model prediction value, and comparing the validation result with a previous validation result to generate validation instruction information for instructing whether to reserve and use the target associative learning model; sending the verification instruction information to the server; 20. The method for training an associative learning model of claim 16, comprising:

19. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein when the processor executes the program, the method for training an associative learning model according to any one of claims 1 to 13 or claims 14 to 18 is realized.

20. A computer-readable storage medium having a computer program stored thereon, A computer-readable storage medium which, when the program is executed by a processor, implements the method for training an associative learning model according to any one of claims 1 to 13 or claims 14 to 18.

Citation Information

Patent Citations

  • Federated training-based sample prediction methods, devices, and storage media

    CN109165683B

  • Distributed machine learning system, apparatus, and method

    JP2019526851A

  • Distributed Machine Learning Systems, Apparatus, and Methods

    US20180018590A1