Federal learning model training method and device and electronic equipment
By acquiring and aligning the target virtual fusion data sets of data users and providers, performing feature binning and segmentation point determination, the hybrid federated learning model training of the tree model is realized, which solves the problem of the inability to combine vertical and horizontal federation in the existing technology. The problem of learning models improves the collaborative training capabilities of the model.
Patent Information
- Application Number
- CN202410883641.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-24
AI Technical Summary
Existing federated learning solutions are limited to one-way vertical or one-way horizontal federated learning, and cannot effectively combine vertical and horizontal federated learning models, resulting in the inability to train hybrid federated learning models, especially tree models.
By obtaining the target virtual fusion data set between data users and data providers, align data samples and features, binning features, determine the optimal split point, realize collaborative training of tree federated learning models, and generate hybrid federated learning models. .
The hybrid federated learning model training of the tree model is realized, which improves the ability to utilize data samples and features, avoids the operation of weighted averaging of parameters, and enhances the collaborative training capabilities of the model.
Smart Images

Figure CN118690875A
Abstract
Description
Technical Field
[0001] The present application mainly relates to the field of computer technology, and in particular to a method, device and electronic device for training a federated learning model. Background Art
[0002] With the development of privacy-preserving computing, federated learning has gradually become a research focus. Federated learning allows data to be distributed across different devices and networks without being visible to each other, solving security issues such as privacy leakage in data collaboration tasks.
[0003] Federated learning includes vertical federated learning (VFL) and horizontal federated learning (HFL). Vertical federated learning means that the data samples of different participants have a large overlap, but the overlap of sample features is not high, that is, data sample union, while horizontal federated learning means that the data of different participants have a large feature overlap, but the overlap of data samples is not high, that is, data feature union.
[0004] At present, the mainstream federated learning solutions are limited to one-way federated learning (one-way vertical federated learning or one-way horizontal federated learning). In actual application scenarios, vertical federated learning and horizontal federated learning can each solve different practical problems. However, as more and more application scenarios emerge, hybrid federated learning that requires the use of both vertical federated learning and horizontal federated learning has emerged.
[0005] Some hybrid federated learning models first obtain multiple complete vertical federated learning models by performing vertical federated learning, and then perform horizontal federated learning on these multiple vertical federated learning models, and finally realize the training of the hybrid federated learning model. In practical applications, most commonly used machine learning algorithm models are parametric models (i.e. statistical models with a fixed number of parameters). Therefore, when training the parametric model, the parameters of the model will be weighted and averaged. If there are no parameters, weighted averaging cannot be performed, so it is impossible to simply combine the vertical federated learning technology and the horizontal federated learning technology to obtain a hybrid federated learning model. For example, the currently commonly used tree model is a type of non-parametric model. Based on the above method, it is impossible to obtain a hybrid federated learning model of the tree model by simply combining the vertical federated learning technology and the horizontal federated learning technology. Summary of the invention
[0006] The present application provides a federated learning model training method, device and electronic device to implement the training of a hybrid federated learning model based on a tree model, thereby improving the federated learning model's ability to utilize data samples and data features.
[0007] In a first aspect, the present application provides a federated learning model training method, which is applied to a federated learning system, wherein the federated learning system includes a data user including labeled data and N data providers that do not include labeled data, and the method includes:
[0008] Obtain target virtual fusion data sets corresponding to N data providers and data users respectively, where the target virtual fusion data sets are obtained by aligning data samples and data features of the data users and data providers respectively, and N is a positive integer greater than or equal to 2;
[0009] Perform feature binning on each data feature in the multiple target virtual fusion data sets to obtain multiple candidate segmentation points for each data feature in the multiple target virtual fusion data sets;
[0010] Determine the optimal segmentation point according to the splitting gain values corresponding to each of the multiple candidate segmentation points;
[0011] The nodes in the federated learning model are split according to the optimal split point until the federated learning model meets the preset conditions and generates the target federated learning model.
[0012] Through the above method, when training a tree federated learning model, there is no need to perform weighted averaging operations on the model parameters, and the data user with labeled data and multiple data providers with unlabeled data can perform collaborative training of the tree federated learning model.
[0013] In an optional implementation, the target virtual fusion data set is obtained by:
[0014] Aligning the first data set of the data user with the second data sets of the N data providers to obtain the third data sets of the N data providers, wherein the third data sets include the common data samples of the N data providers and the data user;
[0015] Performing data feature alignment on the second data sets of the N data providers to determine the first data features, the second data features and the private features of the N data providers, and determining the fourth data sets of the N data providers according to the usage scope of the data features jointly determined by the N data providers; wherein the first data features represent data features included by all the N data providers, and the second data features represent data features included by at least two of the N data providers;
[0016] The target virtual fusion dataset is obtained based on the third dataset and the fourth dataset.
[0017] Through the above method, the data feature dimension and data sample dimension of the training data are expanded, and the data provider and the data user can interact with each other based on each virtual fusion data set.
[0018] In an optional implementation, aligning data samples of the first data set of the data user with the second data sets of N data providers to obtain respective third data sets of the N data users includes:
[0019] Performing data intersection processing on the first data set and the second data sets corresponding to the N data providers, respectively, to obtain fused data sets of the N data users;
[0020] Intersect the fused data sets of N data users in pairs to obtain the overlapping data samples corresponding to every two fused data sets;
[0021] According to the preset rules, the overlapping data samples corresponding to every two fused data sets are deduplicated to obtain a third data set.
[0022] Through the above method, the virtual fusion data set between data providers is deduplicated, which can reduce the duplicate samples participating in hybrid federated learning, so as to improve the learning efficiency of hybrid federated learning.
[0023] In an optional implementation, after respectively acquiring the target virtual fusion data sets corresponding to the data users from the N data providers, the method further includes:
[0024] Calculate the first-order gradient and second-order gradient corresponding to all data samples of N data providers, and encrypt the calculated first-order gradient and second-order gradient to obtain the encrypted first-order gradient and second-order gradient of all data samples;
[0025] According to the target virtual fusion data set to which each data sample belongs, the encrypted first-order gradient and second-order gradient are sent to the corresponding data provider.
[0026] Through the above method, the first-order gradient and second-order gradient of the samples in each target virtual fusion dataset are calculated respectively, and each data provider can obtain the gradient information of its corresponding target virtual fusion dataset, which is convenient for information exchange with the data user.
[0027] In an optional implementation, each data feature in the multiple target virtual fusion data sets is binned to obtain multiple candidate segmentation points for each data feature in the multiple target virtual fusion data sets, including:
[0028] Respectively obtain the minimum eigenvalue, the maximum eigenvalue, and the number of samples of the common features of the N data providers, wherein the common features include the first data feature and the second data feature;
[0029] Determine the global minimum eigenvalue, global maximum eigenvalue and total number of samples corresponding to all common features of N data providers based on the minimum eigenvalue, maximum eigenvalue and number of samples;
[0030] Based on the global minimum eigenvalue, the global maximum eigenvalue and the total number of samples, multiple candidate segmentation points for each data feature in multiple target virtual fusion data sets are determined.
[0031] Through the above method, by determining the owner of the optimal split point, the data user with labeled data and the data provider with unlabeled data can perform collaborative training of the tree model.
[0032] In an optional implementation, after determining a plurality of candidate segmentation points for each data feature in a plurality of target virtual fusion data sets, the method further includes:
[0033] Determine candidate segmentation points of common features of N data providers;
[0034] Based on the candidate segmentation points, the first left node cumulative histogram corresponding to each data provider is calculated;
[0035] According to the candidate segmentation points corresponding to each data feature of the data user, the second left node cumulative histogram corresponding to the data user is calculated;
[0036] Calculating a first global cumulative histogram corresponding to the N data providers according to the first left node cumulative histogram, and calculating a second global cumulative histogram corresponding to the data user according to the second left node cumulative histogram;
[0037] Obtaining a target global cumulative histogram according to the first global cumulative histogram and the second global cumulative histogram;
[0038] Based on the target global cumulative histogram, the optimal segmentation point of each data feature in multiple target virtual fusion data sets is determined.
[0039] By using the above method, the left node cumulative histogram is aligned to obtain a global cumulative histogram, thereby realizing the optimal splitting gain calculation and determining the optimal splitting point.
[0040] In an optional implementation, based on the candidate segmentation points, the first left node cumulative histogram corresponding to each data provider is calculated, including:
[0041] Calculate the local left node cumulative histogram corresponding to each of the candidate segmentation points according to the first-order gradient and the second-order gradient corresponding to each of the data samples;
[0042] The local left node cumulative histograms corresponding to the candidate segmentation points are sent to the data user for aggregation to obtain the left node cumulative histograms corresponding to each data provider.
[0043] In an optional embodiment, the method further includes:
[0044] If each data provider includes a second data feature and a private feature, the second data feature and the private feature are deleted, and the private feature is a feature unique to the data provider; or,
[0045] For each second data feature and private feature, all data samples of the data provider that does not include the second data feature or the private feature and all data samples of the data providers that have the second data feature or the private feature and have missing values are classified into virtual missing bins, and when calculating the first left node cumulative histogram, the virtual missing bins are divided into the right bins or left bins corresponding to the candidate split points corresponding to the second data feature or the private feature.
[0046] Through the above method, the private features of each data provider are processed in different ways, so that the amount of data can be reduced when the private features are not needed. When the private features are needed, the amount of information of this part of the feature data will not be lost due to not using the unaligned private features.
[0047] In an optional implementation, the preset conditions for generating the target federated learning model include at least one of the following:
[0048] There are no nodes that need to be split or all nodes are leaf nodes; the number of training times of the federated learning model is greater than or equal to the preset number of training times; the training time of the federated learning model is greater than or equal to the preset training time.
[0049] Through the above method, the training of the model can be stopped in time according to the preset conditions to prevent the model from overfitting.
[0050] In a second aspect, the present application provides a federated learning model training device, the device comprising:
[0051] An acquisition module is used to respectively acquire target virtual fusion data sets corresponding to N data providers and data users, where the target virtual fusion data sets are obtained by aligning data samples and data features of the data users and data providers, respectively, and N is a positive integer greater than or equal to 2;
[0052] A processing module, used for performing feature binning on each data feature in the multiple target virtual fusion data sets to obtain multiple candidate segmentation points for each data feature in the multiple target virtual fusion data sets;
[0053] A determination module, used for determining an optimal segmentation point according to the splitting gain values corresponding to each of the plurality of candidate segmentation points;
[0054] The training module is used to split the nodes in the federated learning model according to the optimal split point until the federated learning model meets the preset conditions and generates the target federated learning model.
[0055] In an optional implementation, the target virtual fusion data set is obtained by:
[0056] Aligning the first data set of the data user with the second data sets of the N data providers to obtain the third data sets of the N data providers, wherein the third data sets include the common data samples of the N data providers and the data user;
[0057] Performing data feature alignment on the second data sets of the N data providers to determine the first data features, the second data features and the private features of the N data providers, and determining the fourth data sets of the N data providers according to the usage scope of the data features jointly determined by the N data providers; wherein the first data features represent data features included by all the N data providers, and the second data features represent data features included by at least two of the N data providers;
[0058] The target virtual fusion dataset is obtained based on the third dataset and the fourth dataset.
[0059] In an optional implementation, when aligning data samples of the first data set of the data user with the second data sets of N data providers to obtain respective third data sets of the N data users, the acquisition module is specifically used to:
[0060] Performing data intersection processing on the first data set and the second data sets corresponding to the N data providers, respectively, to obtain fused data sets of the N data users;
[0061] Intersect the fused data sets of N data users in pairs to obtain the overlapping data samples corresponding to every two fused data sets;
[0062] According to the preset rules, the overlapping data samples corresponding to every two fused data sets are deduplicated to obtain a third data set.
[0063] In an optional implementation, after respectively acquiring the target virtual fusion data sets corresponding to the data users from the N data providers, the acquisition module is further configured to:
[0064] Calculate the first-order gradient and second-order gradient corresponding to all data samples of N data providers, and encrypt the calculated first-order gradient and second-order gradient to obtain the encrypted first-order gradient and second-order gradient of all data samples;
[0065] According to the target virtual fusion data set to which each data sample belongs, the encrypted first-order gradient and second-order gradient are sent to the corresponding data provider.
[0066] In an optional implementation, when performing feature binning on each data feature in a plurality of target virtual fusion data sets to obtain a plurality of candidate segmentation points for each data feature in the plurality of target virtual fusion data sets, the processing module is specifically used to:
[0067] Respectively obtain the minimum eigenvalue, the maximum eigenvalue, and the number of samples of the common features of the N data providers, wherein the common features include the first data feature and the second data feature;
[0068] Determine the global minimum eigenvalue, global maximum eigenvalue and total number of samples corresponding to all common features of N data providers based on the minimum eigenvalue, maximum eigenvalue and number of samples;
[0069] Based on the global minimum eigenvalue, the global maximum eigenvalue and the total number of samples, multiple candidate segmentation points for each data feature in multiple target virtual fusion data sets are determined.
[0070] In an optional implementation, after determining a plurality of candidate segmentation points for each data feature in a plurality of target virtual fusion data sets, the processing module is further configured to:
[0071] Determine candidate segmentation points of common features of N data providers;
[0072] Based on the candidate segmentation points, the first left node cumulative histogram corresponding to each data provider is calculated;
[0073] According to the candidate segmentation points corresponding to each data feature of the data user, the second left node cumulative histogram corresponding to the data user is calculated;
[0074] Calculating a first global cumulative histogram corresponding to the N data providers according to the first left node cumulative histogram, and calculating a second global cumulative histogram corresponding to the data user according to the second left node cumulative histogram;
[0075] Obtaining a target global cumulative histogram according to the first global cumulative histogram and the second global cumulative histogram;
[0076] Based on the target global cumulative histogram, the optimal segmentation point of each data feature in multiple target virtual fusion data sets is determined.
[0077] In an optional implementation, when calculating and obtaining the first left node cumulative histogram corresponding to each data provider based on the candidate segmentation point, the processing module is specifically configured to:
[0078] Calculate the local left node cumulative histogram corresponding to each of the candidate segmentation points according to the first-order gradient and the second-order gradient corresponding to each of the data samples;
[0079] The local left node cumulative histograms corresponding to the candidate segmentation points are sent to the data user for aggregation to obtain the left node cumulative histograms corresponding to each data provider.
[0080] In an optional implementation, the processing module is further used for:
[0081] If each data provider includes a second data feature and a private feature, the second data feature and the private feature are deleted; or,
[0082] For each second data feature and private feature, all data samples of the data provider that does not include the second data feature or the private feature and all data samples of the data providers that have the second data feature or the private feature and have missing values are classified into virtual missing bins, and when calculating the first left node cumulative histogram, the virtual missing bins are divided into the right bins or left bins corresponding to the candidate segmentation points corresponding to the second data feature or the private feature.
[0083] In an optional implementation, the preset conditions for generating the target federated learning model include at least one of the following:
[0084] There are no nodes that need to be split or all nodes are leaf nodes; the number of training times of the federated learning model is greater than or equal to the preset number of training times; the training time of the federated learning model is greater than or equal to the preset training time.
[0085] In a third aspect, the present application provides an electronic device, including:
[0086] Memory, used to store computer programs;
[0087] The processor is used to implement the steps of the above-mentioned training method of a federated learning model when executing the computer program stored in the memory.
[0088] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the above-mentioned training method of a federated learning model.
[0089] For each aspect from the second to the fourth aspect and the technical effects that may be achieved by each aspect, please refer to the above description of the technical effects that can be achieved by the first aspect and various possible solutions in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0090] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0091] Figure 1 A schematic diagram of an implementation flow of a federated learning model training method provided in an embodiment of the present application;
[0092] Figure 2 A schematic diagram of the architecture of a federated learning system provided in an embodiment of the present application;
[0093] Figure 3 A schematic diagram of a data feature binning result provided in an embodiment of the present application;
[0094] Figure 4 A schematic diagram of the structure of a federated learning device provided in an embodiment of the present application;
[0095] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0096] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0097] It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. A and B are connected, which can represent two situations: A and B are directly connected and A and B are connected through C. In addition, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0098] The embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0099] At present, the mainstream federated learning solutions are limited to one-way federated learning (one-way vertical federated learning or one-way horizontal federated learning). In actual application scenarios, vertical federated learning and horizontal federated learning can each solve different practical problems. However, as more and more application scenarios emerge, hybrid federated learning that requires the use of both vertical federated learning and horizontal federated learning has emerged.
[0100] Some hybrid federated learning models first obtain multiple complete vertical federated learning models by performing vertical federated learning, and then perform horizontal federated learning on these multiple vertical federated learning models, and finally realize the training of the hybrid federated learning model. In practical applications, most commonly used machine learning algorithm models are parametric models (i.e. statistical models with a fixed number of parameters). Therefore, when training the parametric model, the parameters of the model will be weighted and averaged. If there are no parameters, weighted averaging cannot be performed, so it is impossible to simply combine the vertical federated learning technology and the horizontal federated learning technology to obtain a hybrid federated learning model. For example, the currently commonly used tree model is a type of non-parametric model. Based on the above method, it is impossible to obtain a hybrid federated learning model of the tree model by simply combining the vertical federated learning technology and the horizontal federated learning technology.
[0101] In order to solve the above technical problems, the present application provides a method for training a federated learning model, which includes: first, respectively obtaining the target virtual fusion data sets corresponding to each of N data providers and data users, wherein the target virtual fusion data sets are obtained by aligning data samples and data features of the data users and data providers, respectively, and N is a positive integer greater than or equal to 2; then, feature binning is performed on each data feature in multiple target virtual fusion data sets to obtain multiple candidate segmentation points for each data feature in each of the multiple target virtual fusion data sets; further, the optimal segmentation point is determined according to the splitting gain values corresponding to each of the multiple candidate segmentation points; finally, the nodes in the federated learning model are split according to the optimal segmentation point until the federated learning model meets the preset conditions and generates the target federated learning model. Through the above method, the training of the tree-type hybrid federated learning model can be realized. During the training process, it is no longer dependent on the parameters or weights of the trained vertical federated model and the horizontal federated model, and the data user with labeled data and the data provider with multiple unlabeled data can jointly conduct collaborative training of the tree model.
[0102] It should be noted that the preferred embodiments of the present application are described below in conjunction with the drawings in the specification. The preferred embodiments described herein are only used to illustrate and explain the present application and are not used to limit the present application. In addition, the embodiments of the present application and the features in their embodiments may be combined with each other if there is no conflict.
[0103] See also Figure 1 As shown, it is a schematic diagram of the implementation process of a training method of a federated learning model provided in an embodiment of the present application. The specific implementation process of the method is as follows:
[0104] S1: respectively obtain target virtual fusion data sets corresponding to N data providers and the data users.
[0105] In the embodiments of this application, see Figure 2 As shown, the federated learning system in the embodiment of the present application includes a data user including label data and N data providers that do not include label data. Figure 2 In the system shown, data interaction in hybrid federated learning scenarios can be achieved by distinguishing between data users without data labels and data providers with data labels.
[0106] It should be noted that the target virtual fusion data set is obtained by aligning data samples and data features of the data user and the data provider, respectively. Since there are multiple data providers in the embodiment of the present application, the data user aligns data samples and data features with each data provider, respectively, to obtain the same number of target virtual fusion data sets as the number of data providers, that is, there is a target virtual fusion data set between the data user and each data provider.
[0107] Furthermore, in an embodiment of the present application, the target virtual fusion data set can be obtained in the following manner: first, the first data set of the data user is respectively aligned with the second data sets of N data providers to obtain the third data sets of the N data providers.
[0108] After aligning data samples of the first data set corresponding to the data user with the second data sets of N data providers, the third data sets of the N data users obtained respectively include the common data samples of the N data providers and the data users.
[0109] Specifically, in an embodiment of the present application, data samples of the first data set of the data user are aligned with the second data sets of N data providers respectively to obtain the third data sets of the N data providers respectively, which specifically includes: first, data intersection processing is performed on the first data set corresponding to the data user and the second data sets corresponding to the N data providers respectively to obtain the fused data sets of the N data providers respectively; then, the fused data sets of the N data providers are intersected pairwise to obtain the overlapping data samples corresponding to every two fused data sets; further, according to preset rules, the overlapping data corresponding to every two fused data sets are deduplicated to obtain the third data set of the data provider.
[0110] In the embodiment of the present application, when performing data intersection processing on a data set, a private set intersection (PSI) can be used to calculate the intersection data between the data provider and the data user. Of course, other encrypted sample alignment methods can also be used to obtain the intersection data, which is not specifically limited in the embodiment of the present application.
[0111] For example, assuming that the data user includes samples {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, data provider No. 1 includes samples {1, 2, 3, 4, 5}, data provider No. 2 includes samples {1, 4, 5, 6, 7, 13}, and data provider No. 3 includes samples {9, 10, 11, 12}, then after using PSI to align the data samples of the data user and each data provider, the fused data set of data provider No. 1 can be {1, 2, 3, 4, 5}, the fused data set of data provider No. 2 can be {1, 4, 5, 6, 7}, and the fused data set of data provider No. 3 can be {9, 10, 11, 12}.
[0112] Furthermore, the fused data sets of the N data users are intersected pairwise to obtain overlapping data samples corresponding to every two fused data sets.
[0113] For example, by intersecting the fused dataset of data provider No. 1 and the fused dataset of data provider No. 2, it can be obtained that the overlapping data samples of the fused dataset of data provider No. 1 and the fused dataset of data provider No. 2 are {1, 4, 5}.
[0114] Then, according to preset rules, the overlapping samples of the fused data set of data provider No. 1 and the fused data set of data provider No. 2 are deduplicated to obtain the third data sets of data provider No. 1 and data provider No. 2 respectively.
[0115] Optionally, when determining the attribution of overlapping data samples, the data user may make a selection based on the degree of trust in the two data providers, or may make a selection based on the data missing rate of the data sets corresponding to the data providers, retaining the samples with the smallest sample missing rate, and removing the corresponding overlapping samples in the fused data set of the other data provider. For example, the current selection is to attribute the overlapping data samples {1, 4, 5} to data provider No. 1, then the third data set corresponding to data provider No. 1 is {1, 2, 3, 4, 5}, and the third data set corresponding to data provider No. 2 is {6, 7}.
[0116] In addition, when the fused data set of data provider No. 1 is intersected with the fused data set of data provider No. 3, if the result is an empty set, it means that there are no overlapping data samples between data provider No. 1 and data provider No. 3, and the data samples of data provider No. 3 are completely retained. However, if there are overlapping data samples between data provider No. 2 and data provider No. 3, deduplication is still performed according to the rules.
[0117] Through the above method, the sample intersection results of the data provider are deduplicated, which can reduce the duplicate samples participating in hybrid federated learning, so as to improve the learning efficiency of hybrid federated learning.
[0118] Furthermore, in the embodiment of the present application, it is also necessary to align data features of N data providers.
[0119] Specifically, when aligning data features, data feature alignment is performed between every two data providers. After the data feature alignment, the first data feature, the second data feature, and the unaligned private data feature of each data provider and the other data providers are obtained. It should be noted that in the embodiment of the present application, the first data feature is a data feature possessed by N data providers, and the second data feature is a data feature possessed by at least two of the N data providers.
[0120] Exemplarily, data provider No. 1 includes data features {feature A, feature B, feature C, feature F}, data provider No. 2 includes data features {feature B, feature C, feature D, feature G}, and data provider No. 3 includes data features {feature A, feature C, feature E, feature H}. After the data providers align the data features, {feature A, feature C} are the first data features possessed by all data providers, {feature A} is the second data feature possessed by data provider No. 1 and data provider No. 3, {feature B} is the second data feature possessed by data provider No. 1 and data provider No. 2, and {feature F} is the private feature of data provider No. 1. Then, according to the usage scope of the data features jointly determined by the N data providers, the fourth data sets of the N data providers are determined. For example, in an embodiment of the present application, the first data feature, the second data feature and the private feature can be selected to form the fourth data set corresponding to each data provider. Exemplarily, the fourth data set corresponding to data provider No. 1 is {feature A, feature B, feature C}, or the first data feature and the private feature are used to form the fourth data set corresponding to each data provider. Exemplarily, the fourth data set corresponding to data provider No. 1 is {feature A, feature C, feature F}, or the first data feature and the second data feature are used to form the fourth data set corresponding to each data provider. Exemplarily, the fourth data set corresponding to data provider No. 1 is {feature A, feature C, feature F}.
[0121] Furthermore, after performing data feature alignment and data sample alignment, each data provider can obtain a target virtual fusion data set D based on the third data set and the fourth data set. j , j represents the jth sample alignment result. It should be noted that each fourth data set includes the common data features of the corresponding data user and the private data features of the data user.
[0122] In an optional implementation, after obtaining the target virtual fusion data set of each data provider, the first-order gradients and second-order gradients corresponding to each of the data samples of N data providers are calculated, and the first-order gradients and second-order gradients corresponding to each of the calculated data samples are encrypted to obtain the first-order gradients and second-order gradients of each of the data samples after encryption. Specifically, after calculating the first-order gradients and second-order gradients of all data samples, the first-order gradients and second-order gradients of each data sample calculated are homomorphically encrypted, and further, the first-order gradients and second-order gradients after homomorphic encryption can be sent to the corresponding data provider according to the target virtual fusion data set to which each data sample belongs. For example, when homomorphically encrypting the first-order gradients and second-order gradients, the Paillier homomorphic encryption algorithm can be used. Encrypting the first-order gradients and second-order gradients by the homomorphic encryption algorithm can ensure information security during data transmission.
[0123] Furthermore, according to the target virtual fusion data set to which each data sample belongs, the encrypted first-order gradient and second-order gradient are sent to the corresponding data provider. For example, if the target virtual fusion data set corresponding to data provider No. 1 includes data sample No. 1 and data sample No. 2, then according to the target virtual fusion data set to which data sample No. 1 and data sample No. 2 belong, data sample No. 1 and data sample No. 2 are sent to data provider No. 1.
[0124] In the embodiment of the present application, by using a virtual fusion data set, the expansion of data feature dimensions and data sample dimensions is achieved, and subsequent information transmission with different data providers can be based on the virtual fusion data set of the corresponding data provider.
[0125] S2: performing feature binning on each data feature in the plurality of target virtual fusion data sets to obtain a plurality of candidate segmentation points for each data feature in the plurality of target virtual fusion data sets.
[0126] In an embodiment of the present application, after obtaining the target virtual fusion data set corresponding to each data provider, it is also necessary to perform horizontal federation binning based on the target virtual fusion data sets of multiple data providers to determine multiple candidate segmentation points for each data feature in the multiple target virtual fusion data sets.
[0127] Specifically, when performing feature binning, first, the minimum feature value, maximum feature value and sample quantity of each common feature of each data provider are obtained. It should be noted that in the embodiment of the present application, the common feature includes the first data feature and the second data feature.
[0128] For example, a common feature of data provider No. 1 and data provider No. 2 is "age". Then, according to the statistical data of data provider No. 1, it is determined that the maximum eigenvalue and minimum eigenvalue of the "age" feature in the target virtual fusion data set of data provider No. 1 are 50 and 18 respectively, and the number of samples is 30; according to the statistical data of data provider No. 2, it is determined that the maximum eigenvalue and minimum eigenvalue of the "age" feature in the target virtual fusion data set of data provider No. 2 are 46 and 12 respectively, and the number of samples is 24. Further, according to the maximum eigenvalue, minimum eigenvalue, and number of samples of the "age" feature provided by data provider No. 1 and the maximum eigenvalue, minimum eigenvalue, and number of samples of the "age" feature provided by data provider No. 2, it is possible to determine the global maximum eigenvalue, minimum eigenvalue, and total number of samples of the "age" feature in the data of both data provider No. 1 and data provider No. 2, that is, the global maximum eigenvalue is 50, the global minimum eigenvalue is 12, and the total number of samples is 54.
[0129] Furthermore, candidate segmentation points of the multiple target virtual fusion data sets are determined according to the global maximum eigenvalue, the global minimum eigenvalue and the total number of samples.
[0130] Specifically, the purpose of determining the candidate segmentation points is to make the number of samples in each feature bin roughly equal, so as to achieve equal frequency binning. Optionally, in the embodiment of the present application, other feature binning methods may be used, such as equal width binning, to achieve equal spacing of data samples, which is not specifically limited in the embodiment of the present application.
[0131] First, when determining the candidate segmentation points, the target segmentation point ranking of the candidate segmentation points can be obtained based on the total number of samples and the number of bins.
[0132] When determining the target split point, first initialize a global split point or split point range based on the binning target and quantity. Then, each data provider calculates the number of samples in each split point or range based on local data, and encrypts the statistical information and sends it to the data user. After obtaining the statistical information of each data provider, the data user calculates the global sample distribution and determines the new split point or range. If the difference between the new split point or range and the previous split point or range is less than the preset threshold, stop binning. If the difference between the new split point or range and the previous split point or range is greater than the preset threshold, continue to the next round of query.
[0133] In each round of recursive query, if the target query value is ranked greater than the current query value, the data user calculates the average of the current query value and the global maximum value of the feature as the new round of query value. If the target query value is ranked less than the current query value, the data user calculates the average of the current query value and the global minimum value of the feature as the new round of query value. The data user sends the new round of query values to each data provider and repeats the query steps until the query value ranking is fixed and the candidate segmentation points of each of the multiple target virtual fusion data sets are obtained.
[0134] For example, suppose there are 12 feature points in total, which need to be divided into 4 boxes. In order to make the number of samples in each box roughly equal, the target segmentation points for initialization can be determined to be 3, 6, 9, and 12. If the target segmentation points should be 3, 6, 9, and 12 during the first query, but there are seven nodes to the left of the target segmentation point 6, the binning requirement is not met. Move the seventh node to the left to replace the maximum value, and repeat the query steps until the following is met. Figure 3 The target split point shown requires that the number of samples in each split node is roughly the same.
[0135] It should be noted that the above process of determining candidate segmentation points is performed for N data providers, and the above process does not need to be performed for the data features corresponding to the data users.
[0136] Furthermore, after determining the candidate segmentation points for each feature, each data provider calculates its own first left node cumulative histogram. For example, the candidate segmentation points determined by data provider No. 1 are: 3, 6, 9, 12. Based on these four candidate segmentation points, the characteristic value interval of bin No. 1 is (0, 3], the characteristic value interval of bin No. 2 is (3, 6], the candidate segmentation point of the characteristic value of bin No. 3 is (6, 9], and the characteristic value of bin No. 4 is (9, 12], and then based on the candidate segmentation points, the first left node cumulative histogram corresponding to each data provider is calculated. In addition, according to the candidate segmentation points corresponding to each data feature of the data user, the second left node cumulative histogram corresponding to the data user is calculated. For the first left node cumulative histogram corresponding to each feature, according to the candidate segmentation point, the first-order gradients of all bins to the left of the candidate segmentation point are accumulated to obtain the first-order gradient sum, and the second-order gradients are added to obtain the second-order gradient sum.
[0137] Then, according to the first global cumulative histogram and the second global cumulative histogram, a corresponding target global cumulative histogram is obtained; and through the target global cumulative histogram, the optimal segmentation point of each data feature in the target fused virtual data set is obtained.
[0138] For example, first, the bin on the left side of the candidate segmentation point 3 is determined as the left node, the first-order gradients of the features with eigenvalues of 0-3 are accumulated to obtain the first-order gradient sum, and the second-order gradients are accumulated to obtain the second-order gradient sum; or the bin on the left side of the candidate segmentation point 6 is determined as the left node, the first-order gradients of the features with eigenvalues of 1-6 are added to obtain the first-order gradient sum, and the second-order gradients are accumulated to obtain the second-order gradient sum.
[0139] In the embodiment of the present application, after determining the candidate segmentation points, each data provider packages the feature local candidate left node cumulative histogram and the corresponding binning information into a segmentation information package and sends it to the data user.
[0140] Specifically, after determining the candidate segmentation points for each feature, each data provider calculates its own local candidate left node cumulative histogram. For example, the candidate segmentation points determined by data provider No. 1 are: 3, 6, 9, 12. Based on these four candidate segmentation points, the characteristic value interval of bin No. 1 is (0, 3], the characteristic value interval of bin No. 2 is (3, 6], the candidate segmentation point of the characteristic value of bin No. 3 is (6, 9], and the characteristic value of bin No. 4 is (9, 12], and then based on the candidate segmentation points, the left node cumulative histogram corresponding to each data provider is calculated. For the left node cumulative histogram corresponding to each feature, according to the candidate segmentation point, the first-order gradients of all bins to the left of the candidate segmentation point are accumulated to obtain the first-order gradient sum, and the second-order gradients are added to obtain the second-order gradient sum.
[0141] For example, first, the bin on the left side of the candidate segmentation point 3 is determined as the left node, the first-order gradients of the features with eigenvalues of 0-3 are accumulated to obtain the first-order gradient sum, and the second-order gradients are accumulated to obtain the second-order gradient sum; or the bin on the left side of the candidate segmentation point 6 is determined as the left node, the first-order gradients of the features with eigenvalues of 1-6 are added to obtain the first-order gradient sum, and the second-order gradients are accumulated to obtain the second-order gradient sum.
[0142] The local left node cumulative histograms corresponding to the candidate segmentation points are sent to the data user for aggregation. The data user obtains the first global cumulative histogram corresponding to all data providers of each common feature by merging the local left node cumulative histograms of each data provider.
[0143] When sending the binning information to the data user, each data provider can map each bin according to the same pseudo-random mask generator to generate a bin ID mask, and generate a unique identification key for each bin. The bin ID mask corresponding to the same bin with the same feature is consistent, so the bin ID mask can be used to replace the binning information sent to the data user to perform bin alignment aggregation of the cumulative histogram of the local candidate left node of the data provider's feature.
[0144] S3: Determine an optimal segmentation point according to the splitting gain values corresponding to each of the plurality of candidate segmentation points.
[0145] In the embodiment of the present application, the data user obtains the corresponding first-order gradient and second-order gradient based on the global cumulative histogram of the data provider, and calculates the splitting gain value of each node. The splitting gain value calculation formula is as follows:
[0146]
[0147] Among them, λ and γ are the hyperparameters of the regularization term of the preset loss function, G and H are the first-order gradient and second-order gradient corresponding to the global cumulative histogram of the current split node, respectively.
[0148] By using the above calculation formula, the splitting gain values can be calculated for each of the multiple candidate segmentation points, thereby determining the optimal segmentation point among the multiple candidate segmentation points.
[0149] In an optional implementation, it is also necessary to process the private features of the data provider that are not aligned.
[0150] Specifically, if only the second data features and private features included by each data provider are used during training, the second data features and private features are directly deleted. Optionally, depending on the usage of the data features, only the private features may be deleted without deleting the second data features.
[0151] Furthermore, for each second data feature and private feature, all data samples of the data provider that does not include the second data feature or the private feature and all data samples of the data providers that have the second data feature or the private feature and have missing values can be classified into virtual missing bins, and when calculating the first left node cumulative histogram, the virtual missing bins are divided into the right bins or left bins corresponding to the candidate segmentation points corresponding to the second data feature or the private feature, that is, the first-order gradients and second-order gradients of the data samples in the virtual missing bins for the second data feature or the private feature are accumulated to the cumulative histograms of the left bins or right bins of each candidate segmentation point corresponding to the second data feature or the private feature.
[0152] S4: Split the nodes in the federated learning model according to the optimal split point until the federated learning model meets the preset conditions and generates a target federated learning model.
[0153] In an embodiment of the present application, nodes in the federated learning model are split according to the optimal splitting point until the federated learning model meets preset conditions, thereby generating a target federated learning model.
[0154] First, when performing node splitting, it is necessary to determine whether the optimal splitting point belongs to the data user or the data provider.
[0155] It should be noted that when determining the owner of the optimal split point, the split benefit values of all left and right nodes of the data provider and the data user are calculated respectively, and then the node with the largest split benefit value is selected from all left and right nodes of the data user, and the node with the largest split benefit value is selected from all left and right nodes of the data provider. The node with the largest split benefit value of the data user is compared with the node with the largest split benefit value of the data provider, and finally the optimal split point with the largest split benefit value is selected.
[0156] Specifically, if the data feature corresponding to the optimal splitting point is on the data user, the data user will split the data locally and send the left child node sample information after the split to all data providers for corresponding splitting; if the data feature corresponding to the optimal splitting point is on the data provider, the data user will send the optimal splitting point information to each data provider, and each data provider will split the node according to the optimal splitting point, and then send the local left child node sample information after the split to the data user. The data user will merge all the local left child node sample information after the split, obtain the global left child node sample information, and complete the node splitting.
[0157] In an optional implementation, when the nodes in the federated learning model are split according to the optimal split point, the data user can determine whether to enter the next round of iteration through some preset conditions. Node splitting in the federated learning model is to divide the data sample into left child nodes and right child nodes, so that the tree model generates new child nodes. Optionally, if there are no nodes that need to be split or all nodes are leaf nodes, the model parameters are saved and the target federated learning model is generated, or the number of training times of the federated learning model is greater than or equal to the preset number of training times; the training time of the federated learning model is greater than or equal to the preset training time. Of course, other preset conditions can also be used to determine whether to continue training the federated learning model, and this application does not make specific limitations here.
[0158] Based on the same inventive concept, the present application embodiment also provides a training device for a federated learning model, see Figure 4 As shown, the device includes: an acquisition module 401, a processing module 402, a determination module 403 and a training module 404; wherein:
[0159] An acquisition module 401 is used to respectively acquire target virtual fusion data sets corresponding to N data providers and data users, where the target virtual fusion data sets are obtained by aligning data samples and data features of the data users and data providers, respectively, and N is a positive integer greater than or equal to 2;
[0160] A processing module 402 is used to perform feature binning on each data feature in the multiple target virtual fusion data sets to obtain multiple candidate segmentation points for each data feature in the multiple target virtual fusion data sets;
[0161] A determination module 403 is used to determine an optimal segmentation point according to the splitting gain values corresponding to each of the plurality of candidate segmentation points;
[0162] The training module 404 is used to split the nodes in the federated learning model according to the optimal split point until the federated learning model meets the preset conditions, thereby generating a target federated learning model.
[0163] In an optional implementation, the target virtual fusion data set is obtained by:
[0164] Aligning the first data set of the data user with the second data sets of the N data providers to obtain the third data sets of the N data providers, wherein the third data sets include the common data samples of the N data providers and the data user;
[0165] Performing data feature alignment on the second data sets of the N data providers to determine the first data features, the second data features and the private features of the N data providers, and determining the fourth data sets of the N data providers according to the usage scope of the data features jointly determined by the N data providers; wherein the first data features represent data features included by all the N data providers, and the second data features represent data features included by at least two of the N data providers;
[0166] The target virtual fusion dataset is obtained based on the third dataset and the fourth dataset.
[0167] In an optional implementation, when aligning the first data set of the data user with the second data sets of N data providers to obtain the third data sets of the N data users, the acquisition module 401 is specifically used to:
[0168] Performing data intersection processing on the first data set and the second data sets corresponding to the N data providers, respectively, to obtain fused data sets of the N data users;
[0169] Intersect the fused data sets of N data users in pairs to obtain the overlapping data samples corresponding to every two fused data sets;
[0170] According to the preset rules, the overlapping data samples corresponding to every two fused data sets are deduplicated to obtain a third data set.
[0171] In an optional implementation, after respectively acquiring the target virtual fusion data sets corresponding to the data users from the N data providers, the acquisition module 401 is further configured to:
[0172] Calculate the first-order gradient and second-order gradient corresponding to all data samples of N data providers, and encrypt the calculated first-order gradient and second-order gradient to obtain the encrypted first-order gradient and second-order gradient of all data samples;
[0173] According to the target virtual fusion data set to which each data sample belongs, the encrypted first-order gradient and second-order gradient are sent to the corresponding data provider.
[0174] In an optional implementation, when performing feature binning on each data feature in a plurality of target virtual fusion data sets to obtain a plurality of candidate segmentation points for each data feature in the plurality of target virtual fusion data sets, the processing module 402 is specifically used to:
[0175] Respectively obtain the minimum eigenvalue, the maximum eigenvalue, and the number of samples of the common features of the N data providers, wherein the common features include the first data feature and the second data feature;
[0176] Determine the global minimum eigenvalue, global maximum eigenvalue and total number of samples corresponding to all common features of N data providers based on the minimum eigenvalue, maximum eigenvalue and number of samples;
[0177] Based on the global minimum eigenvalue, the global maximum eigenvalue and the total number of samples, multiple candidate segmentation points for each data feature in multiple target virtual fusion data sets are determined.
[0178] In an optional implementation, after determining a plurality of candidate segmentation points for each data feature in a plurality of target virtual fusion data sets, the processing module 402 is specifically configured to:
[0179] Determine candidate segmentation points of common features of N data providers;
[0180] Based on the candidate segmentation points, the first left node cumulative histogram corresponding to each data provider is calculated;
[0181] According to the candidate segmentation points corresponding to each data feature of the data user, the second left node cumulative histogram corresponding to the data user is calculated;
[0182] Calculating a first global cumulative histogram corresponding to the N data providers according to the first left node cumulative histogram, and calculating a second global cumulative histogram corresponding to the data user according to the second left node cumulative histogram;
[0183] Obtaining a target global cumulative histogram according to the first global cumulative histogram and the second global cumulative histogram;
[0184] Based on the target global cumulative histogram, the optimal segmentation point of each data feature in multiple target virtual fusion data sets is determined.
[0185] In an optional implementation, when calculating and obtaining the first left node cumulative histogram corresponding to each data provider based on the candidate segmentation points, the processing module 402 is specifically configured to:
[0186] According to the first-order gradient and the second-order gradient corresponding to all data samples, the local left node cumulative histogram corresponding to each of the candidate segmentation points is calculated;
[0187] The local left node cumulative histograms corresponding to the candidate segmentation points are sent to the data user for aggregation to obtain the left node cumulative histograms corresponding to each data provider.
[0188] In an optional implementation, the processing module 402 is further configured to:
[0189] If the data providers each include a second data feature and a private feature, the second data feature and the private feature are deleted; or,
[0190] For each second data feature and private feature, all data samples of the data provider that does not include the second data feature or the private feature and all data samples of the data providers that have the second data feature or the private feature and have missing values are classified into virtual missing bins, and when calculating the first left node cumulative histogram, the virtual missing bins are divided into the right bins or left bins corresponding to the candidate split points corresponding to the second data feature or the private feature.
[0191] In an optional implementation, the preset conditions when generating the target federated learning model include at least one of the following:
[0192] There are no nodes that need to be split or all nodes are leaf nodes; the number of training times of the federated learning model is greater than or equal to the preset number of training times; the training time of the federated learning model is greater than or equal to the preset training time.
[0193] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps in the above-mentioned federated learning model training method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.
[0194] Based on the same inventive concept, an electronic device is also provided in the embodiment of the present application, and the electronic device can implement the function of the training method of the aforementioned federated learning model, referring to Figure 5 As shown, the electronic device includes:
[0195] At least one processor 501, and a memory 502 connected to the at least one processor 501. The specific connection medium between the processor 501 and the memory 502 is not limited in the embodiment of the present application. Figure 5 In the example, the processor 501 and the memory 502 are connected via a bus 500. The bus 500 is Figure 5 The connections between other components are shown in bold lines, and are not intended to be limiting. The bus 500 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 501 can also be called a controller, and there is no limitation on the name.
[0196] In the embodiment of the present application, the memory 502 stores instructions that can be executed by at least one processor 501. The at least one processor 501 can execute the training method of the federated learning model discussed above by executing the instructions stored in the memory 502. The processor 501 can implement Figure 4 The functions of each module in the device shown.
[0197] Among them, the processor 501 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 502 and calling data stored in the memory 502, the various functions of the device and processing data, the device can be monitored as a whole.
[0198] In one possible design, the processor 501 may include one or more processing units, and the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0199] Processor 501 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the model training method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware processor execution, or a combination of hardware and software modules in the processor.
[0200] The memory 502 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 502 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 502 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 502 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0201] By designing and programming the processor 501, the code corresponding to the training method of the federated learning model introduced in the above embodiment can be fixed into the chip, so that the chip can execute it when running. Figure 1 The steps of the model training method of the embodiment shown. How to design and program the processor 501 is a technique known to those skilled in the art and will not be described in detail here.
[0202] Based on the same inventive concept, an embodiment of the present application also provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes the training method of the federated learning model discussed above.
[0203] In some possible implementations, various aspects of the method for training a federated learning model provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of the method for training a federated learning model according to various exemplary implementations of the present application described above in this specification.
[0204] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0205] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided 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, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0206] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0207] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0208] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. 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 modifications and variations.
Claims
1. A method for training a federated learning model, characterized in that: Applied to a federated learning system, the federated learning system includes a data user including label data and N data providers not including the label data, the method includes: Respectively obtain target virtual fusion data sets corresponding to each of the N data providers and the data user, where the target virtual fusion data sets are obtained by aligning data samples and data features of the data user and the data provider, respectively, and N is a positive integer greater than or equal to 2; Performing feature binning on each data feature in the plurality of target virtual fusion data sets to obtain a plurality of candidate segmentation points for each data feature in the plurality of target virtual fusion data sets; Determining an optimal segmentation point according to the splitting gain values corresponding to each of the plurality of candidate segmentation points; The nodes in the federated learning model are split according to the optimal split point until the federated learning model meets the preset conditions, thereby generating a target federated learning model.
2. The method according to claim 1, characterized in that The target virtual fusion data set is obtained by: Aligning the first data set of the data user with the second data sets of the N data providers to obtain respective third data sets of the N data providers, each of which includes a common data sample between the corresponding data provider and the data user; Performing data feature alignment on the respective second data sets of the N data providers to determine the first data feature, the second data feature and the private feature of the N data providers, and determining the respective fourth data sets of the N data providers according to the usage scope of the data features jointly determined by the N data providers; wherein the first data feature represents the data feature included by all the N data providers, and the second data feature represents the data feature included by at least two of the N data providers; The target virtual fusion dataset is obtained based on the third dataset and the fourth dataset.
3. The method according to claim 2, characterized in that The step of aligning the first data set of the data user with the second data sets of the N data providers to obtain respective third data sets of the N data providers includes: Performing data intersection processing on the first data set and the second data sets corresponding to the N data providers, respectively, to obtain fused data sets of the N data users; Intersecting the fused data sets of the N data providers in pairs to obtain overlapping data samples corresponding to every two fused data sets; According to preset rules, the overlapping data samples corresponding to each two fused data sets are deduplicated to obtain the third data set.
4. The method according to claim 1, characterized in that After respectively acquiring the target virtual fusion data sets corresponding to the N data providers and the data users, the method further includes: Calculating the first-order gradient and the second-order gradient corresponding to each of the data samples of the N data providers, and encrypting the calculated first-order gradient and the second-order gradient to obtain the encrypted first-order gradient and the second-order gradient of each of the data samples; According to the target virtual fusion data set to which each data sample belongs, the encrypted first-order gradient and second-order gradient are sent to the corresponding data provider.
5. The method according to claim 1 or 2, characterized in that: The step of performing feature binning on each data feature in the plurality of target virtual fusion data sets to obtain a plurality of candidate segmentation points for each data feature in the plurality of target virtual fusion data sets comprises: Respectively obtaining the minimum eigenvalue, the maximum eigenvalue, and the number of samples of the common features of the N data providers, wherein the common features include the first data feature and the second data feature; Determine the global minimum eigenvalue, the global maximum eigenvalue and the total number of samples corresponding to all common features of the N data providers based on the minimum eigenvalue, the maximum eigenvalue and the number of samples; Based on the global minimum eigenvalue, the global maximum eigenvalue and the total number of samples, multiple candidate segmentation points for each data feature in multiple target virtual fusion data sets are determined.
6. The method according to claim 5, characterized in that After determining a plurality of candidate segmentation points of each data feature in a plurality of target virtual fusion data sets, the method further comprises: Determine candidate segmentation points of common features of the N data providers; Based on the candidate segmentation points, a first left node cumulative histogram corresponding to each data provider is calculated; According to the candidate segmentation points corresponding to the data features of the data user, a second left node cumulative histogram corresponding to the data user is calculated; Calculating a first global cumulative histogram corresponding to the N data providers according to the first left node cumulative histogram, and calculating a second global cumulative histogram corresponding to the data user according to the second left node cumulative histogram; Obtaining a target global cumulative histogram according to the first global cumulative histogram and the second global cumulative histogram; Based on the target global cumulative histogram, the optimal segmentation point of each data feature in the plurality of target virtual fusion data sets is determined.
7. The method according to claim 6, characterized in that The step of calculating the first left node cumulative histogram corresponding to each data provider based on the candidate segmentation point includes: Calculate the local left node cumulative histogram corresponding to each of the candidate segmentation points according to the first-order gradients and second-order gradients corresponding to each of the data samples; The local left node cumulative histograms corresponding to the candidate segmentation points are sent to the data users for aggregation to obtain the first left node cumulative histograms corresponding to the respective data providers.
8. The method according to claim 1, 2 or 6, characterized in that: The method further comprises: If each of the data providers includes the second data feature and the private feature, the second data feature and the private feature are deleted; or, For each of the second data feature and the private feature, all data samples of the data provider that does not include the second data feature or the private feature and all data samples of the data providers that have the second data feature or the private feature and have missing values on the private feature are classified into virtual missing bins, and when calculating the first left node cumulative histogram, the virtual missing bins are divided into the right bins or left bins corresponding to the candidate segmentation points corresponding to the second data feature or the private feature.
9. The method according to claim 1, characterized in that The preset conditions for generating the target federated learning model include at least one of the following: There are no nodes that need to be split or all nodes are leaf nodes; the number of training times of the federated learning model is greater than or equal to the preset number of training times; the training duration of the federated learning model is greater than or equal to the preset training duration.
10. A federated learning training device, characterized in that: The device comprises: An acquisition module, used to respectively acquire target virtual fusion data sets corresponding to each of the N data providers and the data user, wherein the target virtual fusion data sets are obtained by aligning data samples and data features of the data user and the data provider, respectively, and N is a positive integer greater than or equal to 2; A processing module, used for performing feature binning on each data feature in the plurality of target virtual fusion data sets, and obtaining a plurality of candidate segmentation points for each data feature in the plurality of target virtual fusion data sets; A determination module, configured to determine an optimal segmentation point according to the splitting gain values corresponding to each of the plurality of candidate segmentation points; A training module is used to split the nodes in the federated learning model according to the optimal split point until the federated learning model meets the preset conditions, thereby generating a target federated learning model.
11. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 9 when executing the computer program stored in the memory.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 9 are implemented.
