Federal learning method and system of committee consensus protocol based on block chain

By introducing blockchain technology and committee consensus protocols into federated learning systems, the problems of single point of failure and security privacy attacks in traditional systems are solved, and a decentralized and highly robust federated learning system is achieved.

CN119442299APending Publication Date: 2025-02-14INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411325196.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Traditional federated learning systems face single point of failure problems and security privacy attack threats, resulting in insufficient system robustness and privacy protection capabilities.

Method used

The blockchain-based committee consensus protocol is adopted to elect the consensus committee and proposers through a proof of stake mechanism, and combine multi-party security computing technology to realize a gradient similarity security aggregation algorithm based on secret sharing to prevent Byzantine attacks and privacy leakage.

Benefits of technology

The federated learning system has been decentralized, the Byzantine robustness and data privacy protection capabilities of the system have been improved, and malicious attacks and privacy leakage have been prevented.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119442299A_ABST
    Figure CN119442299A_ABST
Patent Text Reader

Abstract

The invention relates to a federal learning method and system of a committee consensus protocol based on a block chain, and belongs to the technical field of block chains. The method comprises the steps that S1, a task publisher creates a creation block according to a global model; s2, based on the weights of the nodes, selecting a committee of the rth federal training; s3, after the verification equipment and the federation learning participants obtain the global model V (r-1) from the block B (r-1), training the global model V (r-1) by using the local data set, and updating and sharing gradients corresponding to the obtained local model V0 (r) and the local model Vj (r) to the committee member of the rth federation training; and S4, the committee member generates a global model V (r) based on gradient updating corresponding to the local model V0 (r) and the local model Vj (r), creates a block B (r) and updates the weight wi (r) of the node, and then executes again from the step S2. According to the method, decentration of the federal learning architecture is realized, the Byzantine attack is effectively defended, and the Byzantine robustness of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of blockchain, and proposes a federated learning method and system of a committee consensus protocol based on blockchain. Background Art

[0002] In recent years, with the rapid development of artificial intelligence technology, the demand for data has risen sharply. However, due to the laws and regulations on data privacy protection, the traditional artificial intelligence data processing model faces new challenges. Federated learning proposed by Google has opened up a new research direction for artificial intelligence and solved problems such as data silos and data security. In federated learning, each participant sends the local model to the central server, which aggregates the model. However, in this model, network threats and the increase in the number of participating clients may cause a single point of failure in the central server, thereby affecting the communication between the participants and the central server, resulting in the inability to aggregate and update the model, and thus affecting the operation of the entire federated learning system. In addition, there are also threats such as security attacks and privacy attacks. The adversary may interfere with the normal training of the model or manipulate part of the data or model, thereby destroying the global model, endangering the operation of the federated learning system, the accuracy of the model, and the robustness of the system. The adversary may also steal the gradients or parameters of the training process, and restore the user's local training data by reconstructing the model parameters, including the member information, class representative information, attribute information, etc. of the user data.

[0003] In order to promote the development of federated learning in the field of data privacy protection, key issues faced in federated learning must be resolved, including single point failure and security and privacy attacks. As a decentralized distributed storage technology, blockchain technology has many advantages such as decentralization, data privacy protection, enhanced security, and improved credibility. It can effectively deal with the centralization, data privacy leakage, security, and credibility issues faced by traditional federated learning. Summary of the invention

[0004] In order to overcome the above problems, the present invention provides a federated learning method and system based on a committee consensus protocol of blockchain. By constructing a committee consensus mechanism based on proof of stake, a consensus committee and a proposer are selected from the nodes by using a verifiable cryptographic random algorithm according to the number of proof of stake of the nodes. Multi-party secure computing technology is introduced to implement a gradient similarity security aggregation algorithm based on secret sharing. Using the committee consensus mechanism, committee members score, summarize, select, aggregate and other operations on local models to complete the aggregation of the global model. The proposer packages the global model and model score into blocks. The committee verifies the proposer's block and then uploads it to the chain and broadcasts it. The decentralization of the federated learning architecture is achieved, Byzantine attacks are effectively defended, and the Byzantine robustness of the system is improved.

[0005] To achieve the above objectives, the technical solution of the present invention includes the following contents.

[0006] A federated learning method based on a blockchain-based committee consensus protocol, the method comprising:

[0007] Step S1: The task publisher uses the global model V (0) Create Genesis Block B (0) ;

[0008] Step S2: Based on the weight of the node Elect the committee for the rth federated training; where i is a positive integer and the weight of the node It is the ratio of the number of tokens held by the node to the sum of all tokens in the network;

[0009] Step S3: Verify that the device and federated learning participants receive data from Block B (r-1) Get the global model V (r-1) Then, use the local dataset to train the global model V (r-1) , and the local model obtained and local model V j (r) The corresponding gradient updates are shared with the committee members of the r-th federated training; where j is a positive integer;

[0010] Step S4: Committee members based on local models and local model V j (r) The corresponding gradient is updated to generate the global model V (r) And create block B (r) And update the node weights Then, execute again from step S2;

[0011] Step S5: After the set conditions for federated learning are met, the final global model V is obtained.

[0012] Furthermore, the node-based weight W i (r) , elects the rth federal training committee, including:

[0013] The number of committee members τ and the weight of each node based on the r-th federated training Calculate the election probability of the node

[0014] According to the random number of the previous round of training Generate random seeds

[0015] Combine the private key of each node with the random seed Enter the verifiable random function to get a random number and a proof;

[0016] Each node sends the random number Convert it to a decimal between 0 and 1 and use the decimal and the probability of election to determine the winner. Determine whether the node becomes a member of the committee for the rth federation training;

[0017] When a node becomes a member of the committee of the rth federated training, the random number is published With the said proof, other nodes can verify the validity of the election.

[0018] Further, the verification device from block B (r-1) Get the global model V (r-1) Then, use the local dataset to train the global model V (r-1) , and the local model obtained The corresponding gradient updates are shared with the committee members of the r-th federated training, including:

[0019] The verification device uses the local data set to execute the local model training algorithm provided by the task publisher to train the global model V (r-1) , get the gradient update Among them, the local dataset of the verification device is constructed based on the local datasets of each federated learning participant;

[0020] Update the gradient Regularize and get the regularized result

[0021] Update according to the gradient And the regularization result Generate Secret

[0022] Use the SPDZ framework to implement secret sharing technology and share secrets Share it with the committee members so that each r-th committee member s gets the secret A secret share of

[0023] Furthermore, committee members based on local models and local model V j (r) The corresponding gradient is updated to generate the global model V (r) V (r) And create block B (r) And update the node weights include:

[0024] Each committee member s broadcasts its secret share [z] to other committee members, so that each committee member s obtains a local model V based on all secret shares [z]. j (r) Updated cosine similarity Among them, the secret share represents the participant d in the rth federated training j The local model V was shared with the committee members j (r) Secret share for gradient updates;

[0025] According to the cosine similarity Calculate the local model V j (r) Updated score to determine whether to select the local model V in the aggregation process of the rth federated training j (r) ;

[0026] Select a proposer from the committee members and make the proposer perform the selected local model V j (r) Aggregate and get the global model V (r) ;

[0027] The proposer transforms the local model V j (r) Updated scores and global model V (r) Packed into block V (r) After that, it will be submitted to the rth federal training committee for verification;

[0028] Waiting for the rth federation training committee to confirm block B (r) After that, the committee members are incentivized based on the model scores, block proposals, and block verifications in the rth federated training, and the weights of the corresponding nodes are updated.

[0029] Further, according to the cosine similarity Calculate the local model V j (r) Updated score to determine whether to select the local model V in the aggregation process of the rth federated training j (r) ,include:

[0030] Calculate the local model V j (r) Updated ratings

[0031] Set a threshold v;

[0032] In the rating When the value is less than the threshold v, the corresponding local model V is not selected in the aggregation process of the rth federated training. j (r) ;

[0033] In the rating When the value is greater than the threshold v, the corresponding local model V is selected during the aggregation process of the rth federated training. j (r) .

[0034] Furthermore, the proposer selects the local model V j (r) Aggregate and get the global model V (r) ,include:

[0035] Based on the selected local model V j (r) The corresponding secret share Recover the secret

[0036] According to the recovered secret With local model V j (r) The updated score performs security aggregation and obtains the gradient g r ;

[0037] Based on the gradient g r For the global model V (r-1) Update and get the global model V (r) .

[0038] Furthermore, the proposer transforms the local model V (r) Updated scores and global model V (r) Packed into block B (r) After that, it will be submitted to the rth federal training committee for verification, including:

[0039] The proposer transforms the local model V j (r) Updated scores and global model V (r) Packed into block B (r) , and initiate a (r) vote;

[0040] The global model V after any committee member s judges the aggregation (r) With block B (r) The global model V in (r) In case of unanimity, vote for the proposer;

[0041] Within the specified time, a set number of committee members have the right to vote on block B. (r)When the verification is passed, the block B is identified (r) Valid; wherein, within the specified time, block B (r) If the number of committee members who have passed the verification does not reach the set number, the proposer will be re-elected to change the local model V j (r) Updated scores and global model V (r) Pack;

[0042] The proposer will block B (r) Write to the blockchain and block B (r) Confirmed as the new state of the network;

[0043] Committee members on Block B (r) Broadcast to the entire network and synchronize the ledger of the entire network.

[0044] A federated learning system based on a committee consensus protocol of blockchain, the system comprising:

[0045] Task publisher, used to (0) Create Genesis Block B (0) ;

[0046] Federated learning participants, used to obtain (r-1) Get the global model V (r-1) Then, use the local dataset to train the global model V (r-1) , and the local model V j (r) The corresponding gradient updates are shared with the committee members of the r-th federated training; where j is a positive integer;

[0047] Verification device, used to obtain the block B (r-1) Get the global model V (r-1) Then, use the local dataset to train the global model V (r-1) , and the local model obtained The corresponding gradient updates are shared with the committee members of the r-th federated training;

[0048] Blockchain nodes, for node-based weighting Elect the committee for the rth federated training; where i is a positive integer and the weight of the node It is the ratio of the number of tokens held by the node to the sum of all tokens in the network; the committee members are based on the local model and local model V j (r) The corresponding gradient is updated to generate the global model V (r) And create block B (r) And update the node weights

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

[0050] The present invention introduces blockchain technology into federated learning and proposes a federated learning system based on a committee consensus protocol of blockchain. The present invention combines the characteristics of decentralization and data privacy protection of blockchain, proposes a committee consensus mechanism based on proof of equity, and realizes the decentralization and data privacy protection of the federated learning system by electing a committee to replace all nodes, effectively solving the single point failure problem in traditional federated learning. In the construction of a federated learning model based on blockchain, the present invention proposes a gradient similarity security aggregation algorithm based on secret sharing in combination with the committee consensus mechanism of blockchain to address the Byzantine attack of malicious adversaries and privacy leakage during training. In response to the problem of malicious user poisoning in federated learning, the present invention utilizes the committee mechanism of blockchain, and the committee members perform gradient similarity analysis on the local model of the participant and the verification model, thereby scoring the local model, and aggregating the global model according to the score of the local model, preventing malicious participants from submitting erroneous or malicious model updates, and improving the accuracy of the global model. The present invention uses the smart contract of blockchain to realize the incentive mechanism for the devices in the system, and rewards different tokens for the different contributions of the participants and nodes in the blockchain in the system. Adopting blacklist mode: If a device is kicked out of the system due to improper behavior, the device will be denied access to on-chain data. The publication and access control of models through smart contracts proposed in this invention can realize the on-chain use and audit of model usage, and can also support the paid use of models based on model usage records. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 Block diagram of a federated learning system with a blockchain-based committee consensus protocol.

[0052] Figure 2 Flowchart of the federated learning approach for blockchain-based committee consensus protocol.

[0053] Figure 3 A block structure diagram for storing the global model.

[0054] Figure 4 It is a committee encryption sorting algorithm in the blockchain-based committee consensus protocol.

[0055] Figure 5 Diagram of the implementation steps for privacy protection in blockchain-based committee consensus protocols.

[0056] Figure 6 A schematic diagram of the structure of the communication and protocol interaction device supporting the remote federated learning network. DETAILED DESCRIPTION

[0057] The present invention is further described in detail below in conjunction with specific embodiments. The given examples are only for illustrating the present invention, but not for limiting the scope of the present invention.

[0058] In order to solve multiple problems in federated learning, such as single point failure, lack of incentive mechanism, Byzantine attack by malicious adversaries and privacy leakage during training, the present invention designs and proposes a federated learning system based on blockchain committee consensus protocol. Figure 1 The overall structure of the system is described. First, the participants and miners apply for registration with the task publisher. The task publisher creates a genesis block based on the registration information and distributes it to all participants for model initialization. At this point, the system starts normal training. First, the committee is elected. Miners in the blockchain network sign up to participate in the committee election. Encrypted lottery is performed based on the number of miners' tokens, which can effectively prevent witch attacks. Secondly, the participants and verification devices train the global model on the local data set, and after a certain number of iterations, the local model update is obtained. The local model update is normalized and then secretly shared with the committee members, which can prevent malicious adversaries from conducting privacy attacks. Subsequently, the committee members use Beaver triples to implement the secret multiplication of gradient update normalization, and calculate the result Relu function to obtain the score of the participant's local model. Next, the proposer is elected from the committee. The proportion of the sum of the number of tokens is calculated based on the number of tokens of the committee members as the election probability to select the proposer from them and be responsible for creating a new block. The proposer calculates the global model using weighted aggregation based on the model scores of the participants, packages the global model and local model scores into a new block, and broadcasts it to the committee members for verification. Finally, block verification and consensus, after receiving the proposer's block, the committee members will verify it to ensure that the transactions in the block are valid and there are no duplicate or conflicting transactions. Once the verification is passed, the committee members will broadcast the block to other members of the committee to reach a wider consensus. Once more than 2 / 3 of the members accept and verify the block, the block is considered to have reached a consensus and is added to the new block. The participants and verification devices obtain the global model from the new block and start a new round of training until the model converges or the maximum number of training rounds is reached.

[0059] Figure 2 The present invention is a flow chart of a federated learning method based on a committee consensus protocol of a blockchain, and the federated learning method based on a committee consensus protocol of a blockchain includes the following steps.

[0060] Step S1: The task publisher uses the global model V (0) Create Genesis Block B (0) .

[0061] The task publisher of the present invention publishes the feature space required for model training as well as the format and scale requirements of the features. Participants and all nodes with data in the same feature space apply for registration with the task publisher. The task publisher allocates a public key and a private key for signing and creates a genesis block according to the training task.

[0062] In one embodiment, the task publisher uses the global model V (0) Create Genesis Block B (0) Including the following contents.

[0063] First, the task publisher publishes the feature space and feature format and scale requirements required for model training, and the participants and all nodes with data in the same feature space apply to register with the task publisher. Before the participants register, they preprocess the local data set according to the data features published by the task publisher to ensure that the format and scale of the features are consistent.

[0064] Next, when registering, participants need to indicate that they choose local data in the source data upload function, confirm the version number, select the data type, data group, local data set size, and add data description, generate a data list, and upload a smaller local data set as a verification data set. The data list can be used to authorize and delete data.

[0065] The task publisher will assign keys to participants and nodes, including public and private keys for signing. The platform publisher maintains a blacklist to record participants who have uploaded incorrect local models multiple times, privately disseminated global models, and other behaviors.

[0066] Finally, the task publisher creates a genesis block based on the training task and broadcasts it to all registered participants and nodes for model initialization.

[0067] like Figure 3 As shown, the genesis block mainly contains the following information:

[0068] Model initialization parameters w0 and current training round number r;

[0069] Public key pk used for signing;

[0070] The size of local datasets of all participants n j , 1≤j≤K, K is the total number of participants;

[0071] The initial number of tokens for all participants and nodes;

[0072] Random Numbers To ensure the randomness of the election committee, each round of training will be based on the random number of the r-1 round of training. Generate the random seed used for the election in round r i is the number of the node.

[0073] Step S2: Based on the weight of the node Elect the committee for the rth federated training; where i is a positive integer and the weight of the node It is the ratio of the number of tokens held by the node to the sum of all tokens in the network.

[0074] The present invention is based on a verifiable cryptographic random committee election mechanism based on proof of stake. The cryptographic sorting algorithm is implemented using a verifiable random function (VRF). Each miner has a weight that is proportional to the number of tokens it holds. A certain number of nodes are selected from all miners as the committee. This can ensure fairness and unpredictability to prevent manipulation and attacks. Miners in the blockchain network sign up to participate in the committee election, and then execute the committee election mechanism. In order to ensure randomness in the election of the committee, a Figure 4 The encrypted random sorting algorithm shown adopts the PoS election method. Among all miners holding tokens, a certain number of nodes are randomly selected as new members of the committee according to the number of coins owned by the miners. The committee S is elected according to the number of tokens held by the miners. The more tokens held, the greater the probability of being selected.

[0075] In one embodiment, the election of the committee is achieved through the following steps.

[0076] Step 2.1: Initialization.

[0077] Assume that node m i The number of tokens is a i , the total number of tokens of all nodes is N is the total number of nodes. Then the weight of each node is It represents the ratio of the number of tokens held by the node to the sum of all tokens in the network. i Calculate an election probability Used to determine the probability of each node being selected in the lottery. i According to your own weight w i , do w i The miners draw lots a total of W times.

[0078] Step 2.2: Calculate the Verifiable Random Function (VRF) for the lottery.

[0079] In each round r, the node obtains the information of the previous block and calculates a random number. Then, the seed for the current round of training is obtained based on the random number. Next, each node uses its private key and the seed for the current round of training as input to calculate its VRF value. The output of the verifiable random function includes a hash value and a proof. This hash value will determine whether the node will be selected as a committee member.

[0080] Step 2.3: Generate lottery results.

[0081] The node converts the random value into a decimal between 0 and 1. Then, based on this decimal and a pre-set probability p (related to the sum of the weights of the expected choices), it determines whether it is selected.

[0082] Specifically, the interval [0,1) is divided into continuous parts of the form j∈{0,1,…,N}. If In interval I j Then node m i There are j selected sub-users, and the priority of the node is expressed according to the number of selected sub-users. By executing the above process, a node list sorted by random number size is generated. According to the result of the encrypted sort, a fixed-size committee S is selected from the sorted list. Miners can verify its priority through proof. The miner with the highest priority in the encrypted sort result is the proposer leader, who is responsible for generating new blocks. After the committee is selected, it will be broadcast to all miners in the network.

[0083] Step 2.4: Publish the results.

[0084] The selected miners (i.e. committee members) will publish their random values ​​and proofs. This information is propagated through the network so that other nodes can verify the validity of the election.

[0085] Step S3: Verify that the device and federated learning participants receive data from Block B (r-1) Get the global model V (r-1) Then, use the local dataset to train the global model V (r-1) , and the local model obtained and local models The corresponding gradient updates are shared with the committee members of the r-th federated training; where j is a positive integer.

[0086] The participants and verification devices of the present invention obtain the global model on the new block from the associated miners, and use the local data set to train the global model, obtain the local model update after n iterations, normalize the model update, and use the secret sharing technology to share the gradient update with the committee members. Among them, this step can also use the efficient collaborative mechanism of dynamic adjustment of communication status to dynamically adjust the optimization times of the local federation node, realize the increase and decrease control of the interaction frequency through the node iteration number, and improve the efficiency of federation communication.

[0087] In the preferred technical solution provided by the present invention, the step 3 comprises the following steps:

[0088] Step 3.1: The task publisher creates a verification device and obtains a verification model update by training the global model built in the previous round using the verification data set collected during registration, which is used to score the local model of the participant. The verification device d0 uses the verification data set test to execute the local model training algorithm provided by the task publisher. Training the verification model update for round r Updates to the validation model Perform regularization. Use the SPDZ framework to implement secret sharing technology. The secret is shared with committee member S.

[0089] Step 3.2: Party d j Obtain the latest global model from the blockchain, and also execute the task publisher’s local model training algorithm, and obtain the local model update by using the local data set. i The gradient is updated and normalized and will The secret is shared with committee member S.

[0090] Step S4: Committee members based on local models and local models The corresponding gradient is updated to generate the global model V (r) And create block B (r) And update the node weights Then, execute again from step S2.

[0091] In the preferred technical solution provided by the present invention, step S4 comprises the following steps:

[0092] Step 4.1: Aggregation of the global model.

[0093] The committee members use cosine similarity to score the local model updates uploaded by the participants based on the local model updates uploaded by the verification device. In this process, the committee members use secret shared multiplication to calculate the score, which can effectively prevent the nodes of semi-honest adversaries from inferring the local data privacy of the participants based on the model, and weightedly aggregate them into a global model based on the score, which can prevent malicious adversaries from uploading malicious models and destroying the aggregation of the global model, thereby improving the Byzantine robustness of the system and realizing Byzantine attack defense based on the committee consensus mechanism.

[0094] Step 4.1.1: All members of the committee will hold a secret share of the validation model updates and the participant model updates.

[0095] Each committee member S will receive and The verification client acts as a third party to provide the Beaver triplet (a, b, c) for the committee members to perform secret shared multiplication. Figure 5 As shown in the algorithm, each committee member will obtain

[0096] Step 4.1.2: The committee calculates the cosine similarity between the participant model update and the verification model update, and uses the ReLu function to score the participant model update. The committee uses the SPDZ protocol to implement Beaver triples to calculate the multiplication secret sharing of the participant model update and the verification model update, and broadcasts the calculated secret multiplication share. All committees will recover the cosine similarity of each model update. The model update is scored using the ReLu function. If the direction of the participant's model update is close to the angle of the verification model update but less than 90 degrees, the model score will be greater than 0, but it will also seriously affect the global model. Therefore, a threshold v is set to judge whether the participant participates in the aggregation of the global model in this round.

[0097] Specifically, committee members broadcast their secret shares to other committee members, and all committee members will obtain the cosine similarity of each local model update After that, find the participant d i The score of the local model update i =ReLU(c i ). If the local model update direction is close to the angle of the verification model update but less than 90 degrees, the model score i will be greater than 0, but it will also seriously affect the global model, so we will set a threshold v. If the model updates the score score i If it is less than ν, the model will not be used for updating in this round of aggregation.i If the verification result fails for multiple rounds, it will be judged as malicious.

[0098] Step 4.2: Select a proposer.

[0099] The committee members execute the election algorithm to select the proposer leader from the committee. The proposer determines the participants based on the local model score. i Is it a malicious device and executes the security aggregation algorithm w=w+ag. Find the aggregated global model G.

[0100] The proposer performs weighted aggregation on the scores of the local models of the participants to obtain the global model, which can maximize the guarantee that the local model of the malicious adversary has the least impact on the global model.

[0101] Step 4.3: Block verification.

[0102] The proposer packages the updated scores of each participant's local model and the aggregated global model into a new block, and broadcasts the block to other committee members for verification. After receiving the proposer's block, the committee members first verify whether the block signature is legal, then verify the identity of the proposer, and finally judge the score of each participant in the proposal and the global model, including the scores of the local models of different participants and the global model parameters. Once the verification is passed, the committee members will broadcast the block to other committee nodes. Within a certain period of time, if the proposer receives verification from more than 2 / 3 of the committee members, the block will be deemed valid.

[0103] In a preferred embodiment, the proposer leader packages the scores of all model updates and the global model into a new block and votes on the proposed block. i Responsible for verifying the new blocks generated by the proposed leader. Its main tasks include checking whether the signature of the gradient update in the block is legal, the score of the participant's model update, and whether the global model w is correct. i Contains each participant d i If the scores are consistent, the committee members s i It will determine whether the aggregated global model w is consistent with the global model of the proposer leader. If the check result is consistent with the global model in the block, if so, vote for the proposer leader.

[0104] Step 4.4: Block consensus.

[0105] Within the specified time, only if more than 2 / 3 of the committee members have verified the block, the block will be deemed valid. If the block is verified, the proposer leader and the validators in the committee will be rewarded with a certain number of tokens as mining rewards. If it fails to pass the verification, the proposer will be re-elected from the committee, and the proposer will be re-elected and the block will be re-verified. This ensures that the majority of committee members reach a consensus on the validity of the proposal, even if there are a certain number of Byzantine nodes in the network. This process ensures the security and consistency of the blockchain and encourages members of the verification committee to actively participate in the verification process to obtain rewards.

[0106] Once a majority of committee members agree to the proposal, the block is written into the blockchain and confirmed as the new state of the network. Figure 3 As shown, it includes the hash value of the previous block, the random number nonce, which is used to ensure the randomness of the election committee during the committee election, the global model of this round, the score updated by each model indicating whether the local model is malicious, and the signature of each vote by the committee members, which ensures the legitimacy and validity of the new block.

[0107] Step 4.5: The block is finally confirmed and broadcast.

[0108] After the block proposed by the proposer is verified to be valid, the corresponding proposer and verifier will obtain a certain number of tokens from the blockchain as mining rewards. After that, each verifier of the committee executes the Gossip protocol to broadcast the new block to neighbors and synchronize the ledger of the entire network. Among them, the present invention deploys an incentive mechanism in the smart contract to provide block verification incentives, proposed block incentives, model scoring incentives, etc. to committee members and proposers, thereby improving the enthusiasm of nodes.

[0109] Step 5: After the set conditions for federated learning are met, the final global model V is obtained.

[0110] The present invention can use blockchain to record the intermediate parameters of the model training process as audit traceability evidence, and incentivize collaborative nodes to verify model parameters, punish participating nodes that upload false parameters or low-quality models, constrain node selfishness, and improve the quality of model aggregation.

[0111] Figure 6 A schematic diagram of the structure of a communication and protocol interaction device supporting a remote federated learning network is shown, and its core components include:

[0112] 1. Communication service component: This component is responsible for handling communication tasks with the remote federated learning network and supports multiple protocols including gRPC, HTTP, and gateway services. In order to reduce the exposure of service information and simplify the call of training services, this device introduces a gateway service, which is responsible for routing and forwarding requests from external systems.

[0113] 2. Proxy component: Nginx is used to implement this component. This component is mainly responsible for scheduling user tasks, including parsing configuration parameters and coordinating the entire training task. By adopting the responsibility chain pattern in the design pattern, the proxy component can decompose complex training tasks into multiple responsibility chains and effectively submit them to the task thread pool for execution.

[0114] 3. Visualization Workbench: Provides an interactive interface that allows users to intuitively design modeling processes and multi-party secure computations. The workbench supports visualization of advanced functions such as federated learning.

[0115] 4. Machine learning service component: provides a variety of federated learning algorithms to support different data security and privacy protection requirements.

[0116] 5. API service component: The API call interface is released to the outside world in the form of a software development kit (SDK), so that external systems can obtain the interface address through the service discovery mechanism and call it to perform prediction tasks.

[0117] 6. Storage service component: This component includes a variety of storage solutions such as HDFS, Mysql, and Redis, which are used to store prediction results and model parameters. This storage strategy not only improves efficiency, but also ensures that the model does not need to be reloaded from the distributed storage system for each inference request, thereby enhancing data security and system performance.

[0118] The platform device of the present invention combines advanced data security technology, efficient communication mechanism and flexible task scheduling strategy to provide a reliable experimental and application environment for federated learning. In this way, researchers and developers can perform efficient data analysis and model training while protecting data privacy against Byzantine attacks.

[0119] It can efficiently and objectively perform CT scanning, image denoising, semantic segmentation, 3D modeling and 3D printing on molded fossils.

[0120] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology in this field to understand the content of the present invention and implement it, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A federated learning method based on a blockchain-based committee consensus protocol, characterized in that: The method comprises: Step S1: The task publisher uses the global model V (0) Create Genesis Block B (0) ; Step S2: Based on the weight of the node Elect the committee for the rth federated training; where i is a positive integer and the weight of the node It is the ratio of the number of tokens held by the node to the sum of all tokens in the network; Step S3: Verify that the device and federated learning participants receive data from Block B (r-1) Get the global model V (r-1) Then, use the local dataset to train the global model V (r-1) , and the local model obtained and local model V j (r) The corresponding gradient updates are shared with the committee members of the r-th federated training; where j is a positive integer; Step S4: Committee members based on local models and local model V j (r) The corresponding gradient is updated to generate the global model V (r) And create block B (r) And update the node weights Then, execute again from step S2; Step S5: After the set conditions for federated learning are met, the final global model V is obtained.

2. The method according to claim 1, characterized in that The node-based weight W i (r) , elects the rth federal training committee, including: The number of committee members τ and the weight of each node based on the r-th federated training Calculate the election probability of the node According to the random number of the previous round of training Generate random seeds Combine the private key of each node with the random seed Enter the verifiable random function to get a random number and a proof; Each node sends the random number Convert it to a decimal between 0 and 1 and use the decimal and the probability of election to determine the winner. Determine whether the node becomes a member of the committee for the rth federation training; When a node becomes a member of the committee of the rth federated training, the random number is published With the said proof, other nodes can verify the validity of the election.

3. The method according to claim 1, characterized in that Verify that the device is from block B (r-1) Get the global model V (r-1) Then, use the local dataset to train the global model V (r-1) , and the local model obtained The corresponding gradient updates are shared with the committee members of the r-th federated training, including: The verification device uses the local data set to execute the local model training algorithm provided by the task publisher to train the global model V (r-1) , get the gradient update Among them, the local dataset of the verification device is constructed based on the local datasets of each federated learning participant; Update the gradient Regularize and get the regularized result Update according to the gradient And the regularization result Generate Secret Use the SPDZ framework to implement secret sharing technology and share secrets Share it with the committee members so that each r-th committee member s gets the secret A secret share of 4. The method according to claim 3, characterized in that Committee members based on local models and local model V j (r) The corresponding gradient is updated to generate the global model V (r) V (r) And create block B (r) And update the node weights include: Each committee member s broadcasts its secret share [z] to other committee members, so that each committee member s obtains a local model V based on all secret shares [z]. j (r) Updated cosine similarity Among them, the secret share represents the participant d in the rth federated training j The local model V was shared with the committee members j (r) Secret share for gradient updates; According to the cosine similarity Calculate the local model V j (r) Updated score to determine whether to select the local model V in the aggregation process of the rth federated training j (r) ; Select a proposer from the committee members and make the proposer perform the selected local model V j (r) Aggregate and get the global model V (r) ; The proposer transforms the local model V j (r) Updated scores and global model V (r) Packed into block B (r) After that, it will be submitted to the rth federal training committee for verification; Waiting for the rth federation training committee to confirm block B (r) After that, the committee members are incentivized based on the model scores, block proposals, and block verifications in the rth federated training, and the weights of the corresponding nodes are updated.

5. The method according to claim 4, characterized in that According to the cosine similarity Calculate the local model V j (r) Updated score to determine whether to select the local model V in the aggregation process of the rth federated training j (r) ,include: Calculate the local model V j (r) Updated ratings Set a threshold v; In the rating When the value is less than the threshold v, the corresponding local model V is not selected in the aggregation process of the rth federated training. j (r) ; In the rating When the value is greater than the threshold v, the corresponding local model V is selected during the aggregation process of the rth federated training. j (r) .

6. The method according to claim 4, characterized in that The proposer selects the local model V j (r) Aggregate and get the global model V (r) ,include: Based on the selected local model V j (r) The corresponding secret share Recover the secret According to the recovered secret With local model V j (r) The updated score performs security aggregation and obtains the gradient g r ; Based on the gradient g r For the global model V (r-1) Update and get the global model V (r) .

7. The method according to claim 4, characterized in that The proposer transforms the local model V j (r) Updated scores and global model V (r) Packed into block B (r) After that, it will be submitted to the rth federal training committee for verification, including: The proposer transforms the local model V j (r) Updated scores and global model V (r) Packed into block B (r) , and initiate a (r) vote; The global model V after any committee member s judges the aggregation (r) With block B (r) The global model V in (r) In case of unanimity, vote for the proposer; Within the specified time, a set number of committee members have the right to vote on block B. (r) When the verification is passed, the block B is identified (r) Valid; wherein, within the specified time, block B (r) If the number of committee members who have passed the verification does not reach the set number, the proposer will be re-elected to change the local model V j (r) Updated scores and global model V (r) Pack; The proposer will block B (r) Write to the blockchain and block B (r) Confirmed as the new state of the network; Committee members on Block B (r) Broadcast to the entire network and synchronize the ledger of the entire network.

8. A federated learning system based on a blockchain committee consensus protocol, characterized in that: The system comprises: Task publisher, used to (0) Create Genesis Block B (0) ; Federated learning participants, used to obtain (r-1) Get the global model V (r-1) Then, use the local dataset to train the global model V (r-1) , and the local model V j (r) The corresponding gradient updates are shared with the committee members of the r-th federated training; where j is a positive integer; Verification device, used to obtain the (r-1) Get the global model V (r-1) Then, use the local dataset to train the global model V (r -1) , and the local model obtained The corresponding gradient updates are shared with the committee members of the r-th federated training; Blockchain nodes, for node-based weighting Elect the committee for the rth federated training; where i is a positive integer and the weight of the node It is the ratio of the number of tokens held by the node to the sum of all tokens in the network; the committee members are based on the local model and local model V j (r) The corresponding gradient is updated to generate the global model V (r) And create block B (r) And update the node weights

Citation Information

Cited By

  • Longitudinal federation joint reasoning method and system based on privacy protection and storage medium

    CN120579636A

  • Industrial internet-oriented secret-state federal learning method and system based on risk adaptive consensus

    CN121562859A