Medical blockchain data sharing method based on double-mass threshold and federated learning

By introducing blockchain and a dual quality threshold mechanism into federated learning, combined with random response and differential privacy technologies, the problems of privacy leakage, untrusted servers, and malicious node attacks in medical data sharing are solved, achieving secure and efficient medical data sharing and model training.

CN119995888BActive Publication Date: 2026-02-06CHONGQING UNIV OF POSTS & TELECOMM
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411901370.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2026-02-06
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

Existing federated learning methods pose risks to privacy in medical data sharing, include untrusted central servers, difficulty in defending against malicious node poisoning attacks, and the impact of noise on model performance, which are particularly serious in medical diagnostic scenarios.

Method used

We employ a method based on dual quality thresholds and federated learning, using blockchain to replace the central server, combining random response and differential privacy technologies for privacy protection, filtering malicious nodes through dual quality thresholds, and designing a reputation incentive mechanism to improve model performance and resist poisoning attacks.

Benefits of technology

Effectively protects privacy, reduces the impact of noise on model performance, improves training efficiency, resists malicious node attacks, and ensures the security and accuracy of medical data sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119995888B_ABST
    Figure CN119995888B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of medical blockchain data sharing methods based on double mass threshold and federal learning, belong to computer technology field.The method is:1, publishing node publishes task and is built committee;2, participating node downloads global model parameter from blockchain, carries out local model training in combination with random response and differential privacy technology;3, the node of completion training uploads local model parameter to blockchain, committee election mining node downloads all transactions from blockchain and calculates quality, only the node passing through quality threshold can participate in model aggregation and calculate contribution value as its aggregation weight;4, mining node updates the reputation information of each node and is packed into new block with global model parameter;5, other committee node verifies new block, after verification, new block is chained, while adjusting committee composition.The present application can resist the problem of poisoning attack existing in federal learning, while protecting data privacy and reducing the influence of noise on model performance.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of computers and relates to a medical blockchain data sharing method based on double quality thresholds and federated learning. BACKGROUND

[0002] The rapid development of the Internet of Things (IoT) has revolutionized many application fields, and the integration of IoT technology and various medical devices has given birth to the Internet of Medical Things (IoMT). A large amount of medical data is generated every day in the medical field, and with the help of these medical data, high-quality deep learning models can be trained to provide diagnostic assistance for doctors, thereby improving the efficiency of medical services. However, relying solely on data from a single institution to build models often encounters challenges such as limited distribution of training samples and lack of data volume. In addition, since medical data often involves patient personal information and disease privacy, it needs to be highly confidential. Federated learning (FL) can solve the above problems. As a distributed machine learning framework, federated learning supports data sharing without leaving the local data of medical institutions. Multiple medical institutions use local medical data to train models, and then upload model parameters to a central aggregator for aggregation to obtain a global model. FL solves the problem of data silos and does not require data to be moved out of the local area, reducing the risk of data privacy leakage. However, current FL has the following two problems in actual application.

[0003] The first problem is that the method of parameter exchange in FL still has the risk of privacy leakage, and attackers can obtain specific privacy information of the model through inference attacks and model inversion attacks.

[0004] The second problem is that in FL, the central server is relied on for model aggregation, which cannot guarantee the trustworthiness of the central server and is prone to single-point failure. In addition, current FL cannot effectively resist poisoning attacks by malicious nodes. Label flipping attack, as a kind of poisoning attack, can modify the labels of local training data and then upload the poisoned local model for aggregation, ultimately causing the prediction accuracy of the global model to decrease or even fail to converge, which is fatal to medical scenarios that have high requirements for model prediction performance. False medical diagnosis will lead to serious consequences.

[0005] For problem one, there are currently many solutions to solve this problem. Homomorphic encryption (HE) can protect intermediate results, but it will bring heavy computational overhead. At the same time, since encrypted data usually occupies more space than plaintext data, using homomorphic encryption will increase the cost of network transmission. Differential privacy (DP) can add noise to the original gradient or parameter to achieve privacy protection effect, but the addition of noise will affect the accuracy of the model training result, which is unacceptable in medical scenarios that require high accuracy. It is necessary to balance privacy and model performance.

[0006] For the second question, due to the characteristics of decentralization and tamper resistance of the blockchain, the combination of FL can solve the problem of single point failure, replace the central server of traditional FL to aggregate the model, but still cannot resist the poisoning attack of malicious nodes. The existing method focuses on reducing the weight proportion of malicious nodes in aggregation, but cannot fundamentally solve the problem. In addition, the lack of effective reputation evaluation and incentive mechanism to punish malicious nodes and low-quality nodes. Therefore, it is necessary to consider the above problems comprehensively, and design a medical data sharing method considering security and practicality. SUMMARY

[0007] Therefore, the purpose of the present application is to provide a medical blockchain data sharing method based on double quality threshold and federated learning, which can protect privacy data, reduce the impact of noise on model performance, improve the training efficiency of federated learning, and resist the poisoning attack of malicious nodes. Finally, the reputation incentive management of these nodes is carried out.

[0008] In order to achieve the above purpose, the present application provides the following technical scheme:

[0009] A medical blockchain data sharing method based on double quality threshold and federated learning, comprising the following steps:

[0010] S1: The task publishing node publishes the federated learning training task, and uploads the initial model to the blockchain. All nodes register their information on the blockchain, and randomly select nodes to form a committee;

[0011] S2: The participating nodes download the latest global model parameters from the blockchain, use the local data set to train the model, and combine the random response and differential privacy technology to protect the privacy of the model gradient;

[0012] S3: The participating nodes that complete the training upload the local model parameters to the blockchain in the form of transactions. The committee selects the node with the highest reputation as the mining node and calculates the training quality of each participating node to evaluate whether the node can participate in the aggregation of the global model parameters. Then, the participation degree of the participating node in the past aggregation is calculated, and finally the contribution value of the node is calculated according to the training quality, local data set and participation degree. According to the weight of the contribution value, the global model parameters are aggregated;

[0013] S4: The mining node calculates the reputation value and reward and punishment incentive of each node according to the performance of each node in the current iteration training and the past performance, and packs the reputation incentive information and global model parameters of all nodes into a new block;

[0014] S5: Other committee nodes receive the new block and verify it. If more than half of the committee nodes verify it, the new block is saved to the blockchain, and the composition of the committee nodes is adjusted.

[0015] Further, the specific process of step S1 includes that the system model is composed of four parts of a task publishing node, a blockchain, a task participating node and a committee. The task publishing node is responsible for formulating a federated learning task and a reward mechanism to attract nodes to participate, and at the same time, needs to upload the initial model to the blockchain through a transaction. The blockchain replaces the original central server in federated learning, because it can provide the characteristics of data that cannot be tampered with and is open and transparent, so as to ensure that all key data such as task publishing, participant information and model parameter reputation are safely saved, and the transparency and credibility of the system are increased. The task participating node is an entity that provides data, and is responsible for obtaining the task from the chain to locally train the model. The committee members are selected from the task participants with good performance in each round, and are responsible for packaging blocks, aggregating models and reaching consensus. After being selected into the committee, the nodes do not participate in model training tasks. All nodes need to register information and create an account on the blockchain when they first join the system, and the initial committee members are randomly selected from the nodes.

[0016] Further, the specific process of step S2 includes that the publishing node will upload the initial global model parameters of the task to the blockchain at the beginning; first, the participating node downloads the latest global model parameters of the e-th iteration from the blockchain

[0017] Extract a small batch of data d in each iteration in the local data set D, and calculate the gradient of each data d i in d. In order to prevent the influence of individual gradient on model update, gradient clipping is needed, and the clipped gradient is:

[0018]

[0019] Where C is the gradient clipping threshold, and the above formula means that when the 2-norm of the gradient is less than the clipping threshold C, the gradient is retained as the original value, and when the 2-norm of the gradient is greater than the clipping threshold C, the gradient is limited to C. Because if the range of ||g i ||2cannot be determined, the sensitivity cannot be calculated, and DP noise cannot be added. According to the definition of sensitivity, the sensitivity is calculated as:

[0020]

[0021] Where D is the size of the local data set. The sensitivity obtained by calculation can be used to calculate the noise scale. In this paper, Gaussian noise is adopted, and the noise scale is: ​​

[0022]

[0023] where ε k = ε / E G , ε is the global privacy budget, E G is the global training round, ε k refers to the privacy budget consumed by the current round of information exposure of the node, and δ is the probability of information leakage. Random response is introduced into the differential privacy mechanism to interfere with the gradient, and the disturbed gradient is:

[0024]

[0025] where r i is the random probability of node i; finally, the local training model parameters in the kth round are updated as:

[0026]

[0027] where in the first iteration is replaced by the initial global model parameters γ is the learning rate.

[0028] Further, in step S3, the committee selects the node with the highest reputation as the mining node to download all transactions from the blockchain for model aggregation, which includes the following steps:

[0029] S31: The mining node calculates the local model training quality of the participating nodes and divides them into sets according to different quality thresholds.

[0030] S32: Calculate the participation of the participating nodes in the past aggregation, and then calculate the contribution value of each node according to the training quality, local data set and participation.

[0031] S33: Calculate the node aggregation weight of different sets according to the contribution value and aggregate the model parameters.

[0032] Further, in step S31, after the participating nodes upload the local training model parameters to the blockchain, the committee members summarize them according to the proportion of the local data set of each participating node as the weight, calculate its accuracy ACC all in the test set, and then summarize the model parameters without participating node i and calculate its accuracy ACC noi , then the model training quality of participating node i in the tth round of training can be expressed as:

[0033]

[0034] The model performance is expressed by precision, and if the training quality of participating node i is It indicates that the node participates in aggregation to improve the performance of the model.

[0035] To resist the poisoning attack of malicious nodes, we set two quality thresholds Q Hth and Q Lth , and divide the nodes into three sets; the nodes below Q Lth are assigned to Set low , the nodes between Q Lth and Q Hth are assigned to Set accept , and the nodes above Q Hth are assigned to Set high .

[0036] Further, in step S32, we consider not only the local device dataset size of the participating node, but also the training quality of the participating node after each round of training and introduce a node participation degree. The node contribution value is represented as:

[0037]

[0038] wherein represents the contribution value of participating node i in the tth round, represents the proportion of the local device dataset size of participating node i, represents the quality of participating node i in the tth round of training, is the node participation degree we introduced. The participation degree is calculated by the exponential weighted moving average method (EWMA), which is specifically represented as:

[0039]

[0040] wherein represents the participation degree of participating node i in the last round, θ represents the decay factor, θ≥0.9, and are the indication functions of whether participating node i enters Set high or Set accept to participate in aggregation in the tth round of aggregation. If the node enters Set high to participate in aggregation, if the node enters Set accept to participate in aggregation, if the node does not participate in aggregation, α and β represent the weight parameters of the indication functions and , and α+β=2, α>β, indicating that the node enters Set high to participate in aggregation and enters Set acceptThe participation of the participating nodes is different, and the more times the participating nodes enter the high-quality set, the higher the participation is.

[0041] Further, in step S33, the set Set high and the set Set accept The aggregation weights of the participating nodes in the set Set

[0042]

[0043]

[0044] According to the aggregation weights, the model parameters of the nodes in the set Set high and the set Set accept are aggregated respectively:

[0045]

[0046] wherein represents the local model parameters of the participating node i in the tth round, and the final aggregated global model parameters are:

[0047]

[0048] wherein λ and η are the aggregation weights of the set Set high of the aggregated model parameters and the set Set accept of the aggregated model parameters The weights of the global model parameters in the aggregation, in order to improve the performance of the model, make the high-quality set Set high of the aggregated model parameters have a greater weight.

[0049] Further, in step S4, the mining node calculates the reputation value and incentive of each node according to the performance of each node in the current round of iteration and combines the past performance, packs the reputation incentive information and global model parameters of all nodes into a new block, which includes the following steps:

[0050] S41: Calculate the reputation and incentive of the participating nodes;

[0051] S42: Calculate the reputation and incentive of the committee members, and the mining node packs the global model parameters and node reputation incentive information into a new block and submits it to other committee members for verification.

[0052] Further, in step S41, in order to reasonably reflect the performance reputation of the nodes, we consider the performance reputation of the participating nodes in the tth round of model aggregation and the historical performance reputation. The change of the income of the participating nodes in each round is changed according to the change of the reputation value of each round, and the final reputation of the node i is and the change of the income Yi t may be expressed as:

[0053]

[0054] where represents the historical accumulated reputation of node i, and represents the change value of the reputation of node i after each iteration.

[0055] is the performance reputation of node i in the tth round, which is the main influence value of the change of node reputation. According to the participation of node in each round, the reputation of node is calculated as the criterion, and then

[0056]

[0057] u i is the probability of successful transmission of local model parameters by node i, and τ is the reputation compensation factor. The local model parameters are not successfully received, which may be due to unstable network connection, and it is not necessarily the responsibility of the participating node, so it needs to be compensated. ψ and ζ are the sensitivity of the quality contribution to the performance reputation of node i in the tth round, and in order to increase the punishment of malicious nodes and nodes with poor performance, the sensitivity is set as ψ < ζ.

[0058] is the historical performance reputation of node i, which will be updated according to the conditions such as entering different sets and participating in aggregation in each iteration, is expressed as:

[0059]

[0060] where s i represents the historical performance score of node i:

[0061] represents the number of times that node i passes Q Lth represents the number of times that node i does not pass Q Lth represents the number of times that node i passes Q Hth represents the number of times that node i passes the quality threshold Q Lth but does not pass the quality threshold Q Hth k and g are and weight parameters, in order to increase the punishment when node does not pass Q Lth , set k + g = 1, k < g, and​​​​ is and the weight parameter, in order to reflect the performance of the Q Hth is better than only through the Q Lth , set so that the node through the Q Hth the more the reputation increases faster.

[0062] The reputation value plays a leading role in the change of node reputation, considering the historical performance reputation can achieve a supplementary balance. Because the historical performance reputation will be updated according to which set the node enters each round, if the node i performs badly this round, the updated will be reduced, if the updated historical performance reputation is still positive, considering that node i has performed well before, plus the updated , the influence of is reduced. Conversely, if node j performs badly in the previous few rounds, but suddenly performs well in the tth round, its reputation value will increase, is a positive number, but still needs to consider if the updated is negative, then reduce its reputation increase this round.

[0063] Further, in step S42, the reputation of the committee members needs to be stably obtained, and the income changes accordingly according to the change of its reputation, and the reputation and income are as follows:

[0064]

[0065] N C is the number of committee members, N P is the number of participating nodes, x and y are the reputation change factors of committee nodes. When a block is added to the chain, the node in N C increases its reputation if it is verified, otherwise it reduces its reputation; when a block is not added to the chain, the node in N C reduces its reputation if it is verified, otherwise it increases its reputation. In order to increase the punishment for false verification, set x < y.

[0066] In our method, the committee plays an important role in aggregating the global model and verifying the legality of new blocks, so in the selection of committee members, the addition of malicious nodes should be reduced, therefore the selection of committee members follows the following rules:

[0067] When the node joins the system, it needs to register information on the blockchain, and each node will obtain an initial reputation value, in the initial stage, N P are randomly selected from N C , then NC The node with the highest reputation is selected as a mining node to perform operations such as packing a new block in an aggregation model and leaving a signature of itself, and other N C The signature in the new block is verified by other nodes to determine whether it is a mining node and whether it contains the hash value of the previous block, and a transaction in the new block is randomly selected for verification to determine whether the calculation is correct. When the number of verified nodes exceeds half, the new block is added to the blockchain. After each round, the mining nodes and the nodes that make mistakes are removed from the committee and are selected again from the participating nodes. First, it is determined whether the node participated in the aggregation of the global model in this round, that is, whether the reputation value is greater than 0, and then a weighted average is randomly selected from the nodes that meet the condition according to the size of the reputation value .

[0068] The beneficial effects of the present application are as follows:

[0069] 1) The present application proposes a privacy protection mechanism that combines random response and differential privacy technology, which provides privacy protection for the model while reducing the impact of noise on the performance of the model and reducing the computational time of local model training.

[0070] 2) The present application designs an aggregation mechanism with double quality thresholds to filter out malicious nodes and low-quality nodes, and to assign weights to the nodes that pass through different thresholds according to their contribution values when aggregating the global model, which can effectively improve the model performance and resist poisoning attacks.

[0071] 3) The present application designs a reputation incentive evaluation mechanism according to the historical performance of the nodes, which can effectively encourage the nodes to participate honestly and punish the malicious behavior of the nodes.

[0072] Other advantages, objects and features of the present application will be set forth in part in the following specification, and in part will become apparent to those skilled in the art upon examination of the following specification, or can be learned by practice of the present application. The objects and other advantages of the present application can be realized and attained by the methods and instrumentalities particularly pointed out in the following description. BRIEF DESCRIPTION OF DRAWINGS

[0073] In order to make the objects, technical solutions and advantages of the present application clearer, the preferred embodiments of the present application will be described in detail below with reference to the accompanying drawings, in which:

[0074] Figure 1 The working process of the medical blockchain data sharing method based on double quality thresholds and federated learning of the present application;

[0075] Figure 2 The system composition of the medical blockchain data sharing method based on double quality thresholds and federated learning of the present application; DETAILED DESCRIPTION

[0076] The present application can be implemented or applied in other different specific embodiments, and the details in the specification can be modified or changed based on different views and applications without departing from the spirit of the present application. It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0077] Referring to Figure 1 and Figure 2 , the present application provides a medical blockchain data sharing method based on double mass threshold and federated learning, as shown in Figure 1 , the method mainly includes the following steps:

[0078] Step 1: The task publishing node publishes the federated learning training task and uploads the initial model to the blockchain. All nodes register their information on the blockchain and randomly select nodes to form a committee.

[0079] Step 2: The participating nodes download the latest global model parameters from the blockchain, use the local data set for model training, and combine random response and differential privacy technology to protect the model gradient privacy;

[0080] Step 3: The participating nodes that complete the training upload the local model parameters to the blockchain in the form of transactions. The committee determines which nodes can participate in the aggregation of global model parameters through the quality threshold, then calculates the participation degree of the participating nodes in the past participation aggregation, and finally calculates the contribution value of the node through the training quality, local data set and participation degree. According to the weight of the contribution value, the global model parameters are aggregated;

[0081] Step 4: The mining node calculates the reputation value and incentive of each node according to the performance in this round of iteration training and the past performance, and packs the reputation incentive information and global model parameters of all nodes into a new block;

[0082] Step 5: After receiving the new block, the other committee nodes verify it. After more than half of the committee nodes pass the verification, the new block is saved to the blockchain, and the composition of the committee nodes is adjusted.

[0083] Figure 2 The system block diagram of the present application mainly consists of task publisher, blockchain, task participant and committee. The following will be described in conjunction with the drawings, including the following steps:

[0084] 1) The task publisher publishes the federated learning training task and uploads the initial model and reward mechanism to the blockchain through transactions.

[0085] 2) All nodes first need to register their own information on the blockchain, such as address, ID, initial reputation, initial account, etc., and then download the initial model from the blockchain.

[0086] 3) Participants use local data sets for model training, and to prevent inference attacks, add Gaussian noise to the training data gradient using differential privacy.

[0087] 4) The task participants upload the local model parameters after training to the blockchain transaction pool in the form of transactions.

[0088] 5) The committee selects the node with the highest reputation as the mining node and downloads all participant local model parameters from the blockchain for aggregation.

[0089] 6) The mining node first evaluates whether the node can participate in the aggregation of the global model parameters by calculating the training quality of each participant node based on the local model parameters, then calculates the participation degree of each participant in the past aggregation, and finally calculates the contribution value of the node based on the training quality, local data set, and participation degree, and aggregates the global model parameters according to the weight of the contribution value.

[0090] 7) The mining node calculates its reputation value based on the performance of each node in the current iteration training and combines the past performance to calculate the reward and punishment incentive based on the change in the current reputation value.

[0091] 8) The mining node packages all the node reputation incentive information and global model parameters into a new block and broadcasts it to other committee nodes for verification.

[0092] 9) After obtaining more than half of the verification, the new block is added to the blockchain.

[0093] 10) The task publisher downloads the final global model of the current training from the blockchain and uses it as the initial model for the next iteration training

[0094] Optionally, Figure 2 Step 3) of the above is a local training process protected by random response differential privacy, which specifically includes:

[0095]

[0096] Optionally, Figure 2 Step 6) of the above is based on the local model parameters sent by the participating nodes to aggregate the global model parameters, which specifically includes:

[0097]

[0098]

[0099] Optionally, Figure 2 Steps 7), 8), 9) of the reputation evaluation and incentive calculation, packing new blocks, consensus verification, specifically:

[0100] Reputation evaluation and incentive calculation: comprehensive consideration of the performance reputation of participating nodes in the tth round of model aggregation and historical performance reputation. While the change of the income of each round of participating nodes is changed according to the corresponding change of the reputation of each round, the final reputation of node i And the change of the income of each round Y i t Can be expressed as:

[0101]

[0102] Wherein Represents the historical cumulative reputation of node i, And Represents the change value of the reputation of node i after each round of iteration.

[0103] Is the performance reputation of node i in the tth round, which is also the main influence value of the change of the reputation of the node. According to the participation of the node in each round of aggregation as the judgment standard, the reputation of the node is calculated respectively, then:

[0104]

[0105] u i Is the probability of successful transmission of local model parameters of node i, τ is the reputation compensation factor. The local model parameters are not successfully received, which may also be due to unstable network connection, and it is not necessarily the responsibility of the participating node, so it needs to be compensated. ψ and ζ are the sensitivity of the quality contribution to the performance reputation of node i in the tth round, and in order to increase the punishment of malicious nodes and nodes with poor performance, the sensitivity is set as ψ < ζ.

[0106] Is the historical performance reputation of node i, which will be updated according to the conditions such as the entry of the node into different sets in each round of iteration and whether to participate in aggregation, Indicated as:

[0107]

[0108] Wherein s i Indicates the historical performance score of node i:

[0109] Indicates the number of times that node i passes Q Lth , and Indicates that node i does not pass QLth the number of times, denotes the number of times node i passes Q Hth the number of times, denotes the number of times node i passes the quality threshold Q Lth but does not pass the quality threshold Q Hth the number of times, k and g are and weight parameters of Lth to increase the penalty for nodes that do not pass Q Hth , set k+g = 1, k < g, and are and weight parameters of Lth to reflect that the performance of passing Q Lth is better than only passing Q Hth , set so that the more times a node passes Q Hth , the faster the reputation increases.

[0110] The reputation of the committee members needs to be stably obtained, and the income changes accordingly according to the change of their reputation, and the reputation and income are as follows:

[0111]

[0112] N C is the number of committee members, N P is the number of participating nodes, and x and y are reputation change factors of committee nodes. When a block is added to the chain, the nodes in N C increase their reputation if they pass the verification, and vice versa; when a block is not added to the chain, the nodes in N C decrease their reputation if they pass the verification, and vice versa. In order to increase the penalty for false verification, set x < y.

[0113] Packing new blocks and consensus verification: In our method, the committee plays an important role in aggregating global models and verifying the legitimacy of new blocks, etc. Therefore, the selection of committee members should reduce the addition of malicious nodes, so the selection of committee members follows the following rules:

[0114] When a node joins the system, it needs to register information on the blockchain, and each node will obtain an initial reputation value. In the initial stage, N P are randomly selected from N C , and then the node with the highest reputation is selected from N C as a mining node to aggregate models, pack new blocks, etc. and leave its signature, and the other N CThe nodes verify whether the signature in the new block is of the mining node, whether it contains the hash value of the previous block, and randomly select a transaction in the new block for verification to confirm whether the calculation is correct. When the number of nodes that pass the verification exceeds half, the new block is added to the blockchain. After each round, the mining nodes and the nodes that fail the verification are removed from the committee and are selected again from the participating nodes. First, it is determined whether the node participated in the aggregation of the global model in this round, i.e., whether the reputation value is greater than 0, and then a weighted average is taken of the nodes that meet the condition according to the size of their reputation values to randomly select.

[0115] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the purpose and scope of the technical solutions, and they should all be included in the scope of the claims of the present application.

Claims

1. A medical blockchain data sharing method based on double mass threshold and federated learning, characterized in that: The method comprises the following steps: S1: a task publishing node publishes a federated learning training task, and uploads an initial model to a blockchain, and all nodes register their information on the blockchain, and randomly select nodes to form a committee; S2: the participating nodes download the latest global model parameters from the blockchain, train the model using local data sets, and combine random response and differential privacy technology to protect the privacy of the model gradient; S3: the participating nodes that complete the training upload the local model parameters to the blockchain in the form of a transaction; the committee selects the node with the highest reputation as a mining node, evaluates whether the node can participate in the aggregation of the global model parameters by calculating the training quality of the local model parameters of each participating node, then calculates the participation degree of the participating node in the past aggregation, and finally calculates the contribution value of the node by the training quality, the local data set and the participation degree, and aggregates the global model parameters according to the weight of the contribution value; S4: the mining node calculates the reputation value and incentive of each node according to the performance of each node in the current iteration training and the past performance, packs the reputation incentive of all nodes and the global model parameters into a new block; wherein C is a gradient clipping threshold, and the above formula indicates that when the 2-norm of the gradient is less than the clipping threshold C, the gradient is retained as the original value, and when the 2-norm of the gradient is greater than the clipping threshold C, the gradient is limited to C; the sensitivity is calculated according to the definition of sensitivity as follows: The step S2 specific process includes: the publishing node will initially download the initial global model parameters of the task from the blockchain at the beginning First, the participating nodes download the latest global model parameters of the e-th round of iteration from the blockchain Local model training; Extract a small batch of data d in each iteration in the local data set D, calculate the gradient of each data d in d i Gradient clipping is performed on the gradient, and the gradient after clipping is:​ The specific process of the step S1 comprises that the system model comprises four parts of a task publishing node, a blockchain, a task participating node and a committee; the task publishing node is responsible for formulating a federated learning task and an incentive mechanism to attract nodes to participate, and uploads an initial model to the blockchain in the form of a transaction; the blockchain replaces the original central server in federated learning, provides the characteristics of data that cannot be tampered with and is open and transparent, ensures that the task publishing, participant information and model parameter reputation are safely saved, and increases the transparency and credibility of the system; the task participating node is an entity that provides data, and is responsible for obtaining the task from the chain to locally train the model; the committee members are selected from the task participants with good performance in each round, and are responsible for packaging blocks, aggregating models and reaching consensus; after being selected into the committee, the nodes do not participate in the model training task, and all nodes need to register information on the blockchain and create an account when initially joining the system, and the initial committee members are randomly selected from the nodes. where D is the local dataset size; the sensitivity calculated by the calculation can calculate the noise scale, and the Gaussian noise is adopted The noise scale is: where ε k = ε / E G , ε is the global privacy budget, E G is the global training round, ε k refers to the privacy budget consumed by the current round of information exposure of the node, and δ is the probability of information leakage; the random response is introduced into the differential privacy mechanism to interfere with the gradient, and the disturbed gradient is: where r i is a random probability; finally, the kth round of local training model parameters is updated: where the first round of iterations is to replace the initial global model parameters γ is the learning rate, is the set of gradients after the noisy perturbation.

2. The dual-mass threshold and federated learning based medical blockchain data sharing method of claim 1, wherein, In the step S3, the committee selects the node with the highest reputation as a mining node to download all transactions from the blockchain for model aggregation, which specifically comprises the following steps: 3.The dual-mass threshold and federated learning based medical blockchain data sharing method of claim 1, wherein, S31: the mining node calculates the local model training quality of the participating nodes and divides the nodes into different sets according to different quality thresholds; S32: the participation degree of the participating nodes in the past aggregation is calculated, and then the contribution value of the node is calculated by the training quality, the local data set and the participation degree; S33: the aggregation weight of the nodes in different sets is calculated according to the contribution value, and the model parameters are aggregated. ​ 4. The dual-mass threshold and federated learning based medical blockchain data sharing method according to claim 3, characterized in that, In the step S31, the local training model parameters of the participating nodes are uploaded to the blockchain, and then the committee members summarize them according to the proportion of the local data set of each participating node as a weight, and calculate the accuracy ACC in the test set all Then, the model parameters not containing the participating node i are summarized, and the accuracy ACC is calculated noi The model training quality of the participating node i in the tth training round can be represented as: The model performance is expressed in terms of accuracy, if the training quality of the participating node i then it is stated that the participation of this node in the aggregation has a positive effect on the performance of the model; Two quality thresholds Q Hth and Q Lth are set and the nodes are divided into three sets; nodes below Q Lth are put into Set low , nodes between Q Lth and Q Hth are put into Set accept , and nodes above Q Hth are put into Set high .

5. The dual-mass threshold and federated learning based medical blockchain data sharing method of claim 3, wherein, In step S32, in addition to considering the local device data set size of the participating node, the training quality of the participating node after each round of training is also considered, and the participation degree of the introduced node is considered. The node contribution value is represented as: wherein represents the contribution value of participating node i in the tth round, represents the proportion of the local device data set size of participating node i, represents the quality of participating node i in the tth round of training, is the participation degree of the node we introduced; the participation degree p i The calculation method of t is that we use the exponential weighted moving average method (EWMA), which is specifically represented as: wherein denotes the participation degree of the participating node i in the last round, and θ denotes a decay factor, θ≥0.9, and is whether the participating node i enters the set Set high or the set Set accept is an indicator function of participating in aggregation, if the node enters the set Set high participates in aggregation, then if the node enters the set Set accept participates in aggregation, then if the node does not participate in aggregation, then α and β are weight parameters of the indicator function and , and α+β=2, α>β, indicates that the node enters the set Set high participates in aggregation and enters the set Set accept participates in aggregation, and the participation degree is different, the more times the participating node enters the high-quality set, the higher the participation degree.

6. The dual-mass threshold and federated learning based medical blockchain data sharing method of claim 3, wherein, In the step S33, the aggregation weight of the tth round of aggregation of the participating node in the set Set high and the set Set accept is respectively represented as: aggregating the model parameters of the nodes in the set Set high and the set Set accept respectively according to the aggregated weights. wherein denotes the set Set high the local model parameters of node i in round t, denotes the set Set accept the local model parameters of node j in round t, the final aggregated global model parameters: where λ and η are sets Set high Aggregated model parameters and Set accept Aggregated model parameters Weight taken in the aggregation of global model parameters.

7. The dual-mass threshold and federated learning based medical blockchain data sharing method of claim 1, wherein, In step S4, the mining node calculates the reputation value and incentive of each node based on its performance in the current iteration training and combines the past performance, packages the reputation incentive of all nodes and the global model parameters into a new block, which includes the following steps: S41: Calculate the reputation and incentive of the participating node; S42: Calculate the reputation and incentive of the committee members, and the mining node packages the global model parameters and node reputation incentive into a new block and submits it to other committee members for verification.

8. The dual-mass threshold and federated learning based medical blockchain data sharing method according to claim 7, characterized in that, The change of the income of the participating node in each round in the step S41 changes according to the change value of the reputation of the node in each round, and the final reputation of the node i and the change of the income Y in each round i t may be represented as: wherein represents the historical accumulated reputation of node i, and represents the change value of the reputation of node i after each iteration. is the performance reputation of node i in the tth round, and the reputation of the node is calculated according to whether the node participates in aggregation in each round as the evaluation standard, then: u i is the probability that node i successfully sends the local model parameters, τ is the reputation compensation factor; ψ and ζ are the quality contribution influence the sensitivity of node i's performance reputation at the tth round, the sensitivity is set as ψ < ζ; is the historical performance reputation of node i, which will be updated according to whether the node enters different sets in each iteration and participates in the aggregation update, is represented as: where s i represents the historical performance score of node i: represents the number of times node i passed through Q Lth , represents the number of times node i did not pass through Q Lth , represents the number of times node i passed through Q Hth , represents the number of times node i passed through quality threshold Q Lth but did not pass through quality threshold Q Hth , k and g are weight parameters of and , set k+g = 1, k < g, and are weight parameters of and , set so that the more times a node passes through Q Hth the faster its reputation increases.

9. The dual-mass threshold and federated learning based medical blockchain data sharing method according to claim 8, characterized in that, In step S42, the reputation and income of the committee members are as follows: N C is the number of committee members, N P is the number of participating nodes, x and y are the committee node reputation change factors; when a block is added to the chain, N C a node increases its reputation if it is validated, otherwise decreases its reputation; when a block is not added to the chain, N C a node decreases its reputation if it is validated, otherwise increases its reputation, where x < y, represents the reputation change of committee node j in round t, represents the incentive obtained by committee node j calculated through the reputation change after its validation in round i; The committee members select the following rules: When a node joins the system, it needs to register information on the blockchain, and each node will get an initial reputation value, randomly selected from N P in the initial stage C , then select the node with the highest reputation from N C as the mining node to pack the new block in the aggregation model and leave its signature, and other N C nodes verify whether the signature in the new block is that of the mining node, whether it contains the hash value of the previous block, and whether a transaction randomly selected from the new block is calculated correctly; when the number of verified nodes exceeds half, the new block is added to the blockchain; after each round, the mining node and the node that made a mistake are removed from the committee and selected again from the participating nodes, first determine whether the node participated in the global model aggregation in this round, that is, whether the reputation value is greater than 0, then randomly select a weighted average from the nodes that meet the conditions according to the size of their reputation value .

Citation Information

Patent Citations

  • Block chain data sharing method under assistance of asynchronous federated learning

    CN118069607A