Excitation and security federal learning method and system based on block chain

By employing parallel verification with small-shard validators and a random incentive mechanism, combined with artificial Gaussian noise to protect privacy, the problems of long verification times and privacy leaks in blockchain federated learning systems are solved, achieving efficient and secure model training and verification.

CN121998124APending Publication Date: 2026-05-08SHANGHAI JIAOTONG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI JIAOTONG UNIV
Filing Date
2024-11-04
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing blockchain federated learning systems consume excessive time during the verification process, and the lack of transparency in incentive mechanisms leads to the leakage of cost information, insufficient privacy protection, and the risk of malicious attacks.

Method used

We employ small-shard validators to verify model quality in parallel, combine random incentive mechanisms and artificial Gaussian noise to protect privacy, and use a loop-based shard consensus algorithm to ensure security and efficiency.

Benefits of technology

It improves verification speed, protects the privacy of participants' cost information, prevents malicious attacks, and achieves efficient and robust model training and verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121998124A_ABST
    Figure CN121998124A_ABST
Patent Text Reader

Abstract

The invention provides an incentive and secure federal learning method and system based on a block chain, and the method comprises the steps: a plurality of participants obtain training tasks from the block chain, submit corresponding bidding prices to a smart contract, the smart contract determines a winner set in current training according to the bidding prices, and randomly divides the winner set into a training set and a verification set, obtaining a corresponding trainer and a verifier; the method comprises the following steps: downloading a currently trained local model from a block chain based on winner, adding artificial Gaussian noise, calculating a noise gradient of a target function of the local model by each winner, transmitting the noise gradient to each verifier for model verification, obtaining a list of the selected local model, and performing global aggregation; all verifiers are divided into small fragments, after a verification task of a local model of the trainer is received, each verifier in the small fragments evaluates the quality of the model, and the verifiers exchange votes mutually. The fragmentation consensus algorithm based on circulation can ensure the same security as a non-fragmentation consensus protocol.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, specifically to a blockchain-based security algorithm and incentive algorithm, and more particularly to a blockchain-based incentive and security federated learning method and system. Background Technology

[0002] With the rapid development of machine learning (ML), it has been widely applied in various aspects of our daily lives. However, training centralized machine learning models is difficult due to the rapidly increasing model size and required data volume. Therefore, federated learning (FL) is a distributed learning paradigm that can protect the privacy of local data. In a typical FL framework, ML models (such as multilayer perceptrons (MLPs) and 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. The server does not leak private data; this setup is called centralized FL, or weight updates are distributed among other workers; this is called decentralized FL.

[0003] While federated learning offers significant advantages in terms of privacy, several challenges still hinder its widespread adoption. For centralized federated learning, the biggest challenge lies with the central server. Because global aggregation relies on a central server, it is often vulnerable to numerous cyberattacks, such as single points of failure. In contrast, the biggest challenge with decentralized federated learning is that without a trusted central server, no one verifies the quality of the local model, leading to numerous potential attacks by malicious distributed workers, such as stochastic gradient attacks and sign-flipping attacks.

[0004] To mitigate the aforementioned drawbacks of traditional federated learning, several novel blockchain-based federated learning (BFL) frameworks have been proposed. In these frameworks, with the aid of blockchain, the central server is replaced by a group of distributed miner nodes. In effect, blockchain, as a decentralized and distributed digital ledger, records training information from multiple workers, ensuring the security, transparency, and immutability of the recorded information.

[0005] While blockchain enhances the security of federated learning, it also introduces several new challenges. The primary and most significant challenge stems from the necessary but slow verification process. To mitigate the risk of potential attacks introduced by malicious workers into the learned model during training, blockchains rely on validators to locally evaluate models provided by a distributed trainer. Subsequently, validators unanimously select certain local models for global aggregation using a consensus algorithm within the blockchain network. A popular approach is for each validator to verify all local models, then collectively determine the selected models using a consensus algorithm such as Practical Byzantine Fault Tolerance (PBFT). However, as the number of verified local models increases, the verification process leads to a linear increase in time consumption, resulting in substantial time expenditure.

[0006] The second challenge stems from the incentive process inherent in the transparency of blockchain. Incentives play a crucial role in motivating more participants to engage in training tasks on the blockchain. Therefore, various auction-based incentive mechanisms have been proposed, requiring participants to report their actual costs as bid prices to maximize rewards. Based on the reported bid prices, smart contracts select participants to perform the training tasks. However, due to the transparency of blockchain, the list of selected participants must be made public, allowing other participants in the blockchain to access this information. Nevertheless, this operation could lead to the leakage of cost information within BFL (Blockchain-like Application).

[0007] The final challenge stems from privacy protection during training. While federated learning can protect trainer privacy by transmitting local models instead of local data, research indicates that sensitive information can still be inferred by analyzing these models. Therefore, some existing methods employ homomorphic encryption on the local model. However, computational operations involving ciphertext incur significant time overhead, especially in blockchain environments where the model requires numerous validators for verification. Summary of the Invention

[0008] In view of the shortcomings of the prior art, the purpose of this invention is to provide a blockchain-based incentive and secure federated learning method and system.

[0009] According to the present invention, a blockchain-based incentive and secure federated learning method includes:

[0010] Incentive steps: Multiple participants obtain training tasks from the blockchain, and each participant submits a corresponding bid price to the smart contract. The smart contract determines the set of winners in the current training based on the bid price, and randomly divides the set of winners into a training set and a validation set to obtain the corresponding trainer and validator.

[0011] Training steps: The winner downloads the currently trained local model from the blockchain, adds artificial Gaussian noise, each winner calculates the noise gradient of the objective function of the local model, and transmits the noise gradient to each validator for model validation. After obtaining the list of selected local models, they are then aggregated globally.

[0012] Validation steps: Divide all validators into small segments. After receiving the validation task of the local model from the trainer, each validator in the small segment evaluates the model quality and exchanges votes with each other.

[0013] Preferably, the incentive steps include a winner selection step and a payment determination step;

[0014] The winner selection step includes: participant set Participants in the process obtain training tasks from the blockchain, and then each participant w i Submit a bid b to smart contract C i The actual cost of task execution is expressed as c. i The actual cost is known only to the current participants. After receiving bids from participants, the smart contract C determines the set K of the H winning participants in the t-th round of training. t ;

[0015] The payment determination step includes: determining the winners' set K. t Randomly divided into a set T t The κ trainer and a set of V t The κ validator; based on the winner's contribution to model training, smart contract C further determines the payment to T. t Each trainer and V t The reward p for the validator i .

[0016] Preferably, the bid b i For the participant w i The bid price for the missions executed in this round of training;

[0017] The set T t The training set, the set V t This is the validation set.

[0018] Preferably, the training steps include local training steps and global aggregation steps;

[0019] The local training steps include: the winner set K t The winning participant downloads the current global model from the blockchain. Based on the received global model, each trainer t... i ∈T t Perform training tasks locally;

[0020] The global aggregation step includes: submitting the updated local model to each validator v. i ∈V t The validator selects q models through the validation procedure to obtain θ in the global aggregation. t+1 θ belongs to the set of real numbers, where the corresponding selected trainers form the selected trainer set S. t .

[0021] Preferably, the verification step includes a local verification step and a global consensus step;

[0022] The local verification step includes: the verifier forming a set H consisting of H fragments. t Each shard contains Validator, where Determined as Each slice selection The local model is used to validate the shard quality in parallel, utilizing a public dataset that is accessible to anyone in the system. Assess quality;

[0023] The global consensus steps include: the leader in each shard proposes a voting procedure, called a block, and broadcasts the block to other members in the shard. All validators in the shard submit their votes, represented by 1 or 0, where 1 represents agreement and 0 represents disagreement. Finally, the validators select q trainers and use the local models of the trainers for global aggregation.

[0024] Preferably, the global consensus step includes the following sub-steps:

[0025] Step S3.1: Traverse each slice and elect the corresponding leader;

[0026] Step S3.2: The verifier v in the slice j Broadcast voting sends the vote to all validators in the current shard and records the voting results of all validators;

[0027] Step S3.3: Any validator v in the slice i Check the corresponding vote digest to determine if the vote digest exceeds the current loop's security threshold where validators cast the same vote, and if the predefined time limit Δ is reached. loop If not, then the validator v i Broadcast a command to all validators in the current shard to continue preparing consensus; if so, validator v i Send a summary of the votes to the current shard leader;

[0028] Step S3.4: Upon receiving the verifier vi After the vote digest is generated, the leader requests all validators in the current shard to submit their vote digests, and compares them to determine the validator v. i To verify the correctness of the voting summary and determine the correct voting summary;

[0029] Step S3.5: The leader proposes a decision block containing all voting summaries and the correct voting summaries, and all validators in the network reach a consensus on the decision block;

[0030] Step S3.6: Determine whether the decision block is considered correct. If so, the leader will terminate the voting process in the current shard and broadcast the selection of trainer t. i If the decision is not made by the local model, the voting process will enter the consensus preparation phase of the (l+1)th cycle and return to the execution step S3.1.

[0031] According to the present invention, a blockchain-based incentive and secure federated learning system includes:

[0032] Incentive module: Multiple participants obtain training tasks from the blockchain, and each participant submits a corresponding bid price to the smart contract. The smart contract determines the set of winners in the current training based on the bid price, and randomly divides the set of winners into a training set and a validation set to obtain the corresponding trainer and validator.

[0033] Training module: Based on the winner downloading the currently trained local model from the blockchain, artificial Gaussian noise is added. Each winner calculates the noise gradient of the objective function of the local model and transmits the noise gradient to each validator for model validation. After obtaining the list of selected local models, global aggregation is performed.

[0034] Validation module: Divide all validators into small segments. When a validator receives a local model validation task from the trainer, each validator in the segment evaluates the model quality and exchanges votes with each other.

[0035] Preferably, the incentive module includes a winner selection module and a payment determination module;

[0036] The winner selection module includes: a set of participants. Participants in the process obtain training tasks from the blockchain, and then each participant w i Submit a bid b to smart contract C i The actual cost of triggering the task is represented by c. i The actual cost is known only to the current participants. After receiving bids from participants, the smart contract C determines the set K of the K winning participants in the t-th round of training. t ;

[0037] The payment determination module includes: determining the winner set K. t Randomly divided into a set T t The κ trainer and a set of V t The κ validator; based on the winner's contribution to model training, smart contract C further determines the payment to T. t Each trainer and V t The reward p for the validator i ;

[0038] The bid b i For the participant w i The bid price that triggers the task in this round of training;

[0039] The set T t The training set, the set V t This is the validation set.

[0040] Preferably, the training module includes a local training module and a global aggregation module;

[0041] The local training module includes: a set of winners K t The winning participant downloads the current global model from the blockchain. Based on the received global model, each trainer t... i ∈T t Trigger the training task locally;

[0042] The global aggregation module includes: updating and submitting the trained local model to each validator v. i ∈V t The validator selects q models through the validation procedure to obtain θ in the global aggregation. t+1 θ belongs to the set of real numbers, where the corresponding selected trainers form the selected trainer set S. t .

[0043] Preferably, the verification module includes a local verification module and a global consensus module;

[0044] The local verification module includes: a verifier forming a set H consisting of H fragments. t Each shard contains Validator, where Determined as Each slice selection The local model is used to validate the shard quality in parallel, utilizing a public dataset that is accessible to anyone in the system. Assess quality;

[0045] The global consensus module includes: the leader in each shard proposes a voting procedure, called a block, and broadcasts the block to other members in the shard. All validators in the shard submit votes, represented by 1 or 0, where 1 represents agreement and 0 represents disagreement. Finally, the validators select q trainers and use the local models of the trainers for global aggregation.

[0046] Compared with the prior art, the present invention has the following beneficial effects:

[0047] 1. This invention divides the validator into small fragments, which makes it easier for the validator to verify the model quality in parallel, improves the verification speed, and the proposed cyclic-based fragmentation consensus algorithm can ensure the same security as non-fragmented consensus protocols.

[0048] 2. This invention integrates a random incentive program, which attracts more participants through a detailed worker selection probability design, while ensuring the privacy of their cost information.

[0049] 3. This invention protects the privacy of the local model by adding artificial Gaussian noise to the local model, thus ensuring the privacy of the trainer's local model.

[0050] 4. This invention demonstrates high efficiency, robustness, and high accuracy in both classification and regression tasks. Attached Figure Description

[0051] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0052] Figure 1 This is an interactive diagram of the blockchain-based federated learning system of the present invention;

[0053] Figure 2 This is a flowchart illustrating the incentive steps in this invention, which includes two sub-steps: winner selection and payment determination.

[0054] Figure 3 This is a flowchart illustrating the training steps in this invention, which includes two sub-steps: local training and global aggregation.

[0055] Figure 4 This is a flowchart illustrating the verification steps in this invention, which includes two sub-steps: local verification and global consensus. Detailed Implementation

[0056] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0057] This invention proposes a novel, incentive-driven, and secure blockchain-based framework called BIT-FL. This framework effectively incentivizes nodes to participate in model training tasks while ensuring the privacy of their cost information. Furthermore, this invention establishes provable privacy guarantees for BIT-FL's local models by incorporating carefully designed Gaussian noise. To efficiently select high-quality local models for global aggregation, BIT-FL integrates a validator program that shards validators, allowing validators in different shards to validate models in parallel. Validators can use a cycle-based sharding consensus algorithm to evaluate model quality in parallel. The consensus algorithm proposed in this invention ensures the same level of security as non-sharded consensus protocols with synchronous communication. In addition, a training procedure is integrated to address privacy concerns regarding sensitive member information. This involves adding artificial Gaussian noise to the local models to achieve differential privacy; the designed noise ensures that BIT-FL's excess experience risk has a strict upper limit.

[0058] Example 1

[0059] According to the present invention, a blockchain-based incentive and secure federated learning method is adopted, such as... Figure 1 As shown, it includes:

[0060] Incentive Steps: Multiple participants obtain training tasks from the blockchain, and each participant submits a corresponding bid price to the smart contract. The smart contract determines the winning set in the current training based on the bid price, and randomly divides the winning set into a training set and a validation set, thus obtaining the corresponding trainer and validator. Figure 2 As shown, the incentive steps include a winner selection step and a payment determination step.

[0061] The winner selection step includes: participant set Participants in the process obtain training tasks from the blockchain, and then each participant w i Submit a bid b to smart contract C i The bid b i For the participant w i The bid price for executing the task in this round of training. The actual cost of task execution is represented by c. iThe actual cost is known only to the current participant; no other staff member knows it. After receiving a participant's bid, the smart contract C determines the set K of the K winning participants in the t-th round of training. t .

[0062] The payment determination step includes: determining the winners' set K. t Randomly divided into a set T t The κ trainer and a set of V t The κ validator. Based on the winner's contribution to model training, smart contract C further determines the payment to T. t Each trainer and V t The reward p for the validator i Where T and V are sets, the two being the trainer and validator split from the winner Kt, and the set T... t The training set, the set V t This is the validation set.

[0063] Two common attacks during the incentive process are false reporting attacks and inference attacks. This invention proposes a random incentive mechanism where each participant selects according to a probability distribution. By carefully designing the selection probabilities, it achieves differential privacy (DP) on the bids reported by participants, preventing malicious participants from inferring cost information from the published list of winning bidders. The incentive process effectively motivates participants to engage in model training while protecting the privacy of their cost information, including: integrating the incentive procedure to attract more participants to model training; and achieving differential privacy on participant-reported bids through a random incentive mechanism and carefully designed selection probabilities. This not only attracts participant participation but also defends against false reporting and inference attacks.

[0064] Training steps: The winner downloads the currently trained local model from the blockchain, adds artificial Gaussian noise, each winner calculates the noise gradient of the objective function of the local model, and transmits the noise gradient to each validator for model validation. After obtaining the list of selected local models, they are then aggregated globally.

[0065] The training process includes five potential attacks: information eavesdropping attacks, stochastic gradient attacks, sign-flipping attacks, adversarial poisoning attacks, and backdoor attacks. This invention protects the privacy of participants' local models by adding artificial Gaussian noise. The carefully designed shape of the noise distribution ensures the accuracy of the FL (Feature-Based Flow) algorithm. The training steps of this invention employ a perturbation-based training method, using artificial Gaussian noise to protect the privacy of local models, integrating the training process to address privacy issues related to sensitive member information. This involves adding artificial Gaussian noise to the local model to achieve differential privacy. Furthermore, through careful design of the Gaussian noise, it limits the overexperience risk of BIT-FL to... Where n is the size of the union dataset, n min It is the size of the minimum value dataset.

[0066] The training steps include local training steps and global aggregation steps.

[0067] The local training steps include: the winner set K t The winning participant downloads the current global model from the blockchain. Based on the received global model, each trainer t... i ∈T t Perform training tasks locally.

[0068] The global aggregation step includes: submitting the updated local model to each validator v. i ∈V t The validator selects q models through the validation procedure to obtain θ in the global aggregation. t+1 θ belongs to the set of real numbers and is the parameter vector used to find a model that minimizes the following empirical risk function, where the corresponding selected trainers form the selected trainer set S. t .

[0069] Validation steps: All validators are divided into small segments. Upon receiving the validation task from the trainer's local model, each validator in each segment evaluates the model quality and exchanges votes with each other. The validation steps include local validation steps and global consensus steps.

[0070] The local verification step includes: the verifier forming a set H consisting of H fragments. t Each shard contains Validator, where Determined as Each slice selection The local model is used to validate the shard quality in parallel, utilizing a public dataset that is accessible to anyone in the system.

[0071] The global consensus step includes: Each leader within a shard proposes a voting procedure, called a "block," and broadcasts the block to other members within the shard. This block aims to determine whether the validated local model meets the required criteria. Afterward, all validators within the shard submit their votes, represented by 1 or 0, where 1 represents "agree" and 0 represents "disagree." Finally, the validators select q trainers and perform global aggregation using the trainers' local models. Specifically, the global consensus step includes the following sub-steps:

[0072] Step S3.1: Traverse each slice and elect the corresponding leader.

[0073] Step S3.2: The verifier v in the slice k Broadcast voting sends the vote to all validators in the current shard and records the voting results of all validators;

[0074] Step S3.3: Any validator v in the slice i Check the corresponding vote digest to determine if the vote digest exceeds the current loop's security threshold where validators cast the same vote, and if the predefined time limit Δ is reached. loop If not, then the validator v i Broadcast a command to all validators in the current shard to continue preparing consensus; if so, validator v i Send a summary of the votes to the current shard leader.

[0075] Step S3.4: Upon receiving the verifier v i After the vote digest is generated, the leader requests all validators in the current shard to submit their vote digests, and compares them to determine the validator v. i The correctness of the voting summary is determined to identify the correct voting summary.

[0076] Step S3.5: The leader proposes a decision block containing all voting summaries and the correct voting summaries, and all validators in the network reach a consensus on the decision block.

[0077] Step S3.6: Determine whether the decision block is considered correct. If so, the leader will terminate the voting process in the current shard and broadcast the selection of trainer t. i If the decision is not made by the local model, the voting process will enter the consensus preparation phase of the (l+1)th cycle and return to the execution step S3.1.

[0078] The verification process includes liveness and security attacks. Validators are divided into small shards so they can verify model quality in parallel; that is, validators are sharded, allowing validators in different shards to verify the model concurrently. Furthermore, to prevent erroneous model selection, a round-robin-based sharding consensus algorithm is employed to improve the efficiency and security of model verification. This consensus algorithm not only improves verification efficiency but also achieves the same security guarantees as non-sharding consensus protocols. Under synchronous communication, when the ratio of adversaries among validators is less than 1 / 2, i.e. It always outputs the correct decisions, among which This refers to the number of validators. While maintaining reasonable performance, the verification process achieves the same security as a non-sharded consensus algorithm, a sharded consensus algorithm, significantly improving the efficiency of local verification in BIT-FL.

[0079] This invention aims to establish a secure and fair incentive mechanism. BIT-FL ensures a fair exchange between task execution and rewards without the need for a central authority, thereby preventing malicious attacks such as false reporting. Furthermore, it protects the privacy of participants' cost information from inference attacks. For secure and accurate training, BIT-FL can defend against training process attacks initiated by malicious trainers. Moreover, as a learning model, it guarantees high training accuracy. For secure and efficient verification, BIT-FL ensures security, including liveness and safety, while maintaining high efficiency during the verification process.

[0080] Furthermore, the blockchain-based incentive and security federated learning method of this invention is specifically described below with reference to the accompanying drawings: The federated learning method of this invention includes an incentive step, a training step, and a verification step.

[0081] Incentive Steps: Since other participants may infer the reported bids from the published list of winners, it is necessary to protect the privacy of cost information. Although participants can apply zero-knowledge proofs to achieve anonymity, thereby preventing others from identifying them from the list of winners, generating the corresponding proofs would consume significant time and space. This invention uses an exponential mechanism to guarantee differential privacy of worker costs.

[0082] like Figure 2 As shown, the incentive step consists of two sub-steps: winner selection and payout determination.

[0083] Winner selection: To employ this mechanism, the scoring function is set as follows: in yes A replica set. The scoring function means that for the input... Once participants are selected, w i When performing the training task, the score is Therefore, according to this rating function, participant w i The probability of being selected is:

[0084]

[0085] Where ∈′=∈ E / (eln(e / δ E For a given privacy budget 0 < ∈ E <1, probability of failure 0<δ E <1. Furthermore, b i It is w i The bid. You can get Will Represented as Pr(b) i ).

[0086] Based on the selection probabilities determined by specific criteria, the smart contract obtains a winner set K consisting of K winning workers. t The set is further randomly and uniformly divided into two subsets: a set of trainers T with κ trainers. t and have The validator set V t Each trainer t i ∈T t With probability P from K t The validator is selected to perform the training task, and each validator v j ∈V t The verification task is performed with a probability of 1-P.

[0087] Payment confirmed: each winner w i ∈K t payment p i Her role in model training is determined. In each round of training, the smart contract selects trainers from the set T based on the quality of the worker model verified during the validation process. t Select a set of S t There are q trainers in total. Without loss of generality, let α represent T. t The number of malicious trainers in China V represents t The number of malicious validators. Payment is as follows:

[0088] • For the selected trainer t i The reward is

[0089] For honesty verifier v j The reward is

[0090] In addition, unselected trainers and malicious validators will not receive rewards.

[0091] Training Steps: Since analyzing the local model submitted by the trainer may also reveal sensitive information, it is necessary to protect the privacy of the local model. Although the trainer can apply homomorphic encryption to ensure privacy, it requires a significant amount of time to achieve global aggregation of the ciphertext. Therefore, this invention will apply a Gaussian mechanism to ensure differential privacy on the worker's local model.

[0092] like Figure 3 As shown, this step includes two sub-steps: local training and global aggregation.

[0093] Localized training: In round t, after the motivational step, each honest trainer t i ∈T t According to the formula Calculate the local objective function F i (θ t-1 D i The noise gradient G i (θ t-1 D i ), where F i (θ t-1 D i ) and trainer t i Dataset D i From the equation Given. Zi t These are noises added at t=1, originating from N(0,σ). 2 I d The variables are independent and identically distributed (i.i.d) random variables extracted from the model. Additionally, d represents the dimension of the global model parameter θ. Finally, the noise gradient G is... i (θ t-1 Transmitted to each validator v i ∈V t Model validation was performed. In contrast, T t Malicious trainers launch attacks by submitting malicious local models.

[0094] Global aggregation: After the validation process, it obtains a list S of the selected local models. t Then, each validator computes the global aggregation and updates the global model θ. t ,in η>0 is the learning rate, n i It is the trainer t i The size of the dataset.

[0095] Verification Steps: Since malicious trainers may launch liveness and security attacks to degrade model performance, it is necessary to use validators to evaluate the quality of local models. However, the time required for model verification increases linearly with the number of models to be verified. If each validator's task is to verify all local models, it will consume a significant amount of time. Therefore, during the verification process, this invention divides the validator into small slices, where different models are verified in parallel across different slices. However, some malicious validators may violate the verification rules. Furthermore, due to the division of validators, some slices may contain more malicious validators, making accurate verification of model quality challenging.

[0096] This invention proposes a sharding consensus algorithm based on round-robin to help validators make accurate decisions and avoid false positives. The verification steps include the following: all v validators are divided into H shards, each shard containing Validator. In the l-th loop, upon receiving the trainer t... i After the local model validation task, the shard hl Each validator in the dataset (where (i+l-1)≡lmodH) uses the public dataset. Evaluate the model quality. Then, partition h... l The validators in the set exchange votes. When the set of validators V... t The number of validators with the same vote exceeds When the voting process ends, the verification process terminates.

[0097] If this condition is not met, the process continues to the next loop, involving a new fragment h. l +1. Here, S l This represents the termination threshold, corresponding to the safety threshold S discussed in Section 4. Specifically, in the l-th loop, S... l The calculation is as follows:

[0098]

[0099] in Represents validator V t The number of opponents. Additionally, z is a variable derived from a standard Gaussian distribution, with a cumulative probability of... Where b represents the safety parameter.

[0100] Specifically, such as Figure 4 As shown, this step includes two sub-steps: local verification and global consensus. Before starting local verification, the validators form a set H. t ={h1,…,h H It contains H partitions, each partition holding... Verifiers. Additionally, each verifier v j They were all randomly assigned. Assistant, responsible for storing verifier v j The message includes signatures, votes, etc. Subsequently, each validator receives all local models from the trainer and calculates the global model θ using the following formula. t-1 Accuracy:

[0101]

[0102] in This represents a public dataset stored in the blockchain for model validation, with a size of [size missing].

[0103] Local validation: During the l-th loop, for each trainer t i The local model is validated only by the validator in the shard hl, where (i+l-1)≡lmodH. This validation involves using the formula... The computational model is described, where η represents the learning rate. Subsequently, the validator v...j The trainer t was evaluated using the following methods. i Model accuracy:

[0104] if This indicates that the trainer t i If a local model makes a positive contribution, it can be selected for global aggregation; otherwise, it cannot be selected. It is worth noting that all honest validators will evaluate each trainer's work. i They made the same decision because of their input. and They are the same. Afterward, the program will proceed to the global consensus implementation to determine whether to select the local model. To prevent erroneous decisions in the presence of malicious validators, this paper proposes a novel round-robin-based consensus algorithm. This algorithm includes the following sub-steps:

[0105] Sub-phase s1. Consensus preparation:

[0106] Before consensus is reached, each partition hl randomly selects a leader. During the first iteration, the leader broadcasts a block containing whether to select a trainer t. i The problem lies with the local model. Instead, in subsequent iterations (denoted by l), the validators within the partition hl (with indices of (i+l-1)≡lmodH) are selected from all... Validator v k Receive all vote summaries U k,l-1 These summaries are obtained only from the last involved fragment hl-1, where (i+l-2)≡(l-1)modH, where Voting Summary u k,l-1 By verifier v k The created matrix contains κ rows and two columns representing different voting states (accept (00), reject (01), no vote (10), double vote (11)). Each row stores the validator v. j ∈∪ z h z The voting state, where (imodH)≤z≤(l-1), corresponds to the j-th row. Any honest validator would carefully examine all received U... k,l-1 Conflicting information within. If discrepancies exist, such as between validator v in the UK record. b The voting status of l-1 differs from other summaries; validator v e By sending a validator v b The assistant queries the relevant votes and draws her own conclusions to solve the problem. She then records all these votes in her vote summary. If all k's U k,l-1 combination v k ∈hl-1 This indicates that at least (1-S) of all voting validators l-1 Fractions, i.e., slices ∪ j h j The scores of all validators, of which Each validator either disagrees with the majority vote or remains silent. j Synchronize the block ∈hl and perform local verification to implement the (l+1)th local verification.

[0107] Sub-phase s2. Consensus Implementation:

[0108] Each validator v j ∈hl sends its vote to all validators in the shard hl. Simultaneously, they transmit their vote to the assistant, including the block hash, their decision, and digital signature. Subsequently, each validator v... j The voting digest records all votes received by validators in the shard hl. Finally, the validators perform consensus verification.

[0109] Sub-phase s3. Consensus Authentication:

[0110] Any validator v i ∈hl check their vote summary. If it does not exceed S l Some validators cast the same vote, and the predefined time limit Δ is reached. loop Then the verifier v i To fragment ∪ j h j All validators broadcast commands, where Continue working towards a consensus. Otherwise, if sharding ∪ j h j China surpasses S l Some of the validators cast the same vote, among which Then the verifier v i Send a summary of the votes to the current shard leader.

[0111] Sub-phase s4. Consensus decision:

[0112] After receiving the verifier v i After the summary, the leader requires all HL fragments to be processed. Validators submit summaries of their votes to prevent manipulation by adversaries. In fact, the leader checks validators' performance by comparing them to others. iThe leader verifies the correctness of the submitted voting summaries. If discrepancies exist among the received voting summaries, the leader determines the correct vote from the assistants of the validators who voted differently. Finally, the leader proposes a decision block containing all summaries and the determined correct voting summary. Afterward, all validators in the network reach a consensus on this decision block; any BFT algorithm can facilitate this consensus after a simple check of the included voting summaries. If the decision is deemed correct, the leader terminates the voting process in the partition hl and broadcasts information about selecting the trainer t. i The decision is made by the local model. Otherwise, the voting process will enter the consensus preparation phase of the (l+1)th cycle.

[0113] To address the slow verification problem, this invention divides the validator into small shards so that they can verify model quality in parallel. To prevent erroneous model selection, a novel sharding consensus algorithm based on loops is proposed, achieving the same security guarantees as non-sharding consensus protocols. To address the inference attack problem caused by the internal incentive procedure in the transparent nature of blockchains, a stochastic incentive mechanism is proposed, where each participant selects according to a probability distribution. By carefully designing the selection probabilities, differential privacy (DP) is achieved on the bids reported by participants, preventing malicious participants from inferring cost information from the published list of winning bids. Finally, to achieve privacy protection during training, artificial Gaussian noise is added to protect the privacy of the local model. This invention demonstrates high efficiency, robustness, and high accuracy in both classification and regression tasks, outperforming existing methods and confirming its superior performance.

[0114] Example 2

[0115] The present invention also provides a blockchain-based incentive and secure federated learning system, which can be implemented by executing the process steps of the blockchain-based incentive and secure federated learning method. That is, those skilled in the art can understand the blockchain-based incentive and secure federated learning method as a preferred implementation of the blockchain-based incentive and secure federated learning system.

[0116] According to the present invention, a blockchain-based incentive and secure federated learning system includes:

[0117] Incentive Steps: Multiple participants acquire training tasks from the blockchain, and each participant submits a corresponding bid price to the smart contract. The smart contract determines the winning set in the current training based on the bid prices, and randomly divides the winning set into a training set and a validation set to obtain the corresponding trainer and validator. The incentive steps include a winner selection step and a payment determination step; the winner selection step includes: participant set... Participants in the process obtain training tasks from the blockchain, and then each participant w i Submit a bid b to smart contract C i The actual cost of triggering the task is represented by c. i The actual cost is known only to the current participants. After receiving bids from participants, the smart contract C determines the set K of the K winning participants in the t-th round of training. t The payment determination step includes: setting up the winners' set K. t Randomly divided into a set T t The κ trainer and a set of V t The κ validator; based on the winner's contribution to model training, smart contract C further determines the payment to T. t Each trainer and V t The reward p for the validator i The bid b i For the participant w i The bid price that triggers the task in this round of training; the set T t The training set, the set V t This is the validation set.

[0118] Training steps: Based on the winners downloading the currently trained local models from the blockchain, artificial Gaussian noise is added. Each winner calculates the noise gradient of the objective function of their local model, and transmits the noise gradient to each validator for model validation. After obtaining a list of selected local models, global aggregation is performed. The training steps include local training steps and global aggregation steps. The local training steps include: a set of winners K. t The winning participant downloads the current global model from the blockchain. Based on the received global model, each trainer t... i ∈T t The training task is triggered locally; the global aggregation step includes: updating and submitting the trained local model to each validator v. i ∈V t The validator selects q models through the validation procedure to obtain θ in the global aggregation. t+1 θ belongs to the set of real numbers, where the corresponding selected trainers form the selected trainer set S. t .

[0119] Validation steps: All validators are divided into small segments. Upon receiving the validation task from the trainer's local model, each validator in each segment evaluates the model quality and exchanges votes with each other. The validation steps include local validation steps and global consensus steps.

[0120] The local verification step includes: the verifier forming a set H consisting of H fragments. tEach shard contains Validator, where Determined as Each slice selection The local model is used to validate the shard quality in parallel, utilizing a public dataset that is accessible to anyone in the system. Quality assessment. The global consensus steps include: the leader within each shard proposes a voting procedure, called a block, and broadcasts the block to other members within the shard; all validators within the shard submit their votes, represented by 1 or 0, where 1 represents agreement and 0 represents disagreement; finally, the validators select q trainers and use the trainers' local models for global aggregation.

[0121] The global consensus module includes the following sub-modules: Module M3.1: Traverses each slice and elects the corresponding leader; Module M3.2: Validators v in the slice. j Broadcast voting sends votes to all validators in the current slice and records the voting results of all validators; Module M3.3: Any validator v in the slice i Check the corresponding vote digest to determine if the vote digest exceeds the current loop's security threshold where validators cast the same vote, and if the predefined time limit Δ is reached. loop If not, then the validator v i Broadcast a command to all validators in the current shard to continue preparing consensus; if so, validator v i Send the vote digest to the current shard leader; Module M3.4: Upon receiving the validator v i After the vote digest is generated, the leader requests all validators in the current shard to submit their vote digests, and compares them to determine the validator v. i The correctness of the voting digests is determined by module M3.5: the leader proposes a decision block containing all voting digests and the correct voting digest, and all validators in the network reach a consensus on the decision block; module M3.6: it determines whether the decision block is considered correct. If so, the leader terminates the voting process in the current shard and broadcasts information about selecting the trainer t. i If the decision is not made by the local model, the voting process will enter the consensus preparation phase of the (l+1)th cycle and return to the trigger module M3.1.

[0122] Those skilled in the art will understand that, besides implementing the system and its various devices, modules, and units provided by this invention in the form of purely computer-readable program code, the same functions can be achieved entirely through logical programming of the method steps, enabling the system and its various devices, modules, and units to function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, the system and its various devices, modules, and units provided by this invention can be considered a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered structures within the hardware component; alternatively, the devices, modules, and units for implementing various functions can be considered both software modules implementing the method and structures within the hardware component.

[0123] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. A blockchain-based incentive and secure federated learning method, characterized in that, include: Incentive steps: Multiple participants obtain training tasks from the blockchain, and each participant submits a corresponding bid price to the smart contract. The smart contract determines the set of winners in the current training based on the bid price, and randomly divides the set of winners into a training set and a validation set to obtain the corresponding trainer and validator. Training steps: The winner downloads the currently trained local model from the blockchain, adds artificial Gaussian noise, each winner calculates the noise gradient of the objective function of the local model, and transmits the noise gradient to each validator for model validation. After obtaining the list of selected local models, they are then aggregated globally. Validation steps: Divide all validators into small segments. After receiving the validation task of the local model from the trainer, each validator in the small segment evaluates the model quality and exchanges votes with each other.

2. The blockchain-based incentive and secure federated learning method according to claim 1, characterized in that, The incentive process includes a winner selection process and a payment determination process; The winner selection step includes: participant set Participants in the process obtain training tasks from the blockchain, and then each participant w i Submit a bid b to smart contract C i The actual cost of task execution is expressed as c. i The actual cost is known only to the current participants. After receiving bids from participants, the smart contract C determines the set K of the K winning participants in the t-th round of training. t ; The payment determination step includes: determining the winners' set K. t Randomly divided into a set T t The κ trainer and a set of V t The κ validator; based on the winner's contribution to model training, smart contract C further determines the payment to T. t Each trainer and V t The reward p for the validator i .

3. The blockchain-based incentive and secure federated learning method according to claim 2, characterized in that, The bid b i For the participant w i The bid price for the missions executed in this round of training; The set T t The training set, the set V t This is the validation set.

4. The blockchain-based incentive and secure federated learning method according to claim 1, characterized in that, The training steps include local training steps and global aggregation steps; The local training steps include: the winner set K t The winning participant downloads the current global model from the blockchain. Based on the received global model, each trainer t... i ∈T t Perform training tasks locally; The global aggregation step includes: submitting the updated local model to each validator v. i ∈V t The validator selects q models through the validation procedure to obtain θ in the global aggregation. t+1 θ belongs to the set of real numbers, where the corresponding selected trainers form the selected trainer set S. t .

5. The blockchain-based incentive and secure federated learning method according to claim 1, characterized in that, The verification steps include local verification steps and global consensus steps; The local verification step includes: the verifier forming a set H consisting of H fragments. t Each shard contains Validator, where Determined as Each slice selection The local model is used to validate the shard quality in parallel, utilizing a public dataset that is accessible to anyone in the system. Assess quality; The global consensus steps include: the leader in each shard proposes a voting procedure, called a block, and broadcasts the block to other members in the shard. All validators in the shard submit their votes, represented by 1 or 0, where 1 represents agreement and 0 represents disagreement. Finally, the validators select q trainers and use the local models of the trainers for global aggregation.

6. The blockchain-based incentive and secure federated learning method according to claim 5, characterized in that, The global consensus step includes the following sub-steps: Step S3.1: Traverse each slice and elect the corresponding leader; Step S3.2: The verifier v in the slice j Broadcast voting sends the vote to all validators in the current shard and records the voting results of all validators; Step S3.3: Any validator v in the slice i Check the corresponding vote digest to determine if the vote digest exceeds the current loop's security threshold where validators cast the same vote, and if the predefined time limit Δ is reached. loop If not, then the validator v i Broadcast a command to all validators in the current shard to continue preparing consensus; if so, validator v i Send a summary of the votes to the current shard leader; Step S3.4: Upon receiving the verifier v i After the vote digest is generated, the leader requests all validators in the current shard to submit their vote digests, and compares them to determine the validator v. i To verify the correctness of the voting summary and determine the correct voting summary; Step S3.5: The leader proposes a decision block containing all voting summaries and the correct voting summaries, and all validators in the network reach a consensus on the decision block; Step S3.6: Determine whether the decision block is considered correct. If so, the leader will terminate the voting process in the current shard and broadcast the selection of trainer t. i If the decision is not made by the local model, the voting process will enter the consensus preparation phase of the (l+1)th cycle and return to the execution step S3.

1.

7. A blockchain-based incentive and secure federated learning system, characterized in that, include: Incentive module: Multiple participants obtain training tasks from the blockchain, and each participant submits a corresponding bid price to the smart contract. The smart contract determines the set of winners in the current training based on the bid price, and randomly divides the set of winners into a training set and a validation set to obtain the corresponding trainer and validator. Training module: Based on the winner downloading the currently trained local model from the blockchain, artificial Gaussian noise is added. Each winner calculates the noise gradient of the objective function of the local model and transmits the noise gradient to each validator for model validation. After obtaining the list of selected local models, global aggregation is performed. Validation module: Divide all validators into small segments. When a validator receives a local model validation task from the trainer, each validator in the segment evaluates the model quality and exchanges votes with each other.

8. A blockchain-based incentive and secure federated learning system according to claim 7, characterized in that, The incentive module includes a winner selection module and a payment determination module; The winner selection module includes: a set of participants. Participants in the process obtain training tasks from the blockchain, and then each participant w i Submit a bid b to smart contract C i The actual cost of triggering the task is represented by c. i The actual cost is known only to the current participants. After receiving bids from participants, the smart contract C determines the set K of the K winning participants in the t-th round of training. t ; The payment determination module includes: determining the winner set K. t Randomly divided into a set T t The κ trainer and a set of V t The κ validator; based on the winner's contribution to model training, smart contract C further determines the payment to T. t Each trainer and V t The reward p for the validator i ; The bid b i For the participant w i The bid price that triggers the task in this round of training; The set T t The training set, the set V t This is the validation set.

9. A blockchain-based incentive and secure federated learning system according to claim 7, characterized in that, The training module includes a local training module and a global aggregation module; The local training module includes: a set of winners K t The winning participant downloads the current global model from the blockchain. Based on the received global model, each trainer t... i ∈T t Trigger the training task locally; The global aggregation module includes: updating and submitting the trained local model to each validator v. i ∈V t The validator selects q models through the validation procedure to obtain θ in the global aggregation. t+1 θ belongs to the set of real numbers, where the corresponding selected trainers form the selected trainer set S. t .

10. A blockchain-based incentive and secure federated learning system according to claim 7, characterized in that, The verification module includes a local verification module and a global consensus module; The local verification module includes: a verifier forming a set H consisting of H fragments. t Each shard contains Validator, where Determined as Each slice selection The local model is used to validate the shard quality in parallel, utilizing a public dataset that is accessible to anyone in the system. Assess quality; The global consensus module includes: the leader in each shard proposes a voting procedure, called a block, and broadcasts the block to other members in the shard. All validators in the shard submit votes, represented by 1 or 0, where 1 represents agreement and 0 represents disagreement. Finally, the validators select q trainers and use the local models of the trainers for global aggregation.