CN114491623A - Asynchronous federal learning method and system based on block chain - Google Patents

Asynchronous federal learning method and system based on block chain Download PDF

Info

Publication number
CN114491623A
CN114491623A CN202111653752.4A CN202111653752A CN114491623A CN 114491623 A CN114491623 A CN 114491623A CN 202111653752 A CN202111653752 A CN 202111653752A CN 114491623 A CN114491623 A CN 114491623A
Authority
CN
China
Prior art keywords
node
nodes
conference
global model
reputation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111653752.4A
Other languages
Chinese (zh)
Inventor
高志鹏
李璜琦
林怡静
张莹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN202111653752.4A priority Critical patent/CN114491623A/en
Publication of CN114491623A publication Critical patent/CN114491623A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/20Ensemble learning

Abstract

The invention provides an asynchronous federal learning method and system based on a block chain.A block chain network is introduced on the basis of federal learning, and edge equipment nodes with higher reputation are selected as party nodes for model aggregation and reputation update of all the nodes, so that decentralized of the federal learning process is realized; and sending the global model to the edge device, training by utilizing rich data generated by the edge device, returning an updating parameter of the global model, respectively carrying out model aggregation, reputation updating and consensus authentication based on the conference node, and finally realizing complete federal learning under the condition of successful consensus. In the method, in the model training process, data of the edge equipment does not leave the local, so that the risk of data leakage is reduced, and the privacy of a user is protected; based on block chain network and consensus algorithm, centralization is achieved, single point failure is avoided, and system robustness and expansibility are improved.

Description

Asynchronous federal learning method and system based on block chain
Technical Field
The invention relates to the technical field of electronic data processing, in particular to an asynchronous federal learning method and an asynchronous federal learning system based on a block chain.
Background
With the popularization and development of the internet of things and 4G/5G wireless cellular network technology in the last decade, the number of intelligent terminals at the edge of the network is greatly increased, and large-scale data acquisition and data interaction causes data enrichment at the edge of the network. The massive terminal data can serve for wide artificial intelligence application, enrich life of people and improve productivity and working efficiency of society. By combining edge calculation and AI technology, the local data set of the Internet of things equipment can be directly utilized, real-time decision making and state perception capabilities are provided for the Internet of things equipment, and the complex real-time environment can be better responded. However, if training is performed by directly using a large amount of data of the terminal device, the original data or the intermediate data needs to be transmitted to the outside of the terminal device, and the process obviously needs to deal with the problem of privacy protection.
As a solution with privacy protection attributes, federated learning can use data on terminal devices to complete the task of learning a single global statistical model under the condition of data localization. The federated learning can effectively prevent privacy leakage, and can be trained based on heterogeneous networks and non-independent same-distribution data sets, so that the federated learning method is suitable for complex environments and data sources of edge networks. However, the federal learning architecture still has certain defects when applied to an edge network, for example, centralized federal learning needs to use a central server for scheduling and model aggregation, which causes the federal learning architecture to face a serious single-point failure problem; in addition, under the edge environment that the server node cannot be absolutely trusted, the source of the node is complex, the problems of mutual trust and inconsistent data may exist, and an attacker can disturb the model aggregation process by hijacking the node or injecting a malicious node into the system.
Disclosure of Invention
In view of this, embodiments of the present invention provide an asynchronous federated learning method and system based on a block chain, so as to eliminate or improve one or more defects in the prior art, and solve the problems of mutual distrust among single points, inconsistent data, and disturbed aggregation of malicious nodes in the federated learning process.
The technical scheme of the invention is as follows:
in one aspect, the present invention provides an asynchronous federal learning method based on a blockchain, the method being configured to operate on a blockchain network formed by a plurality of edge devices, each edge device serving as a node, the method operating based on a round-robin, and in each round, the method including:
sequencing all nodes according to the reputation scores of all nodes in the previous round, selecting a first set number of nodes with higher reputation scores as conference nodes, and using the rest nodes as common nodes; the conference node is used for model local training, model aggregation, consensus and reputation update of each node, and the common node is only used for model local training;
each node acquires a current global model in the block chain network, carries out local training on the global model according to a local data set, and broadcasts updating parameters of the global model to all conference nodes;
carrying out reputation score authentication on nodes participating in broadcasting by each conference node, rejecting update parameters broadcasted by nodes with reputation scores lower than a first set value, carrying out local test on the update parameters broadcasted by the rest nodes by each conference node by using local data to obtain verification scores, and carrying out aggregation updating on the update parameters of each node to update a global model; the verification score is obtained by calculating one or more performance parameters;
each conference node gives the authentication scores of the nodes calculated locally to other conference nodes, and each conference node comprehensively calculates the final authentication scores of the nodes locally and calculates and updates the reputation scores according to the final authentication scores of the nodes;
each conference node packages the updated reputation scores of the nodes calculated locally and the global model after aggregation and update, and performs consensus authentication among the conference nodes;
and after the consensus is successful, the blockchain network updates the reputation scores and the global model of each node according to the consensus result.
In some embodiments, after each conferencing node gives the locally computed authentication score of each node to other conferencing nodes, the method further includes:
each conference node delivers the global model updated by local aggregation to other conference nodes, and each conference node performs performance test on the current global model and the updated global model sent by the other conference nodes by using a local data set, wherein the performance test at least comprises accuracy;
and in the performance test process of each conference node, if the performance of the updated global model sent by other conference nodes is lower than that of the current global model, broadcasting prompt.
In some embodiments, after each conferencing node gives the locally computed authentication score of each node to other conferencing nodes, the method further includes:
each conference node delivers the global model updated by local aggregation to other conference nodes, and each conference node performs performance test on the current global model and the updated global model sent by the other conference nodes by using a local data set, wherein the performance test at least comprises accuracy;
in the performance test process of each conference node, if the performance of the updated global model sent by other conference nodes is lower than that of the current global model and the difference exceeds a set threshold, broadcasting prompt is carried out.
In some embodiments, the method further comprises: and setting a termination condition, wherein the termination condition is that all nodes upload the update parameters or rounds at least once to reach a second set number.
In some embodiments, each conference node hands over locally calculated authentication scores for each node to other conference nodes, each conference node locally and synthetically calculating a final authentication score for each node, comprising:
for the conference node m, receiving the authentication scores H calculated by other conference nodes and related to the node n1、H2、H3…HcC is the number of other conference nodes except conference node m in the block network;
scoring verification H1、H2、H3…HcA weighted sum is performed, with the weight of each validation score being proportional to the reputation score of the corresponding conference node.
In some embodiments, the global model is updated by aggregating the update parameters of each node, and the calculation formula is represented as:
w′global←α×wi+(1-α)×wglobal
wherein, wiIs an update parameter, w, uploaded by the ith nodeglobalIs a parameter of the global model, w'globalIs a parameter of the updated global model and α is the aggregation coefficient.
In some embodiments, the calculation of the aggregation coefficient is:
Figure BDA0003445287600000031
wherein l (t- τ) is a function for measuring the update staleness degree, t is the current time, and τ is the generation time of the global model used by the node i;
Figure BDA0003445287600000032
wherein r isiIs the reputation score of node i;
Figure BDA0003445287600000033
is a factor related to the amount of data local to node i;
Figure BDA0003445287600000034
wherein d isiIs the data set size of node i, dallIs the data set size for all nodes, and β and γ are scaling factors.
In some embodiments, the updated reputation score is calculated from the final verification score of each node, with the calculation:
rk=ζ×rk+(1-ζ)×(sk/scompare)2
wherein r iskIs section (III)Reputation score, s, for point kkIs the local update quality of node k, measured by the final verification score of node k, ζ is the coefficient balancing the historical data and the current data, scompareIs a normalized score.
In some embodiments, the verification score is obtained by performing normalization processing on the accuracy and the loss function value and then performing weighted summation.
In another aspect, an asynchronous federated learning system based on blockchains includes:
a blockchain network consisting of a plurality of edge devices, each edge device serving as a node, the blockchain network loading agents and executing the above-described blockchain-based asynchronous federal learning method.
The invention has the beneficial effects that:
in the asynchronous federal learning method and system based on the block chain, a block chain network is introduced on the basis of federal learning, and edge equipment nodes with higher reputations are selected as conference nodes for model aggregation and reputation updating of all nodes, so that decentralization of the federal learning process is realized; and sending the global model to the edge device, training by utilizing rich data generated by the edge device, returning an updating parameter of the global model, respectively carrying out model aggregation, reputation updating and consensus authentication based on the conference node, and finally realizing complete federal learning under the condition of successful consensus. In the method, in the model training process, data of the edge equipment does not leave the local, so that the risk of data leakage is reduced, and the privacy of a user is protected; based on block chain network and consensus algorithm, centralization is achieved, single point failure is avoided, and system robustness and expansibility are improved.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
It will be appreciated by those skilled in the art that the objects and advantages that can be achieved with the present invention are not limited to what has been particularly described hereinabove, and that the above and other objects that can be achieved with the present invention will be more clearly understood from the following detailed description.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principles of the invention. In the drawings:
fig. 1 is a schematic flowchart of an asynchronous federal learning method based on a blockchain according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a logical structure of the block chain-based asynchronous federated learning method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating an asynchronous federal learning method based on a blockchain according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the following embodiments and accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
It should be noted that, in order to avoid obscuring the present invention with unnecessary details, only the structures and/or processing steps closely related to the scheme according to the present invention are shown in the drawings, and other details not so relevant to the present invention are omitted.
It should be emphasized that the term "comprises/comprising" when used herein, is taken to specify the presence of stated features, elements, steps or components, but does not preclude the presence or addition of one or more other features, elements, steps or components.
It is also noted herein that the term "coupled," if not specifically stated, may refer herein to not only a direct connection, but also an indirect connection in which an intermediate is present.
In recent years, blockchains have become a promising, trusted decentralized system solution. The block chain has the characteristics of decentralization, tamper resistance, transparency and the like, and by utilizing the alliance block chain needing identity authentication, federal learning can achieve consensus among nodes which are not trusted with each other, so that the final consistency of a global model and a historical process is ensured. In addition, the federal study is subjected to decentralized modification based on the block chain, and system potential safety hazards such as single-point faults and the like caused by a central server can be eliminated.
Specifically, the invention provides an asynchronous federal learning method based on a blockchain, which is used for running on a blockchain network formed by a plurality of edge devices, wherein each edge device is used as a node, and the edge device can be a mobile terminal such as a mobile phone and a tablet personal computer for a personal user, and can be a machine readable medium or an electronic device such as a host server for an enterprise. The formed block chain network runs related program steps by loading agents.
The method is run based on a round system, and in each round, as shown in fig. 1 and 2, the method includes steps S101 to S106:
step S101: sequencing all nodes according to the reputation scores of all nodes in the previous round, selecting a first set number of nodes with higher reputation scores as conference nodes, and using the rest nodes as common nodes; the conference node is used for model local training, model aggregation, consensus and reputation updating of each node, and the common node is only used for model local training;
step S102: each node acquires the current global model in the block chain network, carries out local training on the global model according to a local data set, and broadcasts the update parameters of the global model to all conference nodes.
Step S103: carrying out reputation score authentication on nodes participating in broadcasting by each conference node, rejecting update parameters broadcasted by nodes with reputation scores lower than a first set value, carrying out local test on the update parameters broadcasted by the rest nodes by each conference node by using a local data set to obtain verification scores, and carrying out aggregation updating on the update parameters of each node to obtain a global model; the verification score is calculated for one or more performance parameters.
Step S104: each conference node gives the authentication scores of the nodes calculated locally to other conference nodes, each conference node comprehensively calculates the final authentication scores of the nodes locally, and calculates and updates the reputation scores according to the final authentication scores of the nodes.
Step S105: and each conference node packages the locally calculated updated reputation scores of the nodes and the aggregated updated global model, and performs consensus authentication among the conference nodes.
Step S106: and after the consensus is successful, the blockchain network updates the reputation scores and the global model of each node according to the consensus result.
In step S101, to avoid the impact of the high latency of the consensus process on the asynchronous aggregation efficiency, the model aggregation and consensus process is limited to be performed in a small-scale conference in the blockchain network. Therefore, the conference nodes are selected from a plurality of nodes forming the block chain network according to set rules for model local training, model aggregation, consensus and reputation updating of each node, and the rest nodes are used as common nodes only for model local training. Specifically, the conference node may be specified by an official agreement, or may be dynamically screened and adjusted according to past reputation scores of each node. In other embodiments, other filtering criteria may be set, such as preferentially selecting a node with higher computational power as the conference node. In this embodiment, each node is ranked according to the reputation score in the previous round, and the nodes with the higher first set number of reputation scores are selected as the conference nodes, so that the reliability can be guaranteed, and the aggregation efficiency can be improved.
It should be noted that, in the present application, the "nodes" refer to all nodes constituting the blockchain network, and the "conference nodes" refer to conference nodes selected in each round for local model training, model aggregation, consensus and reputation update of the nodes.
In step S102, the global model obtained by the previous round of aggregation is sent to each node, and each node trains the global model locally by using the local data set to obtain the update parameter. It should be noted here that, in the form of model training of federal learning, the local data set of each node is not involved in transmission, and the local data is only stored locally at each node to prevent data leakage. Transmitted between the nodes are the parameters of the model. Each node trains the received global model by using local hardware and a local data set, and standards in the training process of each node are kept consistent, such as adopted loss functions are consistent, iteration times or termination conditions are consistent, and the like. And after each node finishes updating, broadcasting the updated parameters to the conference node.
In step S103, each conference node obtains the updated parameters corresponding to all nodes, and each conference node first verifies the reputation score of each node in the previous round, and if the reputation score is lower than a first set value, the updated parameters of the node are removed, so that the influence of a malicious node can be effectively prevented. Each conference node separately conducts performance test and verification on the updated model trained by each node.
Specifically, the performance parameters used for calculating the verification score may include accuracy and a loss function value, and in some embodiments, the verification score formula is obtained by performing normalization processing on the accuracy and the loss function value and then performing weighted summation. In other embodiments, other performance parameters may also be introduced.
Further, each conferencing node locally aggregates the updated parameters broadcast by each node with the global parameters of the previous round.
In some embodiments, the global model is updated by aggregating the update parameters of each node, and the calculation formula is represented as:
w′global←α×wi+(1-α)×wglobal; (1)
wherein, wiIs an update parameter, w, uploaded by the ith nodeglobalIs a parameter of the global model, w'globalIs a parameter of the updated global model and α is the aggregation coefficient.
In some embodiments, the calculation of the aggregation coefficient is:
Figure BDA0003445287600000071
where l (t- τ) is a function that measures how old the update is, t is the current time, and τ is the generation time of the global model used by node i.
Figure BDA0003445287600000072
Wherein r isiIs the reputation score of node i;
Figure BDA0003445287600000073
is a factor related to the amount of data local to node i.
Figure BDA0003445287600000074
Wherein d isiIs the data set size of node i, dallIs the data set size for all nodes, and β and y are scaling factors.
In step S104, an update parameter C trained for a certain node qqFirst, the local data of the conference nodes are shared to each conference node for detection, calculation and verification of frequency division. Therefore, each conference node calculates the updated parameter CqAuthentication scoring of (1) sharing respective pair update parameters C between conferencing nodesqAnd calculating locally by each conference node an updated parameter CqThe final verification score of (1).
Specifically, in step S104, each conference node gives the locally calculated authentication score of each node to other conference nodes, and each conference node locally and comprehensively calculates the final authentication score of each node, which is shown in fig. 2, and includes steps S1041 to S1042:
step S1041: for the conference node m, receiving the authentication scores H calculated by other conference nodes and related to the node n1、H2、H3…HcC is the number of other conferencing nodes except conferencing node m in the block networkAmount of the compound (A).
Step S1042: scoring verification H1、H2、H3…HcAnd performing weighted summation, wherein the weight of each verification score is in direct proportion to the reputation score of the corresponding conference node.
Further, each conference node calculates the updated reputation score of the corresponding node according to the final verification score of each node.
In some embodiments, the updated reputation score is calculated from the final verification score of each node, with the calculation:
rk=ζ×rk+(1-ζ)×(sk/scompare)2; (5)
wherein r iskIs the reputation score of node k, skIs the local update quality of node k, measured by the final verification score of node k, where ζ is the coefficient balancing the historical data and the current data, scompareIs a normalized score.
In step S105, consensus authentication is performed inside each conference node for the updated reputation score of each node calculated by each conference node and the updated global model is aggregated, so as to prevent malicious node attacks or node failures. Specifically, the consensus algorithm may employ a practical byzantine fault tolerance protocol.
In step S106, based on the persistent and unalterable characteristic of the blockchain, the global model generated by each aggregation, the reputation score uploaded by the node and locally updated and other related records are permanently stored in the blockchain. Based on the historical records, the system can quantitatively evaluate the node behaviors of asynchronous federated learning, assign roles to the nodes according to quantitative data and adjust the weight of the nodes in the aggregation process, and can punish malicious nodes, such as excluding the malicious nodes from the federated learning process.
In some embodiments, in step S104, after each conference node gives the locally calculated authentication score of each node to other conference nodes, the method further includes steps S201 to S202:
step S201: each conference node gives the global model updated by local aggregation to other conference nodes, and each conference node performs performance tests on the current global model and the updated global model sent by the other conference nodes by using a local data set, wherein the performance tests at least comprise accuracy.
Step S202: and in the performance test process of each conference node, if the performance of the updated global model sent by other conference nodes is lower than that of the current global model, broadcasting prompt.
In some embodiments, in step S104, after each conference node gives the locally calculated authentication score of each node to other conference nodes, the method further includes steps S301 to S302:
step S301: each conference node gives the global model updated by local aggregation to other conference nodes, and each conference node performs performance tests on the current global model and the updated global model sent by the other conference nodes by using a local data set, wherein the performance tests at least comprise accuracy.
Step S302: in the performance test process of each conference node, if the performance of the updated global model sent by other conference nodes is lower than that of the current global model and the difference exceeds a set threshold, broadcasting prompt is carried out.
In steps S201 to S202 and steps S301 to S302, for the global model aggregated by one conference node, other conference nodes verify the global model by using local data, and if there is insufficient performance, broadcast prompting is performed. Further, whether the conference node cheats exists or not can be judged according to the performance difference, or the aggregation coefficient is adjusted and then the global model is aggregated again and updated.
In some embodiments, the method further comprises: and setting a termination condition, wherein the termination condition is that all nodes upload the update parameters at least once or the round reaches a second set number.
In another aspect, an asynchronous federated learning system based on blockchains includes: a blockchain network consisting of a plurality of edge devices, each edge device serving as a node, the blockchain network loading agents and executing the above-described blockchain-based asynchronous federal learning method.
The invention is illustrated below with reference to specific examples:
the embodiment provides an efficient asynchronous block chain-based federated learning architecture suitable for an edge network. The framework comprises an asynchronous learning mode, a conference consensus and a reputation quantification method, and the throughput rate and the safety of federal learning under an unstable edge network can be improved. A credible decentralized federal learning system with good efficiency is built on the edge network, so that abundant data generated by edge equipment are fully utilized, the quality of an artificial intelligence statistical model is improved, and the environment perception capability of the edge equipment is endowed; the data does not leave the local area, so that the data leakage risk is reduced, and the privacy of the user is protected; single point failure is avoided, and system robustness and expansibility are improved.
The embodiment aims to improve the generation efficiency of the global model through asynchronous aggregation and small-scale consensus, truly record the node behaviors and the aggregation result through the block chain, and search and eliminate malicious nodes according to a reputation mechanism.
Fig. 3 illustrates the framework of the present embodiment and the workflow of the framework when processing a local update. In the present framework, edge devices are divided into two types of nodes, normal nodes and conference nodes. And the common node undertakes the tasks of local training and uploading updating. The conference node is a special node which needs to be responsible for accepting updates of other nodes and aggregating the updates, packaging the aggregation result, the update content and the scores into a block, and uploading the block to a block chain after internal consensus of the conference, wherein the other nodes refer to all the common nodes and the conference node except the current conference node. In a block chain-based federated learning architecture, each time of federated aggregation needs to be determined through consensus, and through a node division mode, the framework limits the consensus process in a small-scale conference, and avoids the influence of high time delay caused by the consensus on asynchronous aggregation efficiency.
Assuming node i uploads a local update, the conferencing node aggregates according to the following formula:
w′global←α×wi+(1-α)×wglobal; (1)
wherein, wiIs an update parameter, w, uploaded by the ith nodeglobalIs a parameter of the global model, w'globalIs a parameter of the updated global model and α is the aggregation coefficient.
In some embodiments, the calculation of the aggregation coefficient is:
Figure BDA0003445287600000091
where l (t- τ) is a function that measures how old the update is, t is the current time, and τ is the generation time of the global model used by node i.
Figure BDA0003445287600000092
Wherein r isiIs the reputation score of node i;
Figure BDA0003445287600000093
is a factor related to the amount of data local to node i.
Figure BDA0003445287600000094
Wherein d isiIs the data set size of node i, dallIs the data set size for all nodes, and β and γ are scaling factors.
Based on the persistent and unalterable characteristic of the blockchain, relevant records such as global models generated by each aggregation, scores of local updates uploaded by nodes and the like are permanently stored in the blockchain. Based on the historical records, the system can quantitatively evaluate the node behaviors of asynchronous federated learning, assign roles to the nodes according to quantitative data and adjust the weight of the nodes in the aggregation process, and can punish malicious nodes, such as excluding the malicious nodes from the federated learning process.
The frame adopts a novel reputation evaluation method, and the reputation of the node is quantified by testing the quality (such as accuracy, loss function value and the like) of the node uploading model and combining the historical records of the node to generate a reputation factor. The calculation of the node reputation requires iterative calculation according to the historical reputation of the node and the current score, and the calculation formula is as follows:
rk=ζ×rk+(1-ζ)×(sk/scompare)2; (5)
wherein r iskIs the reputation score of node k, skIs the local update quality of node k, measured by the final verification score of node k, where ζ is the coefficient balancing the historical data and the current data, scompareIs a normalized score.
By adjusting the reputation threshold and the reputation calculation coefficient, i.e., the first set value and ζ in equation 5, the framework may trade off between security (i.e., speed of detection of malicious nodes) and risk of accidental injury (i.e., the likelihood of determining normal nodes as malicious nodes).
On the basis of a reputation quantification method, the system can select a batch of nodes with the best reputation from the nodes participating in training as conference nodes, so that the influence of malicious nodes on federal learning is reduced to the maximum extent on the basis of ensuring the aggregation speed. Meanwhile, in order to avoid the influence of frequent election processes on learning efficiency, asynchronous federated learning is carried out by taking rounds as units, each learning task comprises a learning process of a plurality of rounds, each round has the same time limit, and at least one model update is uploaded on all nodes or the time of each round is ended after the time of the round is expired. The tenure of the conference is one round, and the blockchain will start to identify new conference members and start the next round of training after the round expires.
The system proposed in this embodiment works roughly as follows: in each round of learning process, each node firstly takes out the latest global model from a local block chain account book to train according to a local data set, and after the training is finished, the node broadcasts updating parameters to the conference node and waits for the conference node to finish model aggregation, reputation updating and block chain consensus. After consensus is completed, the node continues to start a new round of local training until the training round expires, and the conference node issues a round termination signal. And after receiving a turn termination signal, stopping training of all nodes, entering the next turn through federal learning, and starting election of a new conference node until the number of appointed turns is completed or the model precision reaches the standard.
Therefore, in order to fully utilize data and device resources of the edge network and improve the security and reliability of the federal learning system in the edge environment on the premise of keeping efficient aggregation as much as possible, the embodiment provides the following main innovation points: the frame comprises an asynchronous learning mode, a conference consensus and a reputation quantification method, and the throughput rate and the safety of federal learning under an unstable edge network can be improved. In order to identify and prevent malicious nodes from interfering with the federal learning process, the system provided by the embodiment quantifies the reputation of the nodes based on the historical data and the output quality of the nodes, and eliminates the malicious nodes from the learning process through a reputation threshold. In order to improve the aggregation efficiency of the asynchronous federated learning architecture, the system provided by the embodiment adopts a reputation-based conference consensus mechanism, and improves the consensus efficiency by reducing the consensus scale.
In conclusion, in the asynchronous federal learning method and system based on the block chain, the block chain network is introduced on the basis of federal learning, and the edge device nodes with higher reputation are selected as conference nodes for model aggregation and reputation update of all nodes, so that decentralization of the federal learning process is realized; and sending the global model to the edge device, training by utilizing rich data generated by the edge device, returning an updating parameter of the global model, respectively carrying out model aggregation, reputation updating and consensus authentication based on the conference node, and finally realizing complete federal learning under the condition of successful consensus. In the method, in the model training process, data of the edge equipment does not leave the local, so that the risk of data leakage is reduced, and the privacy of a user is protected; based on block chain network and consensus algorithm, centralization is achieved, single point failure is avoided, and system robustness and expansibility are improved.
Those of ordinary skill in the art will appreciate that the various illustrative components, systems, and methods described in connection with the embodiments disclosed herein may be implemented as hardware, software, or combinations of both. Whether this is done in hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this patent describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
Features that are described and/or illustrated with respect to one embodiment may be used in the same way or in a similar way in one or more other embodiments and/or in combination with or instead of the features of the other embodiments in the present invention.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes may be made to the embodiment of the present invention by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. An asynchronous federated learning method based on blockchains, wherein the method is used for operating on a blockchain network formed by a plurality of edge devices, each edge device being used as a node, the method operates based on a round system, and in each round, the method comprises:
sequencing all nodes according to the reputation scores of all nodes in the previous round, selecting a first set number of nodes with higher reputation scores as conference nodes, and using the rest nodes as common nodes; the conference node is used for model local training, model aggregation, consensus and reputation updating of each node, and the common node is only used for model local training;
each node acquires a current global model in the block chain network, carries out local training on the global model according to a local data set, and broadcasts updating parameters of the global model to all conference nodes;
carrying out reputation score authentication on nodes participating in broadcasting by each conference node, rejecting update parameters broadcasted by nodes with reputation scores lower than a first set value, carrying out local test on the update parameters broadcasted by the rest nodes by each conference node by using a local data set to obtain verification scores, and carrying out aggregation updating on the update parameters of each node to obtain a global model; the verification score is obtained by calculating one or more performance parameters;
each conference node gives the authentication scores of the nodes calculated locally to other conference nodes, and each conference node comprehensively calculates the final authentication scores of the nodes locally and calculates and updates the reputation scores according to the final authentication scores of the nodes;
each conference node packages the updated reputation scores of the nodes calculated locally and the global model after aggregation and update, and performs consensus authentication among the conference nodes;
and after the consensus is successful, the blockchain network updates the reputation scores and the global model of each node according to the consensus result.
2. The asynchronous block chain-based federated learning method of claim 1, wherein each conferencing node hands over locally computed authentication scores of nodes to other conferencing nodes, further comprising:
each conference node delivers the global model updated by local aggregation to other conference nodes, and each conference node performs performance test on the current global model and the updated global model sent by the other conference nodes by using a local data set, wherein the performance test at least comprises accuracy;
and in the performance test process of each conference node, if the performance of the updated global model sent by other conference nodes is lower than that of the current global model, broadcasting prompt.
3. The asynchronous block chain-based federated learning method of claim 2, wherein each conferencing node hands over locally computed authentication scores of nodes to other conferencing nodes, further comprising:
each conference node delivers the global model updated by local aggregation to other conference nodes, and each conference node performs performance test on the current global model and the updated global model sent by the other conference nodes by using a local data set, wherein the performance test at least comprises accuracy;
in the performance test process of each conference node, if the performance of the updated global model sent by other conference nodes is lower than that of the current global model and the difference exceeds a set threshold, broadcasting prompt is carried out.
4. The blockchain-based asynchronous federated learning method of claim 1, further comprising:
and setting a termination condition, wherein the termination condition is that all nodes upload the update parameters or rounds at least once to reach a second set number.
5. The asynchronous block chain-based federated learning method of claim 1, wherein each conference node hands over locally computed authentication scores of each node to other conference nodes, and each conference node locally and synthetically computes final authentication scores of each node, comprising:
for the conference node m, receiving the authentication scores H calculated by other conference nodes and related to the node n1、H2、H3…HcC is the number of other conference nodes except conference node m in the block network;
scoring verification H1、H2、H3…HcA weighted sum is performed, with the weight of each validation score being proportional to the reputation score of the corresponding conference node.
6. The asynchronous federal learning method based on a blockchain according to claim 1, wherein the global model is updated by aggregating the update parameters of each node, and the calculation formula is represented as:
w′global←α×wi+(1-α)×wglobal
wherein, wiIs an update parameter, w, uploaded by the ith nodeglobalIs a parameter of the global model, w'globalIs a parameter of the updated global model and α is the aggregation coefficient.
7. The asynchronous block chain-based federated learning method of claim 6, wherein the calculation formula of the aggregation coefficient is:
Figure FDA0003445287590000021
wherein l (t- τ) is a function for measuring the update staleness degree, t is the current time, and τ is the generation time of the global model used by the node i;
Figure FDA0003445287590000031
wherein r isiIs the reputation score of node i;
Figure FDA0003445287590000032
is a factor related to the amount of data local to node i;
Figure FDA0003445287590000033
wherein d isiIs the data set size of node i, dallIs the data set size for all nodes, and β and γ are scaling factors.
8. The asynchronous federated learning method based on blockchain according to claim 7, wherein the updated reputation score is calculated according to the final verification score of each node, and the calculation formula is:
rk=ζ×rk+(1-ζ)×(sk/scompare)2
wherein r iskIs the reputation score of node k, skIs the local update quality of node k, measured by the final verification score of node k, ζ is the coefficient balancing the historical data and the current data, scompareIs a normalized score.
9. The asynchronous federal learning method as claimed in claim 1, wherein the verification score is obtained by performing normalization processing on the accuracy and the loss function value and then performing weighted summation.
10. An asynchronous federated learning system based on blockchains, comprising:
a blockchain network composed of a plurality of edge devices, each edge device serving as a node, the blockchain network loading agents and performing the blockchain-based asynchronous federal learning method of any one of claims 1 to 9.
CN202111653752.4A 2021-12-30 2021-12-30 Asynchronous federal learning method and system based on block chain Pending CN114491623A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111653752.4A CN114491623A (en) 2021-12-30 2021-12-30 Asynchronous federal learning method and system based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111653752.4A CN114491623A (en) 2021-12-30 2021-12-30 Asynchronous federal learning method and system based on block chain

Publications (1)

Publication Number Publication Date
CN114491623A true CN114491623A (en) 2022-05-13

Family

ID=81508214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111653752.4A Pending CN114491623A (en) 2021-12-30 2021-12-30 Asynchronous federal learning method and system based on block chain

Country Status (1)

Country Link
CN (1) CN114491623A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174404A (en) * 2022-05-17 2022-10-11 南京大学 Multi-device federal learning system based on SDN networking
CN115456194A (en) * 2022-08-25 2022-12-09 北京百度网讯科技有限公司 Model training control method, device and system based on asynchronous federal learning
CN116611118A (en) * 2023-07-21 2023-08-18 北京智芯微电子科技有限公司 Construction method and device of data privacy protection model based on improved differential privacy
WO2024026846A1 (en) * 2022-08-05 2024-02-08 华为技术有限公司 Artificial intelligence model processing method and related device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174404A (en) * 2022-05-17 2022-10-11 南京大学 Multi-device federal learning system based on SDN networking
WO2024026846A1 (en) * 2022-08-05 2024-02-08 华为技术有限公司 Artificial intelligence model processing method and related device
CN115456194A (en) * 2022-08-25 2022-12-09 北京百度网讯科技有限公司 Model training control method, device and system based on asynchronous federal learning
CN115456194B (en) * 2022-08-25 2023-09-01 北京百度网讯科技有限公司 Model training control method, device and system based on asynchronous federal learning
CN116611118A (en) * 2023-07-21 2023-08-18 北京智芯微电子科技有限公司 Construction method and device of data privacy protection model based on improved differential privacy

Similar Documents

Publication Publication Date Title
CN114491623A (en) Asynchronous federal learning method and system based on block chain
Xiao et al. A secure mobile crowdsensing game with deep reinforcement learning
CN112906903B (en) Network security risk prediction method and device, storage medium and computer equipment
CN110598870A (en) Method and device for federated learning
Lin et al. Sybil-proof incentive mechanisms for crowdsensing
CN110602117B (en) Vehicle networking node consistency consensus method based on block chain
CN106960143A (en) The recognition methods of user account and device, storage medium, electronic equipment
US11763238B2 (en) User interface-based mobility transaction management on a MaaS platform
CN103368910B (en) Virtual radio communications network system and method for building up thereof
CN110378488A (en) Federal training method, device, training terminal and the storage medium of client variation
CN112506753A (en) Efficient contribution evaluation method in federated learning scene
CN114301935A (en) Reputation-based method for selecting edge cloud collaborative federated learning nodes of Internet of things
CN110879827A (en) Information processing method and device based on block chain network
CN103890758A (en) Method and apparatus for deriving composite tie metric for edge between nodes of telecommunication call graph
CN109743682A (en) Method for inspecting, apparatus and system
CN113645190A (en) Byzantine fault-tolerant consensus method considering node reputation and block chain
CN112866282A (en) Method and device for verifying time information in block chain
CN110264608A (en) Voting method, apparatus and system based on block chain
CN111221649A (en) Edge resource storage method, access method and device
CN113435534A (en) Data heterogeneous processing method and device based on similarity measurement, computer equipment and computer readable storage medium
CN108460854A (en) The attendance punch card method and system of mobile terminal based on wireless network
CN116806038A (en) Decentralizing computer data sharing method and device
CN109873836A (en) A kind of methods of risk assessment and device of data
CN114980135A (en) 5G base station address distribution system and method based on big data
Zhou et al. Leveraging crowd to improve data credibility for mobile crowdsensing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination