CN110633805B - Longitudinal federal learning system optimization method, device, equipment and readable storage medium - Google Patents

Longitudinal federal learning system optimization method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN110633805B
CN110633805B CN201910918262.9A CN201910918262A CN110633805B CN 110633805 B CN110633805 B CN 110633805B CN 201910918262 A CN201910918262 A CN 201910918262A CN 110633805 B CN110633805 B CN 110633805B
Authority
CN
China
Prior art keywords
data
model
sample data
gradient information
output
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910918262.9A
Other languages
Chinese (zh)
Other versions
CN110633805A (en
Inventor
程勇
刘洋
陈天健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201910918262.9A priority Critical patent/CN110633805B/en
Publication of CN110633805A publication Critical patent/CN110633805A/en
Priority to PCT/CN2020/107332 priority patent/WO2021004551A1/en
Application granted granted Critical
Publication of CN110633805B publication Critical patent/CN110633805B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0202Market predictions or forecasting for commercial activities

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Medical Informatics (AREA)
  • Game Theory and Decision Science (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Machine Translation (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method, a device, equipment and a readable storage medium for optimizing a longitudinal federal learning system, wherein the method comprises the following steps: sample alignment is carried out on the first equipment and the second equipment to obtain first sample data of the first equipment, wherein the data characteristics of the first sample data are different from those of the second sample data, and the second sample data are obtained by sample alignment of the second equipment and the first equipment; and performing collaborative training by adopting the first sample data and the second equipment to obtain an interpolation model, wherein the interpolation model is used for inputting data under the corresponding data characteristics of the first equipment and outputting prediction data under the corresponding data characteristics of the second equipment. The model can be independently used without the cooperation of other participants when the model trained by the longitudinal federal learning is used by the participants of the longitudinal federal learning, and the application range of the longitudinal federal learning is expanded.

Description

Longitudinal federal learning system optimization method, device, equipment and readable storage medium
Technical Field
The present invention relates to the field of machine learning technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for optimizing a longitudinal federal learning system.
Background
Along with the development of artificial intelligence, people put forward the concept of 'federal learning' for solving the problem of data island, so that both federal parties can also perform model training to obtain model parameters under the condition of not giving own data, and the problem of data privacy leakage can be avoided.
The longitudinal federal learning is to take out the part of users and data with the same participant users and different user data characteristics to perform a joint training machine learning model under the condition that the data characteristics of the participants are less overlapped and the users are more overlapped. For example, there are two participants a and B belonging to the same area, wherein participant a is a bank and participant B is an e-commerce platform. Participants a and B have more and the same users in the same area, but the services of a and B are different, and the characteristics of the recorded user data are different. In particular, the user data characteristics of the a and B records may be complementary. In such a scenario, vertical federal learning may be used to help a and B build a joint machine learning predictive model, helping a and B provide better service to their customers.
However, when using a model trained by longitudinal federal learning, participant a needs to cooperate with participant B to make predictions using the model. For example, participant a has data characteristics X3, X4, and X5, participant B has data characteristics X1 and X2, and when participant a needs to predict a new client, participant a needs to communicate with participant B to see if participant B also has the client, and if participant B does not have the client's data, participant a cannot predict the client because participant a does not have all the data characteristics, i.e., does not have the client's data under data characteristics X1 and X2. Even if participant B has data for the client, participant a and B are required to cooperate to make predictions for the client.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a readable storage medium for optimizing a longitudinal federal learning system, and aims to realize that a model can be independently used by participants of longitudinal federal learning without matching other participants when the model trained by the longitudinal federal learning is used.
In order to achieve the above object, the present invention provides a longitudinal federal learning system optimization method, which is applied to a first device, the first device is communicatively connected to a second device, and the longitudinal federal learning system optimization method includes the following steps:
Sample alignment is carried out on the second equipment to obtain first sample data of the first equipment, wherein the data characteristics of the first sample data are different from those of second sample data, and the second sample data are obtained by sample alignment of the second equipment and the first equipment;
And cooperatively training the first sample data and the second equipment to obtain an interpolation model, wherein the interpolation model is used for inputting data belonging to the data characteristics corresponding to the first equipment and outputting data belonging to the data characteristics corresponding to the second equipment.
Optionally, the step of training cooperatively with the second device to obtain an interpolation model using the first sample data includes:
inputting the first sample data into a first part model preset in the first device to obtain a first output;
Transmitting the first output to the second device, so that the second device obtains a second output of a preset second part model according to the first output, calculates a first loss function and first gradient information according to the second sample data and the second output, and updates parameters of the second part model according to gradient information related to the second part model in the first gradient information;
updating parameters of the first part model according to gradient information related to the first part model in the first gradient information received from the second equipment, and iteratively training until the second part model sent by the second equipment is received when the condition that a preset stopping condition is met is detected;
And combining the first partial model and the second partial model to obtain the interpolation model.
Optionally, after the step of combining the first partial model and the second partial model to obtain the interpolation model, the method further includes:
Inputting local sample data belonging to the data characteristics corresponding to the first equipment into the interpolation model to obtain predicted sample data belonging to the data characteristics corresponding to the second equipment;
And carrying out local training on a preset machine learning model to be trained by adopting the local sample data and the prediction sample data to obtain a target machine learning model.
Optionally, the first device includes a first trusted execution environment TEE module therein, the second device includes a second TEE module therein,
The step of sending the first output to the second device, so that the second device obtains a second output of a preset second part model according to the first output, the step of calculating a first loss function and first gradient information according to the second sample data and the second output, and the step of updating parameters of the second part model according to gradient information related to the second part model in the first gradient information comprises the following steps:
encrypting the first output to obtain a first encrypted output;
Transmitting the first encryption output to the second device, so that the second device decrypts the first encryption output in the second TEE module to obtain the first output, obtaining a second output of a preset second part model according to the first output, calculating a first loss function and first gradient information according to the second sample data and the second output, updating parameters of the second part model according to gradient information related to the second part model in the first gradient information, and encrypting gradient information related to the first part model in the first gradient information to obtain encrypted gradient information;
The step of updating parameters of the first partial model based on gradient information related to the first partial model in the first gradient information received from the second device includes:
and receiving the encrypted gradient information sent by the second equipment, decrypting the encrypted gradient information in the first TEE module to obtain gradient information related to the first part model in the first gradient information, and updating parameters of the first part model according to the gradient information related to the second part model.
Optionally, after the step of sending the first output to the second device, the method further includes:
receiving the second output and the first loss function sent by the second device;
inputting the first sample data and the second output into a preset machine learning model to be trained to obtain predictive label data;
Calculating a second loss function and second gradient information of the machine learning model to be trained according to the predicted tag data and the pre-stored local actual tag data;
The step of receiving the second part model sent by the second device until the iterative training is detected to meet a preset stopping condition comprises the following steps:
And updating parameters of the machine learning model to be trained according to the second gradient information, performing iterative training to minimize a fusion loss function, obtaining a target machine learning model until the condition that a preset stopping condition is met is detected, and receiving the second partial model sent by the second device, wherein the first device fuses the first loss function and the second loss function to obtain the fusion loss function.
Optionally, the first device includes a TEE module, and the step of cooperatively training with the second device using the first sample data to obtain an interpolation model includes:
Receiving second encrypted sample data sent by the second device, wherein the second device encrypts the second sample data to obtain the second encrypted sample data;
and decrypting the second encrypted sample data in the TEE module to obtain second sample data, and training an interpolation model to be trained according to the first sample data and the second sample data to obtain the interpolation model.
Optionally, the target machine learning model is configured to predict a purchase intention of a user, and after the step of locally training the preset machine learning model to be trained by using the local sample data and the predicted sample data to obtain the target machine learning model, the method further includes:
inputting first data of a target user into the interpolation model to obtain second data, wherein the data characteristics of the first data comprise user identity characteristics, and the data characteristics of the second data comprise user purchase characteristics;
And inputting the first data and the second data into the target machine learning model to obtain the purchase intention of the target user.
In order to achieve the above object, the present invention further provides a longitudinal federal learning system optimization device, where the longitudinal federal learning system optimization device is deployed on a first device, and the first device is communicatively connected to a second device, and the longitudinal federal learning system optimization device includes:
The alignment module is used for carrying out sample alignment with the second equipment to obtain first sample data of the first equipment, wherein the data characteristics of the first sample data are different from those of second sample data, and the second sample data are obtained by carrying out sample alignment with the first equipment;
The training module is used for cooperatively training the first sample data and the second equipment to obtain an interpolation model, wherein the interpolation model is used for inputting data belonging to the data characteristics corresponding to the first equipment and outputting prediction data belonging to the data characteristics corresponding to the second equipment.
To achieve the above object, the present invention also provides a longitudinal federal learning system optimization apparatus, including: the system comprises a memory, a processor and a longitudinal federal learning system optimization program stored on the memory and capable of running on the processor, wherein the longitudinal federal learning system optimization program realizes the steps of the longitudinal federal learning system optimization method when being executed by the processor.
In addition, in order to achieve the above object, the present invention also proposes a computer readable storage medium having stored thereon a longitudinal federal learning system optimization program which, when executed by a processor, implements the steps of the longitudinal federal learning system optimization method as described above.
According to the invention, the first equipment performs sample alignment with the second equipment, and performs collaborative training by adopting aligned sample data to obtain the interpolation model capable of complementing the missing data characteristics of the first equipment relative to the second equipment, so that when the first equipment uses the machine learning model obtained by training the data characteristics of the first equipment and the second equipment, even if the first equipment does not have the data of the second equipment, the first equipment can locally obtain the data belonging to the corresponding data characteristics of the second equipment by prediction through the interpolation model alone, and the machine learning model is used for completing prediction through the complemented data, thereby expanding the application range of longitudinal federal learning and avoiding the machine learning model which cannot be obtained by the longitudinal federal learning by the first equipment under the condition that the second equipment cannot provide the data for the first equipment.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of a longitudinal federal learning system optimization method according to the present invention;
FIG. 3 is a schematic diagram of sample data according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a model cutting mode according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a first device alone training a machine learning model in accordance with an embodiment of the present invention;
FIG. 6 is a schematic flow chart of a first device and a second device cooperatively training an interpolation model and a first device alone training a machine learning model according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a first device and a second device cooperatively training an interpolation model in respective TEE module environments according to an embodiment of the invention;
FIG. 8 is a schematic diagram of a first device and a second device cooperatively training an interpolation model and a machine learning model according to an embodiment of the present invention;
FIG. 9 is a block diagram of a functional schematic of a preferred embodiment of the vertical federal learning system optimization mechanism of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic device structure of a hardware running environment according to an embodiment of the present invention.
It should be noted that, the longitudinal federal learning system optimization device in the embodiment of the present invention may be a smart phone, a personal computer, a server, etc., which is not limited herein.
As shown in fig. 1, the vertical federal learning system optimization apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the configuration of the apparatus shown in FIG. 1 is not limiting of the longitudinal federal learning system optimization apparatus and may include more or fewer components than shown, or certain components may be combined, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a vertical federal learning system optimization procedure may be included in the memory 1005, which is a computer storage medium. A TEE (Trusted execution environment), trusted execution environment) module is also included. The operating system is a program for managing and controlling hardware and software resources of the device, and supports the running of federal learning private data processing programs and other software or programs. The TEE is a secure area within the host processor that runs in a separate environment and in parallel with the operating system, which ensures that the confidentiality and integrity of code and data loaded in the TEE are protected. Trusted applications running in the TEE may access the full functionality of the device host processor and memory, while hardware isolation protects these components from user-installed applications running in the host operating system. In this embodiment, the TEE module may be implemented in various ways, such as Intel-based Software Guard Extensions (software protection extension, SGX), AMD Secure Encrypted Virtualization (secure virtualization encryption, SEV), ARM Trust Zone, or MIT santum. Authentication and authorization of the TEE module may be accomplished by a third party security server. For example, when the TEE is an SGX using Intel, the TEE may be authenticated, i.e., secured, by a security server of Intel.
In the device shown in fig. 1, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing communication connection with other terminal devices participating in federal learning, such as a second device serving as a participant of longitudinal federal learning; and the processor 1001 may be configured to invoke the vertical federation learning system optimization program stored in the memory 1005 and perform the following operations:
Sample alignment is carried out on the second equipment to obtain first sample data of the first equipment, wherein the data characteristics of the first sample data are different from those of second sample data, and the second sample data are obtained by sample alignment of the second equipment and the first equipment;
And cooperatively training the first sample data and the second equipment to obtain an interpolation model, wherein the interpolation model is used for inputting data belonging to the data characteristics corresponding to the first equipment and outputting data belonging to the data characteristics corresponding to the second equipment.
Further, the step of training cooperatively with the second device to obtain an interpolation model using the first sample data includes:
inputting the first sample data into a first part model preset in the first device to obtain a first output;
Transmitting the first output to the second device, so that the second device obtains a second output of a preset second part model according to the first output, calculates a first loss function and first gradient information according to the second sample data and the second output, and updates parameters of the second part model according to gradient information related to the second part model in the first gradient information;
updating parameters of the first part model according to gradient information related to the first part model in the first gradient information received from the second equipment, and iteratively training until the second part model sent by the second equipment is received when the condition that a preset stopping condition is met is detected;
And combining the first partial model and the second partial model to obtain the interpolation model.
Further, after the step of combining the first partial model and the second partial model to obtain the interpolation model, the processor 1001 may be further configured to invoke a federal learning privacy data processing program stored in the memory 1005, and perform the following steps:
Inputting local sample data belonging to the data characteristics corresponding to the first equipment into the interpolation model to obtain predicted sample data belonging to the data characteristics corresponding to the second equipment;
And carrying out local training on a preset machine learning model to be trained by adopting the local sample data and the prediction sample data to obtain a target machine learning model.
Further, the first equipment comprises a first TEE module, the second equipment comprises a second TEE module,
The step of sending the first output to the second device, so that the second device obtains a second output of a preset second part model according to the first output, the step of calculating a first loss function and first gradient information according to the second sample data and the second output, and the step of updating parameters of the second part model according to gradient information related to the second part model in the first gradient information comprises the following steps:
encrypting the first output to obtain a first encrypted output;
Transmitting the first encryption output to the second device, so that the second device decrypts the first encryption output in the second TEE module to obtain the first output, obtaining a second output of a preset second part model according to the first output, calculating a first loss function and first gradient information according to the second sample data and the second output, updating parameters of the second part model according to gradient information related to the second part model in the first gradient information, and encrypting gradient information related to the first part model in the first gradient information to obtain encrypted gradient information;
The step of updating parameters of the first partial model based on gradient information related to the first partial model in the first gradient information received from the second device includes:
And receiving the encrypted gradient information sent by the second equipment, decrypting the encrypted gradient information in the first TEE module to obtain gradient information related to the first part model in the first gradient information, and updating parameters of the first part model according to the gradient information related to the first part model.
Further, after the step of sending the first output to the second device, the processor 1001 may be further configured to invoke a federal learning privacy data handler stored in the memory 1005 and perform the steps of:
receiving the second output and the first loss function sent by the second device;
inputting the first sample data and the second output into a preset machine learning model to be trained to obtain predictive label data;
Calculating a second loss function and second gradient information of the machine learning model to be trained according to the predicted tag data and the pre-stored local actual tag data;
The step of receiving the second part model sent by the second device until the iterative training is detected to meet a preset stopping condition comprises the following steps:
And updating parameters of the machine learning model to be trained according to the second gradient information, performing iterative training to minimize a fusion loss function, obtaining a target machine learning model until the condition that a preset stopping condition is met is detected, and receiving the second partial model sent by the second device, wherein the first device fuses the first loss function and the second loss function to obtain the fusion loss function.
Further, the first device includes a TEE module, and the step of training cooperatively with the second device using the first sample data to obtain an interpolation model includes:
Receiving second encrypted sample data sent by the second device, wherein the second device encrypts the second sample data to obtain the second encrypted sample data;
and decrypting the second encrypted sample data in the TEE module to obtain second sample data, and training an interpolation model to be trained according to the first sample data and the second sample data to obtain the interpolation model.
Further, after the step of locally training the preset machine learning model to be trained by using the local sample data and the predicted sample data to obtain the target machine learning model, the processor 1001 may be further configured to invoke the federal learning privacy data processing program stored in the memory 1005, and perform the following steps:
inputting first data of a target user into the interpolation model to obtain second data, wherein the data characteristics of the first data comprise user identity characteristics, and the data characteristics of the second data comprise user purchase characteristics;
And inputting the first data and the second data into the target machine learning model to obtain the purchase intention of the target user.
Based on the above structure, various embodiments of a vertical federal learning system optimization method are presented.
Embodiments of the present invention provide embodiments of a method of optimizing a longitudinal federal learning system, it being noted that although a logical order is illustrated in the flowchart, in some cases, steps illustrated or described may be performed in an order different than that illustrated herein. The first device and the second device related in the embodiment of the invention can be participation devices for participating in longitudinal federal learning, and the participation devices can be devices such as smart phones, personal computers, servers and the like.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the method for optimizing a longitudinal federal learning system according to the present invention. In this embodiment, the longitudinal federal learning system optimization method includes:
Step S10, performing sample alignment with the second equipment to obtain first sample data of the first equipment, wherein the data characteristics of the first sample data are different from those of second sample data, and the second sample data are obtained by performing sample alignment with the first equipment by the second equipment;
In the following, the first device and the second device are used to distinguish between the two participating devices, and the model required for training and using the first device is used as an example. The model required by the second device can be trained and used only by exchanging the roles of the first device and the second device, and the model can be suitable for a scene with a plurality of participation devices and coordination devices matched with the participation devices according to similar principles.
The first device establishes a communication connection with the second device in advance. The local data of the first device and the second device have overlapping parts in the user dimension, and have different parts (possibly completely different) in data characteristics, the first device and the second device adopt respective local data to conduct sample alignment, the common user and different data characteristics of the two parties are determined, the first device takes the data of the common user in the local data as first sample data, and the second device takes the data which is different from the data characteristics of the first device in the data of the common user in the local data as second sample data, namely, the finally determined users in the first sample data and the second sample data are identical, and the data characteristics are different. The sample alignment method of the first device and the second device may adopt an existing sample alignment technology, and if the first device and the second device are not trusted, an encrypted sample alignment technology may be adopted, which is not described in detail herein. For example, fig. 3 is a schematic diagram of sample data in a first device and a second device, where the first device local data includes 3 users { U1, U2, U3}, the data features include { X1, X2, X3}, the second device local data includes 3 users { U1, U2, U4}, and the data features include { X4, X5}. After the alignment of the samples, the first sample data determined by the first device is the data of the users U1 and U2 under the data features X1, X2 and X3, and the second sample data determined by the second device is the data of the users U1 and U2 under the data features X4 and X5.
And S20, adopting the first sample data and the second equipment to cooperatively train to obtain an interpolation model, wherein the interpolation model is used for inputting data belonging to the data characteristics corresponding to the first equipment and outputting data belonging to the data characteristics corresponding to the second equipment.
The first device is trained cooperatively with the second device using the first sample data to obtain an interpolation (imputation) model. The interpolation model is used for complementing the data of the missing data characteristic of the first device relative to the second device. As in the specific example described above, the interpolation model is used to complement the data of the users U1 and U2 under the data features X4 and X5 in the first sample data of the first device. Specifically, the interpolation model may be used to input data belonging to the data feature corresponding to the first device, output data belonging to the data feature corresponding to the second device, that is, input the data of the user in the first sample data into the interpolation model, output data close to the data of the user in the second sample data, for example, input the data of the user U1 under the data features X1, X2 and X3, and the interpolation model outputs data close to the data of the user U1 under the data features X4 and X5 in the second sample data, so as to complement the data of the missing user U1 under the data features X4 and X5 for the first device. The interpolation model may employ a model structure such as a variational automatic encoder (Variational Autoencoder), a generation countermeasure Network (GENERATIVE ADVERSARIAL Network), a Pixel-RNN, a Pixel-CNN, or a limited boltzmann machine (RESTRICTED BOLTZMANN MACHINE), and the first device and the second device may cooperatively train the interpolation model by employing split learning (SPLIT LEARNING).
Further, the step S20 includes:
step S201, inputting the first sample data into a first part model preset in the first device to obtain a first output;
The method comprises the steps of presetting a structure of an interpolation model to be trained, setting input features of the interpolation model to be trained as data features corresponding to first equipment, setting output features of the interpolation model to be trained as data features corresponding to second equipment, and cutting the interpolation model to be trained into two parts, namely a first part model and a second part model. The first partial model is pre-placed in the first device and the second partial model is pre-placed in the second device. Specifically, as shown in fig. 4, when the interpolation model to be trained is a neural network model including a plurality of layers, there are two ways of cutting the interpolation model to be trained; the first is to select two layers in the neural network model, cut from between the two layers, and take the front part of the neural network model as a first part model and the rear part as a second part model, and the two layers are called as cut layers; the second is to select two layers in the neural network model, add one layer in the middle of the two layers, the input of the layer is the output of the previous layer in the two layers, the output is the input of the next layer in the two layers, namely, the previous layer is directly connected with the added layer, the neural network model is cut from the previous layer to the added layer, the front part is used as a first part model, the rear part is used as a second part model, and the cut layer is called between the previous layer and the added layer; compared with the first cutting mode, the second cutting mode has fewer connections between the first part model and the second part model, so that the data volume required to be transmitted between the first equipment and the second equipment is reduced, and which cutting mode can be selected according to the specific conditions of the dimension of the data characteristics of the first equipment and the second equipment, the structural complexity of the interpolation model to be trained and the like.
The first device inputs the first sample data into a first partial model of the first device, which outputs a first output, i.e. the output of the last layer of the first partial model.
Step S202, the first output is sent to the second device, so that the second device obtains a second output of a preset second part model according to the first output, calculates a first loss function and first gradient information according to the second sample data and the second output, and updates parameters of the second part model according to gradient information related to the second part model in the first gradient information;
The first device transmits the first output to the second device. If the interpolation model to be trained is cut according to the first cutting mode, multiplying the first output by the corresponding connection weight according to the connection relation between the cutting layers by the first device so as to convert the first output into the input of the first layer of the second part model, sending the converted result to the second device, inputting the converted result into the first layer of the second part model by the second device, and outputting the second output by the second part model; if the interpolation model to be trained is cut according to the second cutting mode, the first device directly sends the first output to the second device, the second device directly inputs the first output into the first layer of the second part model after receiving the first output, and the second part model outputs the second output.
The second device obtains a second output of the second partial model according to the first output, and calculates a first loss function and first gradient information according to the second sample data and the second output. The first loss function is a loss function of the interpolation model to be trained, and the first gradient information may include gradient information related to the second part model, such as gradient information of the first loss function on each parameter of the second part model, and may also include gradient information related to the first part model, such as gradient information of the first loss function on an input variable of the second part model.
The second device may detect whether a preset stop condition is satisfied, where the preset stop condition may be a preset stop condition, for example, stop when convergence of the first loss function is detected, stop when the number of iterative training reaches a maximum number, or stop when the time of iterative training reaches a maximum training time. Specifically, the second device may determine that the first loss function converges when detecting that the loss value of the first loss function is smaller than a preset value, and determine that the first loss function does not converge when not smaller than the preset value. And when the condition that the preset stopping condition is not met is detected, the second equipment updates parameters in the second part model according to gradient information related to the second part model in the first gradient information. The second device may send gradient information related to the first part model in the first gradient information to the first device, or may send the first gradient information to the first device.
Step S203, updating parameters of the first part model according to gradient information related to the first part model in the first gradient information received from the second device, and iteratively training until the second part model sent by the second device is received when the second part model is detected to meet a preset stopping condition;
The first device receives the first gradient information from the second device or receives a new gradient associated with the first partial model in the first gradient information. The first device updates each parameter of the first part model according to gradient information related to the first part model, such as gradient information of input variables of the first loss function to the second part model, gradient information of the first loss function to output variables of the first part model is deduced, gradient information of the first loss function to each parameter of the first part model is deduced, and each parameter is updated according to gradient information corresponding to the parameter. After updating parameters of the first part model, the first device continuously adopts the first sample data to input the first part model to obtain a first output, the first output is sent to the second device, the second device calculates a first loss function and gradient information, the training of the interpolation model to be trained is stopped until the condition that the preset stopping condition is met is detected to be met, and the current parameters are used as final parameters of the first part model and the second part model. The second device sends the second partial model, which determines the final parameters, to the first device. It should be noted that, whether the second device detects that the preset stopping condition is satisfied or not may also be that the first device detects that the preset stopping condition is satisfied or not, if the first device detects that the preset stopping condition is satisfied or not, the second device may send the calculation result of the first loss function to the first device, and the first device detects that the first loss function converges or not, or the second device sends the result of detecting that the first loss function converges to the first device.
And step S204, combining the first part model and the second part model to obtain the interpolation model.
The first device receives a second part model which is sent by the second device and determines final parameters, and combines the second part model with the first part model which determines the final parameters to obtain a trained interpolation model. Specifically, the combination mode may correspond to the cutting mode, when the first cutting mode is adopted, the trained first part model and the trained second part model are directly spliced, and when the second cutting mode is adopted, the first layer of the second part model is removed and then spliced with the first part model.
In this embodiment, the first device performs sample alignment with the second device, and performs cooperative training by using the aligned sample data to obtain an interpolation model capable of complementing the missing data features of the first device relative to the second device, so that when the first device uses the machine learning model obtained by training the data features of the first device and the second device, even if there is no data of the second device, the first device alone can locally predict the data belonging to the corresponding data features of the second device through the interpolation model, thereby completing prediction by using the machine learning model through the complemented data, thereby expanding the application range of longitudinal federal learning, and avoiding the machine learning model which cannot be obtained by the longitudinal federal learning by the first device in a scenario in which the second device cannot provide data for the first device.
Further, based on the above first embodiment, a second embodiment of the method for optimizing a longitudinal federal learning system according to the present invention is provided, and in the second embodiment of the method for optimizing a longitudinal federal learning system according to the present invention, after the step S204, the method further includes:
Step S205, inputting local sample data belonging to the data characteristics corresponding to the first equipment into the interpolation model to obtain predicted sample data belonging to the data characteristics corresponding to the second equipment;
The first device, after training in cooperation with the second device to obtain the interpolation model, may independently train a machine learning model whose input features include data features of the first device and the second device. Specifically, the first device locally stores local sample data (which may include data of a plurality of users) belonging to corresponding data features of the first device. It should be noted that, the local sample data may include user data that is not used in the training interpolation model, that is, data of the user may not be included in the second device. The first device inputs the local sample data into the interpolation model to obtain the predicted sample data belonging to the corresponding data characteristic of the second device. Or the first device inputs the first sample data into the interpolation model to obtain the predicted sample data which corresponds to the second sample data and belongs to the data characteristics corresponding to the second device. If the first device inputs the data of the user U1 under the data features X1, X2 and X3 into the interpolation model, and obtains the data under the data features X4 and X5 (called as prediction sample data), the interpolation model outputs the obtained data under the data features X4 and X5, which is close to the real data of the user U1 under the data features X4 and X5, because the data is the interpolation model trained in advance.
Step S206, carrying out local training on a preset machine learning model to be trained by adopting the local sample data and the prediction sample data to obtain a target machine learning model.
The first device adopts local sample data and prediction sample data to carry out local training on a preset machine learning model to be trained so as to obtain a target machine learning model. Or the first device adopts the first sample data and the predicted sample data to locally train a preset machine learning model to be trained to obtain a target machine learning model. The machine learning model to be trained can be a machine learning model with specific prediction or classification targets, such as a neural network model. Specifically, the first device combines the data features of the user data in the local sample data and the data features of the user data in the prediction sample data, and uses the combined data features as input features of the machine learning model to be trained, and performs iterative training on the machine learning model to be trained until convergence of the machine learning model to be trained is detected, that is, the training is completed, so as to obtain the target machine learning model. The first device may use the trained target machine learning model to accomplish a predictive or classification task.
It should be noted that, if the machine learning model to be trained is a supervised machine learning model, and only the second device has the data tag, the second device may share the data corresponding to the data tag to the first device, and the first device performs supervised training on the machine learning model to be trained by using the data corresponding to the data tag. If the first device and the second device are in an untrusted scene, the second device can share the data tag with the first device in an encrypted mode.
As shown in fig. 5, a schematic diagram of the first device alone training the machine learning model is shown. In the figure, GM A is an interpolation model obtained by training the first device and the second device cooperatively, the first device inputs first sample data X A into GM A and M A, trains the machine learning model M A locally through the interpolation model, and inputs first sample data X A into GM A and M A.
In this embodiment, the first device uses the interpolation model obtained by training in cooperation with the second device to complement the missing data features of the first device, so that the first device can independently train locally to obtain the target machine learning model without the help of the second device, thereby expanding the application scenario of longitudinal federal learning.
Further, the target machine learning model is configured to predict a purchase intention of the user, and after step S206, further includes:
Step S207, inputting first data of a target user into the interpolation model to obtain second data, wherein the data features of the first data comprise user identity features, and the data features of the second data comprise user purchase features;
The target machine learning model may be a machine learning model for predicting the purchase intent of the user, i.e., the output label of the target machine learning model may be the purchase intent, e.g., output result of 0 or 1,1 indicates that the user will purchase, and 0 indicates that the user will not purchase. The first device may be a device deployed with a banking institution, the second device may be a device deployed with an e-commerce institution, the data characteristics of the user data in the first device may include user identity characteristics such as age, deposit, monthly salary, etc. due to the different services, the data characteristics of the user data in the first device may include user purchase characteristics such as number of purchases, purchase preferences, etc. The first equipment and the second equipment are trained to obtain an interpolation model for predicting user purchase characteristic data according to the user identity characteristic data through cooperation in advance.
After the first device is trained to obtain the target machine learning model, the interpolation model and the target machine learning model can be independently adopted to predict the purchase intention of the target user under the condition that the second device does not provide data on the purchase characteristic of the user. Specifically, the first device may input the first data of the target user into the interpolation model, and the interpolation model outputs the second data. The first data is the data of the target user recorded by the first equipment, and comprises user identity characteristics, and the second data is the predicted purchase characteristic data of the target user.
And step S208, inputting the first data and the second data into the target machine learning model to obtain the purchase intention of the target user.
After obtaining the second data, the first device inputs the first data and the second data into a target machine learning model to obtain the purchase intention of the target user. The second data is predicted by the pre-trained interpolation model and is close to the real data of the user, so that the first data and the second data are input into the target machine learning model, and the predicted purchase intention error of the target user is smaller.
It should be noted that the target machine learning model may be used in other application scenarios besides purchase intention prediction, such as performance level prediction, paper value evaluation, and the like, and the embodiment of the present invention is not limited herein.
Fig. 6 is a schematic flow chart of a first device and a second device cooperatively training an interpolation model, wherein the first device alone trains a machine learning model.
In this embodiment, the first device and the second device cooperatively train to obtain an interpolation model, and when the target machine learning model is used, the interpolation model is adopted to complement the missing data features of the first device, so that the first device can complete the prediction function by using the target machine learning model in a scene without the cooperation of the second device, thereby expanding the application range of longitudinal federal learning.
Further, based on the first and second embodiments, a third embodiment of the longitudinal federal learning system optimization method according to the present invention is provided, in which the first device includes a first TEE module, the second device includes a second TEE module, and the step S202 includes:
step S2021, encrypting the first output to obtain a first encrypted output;
In this embodiment, in order to adapt to a scenario that the first device and the second device do not trust each other, a TEE module may be respectively disposed in the first device and the second device, the privacy data is processed in the TEE module, and the privacy data outside the TEE module is encrypted, so that the privacy data of the other party cannot be obtained. Specifically, after the first device obtains the first output, the first device may encrypt the first output to obtain a first encrypted output, where the encryption manner is not limited in this embodiment. It should be noted that, since the first output is obtained according to the data local to the first device and is visible in the first device, the first output may be encrypted in the first TEE module or encrypted in the second TEE module, where the encryption is to ensure that after the first output is sent to the second device, the second device cannot obtain the original first output, so that it is ensured that the data information of the first device cannot be revealed to the second device in a scenario where the first device and the second device are not trusted.
Step S2022, sending the first encrypted output to the second device, so that the second device decrypts the first encrypted output in the second TEE module to obtain the first output, obtains a second output of a preset second partial model according to the first output, calculates a first loss function and first gradient information according to the second sample data and the second output, updates parameters of the second partial model according to gradient information related to the second partial model in the first gradient information, and encrypts gradient information related to the first partial model in the first gradient information to obtain encrypted gradient information;
The first device outputs the first encryption to the second device. After receiving the first encrypted output, the second device decrypts the first encrypted output in the second TEE module to obtain the first output. It should be noted that, the decryption mode in the second TEE module of the second device corresponds to the encryption mode in the first TEE module of the first device, if the public key is adopted in the first TEE module to encrypt the first output, the private key corresponding to the public key is adopted in the second TEE module to decrypt. After the second device decrypts the first output in the second TEE module to obtain the first output, the second device continues to obtain a first loss function and first gradient information in the TEE module in a similar manner to step S202 because the first output cannot be exposed to a part outside the second device TEE module, updates parameters of the second part model, and encrypts gradient information related to the first part model in the first gradient information to obtain encrypted gradient information. And the second device sends the encryption gradient information to the first device after obtaining the encryption gradient information. Because the first output, the first loss function and the first gradient information are obtained on the basis of the data in the first device, the original first output, the first loss function and the first gradient information are processed in the TEE module in the second device, and the data are encrypted outside the TEE module of the second device, so that the second device cannot acquire the privacy data of the first device.
The step of updating parameters of the first partial model according to gradient information related to the first partial model in the first gradient information received from the second device in step SS203 includes:
Step S2031, receiving the encrypted gradient information sent by the second device, decrypting the encrypted gradient information in the first TEE module to obtain gradient information related to the first part model in the first gradient information, and updating parameters of the first part model according to the gradient information related to the first part model.
After receiving the encrypted gradient information sent by the second device, the first device decrypts the encrypted gradient information in the first TEE module to obtain gradient information related to the first part model in the original first gradient information, wherein the encrypted gradient information is obtained on the basis of data of the second device, so that the data of the second device are not leaked to the first device. The manner of decrypting the data in the first TEE module corresponds to the manner of encrypting the data in the second TEE module. And the first equipment updates the parameters of the first part model according to the gradient information related to the first part model after obtaining the gradient information related to the first part model in the first gradient information.
After updating parameters of the first part model, the first device continuously adopts first sample data to input the first part model to obtain first output, the first output is encrypted and sent to the second device, the second device calculates first loss function and gradient information in the TEE module, and the second device circulates until the training of the interpolation model to be trained is stopped when the condition that the preset stopping condition is met is detected, and the current parameters are used as final parameters of the first part model and the second part model. The second device sends a second partial model (encryptable) to the first device, which determines the final parameters. The first device obtains an interpolation model according to the combination of the first partial model and the second partial model. Specifically, similar to the process of step S204, detailed description thereof will be omitted.
As shown in fig. 6, a schematic diagram of a first device and a second device cooperatively training an interpolation model in respective TEE module environments is shown, the first device inputs first sample data X A into a first Part model GM A -Part1 of an interpolation model GM A in the first TEE module, encrypts a first output and transmits the encrypted first output to the second device, the second device decrypts the first output in the second TEE module, obtains a second output X B' of a second Part model GM A -Part2 according to a decryption result, calculates gradient information, encrypts the gradient information, and then transmits the encrypted gradient information back to the first device, the first device performs parameter updating according to the gradient information, and when the first device performs iterative training until a preset stop condition is met, the second device sends GM A -Part2 to the first device, and the first device combines GM A -Part1 and GM A -Part2 to obtain a trained interpolation model GM A.
In this embodiment, by setting the TEE module in the first device and the second device respectively, the first device and the second device process the original data in the TEE module, and only obtain the encrypted data outside the TEE module, so as to ensure that the private data will not leak to the other party when the first device and the second device are not trusted, thereby ensuring the security of the data.
Further, based on the first, second and third embodiments, a fourth embodiment of the method for optimizing a longitudinal federal learning system according to the present invention is provided, and in the fourth embodiment of the method for optimizing a longitudinal federal learning system according to the present invention, after the step S202, the method further includes:
Step A10, receiving the second output and the first loss function sent by the second device;
in this embodiment, the first device and the second device may cooperatively train the machine learning model while cooperatively training the interpolation model. Specifically, on the basis of the first embodiment, after the first device sends the first output to the second device, the second device obtains the second output, and calculates to obtain the first loss function and the first gradient information, the second device sends the second output, the first loss function and the second gradient information to the first device.
Step A20, inputting the first sample data and the second output into a preset machine learning model to be trained to obtain predictive label data;
The first device is provided with a machine learning model to be trained in advance. The first device inputs the first sample data and the second output into a machine learning model to be trained, and outputs predictive label data from the machine learning model to be trained.
Step A30, calculating a second loss function and second gradient information of the machine learning model to be trained according to the predicted tag data and the pre-stored local actual tag data;
the first device calculates a second loss function and second gradient information of the machine learning model to be trained according to the predicted tag data and the pre-stored local actual tag data. It should be noted that, the local actual tag data pre-stored in the first device may be tag data locally recorded by the first device, or the second device may share the locally recorded tag data to the first device, where the first device is stored locally.
The step of receiving the second partial model sent by the second device until the iterative training in the step S203 detects that a preset stop condition is met includes:
step S2032, updating parameters of the machine learning model to be trained according to the second gradient information, performing iterative training to minimize a fusion loss function, obtaining a target machine learning model until a preset stopping condition is detected to be met, and receiving the second partial model sent by the second device, where the first device fuses the first loss function and the second loss function to obtain the fusion loss function.
The first device fuses the first loss function and the second loss function to obtain a fused loss function, and the fusing mode may be to calculate a weighted sum of the first loss function and the second loss function as the fused loss function. The first device determines whether a preset stopping condition is satisfied, where the preset stopping condition may be a preset stopping condition, for example, stopping when convergence of the fusion loss function is detected, stopping when the number of iterative training reaches a maximum number, or stopping when the time of iterative training reaches a maximum training time. Specifically, whether the fusion loss function is converged or not is judged, that is, whether the fusion loss function is converged or not is judged according to the calculated loss value of the fusion loss function, if the loss value of the fusion loss function is detected to be smaller than a preset value, the fusion loss function is determined to be converged, and if the loss value of the fusion loss function is not smaller than the preset value, the fusion loss function is determined to be not converged. If the first equipment detects that the preset stopping condition is not met, the parameters of the machine learning model to be trained can be updated according to the second gradient information, and the parameters of the first part model are updated according to the gradient information related to the first part model in the first gradient information. After updating parameters of the first part model and the machine learning model to be trained, the first device continuously adopts first sample data to input the first part model to obtain first output, the first output is sent to the second device, the second device calculates first loss function and gradient information, iterative training is conducted to achieve the purpose of minimizing fusion loss function, training of the interpolation model to be trained and the machine learning model to be trained is stopped until detection of meeting preset stop conditions, current parameters are used as final parameters of the first part model, the second part model and the machine learning model to be trained, and the machine learning model to be trained which finally determines the parameters is used as a target machine learning model after training is completed. The second device sends the second partial model with the final parameters determined to the first device, and the first device combines the first partial model and the second partial model to obtain a trained interpolation model.
On the basis of the collaborative training, if the first device and the second device are not trusted, the TEE module may be set in the first device and the second device, the original privacy data may be processed in the TEE module, and the privacy data outside the TEE module may be encrypted, so as to ensure that the privacy data of the first device and the second device may not be revealed to each other.
As shown in fig. 7, a schematic diagram of training an interpolation model and a machine learning model by a first device and a second device in cooperation, the first device inputs first sample data X A into a first partial model GM A -Part1 of the interpolation model GM A, forward transmits a first output to the second device, the second device obtains a second output X B' of a second partial model GM A -Part2 according to the first output, calculates gradient information and a loss function, forward transmits the second output to the first device, and backward transmits the gradient information and the loss function to the first device. The first device updates parameters of GM A -Part1 according to gradient information, takes the second output as input of a machine learning model M A to be trained, and iteratively trains until a fusion loss function converges, so that a trained machine learning model M A is obtained. The second device sends GM A -Part2 to the first device, which combines GM A -Part1 and GM A -Part2 to obtain a trained interpolation model GM A.
In this embodiment, the machine learning model is cooperatively trained while the first device and the second device cooperatively train the interpolation model, so that the training efficiency of the machine learning model is improved, and after the first device trains to obtain the interpolation model, the interpolation model can be used for completing missing data features, so that the first device can complete a prediction task by using the trained machine learning model under the condition that the second device does not cooperate, and the application range of longitudinal federal learning is widened.
Further, based on the first, second, third and fourth embodiments, a fifth embodiment of the longitudinal federal learning system optimization method according to the present invention is provided, in which the first device includes a TEE module, and the step S20 includes:
step B10, receiving second encrypted sample data sent by the second device, wherein the second device encrypts the second sample data to obtain the second encrypted sample data;
In the present embodiment, a manner of cooperatively training an interpolation model is proposed, which is different from that in the first embodiment. Specifically, in order to adapt to a scenario that the first device and the second device are mutually not trusted, a TEE module may be set in the first device, the first device performs processing of private data in the TEE module, and the private data outside the TEE module is encrypted, so that the private data of the second device cannot be obtained. And the second device performs sample alignment with the first device to obtain second sample data, encrypts the second sample data to obtain second encrypted data, and sends the second encrypted data to the first device.
And step B20, decrypting the second encrypted sample data in the TEE module to obtain second sample data, and training an interpolation model to be trained according to the first sample data and the second sample data to obtain the interpolation model.
The first device decrypts the second encrypted sample data in the TEE module to obtain second sample data. The manner of decrypting the data in the TEE module corresponds to the manner of encrypting the data by the second device. The first device trains the interpolation model to be trained according to the first sample data and the second sample data in the TEE module to obtain the interpolation model, and the mode of independently training the interpolation model by the first device is the same as that of the traditional independently training model, and is not particularly limited. Further, the second device may train the machine learning model locally alone by training the completed interpolation model in the TEE module; the first device may also be a machine learning model trained while the interpolation model is trained in the TEE module.
In this embodiment, by setting the TEE module in the first device, the second device encrypts the second sample data and sends the encrypted second sample data to the first device, and the first device decrypts the second sample data in the TEE module, so that the first device alone trains the interpolation model under the condition that the second device does not leak private data to the first device, and therefore the first device cannot train and use the machine learning model under the condition that the second device cannot train the interpolation model in cooperation with the first device, and the application range of longitudinal federal learning is widened.
In addition, an embodiment of the present invention further provides a longitudinal federal learning system optimization device, where the longitudinal federal learning system optimization device is disposed on a first device, and the first device is communicatively connected to a second device, and referring to fig. 9, the longitudinal federal learning system optimization device includes:
An alignment module 10, configured to perform sample alignment with the second device to obtain first sample data of the first device, where the data characteristics of the first sample data are different from those of second sample data, and the second sample data is obtained by performing sample alignment with the second device and the first device;
And the training module 20 is configured to perform collaborative training with the second device by using the first sample data to obtain an interpolation model, where the interpolation model is used to input data belonging to the data feature corresponding to the first device and output predicted data belonging to the data feature corresponding to the second device.
Further, the training module 20 includes:
a first input unit, configured to input the first sample data into a first part model preset in the first device to obtain a first output;
The sending unit is used for sending the first output to the second device so that the second device obtains a second output of a preset second part model according to the first output, calculates a first loss function and first gradient information according to the second sample data and the second output, and updates parameters of the second part model according to gradient information related to the second part model in the first gradient information;
a first receiving unit, configured to update parameters of the first part model according to gradient information related to the first part model in the first gradient information received from the second device, and iteratively train until a preset stopping condition is detected to be met, and receive the second part model sent by the second device;
And the combining unit is used for combining the first partial model and the second partial model to obtain the interpolation model.
Further, the training module 20 further includes:
the second input unit is used for inputting local sample data belonging to the data characteristics corresponding to the first equipment into the interpolation model to obtain predicted sample data belonging to the data characteristics corresponding to the second equipment;
The first training unit is used for carrying out local training on a preset machine learning model to be trained by adopting the local sample data and the prediction sample data to obtain a target machine learning model.
Further, the first device includes a first trusted execution environment TEE module, the second device includes a second TEE module, and the sending unit includes:
The encryption subunit is used for encrypting the first output to obtain a first encrypted output;
A sending subunit, configured to send the first encrypted output to the second device, so that the second device decrypts the first encrypted output in the second TEE module to obtain the first output, obtain a second output of a preset second part model according to the first output, calculate a first loss function and first gradient information according to the second sample data and the second output, update parameters of the second part model according to gradient information related to the second part model in the first gradient information, and encrypt gradient information related to the first part model in the first gradient information to obtain encrypted gradient information;
The first receiving unit is further configured to receive the encrypted gradient information sent by the second device, decrypt the encrypted gradient information in the first TEE module to obtain gradient information related to the first part model in the first gradient information, and update parameters of the first part model according to the gradient information related to the first part model.
Further, the training module 20 further includes:
A second receiving unit, configured to receive the second output and the first loss function sent by the second device;
The third input unit is used for inputting the first sample data and the second output into a preset machine learning model to be trained to obtain prediction tag data;
The calculating unit is used for calculating a second loss function and second gradient information of the machine learning model to be trained according to the prediction tag data and the pre-stored local actual tag data;
The first receiving unit is further configured to update parameters of the machine learning model to be trained according to the second gradient information, iterate training to minimize a fusion loss function, obtain a target machine learning model until a preset stopping condition is detected to be met, and receive the second partial model sent by the second device, where the first device fuses the first loss function and the second loss function to obtain the fusion loss function.
Further, the first device includes a TEE module therein, and the training module 20 includes:
a third receiving unit, configured to receive second encrypted sample data sent by the second device, where the second device encrypts the second sample data to obtain the second encrypted sample data;
And the second training unit is used for decrypting the second encrypted sample data in the TEE module to obtain second sample data, and training the interpolation model to be trained according to the first sample data and the second sample data to obtain the interpolation model.
Further, the target machine learning model is used for predicting purchasing intent of a user, and the longitudinal federal learning system optimization device further comprises:
The input module is used for inputting first data of a target user into the interpolation model to obtain second data, wherein the data characteristics of the first data comprise user identity characteristics, and the data characteristics of the second data comprise user purchase characteristics;
and the prediction module is used for inputting the first data and the second data into the target machine learning model to obtain the purchase intention of the target user.
The expansion content of the specific implementation mode of the longitudinal federal learning system optimization device is basically the same as that of each embodiment of the longitudinal federal learning system optimization method, and the description is omitted here.
In addition, the embodiment of the invention also provides a computer readable storage medium, wherein the storage medium is stored with a longitudinal federal learning system optimization program, and the longitudinal federal learning system optimization program realizes the steps of the longitudinal federal learning system optimization method when being executed by a processor.
Embodiments of the longitudinal federal learning system optimization apparatus and the computer-readable storage medium according to the present invention may refer to embodiments of the longitudinal federal learning system optimization method according to the present invention, and will not be described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (8)

1. The longitudinal federal learning system optimization method is characterized by being applied to a first device, wherein the first device is in communication connection with a second device, and the longitudinal federal learning system optimization method comprises the following steps:
Performing sample alignment with the second device to obtain first sample data of the first device, wherein the first device uses data of a common user in local data as the first sample data, the second device uses the data of the common user in the local data as second sample data, the first sample data is different from the second sample data in data characteristics, and the second sample data is obtained by performing sample alignment with the first device by the second device;
the first sample data and the second equipment are adopted for collaborative training to obtain an interpolation model, wherein the interpolation model is used for inputting data belonging to the data characteristics corresponding to the first equipment and outputting data belonging to the data characteristics corresponding to the second equipment;
Inputting local sample data belonging to the data characteristics corresponding to the first equipment into the interpolation model to obtain predicted sample data belonging to the data characteristics corresponding to the second equipment;
Carrying out local training on a preset machine learning model to be trained by adopting the local sample data and the prediction sample data to obtain a target machine learning model, wherein the target machine learning model is used for predicting the purchase intention of a user;
inputting first data of a target user into the interpolation model to obtain second data, wherein the data features of the first data comprise user identity features, the user identity features comprise age, deposit and monthly salary, the data features of the second data comprise user purchase features, and the user purchase features comprise purchase times and purchase preferences;
And inputting the first data and the second data into the target machine learning model to obtain the purchase intention of the target user.
2. The method of longitudinal federal learning system optimization according to claim 1, wherein the step of training in collaboration with the second device using the first sample data to obtain an interpolation model comprises:
inputting the first sample data into a first part model preset in the first device to obtain a first output;
Transmitting the first output to the second device, so that the second device obtains a second output of a preset second part model according to the first output, calculates a first loss function and first gradient information according to the second sample data and the second output, and updates parameters of the second part model according to gradient information related to the second part model in the first gradient information;
updating parameters of the first part model according to gradient information related to the first part model in the first gradient information received from the second equipment, and iteratively training until the second part model sent by the second equipment is received when the condition that a preset stopping condition is met is detected;
And combining the first partial model and the second partial model to obtain the interpolation model.
3. The method of claim 2, wherein the first device includes a first trusted execution environment, TEE, module and the second device includes a second TEE module,
The step of sending the first output to the second device, so that the second device obtains a second output of a preset second part model according to the first output, the step of calculating a first loss function and first gradient information according to the second sample data and the second output, and the step of updating parameters of the second part model according to gradient information related to the second part model in the first gradient information comprises the following steps:
encrypting the first output to obtain a first encrypted output;
Transmitting the first encryption output to the second device, so that the second device decrypts the first encryption output in the second TEE module to obtain the first output, obtaining a second output of a preset second part model according to the first output, calculating a first loss function and first gradient information according to the second sample data and the second output, updating parameters of the second part model according to gradient information related to the second part model in the first gradient information, and encrypting gradient information related to the first part model in the first gradient information to obtain encrypted gradient information;
The step of updating parameters of the first partial model based on gradient information related to the first partial model in the first gradient information received from the second device includes:
And receiving the encrypted gradient information sent by the second equipment, decrypting the encrypted gradient information in the first TEE module to obtain gradient information related to the first part model in the first gradient information, and updating parameters of the first part model according to the gradient information related to the first part model.
4. The longitudinal federal learning system optimization method according to claim 2, wherein after the step of transmitting the first output to the second device, further comprising:
receiving the second output and the first loss function sent by the second device;
inputting the first sample data and the second output into a preset machine learning model to be trained to obtain predictive label data;
Calculating a second loss function and second gradient information of the machine learning model to be trained according to the predicted tag data and the pre-stored local actual tag data;
The step of receiving the second part model sent by the second device until the iterative training is detected to meet a preset stopping condition comprises the following steps:
And updating parameters of the machine learning model to be trained according to the second gradient information, performing iterative training to minimize a fusion loss function, obtaining a target machine learning model until the condition that a preset stopping condition is met is detected, and receiving the second partial model sent by the second device, wherein the first device fuses the first loss function and the second loss function to obtain the fusion loss function.
5. The method of optimizing a longitudinal federal learning system according to claim 1, wherein the first device includes a TEE module, and wherein the step of training cooperatively with the second device using the first sample data to obtain an interpolation model includes:
Receiving second encrypted sample data sent by the second device, wherein the second device encrypts the second sample data to obtain the second encrypted sample data;
and decrypting the second encrypted sample data in the TEE module to obtain second sample data, and training an interpolation model to be trained according to the first sample data and the second sample data to obtain the interpolation model.
6. A longitudinal federal learning system optimization device deployed at a first facility, the first facility communicatively coupled to a second facility, the longitudinal federal learning system optimization device comprising:
The alignment module is used for carrying out sample alignment with the second equipment to obtain first sample data of the first equipment, wherein the first equipment takes data of a common user in local data as the first sample data, the second equipment takes the data of the common user in the local data as second sample data, the data characteristics of the first sample data are different from those of the second sample data, and the second sample data are obtained by carrying out sample alignment on the second equipment and the first equipment;
the training module is used for cooperatively training the first sample data and the second equipment to obtain an interpolation model, wherein the interpolation model is used for inputting data belonging to the data characteristics corresponding to the first equipment and outputting prediction data belonging to the data characteristics corresponding to the second equipment;
the second input unit is used for inputting local sample data belonging to the data characteristics corresponding to the first equipment into the interpolation model to obtain predicted sample data belonging to the data characteristics corresponding to the second equipment;
The first training unit is used for carrying out local training on a preset machine learning model to be trained by adopting the local sample data and the prediction sample data to obtain a target machine learning model, wherein the target machine learning model is used for predicting the purchase intention of a user;
The input module is used for inputting first data of a target user into the interpolation model to obtain second data, wherein the data characteristics of the first data comprise user identity characteristics, and the data characteristics of the second data comprise user purchase characteristics;
and the prediction module is used for inputting the first data and the second data into the target machine learning model to obtain the purchase intention of the target user.
7. A longitudinal federal learning system optimization apparatus, the longitudinal federal learning system optimization apparatus comprising: memory, a processor and a longitudinal federal learning system optimization program stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the longitudinal federal learning system optimization method of any one of claims 1 to 5.
8. A computer readable storage medium, wherein a longitudinal federal learning system optimization program is stored on the computer readable storage medium, which when executed by a processor, implements the steps of the longitudinal federal learning system optimization method according to any one of claims 1 to 5.
CN201910918262.9A 2019-09-26 2019-09-26 Longitudinal federal learning system optimization method, device, equipment and readable storage medium Active CN110633805B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910918262.9A CN110633805B (en) 2019-09-26 2019-09-26 Longitudinal federal learning system optimization method, device, equipment and readable storage medium
PCT/CN2020/107332 WO2021004551A1 (en) 2019-09-26 2020-08-06 Method, apparatus, and device for optimization of vertically federated learning system, and a readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910918262.9A CN110633805B (en) 2019-09-26 2019-09-26 Longitudinal federal learning system optimization method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN110633805A CN110633805A (en) 2019-12-31
CN110633805B true CN110633805B (en) 2024-04-26

Family

ID=68973220

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910918262.9A Active CN110633805B (en) 2019-09-26 2019-09-26 Longitudinal federal learning system optimization method, device, equipment and readable storage medium

Country Status (2)

Country Link
CN (1) CN110633805B (en)
WO (1) WO2021004551A1 (en)

Families Citing this family (62)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110633805B (en) * 2019-09-26 2024-04-26 深圳前海微众银行股份有限公司 Longitudinal federal learning system optimization method, device, equipment and readable storage medium
CN111241580B (en) * 2020-01-09 2022-08-09 广州大学 Trusted execution environment-based federated learning method
CN111310204B (en) * 2020-02-10 2022-06-14 北京百度网讯科技有限公司 Data processing method and device
CN111339212A (en) * 2020-02-13 2020-06-26 深圳前海微众银行股份有限公司 Sample clustering method, device, equipment and readable storage medium
CN111260061B (en) * 2020-03-09 2022-07-19 厦门大学 Differential noise adding method and system in federated learning gradient exchange
CN111401552B (en) * 2020-03-11 2023-04-07 浙江大学 Federal learning method and system based on batch size adjustment and gradient compression rate adjustment
CN113392164B (en) * 2020-03-13 2024-01-12 京东城市(北京)数字科技有限公司 Method for constructing longitudinal federal tree, main server, service platform and system
CN111460511B (en) * 2020-04-17 2023-05-02 支付宝(杭州)信息技术有限公司 Federal learning and virtual object distribution method and device based on privacy protection
CN113554476B (en) * 2020-04-23 2024-04-19 京东科技控股股份有限公司 Training method and system of credit prediction model, electronic equipment and storage medium
CN111522669A (en) * 2020-04-29 2020-08-11 深圳前海微众银行股份有限公司 Method, device and equipment for optimizing horizontal federated learning system and readable storage medium
CN111625820A (en) * 2020-05-29 2020-09-04 华东师范大学 Federal defense method based on AIoT-oriented security
CN111737921B (en) * 2020-06-24 2024-04-26 深圳前海微众银行股份有限公司 Data processing method, equipment and medium based on cyclic neural network
CN111858955B (en) * 2020-07-01 2023-08-18 石家庄铁路职业技术学院 Knowledge graph representation learning enhancement method and device based on encryption federal learning
CN111859360A (en) * 2020-07-10 2020-10-30 深圳市洞见智慧科技有限公司 Safe multi-device joint data computing system, method and device
CN111860864A (en) * 2020-07-23 2020-10-30 深圳前海微众银行股份有限公司 Longitudinal federal modeling optimization method, device and readable storage medium
CN112231746B (en) * 2020-09-10 2024-02-02 杭州锘崴信息科技有限公司 Joint data analysis method, device, system and computer readable storage medium
CN111931216B (en) 2020-09-16 2021-03-30 支付宝(杭州)信息技术有限公司 Method and system for obtaining joint training model based on privacy protection
CN112132293A (en) * 2020-09-30 2020-12-25 腾讯科技(深圳)有限公司 Calculation method, device, equipment and medium in longitudinal federal learning
CN112149171B (en) * 2020-10-27 2021-07-09 腾讯科技(深圳)有限公司 Method, device, equipment and storage medium for training federal neural network model
CN112418446B (en) * 2020-11-18 2024-04-09 脸萌有限公司 Model processing method, system, device, medium and electronic equipment
CN112529102B (en) * 2020-12-24 2024-03-12 深圳前海微众银行股份有限公司 Feature expansion method, device, medium and computer program product
CN112700010A (en) * 2020-12-30 2021-04-23 深圳前海微众银行股份有限公司 Feature completion method, device, equipment and storage medium based on federal learning
CN112686473B (en) * 2021-01-22 2023-12-08 国网江苏省电力有限公司营销服务中心 Power consumption prediction method and prediction system based on classification algorithm
CN112818394A (en) * 2021-01-29 2021-05-18 西安交通大学 Self-adaptive asynchronous federal learning method with local privacy protection
CN112885337A (en) * 2021-01-29 2021-06-01 深圳前海微众银行股份有限公司 Data processing method, device, equipment and storage medium
CN112989944A (en) * 2021-02-08 2021-06-18 西安翔迅科技有限责任公司 Intelligent video safety supervision method based on federal learning
CN112818374A (en) * 2021-03-02 2021-05-18 深圳前海微众银行股份有限公司 Joint training method, device, storage medium and program product of model
CN112836767A (en) * 2021-03-03 2021-05-25 深圳前海微众银行股份有限公司 Federal modeling method, apparatus, device, storage medium, and program product
CN112948883B (en) * 2021-03-25 2023-10-31 支付宝(杭州)信息技术有限公司 Method, device and system for multiparty joint modeling of privacy data protection
CN112949760B (en) * 2021-03-30 2024-05-10 平安科技(深圳)有限公司 Model precision control method, device and storage medium based on federal learning
CN113191072A (en) * 2021-03-30 2021-07-30 中国建设银行股份有限公司 Suspicious transaction monitoring method and device based on longitudinal federal logistic regression
CN113807535B (en) * 2021-04-01 2023-11-03 京东科技控股股份有限公司 Training method and device of federal learning model, electronic equipment and storage medium
CN113807538B (en) * 2021-04-09 2024-02-06 京东科技控股股份有限公司 Federal learning method, federal learning device, electronic equipment and storage medium
CN113269232B (en) * 2021-04-25 2023-12-08 北京沃东天骏信息技术有限公司 Model training method, vectorization recall method, related equipment and storage medium
CN113240461B (en) * 2021-05-07 2022-08-16 广州银行股份有限公司 Method, system and medium for identifying potential customers based on longitudinal federal learning
CN113283521B (en) * 2021-06-03 2023-09-01 光大科技有限公司 Condition generation countermeasure network generation method and device
CN113361771B (en) * 2021-06-04 2023-04-18 合肥工业大学 Method and device for determining the pressure of a storage tank
CN113297573B (en) * 2021-06-11 2022-06-10 浙江工业大学 Vertical federal learning defense method and device based on GAN simulation data generation
CN113642034A (en) * 2021-06-25 2021-11-12 合肥工业大学 Medical big data safety sharing method and system based on horizontal and vertical federal learning
CN113642664B (en) * 2021-08-24 2024-02-20 安徽大学 Privacy protection image classification method based on federal learning
CN113673700A (en) * 2021-08-25 2021-11-19 深圳前海微众银行股份有限公司 Longitudinal federal prediction optimization method, device, medium, and computer program product
CN113688771B (en) * 2021-09-02 2024-04-05 重庆大学 LNG storage tank acceleration response data supplementing method and device
CN114186694A (en) * 2021-11-16 2022-03-15 浙江大学 Efficient, safe and low-communication longitudinal federal learning method
CN114186263B (en) * 2021-12-17 2024-05-03 大连理工大学 Data regression method based on longitudinal federal learning and electronic device
CN114282652A (en) * 2021-12-22 2022-04-05 哈尔滨工业大学 Privacy-protecting longitudinal deep neural network model construction method, computer and storage medium
CN114302412A (en) * 2021-12-27 2022-04-08 中国电信股份有限公司 Base station construction intelligent planning method and device, storage medium and terminal equipment
CN114491590A (en) * 2022-01-17 2022-05-13 平安科技(深圳)有限公司 Homomorphic encryption method, system, equipment and storage medium based on federal factorization machine
CN114429223B (en) * 2022-01-26 2023-11-07 上海富数科技有限公司 Heterogeneous model building method and device
CN114548255A (en) * 2022-02-17 2022-05-27 支付宝(杭州)信息技术有限公司 Model training method, device and equipment
CN114818476B (en) * 2022-04-01 2023-08-22 西南交通大学 Federal learning system and method applied to life prediction of rotating mechanical equipment
CN114492846B (en) * 2022-04-06 2022-08-26 天聚地合(苏州)科技股份有限公司 Cross-domain federated learning method and system based on trusted execution environment
CN114996317B (en) * 2022-07-05 2024-02-23 中国电信股份有限公司 Asynchronous optimization method and device based on longitudinal federal learning and storage medium
CN115659212B (en) * 2022-09-27 2024-04-09 南京邮电大学 Federal learning efficiency evaluation method based on TDD communication under cross-domain heterogeneous scene
CN115292738B (en) * 2022-10-08 2023-01-17 豪符密码检测技术(成都)有限责任公司 Method for detecting security and correctness of federated learning model and data
CN115545216B (en) * 2022-10-19 2023-06-30 上海零数众合信息科技有限公司 Service index prediction method, device, equipment and storage medium
CN115563564B (en) * 2022-12-02 2023-03-17 腾讯科技(深圳)有限公司 Processing method and device of decision tree model, computer equipment and storage medium
CN116032431B (en) * 2023-02-06 2023-09-12 哈尔滨工业大学(深圳) Communication compression method for distributed learning and related equipment
CN116319714B (en) * 2023-05-24 2023-07-21 北京邮电大学 Federal learning method based on modal conversion and related equipment
CN116633704B (en) * 2023-07-25 2023-10-31 北京数牍科技有限公司 Graph calculation method and device
CN117094421B (en) * 2023-10-16 2023-12-15 亚信科技(中国)有限公司 Asymmetric longitudinal federal learning method, device, electronic equipment and storage medium
CN117689009A (en) * 2024-01-30 2024-03-12 东北大学 Regularized personalized federal training-oriented communication optimization method
CN117853212A (en) * 2024-03-06 2024-04-09 之江实验室 Longitudinal federal financial wind control method based on knowledge migration and self-supervision learning

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109347620A (en) * 2018-08-10 2019-02-15 深圳前海微众银行股份有限公司 Sample alignment schemes, system and computer readable storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100076785A1 (en) * 2008-09-25 2010-03-25 Air Products And Chemicals, Inc. Predicting rare events using principal component analysis and partial least squares
US10572773B2 (en) * 2017-05-05 2020-02-25 Intel Corporation On the fly deep learning in machine learning for autonomous machines
CN109033854B (en) * 2018-07-17 2020-06-09 阿里巴巴集团控股有限公司 Model-based prediction method and device
CN109002861B (en) * 2018-08-10 2021-11-09 深圳前海微众银行股份有限公司 Federal modeling method, device and storage medium
CN110110229B (en) * 2019-04-25 2021-06-04 深圳前海微众银行股份有限公司 Information recommendation method and device
CN110245510B (en) * 2019-06-19 2021-12-07 北京百度网讯科技有限公司 Method and apparatus for predicting information
CN110633805B (en) * 2019-09-26 2024-04-26 深圳前海微众银行股份有限公司 Longitudinal federal learning system optimization method, device, equipment and readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109347620A (en) * 2018-08-10 2019-02-15 深圳前海微众银行股份有限公司 Sample alignment schemes, system and computer readable storage medium

Also Published As

Publication number Publication date
WO2021004551A1 (en) 2021-01-14
CN110633805A (en) 2019-12-31

Similar Documents

Publication Publication Date Title
CN110633805B (en) Longitudinal federal learning system optimization method, device, equipment and readable storage medium
CN110633806B (en) Longitudinal federal learning system optimization method, device, equipment and readable storage medium
CN109167695B (en) Federal learning-based alliance network construction method and device and readable storage medium
CN111428881B (en) Recognition model training method, device, equipment and readable storage medium
CN109492420B (en) Model parameter training method, terminal, system and medium based on federal learning
CN110402561B (en) Block chain data protection based on general account model and homomorphic encryption
CN110073633B (en) Block chain data protection using homomorphic encryption
CN110546667B (en) Blockchain data protection using homomorphic encryption
CN113159327B (en) Model training method and device based on federal learning system and electronic equipment
US11741461B2 (en) Method for performing non-repudiation, and payment managing server and user device therefor
US11121857B2 (en) Systems, devices, and methods for in-field authenticating of autonomous robots
CN111602161A (en) Block chain data protection based on general account model and homomorphic encryption
US20190354969A1 (en) System and method for securing digital assets
CN110326251A (en) The system and method that the general dispersion solution of user is verified using cross validation feature are provided
KR101982237B1 (en) Method and system for data sharing using attribute-based encryption in cloud computing
CN110417750A (en) File based on block chain technology is read and method, terminal device and the storage medium of storage
CN112613956B (en) Bidding processing method and device
CN112199709A (en) Multi-party based privacy data joint training model method and device
CN111612167A (en) Joint training method, device, equipment and storage medium of machine learning model
CN113569263A (en) Secure processing method and device for cross-private-domain data and electronic equipment
US20200349566A1 (en) Device control method and related device
CN116992458A (en) Programmable data processing method and system based on trusted execution environment
CN111985000A (en) Model service output method, device, equipment and storage medium
US11943210B2 (en) System and method for distributed, keyless electronic transactions with authentication
CN116502732B (en) Federal learning method and system based on trusted execution environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant