Dual blockchain data sharing and reputation management method based on federated learning
Through the federated learning method of dual-blockchain architecture, combined with reputation-incentive blockchain and model-quality blockchain, the problems of single point failure, poisoning attacks and low-quality nodes in federated learning are solved, and high-quality data sharing and reputation management are achieved.
Patent Information
- Application Number
- CN202211612645.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2042-12-15
AI Technical Summary
The existing federated learning methods have problems with single point of failure, poisoning attacks and low-quality node impacts in medical data sharing, and lack effective reputation management and incentive mechanisms.
Adopting a dual-blockchain architecture, decentralized federated learning is achieved through the combination of reputation-incentive blockchain (RIchain) and model-quality blockchain (MQchain). RIchain is used for reputation assessment and incentives. MQchain excludes low-quality nodes through a threshold proof of quality consensus (PoQ) and selects high-quality nodes for parameter aggregation.
It effectively avoids the impact of single point of failure, poisoning attacks and low-quality nodes, improves the training quality of federated learning, and promotes the participation of high-quality nodes through reputation management and incentive mechanisms.
Smart Images

Figure CN116128069B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology and relates to a dual-blockchain data sharing and reputation management method based on federated learning. Background Art
[0002] The Internet of Medical Things (IoMT) can collect electronic medical data through sensors, wearable devices, and clinical systems. Using this data, medical institutions can build medical detection models to make timely and effective diagnoses for patients. Models built by a single institution based on its own data often have problems such as single distribution of training samples and insufficient data volume. Modeling by combining data from multiple medical institutions is an effective solution. However, medical data involves patient privacy and needs to be shared securely.
[0003] The traditional method of sharing medical data is to design a data encryption scheme to protect the privacy of patients, and then share the encrypted data through the cloud. However, the data needs to be stored in the cloud from the local area, so it is difficult to avoid single point failure and collusion attacks. Using the method of federated learning for data sharing can enable joint modeling without leaving the local area. This is because the global model of federated learning can be obtained by aggregating the model parameters of the local training of participating nodes through the central aggregator. However, it also has the problem of single point failure and is vulnerable to poisoning attacks. In addition, due to the lack of reputation evaluation and incentive mechanism, it is impossible to eliminate the influence of low-quality nodes.
[0004] Since blockchain can be seen as a decentralized, transparent, and auditable digital ledger, the method of combining blockchain with federated learning has emerged. Generally speaking, there are two main ways of combining. One is to use blockchain to establish a decentralized system for distributed aggregation with incentives, thereby avoiding single points of failure. However, incentives are given after each aggregation, and the punishment for nodes that attack after aggregation is insufficient. Another way is to use blockchain to establish a reputation evaluation and incentive mechanism to reduce the impact of low-quality nodes. However, this method of FL still requires a central aggregator to aggregate parameters, and there are single points of failure and poisoning attacks. Therefore, it is necessary to design a secure federated learning method with reputation management and incentives for data sharing. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a dual-blockchain data sharing and reputation management method based on federated learning, improve the training quality of federated learning, avoid problems such as single point failure and poisoning attacks, and at the same time be able to manage the reputation of nodes participating in federated learning and provide incentives.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] A dual blockchain data sharing and reputation management method based on federated learning, specifically comprising the following steps:
[0008] S1: Nodes participating in data sharing register their identities on the Reputation-Incentive blockchain (RIchain) and obtain initial reputation;
[0009] S2: Select nodes from RIchain based on reputation to conduct federated learning on the Model-Quality blockchain (MQchain), and store model update parameters on MQchain;
[0010] S3: Deploy Proof of Quality (PoQ) consensus with thresholds on MQchain. This consensus can exclude nodes with low update quality from participating in federated learning parameter aggregation through thresholds, and select nodes with the highest update quality as mining nodes of MQchain; repeat training until the global model reaches the target;
[0011] S4: According to the performance of participating nodes in the aggregation on MQchain, RIchain uses reputation evaluation, incentives and index query mechanisms to update the reputation of nodes and provide incentives;
[0012] S5: RIchain uses the Proof of Work (PoW) consensus to select mining nodes to package and store the node’s reputation and incentive information, so that high-reputation nodes can be selected to participate in the next federated learning task.
[0013] Further, step S1 specifically includes: the nodes participating in data sharing are composed of various entities. Through identity authentication, they use uuid to generate a unique identification code on RIchain and upload the data type they have; at the same time, RIchain will give an initial reputation value to the node that registers for the first time; then the node's identification code, data type, reputation, and incentive will be saved on the blockchain as a transaction on RIchain through PoW consensus. RIchain is maintained by all nodes.
[0014] Further, step S2 specifically includes: the task issuing node of federated learning selects participating nodes from RIchain to perform federated learning on MQchain according to the reputation value and the required data type; let P = {P1, P2, ..., P n} represents the set of n participating nodes in the federated learning task; the participating node P i There is a size d i The dataset, G dRepresents the sum of the data volume of all participating nodes, At the beginning of federated learning, each participating node obtains the initial global model parameters and the number of global model training rounds T g The local training process is the same as the normal learning process; in round t of global training, the global model parameters are used The trained local model parameters are Different from the traditional federated learning global model update, which requires the aggregation of all node updates, this invention has some restrictions on the quality of participating nodes. After the node local update quality is evaluated by PoQ with a threshold, the nodes with quality higher than the threshold are put into the update aggr = {P1, P2, ..., P m}, m≤n, where update aggr represents the set of m nodes whose quality is higher than the threshold; then the global model parameter of round t+1 is
[0015] Updates of participating nodes are saved as transactions in the block body, and global model updates are saved in the block header. All updated parameters will be packaged into new blocks and stored in MQchain.
[0016] Further, in step S3, the PoQ with threshold divides the nodes according to the update quality and selects the nodes with the highest quality as mining nodes, which specifically includes the following steps:
[0017] S31: Perform quality assessment based on node upload updates, and use thresholds to divide nodes into different sets in the MQchain transaction pool;
[0018] S32: After receiving all the transactions of the nodes or reaching the set time limit, update aggr The node updates in are aggregated to obtain the new global model parameters At the same time, update aggr The node with the highest update quality is selected as the mining node; the mining node packages all transactions and updated global model parameters into a new block and broadcasts it to other participating nodes;
[0019] S33: Other nodes verify the format of the new block and the quality of the miners. After more than half of the nodes pass the verification, the new block is saved on MQchain.
[0020] MQchain is maintained by nodes participating in federated learning.
[0021] Further, in step S31, the Youden index, a coefficient measuring the authenticity of the model, is used to perform quality assessment; the Youden index is the sum of the sensitivity (TPR) and the specificity (TNR) minus 1, that is,
[0022] Youden=TPR+TNR-1
[0023] The Youden Index indicates the total ability of the screening method to detect true patients and non-patients. The larger the value, the better the screening experiment is and the greater its authenticity.
[0024] After the quality assessment is completed, the node's updated parameters and assessment results will be sent to MQchain as transactions, and all transactions will be temporarily retained in the transaction pool; at this time, the transactions sent to the transaction pool will be divided according to the threshold, and the nodes with update quality higher than the threshold will be placed in the update aggr In the collection, those below the threshold are placed in the update collection.
[0025] Further, step S33 specifically includes: after receiving the new block, other participating nodes will verify it; the verification content includes the block format and whether the mining node quality is higher than their own; when more than half of the verifications are passed, PoQ is completed and the new block is put on the chain. Then the participating nodes obtain the global model parameters from MQchain for training until the global model achieves the task goal.
[0026] Furthermore, in step S4, RIchain evaluates the reputation of participating nodes and provides incentives based on their performance on MQchain, which specifically includes the following steps:
[0027] S41: Node participation in aggregation is considered a positive event, and non-participation in aggregation is considered a negative event; considering the difference in the interaction effects between positive and negative events, as well as the influence of node training time and data volume, the direct reputation of the node is calculated using a subjective logic model;
[0028] S42: Using the index query mechanism, the index of the node's reputation block is saved in the RIchain block header, so as to quickly find the node's historical reputation; then the node's historical reputation is combined with the direct reputation to calculate the node's final reputation;
[0029] S43: Consider the direct reputation of the node through the incentive mechanism and calculate the incentive obtained by the node in this federated learning task.
[0030] Further, step S41 specifically includes: using the subjective logic model to calculate the direct reputation of the node; considering the node's participation in aggregation as a positive event, and not participating in aggregation as a negative event; first considering the difference in interaction effects, there are
[0031]
[0032] Among them, α represents the number of positive events, that is, the number of times they participated in the aggregation; β represents the number of negative events, that is, the number of times they did not participate in the aggregation; k represents the weight of the positive event, η represents the weight of the negative event, k+η=1, and k≤η; s ij represents the probability of successful transmission, then u ij represents the probability of transmission failure; b ij represents the proportion of positive events of participating task node j in the process of participating in the task of releasing task node i; d ij It represents the proportion of negative events of participating task node j in the process of participating in the task of releasing task node i;
[0033] Considering the impact of training time on reputation, that is, the shorter the time to complete local training, the higher the node reputation, then:
[0034]
[0035] Among them, L T represents the average time of local training of participating nodes; G T represents the average time of global training; a negative exponential function is used to control the influence of the training time ratio, and a represents the influencing parameter; however, if only the training time is considered, a node with a large amount of data and average computing power will have a longer local training time than a node with less data, thus getting a lower evaluation, which is obviously unreasonable. Therefore, considering the influence of the amount of data held by the node on the evaluation, the original formula is changed to:
[0036]
[0037] Among them, L d Indicates the amount of data owned by the participating nodes; G d It represents the sum of the data volume owned by all participating nodes. At this point, the training quality of the nodes can be further distinguished, so that each time the nodes participate in the aggregation, the nodes with large data volume and short training time will get higher reputation. The final direct reputation of the node is:
[0038] T d_ij =b ij +γu ij
[0039] Among them, γ represents the proportion of uncertainty; T d_ij It represents the direct reputation evaluation of task issuing node i on task participating node j.
[0040] Further, step S42 specifically includes: using the index query mechanism to quickly find the historical reputation of the node; adding a participating node set participants to the block header of RIchainset stores the participating nodes included in the current block and the index of the previous block containing the node-containing transaction; when performing a node historical reputation query, it can quickly determine whether the block contains the node transaction through participants set and secondly, it can directly jump to the previous block containing the node transaction through the index stored in the set, thus eliminating the need to traverse each block and reducing the query time. The time complexity of the optimized query algorithm is o(mn), where 0 < m ≤ n. Only when the transaction of a certain node exists in every block, the time complexity is the same as the traditional query method.
[0041] Denote the direct reputation of the node as T d and the historical reputation of the node as the indirect evaluation T r then the final evaluation T is:
[0042] T = (1 - ε)T d + εT r
[0043] where ε is a function representing the proportion of the indirect evaluation in the total evaluation, which is mainly affected by the time residual value θ and the task similarity ω; the calculation formula for the residual value θ is as follows:
[0044]
[0045] Calculate each block in the evaluation chain as a time period, where t n represents the time period of the current block; t c represents the time period of the previous block where there was an evaluation of the node; t t is the forgetting factor. When t t = 1, it means that the indirect evaluation has the maximum value only at the current block, and the further away from the current block in terms of time period, the less its residual value; γ t is an adjustable parameter; compared with using a negative exponential function to represent the decay of time, this function has a more flexible decay and can adjust the decay of the residual value according to the block production speed.
[0046] The task similarity ω is calculated using the Jaccard similarity coefficient; assume that the feature vector of the current round of tasks is represented as D = {d1, d2,..., d n}, and the feature vector of the historical task is represented as R = {r1, r2,..., r n}, then there is:
[0047]
[0048] Then the value of ε is:
[0049]
[0050] Therefore, the reputation evaluation mechanism of the node can make the growth of positive reviews slow down and the decrease of negative reviews quickly, thereby further restricting the behavior of the node and effectively identifying malicious nodes.
[0051] Further, step S43 specifically includes: the incentive mechanism needs to give corresponding rewards to the nodes according to the performance of the participating nodes in this task, so as to ensure the fairness of the incentive measures. Therefore, the incentive mechanism is only related to the direct reputation of the node. When a node participates in a task, it needs to pay a certain deposit. If the node performs well during the task completion, it will receive a reward proportional to the deposit. If the performance is poor, a corresponding proportion will be deducted from the deposit as a penalty. The formula of the incentive function is:
[0052]
[0053] Where ΔT = T d -0.5, μ is the influence factor of the incentive, which controls the growth of the incentive. In addition, when a node becomes a mining node, it will receive additional incentives to encourage the nodes with the highest training quality. The mining incentive will change according to the number of participating nodes. The more participating nodes, the less mining incentives will be obtained. Therefore, the final incentives obtained by the node are:
[0054]
[0055] Among them, n represents the number of participating nodes. By setting up additional mining incentives, participating nodes can be stimulated to improve their own training quality, and get more incentives while obtaining mining rights, thereby achieving healthy competition and ultimately benefiting task publishers.
[0056] The incentive mechanism can attract excellent nodes to participate in tasks and punish low-quality nodes and malicious nodes. At the same time, since incentives are given only based on the performance of the current task, when a normal node turns into a malicious node to attack during the task, it can also be given a larger punishment; when a node performs poorly in the previous task and performs normally in this task, its evaluation will improve more slowly than other normal nodes, but the incentives it receives are consistent with its performance. Therefore, the incentive mechanism ensures fairness.
[0057] Further, step S5 specifically includes: when the reputation and incentive calculation of the node is completed, it is sent to RIchain as a transaction. RIchain then uses PoW to generate new blocks to complete the reputation update of the node. When a new federated learning task is performed later, nodes with high reputation are selected to participate according to the node reputation recorded on RIchain. In this way, the node selection in the federated learning reduces the possibility of being attacked by malicious nodes.
[0058] The beneficial effects of the present invention are:
[0059] 1) The present invention realizes decentralized federated learning by using MQchain and designs a PoQ consensus with threshold to prevent federated learning from being affected by low-quality nodes, single point failures and poisoning attacks.
[0060] 2) The present invention uses a RIchain to comprehensively evaluate all nodes and provide incentives, thereby providing MQchain with nodes with high credibility, attracting more high-quality nodes, and reducing the participation of malicious nodes in the node selection stage of federated learning.
[0061] 3) The present invention designs an index query mechanism that can quickly find the historical reputation of a node, reduce the calculation time of reputation evaluation, and thus speed up the reputation evaluation process.
[0062] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0064] Figure 1 The dual blockchain data sharing and reputation management process based on federated learning in the present invention;
[0065] Figure 2 This is a model diagram of the dual blockchain data sharing and reputation management system based on federated learning in the present invention;
[0066] Figure 3 This is the block structure diagram of MQchain;
[0067] Figure 4 This is the block structure diagram of RIchain. DETAILED DESCRIPTION
[0068] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0069] See also Figure 1 to Figure 4 ,The present invention provides a dual blockchain data sharing and reputation management method based on federated learning, such as Figure 1 As shown, the method mainly includes the following steps:
[0070] Step 1: The node registers on RIchain and obtains initial reputation;
[0071] Step 2: Select nodes based on reputation to conduct federated learning on MQchain;
[0072] Step 3: Aggregate nodes with quality higher than the threshold through PoQ with threshold to update into a new global model, and select the node with the highest update quality as the mining node of MQchain. Repeat the training until the global model reaches the target;
[0073] Step 4: Based on the performance of participating nodes in the aggregation on MQchain, RIchain uses reputation evaluation, incentives and index query mechanisms to update the reputation of the nodes and provide incentives;
[0074] Step 5: RIchain uses PoW to select mining nodes and store the reputation and incentive information of the nodes, so that high-reputation nodes can be selected to participate in the next federated learning task.
[0075] Figure 2 The system model diagram of the present invention is mainly composed of publishing nodes, participating nodes, cloud database (CloudDB), MQchain and RIchain. The following is an explanation with reference to the accompanying drawings, including the following steps:
[0076] 1) The publishing node publishes the data type, number of nodes, and initial global model parameters required for federated learning and the number of global model training rounds T g ;
[0077] 2) CloudDB queries the qualified nodes on RIchain and checks whether their status is available according to the task requirements of the publishing node;
[0078] 3) After the query is completed, CloudDB returns the address of the matching node based on the node's reputation value;
[0079] 4) Initial Federated Learning Model Updated to MQchain;
[0080] 5)MQchain sends global model parameters to participating nodes;
[0081] 6) Participating nodes use local data for training;
[0082] 7) Local model parameters The evaluation is sent to MQchain as a transaction and aggregated into new global model parameters through PoQ
[0083] 8) Each node’s participation in the aggregation is sent to RIchain;
[0084] 9) RIchain evaluates the nodes, stores the node data and synchronizes it to CloudDB.
[0085] Figure 3 It is a specific block structure in MQchain. In addition to saving block information, the block header also includes global model parameters, evaluations, and the set of nodes participating in and not participating in aggregation. The block body mainly saves the updated parameters and evaluations uploaded by the nodes.
[0086] Figure 4 The specific block structure in RIchain. In addition to storing block information, the block header also includes the node index set contained in the block. The block body mainly stores the node's reputation, incentives, and data type.
[0087] Optionally, steps 4), 5), 6), and 7) are federated learning processes based on MQchain, specifically including a federated learning process and a PoQ process with a threshold:
[0088] Federated learning process: Let P = {P1, P2, ..., P n} represents n participating nodes in the federated learning task. Participating nodes P i There is a size d i The dataset, G d Represents the sum of the data volume of all participating nodes, At the beginning of federated learning, each participating node obtains the initial global model parameters and the number of global model training rounds T g The local training process is the same as the normal learning process. In the tth round of global training, the global model parameters are used The trained local model parameters are Different from the traditional federated learning global model update, which requires the aggregation of all node updates, this design has some restrictions on the quality of participating nodes. After the quality of the node local update is evaluated by PoQ with a threshold, the nodes with quality higher than the threshold are put into the update aggr = {P1, P2, ..., P m}, m≤n. Then the global model parameters of round t+1 are
[0089] PoQ process with threshold: At the beginning of each round of global model training, P i Get the global model parameters of the current round by accessing MQchain After training is completed, the node local update parameters are obtained System Performance evaluation. Considering the particularity of medical data, the coefficient to measure the authenticity of the model, the Youden index, is used. Assuming that the harmfulness of the model's false negatives (missed diagnosis rate) and false positives (misdiagnosis rate) is of equal significance, the Youden index is the sum of the sensitivity (TPR) and the specificity (TNR) minus 1, that is,
[0090] Youden=TPR+TNR-1
[0091] The Youden Index indicates the total ability of a screening method to detect true patients and non-patients. The larger the value, the better the effect of the screening experiment and the greater its authenticity.
[0092] After the quality assessment is completed, the node's updated parameters and assessment results will be sent to MQchain as a transaction, and all transactions will be temporarily retained in the transaction pool. At this time, the transactions sent to the transaction pool will be divided according to the threshold, and the nodes with update quality higher than the threshold will be placed in the update aggr In the collection, those below the threshold are placed in the update collection.
[0093] When all nodes' transactions are received or the set time limit is reached, update aggr The node updates in are aggregated to obtain the new global model parameters At the same time, update aggr The node with the highest update quality is selected as the mining node. The mining node packages all transactions and updated global model parameters into a new block and broadcasts it to other participating nodes.
[0094] After receiving the new block, other participating nodes will verify it. The verification content includes the block format and whether the quality of the mining node is higher than their own. When more than half of the verifications are passed, PoQ is completed and the new block is put on the chain. Then the participating nodes obtain the global model parameters from MQchain for training until the global model achieves the task goal. Therefore, MQchain is maintained by the nodes participating in federated learning.
[0095] Optionally, steps 8) and 9) are the process of RIchain evaluating and motivating the participating nodes of MQchain, which specifically include reputation calculation, index query, and incentive calculation:
[0096] (1) Use the subjective logic model to calculate the direct reputation of the node. The node's participation in aggregation is considered a positive event, and its non-participation in aggregation is considered a negative event. First, consider the difference in interaction effects.
[0097]
[0098] Where α represents the number of positive events, that is, the number of times they participated in the aggregation; β represents the number of negative events, that is, the number of times they did not participate in the aggregation; k represents the weight of the positive event, η represents the weight of the negative event, k+η=1, and k≤η; s ij represents the probability of successful transmission, then u ij represents the probability of transmission failure. ij represents the proportion of positive events of participating task node j in the process of participating in the task of releasing task node i; d ij It represents the proportion of negative events of participating task node j in the process of participating in the task of releasing task node i.
[0099] Considering the impact of training time on reputation, that is, the shorter the time to complete local training, the higher the node reputation, then:
[0100]
[0101] Among them, L T represents the average time of local training of participating nodes; G T represents the average time of global training; a negative exponential function is used to control the influence of the training time ratio, and a represents the influencing parameter. However, if only the training time is considered, a node with a large amount of data and average computing power will have a longer local training time than a node with less data, thus getting a lower evaluation, which is obviously unreasonable. Therefore, considering the influence of the amount of data held by the node on the evaluation, the original formula is changed to:
[0102]
[0103] Among them, L d Indicates the amount of data owned by the participating nodes; G d It represents the sum of the data volume owned by all participating nodes. At this point, the training quality of the nodes can be further distinguished, so that each time the nodes participate in the aggregation, the nodes with large data volume and short training time will get higher reputation. The final direct reputation of the node is:
[0104] T d_ij =b ij +γu ij
[0105] γ represents the proportion of uncertainty; T d_ij Represents the direct reputation evaluation of publishing node i on participating node j.
[0106] (2) Use the index query mechanism to quickly find the historical reputation of nodes. Add a set of participating nodes, participants, to the block header of RIchain. set , which stores the participating nodes included in the current block and the index of the previous block containing the node transaction. When querying the historical reputation of a node, it can be quickly determined whether the block contains the node transaction through participants set . Secondly, the index stored in the set can be directly used to jump to the previous block containing the node transaction, thus eliminating the need to traverse each block and reducing the query time. The time complexity of the optimized query algorithm is o(mn), where 0 < m ≤ n. The time complexity is the same as the traditional query method only when the transaction of a certain node exists in every block.
[0107] Represent the direct reputation of the node as T d , and the historical reputation of the node as the indirect evaluation T r . Then the final evaluation T is:
[0108] T = (1 - ε)T d + εT r
[0109] Among them, ε is a function representing the proportion of the indirect evaluation in the total evaluation. It is mainly affected by the time residual value θ and the task similarity ω. The calculation formula of the residual value θ is as follows:
[0110]
[0111] In the present invention, each block in the evaluation chain is used as a time period for calculation, t n represents the time period of the current block; t c represents the time period of the previous block where there is an evaluation of the node; t t is the forgetting factor. When t t = 1, it means that the indirect evaluation has the maximum value only in the current block. The farther the time period from the current block, the less its residual value; γ t is an adjustable parameter. Compared with using the negative exponential function to represent the decay of time, the decay of this function is more flexible and can adjust the decay of the residual value according to the block production speed.
[0112] The task similarity ω is calculated using the Jaccard similarity coefficient. Assume that the feature vector of the current round of tasks is represented as D = {d1, d2,..., d n} and the feature vector of the historical tasks is represented as R = {r1, r2,..., r n}. Then there is:
[0113]
[0114] Then the value of ε is:
[0115]
[0116] Therefore, the reputation evaluation mechanism of the node can make the growth of positive reviews slow down and the decrease of negative reviews quickly, thereby further restricting the behavior of the node and effectively identifying malicious nodes.
[0117] (3) The incentive mechanism needs to give corresponding rewards to the nodes according to their performance in this task, so as to ensure the fairness of the incentive measures. Therefore, the incentive mechanism is only related to the direct reputation of the node. When a node participates in a task, it needs to pay a certain deposit. If the node performs well during the task completion, it will receive a reward proportional to the deposit. If the performance is poor, a corresponding proportion will be deducted from the deposit as a penalty. The formula of the incentive function is:
[0118]
[0119] Where ΔT = T d -0.5, μ is the influence factor of the incentive, which controls the growth of the incentive. In addition, when a node becomes a mining node, it will receive additional incentives to encourage the nodes with the highest training quality. The mining incentive will change according to the number of participating nodes. The more participating nodes, the less mining incentives will be obtained. Therefore, the final incentives obtained by the node are:
[0120]
[0121] Among them, n represents the number of participating nodes. By setting up additional mining incentives, participating nodes can be stimulated to improve their own training quality, and get more incentives while obtaining mining rights, thereby achieving healthy competition and ultimately benefiting task publishers.
[0122] The incentive mechanism can attract excellent nodes to participate in tasks and punish low-quality nodes and malicious nodes. At the same time, since incentives are given only based on the performance of the current task, when a normal node turns into a malicious node to attack during the task, it can also be given a larger punishment; when a node performs poorly in the previous task and performs normally in this task, its evaluation will improve more slowly than other normal nodes, but the incentives it receives are consistent with its performance. Therefore, the incentive mechanism ensures fairness.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A dual-blockchain data sharing and reputation management method based on federated learning, characterized in that: The method specifically comprises the following steps: S1: Nodes participating in data sharing register their identities on RIchain and obtain initial reputation; RIchain stands for reputation incentive blockchain; S2: Select nodes from RIchain based on reputation to perform federated learning on MQchain, and store model update parameters on MQchain; MQchain represents the model quality blockchain; S3: Deploy PoQ with threshold on MQchain. This PoQ excludes nodes with low update quality from participating in federated learning parameter aggregation through threshold, and selects nodes with the highest update quality as mining nodes of MQchain; repeat the training until the global model reaches the target; PoQ stands for Proof of Quality Consensus; S4: According to the performance of participating nodes in the aggregation on MQchain, RIchain uses reputation evaluation, incentives and index query mechanisms to update the reputation of nodes and provide incentives; S5: RIchain uses PoW to select mining nodes to package and store the reputation and incentive information of the nodes, so as to facilitate the selection of high-reputation nodes to participate in the next federated learning task; PoW stands for Proof of Work consensus.
2. The dual blockchain data sharing and reputation management method according to claim 1 is characterized in that: Step S1 specifically includes: the nodes participating in data sharing are composed of various entities. Through identity authentication, they use uuid to generate a unique identification code on RIchain and upload the data type they own; at the same time, RIchain will give an initial reputation value to the node that registers for the first time; then the node's identification code, data type, reputation, and incentive will be saved on the blockchain as a transaction on RIchain through PoW consensus.
3. The dual blockchain data sharing and reputation management method according to claim 1 is characterized in that: Step S2 specifically includes: the task issuing node of federated learning selects participating nodes from RIchain to conduct federated learning on MQchain according to the reputation value and the required data type; let P = {P1, P2, ..., P n } represents the set of n participating nodes in the federated learning task; the participating node P i There is a size d i The dataset, G d Represents the sum of the data volume of all participating nodes, At the beginning of federated learning, each participating node obtains the initial global model parameters and the number of global model training rounds T g The local training process is the same as the normal learning process; in round t of global training, the global model parameters are used The trained local model parameters are After the node local update quality is evaluated by PoQ with a threshold, the nodes with quality higher than the threshold are put into the update aggr = {P1, P2, ..., P m }, m≤n, where update aggr represents the set of m nodes whose quality is higher than the threshold; then the global model parameter of round t+1 is 4. The dual blockchain data sharing and reputation management method according to claim 3 is characterized in that: In step S3, the PoQ with threshold divides the nodes according to the update quality and selects the nodes with the highest quality as mining nodes, which specifically includes the following steps: S31: Perform quality assessment based on node upload updates, and use thresholds to divide nodes into different sets in the MQchain transaction pool; S32: After receiving all the transactions of the nodes or reaching the set time limit, update aggr The node updates in are aggregated to obtain the new global model parameters At the same time, update aggr The node with the highest update quality is selected as the mining node; the mining node packages all transactions and updated global model parameters into a new block and broadcasts it to other participating nodes; S33: Other nodes verify the format of the new block and the quality of the miners. After more than half of the nodes pass the verification, the new block is saved on MQchain.
5. The dual blockchain data sharing and reputation management method according to claim 4 is characterized in that: In step S31, the Youden index, a coefficient that measures the authenticity of the model, is used to perform quality assessment; the Youden index is the sum of the sensitivity TPR and the specificity TNR minus 1, that is, Youden=TPR+TNR-1 The Youden Index indicates the total ability of the screening method to detect true patients and non-patients. The larger the value, the better the screening experiment is and the greater its authenticity. After the quality assessment is completed, the node's updated parameters and assessment results will be sent to MQchain as transactions, and all transactions will be temporarily retained in the transaction pool; at this time, the transactions sent to the transaction pool will be divided according to the threshold, and the nodes with update quality higher than the threshold will be placed in the update aggr In the collection, those below the threshold are placed in the update collection.
6. The dual blockchain data sharing and reputation management method according to claim 4 is characterized in that: Step S33 specifically includes: after receiving the new block, other participating nodes will verify it; the verification content includes the block format and whether the quality of the mining node is higher than their own; when more than half of the verifications are passed, PoQ is completed and the new block is put on the chain; then the participating nodes obtain the global model parameters from MQchain for training until the global model achieves the task goal.
7. The dual blockchain data sharing and reputation management method according to claim 4 is characterized in that: In step S4, RIchain evaluates the reputation of participating nodes and provides incentives based on their performance on MQchain, which specifically includes the following steps: S41: Node participation in aggregation is considered a positive event, and non-participation in aggregation is considered a negative event; considering the difference in the interaction effects between positive and negative events, as well as the influence of node training time and data volume, the direct reputation of the node is calculated using a subjective logic model; S42: Using the index query mechanism, the index of the node's reputation block is saved in the RIchain block header, so as to quickly find the node's historical reputation; then the node's historical reputation is combined with the direct reputation to calculate the node's final reputation; S43: Consider the direct reputation of the node through the incentive mechanism and calculate the incentive obtained by the node in this federated learning task.
8. The dual blockchain data sharing and reputation management method according to claim 7 is characterized in that: Step S41 specifically includes: using the subjective logic model to calculate the direct reputation of the node; considering the node's participation in aggregation as a positive event, and not participating in aggregation as a negative event; first considering the difference in interaction effects, there are Among them, α represents the number of positive events, that is, the number of times they participated in the aggregation; β represents the number of negative events, that is, the number of times they did not participate in the aggregation; k represents the weight of the positive event, η represents the weight of the negative event, k+η=1, and k≤η; s ij represents the probability of successful transmission, then u ij represents the probability of transmission failure; b ij represents the proportion of positive events of participating task node j in the process of participating in the task of releasing task node i; d ij It represents the proportion of negative events of participating task node j in the process of participating in the task of releasing task node i; Considering the impact of training time on reputation, that is, the shorter the time to complete local training, the higher the node reputation, then: Among them, L T represents the average time of local training of participating nodes; G T represents the average time of global training; a negative exponential function is used to control the influence of the training time ratio, and a represents the influencing parameter; considering the influence of the amount of data held by the node on the evaluation, the original formula is changed to: Among them, L d Indicates the amount of data owned by the participating nodes; G d Represents the sum of the data owned by all participating nodes; the final node’s direct reputation is: T d_ij =b ij +γu ij Among them, γ represents the proportion of uncertainty; T d_ij It represents the direct reputation evaluation of task issuing node i on task participating node j.
9. The dual blockchain data sharing and reputation management method according to claim 8, characterized in that: Step S42 specifically includes: using the index query mechanism to quickly find the historical reputation of the node; adding a participating node set participants to the block header of RIchain set , stores the participating nodes included in the current block, and the index of the previous block containing node transactions; Denote the direct reputation of a node as T d , the node's historical reputation is used as an indirect evaluation T r , then the final evaluation T is: T=(1-ε)T d +εT r Among them, ε is a function that represents the proportion of indirect evaluation in the total evaluation, which is affected by the time residual value θ and the task similarity ω; the calculation formula of the residual value θ is as follows: Each block in the evaluation chain is calculated as a time period, t n Indicates the time period of the current block; t c Indicates the time period of the last block that evaluated the node; t t is the forgetting factor, when t t =1, it means that the indirect evaluation has the maximum value only in the current block, and the further away from the current block time period, the less its residual value; γ t It is an adjustable parameter; The task similarity ω is calculated using the Jaccard similarity coefficient; assuming that the feature vector of this round of tasks is represented by D = {d1, d2, …, d n }, the feature vector of the historical task is expressed as R = {r1, r2, …, r n }, then: Then the value of ε is:
10. The dual blockchain data sharing and reputation management method according to claim 9, characterized in that: In step S43, the incentive obtained by the final node is: Where n represents the number of participating nodes; The formula of the activation function is: Where ΔT = T d -0.5, μ is the influence factor of incentive, which controls the growth degree of incentive.
Citation Information
Patent Citations
High-quality federal learning system and learning method based on block chain and reputation mechanism
CN114154649A
Asynchronous federal learning method and system based on block chain
CN114491623A