A security aggregation and model pruning method and system based on a multi-level alliance chain

CN116896438BActive Publication Date: 2026-10-16ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310477652.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-28
Publication Date
2026-10-16
Estimated Expiration
2043-08-28

AI Technical Summary

Technical Problem

[0003]针对现有技术的不足,本发明内容要解决的问题是如何在较小的通信复杂度下,安全地利用分布在各个节点的数据完成联邦模型训练并对各方的模型贡献做出合理评估

Benefits of technology

[0027]The beneficial effects of this invention are as follows: This invention proposes a secure aggregation and model pruning method based on a multi-level consortium blockchain. This method uses the consortium blockchain as a trust infrastructure to ensure the transparency, openness, and traceability of the aggregation process and contribution evaluation. Homomorphic encryption technology is used to protect the privacy and security of gradient information during model training. Based on the idea of ​​Shapley marginal contribution, a contribution evaluation and model pruning mechanism is designed and executed transparently on smart contracts, realizing a fair and trustworthy distribution of benefits among the participants and ensuring the aggregation quality of the global model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116896438B_ABST
    Figure CN116896438B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on multi-level alliance chain's security aggregation and model pruning method and system.Combining privacy computing method, important aggregation process in federal learning can be provided with the security guarantee of private data and the transparent and open traceability of contribution evaluation benefit distribution using the infrastructure of building trust of alliance chain, the model architecture of scheme designs two layers of alliance chain, and the lower level alliance chain is mainly used for the encrypted aggregation of the gradient contribution of each data holding node local iteration, and the higher level alliance chain is mainly used for the model parameter aggregation of each interest party of alliance and contribution evaluation.The algorithm and dataset information of each round evaluation are recorded in chain, and any member can submit manual audit according to data declaration if having any question to evaluation result, and reevaluation of this round contribution is applied.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of privacy data protection, and in particular to a secure aggregation and model pruning method and system based on a multi-level consortium blockchain. Background Technology

[0002] With the immense value of data-driven models and increasing awareness of privacy protection, data flow faces increasingly stringent restrictions, and model training based on massive datasets is becoming increasingly costly. Federated learning aims to collaboratively build machine learning models by leveraging the value of data distributed across various nodes, while fully protecting the data security of all stakeholders in the consortium. However, even a naive federated learning approach carries a significant risk of privacy breaches. A series of studies have shown that it is possible to infer some information from the privacy-sensitive training data from the gradient information or model parameters shared within the consortium. To address these privacy risks, the Google team proposed a semi-honest aggregation security model for horizontal federated learning and a secure aggregation protocol based on secret sharing. However, since all participating nodes need to negotiate keys pairwise, and a double masking mechanism is introduced to handle client disconnection, this secure aggregation protocol has high communication complexity. In addition, some studies have used differential privacy to protect local gradients. Although it can achieve the same computational and communication efficiency as plaintext, the degree of noise addition is difficult to control. Too little noise may have very limited protection for privacy data, while too much noise may damage the quality of the aggregated model results. Therefore, there is an urgent need for a technical solution that can achieve the same number of communication rounds complexity as plaintext and provide better integrity protection for the model aggregation results. Summary of the Invention

[0003] In view of the shortcomings of the existing technology, the problem to be solved by the present invention is how to securely use data distributed across various nodes to complete federated model training and make a reasonable evaluation of the model contributions of each party with relatively low communication complexity.

[0004] The objective of this invention is achieved through the following approach:

[0005] A secure aggregation and model pruning method based on a multi-level consortium blockchain, comprising the following steps:

[0006] (1) Global parameter initialization:

[0007] The alliance determines the model, training method, and initialization parameters and publishes them to the first-level alliance chain. The equity node AN downloads the initialization parameters from the chain and publishes them to its second-level alliance chain. The data node DN in the second-level alliance chain can directly download the initialization parameters from the second-level alliance chain.

[0008] (2) The second-level consortium blockchain performs local model training and cryptographic gradient homomorphic aggregation:

[0009] The equity node AN generates a homomorphic key and designates a specific data node as the aggregation node for training. The aggregation node collects the cryptographic model parameters of each data node and performs homomorphic aggregation operations. After decrypting the cryptographic model parameters of one round of aggregation, the equity node publishes them to the secondary consortium blockchain. Data nodes in the secondary consortium can update their parameters and perform a new round of training and aggregation. After the aggregation results converge, the equity node terminates the current round of secondary consortium training and uploads the converged aggregation results to the primary consortium blockchain.

[0010] (3) Smart contracts perform contribution evaluation and model pruning:

[0011] The FedContract smart contract running on the primary consortium blockchain is responsible for evaluating the contribution and aggregating and pruning the model parameters trained on the secondary consortium blockchain uploaded by the ANs of the equity nodes. The FedContract specifies the evaluation algorithm and the index of the verification dataset, and the specific evaluation calculations are completed by the verification nodes and submitted to the smart contract. Based on the evaluation results, the FedContract selects the share of the well-evaluated model to update the global model, and updates the contribution value of each AN of the equity nodes based on the quality of the uploaded model shares.

[0012] Further, in step (2), the aggregation node collects the encryption model parameters of each data node DN and performs homomorphic aggregation operations, specifically including the following sub-steps:

[0013] (2.1) The coordinating node AN publishes the initial parameters of the model and the training method to its secondary consortium chain, and uses the training parameters of the previous round as the seed of the pseudo-random function to select a data node in the secondary consortium as the homomorphic aggregation operation node for this round, and publishes the Paillier homomorphic public key used for this round of secure aggregation.

[0014] (2.2) The data node DN trains the model using local data according to the published model parameters and training method, and encrypts the gradient share obtained by training using the homomorphic public key published on the chain, and sends the encrypted share to the aggregation operation node.

[0015] (2.3) After receiving the encrypted share from other data nodes, the aggregation operation node performs a homomorphic addition operation with its own encrypted share to obtain the encrypted aggregation result, and sends the encrypted aggregation result to the coordinating node;

[0016] (2.4) The coordinating node AN uses the paillier homomorphic private key to decrypt the aggregation result and publishes the aggregation result of this round on the secondary consortium chain;

[0017] Furthermore, the contribution assessment and aggregation pruning include the following steps:

[0018] (3.1) The equity node AN submits the model parameters obtained by the secure aggregation of its secondary consortium chain to the smart contract;

[0019] (3.2) After collecting a certain number of model parameters, the smart contract FedContract selects an appropriate evaluation scheme based on the number of participants. When the number of participants is less than 5, the TMC-Shapley scheme is selected to evaluate the contribution of each participant. When the number of participants exceeds 5, the LOO-Shapley scheme is selected to evaluate the contribution of each participant.

[0020] (3.3) The verification node EN downloads the evaluation parameters from the smart contract FedContract, extracts the specified verification dataset for evaluation calculation, publishes the verification dataset for this evaluation, and submits the evaluation results to the smart contract;

[0021] (3.4) The smart contract FedContract updates the contribution values ​​of the participants based on the evaluation results, performs pruning optimization on this model update, and updates the global model.

[0022] A secure aggregation and model pruning system based on a multi-level consortium blockchain, comprising the following modules:

[0023] Module composition: A primary consortium blockchain composed of nodes AN representing various stakeholders;

[0024] Evaluation and Update Module: The first-level consortium blockchain is responsible for collecting the share of each participant in each round of iteration, obtaining evaluation result records through a specified evaluation algorithm, and finally uploading the model update parameters and participant contribution values ​​to the smart contract FedContract.

[0025] Download computation module: Manages and maintains the validation dataset, downloads gradient shares from the contract, and computes the evaluation node EN for the specified evaluation algorithm.

[0026] Mounting Module: Mounted on the secondary consortium chain consisting of the data nodes (DNs) of the same data rights holder under the primary consortium chain; the secondary consortium chain achieves secure homomorphic aggregation between the data nodes through three rounds of communication, and then the primary consortium chain node decrypts the secondary aggregation result and uploads it to the primary consortium chain smart contract, where the contract and the evaluation node conduct a public and transparent contribution evaluation.

[0027] The beneficial effects of this invention are as follows: This invention proposes a secure aggregation and model pruning method based on a multi-level consortium blockchain. This method uses the consortium blockchain as a trust infrastructure to ensure the transparency, openness, and traceability of the aggregation process and contribution evaluation. Homomorphic encryption technology is used to protect the privacy and security of gradient information during model training. Based on the idea of ​​Shapley marginal contribution, a contribution evaluation and model pruning mechanism is designed and executed transparently on smart contracts, realizing a fair and trustworthy distribution of benefits among the participants and ensuring the aggregation quality of the global model. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of a two-level consortium blockchain architecture;

[0029] Figure 2 A flowchart for secure aggregation of secondary consortium blockchains;

[0030] Figure 3 A flowchart for the aggregation evaluation of a primary consortium blockchain;

[0031] Figure 4 A flowchart for the contract method modelSubmit;

[0032] Figure 5 A flowchart for the contract method evaluationSubmit;

[0033] Figure 6 A schematic diagram illustrating the proof of ProofOfConvergence for gradient convergence. Detailed Implementation

[0034] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0035] like Figure 1 As shown, this invention implements a secure federated learning system based on a multi-level consortium blockchain. The two-level consortium blockchain includes a first-level consortium blockchain composed of various stakeholders and a second-level consortium blockchain composed of each stakeholder and its subordinate data nodes. Additionally, an evaluation node with access permissions to verify the dataset is provided.

[0036] (1) The consortium publishes the initial model and training method to the first-level consortium blockchain, which is then distributed by the various stakeholder nodes AN. i Download and publish to the relevant secondary consortium blockchain;

[0037] (2) Equity Node AN i In the secondary consortium blockchain, the coordinating node AN acts as the coordinator for secure aggregation. Before each round of secure aggregation begins, the coordinating node... i The parameters from the previous training round will be used as the seed for the random function, and a data node will be randomly selected as the homomorphic operation node DN for this round of safe aggregation. aggSimultaneously, it generates the homomorphic key required for secure aggregation and publishes the public key to the blockchain;

[0038] (3) Data Node DN ij Based on the model parameters and training methods published on the blockchain, the model is trained using local data. The training results are then encrypted using the homomorphic public key published on the blockchain, and the encrypted share is sent to the aggregation node DN. agg ;

[0039] (4) Aggregation operation node DN agg After receiving encrypted shares from other data nodes, it performs a homomorphic addition operation with its own encrypted shares to obtain an encrypted aggregation result, and then sends the encrypted aggregation result to the coordinating node AN. i ;

[0040] (5) Coordination node AN i The encrypted aggregation result is decrypted using a homomorphic private key, and the gradient update for this round of secure aggregation is then uploaded to the blockchain. This completes one round of secure aggregation.

[0041] (6) After multiple rounds of secure aggregation of the secondary consortium blockchain, the model gradually converges until the end of the iteration. The coordinating node records the updated parameters of the secondary consortium blockchain model training in the training log. Thus, one round of training of the secondary consortium blockchain model is completed.

[0042] (7) After each round of training of the secondary consortium blockchain model, the equity node AN i The model parameter updates are submitted to the primary consortium blockchain via the modelSubmit contract method;

[0043] (8) After collecting a certain number of model parameter updates, the smart contract FedContract selects an appropriate evaluation scheme based on the number of participants. When the number of participants is small, the evaluation scheme is set to TMC-Shapley; when the number of participants is large, the evaluation scheme is set to LOO-Shapley. In addition, all model parameter shares are used as pseudo-random number seeds to randomly select the index of the validation dataset for this evaluation;

[0044] (9) The verification node EN downloads the evaluation parameters from the contract and extracts the specified verification dataset for evaluation. After the evaluation is completed, it calculates the verification dataset for this evaluation and submits the evaluation results to the smart contract; (10) The smart contract FedContract updates the contribution values ​​of the participants based on the evaluation results, performs pruning optimization on this model update, and updates the global model.

[0045] The secure aggregation protocol, as follows: Figure 2 As shown, specifically, it includes the following sub-steps:

[0046] (2.1)ANi Randomly select an aggregation node, with the node index being Index. agg =PRF(w k-1 )mod n

[0047] (2.2)AN i Generate homomorphic key pairs {Pk paillier Sk paillier}←KeyGen(λ), and publish the public key to the blockchain;

[0048] (3.1)DN ij Gradient descent is performed using local data to calculate the batch gradient.

[0049] (3.2)DN ij Encrypt the gradient share. Send the encrypted share to DN agg ;

[0050] (4.1)DN agg Collect the encrypted share of other data nodes and start a timeout timer. If the collection of encrypted gradient shares of all members in the alliance is completed before the timeout is triggered, proceed to (4.3); if the timeout is triggered, proceed to (4.2).

[0051] (4.2)DN agg Determine whether the collected shares have reached the aggregation threshold. If the number of shares is insufficient, terminate the aggregation process abnormally. Otherwise, record the shares that have reached the threshold and the number of shares, and proceed to (4.3).

[0052] (4.3)DN agg Perform homomorphic addition on all encrypted shares and send the result to AN. i ;

[0053]

[0054] (5.1)AN i The encrypted aggregation result is decrypted using a homomorphic private key, completing one round of secure aggregation.

[0055]

[0056] (6.1) After multiple rounds of secure aggregation until the model within the secondary consortium chain converges, AN i Update the model parameters and complete one round of training for the second-level consortium model;

[0057]

[0058] (6.2) After one round of training in a secondary consortium, each data node needs to provide proof of model convergence. For example... Figure 6 As shown, the proof consists of two parts. The first part proves that the gradient share submitted in the last round converges, i.e., verifies the calculation result, which uses range proof. The second part proves that the gradient share submitted in the last round is obtained from the aggregation result of the previous round through training on local data, i.e., verifies the calculation process. Considering that the result of each round of secure aggregation is stored in the secondary consortium blockchain, data nodes cannot tamper with the submitted gradient shares. The validity of the data node training process can be verified by the calculation process of the share submitted in the last round and the share in the previous round, avoiding the need to construct zero-knowledge proofs for each round of gradient update, and greatly reducing computational overhead.

[0059]

[0060]

[0061] Contribution assessment and model pruning, the process is as follows: Figure 3 As shown, specifically, it includes the following sub-steps:

[0062] (8.1) After the contract completes the collection of participant model parameters, select an appropriate evaluation scheme based on the number of parameter shares;

[0063] set Evaluation=TMC, if len(Shares)>TMC-threshold,

[0064] else set Evaluation = LOO

[0065] (8.2) Use the model parameters as a pseudo-random number seed to randomly generate the validation set index for this evaluation.

[0066] Index sample =PRF(∑w i )mod n

[0067] (9.1) The verification node EN downloads the evaluation parameters and model parameters from the contract, extracts the current evaluation sample from the verification dataset, and executes the corresponding evaluation algorithm:

[0068] The evaluation algorithm draws on the classic theory of cooperative game theory, Shapley Value. The standard definition of Shapley Value requires enumerating all combinations of participants and calculating the marginal effect of each individual. The computational complexity increases exponentially with the number of participants, placing an excessive burden on the evaluation nodes. In this invention, a TMC-Shapley approximation of Shapley Value is used for a small number of participants. When the number of participants is large, a simple LOO approximation method is employed to further improve computational efficiency while ensuring a certain degree of fairness in the evaluation index. The flowcharts of the two evaluation algorithms are as follows:

[0069] The TMC-Shapley:

[0070] a. For a cooperative game scenario with N partners, randomly generate m permutations, with sequence number t:

[0071] π t (N), t=1,...,m;

[0072] b. For permutations π t (N), calculate the marginal contribution of each participant i joining the cooperation in turn, where v(x) is the benefit function:

[0073]

[0074] c. If the marginal effect is no longer significant, the pruning calculation in the previous step can be skipped:

[0075]

[0076] d. After m iterations, the contribution of participant i is approximated using the following formula:

[0077]

[0078] The algorithm has a time complexity of O(kN). 2 ), where k is the number of permutations generated. When the number of participants is large, the computational overhead will place a heavy burden on the evaluation work of the verification nodes. This invention designs a more efficient LOO-Shapley approximation scheme.

[0079] The LOO-Shapley:

[0080] a. For a cooperative game scenario with N partners, calculate the marginal contribution of each partner i to all other partners;

[0081] μ i =v(N)-v(i)

[0082] b uses this marginal effect portion as an approximation of the contribution of participant i:

[0083] φ i =μ i

[0084] The algorithm has a time complexity of O(N), which greatly improves efficiency compared to the TMC algorithm while ensuring the rationality of the evaluation indicators, and is suitable for scenarios with a large number of nodes.

[0085] After the evaluation algorithm is completed, the verification node EN uploads the evaluation results to the blockchain by calling evaluationSubmit, and publishes the verification dataset for this evaluation. The hash of the verification dataset is then uploaded to the blockchain.

[0086] (b 1) The smart contract FedContract executes the evaluationSubmit method to record the contribution index of each participant's model parameters submitted by the verification node;

[0087] (b2) Select the subset of shares with higher evaluation indices and update the global model.

[0088] for i in{1,...,k}top k Shares of{φ i}

[0089]

[0090] (b3) Accumulate contribution value for participants in the selected share;

[0091] (b4) Select a subset of participants with negative evaluation indices and penalize them for their contribution value.

[0092] The above embodiments are used to explain and illustrate the present invention, but not to limit the present invention. Any modifications and changes made to the present invention within the spirit and scope of the claims shall fall within the protection scope of the present invention.

Claims

1. A secure aggregation and model pruning method based on a multi-level consortium blockchain, characterized in that, The method includes the following steps: (1) Global parameter initialization: The alliance determines the model, training method, and initialization parameters and publishes them to the first-level alliance chain. The equity node AN downloads the initialization parameters from the chain and publishes them to its second-level alliance chain. The data node DN in the second-level alliance chain can directly download the initialization parameters from the second-level alliance chain. (2) The second-level consortium blockchain performs local model training and cryptographic gradient homomorphic aggregation: The equity node AN generates a homomorphic key and designates a specific data node as the aggregation node for training. The aggregation node collects the cryptographic model parameters of each data node and performs homomorphic aggregation operations. After decrypting the cryptographic model parameters of one round of aggregation, the equity node publishes them to the secondary consortium blockchain. Data nodes in the secondary consortium can update their parameters and perform a new round of training and aggregation. After the aggregation results converge, the equity node terminates the current round of secondary consortium training and uploads the converged aggregation results to the primary consortium blockchain. (3) Smart contracts perform contribution evaluation and model pruning: The smart contract FedContract, running on the primary consortium blockchain, is responsible for evaluating the contribution and performing aggregate pruning on the model parameters trained on the secondary consortium blockchain and uploaded by the equity nodes AN. The contribution evaluation and aggregate pruning include the following steps: (3.1) The equity node AN submits the model parameters obtained by the secure aggregation of its secondary consortium chain to the smart contract; (3.2) After collecting a certain number of model parameters, the smart contract FedContract selects an appropriate evaluation scheme based on the number of participants. When the number of participants is less than 5, the TMC-Shapley scheme is selected to evaluate the contribution of each participant. When the number of participants exceeds 5, the LOO-Shapley scheme is selected to evaluate the contribution of each participant. (3.3) The verification node EN downloads the evaluation parameters from the smart contract FedContract, extracts the specified verification dataset for evaluation calculation, publishes the verification dataset for this evaluation, and submits the evaluation results to the smart contract; (3.4) The smart contract FedContract updates the contribution values ​​of the participants based on the evaluation results, performs pruning optimization on this model update, and updates the global model; The FedContract specifies the evaluation algorithm and the verification dataset index. The specific evaluation calculations are completed by the verification nodes and submitted to the smart contract. Based on the evaluation results, the FedContract selects the share of the well-evaluated models to update the global model, and updates the contribution value of each stake node AN based on the quality of the uploaded model shares.

2. The secure aggregation and model pruning method based on a multi-level consortium blockchain according to claim 1, characterized in that, The aggregation node in step (2) collects the encryption model parameters of each data node DN and performs homomorphic aggregation operation, specifically including the following sub-steps: (2.1) The coordinating node AN publishes the initial parameters of the model and the training method to its own secondary consortium chain, and uses the training parameters of the previous round as the seed of the pseudo-random function to select a data node in the secondary consortium as the homomorphic aggregation operation node for this round, and publishes the Paillier homomorphic public key used for this round of secure aggregation. (2.2) The data node DN trains the model using local data according to the published model parameters and training method, and encrypts the gradient share obtained by training using the homomorphic public key published on the chain, and sends the encrypted share to the aggregation operation node. (2.3) After receiving the encrypted share from other data nodes, the aggregation node performs a homomorphic addition operation with its own encrypted share to obtain the encrypted aggregation result, and sends the encrypted aggregation result to the coordinating node; (2.4) The coordinating node AN uses the paillier homomorphic private key to decrypt the aggregation result and publishes the aggregation result of this round on the secondary consortium chain.

3. A system for performing the method according to any one of claims 1-2, characterized in that, The system includes the following modules: Module composition: A primary consortium blockchain composed of nodes AN representing various stakeholders; Evaluation and Update Module: The first-level consortium blockchain is responsible for collecting the share of each participant in each round of iteration, obtaining evaluation result records through a specified evaluation algorithm, and finally uploading the model update parameters and participant contribution values ​​to the smart contract FedContract. Download computation module: manages and maintains the validation dataset, downloads gradient shares from the contract, and computes the evaluation node EN for the specified evaluation algorithm; Mounting Module: Mounted on the secondary consortium chain consisting of the data nodes (DNs) of the same data rights holder under the primary consortium chain; the secondary consortium chain achieves secure homomorphic aggregation between the data nodes through three rounds of communication, and then the primary consortium chain node decrypts the secondary aggregation result and uploads it to the primary consortium chain smart contract, where the contract and the evaluation node conduct a public and transparent contribution evaluation.

Citation Information

Patent Citations

  • Alliance chain multistage consensus method and device and storage medium

    CN112511350A

  • Complex Internet of Things alliance chain system communication mechanism

    CN112583598A