Blockchain-based federated learning trusted sharing method and system
By introducing blockchain technology into federated learning, using smart contracts and consensus mechanisms for identity, quality, and reputation verification, and adopting on-chain and off-chain storage methods, the problem of insufficient trust in model sharing in federated learning is solved, enabling trusted transmission and storage of global model parameters, and improving the security and trustworthiness of model sharing.
Patent Information
- Application Number
- CN202611211746.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-11-24
AI Technical Summary
The existing federated learning model sharing process suffers from insufficient credibility issues, including the difficulty in verifying the true identity of participating nodes under a centralized architecture, the risk of malicious nodes forging identities or uploading low-quality model parameters, and the lack of evidence storage and integrity verification of global model parameters during the sharing process, making it difficult for participating nodes to establish mutual trust.
By combining blockchain with federated learning, smart contracts in the blockchain network are used for identity verification, quality verification, and reputation verification. Global model parameters are stored on-chain and their integrity is verified, including digital signature verification, consensus mechanism, historical verification records, and on-chain and off-chain storage mechanisms, to ensure the credibility and security of model parameters.
It effectively solves the problem of identity verification under centralized architecture, suppresses low-quality or tampered model parameters, ensures the traceability of the source of global model parameters and the verifiability of transmission and storage, and improves the credibility and security of model sharing.
Smart Images

Figure CN123159472A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of federated learning technology, and in particular to a blockchain-based trusted sharing method and system for federated learning. Background Technology
[0002] With the development of artificial intelligence technology, model training is increasingly reliant on large-scale data. However, this data is often scattered across different institutions and is difficult to aggregate directly due to privacy and data security requirements. Federated learning, as a distributed machine learning paradigm, allows participants to upload their local model parameters and have them aggregated by an aggregation node to obtain a global model without sharing their original local data. This enables collaborative modeling while protecting data privacy.
[0003] However, existing federated learning still suffers from insufficient credibility during model sharing. On the one hand, aggregation nodes typically rely on centralized architectures, making it difficult to verify the true identities of participating nodes uploading local model parameters. This poses a risk of malicious nodes forging identities or uploading low-quality, tampered model parameters to interfere with the global model. On the other hand, the global model parameters lack effective evidence preservation and integrity verification mechanisms during sharing, making it difficult to trace the source of parameters and ensure they have not been tampered with during transmission and storage, thus hindering the establishment of mutual trust among participating nodes. Therefore, improving the credibility and security of model sharing in federated learning has become an urgent technical problem to be solved. Summary of the Invention
[0004] The purpose of this invention is to provide a blockchain-based trusted sharing method and system for federated learning, which aims to solve the problem of insufficient trust in the model sharing process of existing federated learning. By combining blockchain with a multi-dimensional verification mechanism, the invention performs identity verification, quality verification, and reputation verification on participating nodes that upload local model parameters, and performs on-chain evidence storage and integrity verification on global model parameters, thereby improving the trustworthiness and security of model sharing in federated learning.
[0005] To achieve the above objectives, this invention provides a blockchain-based trusted sharing method for federated learning, applied to an aggregation node. The aggregation node is connected to a blockchain network, which also connects to multiple independent participating nodes. The blockchain-based trusted sharing method for federated learning includes:
[0006] Receive the local model parameters obtained by each participating node through training its local model based on local data and uploaded by the node.
[0007] Based on preset trusted verification rules, a set of verification results is generated according to the local model parameters;
[0008] Based on the set of verification results, the verified local model parameters are aggregated to obtain global model parameters, and the global model parameters are shared to each of the participating node through the blockchain network.
[0009] Optionally, the blockchain network is deployed with smart contracts, and the verification result set includes identity verification results. The step of generating the verification result set based on preset trusted verification rules and the local model parameters includes: obtaining digital signature information carried by the local model parameters; and calling the smart contract to verify the identity of the participating node based on the digital signature information to obtain the identity verification result.
[0010] Optionally, the step of calling the smart contract to verify the identity of the participating node based on the digital signature information and obtaining the identity verification result includes: calling the smart contract to verify the digital signature information through a single consensus node in the blockchain network, or to verify the digital signature information through consensus through various consensus nodes in the blockchain network, and obtaining the identity verification result.
[0011] Optionally, the verification result set further includes quality verification results; the step of generating the verification result set based on the local model parameters according to the preset trusted verification rules further includes: performing accuracy testing on the local model corresponding to the local model parameters according to the preset test dataset to obtain accuracy evaluation information; and performing quality verification on the local model parameters according to the accuracy evaluation information to obtain the quality verification results.
[0012] Optionally, the verification result set further includes reputation verification results; the step of generating the verification result set based on the preset trusted verification rules and the local model parameters further includes: obtaining the reputation value information of the participating node based on the historical verification records stored in the blockchain network; and performing reputation verification on the participating node based on the reputation value information to obtain the reputation verification results.
[0013] Optionally, the step of performing reputation verification on the participating node based on the reputation value information to obtain the reputation verification result includes: when the reputation value represented by the reputation value information is greater than or equal to a first reputation threshold, determining that the reputation verification of the participating node has passed, and determining the aggregate weight of the corresponding local model parameter as a first aggregate weight; when the reputation value is greater than or equal to a second reputation threshold and less than the first reputation threshold, determining that the reputation verification of the participating node has passed, and determining the aggregate weight of the corresponding local model parameter as a second aggregate weight; wherein, the first reputation threshold is greater than the second reputation threshold, and the first aggregate weight is greater than the second aggregate weight.
[0014] Optionally, the federated learning includes multiple rounds, and the blockchain-based trusted sharing method for federated learning further includes: when the local model parameters uploaded by the participating node all indicate successful verification in the verification result sets corresponding to multiple consecutive rounds, controlling the reputation value represented by the reputation value information to gradually increase; when the local model parameters uploaded by the participating node all indicate unsuccessful verification in the verification result sets corresponding to multiple consecutive rounds, controlling the reputation value to gradually decrease, and prohibiting the participating node from participating in subsequent rounds of federated learning when the reputation value is less than a preset elimination threshold.
[0015] Optionally, the step of sharing the global model parameters to each of the participating nodes through the blockchain network includes: generating corresponding hash digest information based on the global model parameters; writing the hash digest information into the on-chain storage space of the blockchain network, and storing the global model parameters in the off-chain storage space, so that each of the participating nodes can obtain the global model parameters from the off-chain storage space.
[0016] Optionally, the blockchain-based federated learning trusted sharing method further includes: when a participating node requests to obtain the global model parameters, the smart contract is invoked to verify the access rights of the participating node, and after successful verification, the storage address of the global model parameters in the off-chain storage space is returned to the participating node; when multiple participating nodes request to obtain the global model parameters, the smart contract is invoked to verify the access rights of each participating node in sequence, and the storage address is sent to each participating node that has passed the verification; wherein, the storage address is used for the participating nodes to obtain the global model parameters, and the hash digest information is used for the participating nodes to perform integrity verification on the obtained global model parameters.
[0017] The present invention also provides a blockchain-based federated learning trusted sharing system, the blockchain-based federated learning trusted sharing system comprising: a blockchain network, wherein smart contracts are deployed on the blockchain network; multiple participating nodes, each of the participating nodes being independent of each other and connected to the blockchain network, each of the participating nodes being used to train a local model based on local data to obtain local model parameters; and an aggregation node, wherein the aggregation node is connected to the blockchain network and is configured to execute the blockchain-based federated learning trusted sharing method as described above.
[0018] This invention, by combining blockchain with federated learning, addresses the problem of insufficient trust in model sharing in the prior art, achieving the following beneficial effects:
[0019] 1. By calling the smart contract deployed on the blockchain network to verify the identity of the participating nodes that upload local model parameters, and combining digital signatures and consensus mechanisms to confirm their true identity, the problem of difficulty in verifying the identity of participating nodes and easy for malicious nodes to forge identities under centralized architecture is effectively solved.
[0020] 2. By performing quality verification on local model parameters and reputation verification based on historical verification records, and determining the corresponding aggregation weights based on the reputation values, the interference of low-quality or tampered model parameters on the global model is effectively suppressed.
[0021] 3. By writing the hash digest information of the global model parameters into the on-chain storage space and storing the parameter body in the off-chain storage space, and having participating nodes perform integrity verification based on the hash digest information, the source of the global model parameters is traceable and the transmission and storage links are verifiable. This effectively solves the problems of lack of evidence storage and integrity verification in model sharing and the difficulty in establishing mutual trust among participating nodes, thereby improving the credibility and security of model sharing in federated learning as a whole. Attached Figure Description
[0022] Figure 1 A flowchart illustrating the blockchain-based federated learning trusted sharing method provided by this invention;
[0023] Figure 2 A schematic diagram of the authentication process in the blockchain-based federated learning trusted sharing method provided by this invention;
[0024] Figure 3 A schematic diagram of the reputation verification process in the blockchain-based federated learning trusted sharing method provided by this invention;
[0025] Figure 4 A schematic diagram of the structure of the blockchain-based federated learning trusted sharing system provided by the present invention.
[0026] Figure Labels
[0027] 10 blockchain networks, 20 participating nodes, 30 aggregation nodes, and 100 blockchain-based federated learning trusted sharing systems. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0029] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but must be based on what can be implemented by those skilled in the art.
[0030] To more clearly illustrate the technical solution of the present invention, the following detailed description of the blockchain-based federated learning trusted sharing method and system provided by the present invention, in conjunction with specific embodiments and accompanying drawings, is provided. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0031] This embodiment provides a blockchain-based trusted sharing method for federated learning. Before aggregation, the aggregation node verifies the local model parameters uploaded by each participating node according to preset trusted verification rules. Only the verified local model parameters are included in the aggregation, and the sharing of global model parameters is completed with the help of the blockchain network. This allows each participating node to obtain trusted global model parameters without leaving its local data, effectively reducing the interference of abnormal parameters on the global model and improving the trustworthiness and security of model sharing in federated learning.
[0032] See Figure 1 This embodiment of the blockchain-based federated learning trusted sharing method is applied to aggregation nodes. These aggregation nodes connect to a blockchain network, which also connects to multiple independent participating nodes. In practical applications, each participating node can be a server or edge computing device belonging to different institutions, such as data servers belonging to different regional power companies, or business servers belonging to different medical institutions or financial institutions. Due to privacy protection and data security requirements, the data held by each institution cannot be directly aggregated. The aggregation node can be an independently deployed server or server cluster, connected to the same blockchain network as the participating nodes. The blockchain network can be constructed in the form of a consortium blockchain. The blockchain-based federated learning trusted sharing method includes the following steps:
[0033] Step S10: Receive the local model parameters obtained by each participating node through training the local model based on local data and uploaded by the participating nodes.
[0034] Each participating node holds local data for model training and trains based on a local model with the same structure. The local model can be a conventional machine learning model such as a convolutional neural network or a multilayer perceptron. Its network structure and initial parameters are uniformly distributed by the aggregation node before training begins to ensure the aggregability of parameters trained by each participating node. Training the local model by participating nodes can be implemented using the conventional gradient descent method, where local data is input into the local model in batches, the loss is calculated based on the deviation between the model output and the sample labels, and the weights and biases of the local model are gradually adjusted in the direction of decreasing loss. After several local iterations, the adjusted weights and biases are extracted as the local model parameters. Each participating node serializes its local model parameters and uploads them to the aggregation node. Local data remains on the participating node's local machine and is not transmitted, thus ensuring data privacy. The aggregation node can set a receiving window to collect the local model parameters uploaded by each participating node and record the correspondence between each local model parameter and its source participating node for subsequent verification and aggregation.
[0035] Step S20: Based on the preset trusted verification rules, generate a set of verification results according to the local model parameters;
[0036] Pre-configured trusted verification rules are a set of verification logics pre-configured in the aggregation node. These rules are used to verify the integrity and validity of each local model parameter before aggregation. The specific composition of the verification logic can be configured and expanded according to the security requirements of the application scenario. For example, the verification logic may include one or more of the following: format and dimension verification, numerical range verification, and distribution anomaly verification. Format and dimension verification verifies whether the data format and parameter dimensions of the received local model parameters match the uniformly distributed local model structure. A mismatch indicates that the parameter was damaged during transmission or was not trained according to the agreed-upon local model. Numerical range verification verifies whether the parameter value is within a reasonable numerical range. Local model parameters with overflow values or containing a large number of invalid values are judged as invalid parameters. Distribution anomaly verification statistically analyzes the overall distribution of local model parameters within the same receiving window, judging local model parameters that significantly deviate from the overall distribution as abnormal parameters, thereby identifying tampered or abnormally trained local model parameters. The aggregation node verifies each local model parameter one by one according to the above verification logic, obtaining a verification result corresponding to each local model parameter. Each verification result indicates whether the corresponding local model parameter has passed or failed the verification. All verification results are collected to form a verification result set. The verification result set can be stored in the form of a mapping table, which records the correspondence between the node identifier of each participating node and the corresponding verification result, so as to quickly filter the local model parameters that have passed the verification in subsequent steps.
[0037] Step S30: Based on the verification result set, aggregate the verified local model parameters to obtain global model parameters, and share the global model parameters to each participating node through the blockchain network.
[0038] The aggregation node traverses the verification result set, selecting locally validated model parameters to participate in the aggregation, while locally validated but unvalidated model parameters are excluded from aggregation, thus preventing abnormal parameters from polluting the global model. In one feasible implementation, aggregation is achieved using the federated averaging method, which is common in federated learning. This involves weighting the parameter components in the same position among the validated locally validated model parameters. The weights used for weighting can be determined based on the number of samples of local data used by each participating node during training; the more samples, the greater the weight of the corresponding locally validated model parameter. The entire set of parameters obtained after weighted averaging is the global model parameter. The aforementioned federated averaging is a common aggregation method in this field, and any method that can merge multiple locally validated model parameters into a single global model parameter can be applied to this step. This embodiment does not limit the specific computational form of aggregation.
[0039] Furthermore, the aggregation node shares the global model parameters with all participating nodes through the blockchain network. The aggregation node can broadcast the sharing message of the global model parameters to all participating nodes via the blockchain network, enabling each participating node to simultaneously know that the global model parameters have been published and to obtain them accordingly. Due to the distributed ledger and immutability characteristics of the blockchain network, the sharing process is open, transparent, and traceable among all nodes. Each participating node can trace the source of the global model parameters, thus ensuring the trustworthiness of the sharing process. After obtaining the global model parameters, each participating node updates its local model with the global model parameters, thereby obtaining a trustworthy global model that integrates the knowledge of multiple parties' data, without requiring local data from any party to leave its domain.
[0040] This embodiment further illustrates the method of identity verification based on the foregoing. By deploying smart contracts in the blockchain network, the true identity of participating nodes is verified by using the digital signature information carried when they upload data. This ensures that only local model parameters uploaded by legitimate participating nodes that have been granted access registration can pass the verification, thereby blocking the path for malicious nodes to forge identities and upload parameters from the source and improving the credibility of model sharing in federated learning.
[0041] See Figure 2 The blockchain network deploys smart contracts, and the verification result set includes identity verification results. A smart contract is a pre-written and automatically executable program code deployed in the blockchain network. It pre-registers the node identifiers and corresponding public keys of each legitimate participating node, and once deployed, it cannot be tampered with and is jointly maintained by all nodes in the blockchain network. In this embodiment, the step of generating the verification result set based on preset trusted verification rules includes:
[0042] Step S21: Obtain the digital signature information carried by the local model parameters;
[0043] Before uploading their local model parameters, participating nodes first sign the parameters with their private keys to obtain digital signature information, which is then uploaded along with the parameters. Specifically, participating nodes can perform a hash operation on the local model parameters to obtain a parameter digest, and then encrypt the digest with their private keys; the encrypted result is the digital signature information. Upon receiving the uploaded data, the aggregation node parses and separates the local model parameters from the corresponding digital signature information, retaining the node identifier of the source participating node identified by the digital signature information for subsequent use when calling the smart contract.
[0044] Step S22: Based on the digital signature information, call the smart contract to verify the identity of the participating node and obtain the identity verification result.
[0045] The aggregation node submits the digital signature information and the corresponding node identifier as input parameters to the blockchain network, triggering the execution of the smart contract. The smart contract searches for the corresponding public key registered internally by the node identifier in the input parameters. If the corresponding public key is not found, it indicates that the participating node has not been authorized for registration, and authentication is directly deemed unsuccessful. If the corresponding public key is found, it decrypts the digital signature information using that public key to restore the parameter digest. Simultaneously, it re-hashes the accompanying local model parameters to obtain a verification digest, comparing the two digests: if they match, it indicates that the digital signature information was indeed generated by the private key corresponding to the node identifier and that the local model parameters have not been tampered with during transmission, and authentication is deemed successful; if they do not match, authentication is deemed unsuccessful.
[0046] Understandably, since the private key is held locally only by the corresponding participating node and is not publicly disclosed, malicious nodes cannot forge the digital signature information of legitimate nodes, nor can they pass digest comparison after tampering with local model parameters. Therefore, the above authentication can simultaneously verify the authenticity of the participating node's identity and the integrity of the local model parameters. The smart contract returns the execution result of successful or unsuccessful authentication as the authentication result to the aggregation node and includes it in the verification result set. The entire verification process leaves a traceable execution record on the chain, which cannot be unilaterally tampered with.
[0047] This embodiment further illustrates two implementation methods for smart contracts to call consensus nodes to complete verification based on identity verification. Depending on the scale and security requirements of the blockchain network, either single-node verification or multi-node consensus verification can be selected, ensuring both the credibility of identity verification and verification efficiency.
[0048] In this embodiment, the step of calling a smart contract to authenticate the participating node based on the digital signature information and obtaining the authentication result includes:
[0049] The smart contract is invoked to verify the digital signature information through a single consensus node in the blockchain network, or through consensus verification of the digital signature information through various consensus nodes in the blockchain network, to obtain the identity verification result.
[0050] A blockchain network has multiple consensus nodes, each maintaining an identical ledger and smart contract copy, capable of independently executing the authentication logic within the smart contract. When an aggregation node triggers a smart contract, it can choose to execute one of the pre-configured verification modes.
[0051] In the method of verification by a single consensus node, the blockchain network designates a consensus node to execute the smart contract. This consensus node looks up the registered public key based on the digital signature information and the corresponding node identifier, compares the signature with the digest, and directly returns its verification conclusion as the identity verification result. This method only requires the participation of a single node in the computation, has a short verification path, and a fast response time, making it suitable for scenarios with a small number of participating nodes or where each consensus node has high credibility.
[0052] In this consensus verification method where multiple consensus nodes perform verification, the digital signature information is broadcast to each consensus node. Each consensus node independently executes a smart contract to verify the signature and generates its own verification conclusion. These conclusions are then compared according to a preset consensus mechanism. When the percentage of consensus conclusions meets a preset consensus condition (e.g., more than half of the consensus nodes reach the same conclusion), this consensus conclusion is used as the identity verification result. The consensus mechanism can be implemented using conventional consensus algorithms in the field, such as Byzantine fault tolerance, and this embodiment is not limited to any particular algorithm. Understandably, this method involves cross-verification by multiple consensus nodes. Even if individual nodes fail or are maliciously controlled, a reliable identity verification result can still be obtained based on the consensus conclusion of the majority of nodes, making it suitable for scenarios with high requirements for verification reliability.
[0053] This embodiment adds a quality verification dimension on top of identity verification. It uses a preset test dataset to perform accuracy tests on the local model corresponding to the local model parameters, and verifies the quality of the local model parameters based on the accuracy evaluation information. This further filters out local model parameters with poor accuracy under the premise of legitimate identity, preventing them from lowering the performance of the global model and improving the credibility of model sharing in federated learning.
[0054] In this embodiment, the verification result set also includes quality verification results, and the step of generating the verification result set based on preset trusted verification rules further includes:
[0055] Based on the preset test dataset, perform accuracy tests on the local model corresponding to the local model parameters to obtain accuracy evaluation information;
[0056] The preset test dataset is a set of sample data with standard labels pre-stored in the aggregation node. Its sample distribution is consistent with the target distribution of the tasks performed by each participating node and is independent of the local data of each participating node to ensure the objectivity and fairness of the test results. After receiving the local model parameters, the aggregation node loads these parameters into a local model with the same structure as each participating node, obtaining a restored local model. Then, it inputs the sample data from the preset test dataset one by one into this local model to obtain the model's prediction results for each sample data. The aggregation node compares each prediction result with the standard labels corresponding to the sample data, calculates the degree of agreement, and obtains accuracy evaluation information. Understandably, the accuracy evaluation information can be characterized using conventional indicators in the art, such as accuracy rate and loss value. For example, the accuracy rate can be the ratio of the number of correctly predicted samples to the total number of test samples. A higher accuracy rate indicates better quality of the local model parameters. This embodiment does not limit the specific form of the accuracy evaluation information.
[0057] Based on the accuracy assessment information, the local model parameters are quality verified, and the quality verification results are obtained.
[0058] The aggregation node compares the accuracy assessment information with a preset quality threshold: when the accuracy represented by the accuracy assessment information reaches the preset quality threshold, the local model parameter is deemed to have passed the quality verification; when the accuracy represented by the accuracy assessment information is lower than the preset quality threshold, the local model parameter is deemed to have failed the quality verification. The conclusion of passing or failing the quality verification is included in the verification result set as the quality verification result. Understandably, when a participating node's local data is of poor quality, insufficiently trained, or has been subjected to a poisoning attack, its uploaded local model parameters often exhibit significantly lower accuracy on the preset test dataset. The above quality verification can identify and exclude such local model parameters from aggregation, preventing them from harming the performance of the global model.
[0059] This embodiment adds a reputation verification dimension on top of the aforementioned verification dimensions. It calculates the reputation value of participating nodes by using historical verification records stored in the blockchain network, and performs reputation verification on participating nodes based on the reputation value. In this way, it identifies participating nodes with long-term abnormal behavior by combining the nodes' past performance, thereby improving the credibility of model sharing in federated learning.
[0060] See Figure 3 In this embodiment, the verification result set also includes reputation verification results, and the step of generating the verification result set based on preset trusted verification rules further includes:
[0061] Step S31: Obtain the reputation value information of the participating nodes based on the historical verification records stored in the blockchain network;
[0062] Historical verification records are archived records of the verification status of local model parameters uploaded by each participating node during previous federated learning processes. Each historical verification record may include the node identifier, round identifier, and corresponding verification conclusion of the participating node. Due to the immutable nature of the blockchain network, once a verification conclusion is written, it cannot be unilaterally deleted or modified, thus ensuring the authenticity and reliability of the historical verification records. The aggregation node retrieves all historical verification records of the participating node to be verified from the blockchain network based on the node identifier and calculates its reputation value information. Understandably, the reputation value information can be obtained by statistically analyzing historical verification conclusions, for example, by representing it as the ratio of the number of times the participating node has passed verification in the past to the total number of verifications participated in. A higher ratio indicates that its past performance has been more stable and reliable, and the corresponding reputation value is higher. Alternatively, verification conclusions from nearby rounds can be given higher weight so that the reputation value better reflects the node's recent performance; this embodiment does not limit this.
[0063] Step S32: Based on the reputation value information, perform reputation verification on the participating nodes to obtain the reputation verification result.
[0064] The aggregation node compares its reputation value with a preset reputation threshold: when the reputation value reaches the preset threshold, the node's reputation verification is considered successful; when the reputation value is below the preset threshold, the reputation verification is considered unsuccessful. The verification conclusion is included in the verification result set as the reputation verification result. Understandably, while some participating nodes may pass single-time identity verification and quality verification, their reputation value will decrease if they have frequently uploaded abnormal local model parameters in the past. The aforementioned reputation verification can identify such potentially untrustworthy nodes based on their long-term performance, compensating for the inadequacy of a single verification in reflecting a node's continuous trustworthiness.
[0065] This embodiment further explains the implementation method of dividing aggregation weights based on reputation value, based on reputation verification. By setting two levels of reputation thresholds (high and low), participating nodes that have passed reputation verification are divided into tiers, and different aggregation weights are assigned to different tiers. This allows participating nodes with higher reputation to have greater say in the aggregation of their uploaded local model parameters, thereby giving full play to the contribution of high-quality nodes while ensuring credibility, and improving the quality and credibility of the global model.
[0066] In this embodiment, the step of verifying the reputation of participating nodes based on reputation value information and obtaining the reputation verification result includes:
[0067] When the reputation value represented by the reputation value information is greater than or equal to the first reputation threshold, the reputation verification of the participating node is deemed to have passed, and the aggregate weight of the corresponding local model parameter is determined to be the first aggregate weight.
[0068] When the reputation value is greater than or equal to the second reputation threshold and less than the first reputation threshold, the reputation verification of the participating node is deemed to have passed, and the aggregation weight of the corresponding local model parameter is determined to be the second aggregation weight.
[0069] Among them, the first reputation threshold is greater than the second reputation threshold, and the first aggregation weight is greater than the second aggregation weight.
[0070] The aggregation node pre-sets a first reputation threshold and a second reputation threshold, with the first reputation threshold being greater than the second. These thresholds divide the reputation value into three ranges: high, medium, and low, and correspondingly configure a first aggregation weight and a second aggregation weight, with the first aggregation weight being greater than the second aggregation weight. After calculating the reputation value of the participating nodes, the aggregation node compares it sequentially with the first reputation threshold and then the second reputation threshold.
[0071] When the reputation value is greater than or equal to the first reputation threshold, it indicates that the participating node has a history of excellent performance and high credibility, and its reputation verification is deemed successful. The corresponding local model parameter's aggregation weight is then set to a larger first aggregation weight. When the reputation value is greater than or equal to the second reputation threshold but less than the first reputation threshold, it indicates that the participating node's credibility is at a medium level. Its reputation verification is still deemed successful, but the corresponding local model parameter's aggregation weight is set to a smaller second aggregation weight. In other words, when the reputation value is less than the second reputation threshold, it indicates that the participating node's credibility is insufficient, and its reputation verification is deemed unsuccessful. This is the aforementioned situation of unsuccessful reputation verification, and the corresponding local model parameter does not participate in aggregation.
[0072] For example, assuming a first reputation threshold of 0.8, a second reputation threshold of 0.5, a first aggregation weight of 0.7, and a second aggregation weight of 0.3: If a participating node has a reputation value of 0.9, which is greater than the first reputation threshold, its local model parameters participate in aggregation with the first aggregation weight of 0.7; if another participating node has a reputation value of 0.6, which falls between the second and first reputation thresholds, its local model parameters participate in aggregation with the second aggregation weight of 0.3; and if yet another participating node has a reputation value of 0.4, which is less than the second reputation threshold, its local model parameters are excluded from aggregation. Understandably, when aggregating local model parameters, the aggregating node can further weight them based on the aforementioned weighted aggregation, combining the aggregation weights corresponding to each local model parameter. This allows the local model parameters of high-reputation nodes to have a greater impact on the global model parameters, thereby suppressing unreliable parameters while fully absorbing the contributions of high-quality nodes. The specific values of the above thresholds and weights can be adjusted according to actual application needs, and this embodiment does not limit them.
[0073] This embodiment further explains the mechanism of dynamically adjusting the reputation value based on the performance of the participating node in each round, on the basis of reputation verification. By tracking the verification status of the participating node in multiple consecutive rounds, its reputation value is increased or decreased accordingly. When the reputation value is too low, the participating node is removed from the subsequent federated learning, thereby forming a continuous incentive and constraint on the participating node and improving the credibility of model sharing in federated learning.
[0074] In this embodiment, federated learning includes multiple rounds, and the blockchain-based trusted sharing method for federated learning further includes:
[0075] When the local model parameters uploaded by the participating node all pass the verification result set in multiple consecutive rounds, the reputation value represented by the control reputation value information gradually increases.
[0076] Federated learning proceeds in multiple rounds of iteration. In each round, each participating node uploads its local model parameters, which are then verified by the aggregation node. The corresponding verification result set records the verification conclusion of that participating node in that round. Understandably, newly joined participating nodes are assigned a preset initial reputation value. This reputation value increases or decreases within a preset upper and lower limit to prevent it from increasing or decreasing indefinitely. The aggregation node tracks the verification conclusions of each participating node round by round. When the local model parameters uploaded by a participating node pass verification in the corresponding verification result sets for multiple consecutive rounds, it indicates that the node is consistently and stably providing reliable local model parameters. Based on this, the aggregation node controls its reputation value to gradually increase. The increase in reputation value can be achieved by accumulating a reputation increment after each consecutive round. The more consecutive rounds passed, the larger the single accumulated reputation increment, encouraging participating nodes to maintain good performance over the long term. The updated reputation value is written to the blockchain network as the basis for reputation verification in subsequent rounds.
[0077] When the local model parameters uploaded by a participating node fail to pass the verification in the corresponding set of verification results for multiple consecutive rounds, the reputation value is gradually reduced, and when the reputation value is less than the preset elimination threshold, the participating node is prohibited from participating in subsequent rounds of federated learning.
[0078] Conversely, when the verification result set corresponding to the local model parameters uploaded by a participating node fails verification for multiple consecutive rounds, it indicates that the node is continuously providing abnormal or low-quality local model parameters. The aggregation node then controls its reputation value to gradually decrease. The decrease in reputation value can be achieved by deducting a reputation penalty for each consecutive round of failures. The more consecutive rounds of failures, the larger the single reputation penalty, thus accelerating the constraint on abnormal nodes. The deducted reputation value is also written into the blockchain network for direct reading in subsequent rounds of reputation verification, connecting with the aforementioned method of calculating reputation values based on historical verification records. When a participating node's reputation value drops below a preset removal threshold due to continuous abnormalities, it indicates that the node is no longer trustworthy. The aggregation node prohibits this participating node from participating in subsequent rounds of federated learning, i.e., it no longer accepts its uploaded local model parameters, thereby completely eliminating persistently untrustworthy nodes and preventing them from repeatedly interfering with the global model.
[0079] Understandably, the preset removal threshold is lower than the aforementioned second reputation threshold, so that participating nodes still have some room to improve their performance after failing the reputation verification. They are only completely removed when their reputation value continues to drop below the preset removal threshold, thereby achieving a balance between constraining untrustworthy nodes and preserving the recovery opportunities of nodes.
[0080] This embodiment further illustrates the on-chain and off-chain hierarchical storage method when global model parameters are shared via a blockchain network. By storing the hash digest information with a smaller data volume on the blockchain for evidence, and storing the global model parameter body with a larger data volume off-chain, the traceability and verifiability of global model parameters are ensured, while avoiding the storage and synchronization burden caused by directly storing large amounts of model parameters on the blockchain, thereby improving the credibility and efficiency of model sharing.
[0081] In this embodiment, the step of sharing global model parameters to each participating node through the blockchain network includes:
[0082] Generate corresponding hash digest information based on global model parameters;
[0083] After obtaining the global model parameters, the aggregation node performs a hash operation on the global model parameters to generate corresponding hash digest information. The hash operation can be implemented using conventional hash algorithms in the field, which map global model parameters of arbitrary length to a digest value of fixed length and have collision resistance characteristics. That is, any change in any part of the global model parameters will result in a significantly different digest value. Therefore, the hash digest information can uniquely represent the corresponding global model parameters and can be used as a basis for verifying the integrity of the global model parameters. This embodiment does not limit the specific form of the hash algorithm.
[0084] The hash digest information is written to the on-chain storage space of the blockchain network, and the global model parameters are stored in the off-chain storage space so that each participating node can obtain the global model parameters from the off-chain storage space.
[0085] On-chain storage space refers to the ledger storage space jointly maintained by all nodes in the blockchain network. Data written into it is immutable but has limited capacity. Off-chain storage space refers to storage space located outside the blockchain network, such as a distributed file system or a dedicated storage server. It has ample capacity and is suitable for storing large volumes of data. Aggregator nodes write smaller hash digests of data into the on-chain storage space for permanent notarization, while storing larger global model parameter datasets in the off-chain storage space. Understandably, since the hash digests are on-chain and immutable, and the off-chain global model parameters correspond one-to-one with these hash digests, each participating node can verify the global model parameters after obtaining them from the off-chain storage space using the on-chain hash digests. This ensures the trustworthiness of the global model parameters while avoiding the storage overhead and synchronization delays associated with uploading the entire global model parameters to the blockchain.
[0086] This embodiment further illustrates the access permission verification and integrity verification mechanism for participating nodes when obtaining global model parameters, based on the on-chain and off-chain hierarchical storage. The smart contract verifies the permissions of participating nodes requesting to obtain global model parameters, and only returns the off-chain storage address to nodes that pass the verification. The participating nodes then use the hash digest information on the chain to verify the integrity of the obtained parameters, thereby ensuring that the global model parameters are neither obtained without authorization nor tampered with during the distribution process, thus improving the credibility and security of model sharing.
[0087] In this embodiment, the blockchain-based federated learning trusted sharing method further includes:
[0088] When a participating node requests to obtain global model parameters, the smart contract is invoked to verify the participating node's access permissions, and after successful verification, the storage address of the global model parameters in the off-chain storage space is returned to the participating node.
[0089] The smart contract pre-registers node identifiers of participating nodes with the authority to access global model parameters. When a participating node requests access to global model parameters, it submits its node identifier along with the request, triggering the smart contract to perform an access permission verification. The smart contract checks whether the node identifier in the request belongs to a registered node with the necessary permissions: if it does, the access permission verification is successful, and the storage address of the global model parameters in off-chain storage is returned to the participating node; if it does not, the verification fails, and the storage address is not returned. In this way, only participating nodes that are authorized and involved in this round of federated learning can know the storage address, preventing unauthorized nodes from accessing the global model parameters.
[0090] When multiple participating nodes request to obtain global model parameters, the smart contract is invoked to verify the access permissions of each participating node in turn, and the storage address is sent to each participating node that has passed the verification.
[0091] When multiple participating nodes concurrently request to obtain global model parameters, the aggregation node uses a smart contract to sequentially verify the access permissions of each participating node's node identifier, and sends the storage address to each participating node that passes the verification. The storage address is not sent to participating nodes that fail the verification, thus controlling the acquisition of permissions one by one in the scenario where multiple nodes request at the same time.
[0092] The storage address is used by participating nodes to obtain global model parameters, and the hash digest information is used by participating nodes to verify the integrity of the obtained global model parameters.
[0093] After obtaining the storage address, the participating node downloads the global model parameters from the off-chain storage space based on that address. Understandably, after obtaining the global model parameters, the participating node re-hashes them to obtain a verification digest, and then reads the previously stored hash digest information from the on-chain storage space, comparing the two: if they match, it indicates that the obtained global model parameters are complete and accurate, and have not been tampered with during storage and transmission; the participating node then updates its local model accordingly. If they do not match, it indicates that the global model parameters have been tampered with or damaged during transmission; the participating node discards these parameters and can re-initiate the acquisition request, thus ensuring that the global model parameters ultimately used to update the local model are authentic and reliable.
[0094] This embodiment provides a blockchain-based trusted sharing system for federated learning, which carries and executes the aforementioned blockchain-based trusted sharing method for federated learning. Through the collaborative cooperation of the blockchain network, multiple participating nodes and the aggregation node, each participating node can complete trusted collaborative modeling without leaving its local data, thereby improving the trustworthiness and security of model sharing in federated learning.
[0095] See Figure 4 The blockchain-based federated learning trusted sharing system 100 in this embodiment includes a blockchain network 10, multiple participating nodes 20, and an aggregation node 30. The components are described in detail below:
[0096] Blockchain Network 10, which is equipped with smart contracts;
[0097] Blockchain network 10 is a distributed network providing trusted underlying support for the system. It can be constructed in the form of a consortium blockchain, with multiple consensus nodes jointly maintaining an immutable ledger. Blockchain network 10 deploys smart contracts, which are pre-written and automatically executable program codes deployed on blockchain network 10. These contracts respond to calls from aggregation node 30 to perform verification logic such as identity verification and access permission verification. Internally, they can register the node identifiers and corresponding public keys and permission information of each legitimate participating node 20. Blockchain network 10 also provides on-chain storage space for storing data that must be guaranteed to be immutable, such as notarized hash digest information and historical verification records.
[0098] Multiple participating nodes 20, each participating node 20 is independent of each other and connected to the blockchain network 10. Each participating node 20 is used to train the local model based on local data to obtain local model parameters.
[0099] Each participating node 20 can be a server or edge computing device belonging to different institutions. Each participating node 20 is independent of each other and is connected to the blockchain network 10. Each participating node 20 holds local data for model training. Based on the local data, it trains a local model with a unified structure to obtain local model parameters. After signing the local model parameters with its own private key, it uploads the local model parameters along with the digital signature information to the aggregation node 30. The local data is always kept on the local machine of each participating node 20 and is not transmitted. Each participating node 20 can also obtain global model parameters from off-chain storage space after passing access permission verification, and update its local model with them after integrity verification.
[0100] Aggregator node 30 is connected to blockchain network 10 and is configured to execute the aforementioned blockchain-based federated learning trusted sharing method.
[0101] Aggregator node 30 can be an independently deployed server or server cluster connected to blockchain network 10. Aggregator node 30 is configured to execute the aforementioned blockchain-based federated learning trusted sharing method, that is, to receive local model parameters uploaded by each participating node 20, perform identity verification, quality verification, and reputation verification on the local model parameters based on preset trusted verification rules and with the help of smart contracts to generate a set of verification results, aggregate the verified local model parameters to obtain global model parameters, and then share them to each participating node 20 through blockchain network 10 after hierarchical storage on and off the chain.
[0102] Understandably, the above system embodiments correspond to the aforementioned method embodiments. The specific working processes and beneficial effects of each component in the system can be found in the corresponding descriptions in the aforementioned method embodiments, and will not be repeated here. The division of the system components in this embodiment is merely an example. In practical applications, the above functions can be assigned to different components as needed. Any system structure capable of implementing the aforementioned method falls within the protection scope of this embodiment.
[0103] The above are merely exemplary embodiments of the present invention and do not limit the scope of the patent of the present invention. All equivalent structural transformations made using the contents of the present invention specification and drawings under the technical concept of the present invention, or direct / indirect applications in other related technical fields, are included within the scope of patent protection of the present invention.
Claims
1. A blockchain-based federated learning trusted sharing method, applied to aggregation nodes, characterized in that, The aggregation node is connected to a blockchain network, which also connects to multiple independent participating nodes. The blockchain-based federated learning trusted sharing method includes: Receive the local model parameters obtained by each participating node through training its local model based on local data and uploaded by the node. Based on preset trusted verification rules, a set of verification results is generated according to the local model parameters; Based on the set of verification results, the verified local model parameters are aggregated to obtain global model parameters, and the global model parameters are shared to each of the participating node through the blockchain network.
2. The blockchain-based federated learning trusted sharing method as described in claim 1, characterized in that, The blockchain network is deployed with smart contracts, the verification result set includes identity verification results, and the step of generating the verification result set based on preset trusted verification rules and local model parameters includes: Obtain the digital signature information carried by the local model parameters; Based on the digital signature information, the smart contract is invoked to verify the identity of the participating node, and the identity verification result is obtained.
3. The blockchain-based federated learning trusted sharing method as described in claim 2, characterized in that, The step of calling the smart contract to authenticate the participating node based on the digital signature information and obtaining the authentication result includes: The smart contract is invoked to verify the digital signature information through a single consensus node in the blockchain network, or through consensus verification of the digital signature information through various consensus nodes in the blockchain network, to obtain the identity verification result.
4. The blockchain-based federated learning trusted sharing method as described in claim 2, characterized in that, The verification result set also includes quality verification results; the step of generating the verification result set based on the local model parameters according to the preset trusted verification rules further includes: Based on a preset test dataset, the accuracy of the local model corresponding to the local model parameters is tested to obtain accuracy evaluation information. Based on the accuracy assessment information, the local model parameters are quality verified to obtain the quality verification result.
5. The blockchain-based federated learning trusted sharing method as described in claim 2, characterized in that, The verification result set also includes reputation verification results; the step of generating the verification result set based on the local model parameters according to the preset trusted verification rules further includes: The reputation value information of the participating nodes is obtained based on the historical verification records stored in the blockchain network. Based on the reputation value information, the reputation of the participating node is verified to obtain the reputation verification result.
6. The blockchain-based federated learning trusted sharing method as described in claim 5, characterized in that, The step of performing reputation verification on the participating node based on the reputation value information to obtain the reputation verification result includes: When the reputation value represented by the reputation value information is greater than or equal to the first reputation threshold, it is determined that the reputation verification of the participating node has passed, and the aggregate weight of the corresponding local model parameter is determined as the first aggregate weight. When the reputation value is greater than or equal to the second reputation threshold and less than the first reputation threshold, the reputation verification of the participating node is determined to be successful, and the aggregate weight of the corresponding local model parameter is determined to be the second aggregate weight. Wherein, the first reputation threshold is greater than the second reputation threshold, and the first aggregation weight is greater than the second aggregation weight.
7. The blockchain-based federated learning trusted sharing method as described in claim 5, characterized in that, The federated learning process includes multiple rounds, and the blockchain-based trusted sharing method for federated learning further includes: When the local model parameters uploaded by the participating node all indicate that the verification has passed in the corresponding set of verification results in multiple consecutive rounds, the reputation value represented by the reputation value information is controlled to gradually increase. When the local model parameters uploaded by the participating node all indicate that the verification has failed in multiple consecutive rounds, the reputation value is controlled to gradually decrease, and when the reputation value is less than a preset elimination threshold, the participating node is prohibited from participating in subsequent rounds of federated learning.
8. The blockchain-based federated learning trusted sharing method as described in claim 2, characterized in that, The step of sharing the global model parameters to each of the participating nodes through the blockchain network includes: Based on the global model parameters, generate the corresponding hash digest information; The hash digest information is written into the on-chain storage space of the blockchain network, and the global model parameters are stored in the off-chain storage space so that each participating node can obtain the global model parameters from the off-chain storage space.
9. The blockchain-based federated learning trusted sharing method as described in claim 8, characterized in that, The blockchain-based federated learning trusted sharing method also includes: When a participating node requests to obtain the global model parameters, the smart contract is invoked to verify the access rights of the participating node, and after the verification is successful, the storage address of the global model parameters in the off-chain storage space is returned to the participating node. When multiple participating nodes request to obtain the global model parameters, the smart contract is invoked to verify the access permissions of each participating node in turn, and the storage address is sent to each participating node that has passed the verification. The storage address is used for the participating nodes to obtain the global model parameters, and the hash digest information is used for the participating nodes to perform integrity verification on the obtained global model parameters.
10. A blockchain-based federated learning trusted sharing system, characterized in that, The blockchain-based federated learning trusted sharing system includes: A blockchain network, wherein smart contracts are deployed; Multiple participating nodes, each independent of the others and connected to the blockchain network, each participating node training a local model based on local data to obtain local model parameters; and An aggregation node, which is connected to the blockchain network, is configured to perform a blockchain-based federated learning trusted sharing method as described in any one of claims 1 to 9.
