CN111242316A - Longitudinal federated learning model training optimization method, device, equipment and medium - Google Patents

Longitudinal federated learning model training optimization method, device, equipment and medium Download PDF

Info

Publication number
CN111242316A
CN111242316A CN202010022573.XA CN202010022573A CN111242316A CN 111242316 A CN111242316 A CN 111242316A CN 202010022573 A CN202010022573 A CN 202010022573A CN 111242316 A CN111242316 A CN 111242316A
Authority
CN
China
Prior art keywords
model
local
training
intermediate result
model training
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.)
Granted
Application number
CN202010022573.XA
Other languages
Chinese (zh)
Other versions
CN111242316B (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 CN202010022573.XA priority Critical patent/CN111242316B/en
Publication of CN111242316A publication Critical patent/CN111242316A/en
Application granted granted Critical
Publication of CN111242316B publication Critical patent/CN111242316B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method and a device for optimizing training of a longitudinal federated learning model, terminal equipment and a computer readable storage medium, wherein model training intermediate results sent by other data providers in the ith training period are received; and performing multiple rounds of local model parameter updating according to the model training intermediate result, and receiving the model training intermediate result sent by other data providers in the (i + 1) th training period to continue performing multiple rounds of local model parameter updating. The method utilizes the model training intermediate result of updating the model parameters of one round of the longitudinal federal learning transmitted by other data providers to update the local model parameters of multiple rounds, then utilizes the new model training intermediate result transmitted by other data providers to continuously update the local model parameters of the multiple rounds, and reduces the transmission times of the model training intermediate result in the longitudinal federal learning, thereby reducing the total transmission data amount and the transmission cost and solving the transmission efficiency bottleneck of the federal learning to a certain extent.

Description

Longitudinal federated learning model training optimization method, device, equipment and medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a longitudinal federal learning model training optimization method, a longitudinal federal learning model training optimization device, terminal equipment and a computer readable storage medium.
Background
Federal learning is a novel machine learning concept which ensures that user privacy data is protected to the maximum extent through distributed training and encryption technology. The federal learning can be divided into horizontal federal learning and longitudinal federal learning, under the longitudinal federal learning, all participants (data providers with respective local data) need to jointly calculate gradients, so that the intermediate results of models calculated by respective local sides need to be mutually transmitted every time each participant local training model is trained for each turn. Therefore, in the whole training process of longitudinal federal learning, the transmission times of the intermediate results are in direct proportion to the iteration times of model training, so that the transmission cost of the existing longitudinal federal learning scheme is high, and the efficiency is low.
Disclosure of Invention
The invention mainly aims to provide a longitudinal federated learning model training optimization method, a longitudinal federated learning model training optimization device, terminal equipment and a computer readable storage medium, and aims to solve the technical problems of high transmission cost and low efficiency of the conventional longitudinal federated learning scheme.
In order to achieve the above object, the present invention provides a longitudinal federal learning model training optimization method, which is applied to a data provider participating in longitudinal federal learning, and the longitudinal federal learning model training optimization method includes:
receiving model training intermediate results sent by other data providers in the ith training period;
and performing multiple rounds of local model parameter updating according to the model training intermediate result, and receiving the model training intermediate result sent by the other data provider in the (i + 1) th training period to continue performing multiple rounds of local model parameter updating.
Further, the step of performing multiple rounds of local model parameter updating according to the model training intermediate result includes:
in a local training process of a local model, calculating by combining a local side intermediate result calculated by the local model and the model training intermediate result to obtain a gradient value, and updating a model parameter of the local model based on the gradient value;
and circularly executing multiple rounds of local training of the local model until the number of training rounds of the local model reaches a preset number of rounds.
Further, after the step of performing multiple rounds of local model parameter updating according to the model training intermediate result, the method further includes:
and transmitting the local side intermediate result obtained by the local model calculation to the other data providers as a new model training intermediate result.
Further, the step of transmitting the local side intermediate result calculated by the local model to the other data provider as a new model training intermediate result includes:
calling a preset public key to encrypt the local side intermediate result obtained by the local model based on local data calculation;
and transmitting the encrypted local side intermediate result to the other data providers as a new model training intermediate result.
Further, the step of calculating a gradient value by combining the local side intermediate result calculated by the local model and the model training intermediate result, and updating the model parameter of the local model based on the gradient value includes:
combining the local side intermediate result calculated by the local model and the encrypted model training intermediate result to calculate an encrypted gradient value;
and calling a preset private key to decrypt the encrypted gradient value, and updating the model parameter of the local model based on the decrypted gradient value.
Further, the step of calling a preset private key to decrypt the encrypted gradient value and updating the model parameter of the local model based on the decrypted gradient value includes:
transmitting the encrypted gradient value to a preset coordinator, so that the preset coordinator can call a preset private key to decrypt the encrypted gradient value;
and receiving the decrypted gradient value fed back by the preset coordinator, and updating the model parameters of the local model.
Further, the step of performing multiple rounds of local model parameter updating according to the model training intermediate result further includes:
and calculating a loss value by combining the local side intermediate result calculated by the local model and the model training intermediate result, judging whether the training of the local model is converged or not based on the loss value, and finishing the training of the local model when the convergence is judged.
In addition, in order to achieve the above object, the present invention further provides a longitudinal federal learning model training optimization device, which is applied to a data provider participating in longitudinal federal learning, and the longitudinal federal learning model training optimization device includes:
the receiving module is used for receiving model training intermediate results sent by other data providers in the ith training period;
and the training learning module is used for carrying out multiple rounds of local model parameter updating according to the model training intermediate result and receiving the model training intermediate result sent by the other data provider in the (i + 1) th training period to continuously carry out multiple rounds of local model parameter updating.
The present invention also provides a terminal device, including: the system comprises a memory, a processor and a longitudinal federated learning model training optimization program stored on the memory and operable on the processor, wherein the longitudinal federated learning model training optimization program when executed by the processor implements the steps of the longitudinal federated learning model training optimization method as described above.
The present invention also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the longitudinal federated learning model training optimization method as described above.
The invention provides a longitudinal federated learning model training optimization method, a device, terminal equipment and a computer readable storage medium, wherein the longitudinal federated learning model training optimization method is applied to data providers participating in longitudinal federated learning, and model training intermediate results sent by other data providers in the ith training period are received; and performing multiple rounds of local model parameter updating according to the model training intermediate result, and receiving the model training intermediate result sent by the other data provider in the (i + 1) th training period to continue performing multiple rounds of local model parameter updating. The method realizes that in the process of one training period of longitudinal federal learning training, the current data provider uses the intermediate result of model training updated by one round of longitudinal federal learning model parameters transmitted by other data providers to update the local model parameters of multiple rounds locally and independently, then in the process of the next training period of longitudinal federal learning training, the intermediate result of new model training updated by one round of longitudinal federal learning model parameters transmitted by other data providers is used to continuously and independently update the local model parameters of multiple rounds, and each data provider does not interact with the intermediate result of calculation during the process of one training period of updating the local model parameters of multiple rounds independently by using the intermediate result of model training updated by one round of received model parameters, thus reducing the transmission times of the intermediate results mutually transmitted in one training period of longitudinal federal learning model training, therefore, the total amount of transmission data and the transmission cost are reduced, so that the federal learning can be applied to more complex models, and the bottleneck of the transmission efficiency of the federal learning is solved to a certain extent.
Drawings
FIG. 1 is a schematic diagram of the hardware operation involved in an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of a longitudinal federated learning model training optimization method of the present invention;
FIG. 3 is a detailed flowchart of step S200 in an embodiment of the method for optimizing training of a longitudinal federated learning model according to the present invention;
FIG. 4 is a schematic diagram of an application scenario in an embodiment of the method for optimizing training of a longitudinal federated learning model according to the present invention
FIG. 5 is a schematic structural diagram of a longitudinal federated learning model training optimization device of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a hardware operating environment according to an embodiment of the present invention.
It should be noted that fig. 1 is a schematic structural diagram of a hardware operating environment of the terminal device. The terminal equipment of the embodiment of the invention can be terminal equipment such as a PC, a portable computer and the like.
As shown in fig. 1, the terminal device 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 a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also 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 non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the terminal device configuration shown in fig. 1 is not intended to be limiting of the terminal device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a distributed task processing program. Among them, the operating system is a program that manages and controls the hardware and software resources of the sample terminal device, a handler that supports distributed tasks, and the execution of other software or programs.
In the terminal apparatus shown in fig. 1, the user interface 1003 is mainly used for data communication with each terminal; the network interface 1004 is mainly used for connecting a background server and performing data communication with the background server; and the processor 1001 may be configured to invoke a longitudinal federated learning model training optimization program stored in the memory 1005 and perform the following operations:
receiving model training intermediate results sent by other data providers in the ith training period;
and performing multiple rounds of local model parameter updating according to the model training intermediate result, and receiving the model training intermediate result sent by the other data provider in the (i + 1) th training period to continue performing multiple rounds of local model parameter updating.
Further, processor 1001 may invoke a longitudinal federated learning model training optimization program stored in memory 1005, and also perform the following operations:
in a local training process of a local model, calculating by combining a local side intermediate result calculated by the local model and the model training intermediate result to obtain a gradient value, and updating a model parameter of the local model based on the gradient value;
and circularly executing multiple rounds of local training of the local model until the number of training rounds of the local model reaches a preset number of rounds.
Further, processor 1001 may invoke a vertical federated learning model training optimization program stored in memory 1005, and after performing multiple rounds of local model parameter updates according to the model training intermediate results, perform the following operations:
and transmitting the local side intermediate result obtained by the local model calculation to the other data providers as a new model training intermediate result.
Further, processor 1001 may invoke a longitudinal federated learning model training optimization program stored in memory 1005, and also perform the following operations:
calling a preset public key to encrypt the local side intermediate result obtained by the local model based on local data calculation;
and transmitting the encrypted local side intermediate result to the other data providers as a new model training intermediate result.
Further, processor 1001 may invoke a longitudinal federated learning model training optimization program stored in memory 1005, and also perform the following operations:
the step of calculating to obtain a gradient value by combining the local side intermediate result calculated by the local model and the model training intermediate result, and updating the model parameter of the local model based on the gradient value comprises the following steps:
combining the local side intermediate result calculated by the local model and the encrypted model training intermediate result to calculate an encrypted gradient value;
and calling a preset private key to decrypt the encrypted gradient value, and updating the model parameter of the local model based on the decrypted gradient value.
Further, processor 1001 may invoke a longitudinal federated learning model training optimization program stored in memory 1005, and also perform the following operations:
transmitting the encrypted gradient value to a preset coordinator, so that the preset coordinator can call a preset private key to decrypt the encrypted gradient value;
and receiving the decrypted gradient value fed back by the preset coordinator, and updating the model parameters of the local model.
Further, processor 1001 may invoke a longitudinal federated learning model training optimization program stored in memory 1005, and also perform the following operations:
and calculating a loss value by combining the local side intermediate result calculated by the local model and the model training intermediate result, judging whether the training of the local model is converged or not based on the loss value, and finishing the training of the local model when the convergence is judged.
Based on the structure, the invention provides various embodiments of the longitudinal federal learning model training optimization method.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of a longitudinal federated learning model training optimization method of the present invention.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different than that shown.
The method for training and optimizing the longitudinal federated learning model in the embodiment of the present invention is applied to the terminal device, and the terminal device in the embodiment of the present invention may be a terminal device such as a PC, a portable computer, or the like, and is not particularly limited herein.
The longitudinal federal learning model training optimization method is applied to data providers participating in longitudinal federal learning, and comprises the following steps:
and step S100, receiving model training intermediate results sent by other data providers in the ith training period.
In the process that a plurality of data providers for longitudinal federal learning participate in the process of federal learning model training, any one data provider receives other data providers transmitted by other data providers in the current federal and calculates model training intermediate results in the process of updating model parameters of a training period for the current longitudinal federal learning.
It should be noted that i is any positive integer greater than 0, and the data provider needs to perform multiple current longitudinal federal learning model parameter updating processes in one training period.
Specifically, for example, there are a data provider a and a data provider B currently participating in vertical federal learning, where the a party and the B party independently perform data calculation of respective local models, and when the a party and the B party perform model training of vertical federal learning, the a party receives a round of model training performed by the B party in participation in current vertical federal learning, so as to perform a model training intermediate result on the B party side calculated in the update process of local model parameters of the B party.
And S200, performing multiple rounds of local model parameter updating according to the model training intermediate result, and receiving the model training intermediate result sent by the other data providers in the (i + 1) th training period to continue performing multiple rounds of local model parameter updating.
In the process that a plurality of data providers for longitudinal federal learning participate in federal learning model training, after any one of the data providers receives an intermediate result of model training of the other data provider side transmitted by the other data provider, the data provider updates a plurality of rounds of local model parameters based on the intermediate result of model training and the feature gradient of the data provider side, and after the updating of the plurality of rounds of local model parameters is completed, receives any other data provider of the plurality of data providers participating in the current longitudinal federal learning again, transmits the intermediate result of model training calculated after the other data provider side passes through the model parameter updating process of the plurality of rounds in the current training period, and continues to update the plurality of rounds of local model parameters based on the intermediate result of model training and the feature gradient of the data provider side, and the process is circulated until the training is finished.
Specifically, for example, in the process of performing model training of longitudinal federal learning by the a-side and the B-side, after the a-side receives the intermediate result of model training on the B-side calculated by the B-side in the process of participating in current longitudinal federal learning one-pass model training to perform local model parameter updating on the B-side, the a-side performs multiple rounds of model parameter updating on the a-side local model through the gradient of feature data owned by the B-side and the received intermediate result of model training on the B-side, and after the a-side completes the multiple rounds of local model parameter updating, receives the intermediate result of model training on the B-side calculated in the local model parameter updating through the B-side and the current training cycle model training again through the B-side and the local model parameter updating, and continues to pass the intermediate result of model training on the B-side which is owned by the a-side and is received again, and carrying out multiple rounds of model parameter updating on the local model of the A side, and circularly executing the process by the A side until the training of the local model of the A side is finished.
Further, referring to fig. 3, fig. 3 is a detailed flowchart illustrating a step of performing multiple rounds of local model parameter updating according to the intermediate result of model training in step S200. In step S200, the step of performing multiple rounds of local model parameter updating according to the model training intermediate result includes:
step S201, in a round of local training process of a local model, combining a local side intermediate result calculated by the local model and a model training intermediate result to calculate a gradient value, and updating a model parameter of the local model based on the gradient value;
at any one data provider in a plurality of data providers participating in longitudinal federal learning, receiving intermediate results of model training at the other data providers transmitted by the other data providers, when multiple rounds of local model parameter updating are carried out based on the model training intermediate result and the characteristic gradient of the self side, during each round of local model parameter update by the data provider based on the intermediate results and the feature gradients on its own side, the data provider calculates the characteristic gradient of the own side to obtain the intermediate result of the own side, and the intermediate result of the local side and the received intermediate result of the model training transmitted by other data providers are connected in parallel to calculate the gradient value of the local model in the current iteration training process, and the data provider updates each model parameter of the local model correspondingly once according to the gradient value obtained by joint calculation.
Specifically, for example, in each round of model parameter updating process performed by the local model of the party a through the gradient of the feature data owned by the party a and the received model training intermediate result on the side of the party B, the party a obtains the local intermediate result on the side of the party a based on the feature gradient calculation of the local side of the party a, and connects the local intermediate result and the received intermediate result on the side of the party B transmitted by the party B in parallel, calculates the gradient value of the local model of the party a in the current round of iterative training process, and then the party a updates each model parameter of the local model once according to the gradient value obtained by the joint calculation.
Step S202, executing multiple rounds of local training of the local model in a circulating manner until the number of training rounds of the local model reaches a preset number of rounds.
Any one data provider in the multiple data providers participating in the longitudinal federal learning performs training circularly to update the local model parameters based on the received model training intermediate results of the other data providers and the characteristic gradient of the local data provider, wherein the model training intermediate results are transmitted by the other data providers, and the local model parameters are updated until the number of training rounds of the data provider for training and updating the local model parameters reaches the preset number of rounds, namely, the current received model training intermediate results of the other data providers are used for continuing updating the local model parameters.
It should be noted that, in this embodiment, in order to ensure that model training of each data provider participating in current longitudinal federal learning can be accurately converged and a model training result is stable, a preset data provider needs to train based on a received model training intermediate result of another data provider to update a training round number of local model parameters, that is, a preset round number, it should be understood that a specific numerical value of the preset round number may be set based on training requirements of different model training.
Specifically, for example, when the a-side receives the intermediate result of model training on the B-side transmitted by the B-side, and performs training cyclically to update the local model parameters of the a-side based on the intermediate result of model training and the feature gradient of the own side until the number of training rounds of the local model parameters updated by the a-side reaches the preset number of rounds (if the preset number of rounds is 10 times, the number of training rounds of the local model parameters updated by the a-side also reaches 10 times), that is, the a-side local model parameters are updated continuously by using the currently received intermediate result on the B-side.
In this embodiment, in the process that a plurality of data providers participating in the longitudinal federal learning participate in the federal learning model training, any one of the data providers receives the other data providers transmitted by the other data providers in the current federal learning, an intermediate result of model training calculated in the process of model parameter updating of one training period of the current longitudinal federal learning is performed, in the process that the plurality of data providers participating in the federal learning model training of the longitudinal federal learning participate, after any one of the data providers receives an intermediate result of model training of one side of the other data providers transmitted by the other data providers, the data provider updates the local model parameters of a plurality of rounds based on the intermediate result of model training and the feature gradient of the local side of the data provider, and after the updating of the local model parameters of the plurality of rounds is completed, any other one of the data providers participating in the plurality of data providers participating in the current longitudinal federal learning is received again to provide the data And the other data provider side is transmitted to obtain a model training intermediate result after the model parameter updating process of multiple rounds in the current training period, and continuously updates the local model parameters of the multiple rounds based on the model training intermediate result and the characteristic gradient of the local side of the other data provider side, and the process is circulated until the training is finished.
The method realizes that in the process of one training period of longitudinal federal learning training, the current data provider uses the intermediate result of model training updated by one round of longitudinal federal learning model parameters transmitted by other data providers to update the local model parameters of multiple rounds locally and independently, then in the process of the next training period of longitudinal federal learning training, the intermediate result of new model training updated by one round of longitudinal federal learning model parameters transmitted by other data providers is used to continuously and independently update the local model parameters of multiple rounds, and each data provider does not interact with the intermediate result of calculation during the process of one training period of updating the local model parameters of multiple rounds independently by using the intermediate result of model training updated by one round of received model parameters, thus reducing the transmission times of the intermediate results mutually transmitted in one training period of longitudinal federal learning model training, therefore, the total amount of transmission data and the transmission cost are reduced, so that the federal learning can be applied to more complex models, and the bottleneck of the transmission efficiency of the federal learning is solved to a certain extent.
Further, based on the first embodiment of the longitudinal federal learning model training optimization method, a second embodiment of the longitudinal federal learning model training optimization method is provided.
In a second embodiment of the longitudinal federated learning model training optimization method according to the present invention, after the step S200 of the first embodiment, which is performed according to the intermediate result of the model training, performing multiple rounds of local model parameter updating, the longitudinal federated learning model training optimization method according to the present invention further includes:
and step A, transmitting the local side intermediate result obtained by the local model calculation to other data providers as a new model training intermediate result.
Any one data provider in a plurality of data providers participating in longitudinal federal learning circularly executes training to update local model parameters to reach the last round of training of a preset number of rounds based on the received model training intermediate result of one side of the other data provider and the characteristic gradient of the own side transmitted by the other data providers, calculates the local side intermediate result of the own side based on the characteristic gradient of the own side, and transmits the local side intermediate result as a new model training intermediate result transmitted by the other data providers to other data providers except the own data provider in the plurality of data providers participating in the current longitudinal federal learning.
Specifically, for example, when the a-side receives the intermediate result of model training on the B-side transmitted by the B-side, and performs the 10 th training to update the local model parameters of the a-side (the preset number of rounds is 10) based on the intermediate result of model training and the feature gradient of the own side, the intermediate result of the own side calculated by the a-side based on the feature gradient of the own side in the current round of training is used as the intermediate result of new model training in the current longitudinal federal learning one round of model parameter updating and transmitted to the B-side, so that the B-side performs multiple rounds of local model parameter updating based on the new intermediate result and the feature gradient of the own side of the B-side.
Further, step a, comprises:
step A1, calling a preset public key to encrypt the local side intermediate result obtained by the local model based on local data calculation;
and step A2, transmitting the encrypted local side intermediate result to the other data providers as a new model training intermediate result.
It should be noted that, in this embodiment, when the intermediate results of model training at the respective local side are transmitted between the data providers participating in the longitudinal federal learning, the intermediate results may be mutually transmitted in an encrypted transmission manner, so that privacy and security of data between each other are ensured.
Specifically, for example, when the public key is obtained by being distributed when participating in current longitudinal federal learning, the party a calls a homomorphic encryption algorithm to perform the 10 th training in a loop to update local model parameters of the party a (the preset number of rounds is 10), the party a encrypts a local side intermediate result obtained by calculation based on a local side feature gradient of the party a during the current round of training, and the local side intermediate result after encryption is used as a new model training intermediate result in one round of model parameter updating of current longitudinal federal learning and is transmitted to the party B, so that the party B performs multiple rounds of local model parameter updating based on the new intermediate result and the local side feature gradient of the party B.
Further, in step S201, the step of calculating a gradient value by combining the local side intermediate result calculated by the local model and the model training intermediate result, and updating the model parameter of the local model based on the gradient value includes:
step S2011, combining the local side intermediate result calculated by the local model and the encrypted model training intermediate result to calculate and obtain an encrypted gradient value;
step S2012, a preset private key is called to decrypt the gradient value, and the model parameter of the local model is updated based on the decrypted gradient value.
And each data provider participating in the longitudinal federated learning calculates and obtains the encrypted gradient value based on the combined local intermediate result and the received encrypted model training intermediate result transmitted by other data providers, so that in the process of updating the local model parameters of each data provider, the encrypted gradient value is decrypted based on the unique private keys respectively distributed and obtained when each data provider participates in the current longitudinal federated learning, and then each model parameter of the local model is correspondingly updated by using the gradient value obtained by decryption.
Specifically, for example, during the process of updating the model parameters of the local model, the party a and the party B calculate the local side intermediate result on one side of the party a and the party B based on the characteristic gradient of the local side of the party a, connect the local side intermediate result in parallel with the received model training intermediate result transmitted by the other party and encrypted based on the homomorphic encryption algorithm, calculate the gradient value encrypted in the current iteration training process of the local model of the party a and the party B, then the party a and the party B call the unique private keys distributed during the participation in the current longitudinal federal learning to decrypt the encrypted gradient value, and update the model parameters of the local model correspondingly by using the decrypted gradient value.
Further, in another embodiment, in the step S2012, the method includes:
step C, the encrypted gradient value is transmitted to a preset coordinator, so that the preset coordinator can call a preset private key to decrypt the encrypted gradient value;
and D, receiving the decrypted gradient value fed back by the preset coordinator, and updating the model parameters of the local model.
It should be noted that, in this embodiment, each data provider participating in the longitudinal federal learning may also perform training and updating of each local model based on the coordination control of the coordinator in the current longitudinal federal learning, and when each data provider performs model training based on the coordinator, the coordinator uniformly distributes the public key of the encryption algorithm to each data provider, and the coordinator retains the unique private key.
After each data provider participating in longitudinal federal learning calculates and obtains an encrypted gradient value based on a combined local side intermediate result and a received encrypted model training intermediate result transmitted by other data providers, the encrypted gradient value is sent to a coordinator, the coordinator receives the encrypted gradient value and calls a unique private key for decryption, then the decrypted gradient value is fed back to the corresponding data provider, and each data provider receives the decrypted gradient value fed back by the coordinator and correspondingly updates each model parameter of each local model.
Specifically, for example, in the application scenario shown in fig. 4, when the C party (coordinator) starts model training in the current vertical federal learning, a public key of a homomorphic encryption algorithm is issued to the a party (data provider) and the B party (another data provider), the a party and the B party call the public key during model parameter updating of the local model, and in the last round of training in the preset round of number, the a party and the B party each encrypt their own-side intermediate results obtained by calculation based on their own-side feature gradient, and mutually transfer the encrypted own-side intermediate results to each other as intermediate results in a current vertical federal learning round of model parameter updating, and after each of the a party and the B party receives the encrypted intermediate results transferred by the other party, jointly calculate their own-side intermediate results based on their own-side feature gradient, the gradient values encrypted in the current round iterative training process of the local models of the A party and the B party are obtained through calculation, then the encrypted gradient values obtained through calculation are transmitted to the C party, the C party receives the encrypted gradient values and calls a unique private key reserved by the C party to decrypt the encrypted gradient values, the C party correspondingly returns the gradient values of the A party and the B party obtained through decryption to the A party and the B party, and therefore the A party and the B party use the gradient values obtained through decryption to correspondingly update the model parameters of the local models.
In the embodiment, when the intermediate results of model training of the own side are transmitted among the data providers participating in the longitudinal federal learning, model training intermediate results can be mutually transmitted in an encryption transmission mode, each data provider participating in longitudinal federal learning calls a unique private key distributed during participation in current longitudinal federal learning to decrypt the encrypted gradient value, then the gradient values obtained by decryption are used for correspondingly updating each model parameter of the local model, or each data provider participating in longitudinal federal learning sends the encrypted gradient value to the coordinator, the coordinator receives the encrypted gradient value and calls a unique private key for decryption, and then feeding the gradient value obtained by decryption back to the corresponding data provider so that each data provider can correspondingly update each model parameter of each local model by using the gradient value obtained by decryption. On the premise of ensuring that the transmission times of the intermediate result of the model training in the longitudinal federal learning are reduced, and further ensuring the privacy and safety of data among data providers on the premise of reducing the total amount of transmitted data and the transmission cost.
Further, a third embodiment of the longitudinal federal learning model training optimization method of the present invention is provided based on the first and second embodiments of the longitudinal federal learning model training optimization method.
In a third embodiment of the method for optimizing training of a longitudinal federated learning model according to the present invention, in step S200, the step of updating the parameters of the multiple rounds of local models according to the intermediate result of model training further includes:
and E, calculating a loss value by combining the local side intermediate result calculated by the local model and the model training intermediate result, judging whether the training of the local model is converged or not based on the loss value, and finishing the training of the local model when the convergence is judged.
The method comprises the steps that a data provider in a plurality of data providers participating in longitudinal federated learning obtains a local side intermediate result of one side of the data provider based on characteristic gradient calculation of the local side of the data provider, the local side intermediate result and received model training intermediate results transmitted by other data providers are connected in parallel to calculate a gradient value in the current round of iterative training process of a local model, meanwhile, the local side intermediate result and the received model training intermediate results transmitted by other data providers are combined to calculate a loss value in the current round of iterative training process, whether iterative training of the local model of the data provider is converged or not is judged based on the loss value, and continuous iterative training of the local model is finished when the convergence is judged.
Specifically, for example, in the case where the gradient of the characteristic data owned by the side of the A and the intermediate result received on the side of the B, in each round of model parameter updating process of the local model of the A party, when the A party obtains a local side intermediate result of one side of the A party based on the characteristic gradient calculation of the local side of the A party, and the intermediate result of the local side and the received intermediate result of the side of the B party transmitted by the side B are connected in parallel, while the gradient value of the local model of the side A in the current round iterative training process is calculated, combining the side intermediate result with the received side intermediate result of the B party transmitted by the B party, calculating the loss value of the local model of the A party in the current round iterative training process, and when the loss value is smaller than the preset threshold value, judging that the current round of iterative training of the local model of the A party is converged, namely stopping the local model of the A party to continuously update the model parameters.
It should be noted that, in this embodiment, it is determined whether each data provider participates in the longitudinal federal learning to perform the model training and converges, and it may also be determined based on the number of model training iterative training rounds performed by each data provider participating in the longitudinal federal learning.
In the embodiment, a data provider in a plurality of data providers participating in longitudinal federal learning obtains a local side intermediate result based on the characteristic gradient calculation of the local side, the local side intermediate result is connected with model training intermediate results transmitted by other received data providers in parallel to calculate a gradient value of a local model in the current round of iterative training process, meanwhile, the local side intermediate result and model training intermediate results transmitted by other received data providers are combined to calculate a loss value in the current round of iterative training process, whether iterative training of the local model of the data provider is converged is judged based on the loss value, continuous iterative training of the local model is finished when the convergence is judged, the process of monitoring each data provider participating in longitudinal federal learning to perform model training in real time is realized, and the current data provider is stopped to perform unnecessary training once the convergence of the model training is detected, not only ensures that the training resources are not wasted in the longitudinal federal learning, but also avoids the problem of unstable model effect caused by excessive model training, and comprehensively improves the efficiency of the longitudinal federal learning.
In addition, referring to fig. 5, an embodiment of the present invention further provides a longitudinal federal learning model training optimization device, which is applied to a data provider participating in longitudinal federal learning, and the longitudinal federal learning model training optimization device includes:
the receiving module is used for receiving model training intermediate results sent by other data providers in the ith training period;
and the training learning module is used for carrying out multiple rounds of local model parameter updating according to the model training intermediate result and receiving the model training intermediate result sent by the other data provider in the (i + 1) th training period to continuously carry out multiple rounds of local model parameter updating.
Preferably, the training learning module comprises:
the calculation updating unit is used for calculating a gradient value by combining the local side intermediate result calculated by the local model and the model training intermediate result in the local training process of the local model, and updating the model parameters of the local model based on the gradient value;
and the circulating unit is used for circularly executing multiple rounds of local training of the local model until the number of training rounds of the local model reaches a preset number of rounds.
Preferably, the training learning module further comprises:
and the first transmission unit is used for transmitting the local side intermediate result obtained by the local model calculation to the other data providers as a new model training intermediate result.
Preferably, the first transfer unit includes:
the encryption unit is used for calling a preset public key to encrypt the local side intermediate result obtained by the local model based on local data calculation;
and the transmission subunit is used for transmitting the encrypted local side intermediate result as a new model training intermediate result to the other data providers.
Preferably, the calculation updating unit includes:
the calculation unit is used for calculating and obtaining an encrypted gradient value by combining the local side intermediate result calculated by the local model and the encrypted model training intermediate result;
and the updating unit is used for calling a preset private key to decrypt the encrypted gradient value and updating the model parameter of the local model based on the decrypted gradient value.
Preferably, the updating unit further includes:
a second transmitting unit, configured to transmit the encrypted gradient value to a preset coordinator, so that the preset coordinator calls a preset private key to decrypt the encrypted gradient value;
and the updating subunit is configured to receive the decrypted gradient value fed back by the preset coordinator and update the model parameter of the local model.
Preferably, the training learning module further comprises:
and the training ending unit is used for calculating a loss value by combining the local side intermediate result calculated by the local model and the model training intermediate result, judging whether the training of the local model is converged or not based on the loss value, and ending the training of the local model when the convergence is judged.
The steps implemented by the functional modules of the longitudinal federated learning model training optimization device during operation can refer to the embodiments of the longitudinal federated learning model training optimization method, and are not described herein again.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, which is applied to a computer and may be a non-volatile computer-readable storage medium, where a longitudinal federated learning model training optimization program is stored on the computer-readable storage medium, and when the longitudinal federated learning model training optimization program is executed by a processor, the steps of the longitudinal federated learning model training optimization method described above are implemented.
The steps implemented when the longitudinal federated learning model training optimization program running on the processor is executed may refer to various embodiments of the longitudinal federated learning model training optimization method of the present invention, and are not described herein again.
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 system 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 system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A longitudinal federated learning model training optimization method is applied to data providers participating in longitudinal federated learning and comprises the following steps:
receiving model training intermediate results sent by other data providers in the ith training period;
and performing multiple rounds of local model parameter updating according to the model training intermediate result, and receiving the model training intermediate result sent by the other data provider in the (i + 1) th training period to continue performing multiple rounds of local model parameter updating.
2. The longitudinal federal learning model training optimization method of claim 1, wherein the step of performing multiple rounds of local model parameter updates according to the intermediate results of model training comprises:
in a local training process of a local model, calculating by combining a local side intermediate result calculated by the local model and the model training intermediate result to obtain a gradient value, and updating a model parameter of the local model based on the gradient value;
and circularly executing multiple rounds of local training of the local model until the number of training rounds of the local model reaches a preset number of rounds.
3. The longitudinal federal learning model training optimization method of claim 2, further comprising, after the step of performing multiple rounds of local model parameter updates based on the intermediate results of model training:
and transmitting the local side intermediate result obtained by the local model calculation to the other data providers as a new model training intermediate result.
4. The method for longitudinal federated learning model training optimization of claim 3, wherein the step of passing the local side intermediate results computed by the local model to the other data provider as new model training intermediate results comprises:
calling a preset public key to encrypt the local side intermediate result obtained by the local model based on local data calculation;
and transmitting the encrypted local side intermediate result to the other data providers as a new model training intermediate result.
5. The method for optimizing training of a longitudinal federated learning model as claimed in claim 4, wherein the step of calculating a gradient value by combining the local side intermediate result calculated by the local model and the model training intermediate result, and updating the model parameters of the local model based on the gradient value, comprises:
combining the local side intermediate result calculated by the local model and the encrypted model training intermediate result to calculate an encrypted gradient value;
and calling a preset private key to decrypt the encrypted gradient value, and updating the model parameter of the local model based on the decrypted gradient value.
6. The method for optimizing training of a longitudinal federated learning model as claimed in claim 5, wherein the step of invoking a pre-configured private key to decrypt the encrypted gradient values and update the model parameters of the local model based on the decrypted gradient values comprises:
transmitting the encrypted gradient value to a preset coordinator, so that the preset coordinator can call a preset private key to decrypt the encrypted gradient value;
and receiving the decrypted gradient value fed back by the preset coordinator, and updating the model parameters of the local model.
7. The longitudinal federal learning model training optimization method of claim 2, wherein the step of performing multiple rounds of local model parameter updates according to the intermediate results of model training further comprises:
and calculating a loss value by combining the local side intermediate result calculated by the local model and the model training intermediate result, judging whether the training of the local model is converged or not based on the loss value, and finishing the training of the local model when the convergence is judged.
8. A longitudinal federated learning model training optimization device is applied to a data provider participating in longitudinal federated learning, and comprises the following steps:
the receiving module is used for receiving model training intermediate results sent by other data providers in the ith training period;
and the training learning module is used for carrying out multiple rounds of local model parameter updating according to the model training intermediate result and receiving the model training intermediate result sent by the other data provider in the (i + 1) th training period to continuously carry out multiple rounds of local model parameter updating.
9. A terminal device, characterized in that the terminal device comprises: a memory, a processor, and a longitudinal federated learning model training optimization program stored on the memory and executable on the processor, the longitudinal federated learning model training optimization program when executed by the processor implementing the steps of the longitudinal federated learning model training optimization method of any of claims 1-7.
10. A storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the longitudinal federal learning model training optimization method as claimed in any of claims 1 to 7.
CN202010022573.XA 2020-01-09 2020-01-09 Longitudinal federal learning model training optimization method, device, equipment and medium Active CN111242316B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010022573.XA CN111242316B (en) 2020-01-09 2020-01-09 Longitudinal federal learning model training optimization method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010022573.XA CN111242316B (en) 2020-01-09 2020-01-09 Longitudinal federal learning model training optimization method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN111242316A true CN111242316A (en) 2020-06-05
CN111242316B CN111242316B (en) 2024-05-28

Family

ID=70864192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010022573.XA Active CN111242316B (en) 2020-01-09 2020-01-09 Longitudinal federal learning model training optimization method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111242316B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112001500A (en) * 2020-08-13 2020-11-27 星环信息科技(上海)有限公司 Model training method, device and storage medium based on longitudinal federated learning system
CN112818374A (en) * 2021-03-02 2021-05-18 深圳前海微众银行股份有限公司 Joint training method, device, storage medium and program product of model
CN113010305A (en) * 2021-02-08 2021-06-22 北京邮电大学 Federal learning system deployed in edge computing network and learning method thereof
CN113011603A (en) * 2021-03-17 2021-06-22 深圳前海微众银行股份有限公司 Model parameter updating method, device, equipment, storage medium and program product
CN113408747A (en) * 2021-06-28 2021-09-17 淮安集略科技有限公司 Model parameter updating method and device, computer readable medium and electronic equipment
CN114330759A (en) * 2022-03-08 2022-04-12 富算科技(上海)有限公司 Training method and system for longitudinal federated learning model
CN114819182A (en) * 2022-04-15 2022-07-29 支付宝(杭州)信息技术有限公司 Method, apparatus and system for training a model via multiple data owners
CN115796295A (en) * 2023-02-08 2023-03-14 苏州浪潮智能科技有限公司 Multi-model optimization method, device and equipment for distributed quantum computer
CN116016212A (en) * 2022-12-26 2023-04-25 电子科技大学 Decentralised federation learning method and device for bandwidth perception

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7549644B1 (en) * 2006-10-15 2009-06-23 Richard Meernik Rectangular optimization grid and associated mathematical games
CN110288094A (en) * 2019-06-10 2019-09-27 深圳前海微众银行股份有限公司 Model parameter training method and device based on federation's study
CN110472745A (en) * 2019-08-06 2019-11-19 深圳前海微众银行股份有限公司 Information transferring method and device in a kind of federal study
CN110490738A (en) * 2019-08-06 2019-11-22 深圳前海微众银行股份有限公司 A kind of federal learning method of mixing and framework

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7549644B1 (en) * 2006-10-15 2009-06-23 Richard Meernik Rectangular optimization grid and associated mathematical games
CN110288094A (en) * 2019-06-10 2019-09-27 深圳前海微众银行股份有限公司 Model parameter training method and device based on federation's study
CN110472745A (en) * 2019-08-06 2019-11-19 深圳前海微众银行股份有限公司 Information transferring method and device in a kind of federal study
CN110490738A (en) * 2019-08-06 2019-11-22 深圳前海微众银行股份有限公司 A kind of federal learning method of mixing and framework

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112001500A (en) * 2020-08-13 2020-11-27 星环信息科技(上海)有限公司 Model training method, device and storage medium based on longitudinal federated learning system
CN113010305A (en) * 2021-02-08 2021-06-22 北京邮电大学 Federal learning system deployed in edge computing network and learning method thereof
CN112818374A (en) * 2021-03-02 2021-05-18 深圳前海微众银行股份有限公司 Joint training method, device, storage medium and program product of model
WO2022193432A1 (en) * 2021-03-17 2022-09-22 深圳前海微众银行股份有限公司 Model parameter updating method, apparatus and device, storage medium, and program product
CN113011603A (en) * 2021-03-17 2021-06-22 深圳前海微众银行股份有限公司 Model parameter updating method, device, equipment, storage medium and program product
CN113408747A (en) * 2021-06-28 2021-09-17 淮安集略科技有限公司 Model parameter updating method and device, computer readable medium and electronic equipment
CN114330759A (en) * 2022-03-08 2022-04-12 富算科技(上海)有限公司 Training method and system for longitudinal federated learning model
CN114330759B (en) * 2022-03-08 2022-08-02 富算科技(上海)有限公司 Training method and system for longitudinal federated learning model
CN114819182A (en) * 2022-04-15 2022-07-29 支付宝(杭州)信息技术有限公司 Method, apparatus and system for training a model via multiple data owners
CN114819182B (en) * 2022-04-15 2024-05-31 支付宝(杭州)信息技术有限公司 Method, apparatus and system for training a model via multiple data owners
CN116016212A (en) * 2022-12-26 2023-04-25 电子科技大学 Decentralised federation learning method and device for bandwidth perception
CN116016212B (en) * 2022-12-26 2024-06-04 电子科技大学 Decentralised federation learning method and device for bandwidth perception
CN115796295A (en) * 2023-02-08 2023-03-14 苏州浪潮智能科技有限公司 Multi-model optimization method, device and equipment for distributed quantum computer

Also Published As

Publication number Publication date
CN111242316B (en) 2024-05-28

Similar Documents

Publication Publication Date Title
CN111242316A (en) Longitudinal federated learning model training optimization method, device, equipment and medium
CN110263936B (en) Horizontal federal learning method, device, equipment and computer storage medium
CN110263908B (en) Federal learning model training method, apparatus, system and storage medium
CN110601814B (en) Federal learning data encryption method, device, equipment and readable storage medium
CN110633806B (en) Longitudinal federal learning system optimization method, device, equipment and readable storage medium
WO2021092980A1 (en) Longitudinal federated learning optimization method, apparatus and device, and storage medium
CN110751294A (en) Model prediction method, device, equipment and medium combining multi-party characteristic data
CN108616360A (en) User identity verification, register method and device
Seng et al. A D2D-assisted MEC computation offloading in the blockchain-based framework for UDNs
CN108650667A (en) Terminal scheduling method and apparatus
CN109690491A (en) Execute remote command
Tang et al. Queue-aware dynamic placement of virtual network functions in 5G access network
CN111767411A (en) Knowledge graph representation learning optimization method and device and readable storage medium
CN115801220A (en) Acceleration apparatus, computing system, and acceleration method
CN114691167A (en) Method and device for updating machine learning model
CN110266582A (en) A kind of information push method, system, server and communication terminal
CN109348434A (en) A kind of sending method of scene information, sending device and terminal device
CN114168295A (en) Hybrid architecture system and task scheduling method based on historical task effect
CN105099885B (en) Method for sending information and device
Liu et al. Distributed computation offloading with low latency for artificial intelligence in vehicular networking
CN112100145A (en) Digital model sharing learning system and method
WO2021138877A1 (en) Vertical federated learning model training optimization method and apparatus, device, and medium
CN110392377A (en) A kind of 5G super-intensive networking resources distribution method and device
CN115801221A (en) Acceleration apparatus, computing system, and acceleration method
CN110418371A (en) A kind of control method, the network equipment and terminal

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