CN114580665A - Federated learning system, method, device, equipment and storage medium - Google Patents

Federated learning system, method, device, equipment and storage medium Download PDF

Info

Publication number
CN114580665A
CN114580665A CN202210251368.XA CN202210251368A CN114580665A CN 114580665 A CN114580665 A CN 114580665A CN 202210251368 A CN202210251368 A CN 202210251368A CN 114580665 A CN114580665 A CN 114580665A
Authority
CN
China
Prior art keywords
model
training
participant
initial
sample
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
CN202210251368.XA
Other languages
Chinese (zh)
Other versions
CN114580665B (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.)
Transwarp Technology Shanghai Co Ltd
Original Assignee
Transwarp Technology Shanghai 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 Transwarp Technology Shanghai Co Ltd filed Critical Transwarp Technology Shanghai Co Ltd
Priority to CN202210251368.XA priority Critical patent/CN114580665B/en
Publication of CN114580665A publication Critical patent/CN114580665A/en
Application granted granted Critical
Publication of CN114580665B publication Critical patent/CN114580665B/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
    • G06N20/20Ensemble learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques

Landscapes

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

Abstract

The invention discloses a system, a method, a device, equipment and a storage medium for federated learning, wherein the method comprises the following steps: the terminal equipment is provided with a trusted execution environment, one terminal equipment with the initial model is used as an active party, and the terminal equipment without the initial model is respectively used as a participant; the method comprises the steps that an initial model is sent to each participant in the active direction, model training is conducted on the initial model based on a first training sample, and a first training model is obtained; each participant carries out model training on the initial model based on a second training sample set to obtain a second training model, and the second training model is sent to the active party; the method comprises the steps that a driving party performs model parameter fusion and updates parameters of an initial model, and the updated initial model is sent to each participant until an obtained target model is reached, so that the problems of complex flow and low efficiency of the existing federal learning are solved, the complexity of the federal learning is reduced, and the efficiency of the federal learning is improved.

Description

Federated learning system, method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a system, a method, a device, equipment and a storage medium for federated learning.
Background
The federated learning is used as a distributed machine learning mode, the data island problem can be effectively solved, participators can jointly model on the basis of not sharing sample data, the data island is technically broken, and the collaborative modeling is realized.
As shown in fig. 1, existing federal learning has three major components: a data source, a central server, and participants. The central server provides an initial model for each participant, each participant trains own data, the obtained local model is uploaded to the central server, the central server performs model parameter fusion on the basis of the local model uploaded by each participant to obtain a new initial model, then the new initial model is distributed to each participant, and the initial model is trained continuously until the initial model converges.
However, existing federal learning has some problems. For example, the key of federal learning lies in the fusion of models, the transmission of model parameters is necessarily involved in the fusion process of model parameters, private data may be leaked in the transmission process, a complex encryption algorithm module and a redundant communication module are required, and the process of federal learning is complex and inefficient.
Disclosure of Invention
The invention provides a federated learning system, a method, a device, equipment and a storage medium, which are used for solving the problems of complex process and low efficiency of federated learning caused by the fact that the existing federated learning system needs a complex encryption algorithm module and a redundant communication module, reducing the complexity of federated learning and improving the efficiency of federated learning.
According to an aspect of the present invention, there is provided a bang learning system including: the terminal equipment is provided with a trusted execution environment, one terminal equipment with an initial model is used as an active party, and all terminal equipment without the initial model are respectively used as participating parties;
the active party is used for sending an initial model to each participant and carrying out model training on the initial model based on a first training sample to obtain a first training model;
each participant is respectively used for receiving the initial model sent by the active party, carrying out model training on the initial model based on a second training sample set to obtain a second training model, and sending the second training model to the active party;
the active side is further configured to perform model parameter fusion based on the first training model and each of the second training models, update parameters of the initial model, and send the updated initial model to each of the participants, so that each of the participants respectively returns to the step of receiving the initial model sent by the active side until model training is finished; and sending the target model obtained by model training to each participant.
According to another aspect of the present invention, there is provided a federated learning method, which is applied to a terminal device acting as an active party in a federated learning system, and the method includes:
respectively sending initial models to all participants, and carrying out model training on the initial models based on a first training sample set to obtain first training models;
receiving a second training model sent by each participant, wherein the second training model is obtained by performing model training on the initial model by the participant based on a second training sample set;
model parameter fusion is carried out on the basis of the first training model and the second training model, parameters of the initial model are updated, the updated initial model is sent to each participant, so that each participant returns to the step of receiving the initial model sent by the active party until model training is finished;
and sending the target model obtained by model training to each participant.
According to another aspect of the present invention, there is provided a federated learning method, applied to a terminal device as a participant in a federated learning system, the method including:
receiving an initial model sent by a master side, and performing model training on the initial model based on a second training sample set to obtain a second training model;
sending the second training model to the active party, so that the active party performs model parameter fusion based on the first training model and the second training model sent by each participant and updates parameters of the initial model, and sends the updated initial model to each participant; the first training model is obtained by performing model training on the initial model by the active party based on a first training sample set;
and returning to the step of receiving the initial model sent by the master side until the model training is finished.
According to another aspect of the present invention, there is provided a federated learning apparatus integrated in a federated learning system as a terminal device of an active party, the apparatus including:
the first sending module is used for respectively sending the initial models to all the participants and carrying out model training on the initial models based on a first training sample set to obtain first training models;
the receiving module is used for receiving second training models sent by all the participants, and the second training models are obtained by performing model training on the initial models by all the participants based on a second training sample set;
the fusion module is used for performing model parameter fusion and updating the parameters of the initial model based on the first training model and each second training model, and sending the updated initial model to each participant so as to enable each participant to respectively return to the step of receiving the initial model sent by the active party until the model training is finished;
and the second sending module is used for sending the target model obtained by model training to each participant.
According to another aspect of the present invention, there is provided a federated learning apparatus integrated in a federated learning system as a participant's terminal device, the apparatus including:
the first receiving module is used for receiving an initial model sent by a driving party and carrying out model training on the initial model based on a second training sample set to obtain a second training model;
a sending module, configured to send the second training model to the master, so that the master performs model parameter fusion based on the first training model and the second training model sent by each of the participants, updates parameters of the initial model, and sends the updated initial model to each of the participants; the first training model is obtained by performing model training on the initial model by the active party based on a first training sample set;
and the second receiving module is used for returning to the step of receiving the initial model sent by the master side until the model training is finished.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the federal learning method as defined in any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium having stored thereon computer instructions for causing a processor to, when executed, implement a federal learning method as in any of the embodiments of the present invention.
The embodiment of the invention provides a federated learning system, which comprises: the terminal equipment is provided with a trusted execution environment, one terminal equipment with an initial model is used as an active party, and the terminal equipment without the initial model is respectively used as a participant; the active party is used for respectively sending the initial models to all the participants and carrying out model training on the initial models based on the first training samples to obtain first training models; each participant is respectively used for receiving the initial model sent by the active party, carrying out model training on the initial model based on a second training sample set to obtain a second training model, and sending the second training model to the active party; the active side is further used for performing model parameter fusion and updating the parameters of the initial model based on the first training model and each second training model, and sending the updated initial model to each participant so that each participant respectively returns to the step of receiving the initial model sent by the active side until the model training is finished; the target model obtained by model training is sent to each participant, the problems that the existing federal learning system needs a complex encryption algorithm module and a redundant communication module, so that the process of federal learning is complex and the efficiency is low are solved, and the beneficial effects of reducing the complexity of federal learning and improving the efficiency of federal learning are achieved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of the structure of a prior art federated learning system;
fig. 2 is a schematic structural diagram of a federated learning system according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for federated learning according to a second embodiment of the present invention;
FIG. 4 is a flowchart of a method for federated learning according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a bang learning device according to a fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a bang learning device according to a fourth embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device implementing the federal learning method in an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 2 is a schematic structural diagram of a federated learning system according to an embodiment of the present invention, which may be applied to a case of implementing federated learning of a model. As shown in fig. 2, the federal learning system includes: the terminal equipment is provided with a trusted execution environment, one terminal equipment with an initial model is used as an active party, and the terminal equipment without the initial model is respectively used as a participant;
the active party is used for respectively sending the initial models to all the participants and carrying out model training on the initial models based on a first training sample set to obtain a first training model;
each participant is used for receiving the initial model sent by the active party, performing model training on the initial model based on a second training sample set to obtain a second training model, and sending the second training model to the active party;
the active side is further used for performing model parameter fusion and updating the parameters of the initial model based on the first training model and each second training model, and sending the updated initial model to each participant so that each participant respectively returns to the step of receiving the initial model sent by the active side until the model training is finished; and sending the target model obtained by model training to each participant.
The Trusted Execution Environment (TEE) constructs a secure area in the device by a software and hardware method, and ensures that programs and data loaded in the secure area are protected on confidentiality and integrity. The principle is to divide the hardware and software resources of the device into two execution environments, namely a trusted execution environment and a generic execution environment. The two environments are securely isolated, with independent internal data paths and storage space required for computation. The application programs of the ordinary execution environment cannot access the TEE, even inside the TEE, the operation of a plurality of applications is independent, and the applications cannot be accessed without authorization. A common platform that provides a trusted execution environment is a Software protection Extension (SGX).
SGX is a new set of instruction sets and memory access mechanisms added by intel to the original architecture, thereby allowing users to protect code and data from privilege attacks based on security containers. The specific implementation mode is that the security operation of the legal software is packaged in a security container, the legal software is protected from being attacked by malicious software, privileged or non-privileged software cannot access the security container, once the software and data are located in the security container, the protection can be still provided for codes and memory data in the security container under the condition that a BIOS, a virtual machine monitor, a main operating system and a driver are all attacked by malicious codes, and the malicious software is prevented from influencing the codes and data in the security container, so that the confidentiality and the integrity of key codes and data of a user are guaranteed. The use of secure containers may enable programs to have the ability to protect their own private information from being revealed even if the rest of the system is attacked.
Specifically, the federal learning system includes a plurality of terminal devices, each of which has a trusted execution environment, so as to ensure privacy of data owned by each terminal device. One terminal device in each terminal device has an initial model, the terminal device serves as an active party of the federal learning system, and the rest terminal devices which do not have the initial model serve as participating parties respectively. The active party is used for sending the initial model to each participant so that each participant can carry out model training based on a local second sample data set to obtain a second training model, and meanwhile, the initial model is trained based on a local first sample data set to obtain a first training model; the active party can also be used for receiving the second training model sent by each participant, fusing the first training model and the second training model, updating the initial model, and sending the updated initial model to each participant so as to enable each participant to return to the step of receiving the initial model. And performing model training of each terminal device and model parameter fusion of the active side in a circulating manner to finally obtain a trained target model.
Illustratively, the initial model owned by the master is the model to be trained. The initial model may be a model established on the terminal device as the active party, or may be established by a third party and directly uploaded to the terminal device as the active party.
In the prior art, as shown in fig. 1, a central server is responsible for sending initial models to each participant, performing model parameter fusion and model parameter update based on received training models sent by each participant, returning the updated models to each participant, and each participant starts the next iteration. During the process that each participant transmits the training model to the central server.
The federal learning system provided by the embodiment of the invention determines the terminal equipment without the initial model as the participant from all the terminal equipment, and determines the terminal equipment with the initial model as the active party, and the active party simultaneously plays roles of the central server and the participant without a central server outside the terminal equipment, thereby saving hardware resources. Meanwhile, each terminal device has a trusted execution environment, so that sensitive information used in the federal learning process and a calculation process related to the sensitive information can be executed in the trusted environment, and the data can not be tampered and the security can be guaranteed.
In order to ensure the security of information transmission, in the prior art, the model parameters are usually encrypted by using homomorphic encryption and a mode of adding mask noise, and after the model is sent to a central server, the encrypted training model is decrypted and restored and a fusion operation is executed. The encryption and decryption processes may consume significant computing resources.
In order to solve the above problems, on the basis of the above embodiments, a secure communication channel is established between the active party and each participant, and the active party and each participant perform information interaction through the secure communication channel, so that complicated encryption of model parameters can be avoided, and consumed computing resources can be reduced. The specific implementation of establishing a secure communication channel between the active and each participant is as follows.
In a specific embodiment, the terminal device as the master is configured to:
before the initial model is sent to each participant, an authentication request is sent to each participant, first authentication information fed back by each participant after the authentication request is received, and each terminal device serving as the participant is authenticated to have a trusted execution environment based on each first authentication information;
respectively sending second authentication information to each participant so that each participant respectively authenticates that the terminal equipment serving as the active party has a trusted execution environment;
and respectively establishing a secure communication channel between the terminal equipment as the active party and each terminal equipment as the participant so as to enable the active party and each participant to carry out information interaction based on the secure communication channel.
The authentication request is used for requesting to authenticate whether the terminal equipment has the trusted execution environment. The authentication information may include identity information of the terminal device, whether information of the terminal device is tampered and whether the terminal device has a trusted execution environment, and may be, for example, an authentication certificate. The first authentication information is authentication information of a participant, and the second authentication information is authentication information of an active party.
Specifically, before sending the initial model to each terminal device as a participant, the terminal device as an active party sends an authentication request to each participant; after receiving an authentication request sent by an active party, each participant acquires first authentication information of the participant and sends the first authentication information to the active party, and the active party authenticates that each terminal device serving as the participant has a trusted execution environment based on the first authentication information. Meanwhile, the active side also needs to send second authentication information of the active side to each participant, so that each participant authenticates that the active side has a trusted execution environment according to the second authentication information of the active side.
After mutually authenticating each other between the active side and each participant to have a trusted execution environment, the active side respectively establishes a secure communication channel between the terminal equipment as the active side and each terminal equipment as the participants, so that the active side and each participant can perform information interaction based on the secure communication channel, the security of the model parameters in the transmission process can be guaranteed even if the transmitted model parameters are not subjected to complex encryption, the computing resources consumed by the complex encryption and decryption processes are reduced, and the model training efficiency is improved.
Illustratively, the active party sends the initial model and the updated initial model to each participant through a secure communication channel, and each participant sends the second training model to the active party through a secure communication channel between each participant and the active party.
Since sample data sets owned by a plurality of terminal devices do not completely overlap, it is necessary to confirm common samples of both terminals without disclosing the respective data, so as to perform modeling by combining the features of the common samples. In the prior art, a sample data set of a terminal device is usually encrypted and then sent to a central server, the central server determines an intersection of the encrypted sample data sets of the terminal devices to determine an alignment result, and the alignment result is fed back to each terminal device. Both the encryption process and the transmission process of the sample data set require a large amount of resources.
In order to solve the above problem, on the basis of the above embodiment, each terminal device is further configured to:
respectively sending the data volume of the sample data set owned locally to remote terminal equipment except the local terminal equipment in the federal learning system, and receiving the data volume of the sample data set owned by each remote terminal equipment in the federal learning system;
judging whether the local terminal equipment is the terminal equipment with the largest data volume of the sample data set in the federal learning system;
if not, the local terminal equipment is determined as a data sending party so as to send the sample data set to a data receiving party;
and if so, the local terminal equipment is determined as a data receiver, and a training sample set of each terminal equipment is determined according to the received sample data set sent by the data sender.
The local terminal device represents the terminal device itself, and the remote terminal device represents other terminal devices except for the local terminal device itself in the federal learning system.
Specifically, each terminal device sends the data volume of the sample data set owned by the local terminal device to the remote terminal devices except the local terminal device in the federal learning system, and receives the data volume of the sample data set owned by each remote terminal device sent by each remote terminal device in the federal learning system; each terminal device may determine that the local terminal device is a data receiver or a data sender by comparing the data size of the sample data set owned locally and the data size of the sample data set owned by each remote terminal device. The specific determination principle is that if the data volume of the sample data set owned by the local terminal device is the largest, the local terminal device serves as a data receiving party, and if the data volume of the sample data set owned by the local terminal device is not the largest, the local terminal device is determined as a data sending party. Through the above determination principle, each terminal device can determine whether the terminal device is a data sending party or a data receiving party, wherein the number of the data receiving parties is only one, and the number of the data sending parties can be multiple. The data sender is used for sending the sample data set to the data receiver, and the data receiver is used for receiving the sample data set sent by each data sender and determining the alignment sample of each terminal device.
By comparing the data volumes of the sample data sets owned by the local terminal equipment and the remote terminal equipment, the terminal equipment which has the largest data volume of the sample data sets is determined to be the data receiving party, and the sample data sets sent by the data sending party are received, so that the data volume of the transmission of the sample data sets can be reduced, and the resources consumed by the transmission are reduced.
Optionally, each terminal device as a data sender is respectively configured to:
acquiring a first sample identification set of owned sample data sets;
and sending the first sample identification set to terminal equipment serving as a data receiving party.
Correspondingly, the terminal device as the data receiving side is used for:
receiving first sample identification sets respectively sent by all data sending parties, and acquiring a second sample identification set of a sample data set owned by local terminal equipment;
determining the intersection of each first sample identifier set and each second sample identifier set as an aligned sample identifier set of each terminal device;
determining a first training sample set corresponding to a sample identification set aligned with a sample set owned by local terminal equipment;
and respectively sending the aligned sample identification set to each data sending party so that each data sending party respectively determines a second training sample set corresponding to the aligned sample identification set in the owned sample data set.
The sample identification set is a data set formed by the sample identification of each sample data in the sample data set; the sample identifier may be a primary key value of sample data owned by each terminal device, such as a sample ID, and may generally be a name or an identity card number of a user, or a serial number of an article; the sample identification set may be a set of sample identification columns in the sample data set. The first sample identification set is a sample identification set of a sample data set owned by a data sender, and the second sample identification set is a sample identification set of a sample data set owned by a data receiver.
Specifically, each terminal device serving as a data sender sends a sample identifier set of an owned sample data set to a terminal device serving as a data receiver, the terminal device serving as the data receiver receives a first sample identifier set sent by each data sender, acquires the sample data set owned by a local terminal device and a second sample identifier set, determines an intersection of each first sample identifier set and the second sample identifier, determines the intersection as an aligned sample identifier set of each terminal device, sends the aligned sample identifier set to each data sender, and each data sender takes a data set corresponding to the aligned sample identifier set in the owned sample data set as a second training sample set. After receiving the aligned sample identification set fed back by the data receiver, each data sender takes the data set corresponding to the aligned sample identification set in the owned sample data set as a first training sample set.
In the process of aligning the samples, the sample data set owned by each terminal device does not need to be concentrated to a central server or a data receiver in a complex encryption mode, the aligned samples of each terminal device can be determined only by sending the sample identification set in the sample data set to the data receiver, the data safety can be guaranteed without a complex encryption algorithm, the existing federal learning process is greatly simplified, and the learning efficiency is improved.
Example two
Fig. 3 is a flowchart of a federal learning method provided in the second embodiment of the present invention, which is applicable to the federal learning situation of a model, and the method may be executed by a federal learning device, and the federal learning device may be implemented in the form of hardware and/or software, and may be configured in a federal learning system as a terminal device of an active party. As shown in fig. 3, the method includes:
s210, respectively sending the initial models to all the participants, and carrying out model training on the initial models based on the first training sample set to obtain first training models.
Wherein the initial model is a model to be trained. The method for obtaining the initial model may be that the terminal device as the master obtains the initial model from the third end, or may be an initial model directly established in the terminal device as the master.
Specifically, the terminal device serving as the master sends the initial model to each terminal device serving as the participant, and model training is performed on the initial model based on a first training sample set owned by the master to obtain a first training model.
For example, the method for performing model training on the initial model based on the first training sample set owned by the master may adopt any existing model training method, and the embodiment of the present invention is not limited thereto.
And S220, receiving second training models sent by all the participants, wherein the second training models are obtained by performing model training on the initial models by the participants based on a second training sample set.
Specifically, each terminal device serving as a participant performs model training on the combined initial model sent by the master based on the second training sample set owned by the terminal device to obtain a second training model, and the master who trains the model sending is reduced and receives the second training model sent by each participant.
And S230, performing model parameter fusion and updating the parameters of the initial model based on the first training model and the second training model, and sending the updated initial model to each participant so that each participant respectively returns to the step of receiving the initial model sent by the active party until the model training is finished.
Specifically, the master side performs model parameter fusion based on a first training model obtained by local training and a second training model obtained by training of each participant, updates parameters of the initial model based on the fused model parameters, and sends the updated initial model to each participant. After receiving the updated initial model, each participant continues to train the updated initial model based on the second training sample set and sends the updated initial model to the active party, and the processes are iteratively executed until the model training is finished.
Illustratively, model training may be ended when the model converges; the model training may also be ended when the training frequency reaches a preset frequency, and the end of the model training may be determined according to actual requirements.
And S240, transmitting the target model obtained by model training to each participant.
Specifically, the target model obtained by model training is sent to each participant, so that each participant uses the model.
According to the technical scheme of the embodiment of the invention, the initial models are respectively sent to all participants through the active direction, and model training is carried out on the initial models based on a first training sample set to obtain a first training model; receiving second training models sent by all participants, wherein the second training models are obtained by performing model training on the initial models by the participants based on a second training sample set; model parameter fusion is carried out on the basis of the first training model and the second training model, parameters of the initial model are updated, the updated initial model is sent to each participant, so that each participant respectively returns to the step of receiving the initial model sent by the active party until model training is finished; and the target model obtained by model training is sent to each participant, so that the complexity of the federal learning is reduced, the process of the federal learning is simplified, and the efficiency of the federal learning is improved.
EXAMPLE III
Fig. 4 is a flowchart of a federal learning method provided in the third embodiment of the present invention, which is applicable to a federal learning situation for implementing a model, and the method may be executed by a federal learning device, where the federal learning device may be implemented in a form of hardware and/or software, and the federal learning device may be configured in a federal learning system as a terminal device of a participant. As shown in fig. 4, the method includes:
s310, receiving the initial model sent by the active side, and performing model training on the initial model based on a second training sample set to obtain a second training model.
Specifically, the terminal device as the master sends an initial model to each terminal device as the participant, each terminal device as the participant receives the initial model sent by the master, and model training is performed on the initial model based on the owned second training sample set to obtain a second training model.
S320, sending the second training model to the active side, so that the active side performs model parameter fusion and updates parameters of the initial model based on the first training model and the second training model sent by each participant, and sends the updated initial model to each participant; the first training model is obtained by performing model training on the initial model by the active side based on the first training sample set.
Specifically, each terminal device serving as a participant sends a second training model obtained through training to the master, the master performs model parameter fusion based on a first training model obtained through local training and a second training model obtained through training of each participant, updates parameters of the initial model based on the fused model parameters, and sends the updated initial model to each participant.
And S330, returning to the step of receiving the initial model sent by the master side until the model training is finished.
After receiving the updated initial model, each participant continues to train the updated initial model based on the second training sample set and sends the updated initial model to the active party, and the processes are iteratively executed until the model training is finished.
According to the technical scheme of the embodiment of the invention, the initial model sent by the active party is received by the participant, and model training is carried out on the initial model based on the second training sample set to obtain a second training model; sending the second training model to the active side, so that the active side performs model parameter fusion and updates parameters of the initial model based on the first training model and the second training models sent by the participants, and sending the updated initial model to the participants; the first training model is obtained by performing model training on the initial model by the active side based on the first training sample set; and returning to the step of receiving the initial model sent by the active party until the model training is finished, thereby reducing the complexity of the federal learning, simplifying the process of the federal learning and improving the efficiency of the federal learning.
Example four
Fig. 5 is a schematic structural diagram of a bang learning device according to a fourth embodiment of the present invention. As shown in fig. 5, the apparatus includes: a first sending module 410, a receiving module 420, a fusing module 430 and a second sending module 440;
the first sending module 410 is configured to send initial models to each participant, and perform model training on the initial models based on a first training sample set to obtain first training models;
a receiving module 420, configured to receive a second training model sent by each participant, where the second training model is obtained by performing model training on the initial model by each participant based on a second training sample set;
a fusion module 430, configured to perform model parameter fusion based on the first training model and each of the second training models, update parameters of the initial model, and send the updated initial model to each of the participants, so that each of the participants respectively returns to the step of receiving the initial model sent by the master until model training is completed;
and a second sending module 440, configured to send the target model obtained by model training to each of the participants.
The federal learning device provided by the embodiment of the invention can execute the federal learning method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 6 is a schematic structural diagram of a bang learning device according to a fifth embodiment of the present invention. As shown in fig. 6, the apparatus includes: a first receiving module 510, a transmitting module 520, and a second receiving module 530;
a first receiving module 510, configured to receive an initial model sent by a master, and perform model training on the initial model based on a second training sample set to obtain a second training model;
a sending module 520, configured to send the second training model to the active party, so that the active party performs model parameter fusion based on the first training model and the second training model sent by each of the participants, updates parameters of the initial model, and sends the updated initial model to each of the participants; the first training model is obtained by performing model training on the initial model by the active party based on a first training sample set;
and a second receiving module 530, configured to return to the step of receiving the initial model sent by the master until the model training is finished.
The federal learning device provided by the embodiment of the invention can execute the federal learning method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE six
FIG. 7 illustrates a schematic diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 7, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM)12, a Random Access Memory (RAM)13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM)12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. Processor 11 performs the various methods and processes described above, such as the federal learning method.
In some embodiments, the federated learning method may be implemented as a computer program that is tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When loaded into RAM 13 and executed by processor 11, the computer program may perform one or more of the steps of the federal learning method described above. Alternatively, in other embodiments, processor 11 may be configured to perform the federal learning method in any other suitable manner (e.g., by way of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A bang learning system, comprising: the terminal equipment is provided with a trusted execution environment, one terminal equipment with an initial model is used as an active party, and all terminal equipment without the initial model are respectively used as participating parties;
the active party is used for sending an initial model to each participant and carrying out model training on the initial model based on a first training sample to obtain a first training model;
each participant is respectively used for receiving the initial model sent by the active party, carrying out model training on the initial model based on a second training sample set to obtain a second training model, and sending the second training model to the active party;
the active side is further configured to perform model parameter fusion based on the first training model and each of the second training models, update parameters of the initial model, and send the updated initial model to each of the participants, so that each of the participants respectively returns to the step of receiving the initial model sent by the active side until model training is finished; and sending the target model obtained by model training to each participant.
2. The system according to claim 1, wherein the terminal device as the master is configured to:
before sending an initial model to each participant, sending an authentication request to each participant respectively, receiving first authentication information fed back by each participant after receiving the authentication request respectively, and authenticating that each terminal device serving as the participant has a trusted execution environment based on each first authentication information;
respectively sending second authentication information to each party so that each party respectively authenticates that the terminal equipment serving as the active party has a trusted execution environment;
and respectively establishing a secure communication channel between the terminal equipment as the active party and each terminal equipment as the participating party so as to enable the active party and each participating party to perform information interaction based on the secure communication channel.
3. The system according to any of claims 1-2, wherein each of said terminal devices is further configured to:
respectively sending data volume of a sample data set owned locally to remote terminal equipment except local terminal equipment in the federal learning system, and receiving the data volume of the sample data set owned by each remote terminal equipment in the federal learning system;
judging whether the local terminal equipment is the terminal equipment with the largest data volume of the sample data set in the federal learning system;
if not, the local terminal equipment is determined as a data sending party so as to send a sample data set to a data receiving party;
and if so, the local terminal equipment is determined as a data receiver, and a training sample set of each terminal equipment is determined according to the received sample data set sent by the data sender.
4. The system according to claim 3, wherein each terminal device as a data sender is respectively configured to:
acquiring a first sample identification set of owned sample data sets;
and sending the first sample identification set to terminal equipment serving as a data receiving party.
5. The system according to claim 4, wherein the terminal device as the data receiving side is configured to:
receiving a first sample identification set respectively sent by each data sender, and acquiring a second sample identification set of a sample data set owned by local terminal equipment;
determining an intersection of each first sample identifier set and the second sample identifier set as an aligned sample identifier set of each terminal device;
determining a first training sample set corresponding to the alignment sample identification set in a sample data set owned by local terminal equipment;
and respectively sending the aligned sample identification set to each data sending party so that each data sending party respectively determines a second training sample set corresponding to the aligned sample identification set in the owned sample data set.
6. A federated learning method, which is applied to a terminal device that is an active party in the federated learning system of any one of claims 1 to 4, the method comprising:
respectively sending initial models to all participants, and carrying out model training on the initial models based on a first training sample set to obtain first training models;
receiving a second training model sent by each participant, wherein the second training model is obtained by performing model training on the initial model by the participant based on a second training sample set;
model parameter fusion is carried out on the basis of the first training model and the second training model, parameters of the initial model are updated, the updated initial model is sent to each participant, so that each participant returns to the step of receiving the initial model sent by the active party until model training is finished;
and sending the target model obtained by model training to each participant.
7. A federated learning method, which is applied to a terminal device as a participant in the federated learning system of any one of claims 1 to 4, the method comprising:
receiving an initial model sent by a master side, and performing model training on the initial model based on a second training sample set to obtain a second training model;
sending the second training model to the active party, so that the active party performs model parameter fusion based on the first training model and the second training model sent by each participant and updates parameters of the initial model, and sends the updated initial model to each participant; the first training model is obtained by performing model training on the initial model by the active party based on a first training sample set;
and returning to the step of receiving the initial model sent by the master side until the model training is finished.
8. A Federal learning device integrated in the Federal learning System of any one of claims 1 to 4 as a terminal device of an active party, the device comprising:
the first sending module is used for respectively sending the initial models to all the participants and carrying out model training on the initial models based on a first training sample set to obtain first training models;
the receiving module is used for receiving second training models sent by all the participants, and the second training models are obtained by performing model training on the initial models by all the participants based on a second training sample set;
the fusion module is used for performing model parameter fusion and updating the parameters of the initial model based on the first training model and each second training model, and sending the updated initial model to each participant so as to enable each participant to respectively return to the step of receiving the initial model sent by the active party until the model training is finished;
and the second sending module is used for sending the target model obtained by model training to each participant.
9. A model training apparatus for federated learning, which is integrated into the federated learning system of any one of claims 1 to 4 as a participant's terminal device, the apparatus comprising:
the first receiving module is used for receiving an initial model sent by a driving party and carrying out model training on the initial model based on a second training sample set to obtain a second training model;
a sending module, configured to send the second training model to the active party, so that the active party performs model parameter fusion based on the first training model and the second training models sent by the participants, updates parameters of the initial model, and sends the updated initial model to the participants; the first training model is obtained by performing model training on the initial model by the active party based on a first training sample set;
and the second receiving module is used for returning to the step of receiving the initial model sent by the master side until the model training is finished.
10. A terminal device, characterized in that the terminal device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the federal learning method as claimed in any of claims 6-7.
11. A computer readable storage medium having stored thereon computer instructions for causing a processor to, when executed, implement the federal learning method as claimed in any of claims 6-7.
CN202210251368.XA 2022-03-15 2022-03-15 Federal learning system, method, device, equipment and storage medium Active CN114580665B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210251368.XA CN114580665B (en) 2022-03-15 2022-03-15 Federal learning system, method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210251368.XA CN114580665B (en) 2022-03-15 2022-03-15 Federal learning system, method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114580665A true CN114580665A (en) 2022-06-03
CN114580665B CN114580665B (en) 2023-10-20

Family

ID=81781480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210251368.XA Active CN114580665B (en) 2022-03-15 2022-03-15 Federal learning system, method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114580665B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125779A (en) * 2019-12-17 2020-05-08 山东浪潮人工智能研究院有限公司 Block chain-based federal learning method and device
US20210158216A1 (en) * 2021-01-28 2021-05-27 Alipay Labs (singapore) Pte. Ltd. Method and system for federated learning
CN113487042A (en) * 2021-06-28 2021-10-08 海光信息技术股份有限公司 Federated learning method and device and federated learning system
CN114006769A (en) * 2021-11-25 2022-02-01 中国银行股份有限公司 Model training method and device based on horizontal federal learning

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125779A (en) * 2019-12-17 2020-05-08 山东浪潮人工智能研究院有限公司 Block chain-based federal learning method and device
US20210158216A1 (en) * 2021-01-28 2021-05-27 Alipay Labs (singapore) Pte. Ltd. Method and system for federated learning
CN113487042A (en) * 2021-06-28 2021-10-08 海光信息技术股份有限公司 Federated learning method and device and federated learning system
CN114006769A (en) * 2021-11-25 2022-02-01 中国银行股份有限公司 Model training method and device based on horizontal federal learning

Also Published As

Publication number Publication date
CN114580665B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
WO2022247359A1 (en) Cluster access method and apparatus, electronic device, and medium
CN104715187A (en) Method and apparatus used for authenticating nodes of electronic communication system
CN111163052B (en) Method, device, medium and electronic equipment for connecting Internet of things platform
EP4198783A1 (en) Federated model training method and apparatus, electronic device, computer program product, and computer-readable storage medium
CN111669351B (en) Authentication method, service server, client and computer readable storage medium
CN105635168A (en) Off-line transaction device and security key using method thereof
KR20220066823A (en) Blockchain - based phishing prevention system, apparatus, and method thereof
CN114513350A (en) Identity verification method, system and storage medium
CN113569263A (en) Secure processing method and device for cross-private-domain data and electronic equipment
CN113935070B (en) Data processing method, device and equipment based on block chain and storage medium
CN114244525A (en) Request data processing method, device, equipment and storage medium
US8904508B2 (en) System and method for real time secure image based key generation using partial polygons assembled into a master composite image
CN115955362B (en) Block chain-based data storage and communication method, device, equipment and medium
CN117061110A (en) Message sharing method and device, electronic equipment and storage medium
CN113779522B (en) Authorization processing method, device, equipment and storage medium
CN114580665B (en) Federal learning system, method, device, equipment and storage medium
CN115858914A (en) Method, device and system for inquiring hiding trace, terminal equipment and storage medium
CN115801317A (en) Service providing method, system, device, storage medium and electronic equipment
CN113609156B (en) Data query and write method and device, electronic equipment and readable storage medium
CN113704723B (en) Block chain-based digital identity verification method and device and storage medium
CN115021972B (en) Trusted computing method, device, equipment and medium based on block chain
CN115801286A (en) Calling method, device, equipment and storage medium of microservice
CN116226932A (en) Service data verification method and device, computer medium and electronic equipment
CN117640106A (en) Voting method and device, electronic equipment and storage medium
WO2020168544A1 (en) Data processing method and device

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