Search

CN-121998124-A - Federal learning method and system based on excitation and safety of block chain

CN121998124ACN 121998124 ACN121998124 ACN 121998124ACN-121998124-A

Abstract

The invention provides a federal learning method and a federal learning system based on excitation and safety of a blockchain, which comprise the steps that a plurality of participants acquire training tasks from the blockchain and submit corresponding bidding prices to intelligent contracts, the intelligent contracts determine winners in current training according to the bidding prices and are divided into training sets and verification sets randomly to obtain corresponding trainers and verifiers, local models of the current training are downloaded from the blockchain based on the winners, artificial Gaussian noise is added, noise gradients of objective functions of the local models calculated by each winner are transmitted to each verifier for model verification, global aggregation is carried out after a list of selected local models is obtained, all verifiers are divided into small fragments, each verifier in the small fragments evaluates model quality after the verification tasks of the local models of the trainers are received, and each verifier exchanges votes with each other. The cyclic-based fragmentation consensus algorithm can ensure the same security as a non-fragmentation consensus protocol.

Inventors

  • LUO YUAN
  • WANG BAOJIAN
  • YING CHENHAO
  • CHEN WEI
  • PAN YAN
  • XU ZHIXIN
  • Zhao rao
  • WU ZHOUMING

Assignees

  • 上海交通大学
  • 国家工业信息安全发展研究中心

Dates

Publication Date
20260508
Application Date
20241104

Claims (10)

  1. 1. A blockchain-based incentive and security federal learning method, comprising: a plurality of participants acquire training tasks from a blockchain, each participant submits a corresponding bidding price to an intelligent contract, the intelligent contract determines a winner set in current training according to the bidding price, and the winner set is randomly divided into a training set and a verification set to obtain a corresponding trainer and a corresponding verifier; The training step comprises the steps of downloading a current trained local model from a block chain based on winners, adding artificial Gaussian noise, calculating a noise gradient of an objective function of the local model by each winner, transmitting the noise gradient to each verifier for model verification, and carrying out global aggregation after obtaining a list of the selected local model; And the verification step is to divide all the verifiers into small fragments, and after receiving the verification task of the local model of the trainer, each of the small fragments evaluates the model quality and exchanges votes with each other.
  2. 2. A blockchain-based incentive and security federal learning method in accordance with claim 1, wherein said incentive step includes a winner selection step and a payment determination step; The winner selection step includes the steps of The participants in the chain acquire training tasks from the blockchain, each participant w i submits a bid b i to the intelligent contract C, the actual cost of task execution is denoted as C i , only the current participant knows the actual cost, and after receiving the participant bids, the intelligent contract C determines a set K t of K winning participants for the t-th training round; The payment determination step includes randomly dividing the winner set K t into a set of kappa trainers of set T t and a set of kappa verifiers of set V t , and further determining the pays p i paid to each of the trainers in T t and the verifiers in V t based on the winner's contribution to the model training by the smart contract C.
  3. 3. The blockchain-based incentive and security federal learning method of claim 2, wherein the bid b i is a bid price for the participant w i to perform a task in the current round of training; The set T t is a training set and the set V t is a validation set.
  4. 4. The blockchain-based incentive and security federal learning method of claim 1, wherein the training step includes a local training step and a global aggregation step; The local training step includes the winning participants in winner set K t downloading a current global model from the blockchain, each trainer t i ∈T t performing training tasks locally based on the received global model; The global aggregation step includes submitting the trained local model updates to each verifier v i ∈V t , which selects q models by a verification program to obtain θ t+1 in the global aggregation, where θ belongs to a real set, and the corresponding selected trainers form a selected trainer set S t .
  5. 5. The blockchain-based incentive and security federal learning method of claim 1, wherein the verifying step includes a local verifying step and a global consensus step; The local verification step includes the verifier forming a set H t of H slices, each slice containing A validator wherein Is determined as Each slice selection The local model verifies the quality of the fragments in parallel, using a common data set accessible to anyone in the system Evaluating the quality; The global consensus step includes the leader in each segment proposing a voting program called a block and broadcasting the block to other members in the segment, all verifiers in the segment submit votes, denoted by 1 or 0, 1 representing consent, 0 representing disagreement, and finally the verifier selects q trainees and uses the local model of the trainee for global aggregation.
  6. 6. The blockchain-based incentive and security federal learning method of claim 5, wherein the global consensus step comprises the sub-steps of: Step S3.1, traversing each slice and electing a corresponding leader; Step S3.2, the verifier v j in the slice broadcasts the vote, the vote is sent to all verifiers in the current slice, and the voting results of all verifiers are recorded; Step S3.3, any verifier v i in the slice checks the corresponding voting abstract, judges whether the voting abstract exceeds the verifier of the safety threshold part of the current cycle to cast the same ballot and reaches the predefined time limit delta loop , if not, the verifier v i broadcasts a command to all verifiers in the current slice to continue to prepare consensus, if so, the verifier v i sends the voting abstract to the current slice leader; Step S3.4, after receiving the voting abstract of the verifier v i , the leader asks all the verifiers in the current fragment to submit the voting abstract, compares and determines the correctness of the voting abstract of the verifier v i , and determines the correct voting abstract; Step S3.5, the leader puts forward a decision block containing all the voting digests and the correct voting digests, and all verifiers in the network agree on the decision block; and step S3.6, judging whether the decision block is considered to be correct, if so, terminating the voting process in the current fragment by the leader and broadcasting a decision about selecting the local model of the trainer t i , and if not, entering a consensus preparation stage of the (l+1) th cycle by the voting process, and returning to the step S3.1.
  7. 7. A blockchain-based incentive and security federal learning system comprising: the system comprises an incentive module, a training module and a verification module, wherein the training tasks are acquired from a blockchain by a plurality of participants, each participant submits a corresponding bidding price to an intelligent contract, the intelligent contract determines a winner set in current training according to the bidding price, and the winner set is randomly divided into a training set and a verification set to obtain a corresponding trainer and a corresponding verifier; The training module is used for downloading a current trained local model from a block chain based on winners, adding artificial Gaussian noise, calculating a noise gradient of an objective function of the local model by each winner, transmitting the noise gradient to each verifier for model verification, and carrying out global aggregation after obtaining a list of the selected local model; And the verification module is used for dividing all the verifiers into small fragments, and after receiving the verification task of the local model of the trainer, each of the small fragments evaluates the model quality and exchanges votes with each other.
  8. 8. A blockchain-based incentive and security federal learning system in accordance with claim 7 wherein said incentive module includes a winner selection module and a payment determination module; the winner selection module includes a set of participants The participants in the chain acquire training tasks from the blockchain, each participant w i submits a bid b i to the intelligent contract C, the actual cost of task triggering is denoted as C i , only the current participant knows the actual cost, and after receiving the participant bids, the intelligent contract C determines a set K t of K winning participants of the t-th training round; The payment determination module includes a kappa trainer that randomly divides the winner set K t into a set T t and a set V t kappa validator, the smart contract C further determining a reward p i paid to each of the trainers in T t and the validators in V t based on the winner's contribution to model training; The bid b i is the bid price of the participant w i triggering a task in the present round of training; The set T t is a training set and the set V t is a validation set.
  9. 9. The blockchain-based incentive and security federal learning system of claim 7, wherein the training module comprises a local training module and a global aggregation module; The local training module comprises that winning participants in a winner set K t download a current global model from a blockchain, and each trainer t i ∈T t triggers a training task locally based on the received global model; The global aggregation module comprises submitting the trained local model updates to each verifier v i ∈V t , wherein the verifier selects q models through a verification program to obtain theta t+1 in the global aggregation, wherein theta belongs to a real number set, and the corresponding selected trainers form a selected trainer set S t .
  10. 10. The blockchain-based incentive and security federal learning system of claim 7, wherein the verification module comprises a local verification module and a global consensus module; The local verification module comprises a verifier forming a set H t composed of H slices, each slice containing A validator wherein Is determined as Each slice selection The local model verifies the quality of the fragments in parallel, using a common data set accessible to anyone in the system Evaluating the quality; The global consensus module comprises that a leader in each segment proposes a voting program called a block, the block is broadcasted to other members in the segment, all verifiers in the segment submit votes, which are represented by 1 or 0, 1 represents consent, 0 represents disagreement, and finally the verifiers select q trainees and use the local model of the trainee to conduct global aggregation.

Description

Federal learning method and system based on excitation and safety of block chain Technical Field The invention relates to the technical field of blockchains, in particular to a blockchain-based security algorithm and an excitation algorithm, and especially relates to a blockchain-based excitation and security federal learning method and system. Background With the rapid development of Machine Learning (ML), it has been widely used in various fields of our daily lives. However, training a centralized machine learning model is difficult due to the rapid increase in model size and the amount of data required. Federal Learning (FL) is therefore a distributed learning paradigm that can protect local data privacy. In a typical FL framework, ML models (e.g., multi-layer perceptrons (MLPs), convolutional Neural Networks (CNNs)) are distributed to a large number of workers who train the model using local data and then update the model weights to a central model. While federal learning has significant advantages in terms of privacy protection, some challenges still prevent its widespread adoption. For a centralized FL, the greatest challenge is presented by the central server. Since global aggregation relies on a central server, it is often subject to many network attacks, such as single point of failure. In contrast, the biggest challenge of decentralizing the FL is that without a trusted central server, no one verifies the quality of the local model, resulting in many potential attacks on the learning model by malicious distributed staff, such as random gradient attacks and sign-flip attacks. To alleviate the above-mentioned drawbacks of traditional federal learning, some new blockchain-Based Federal Learning (BFL) frameworks have been proposed. In such a framework, the central server is replaced with a set of distributed miner nodes with the aid of a blockchain. In fact, the blockchain is used as a decentralised and distributed digital ledger, records training information of a plurality of workers, and ensures the safety, transparency and invariance of the recorded information. Blockchains, while enhancing the security of federal learning, also present a number of new challenges. The main and most significant challenge stems from the necessary but slow verification procedure. To reduce the risk of potential attacks introduced by malicious staff on the learning model during model training, the blockchain dependency verifier evaluates locally the model provided by the distributed trainer. The verifier then consistently selects certain local models for global aggregation using a consensus algorithm within the blockchain network. One popular approach is for each validator to validate all local models and then to collectively determine the selected model using a consensus algorithm such as the Practical Bayesian Fault Tolerance (PBFT) algorithm. However, as the number of authenticated local models increases, the authentication process may result in a linear increase in time, resulting in a significant time consumption. The second challenge comes from the excitation process within the transparent nature of the blockchain. In order to motivate more participants to participate in the blockchain to perform training tasks, motivational measures play a vital role. Accordingly, various auction-based incentive mechanisms have been proposed that require participants to report their actual costs as bid prices to maximize rewards. Based on the reported bid price, the intelligent contract selects a number of participants to perform a training task. However, because of the transparency of the blockchain, a selected list of participants must be published to allow access to this information by other participants in the blockchain. Nevertheless, this operation may result in leakage of cost information in the BFL. The final challenge comes from privacy protection during training. Although federal learning can protect the privacy of a trainer by transmitting local models rather than local data, studies have shown that sensitive information can still be inferred by analyzing these models. Thus, some existing methods employ homomorphic encryption on the local model. However, computing operations involving ciphertext can incur significant time overhead, particularly in blockchain environments where the model requires a large number of verifiers to verify. Disclosure of Invention In view of the shortcomings in the prior art, it is an object of the present invention to provide a federal learning method and system based on blockchain incentives and security. According to the invention, a federal learning method based on excitation and safety of block chains comprises the following steps: a plurality of participants acquire training tasks from a blockchain, each participant submits a corresponding bidding price to an intelligent contract, the intelligent contract determines a winner set in current training according to the bidding price, and t