Data sharing method, method for using a model using the same, and related equipment
The method addresses data sharing challenges in federated learning by aligning and fusing sub-models using privacy intersection technology and gradient boosting trees, ensuring data security and enhancing algorithm efficiency.
Patent Information
- Application Number
- CN202110324495.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-26
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-03-26
AI Technical Summary
The challenge of data islands arises when different data owners are unwilling or unable to share data, hindering collaborative model training while ensuring data privacy and security, particularly in vertical federated learning scenarios where data features are held by different parties.
A data sharing method based on federated learning aligns data samples using privacy intersection technology, constructs sub-models for each party, and fuses these sub-models to create a global model without direct data exchange, utilizing gradient boosting trees and homomorphic encryption to ensure security and efficiency.
This approach enables secure and efficient training of a global model by integrating and fusing sub-models, reducing the amount of data interaction and improving algorithm efficiency and effectiveness of the data sharing method.
Smart Images

Figure CN113051239B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer and communication technology, and in particular, to a data sharing method, a method and device for using a model applying the data sharing method, a computer-readable storage medium, and an electronic device. Background Art
[0002] Data-driven intelligent technology has been increasingly developed and applied. With the increasing industry breadth and deepening integration with the industry, many requirements have been put forward for technologies such as big data and artificial intelligence. One of the most important aspects is the consideration of data privacy and security. The value brought by data has been continuously highlighted, making each data owner realize the importance of protecting data privacy and security. Governments in various countries have also realized this and have introduced laws and regulations to protect data security. my country attaches great importance to data, and data has been listed as one of the production factors by relevant departments of my country. Different data owners hope to cooperate to bring out the value of data, but are unwilling or unable to share data, which has caused the problem of data islands. In order to solve this problem, the concept of federated learning has been proposed, hoping that multiple participants can achieve the purpose of jointly training models without sharing data, only sharing intermediate results, and unable to reverse the data. The realization of data that cannot be reversed is generally achieved through certain security technologies to ensure that each party cannot obtain the data information of other parties.
[0003] According to the different characteristics of the data held by different participants in federated learning, it can be classified into horizontal federated learning, vertical federated learning, and federated transfer learning. Horizontal federated learning is the segmentation of samples. Due to its good characteristics, a more general federated learning solution can be designed. Vertical federated learning is more difficult and has been widely used in the industry. Its characteristic is that different data holders have different feature dimensions of the same sample (often a certain customer), which is caused by the different businesses of different companies.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The embodiments of the present disclosure provide a data sharing method, a method and device for using a model applying the data sharing method, a computer-readable storage medium, and an electronic device, which can realize the training of a global model based on federated learning.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to one aspect of the present disclosure, a data sharing method based on federated learning is provided, comprising:
[0008] The computer aligns the data samples of the first participant and the second participant based on the privacy intersection technology;
[0009] The computer constructs a sub-model of the first party using the tag and the data of the first party;
[0010] The computer constructs a sub-model of the second participant based on the label and the data of the second participant;
[0011] The computer obtains a global model based on the sub-model of the first participant and the sub-model of the second participant to achieve sharing of the data of the first participant and the data of the second participant.
[0012] In one embodiment, the computer constructing the sub-model of the first party using the tag and the data of the first party includes:
[0013] The computer constructs a sub-model of the gradient boosting tree of the first participant using the label and the data of the first participant through an extreme gradient boosting tree or a light gradient boosting model at the first participant.
[0014] In one embodiment, the computer acquiring the global model according to the sub-model of the first participant and the sub-model of the second participant comprises:
[0015] The computer obtains a fusion model and a cross model according to the sub-model of the first participant and the sub-model of the second participant.
[0016] In one embodiment, the sub-model of the first participant includes a model score and a prediction result, and the sub-model of the second participant includes a model score and a prediction result, wherein the computer acquires a fusion model and a cross model according to the sub-model of the first participant and the sub-model of the second participant, comprising:
[0017] The computer obtains the fusion model according to the label, the model score of the sub-model of the first participant, and the model score of the sub-model of the second participant.
[0018] In one embodiment, the computer obtaining the fusion model according to the label, the model score of the sub-model of the first participant, and the model score of the sub-model of the second participant includes:
[0019] The computer uses a logistic regression or a gradient boosting tree model to obtain a fusion model according to the label, the model score of the sub-model of the first participant, and the model score of the sub-model of the second participant.
[0020] In one embodiment, the computer acquiring the fusion model and the cross model according to the sub-model of the first participant and the sub-model of the second participant includes:
[0021] The computer obtains the cross model according to the label, the output of the fusion model, the prediction result of the sub-model of the first participant and the prediction result of the sub-model of the second participant.
[0022] According to one aspect of the present disclosure, a method for using a global model based on federated learning is provided, characterized by comprising:
[0023] The computer obtains a prediction request from the first party;
[0024] The computer aligns the data of the prediction request based on a privacy intersection technique;
[0025] The computer uses the sub-models of each participant to predict the data of the prediction request;
[0026] The computer uses the global model to predict the prediction results of the sub-models of each participant to obtain the prediction results of the prediction request of the first participant, so as to realize the sharing of the data of the first participant and the data of the second participant.
[0027] According to one aspect of the present disclosure, a data sharing device based on federated learning is provided, comprising:
[0028] an acquisition module configured to acquire a prediction request from a first party;
[0029] An alignment module, configured to align the data of the prediction request based on a privacy intersection technique;
[0030] A sub-prediction module, configured to use the sub-models of each participant to predict the data of the prediction request;
[0031] The main prediction module is configured to use the global model to predict the prediction results of the sub-models of each participant to obtain the prediction results of the prediction request of the first participant, so as to realize the sharing of the data of the first participant and the data of the second participant.
[0032] According to one aspect of the present disclosure, there is provided an electronic device, including:
[0033] one or more processors;
[0034] The storage device is configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of the above embodiments.
[0035] According to one aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above embodiments is implemented.
[0036] In the technical solutions provided in some embodiments of the present disclosure, it is possible to implement the training of a global model based on federated learning.
[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The following drawings describe certain illustrative embodiments of the present invention, wherein like reference numerals represent like elements. These described embodiments are intended to be exemplary embodiments of the present disclosure and are not intended to be limiting in any way.
[0039] Figure 1 A schematic diagram showing an exemplary system architecture to which the data sharing method based on federated learning according to an embodiment of the present disclosure can be applied;
[0040] Figure 2 A schematic diagram showing the structure of a computer system suitable for implementing the electronic device of the embodiment of the present disclosure is shown;
[0041] Figure 3 A schematic diagram of a vertical federation tree model framework of the related art is shown;
[0042] Figure 4 A flowchart of a data sharing method based on federated learning according to an embodiment of the present disclosure is schematically shown;
[0043] Figure 5 The overall framework diagram of an embodiment of the present disclosure is shown;
[0044] Figure 6 A sub-model training framework diagram of an embodiment of the present disclosure is shown;
[0045] Figure 7 A sub-model fusion framework diagram of an embodiment of the present disclosure is shown;
[0046] Figure 8 A block diagram of a data sharing device based on federated learning according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0047] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.
[0048] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0049] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0050] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0051] Figure 1 A schematic diagram of an exemplary system architecture 100 is shown to which the data sharing method based on federated learning according to an embodiment of the present disclosure can be applied.
[0052] like Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0053] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
[0054] The staff can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. The terminal devices 101, 102, 103 can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, portable computers and desktop computers, digital movie projectors, etc.
[0055] Server 105 can be a server that provides various services. For example, a staff member uses terminal device 103 (or terminal device 101 or 102) to send a data sharing request based on federated learning to server 105. Server 105 can align the data samples of the first participant and the second participant based on the privacy intersection technology; use the label and the data of the first participant to build a sub-model of the first participant; build a sub-model of the second participant based on the label and the data of the second participant; obtain a global model based on the sub-model of the first participant and the sub-model of the second participant to achieve the sharing of the data of the first participant and the data of the second participant. Server 105 can display the trained global model based on federated learning on terminal device 103, and then the staff can view the global model based on federated learning based on the content displayed on terminal device 103.
[0056] For another example, the terminal device 103 (which may also be the terminal device 101 or 102) may be a smart TV, a VR (Virtual Reality) / AR (Augmented Reality) helmet display, or a mobile terminal such as a smart phone or tablet computer on which a navigation, online car-hailing, instant messaging, or video application (application, APP) is installed. The staff may send a data sharing request based on federated learning to the server 105 through the smart TV, VR / AR helmet display, or the navigation, online car-hailing, instant messaging, or video APP. The server 105 may obtain the global model based on federated learning based on the data sharing request based on federated learning, and return the global model based on federated learning to the smart TV, VR / AR helmet display, or the navigation, online car-hailing, instant messaging, or video APP, and then display the global model based on federated learning through the smart TV, VR / AR helmet display, or the navigation, online car-hailing, instant messaging, or video APP.
[0057] Figure 2 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the embodiment of the present disclosure is shown.
[0058] It should be noted that Figure 2The computer system 200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0059] like Figure 2 As shown, the computer system 200 includes a central processing unit (CPU) 201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 202 or the program loaded from the storage part 208 to the random access memory (RAM) 203. Various programs and data required for system operation are also stored in the RAM 203. The CPU 201, the ROM 202 and the RAM 203 are connected to each other through a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.
[0060] The following components are connected to the I / O interface 205: an input section 206 including a keyboard, a mouse, etc.; an output section 207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 208 including a hard disk, etc.; and a communication section 209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 209 performs communication processing via a network such as the Internet. A drive 210 is also connected to the I / O interface 205 as needed. A removable medium 211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 210 as needed so that a computer program read therefrom is installed into the storage section 208 as needed.
[0061] In particular, according to an embodiment of the present disclosure, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 209, and / or installed from a removable medium 211. When the computer program is executed by the central processing unit (CPU) 201, various functions defined in the method and / or device of the present application are executed.
[0062] It should be noted that the computer-readable storage medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM (Erasable Programmable Read Only Memory, Erasable Programmable Read Only Memory) or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable storage medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
[0063] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods, devices and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions selected in the box can also occur in a different order from the order selected in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0064] The modules and / or units and / or sub-units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the modules and / or units and / or sub-units described may also be set in a processor. The names of these modules and / or units and / or sub-units do not, in some cases, constitute limitations on the modules and / or units and / or sub-units themselves.
[0065] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being installed in the electronic device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiment. For example, the electronic device may implement the following Figure 4 Each step.
[0066] In related technologies, for example, machine learning methods, deep learning methods, etc. can be used to train the global model of federated learning, and different methods have different scopes of application.
[0067] In risk control scenarios, vertical federated learning has been more widely used and developed. Its characteristic is that the label is held by only one party (hereinafter referred to as the Guest party), while the other parties only have some features of the data (hereinafter referred to as the Host party). The Guest party hopes to improve the effect of the model through cooperation with the Host party to achieve the purpose of reducing risks. In this process, both the Guest party and the Host party need to ensure the security of their own data.
[0068] In risk control scenarios, tree models are a very important method due to their good interpretability. The Gradient Boosting Machine (GBM) in the tree model can effectively solve the performance problem caused by a single decision tree, integrate the powerful learning ability of multiple trees, and can handle both classification and regression problems. Therefore, it has been widely used in risk control scenarios.
[0069] In the vertical federated gradient boosting tree model training, SecureBoost proposed a solution. It includes two processes: first, encrypting and aligning the data samples, and then performing encrypted model training. The vertical federated gradient boosting tree model training process of related technologies is as follows: Figure 3 shown.
[0070] Figure 3The framework diagram of the vertical federation tree model of the related technology is schematically shown.
[0071] refer to Figure 3 :
[0072] Phase 1 Encrypted Sample Alignment
[0073] Since the training algorithm requires all participants to match the features belonging to the same data, in order to protect data privacy and security, the framework aligns data samples based on privacy intersection technology.
[0074] Second stage encryption model training
[0075] In the second stage, the data of each participant is used for federated modeling based on the aligned data. The intermediate data is protected by additive homomorphic encryption (such as Pailllier) to prevent data privacy leakage. To represent homomorphic encryption operations, additive homomorphic encryption can perform addition and multiplication operations based on ciphertext, namely: The key to building a gradient boosting tree model is: 1) The construction of the tth tree is learned with the label residual of the t-1th time as the target; 2) In the construction of each tree, it is decided how and whether each node should be split. This process is achieved by multi-party cooperation and information exchange to calculate the score of each feature after each threshold split, and the maximum score is taken for splitting.
[0076] The existing data is recorded as: Guest (Participant A) data X 0 and label y, and P hosts (participants B and C, etc.) party data X 1 , ..., X P , the data dimension of the pth participant is d p ; The modeling phase is divided into the following specific steps:
[0077] Step 0: The guest generates a homomorphic encryption key and public key, and sends the public key to each host.
[0078] Step 1: For each feature dimension k=1,...,d of the N data of the pth party p , do binning to get L quantiles S of the feature k ={s k1 , ..., s kL} as the threshold candidate to be split.
[0079] By performing the following t iterations, construct t=1, 2, ..., M trees:
[0080] Step 2: The guest calculates the predicted value for each t-1 iteration The first derivative g (initially y) n and the second-order derivative h n , and then transmitted to each Host party after homomorphic encryption.
[0081] Step 3: For each leaf node of the current tree, each participant p needs to perform the following operations to determine whether to split and how to split. The specific process is as follows:
[0082] Step 3.1: Based on L thresholds S k Divide the data samples whose id is in set I into L-1 bin intervals;
[0083] Step 3.2: Based on the binning obtained in Step 3.1, if the pth party is the Host, it uses the public key to calculate the sum of the first-order derivatives and the sum of the second-order derivatives in each box and sends them to the Guest for decryption; if it is the Guest, it directly calculates the plaintext.
[0084] Step 3.3: The guest calculates the score of each feature and each split based on the aggregated values of all first-order derivatives and second-order derivatives. If the maximum score is less than the threshold γ, no split is performed. Otherwise, the current node is split according to the corresponding attribute and threshold to obtain the corresponding two leaf nodes and their respective sample id sets I L and I R .
[0085] Step 4: For each leaf node of the tth tree, loop through Step 3 until all leaf nodes can no longer be split or the depth of the tree reaches the maximum depth set. The guest calculates the optimal weight w for each leaf node. j , then the tth tree is constructed.
[0086] Step 5: Update the prediction results of each current sample based on the t trees constructed previously
[0087] From this federated learning process, we can see that during the modeling process, the Guest and Host cannot obtain each other's data information, ensuring the data security of all participants.
[0088] The disadvantages of the above-mentioned federated gradient boosting tree model method are:
[0089] 1. When constructing each node of the tree model, the interactive information between the guest and the host is required, and the amount of calculation and data transmission required is huge, resulting in low algorithm efficiency. Different participants are often transmitted through the public network, and the geographical span is large, resulting in a lot of consumption for frequent data transmission.
[0090] 2. The construction of each node and each tree of the tree model is strongly dependent on all participants and cannot be carried out in parallel, resulting in low algorithm operation efficiency.
[0091] Figure 4 The flowchart of the data sharing method based on federated learning according to one embodiment of the present disclosure is schematically shown. The method steps of the embodiment of the present disclosure can be executed by a computer, wherein the computer can be a terminal device, a server or a server cluster composed of multiple servers.
[0092] The method steps of the embodiments of the present disclosure may also be executed by a terminal device, or by a server, or by a terminal device and a server interacting with each other. Figure 1 The server 105 in the embodiment is executed, but the present disclosure is not limited to this.
[0093] In step S410, the computer aligns data samples of the first participant and the second participant based on the privacy intersection technology.
[0094] In this step, the computer aligns the data samples of the first participant and the second participant based on the privacy intersection technology.
[0095] Figure 5 The overall framework diagram of an embodiment of the present disclosure is shown. Figure 5 , the number of participants is 3, but the present disclosure is not limited to this, and the number of participants can be more than or equal to 2. Figure 5 The first participant is, for example, participant A, and the second participant is, for example, participant B or participant C. Figure 5 The "small amount of interaction" in the above text corresponds to the contents of Step 2 and Step 3.2, for example.
[0096] This step corresponds to Figure 5 In the encryption sample alignment, since the training algorithm requires all participants to match the features belonging to the same data, in order to protect data privacy and security, the framework aligns the data samples based on the privacy intersection technology.
[0097] In the embodiments of the present disclosure, the terminal device may be implemented in various forms. For example, the terminal described in the present disclosure may include mobile terminals such as mobile phones, tablet computers, laptop computers, PDAs, portable media players (PMPs), modeling devices for global models of federated learning, wearable devices, smart bracelets, pedometers, robots, driverless cars, and fixed terminals such as digital TVs (televisions) and desktop computers.
[0098] In step S420, the computer constructs a sub-model of the first party using the tag and the data of the first party.
[0099] In this step, the computer uses the label and the data of the first party to construct a sub-model of the first party. In one embodiment, the computer uses the label and the data of the first party to construct the sub-model of the first party, including: the first party uses the label and the data of the first party to construct a sub-model of the gradient boosting tree of the first party through an extreme gradient boosting tree or a light gradient boosting model. In one embodiment, the label can be the purpose or goal of the established global model analysis.
[0100] Figure 6 FIG. 1 shows a sub-model training framework diagram of an embodiment of the present disclosure. Figure 5 and Figure 6 :
[0101] First, use the label and the data of the Guest (the first participant or participant A) to build a sub-model of the gradient boosting tree (the sub-model of the first participant) using methods such as XGBoost (eXtremeGradient Boosting) or LightGBM (Light Gradient BoostingMachine). The following takes XGBoost as an example to give the main steps, and builds t=1, 2, ..., M trees by performing the following t iterations:
[0102] Step 1.1: For each feature dimension k=1,...,d of all data, bin the feature to obtain L quantiles S k ={s k1 , ..., s kL} as the threshold candidate to be split.
[0103] Step 1.2: For each leaf node of the current tree, perform the following operations to determine whether it needs to be split and how to split it. The sample set to be split is recorded as I. The initial node is the root node, and the sample set is all samples. The specific process is as follows:
[0104] According to the threshold S k Divide the data samples whose id is in set I into different box intervals;
[0105] Based on the obtained bins, the guest calculates the aggregated values of the first-order derivative and the second-order derivative, and then calculates the score of each feature for splitting at each threshold. If the maximum score is still less than the threshold γ, then no splitting is done. Otherwise, the current node is split according to the corresponding attributes and thresholds to obtain the corresponding two leaf nodes and their respective sample id sets I L and I R .
[0106] Step 1.3: For each leaf node of the t-th tree, loop through step 1.2 until all leaf nodes can no longer be split or the depth of the tree reaches the set maximum depth, calculate the optimal weight of each leaf node, and the t-th tree of the Guest sub-model is constructed.
[0107] In step S430, the computer constructs a sub-model of the second participant based on the label and the data of the second participant.
[0108] In this step, the computer constructs a sub-model of the second participant based on the label and the data of the second participant.
[0109] refer to Figure 5 and Figure 6 :
[0110] For each host party (second party, party B or party C), use the label and host party data to build its own gradient boosting tree sub-model using methods such as XGBoost or LightGBM. The method of building the sub-model is to combine the data label of the guest party and each host party, and use homomorphic encryption to complete the following Figure 6 The steps shown here build your own sub-model (refer to Figure 3 Corresponding related SecureBoost solutions).
[0111] In step S440, the computer obtains a global model based on the sub-model of the first participant and the sub-model of the second participant to achieve sharing of the data of the first participant and the data of the second participant.
[0112] In this step, the computer obtains a global model according to the sub-model of the first participant and the sub-model of the second participant. In one embodiment, the computer obtains a global model according to the sub-model of the first participant and the sub-model of the second participant, including: the computer obtains a fusion model and a cross model according to the sub-model of the first participant and the sub-model of the second participant. In one embodiment, the sub-model of the first participant includes a model score and a prediction result, and the sub-model of the second participant includes a model score and a prediction result, wherein the computer obtains a fusion model and a cross model according to the sub-model of the first participant and the sub-model of the second participant, including: the computer obtains the fusion model according to the label, the model score of the sub-model of the first participant, and the model score of the sub-model of the second participant. In one embodiment, the computer obtains the fusion model according to the label, the model score of the sub-model of the first participant, and the model score of the sub-model of the second participant, including: the computer uses a logistic regression or a gradient boosting tree model to obtain a fusion model according to the label, the model score of the sub-model of the first participant, and the model score of the sub-model of the second participant. In one embodiment, the computer obtains the fusion model and the cross model based on the sub-model of the first participant and the sub-model of the second participant, including: the computer obtains the cross model based on the label, the output of the fusion model, the prediction result of the sub-model of the first participant and the prediction result of the sub-model of the second participant.
[0113] Figure 7 FIG. 1 shows a sub-model fusion framework diagram of an embodiment of the present disclosure. Figure 7 :
[0114] The sub-models of each participant are integrated to obtain the prediction output result of the global model (integrated model + cross model). The specific steps are as follows:
[0115] Step 3.1 Based on each party’s sub-model f p and data of each party Get the mapping score (model score) of the sub-model output And the corresponding classification results (prediction results) Divide the mapping Direct fusion to get output The selection of the fusion model (direct fusion model) can use logistic regression or gradient boosting tree model. The input y can be, for example, a label, and the fusion model is constructed based on the label and the model scores of each participant.
[0116] Step 3.2 The guest (first participant, participant A) will classify the sub-model The cross model is trained as the data features of each party. The goal of the cross model is to cross the classification results of each sub-model to fit the residual of the direct fusion model, that is, The cross model can use the gradient boosting tree model. The cross model is constructed based on the label minus the output of the fusion model and the prediction results of each participating sub-model. The final prediction result is the output of the fusion model plus the output of the cross model.
[0117] The key point of the disclosed framework is that the designed solution does not directly use global data for modeling, avoiding the consumption caused by frequent data interaction. Instead, each party first models the sub-model with higher efficiency based on local data. The output mapping points of the sub-model modeling are directly fused, and the output classification results of the sub-model are fused to fit the residual of the direct fusion to obtain the final prediction result. The confidentiality of the sub-model enables this method to effectively protect data privacy.
[0118] The data sharing method based on federated learning disclosed in the present invention can be applied in the financial field. For example, the first participant can be an online shopping platform, the second participant can be a bank, and the label can be, for example, credit card processing. Each participant can establish an assessment model for the risk of credit card processing through the modeling method of this application.
[0119] This paper proposes a data sharing method for a federated tree, which realizes vertical federated learning by first building sub-models and then fusing them; designs an efficient model construction scheme, in which the construction of each sub-model only depends on local data features and does not depend on other host parties, reducing the amount of data transmission and improving the efficiency of the entire algorithm; the designed sub-model construction method makes the node splitting of each sub-model independent of the data features of other parties, which enables the construction of each sub-model to be carried out in parallel, thereby improving the execution efficiency of the entire algorithm; the method of combining direct fusion and crossover of sub-models draws on the idea of residual networks. On the one hand, it can effectively utilize the results of individual modeling by each party, and on the other hand, it uses the crossover of sub-models to learn label characteristics that cannot be fitted by direct fusion, thereby improving the performance of the algorithm.
[0120] In one embodiment, the present disclosure also includes a method for using a global model based on federated learning, the method comprising:
[0121] The computer obtains a prediction request from the first party;
[0122] The computer aligns the data of the prediction request based on a privacy intersection technique;
[0123] The computer uses the sub-models of each participant to predict the data of the prediction request;
[0124] The computer uses the global model to predict the prediction results of the sub-models of each participant to obtain the prediction results of the prediction request of the first participant, so as to realize the sharing of the data of the first participant and the data of the second participant.
[0125] Methods of use of the present disclosure Figure 4 The global model based on federated learning established by the method shown is used.
[0126] Figure 8 The block diagram of a data sharing device based on federated learning according to an embodiment of the present disclosure is schematically shown. The data sharing device 800 of federated learning provided in the embodiment of the present disclosure can be set on a terminal device, can also be set on a server side, or can be set partially on a terminal device and partially on a server side. For example, it can be set Figure 1 The server 105 in the embodiment of the present invention is described below, but the present disclosure is not limited to this.
[0127] The data sharing device 800 based on federated learning provided in the embodiment of the present disclosure may include an acquisition module 810 , an alignment module 820 , a sub-prediction module 830 and a main prediction module 840 .
[0128] Among them, the acquisition module is configured to obtain the prediction request of the first participant; the alignment module is configured to align the data of the prediction request based on the privacy intersection technology; the sub-prediction module is configured to use the sub-models of each participant to predict the data of the prediction request; the main prediction module is configured to use the global model to predict the prediction results of the sub-models of each participant to obtain the prediction results of the prediction request of the first participant, so as to realize the sharing of the data of the first participant and the data of the second participant.
[0129] According to an embodiment of the present disclosure, the above-mentioned federated learning-based data sharing device 800 can be used in the method for using the global model based on federated learning described in the present disclosure.
[0130] It is understandable that the acquisition module 810, the alignment module 820, the sub-prediction module 830 and the main prediction module 840 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the acquisition module 810, the alignment module 820, the sub-prediction module 830 and the main prediction module 840 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented in hardware or firmware in any other reasonable way of integrating or packaging the circuit, or in a proper combination of software, hardware and firmware. Alternatively, at least one of the acquisition module 810, the alignment module 820, the sub-prediction module 830 and the main prediction module 840 can be at least partially implemented as a computer program module, and when the program is run by a computer, the function of the corresponding module can be executed.
[0131] It should be noted that, although several modules, units and sub-units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules, units and sub-units described above can be concretized in one module, unit and sub-unit. Conversely, the features and functions of one module, unit and sub-unit described above can be further divided into being concretized by multiple modules, units and sub-units.
[0132] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0133] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and embodiments are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0134] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data sharing method based on federated learning, characterized in that: include: The computer aligns the data samples of the first participant and the second participant based on the privacy intersection technology; The computer constructs a sub-model of the first party using the label and the data of the first party, the sub-model of the first party including a model score and a prediction result; The computer constructs a sub-model of the second participant using homomorphic encryption according to the label and the data of the second participant, wherein the sub-model of the second participant includes a model score and a prediction result; The computer obtains a global model according to the sub-model of the first participant and the sub-model of the second participant, so as to realize the sharing of the data of the first participant and the data of the second participant; The computer acquiring the global model according to the sub-model of the first participant and the sub-model of the second participant includes: The computer obtains a fusion model and a cross model based on the sub-model of the first participant and the sub-model of the second participant to obtain the global model, wherein the computer obtains the fusion model based on the label, the model score of the sub-model of the first participant and the model score of the sub-model of the second participant, and the computer obtains the cross model based on the label, the output of the fusion model, the prediction result of the sub-model of the first participant and the prediction result of the sub-model of the second participant.
2. The method according to claim 1, characterized in that: The computer constructing a sub-model of the first party using the tag and the data of the first party includes: The computer constructs a sub-model of the gradient boosting tree of the first participant using the label and the data of the first participant through an extreme gradient boosting tree or a light gradient boosting model at the first participant.
3. The method according to claim 1, characterized in that The computer obtains the fusion model according to the label, the model score of the sub-model of the first participant, and the model score of the sub-model of the second participant, including: The computer uses a logistic regression or a gradient boosting tree model to obtain a fusion model according to the label, the model score of the sub-model of the first participant, and the model score of the sub-model of the second participant.
4. A method for using a global model based on federated learning, characterized in that: include: The computer obtains a prediction request from the first party; The computer aligns the data of the prediction request based on a privacy intersection technique; The computer uses the sub-models of each participant to predict the data of the prediction request; The computer uses a global model to predict the prediction results of the sub-models of each participant to obtain the prediction results of the prediction request of the first participant, so as to realize the sharing of the data of the first participant and the data of the second participant, wherein the global model is constructed by the data sharing method based on federated learning as described in any one of claims 1-3.
5. A data sharing device based on federated learning, characterized in that: include: an acquisition module configured to acquire a prediction request from a first party; An alignment module, configured to align the data of the prediction request based on a privacy intersection technique; A sub-prediction module, configured to use the sub-models of each participant to predict the data of the prediction request; A main prediction module is configured to use a global model to predict the prediction results of the sub-models of each participant to obtain the prediction results of the prediction request of the first participant, so as to realize the sharing of the data of the first participant and the data of the second participant, wherein the global model is constructed by the data sharing method based on federated learning as described in any one of claims 1 to 3.
6. An electronic device, characterized in that: include: one or more processors; A storage device configured to store one or more programs, which, when executed by the one or more processors, enable the one or more processors to implement the method according to any one of claims 1 to 3.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Model training method, equipment and computer readable storage medium
CN111784001A
Longitudinal federation modeling optimization method and device and readable storage medium
CN111860864A
