CN111723946A - Federal learning method and device applied to block chain - Google Patents

Federal learning method and device applied to block chain Download PDF

Info

Publication number
CN111723946A
CN111723946A CN202010563217.9A CN202010563217A CN111723946A CN 111723946 A CN111723946 A CN 111723946A CN 202010563217 A CN202010563217 A CN 202010563217A CN 111723946 A CN111723946 A CN 111723946A
Authority
CN
China
Prior art keywords
committee
node
nodes
local
committee node
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
CN202010563217.9A
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.)
Sun Yat Sen University
WeBank Co Ltd
National Sun Yat Sen University
Original Assignee
WeBank Co Ltd
National Sun Yat Sen University
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 WeBank Co Ltd, National Sun Yat Sen University filed Critical WeBank Co Ltd
Priority to CN202010563217.9A priority Critical patent/CN111723946A/en
Publication of CN111723946A publication Critical patent/CN111723946A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/20Ensemble learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a federal learning method and a device applied to a block chain, wherein the method comprises the following steps: the first committee node acquires first local model information from any non-committee node; the first committee node determining a first verification result of the first committee node on the non-committee node according to a local verification data set of the first committee node and the first local model information; the first committee node sending the first verification result to each second committee node; and if the first committee node determines that the committee nodes agree on the first local model information, updating a federal learning model at least according to the first local model information. When the method is applied to financial technology (Fintech), the training of the federal learning model is granted only after the first local model information is known, so that the block link point association cooperation can be found in time.

Description

Federal learning method and device applied to block chain
Technical Field
The invention relates to the field of computer software in the field of financial technology (Fintech), in particular to a federal learning method and a device applied to a block chain.
Background
With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech), but due to the requirements of the financial industry on safety and real-time performance, higher requirements are also put forward on the technologies. Currently, many financial strategies in the field of financial technology rely on the results of federal learning of large amounts of financial transaction data. The block chain is a distributed storage structure, and can realize the federal learning of each block chain link point and realize the storage and sharing of the global model of the federal learning.
At present, in a federal learning method applied in a block chain scene, each block chain link point is divided into a plurality of communities, each community of the block chain maintains a model of the community in each community, and after consensus is achieved, the model is transmitted and updated among the communities. However, although this reduces the transmission and storage burden, since the updated model is only commonly known within a community, if the block link joint cooperation in one community is bad (i.e., false intermediate results of federal learning are output), other honest communities have difficulty finding and rejecting the community. Therefore, the current federal learning method applied to the block chain scene has the hidden danger that the single community cooperation is bad but cannot be found in time. This is a problem to be solved.
Disclosure of Invention
The invention provides a federal learning method and a federal learning device applied to a block chain, which solve the problem that the hidden danger cannot be found in time due to the single community cooperation badness in the prior art.
In a first aspect, the present invention provides a federal learning method applied to a blockchain, including: the first committee node acquires first local model information from any non-committee node; the first local model information is trained based on a local test dataset of the non-committee node; the first committee node is any one of the committee nodes; the first committee node determining a first verification result of the first committee node on the non-committee node according to a local verification data set of the first committee node and the first local model information; the first committee node sending the first verification result to each second committee node; the first verification result is used for being combined with each second verification result to enable each committee node to commonly identify the first local model information; each of the second committee nodes is a committee node of the committee nodes other than the first committee node; each second verification result is a verification result obtained according to the local verification data set of each second committee node and the first local model information; and if the first committee node determines that the committee nodes agree on the first local model information, updating a federal learning model at least according to the first local model information.
In the method, a first committee node acquires first local model information from an uncommitted node and then uses the first local model information for updating a federal learning model, but obtains a first verification result which can verify a local learning result of the uncommitted node based on a local verification data set of the first committee node and the first local model information, the first verification result can be combined with second verification results to allow the committee nodes to commonly recognize the first local model information, so that the first local model information is verified by the local verification data set of the first committee node, a worrisation space of the uncommitted node is reduced, after the first local model information passes, the committee node updates the federal learning model based on at least the first local model information, and the method is not a method in which a community commonly recognizes a model, each committee node obtains a verification result of the non-committee node, and after the first local model information is agreed, the committee node is permitted to participate in the training of the federal learning model, so that the block link point joint cooperation disorder can be found in time.
Optionally, the first committee node determines a first verification result of the first committee node on the non-committee node according to the local verification data set of the first committee node and the first local model information; the method comprises the following steps: the first committee node determining, based on the first local model information, a local validation accuracy rate of the first local model information for a local validation dataset of the first committee node; the first committee node determines the first verification result of the first committee node for the non-committee node according to the local verification accuracy.
In the above method, the first committee node determines a local verification accuracy of the first local model information with respect to the local verification data set of the first committee node based on the first local model information, and further determines the first verification result of the first committee node with respect to the non-committee node, thereby verifying the first local model information of the non-committee node with the data set on the first committee node side, and checking whether the non-committee node is malicious or not with accuracy, and further improving the accuracy of the first verification result.
Optionally, the determining, by the first committee node, that the committee nodes agree on the first local model information includes: the first committee node acquires the second verification results; the first committee node determines that the first local model information passes according to the first verification result and the second verification results, and then sends consensus verification results to the second committee nodes; the first committee node receives the consensus verification results from the second committee nodes, and determines that the committee nodes agree on the first local model information according to the consensus verification results of the second committee nodes and a preset consensus algorithm.
In the above method, the first verification result of the first committee node and the second verification results together verify that the first local model information passes, and then a consensus verification result is sent to the second committee nodes, and if the consensus verification result from the second committee nodes indicates that the second committee nodes also verify that the first local model information passes, the accuracy of the first local model information is further improved.
Optionally, the updated federal learning model is updated for the kth federal learning model; k is a positive integer; after the updating of the federal learning model, the method further comprises the following steps: the first committee node determines, from the non-committee nodes, committee nodes for the K +1 th round of federal learning through the second committee nodes.
In the above manner, the committee nodes for the K +1 th round of federal learning are determined only from the non-committee nodes, thereby reducing the risk of committee node repugnance.
Optionally, the determining, by the first committee node, a committee candidate node for the K +1 th round of federal learning from the non-committee nodes through the second committee nodes includes: and the first committee node determines the committee node of the K +1 th round of federal learning from each non-committee node according to the verification result of each committee node on each non-committee node through each second committee node.
In the above manner, according to the verification result of each committee node on each non-committee node, the committee node of the K +1 th round of federal learning is determined from each non-committee node, so that the verification result is used as the basis for electing the committee node, and more reliable committee nodes are elected.
Optionally, the determining, by the first committee node, a committee node of the K +1 th round of federal learning from the non-committee nodes according to the verification result of each non-committee node by each committee node, includes: for each non-committee node of the non-committee nodes, determining, by the first committee node, an initial probability that the non-committee node is selected as a committee node of the K +1 th round of federal learning according to the first verification result; according to the number of historical rounds of the non-committee nodes which are selected as committee nodes in the multi-round training process of federal learning, the first committee node adjusts the initial probability of the non-committee nodes which are selected as the K + 1-th round of the committee nodes of the federal learning according to a negative correlation principle, and therefore the elected probability of the non-committee nodes is determined; the negative correlation principle refers to that the number of historical rounds that the non-committee node has selected as the committee node is in negative correlation with the election probability of the non-committee node; and the first committee node determines the committee nodes of the K +1 th round of federal learning from the non-committee nodes according to the election probability of each non-committee node through the second committee nodes.
In the above manner, first, an initial probability that the non-committee node is selected as the committee node for the K +1 th round of federal learning is determined according to the first verification result, on this basis, the initial probability that the non-committee node is selected as the committee node for the K +1 th round of federal learning is adjusted according to a negative correlation principle, a elected probability of the non-committee node is determined, and the committee node for the K +1 th round of federal learning is determined, so that the committee node with a large number of historical rounds is more difficult to select and is prevented from overfitting a trained federal learning model.
Optionally, after the first committee node determines that the committee nodes agree on the first local model information, the method further includes: the first committee node writing the first local model information to the blockchain; the first committee node updating a federal learning model based at least on the first local model information, including: the first committee node updates the federal learning model according to the local model information of the uplink of each non-committee node; the local model information of the uplink of each non-committee node is the local model information successfully written into the block chain in the local model information of each non-committee node.
In the above manner, after the consensus is achieved, the first committee node writes the first local model information into the block chain, so as to ensure that the first local model information on the block chain is more accurate model information after the consensus is achieved, and further, the first committee node updates the federal learning model according to the local model information of the uplink of each non-committee node, so as to obtain a more accurate federal learning model.
Optionally, after updating the federal learning model, the method further includes: and the first committee node broadcasts the federal learning model obtained after updating the federal learning model to the non-committee nodes.
In the above manner, after the updating of the federal learning model, the first committee node broadcasts the updated federal learning model to the respective non-committee nodes, so that the respective non-committee nodes can be trained based on the latest federal learning model.
In a second aspect, the present invention provides a federal learning apparatus applied to a block chain, the apparatus being adapted to a block chain including committee nodes and non-committee nodes, the apparatus including: an acquisition module for acquiring first local model information from any non-committee node; the first local model information is trained based on a local test dataset of the non-committee node; the first committee node is any one of the committee nodes; a processing module to determine a first validation result of the first committee node for the non-committee node based on a local validation dataset of the first committee node and the first local model information; sending the first verification result to each second committee node; the first verification result is used for being combined with each second verification result to enable each committee node to commonly identify the first local model information; each of the second committee nodes is a committee node of the committee nodes other than the first committee node; each second verification result is a verification result obtained according to the local verification data set of each second committee node and the first local model information; and if the committee nodes are determined to agree on the first local model information, updating a federal learning model at least according to the first local model information.
Optionally, the processing module is specifically configured to: determining, from the first local model information, a local validation accuracy rate of the first local model information for a local validation dataset of the first committee node; determining the first validation result of the first committee node for the non-committee node according to the local validation accuracy.
Optionally, the processing module is specifically configured to: obtaining each second verification result; according to the first verification result and each second verification result, after the first local model information is determined to pass, sending a consensus verification result to each second committee node; and receiving consensus verification results from the second committee nodes, and determining that the committee nodes agree on the first local model information according to the consensus verification results of the second committee nodes and a preset consensus algorithm.
Optionally, the processing module is further configured to: determining, by the second committee nodes, a committee node for the K +1 th round of federal learning from the non-committee nodes.
Optionally, the processing module is specifically configured to: and determining, by the second committee nodes, committee nodes for the K +1 th round of federal learning from the non-committee nodes according to the verification results of the non-committee nodes by the committee nodes.
Optionally, the processing module is specifically configured to: determining, for each non-committee node of the non-committee nodes, an initial probability that the non-committee node is selected as the committee node of the K +1 th round of federal learning according to the first verification result; according to the number of historical rounds of the non-committee nodes which are selected as committee nodes in the multi-round training process of federal learning, according to a negative correlation principle, adjusting the initial probability of the non-committee nodes which are selected as the committee nodes of the K +1 th round of federal learning, and accordingly determining the election probability of the non-committee nodes; the negative correlation principle refers to that the election probability of the non-committee node is in negative correlation with the historical round number of the non-committee node which is selected as a committee node; and determining the committee nodes of the K +1 th round of federal learning from the non-committee nodes through the second committee nodes according to the election probability of the non-committee nodes.
Optionally, the processing module is further configured to: writing the first local model information to the blockchain; the processing module is specifically configured to: updating the federal learning model according to the local model information of the uplink of each non-committee node; the local model information of the uplink of each non-committee node is the local model information successfully written into the block chain in the local model information of each non-committee node.
Optionally, the processing module is further configured to: and broadcasting the federal learning model obtained after updating the federal learning model to the non-committee nodes.
The advantageous effects of the second aspect and the various optional apparatuses of the second aspect may refer to the advantageous effects of the first aspect and the various optional methods of the first aspect, and are not described herein again.
In a third aspect, the present invention provides a computer device comprising a program or instructions for performing the method of the first aspect and the alternatives of the first aspect when the program or instructions are executed.
In a fourth aspect, the present invention provides a storage medium comprising a program or instructions which, when executed, is adapted to perform the method of the first aspect and the alternatives of the first aspect.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that are required to be used in the description of the embodiments will be briefly described below.
Fig. 1 is a schematic flowchart illustrating steps of a federal learning method applied to a block chain according to an embodiment of the present application;
fig. 2 is a flowchart illustrating specific steps of a federal learning method applied to a block chain according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a success rate of malicious node attack in a federated learning method applied to a blockchain according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a federal learning device applied to a block chain according to an embodiment of the present application.
Detailed Description
In order to better understand the technical solutions, the technical solutions will be described in detail below with reference to the drawings and the specific embodiments of the specification, and it should be understood that the specific features in the embodiments and examples of the present application are detailed descriptions of the technical solutions of the present application, but not limitations of the technical solutions of the present application, and the technical features in the embodiments and examples of the present application may be combined with each other without conflict.
The definitions of the terms appearing in the present application are listed first below.
FL (fed Learning, federal Learning): refers to a machine learning setup where multiple clients cooperatively train a model under a central server, which setup ensures that training data is decentralized at the same time. Federal learning includes both horizontal federal learning and vertical federal learning.
Block chains: in brief, the blockchain is a distributed shared account book and database, and has the characteristics of decentralization, non-falsification, trace retention in the whole process, traceability, collective maintenance, public transparency and the like.
And (3) cross validation: the method comprises the steps of grouping original data, using one part of the original data as a training set and the other part of the original data as a verification set, firstly training a classifier by using the training set, and then testing a model obtained by training by using the verification set to serve as a performance index of an evaluation model.
Federal learning proposed by google in 2016 has recently received increasing attention from researchers due to its privacy feature. In the financial institution (banking, insurance or security) operating process, many financial strategies in the field of financial technology rely on the results of federal learning of large amounts of financial transaction data. In the initial architecture, federal learning employed a centralized architecture. However, a centralized server may be biased towards certain clients, thereby biasing the global model. Furthermore, some malicious central servers can compromise the model and even collect client privacy data from updates. The block chain is a distributed storage architecture, and can solve the centralized problem, realize the federal learning of each block chain node, and realize the storage and sharing of the global model of the federal learning. However, in the method of dividing the block chain into a plurality of communities and commonly identifying the block chain in the communities, the hidden danger that the joint cooperation of the block chain nodes in one community cannot be found in time may occur. To this end, the present application provides a federal learning method applied to blockchains, as shown in fig. 1. In particular, the present invention relates to a method for producing,
when the federal learning model of the block chain does not meet the preset federal learning end condition, aiming at each round of federal learning training, aiming at each committee node in each committee node of the block chain, executing the following steps:
step 101: the first committee node obtains first local model information from any one of the non-committee nodes.
Step 102: the first committee node determines a first verification result of the first committee node on the non-committee node according to the local verification data set of the first committee node and the first local model information.
Step 103: the first committee node transmits the first verification result to each second committee node.
Step 104: and if the first committee node determines that the committee nodes agree on the first local model information, updating a federal learning model at least according to the first local model information.
In steps 101 to 104, the first local model information is obtained by training based on the local test data set of the non-committee node; the first committee node is any one of the committee nodes; the first verification result is used for being combined with each second verification result to enable each committee node to commonly identify the first local model information; each of the second committee nodes is a committee node of the committee nodes other than the first committee node; the second verification results are verification results obtained according to the local verification data sets of the second committee nodes and the first local model information.
The federal learning may be either a horizontal federal learning or a vertical federal learning. It should be noted that, the roles of any blockchain node in a blockchain may be switched, such as a committee node switching to a non-committee node and a non-committee node switching to a committee node. Each committee node and each non-committee node have respective local data sets, the local data set used for generating the local learning result is a local testing data set, and the local data set used for verifying the local learning result of the non-committee node is a local verification data set.
It should be noted that, due to federal learning to protect privacy of local data, data communication between nodes is not possible. The division may be by committee nodes and non-committee nodes, wherein non-committee nodes may participate in the current round of training, so that the local test data set of non-committee nodes is the training set, and committee nodes perform local validation on the local model information (e.g., gradient information) submitted by non-committee nodes. Thus, the local validation data set of the committee node is the validation set. This completes the training and validation process in one round of model update.
In an alternative embodiment, step 102 may specifically be:
the first committee node determining, based on the first local model information, a local validation accuracy rate of the first local model information for a local validation dataset of the first committee node; the first committee node determines the first verification result of the first committee node for the non-committee node according to the local verification accuracy.
In particular, a local validation accuracy rate of the first local model information for the local validation data set of the first committee node may be determined as follows:
and the first committee node obtains an updated model of the first committee node according to the first local model information.
Each piece of data in the local validation data set of the first committee node includes a data feature and a tag value, wherein the value of the tag value includes two or more values, for example, the tag value is 0 or 1, and the tag value is 1 or 2 or 3 or 4. Each piece of data in the local validation dataset of the first committee node may be input into the updated model of the first committee node to obtain a prediction result of the piece of data, and then the prediction results of each piece of data are integrated to obtain the local validation accuracy of the first local model information on the local validation dataset of the first committee node.
For example, for each piece of data, if the prediction result of the piece of data is determined according to whether the value of the predicted value is consistent with the value of the label, that is, if the predicted value is consistent with the value of the label, the prediction result of the piece of data is marked as accurate, and if the predicted value is inconsistent with the value of the label, the prediction result of the piece of data is marked as inaccurate, the local validation accuracy of the first local model information for the local validation data set of the first committee node may be characterized by a ratio of the number of the data sets with accurate prediction to the local validation data set of the first committee node.
It should be noted that the predicted result of each piece of data is not only accurate or inaccurate, but also the local validation accuracy of the first local model information on the local validation data set of the first committee node can be evaluated by the error between the predicted value and the tag value of each piece of data. More specifically, after calculating an error value between the predicted value and the tag value of each piece of data, an error rate between the predicted value and the tag value of each piece of data may be calculated based on the error value and the tag value, a difference between the error rate and 1 may be used as a prediction result between the predicted value and the tag value of each piece of data, that is, a prediction accuracy of each piece of data, and the prediction accuracy of each piece of data may be integrated, for example, by a median or average of the accuracy, to obtain a local verification accuracy of the first local model information with respect to the local verification data set of the first committee node.
It should be noted that, in addition to the local verification accuracy, the first verification result may also be determined according to a recall rate of the first local model information to the local verification data set of the first committee node, and the like.
The specific process of the first committee node determining the first verification result of the first committee node on the non-committee node according to the local verification accuracy may be as follows:
and the first committee node determines the node credit score of the non-committee node according to the local verification accuracy rate. For example, when the federal learning is longitudinal federal learning, the first local model information determines an individually updated model of the non-committee node according to updated gradient information, and the first committee node obtains an accuracy rate of verification on the non-committee node according to the individually updated model of the non-committee node and a local verification data set of the first committee node, and further obtains a node credit score of the non-committee node. Obviously, the closer the data distribution of the local validation dataset of the first committee node to the local test dataset of the non-committee node, the higher the node credit score.
In an alternative embodiment, step 104 may specifically be:
the first committee node acquires the second verification results; the first committee node determines that the first local model information passes according to the first verification result and the second verification results, and then sends consensus verification results to the second committee nodes; the first committee node receives the consensus verification results from the second committee nodes, and determines that the committee nodes agree on the first local model information according to the consensus verification results of the second committee nodes and a preset consensus algorithm.
Wherein the consensus verification result sent by the first committee node to each second committee node indicates that the first committee node verifies that the first local model information passes, and the consensus verification result of each second committee node also indicates that the consensus verification result of each second committee node verifies that the second committee node passes.
The verification modes of the first verification result and the second verification results can be in various forms, and the first verification result and the second verification results can be any one evaluation index of model evaluation indexes, such as accuracy, precision, recall rate, F value and the like. Whether the first verification result and the second verification results pass the verification or not may be determined according to a statistical result of the first verification result and the second verification results as a whole, such as a mean, a standard deviation, a median, and the like.
Taking local verification accuracy as an example, the determining, by the first committee node according to the first verification result and the second verification results, that the first local model information passes may specifically be:
the first committee node determines a median of the local verification accuracy rate of the first local model information according to the local verification accuracy rate of the first committee node on the first local model information and the plurality of local verification accuracy rates of the second committee nodes on the first local model information, and if the median is greater than a preset median threshold, the first local model information is determined to pass.
For example, the first verification result and the second verification results are accuracy, the first verification result is R1, the second verification results are R2-1, R2-2, … …, R2-n, and n is a positive integer. And calculating to obtain R1, R2-1, R2-2, … … and R2-n median which is R-m, and if the R-m is larger than a preset median threshold, determining that the first local model information passes, otherwise, not passing.
Further, the verification manner of the first verification result and each second verification result may further include two parts: and verifying each verification result in the first verification result and the second verification results, and verifying the first verification result and the second verification results integrally.
For example, the first verification result and the second verification results are accuracy, the first verification result is R1, the second verification results are R2-1, R2-2, … …, R2-n, and n is a positive integer. Whether the first verification result and the second verification results pass the verification or not can be determined by comparing the results of R1, R2-1, R2-2, … …, R2-n with an accuracy threshold, for example, if the results are greater than or equal to a preset threshold, the verification is passed. Then, a verification ratio of verification results that pass verification in R1, R2-1, R2-2, … …, and R2-n to the total verification result is counted, and whether the first verification result and the second verification results pass verification is determined according to a comparison result of the verification ratio and a preset ratio threshold, for example, whether the first verification result and the second verification results pass verification is determined if the verification ratio is greater than the preset ratio threshold.
In addition to the above-mentioned optional embodiments, the step 104 may be performed by only verifying the first verification result by the first committee node, and after the first verification result is verified, the step may send the consensus verification result to the second committee nodes, and each second committee node may also send the consensus verification result to the first committee node only after the second verification result of each second committee node is verified.
Marking the updated federal learning model as a model update of the Kth round of federal learning; k is a positive integer; an alternative embodiment of the committee node election after step 104 (hereinafter referred to as the committee node election from non-committee nodes) may be as follows:
the first committee node determines, from the non-committee nodes, committee nodes for the K +1 th round of federal learning through the second committee nodes.
In the method of selecting committee nodes from non-committee nodes, after each round of training is finished, a new round of committee nodes are selected and can be selected from the current non-committee nodes only, and model overfitting caused by 'successive committee nodes' of some nodes is avoided.
It should be noted that the committee nodes may also be elected from the non-committee nodes and the committee nodes.
Specifically, the manner in which committee nodes are elected from non-committee nodes may be performed as follows:
and the first committee node determines the committee node of the K +1 th round of federal learning from each non-committee node according to the verification result of each committee node on each non-committee node through each second committee node.
For example, the verification scores of the non-committee nodes may be obtained according to the verification results of the non-committee nodes, and the non-committee nodes with the verification scores greater than or equal to a preset score may be selected, or the non-committee nodes with the highest verification score proportion may be directly selected without setting the preset score, or various flexible ways may be provided.
The committee nodes may be elected from the non-committee nodes by randomly selecting them directly from the non-committee nodes, and so on.
More specifically, the above alternative embodiment may be performed as follows:
for each non-committee node of the non-committee nodes, determining, by the first committee node, an initial probability that the non-committee node is selected as a committee node of the K +1 th round of federal learning according to the first verification result; according to the number of historical rounds of the non-committee nodes which are selected as committee nodes in the multi-round training process of federal learning, the first committee node adjusts the initial probability of the non-committee nodes which are selected as the K + 1-th round of the committee nodes of the federal learning according to a negative correlation principle, and therefore the elected probability of the non-committee nodes is determined; and the first committee node determines the committee nodes of the K +1 th round of federal learning from the non-committee nodes according to the election probability of each non-committee node through the second committee nodes.
The negative correlation principle means that the election probability of the non-committee node is negatively correlated with the historical round number of the non-committee nodes which have been selected as committee nodes.
For example, a specific committee election algorithm may be as follows:
defining the number of nodes participating in training as N, namely the number of candidate committee nodes, and defining an optimization target as a vector x ∈ RNWherein 0 is less than or equal to xi≦ 1 denotes the probability that the ith candidate committee node elected the committee node, furthermore, ∑ xiC means that C committee nodes are to be selected as the next round of committee nodes. The gradient submitted by the ith candidate committee node is the median of the score obtained after the verification of the committee node
Figure BDA0002546789260000143
After the processing of softmax, a vector s ∈ R is obtainedN(ii) a Defining the number of historical rounds that the ith candidate committee node elected the committee once as TiIn order to reduce the overfitting problem caused by repeated selection of a certain number of nodes, punishment is carried out on candidate committee nodes with more historical rounds. In summary, a simple convex quadratic programming problem can be obtained
Figure BDA0002546789260000141
Figure BDA0002546789260000142
Where θ is the hyperparameter of the conditional regularization term. The C candidates with the highest probability in the optimal x vector obtained by the optimization problem are enrolled in the committee of the next round.
As can be seen from the above optimization objectives, for the case of multiple elections, a penalty can also be imposed to reduce the likelihood of overfitting in a regularized form. Such an election corresponds to a repartitioning of the local data set of each node to obtain a training set and a validation set that are completely different from the previous round, and is therefore called cross-validation in federal learning. Meanwhile, the verification result of the previous round and the regular punishment of overfitting are considered, the partitioning mode is favorable for reducing the influence caused by malicious attack, and meanwhile, the generalization capability of global model training is also ensured.
After the first committee node determines that the committee nodes agree on the first local model information, in step 104, an alternative embodiment may be: the first committee node writes the first local model information to the blockchain.
In step 104, according to at least the first local model information, a specific implementation manner of updating the federal learning model may be:
the first committee node updates the federal learning model according to the local model information of the uplink of each non-committee node; the local model information of the uplink of each non-committee node is the local model information successfully written into the block chain in the local model information of each non-committee node.
After step 104, an alternative implementation is:
and the first committee node broadcasts the federal learning model obtained after updating the federal learning model to the non-committee nodes.
In an alternative embodiment of integrating steps 101 to 104, taking longitudinal federal learning as an example, a specific flow of the method may be as shown in fig. 2.
A malicious node is defined as a node that submits incorrect malicious local model information. As previously described. Updates to the federal learning model will be verified by the committee nodes prior to aggregation, as specified by the committee nodes. The factors and likelihood of success of a malicious attack can be theoretically analyzed: assuming a total of P nodes, M nodes in the committees, P, M being a positive integer, P > M, a malicious update is added to the blockchain and only if there are more than M/2 malicious committee nodes in the committee nodes, the malicious committee nodes in these committee nodes also require more than M/2 malicious committee nodes in the previous round of update to enter the committee nodes, and so on, as long as there are more than M/2 honest committee nodes in the initial committee nodes, the malicious committee nodes can be avoided from becoming committee nodes. Even if one extreme is considered: all malicious committee nodes conspire to possess the denominations of the committee nodes. Assuming a total of a participating committee nodes, the malicious committee node share ratio is q, the committee denomination share ratio is p, and the attack targets of the malicious committee nodes are (a × p)/2 committee denominations. Let A fix to 1000, calculate the success rate of malicious committee node attack with the change of p and q, and obtain the result as shown in FIG. 3. It can be seen that the success rate of the attack is significantly greater than 0 if and only if the occupation rate of the malicious committee nodes is greater than 50%, whereas the cost is much higher than the profit if the malicious committee nodes occupy more than half of the computing resources. In conclusion, the method can effectively defend against the attack of the malicious committee nodes.
As shown in fig. 4, the present invention provides a federal learning apparatus applied to a block chain, which is suitable for a block chain including committee nodes and non-committee nodes, and includes: an obtaining module 401, configured to obtain first local model information from any non-committee node; the first local model information is trained based on a local test dataset of the non-committee node; the first committee node is any one of the committee nodes; a processing module 402 configured to determine a first validation result of the first committee node for the non-committee node according to the first local model information and the local validation dataset of the first committee node; sending the first verification result to each second committee node; the first verification result is used for being combined with each second verification result to enable each committee node to commonly identify the first local model information; each of the second committee nodes is a committee node of the committee nodes other than the first committee node; each second verification result is a verification result obtained according to the local verification data set of each second committee node and the first local model information; and if the committee nodes are determined to agree on the first local model information, updating a federal learning model at least according to the first local model information.
Optionally, the processing module 402 is specifically configured to: determining, from the first local model information, a local validation accuracy rate of the first local model information for a local validation dataset of the first committee node; determining the first validation result of the first committee node for the non-committee node according to the local validation accuracy.
Optionally, the processing module 402 is specifically configured to: obtaining each second verification result; according to the first verification result and each second verification result, after the first local model information is determined to pass, sending a consensus verification result to each second committee node; and receiving consensus verification results from the second committee nodes, and determining that the committee nodes agree on the first local model information according to the consensus verification results of the second committee nodes and a preset consensus algorithm.
Optionally, the processing module 402 is further configured to: determining, by the second committee nodes, a committee node for the K +1 th round of federal learning from the non-committee nodes.
Optionally, the processing module 402 is specifically configured to: and determining, by the second committee nodes, committee nodes for the K +1 th round of federal learning from the non-committee nodes according to the verification results of the non-committee nodes by the committee nodes.
Optionally, the processing module 402 is specifically configured to: determining, for each non-committee node of the non-committee nodes, an initial probability that the non-committee node is selected as the committee node of the K +1 th round of federal learning according to the first verification result; according to the number of historical rounds of the non-committee nodes which are selected as committee nodes in the multi-round training process of federal learning, according to a negative correlation principle, adjusting the initial probability of the non-committee nodes which are selected as the committee nodes of the K +1 th round of federal learning, and accordingly determining the election probability of the non-committee nodes; the negative correlation principle refers to that the election probability of the non-committee node is in negative correlation with the historical round number of the non-committee node which is selected as a committee node; and determining the committee nodes of the K +1 th round of federal learning from the non-committee nodes through the second committee nodes according to the election probability of the non-committee nodes.
Optionally, the processing module 402 is further configured to: writing the first local model information to the blockchain; the processing module 402 is specifically configured to: updating the federal learning model according to the local model information of the uplink of each non-committee node; the local model information of the uplink of each non-committee node is the local model information successfully written into the block chain in the local model information of each non-committee node.
Optionally, the processing module 402 is further configured to: and broadcasting the federal learning model obtained after updating the federal learning model to the non-committee nodes.
Embodiments of the present application provide a computer device, which includes a program or instructions, and when the program or instructions are executed, the program or instructions are configured to perform a federal learning method and any optional method applied to a block chain, which are provided by embodiments of the present application.
The embodiments of the present application provide a storage medium, which includes a program or instructions, and when the program or instructions are executed, the program or instructions are used to execute a federal learning method and any optional method applied to a block chain, which are provided by the embodiments of the present application.
Finally, it should be noted that: as will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (11)

1. A federal learning method applied to a block chain, wherein the block chain includes committee nodes and non-committee nodes, the method comprising:
the first committee node acquires first local model information from any non-committee node; the first local model information is trained based on a local test dataset of the non-committee node; the first committee node is any one of the committee nodes;
the first committee node determining a first verification result of the first committee node on the non-committee node according to a local verification data set of the first committee node and the first local model information;
the first committee node sending the first verification result to each second committee node; the first verification result is used for being combined with each second verification result to enable each committee node to commonly identify the first local model information; each of the second committee nodes is a committee node of the committee nodes other than the first committee node; each second verification result is a verification result obtained according to the local verification data set of each second committee node and the first local model information;
and if the first committee node determines that the committee nodes agree on the first local model information, updating a federal learning model at least according to the first local model information.
2. The method of claim 1, wherein the first committee node determines a first validation result of the first committee node for the non-committee node based on a local validation dataset of the first committee node and the first local model information; the method comprises the following steps:
the first committee node determining, based on the first local model information, a local validation accuracy rate of the first local model information for a local validation dataset of the first committee node;
the first committee node determines the first verification result of the first committee node for the non-committee node according to the local verification accuracy.
3. The method of claim 1, wherein the first committee node determining that the committee nodes agree on the first local model information comprises:
the first committee node acquires the second verification results;
the first committee node determines that the first local model information passes according to the first verification result and the second verification results, and then sends consensus verification results to the second committee nodes;
the first committee node receives the consensus verification results from the second committee nodes, and determines that the committee nodes agree on the first local model information according to the consensus verification results of the second committee nodes and a preset consensus algorithm.
4. The method of claim 1, wherein the updated federal learning model is a K-th federal learned model update; k is a positive integer; after the updating of the federal learning model, the method further comprises the following steps:
the first committee node determines, from the non-committee nodes, committee nodes for the K +1 th round of federal learning through the second committee nodes.
5. The method of claim 4, wherein the first committee node determining, by the second committee nodes, committee candidate nodes for a K +1 th round of federal learning from the non-committee nodes comprises:
and the first committee node determines the committee node of the K +1 th round of federal learning from each non-committee node according to the verification result of each committee node on each non-committee node through each second committee node.
6. The method of claim 5, wherein the first committee node determining a committee node for a K +1 th round of federal learning from the non-committee nodes based on the results of the validation of the non-committee nodes by the committee nodes, comprises:
for each non-committee node of the non-committee nodes, determining, by the first committee node, an initial probability that the non-committee node is selected as a committee node of the K +1 th round of federal learning according to the first verification result;
according to the number of historical rounds of the non-committee nodes which are selected as committee nodes in the multi-round training process of federal learning, the first committee node adjusts the initial probability of the non-committee nodes which are selected as the K + 1-th round of the committee nodes of the federal learning according to a negative correlation principle, and therefore the elected probability of the non-committee nodes is determined; the negative correlation principle refers to that the election probability of the non-committee node is in negative correlation with the historical round number of the non-committee node which is selected as a committee node;
and the first committee node determines the committee nodes of the K +1 th round of federal learning from the non-committee nodes according to the election probability of each non-committee node through the second committee nodes.
7. The method of any of claims 1 to 6, wherein the first committee node, after determining that the committee nodes agree on the first local model information, further comprises:
the first committee node writing the first local model information to the blockchain;
the first committee node updating a federal learning model based at least on the first local model information, including:
the first committee node updates the federal learning model according to the local model information of the uplink of each non-committee node; the local model information of the uplink of each non-committee node is the local model information successfully written into the block chain in the local model information of each non-committee node.
8. The method of any of claims 1 to 6, further comprising, after updating the federated learning model:
and the first committee node broadcasts the federal learning model obtained after updating the federal learning model to the non-committee nodes.
9. A federal learning apparatus applied to a block chain, which is applied to a block chain including committee nodes and non-committee nodes, the apparatus comprising:
an acquisition module for acquiring first local model information from any non-committee node; the first local model information is trained based on a local test dataset of the non-committee node; the first committee node is any one of the committee nodes;
a processing module to determine a first validation result of the first committee node for the non-committee node based on a local validation dataset of the first committee node and the first local model information; sending the first verification result to each second committee node; the first verification result is used for being combined with each second verification result to enable each committee node to commonly identify the first local model information; each of the second committee nodes is a committee node of the committee nodes other than the first committee node; each second verification result is a verification result obtained according to the local verification data set of each second committee node and the first local model information; and if the committee nodes are determined to agree on the first local model information, updating a federal learning model at least according to the first local model information.
10. A computer device comprising a program or instructions that, when executed, perform the method of any of claims 1 to 8.
11. A storage medium comprising a program or instructions which, when executed, perform the method of any one of claims 1 to 8.
CN202010563217.9A 2020-06-19 2020-06-19 Federal learning method and device applied to block chain Pending CN111723946A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010563217.9A CN111723946A (en) 2020-06-19 2020-06-19 Federal learning method and device applied to block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010563217.9A CN111723946A (en) 2020-06-19 2020-06-19 Federal learning method and device applied to block chain

Publications (1)

Publication Number Publication Date
CN111723946A true CN111723946A (en) 2020-09-29

Family

ID=72567623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010563217.9A Pending CN111723946A (en) 2020-06-19 2020-06-19 Federal learning method and device applied to block chain

Country Status (1)

Country Link
CN (1) CN111723946A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111931242A (en) * 2020-09-30 2020-11-13 国网浙江省电力有限公司电力科学研究院 Data sharing method, computer equipment applying same and readable storage medium
CN112434280A (en) * 2020-12-17 2021-03-02 浙江工业大学 Block chain-based federal learning defense method
CN112560059A (en) * 2020-12-17 2021-03-26 浙江工业大学 Vertical federal model stealing defense method based on neural pathway feature extraction
CN112598132A (en) * 2020-12-04 2021-04-02 光大科技有限公司 Model training method and device, storage medium and electronic device
CN112738035A (en) * 2020-12-17 2021-04-30 杭州趣链科技有限公司 Block chain technology-based vertical federal model stealing defense method
CN112863175A (en) * 2020-12-31 2021-05-28 平安科技(深圳)有限公司 Automobile road monitoring data processing method, device, equipment and storage medium
CN113239635A (en) * 2021-06-16 2021-08-10 中国银行股份有限公司 Model evaluation method and device
CN113344222A (en) * 2021-06-29 2021-09-03 福建师范大学 Safe and credible federal learning mechanism based on block chain
CN113570065A (en) * 2021-07-08 2021-10-29 国网河北省电力有限公司信息通信分公司 Data management method, device and equipment based on alliance chain and federal learning
CN113807544A (en) * 2020-12-31 2021-12-17 京东科技控股股份有限公司 Method and device for training federated learning model and electronic equipment
CN115699207A (en) * 2021-11-01 2023-02-03 豪夫迈·罗氏有限公司 Federal learning of medical verification models
WO2023245640A1 (en) * 2022-06-24 2023-12-28 亚信科技(中国)有限公司 Blockchain-based federated learning device, method and system

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111931242A (en) * 2020-09-30 2020-11-13 国网浙江省电力有限公司电力科学研究院 Data sharing method, computer equipment applying same and readable storage medium
CN112598132A (en) * 2020-12-04 2021-04-02 光大科技有限公司 Model training method and device, storage medium and electronic device
CN112434280A (en) * 2020-12-17 2021-03-02 浙江工业大学 Block chain-based federal learning defense method
CN112560059A (en) * 2020-12-17 2021-03-26 浙江工业大学 Vertical federal model stealing defense method based on neural pathway feature extraction
CN112738035A (en) * 2020-12-17 2021-04-30 杭州趣链科技有限公司 Block chain technology-based vertical federal model stealing defense method
CN112434280B (en) * 2020-12-17 2024-02-13 浙江工业大学 Federal learning defense method based on blockchain
CN112560059B (en) * 2020-12-17 2022-04-29 浙江工业大学 Vertical federal model stealing defense method based on neural pathway feature extraction
CN113807544A (en) * 2020-12-31 2021-12-17 京东科技控股股份有限公司 Method and device for training federated learning model and electronic equipment
CN113807544B (en) * 2020-12-31 2023-09-26 京东科技控股股份有限公司 Training method and device of federal learning model and electronic equipment
CN112863175B (en) * 2020-12-31 2022-11-22 平安科技(深圳)有限公司 Automobile road monitoring data processing method, device, equipment and storage medium
CN112863175A (en) * 2020-12-31 2021-05-28 平安科技(深圳)有限公司 Automobile road monitoring data processing method, device, equipment and storage medium
CN113239635A (en) * 2021-06-16 2021-08-10 中国银行股份有限公司 Model evaluation method and device
CN113344222A (en) * 2021-06-29 2021-09-03 福建师范大学 Safe and credible federal learning mechanism based on block chain
CN113344222B (en) * 2021-06-29 2023-05-16 福建师范大学 Safe and reliable federal learning mechanism based on blockchain
CN113570065A (en) * 2021-07-08 2021-10-29 国网河北省电力有限公司信息通信分公司 Data management method, device and equipment based on alliance chain and federal learning
CN115699207A (en) * 2021-11-01 2023-02-03 豪夫迈·罗氏有限公司 Federal learning of medical verification models
CN115699207B (en) * 2021-11-01 2024-04-26 豪夫迈·罗氏有限公司 Federal learning of medical validation models
WO2023245640A1 (en) * 2022-06-24 2023-12-28 亚信科技(中国)有限公司 Blockchain-based federated learning device, method and system

Similar Documents

Publication Publication Date Title
CN111723946A (en) Federal learning method and device applied to block chain
US20170270526A1 (en) Machine learning for fraud detection
CN111783875A (en) Abnormal user detection method, device, equipment and medium based on cluster analysis
WO2020040777A1 (en) Model shift prevention through machine learning
CN111401558A (en) Data processing model training method, data processing device and electronic equipment
CN110852881B (en) Risk account identification method and device, electronic equipment and medium
CN113011973B (en) Method and equipment for financial transaction supervision model based on intelligent contract data lake
Jebreel et al. Defending against the label-flipping attack in federated learning
US20220172112A1 (en) Data processing method and apparatus, and computer device
CN110020868B (en) Anti-fraud module decision fusion method based on online transaction characteristics
US11631061B2 (en) Method for creating and maintaining a distributed ledger of vehicle gas consumption and wear and tear information
US11727137B2 (en) Predictive update of profile database with update logic
CN113902127A (en) Asynchronous federal learning method with block chain enabled
Boualouache et al. On-demand security framework for 5GB vehicular networks
CN114841820A (en) Transaction risk control method and system
CN110930158A (en) Block chain DPoS common recognition method based on reward and punishment mechanism
CN116186629B (en) Financial customer classification and prediction method and device based on personalized federal learning
CN109919626B (en) High-risk bank card identification method and device
CN113672992A (en) Multi-source heterogeneous data safety protection and fusion method and system for global air traffic control operation
CN114926279A (en) Terminal payment method and system based on block chain
Witt et al. Decentralized and Incentivized Federated Learning: A Blockchain-Enabled Framework Utilising Compressed Soft-Labels and Peer Consistency
CN113487109A (en) Group identification method and device, electronic equipment and storage medium
Kim et al. Predicting debt default of P2P loan borrowers using self-organizing map
HussainiWindiatmaja et al. PoIR: A Node Selection Mechanism in Reputation-Based Blockchain Consensus Using Bidirectional LSTM Regression Model.
US20220222546A1 (en) Evaluating Supervised Learning Models Through Comparison of Actual and Predicted Model Outputs

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