CN113919507A - Federal learning method based on DAG block chain - Google Patents

Federal learning method based on DAG block chain Download PDF

Info

Publication number
CN113919507A
CN113919507A CN202111186244.XA CN202111186244A CN113919507A CN 113919507 A CN113919507 A CN 113919507A CN 202111186244 A CN202111186244 A CN 202111186244A CN 113919507 A CN113919507 A CN 113919507A
Authority
CN
China
Prior art keywords
model
local
training
malicious
dag
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
CN202111186244.XA
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.)
Chongqing University of Post and Telecommunications
Original Assignee
Chongqing University of Post 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 Chongqing University of Post and Telecommunications filed Critical Chongqing University of Post and Telecommunications
Priority to CN202111186244.XA priority Critical patent/CN113919507A/en
Publication of CN113919507A publication Critical patent/CN113919507A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine 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

Abstract

The invention relates to a federated learning method based on a DAG block chain, belonging to the technical field of mobile communication. First, the device with a higher reputation value in the sliding window w is selected in the candidate device set to participate in local training. Secondly, aggregation based on local DAG block chain local models is carried out in the process of local training of the selected equipment. And finally, collecting the trained local model by the main fog node, and preliminarily detecting the potential malicious model by adopting a fast detection algorithm based on the isolated forest. The main fog node tests the precision of the potential malicious model by using a test data set of a task publisher, if the precision of the potential malicious model is more than beta different from the precision of the current global model, the model is determined to be a malicious model, otherwise, the model is a normal model; and finally, obtaining a new global model. And after the training of the target model is finished, the task publisher acquires the target model and the attribute records of the local models of the related Internet of things equipment from the main block chain, and the reputation value of the Internet of things equipment is updated by the main fog node.

Description

Federal learning method based on DAG block chain
Technical Field
The invention belongs to the technical field of mobile communication, and relates to a federal learning method based on a DAG block chain.
Background
With the rapid development of the internet of things (IoT), various mobile devices need to access the internet, which poses serious challenges for mobile devices with limited computing power and data resources. To effectively overcome these challenges and to support well the compute intensive and delay sensitive applications with quality of service requirements, fog computing (FogComputing), a new paradigm similar to Mobile Edge Computing (MEC), has been proposed as a promising solution to distribute computing, communication, and storage resources to devices near the user, enabling cloud computing to be extended to the edge of the network. Since the fog calculation has a relatively strong calculation power, the performance of the system in terms of task processing delay can be greatly improved. But also face many challenges for user privacy, data security, etc. The federated learning is used as a time-and-time hot artificial intelligence technology, the problems of private data and data isolated island can be solved, and the federated learning is applied to the field of edge calculation to effectively process the problems of private data and the like. Federated learning may enable participants to transfer and exchange model parameters to build machine learning models using the participants' data without revealing their privacy.
While federal learning is widely recognized as a viable approach to enhancing IoT network privacy and security, many challenges remain in the deployment process. The main two points are as follows: first, in federal learning, device variability, different devices have different federal learning resources in terms of computation, communication, buffering, battery level, data, and training time. Secondly, due to abnormal detection of the federal learning model, a malicious participant can provide a malicious local model by launching a poisoning attack in the federal learning process, and the convergence and the accuracy of the global model are compromised.
Disclosure of Invention
In view of the above, the present invention is directed to a federate learning method based on a DAG block chain.
In order to achieve the purpose, the invention provides the following technical scheme:
a federated learning method based on DAG block chains comprises the following steps:
s1: selecting a scheme for federal learning training equipment in a fog network;
s2: a local model training and aggregation scheme based on directed acyclic graph block chains;
s3: a rapid double malicious model detection algorithm based on an isolated forest;
s4: a reputation calculation scheme based on subjective evaluation;
in step S1, the main fog node selects communication capability ξ in the alternative devicemAnd computing power τmAnd (4) forming an alternative device set by stronger devices, and then selecting the devices with higher reputation values in the sliding window w in the alternative device set to participate in the local training task.
In step S2, the devices participating in the local training download the global model from the affiliated foggy node, and perform training and local aggregation. The device randomly selects some unverified transactions (tips) for verification on its local DAG and selects a local model with high precision therein for local aggregation. The device then trains a new local model using the local data set. Finally, the device publishes the patch containing the newly trained local model. In the local training process of the model, a random gradient descent (SGD) algorithm is adopted to update the local model, and a local aggregation model is obtained through a Federal averaging (FedAVG) algorithm.
In step S3, the main fog node collects the local models to be aggregated and initially detects potential malicious models using a fast detection algorithm based on isolated forests. Firstly, the algorithm constructs a plurality of isolated trees by sampling for a plurality of times, and uses the average depth of each model in the trees as the final output depth; secondly, calculating the abnormal score of each data point in the leaf node through the output depth, and selecting a model with the abnormal score exceeding a threshold value as a potential malicious model; thirdly, the main fog node tests the precision of the potential malicious model by using the test data set of the task publisher, if the precision of the potential malicious model is more than beta different from the precision of the current global model, the model is determined as the malicious model, otherwise, the model is the normal model; and finally, selecting a normal model and then carrying out global aggregation to obtain a new global model.
In step S4, after finishing training the target model, the task publisher acquires the target model and the attribute records (whether the attribute records are malicious models) of the local models of the related internet of things devices from the master block chain, calculates reputation values of the corresponding devices, feeds the reputation values back to the corresponding fog nodes, and forwards the reputation values to the master fog node to update the reputation values of the internet of things devices. The reputation value updating process is as follows:
the reputation evaluation of the task publisher m' on the device l based on the published task y is represented by a vector as:
Figure BDA0003299345680000021
wherein
Figure BDA0003299345680000022
Representing trust, distrust and uncertainty, respectively.
Figure BDA0003299345680000023
Wherein
Figure BDA0003299345680000024
Based on the subjective logic model, the following results are obtained:
Figure BDA0003299345680000025
wherein the content of the first and second substances,
Figure BDA0003299345680000026
is the number of normal (malicious) models during the execution of task y,
Figure BDA0003299345680000027
indicating the probability of successful transmission of the packet during task y, i.e., the quality of the communication that affects the uncertainty of the reputation evaluation. η (κ) represents the weight of the normal (malicious) model, respectively, and η + κ ═ 1 and κ ≦ η. Based on this, the reputation evaluation of the task publisher m' on the internet of things device l based on the task y can be represented as:
Figure BDA0003299345680000031
where a ∈ [0,1] represents the degree of influence of uncertainty on reputation.
The invention has the beneficial effects that: the problem of model precision difference caused by differences in the aspects of calculation, communication, cache, battery power, data, training time and the like among different devices is solved. Secondly, in order to realize the abnormal detection of the model, a malicious model detection algorithm based on an isolation forest is adopted, the malicious score uploaded by the participant to the model is calculated by constructing the isolation forest, when the malicious score of the model is higher than a threshold value, the accuracy test is carried out on the model, and the model exceeding the accuracy loss threshold is finally determined as the malicious model.
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 may be realized and attained by the means of the instrumentalities and combinations particularly pointed out hereinafter.
Drawings
For the purposes of promoting a better understanding of the objects, aspects and advantages of the invention, reference will now be made to the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a system model diagram;
FIG. 2 is a flow diagram of federated learning based on directed acyclic graph blockchains in a fog network;
FIG. 3 is a flow chart of a fast isolated forest malicious model double detection algorithm.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention in a schematic way, and the features in the following embodiments and examples may be combined with each other without conflict.
Wherein the showings are for the purpose of illustrating the invention only and not for the purpose of limiting the same, and in which there is shown by way of illustration only and not in the drawings in which there is no intention to limit the invention thereto; to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The same or similar reference numerals in the drawings of the embodiments of the present invention correspond to the same or similar components; in the description of the present invention, it should be understood that if there is an orientation or positional relationship indicated by terms such as "upper", "lower", "left", "right", "front", "rear", etc., based on the orientation or positional relationship shown in the drawings, it is only for convenience of description and simplification of description, but it is not an indication or suggestion that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes, and are not to be construed as limiting the present invention, and the specific meaning of the terms may be understood by those skilled in the art according to specific situations.
1. System model
The fog network in the model is composed of fog nodes FN (Fog nodes) and Internet of things equipment (Internet of things devices). As shown in fig. 1. The fog nodes have large capacity of computing and communication resources, and K fog nodes are assumed to be used
Figure BDA0003299345680000041
And (4) showing. The internet of things devices have limited computational and communication resources, and assuming that there are M internet of things devices, denoted by M ═ 1. The internet of things equipment requesting the task is defined as m', and the internet of things equipment has specific requesting tasks, such as image recognition, traffic condition prediction and the like. Let thing networking device set M have corresponding training data set D ═ D1,..,Dm,..,DMThe computing task is based on the data setAnd D, training the task model and returning the task model to the target model required by the task requester.
The model adopts a federated learning structure based on DAG, and comprises the following three steps: device selection, local training and aggregation, and global aggregation. Firstly, in equipment selection, the efficiency and the precision of model training are improved and the safety of a training model is ensured by screening the Internet of things equipment with better performance; secondly, local models are transmitted among the Internet of things devices through D2D (Device to Device), and model verification and aggregation are carried out by utilizing a DAG structure; and finally, selecting the block producer nodes as an aggregator of global aggregation through a DPOS consensus algorithm. The specific implementation steps are shown in fig. 2. The method mainly comprises the steps of equipment selection for local model training, local model aggregation based on DAG, global aggregation of fog nodes selected by a DPOS consensus algorithm, double screening of local models and subjective reputation calculation model of training equipment.
2. Federal learning model based on DAG block chain
Federal Learning (FL) is a model for machine learning built using distributed training data sets that are stored and maintained on local devices, allowing privacy protection of participant data. The FL is to achieve global aggregation by collecting local models of different devices to update a global model. In the model, the task request of the task requester is completed through the FL. The Internet of things equipment conducts local training, and the main fog nodes conduct global aggregation.
For owning data set DmThe loss function of the local model is defined as
Figure BDA0003299345680000042
Wherein f isj(w,xj,yj) Is the local model w in the data sample (x)j,yj) Loss function of, | DmIs the data sample DmThe size of (2). Therefore, the loss function F (w) of the global model is defined as
Figure BDA0003299345680000043
Where | M | is the number of devices in the internet of things. c. CmIs the local model weight factor for m.
In the model training process, a random gradient descent (SGD) algorithm is adopted, and a minimum global loss function F (w) is obtained through gradual iteration
Q(w)=argminF(w) (5)
2.1 device selection
In order to improve the training efficiency and precision and ensure the safety of a training model, firstly, the communication capability xi is selected from alternative equipmentmAnd computing power τmAnd forming an alternative device set by stronger devices, and then selecting the devices with higher reputation values in the period of the sliding window w in the alternative device set to participate in the local training task. The method comprises the following concrete steps:
firstly, a task publisher initializes a global model, sends the global model, related task information and a test data set to a corresponding fog node, sends the global model to a main fog node of a fog network through the fog node, and broadcasts a task to the whole fog network by the main fog node. The equipment of the Internet of things with the training conditions sends available computing and communication capabilities to corresponding fog nodes, and after all equipment information is collected by the main fog node, according to the computing and communication capabilities xim·τmSorting the Internet of things equipment in a descending order, screening according to the credit value, and finally determining an alternative equipment list
Figure BDA0003299345680000051
And the main fog node receives the local model of the corresponding equipment according to the equipment list.
2.2 local model training and aggregation based on DAG blockchains
Compared with the traditional single-chain block chain, the block chain based on DAG is adopted in the model, and the block chain based on DAG has the advantages that a plurality of collected transactions are packed into one block by the nodes in the traditional block chain, the blocks are connected in a single-chain mode, the latter block must be confirmed by the former block, the block packing time delay and a linear verification mode reduce the validity of block chain transaction verification, and the improvement of the block chain throughput is hindered.
Different from a linear connection structure of a traditional block chain, the model adopts a data structure based on DAG, the data stored at the bottom layer is in a directed acyclic graph form, and the data are connected and stored through the DAG. The block chain adopts a DAG structure, so that asynchronous block addition can be realized, and the structural advantage of the block chain enables the transaction in the whole network to be executed concurrently; moreover, because the DAG structure supports asynchronism, the block chain based on the DAG structure can omit the time delay of block packing, and further improves the block chain efficiency, so that the throughput performance of the block chain based on the DAG structure is greatly improved compared with the block chain of the traditional structure.
The verification of the local model is combined with the updating process in the model. First, in a local block chain, a device l participating in local model training maintains a local DAG block chain, where each block includes device authentication information, local model parameters, and a block connection relationship. The local DAG block chain updates the local DAG block chain through the gossip scheme, so that a new model can be propagated in the whole fog network; second, a consensus algorithm is run to update the local DAG blockchain. Consensus of local DAG blockchains approve blocks by verifying tips' identity information and local model correctness. the identity of tips can be verified by encryption techniques such as RSA in the blockchain field, and the local model can be verified by a test set formed based on local data.
When the device performs local aggregation, firstly, the device runs a consensus algorithm based on a DAG block Chain, selects some tips for verification on the local DAG block Chain through a Markov Chain Monte Carlo (MCMC) algorithm, and selects a local model with high precision to perform aggregation so as to construct a new local model. Second, the device trains a new local model using the local data set. Finally, the tile containing the new local model is released.
Local training in this model employs a Stochastic Gradient Descent (SGD) algorithm. In the t-th iteration, the device
Figure BDA0003299345680000061
Using the global model w in the t-1 th iterationt-1Through a data set DlTraining to obtain local model
Figure BDA0003299345680000062
Calculating the falling gradient by equation (6)
Figure BDA0003299345680000063
l will local model parameters
Figure BDA0003299345680000064
Packed into tiles and sent to nearby devices over the D2D link and receive tiles for nearby devices. Then, l selects from the local DAG blockchain to satisfy the time tolerance using MCMC algorithm
Figure BDA0003299345680000065
Some tips (no more than α) are locally aggregated by first verifying the identity information of tips, then testing the accuracy of the local models in the block using the local test data set, and sorting in descending order of accuracy. And selecting k (k is less than alpha) local models with highest precision, obtaining a local aggregation model through a Federal averaging (FedAVG) algorithm, and training the local models by using a local data set.
Figure BDA0003299345680000066
Where η is the learning rate of the distributed gradient descent algorithm.
2.3 Global aggregation
After local training and aggregation, each fog node collects local model parameters and sends the local model parameters to the main fog node. The main fog node performs global aggregation by using a formula (7) after screening of a malicious model, records the state (normal or malicious) of a local model of corresponding equipment, updates an alternative equipment list (equipment uploading the malicious model for more than three times is removed from the alternative equipment list), packs relevant model parameters and equipment state information into blocks, and adds the blocks to a main chain after verification of other fog nodes.
Figure BDA0003299345680000067
Wherein L is the number of devices participating in the local training, ClIs the contribution of device l to the overall training process in iteration t.
The main block chain in the model selects a block producer through a DPOS consensus algorithm. And voting by the fog nodes according to the computing capacity, the communication capacity and the historical behavior to select a certain number of devices to form a candidate set, taking the fog nodes in the candidate set as main fog nodes, namely block producers in turn, and carrying out global model aggregation and block packing and releasing. And the packed block is sent to other candidate fog nodes for verification, and the verifier verifies the information in the block and returns the result to the main fog node. After collecting all the verification results, the master node determines whether to submit the block. And if the verification is passed, the main fog node sends the block to all the fog nodes, and the main block chain is updated.
3. Fast isolation forest (IForest) dual malicious model detection algorithm
In the model, a fast forest isolation double malicious model detection algorithm is adopted. The method is an abnormal value detection algorithm, a plurality of isolated trees (iTrees) are constructed through multiple sampling, and the average value of the depth of each node in the iTrees is used as the final output depth. And finally, outputting the abnormal scores of the deep calculation nodes, and selecting the nodes with high abnormal scores as candidate malicious models in the model.
And testing the precision of the model by using a test data set provided by a task publisher aiming at the selected candidate malicious model, judging the model as a normal model when the difference between the precision of the candidate model and the precision of the global model is less than alpha, otherwise, judging the model as a malicious model, and failing to participate in global aggregation. Devices uploading malicious models will be marked as sensitive devices, which are not removed from the device list for a while, and federal learning can continue. Slave device list when device is marked as sensitive three times
Figure BDA0003299345680000071
Is removed. This ensures that normal devices are not determined to be malicious devices due to occasional training errors. The algorithm flow is shown in fig. 3, and mainly comprises the steps of inputting model parameters for dimensionality reduction, and constructing an isolated forest for calculating the abnormal score and the threshold of the model and detecting the malicious model. The method comprises the following specific steps:
3.1 data dimensionality reduction for unsupervised feature selection Algorithm (NMIFS) based on standardized mutual information
Because the parameters of the model are usually high latitude matrixes, which is not beneficial to constructing an isolated forest anomaly detection model, all the model parameters need to be flattened into one-dimensional vectors for the following reasons: firstly, the value of each position in the model parameter is expressed as the data characteristic of the model, and after the model is flattened into a one-dimensional vector, the data characteristic of the model can be expressed more intuitively. Secondly, after the model is flattened into a one-dimensional vector, the IForest algorithm is more convenient to apply. After the parameters of the local model i are flattened into a one-dimensional vector, the vector can be expressed into a k-dimensional column vector: u. ofi={xi1,xi2,..,xik},i∈(1,L),xikFor the kth feature data of the ith model, the input raw data set is: u ═ U1,u2,…,uLAnd L is the number of the devices of the Internet of things participating in the local training.
First the redundancy based on normalized mutual information is calculated:
mutual Information (MI) is a measure of the interdependence between two random variables, defined as:
I(x,y)=H(x)+H(y)-H(x,y) (8)
wherein H (.) represents the information entropy of the variable. For a given discrete random variable x and y, MI can be calculated by the following formula
Figure BDA0003299345680000072
Wherein, p (x)i,xj) Is a joint probability distribution, p (x)i),p(xj) Is the marginal probability distribution. Thereby, canThe redundancy of individual features as well as feature subsets is calculated by the following formula.
1) Characteristic xkAnd feature xk'Normalized Mutual Information (NMI) between, i.e. redundancy:
Figure BDA0003299345680000081
2) characteristic xkFeature F relative to feature subsetsAverage redundancy of, i.e. feature xkWith respect to each feature xk'∈FsAverage of redundancy of (1):
Figure BDA0003299345680000082
3) feature subset FsIs the redundancy of each feature xk'∈FsAverage redundancy of (1):
Figure BDA0003299345680000083
the average redundancy is calculated for the data set U using equation (12) and is taken as the feature subset FsSelecting a threshold value of a characteristic element, calculating an entropy value of each characteristic in the U, sorting the characteristic values in an ascending order, calculating the average redundancy of each characteristic in turn by using a formula (11), and taking the characteristic with the average redundancy smaller than the threshold value as a characteristic element of a characteristic subset to finally obtain a characteristic subset Fs
With FsAs a subset of the output features after data dimensionality reduction, Fs={x1,…,xs,…,xSS is the total number of features in the feature set, xsFor the S-th feature in the feature set, S ∈ (1, S), xs={y1,y2,…,yl},ylIs the eigenvalue of the L model in the s-th feature, L ∈ (1, L).
3.2 malicious model detection based on IForest
After all local models have been processed in a dimensionality reduction manner, FsEach feature vector has L parameters. The malicious model detection based on the IForest comprises three steps:
step one, using FsAnd respectively constructing an isolation tree and an isolation forest.
And step two, calculating the abnormal score of the model to generate a candidate malicious model set.
And thirdly, determining a malicious model based on the test data set.
First, using FsAnd respectively constructing an isolation number and an isolation forest. From FsRandomly selecting a data feature, constructing an iTree, and calculating a data point x in the iTreeslIs defined as:
Figure BDA0003299345680000084
where L represents the total number of data points to construct the iTree. After traversing the isolated tree iTree, a data point x can be obtainedslI.e. the depth h (x) of the data pointssl):
h(xsl)=e+C(L) (14)
e is the current path length, C (L) is a correction value, which represents the average path depth of the binary tree constructed by L data points, and the calculation formula is as follows:
Figure BDA0003299345680000091
where ξ 0.5772156649 is the Euler constant, traversing an isolated tree yields data point xslAbnormal score SM (x)sl) Considering the sampling subspace and the random choice of features, SM (x)sl) The reliability is very low. Therefore, the construction of the isolated forest can obtain the average path depth of each data point in a plurality of trees, and further obtain the data point xslAverage anomaly score of AS (x)sl)
Figure BDA0003299345680000092
E(h(xsl) Represents data point x)slAverage over a number of iTree path depths.
And secondly, calculating the abnormal scores of the models to generate a candidate malicious model set. The traditional isolated forest algorithm finds the abnormal score by traversing each tree in the forest and calculating the average path length of each data point. When the abnormal score of a data point tends to 1, the point is determined to be an outlier; when the abnormality score tends to 0, the point is a normal point; when the abnormality score tends to 0.5, the state cannot be judged. According to the scheme, the outlier coefficient of the features is obtained through statistical data feature analysis, the dispersion of the data set is measured based on the feature outlier coefficient, and the threshold value for judging the malicious model is obtained.
Characteristic xsCharacteristic outlier coefficient Disp ofcoe(xs) Is defined as:
Figure BDA0003299345680000093
wherein the content of the first and second substances,
Figure BDA0003299345680000094
is a characteristic xsMean of the anomaly scores of (a), ylRepresents a feature xsAbnormal score, Disp, of model Icoe(xs) For measuring features xsSequentially computing the feature set FsObtaining a data set characteristic outlier coefficient vector DxRecording as follows:
Dx={Dispcoe(x1),Dispcoe(x2),…,Dispcoe(xS)} (18)
d is determined according to equation (18)xNormalization is carried out to obtain a normalized data set characteristic outlier coefficient vector DNormAs shown in equation (19):
Figure BDA0003299345680000095
DNorm={NDispcoe(x1),NDispcoe(x2),…,NDispcoe(xS)} (20)
the pruning threshold theta can be calculated through the characteristic outlier coefficient vectorD. In the formula (21), DNorm-Top (S) means that D is rapidly acquired by adopting the Top () algorithmxS value with maximum medium feature outlier coefficient, S is the number of features in Fs after D dimensionality reduction by NMIFS, and the adjustment factor alpha is the interval [0.45,0.55 ]]A random number in between. Calculating abnormal score of each data point by an isolated forest algorithm and sorting in descending orderDData points with larger anomaly scores fall under the set of candidate malicious models.
Figure BDA0003299345680000101
And finally, testing the precision of the candidate malicious model by using the test data set of the task publisher, and if the difference between the model precision and the global model precision is larger than beta, determining the model as the malicious model, otherwise, determining the model as the normal model.
3.3 Global aggregation
After the malicious model detection of IForest, the detected normal model is subjected to global aggregation according to a formula (7). Then the aggregated global model wtBroadcast to all devices.
4. Reputation model based on subjective evaluation
After the model training is finished, the task publisher acquires the attribute records (whether the attribute records are malicious models) of the target model and the local model of the related Internet of things equipment from the main block chain, calculates the credit values of the corresponding equipment, feeds the credit values back to the corresponding fog nodes, and forwards the credit values to the main fog nodes to update the credit values of the Internet of things equipment. The reputation value updating process is as follows:
the reputation evaluation of the task publisher m' on the device l based on the published task y is represented by a vector as:
Figure BDA0003299345680000102
wherein
Figure BDA0003299345680000103
Representing trust, distrust and uncertainty, respectively.
Figure BDA0003299345680000104
Wherein
Figure BDA0003299345680000105
Based on the subjective logical model, one can obtain:
Figure BDA0003299345680000106
wherein the content of the first and second substances,
Figure BDA0003299345680000107
is the number of normal (malicious) models during the execution of task y,
Figure BDA0003299345680000108
indicating the probability of successful transmission of the packet during task y, i.e., the quality of the communication that affects the uncertainty of the reputation evaluation. η (κ) represents the weight of the normal (malicious) model, respectively, and η + κ ═ 1 and κ ≦ η. Based on this, the reputation evaluation of the task publisher m' on the internet of things device l based on the task y can be represented as:
Figure BDA0003299345680000109
where a ∈ [0,1] represents the degree of influence of uncertainty on reputation.
Fig. 2 is a flow chart of the federal learning based on the DAG in the fog network, and the specific implementation steps are as follows:
step 201: initializing an algorithm;
step 202: selecting candidate block producers forming a consensus layer in the fog node based on a DPOS consensus algorithm;
step 203: the task publisher sends the task information and requirements to be trained to the affiliated fog node, and the affiliated fog node forwards the task information and requirements to the main fog node;
step 204: after receiving the task information, the main fog node broadcasts the task information to the equipment of the whole fog network, and then the equipment sends the resource information (such as the communication capacity and the calculation capacity of the equipment) of the equipment meeting the requirements to the corresponding fog node after receiving the task information, and finally gathers the resource information to the main fog node;
step 205: the main fog node selects equipment with strong comprehensive capability and meeting the credit requirement according to the information returned by the equipment to participate in local training;
step 206: the equipment selected to participate in the training downloads the global model to be trained from the affiliated fog node;
step 207: after the equipment trains the local model, the model is broadcasted to the adjacent equipment;
step 208: the method comprises the following steps that the equipment receives local models of adjacent equipment, selects a batch of tips through an MCMC algorithm, verifies the precision of the tips by using a test data set, and selects a local model with high precision for aggregation;
step 209: before each global aggregation, the fog node collects the local models trained by the devices and sends the local models to the main fog node;
step 210: the main fog node utilizes a rapid IForest double malicious model detection algorithm to screen malicious models, and selects a normal model to carry out global aggregation;
step 211: verifying whether the precision of the aggregated global model meets the requirement, if not, continuing training, otherwise, ending the training;
step 212: the task publisher obtains a trained target model of the task publisher, and returns a credit value of the main fog node to the equipment according to the behavior of the participating equipment in the training process;
step 213: when the main fog node receives the feedback credit value of the task publisher, updating the credit value of the equipment and adding the credit value to the main block chain;
step 214: end up
FIG. 3 is a flow chart of a fast isolated forest malicious model double detection algorithm, which is specifically implemented by the following steps:
step 301: initializing an algorithm;
step 302: calculating the entropy of the parameter matrix of the output model;
step 303: calculating the redundancy of the characteristics of the model parameters according to the entropy to obtain a characteristic vector subset with the minimum redundancy;
step 304: constructing an isolated forest tree by using an isolated forest algorithm;
step 305: calculating the abnormal score of each model by using the constructed isolated forest tree;
step 306: calculating a threshold value of the malicious model by using a formula (21);
step 307: selecting a candidate malicious model by using a threshold value;
step 308: testing the precision of the candidate malicious model;
step 309: judging the candidate malicious models which do not meet the precision requirement as malicious models;
step 310: and (6) ending.
Finally, the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the present invention, and although the present invention has been described in detail with reference to the preferred embodiments, it will be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions, and all of them should be covered by the claims of the present invention.

Claims (5)

1. A federated learning method based on a directed acyclic graph DAG block chain is characterized in that: the method comprises the following steps:
s1: selecting federal learning training equipment in a fog network;
s2: local model training and aggregation based on directed acyclic graph block chains;
s3: carrying out a rapid double malicious model detection algorithm based on the isolated forest;
s4: reputation calculation based on subjective evaluation.
2. The method of claim 1, wherein the method comprises: in the S1, the main fog node selects the communication capacity xi in the equipment meeting the training requirementmAnd computing power τmAnd forming an alternative device set by stronger devices, and then selecting the devices with higher reputation values in the sliding window w in the alternative device set to participate in the local training task.
3. The method of claim 2, wherein the federate learning method is based on a DAG blockchain, and comprises: in S2, after the device participating in the local training obtains the latest global model, the local training and aggregation are performed. The device randomly selects some unverified transactions for verification on its local DAG and selects a local model with high precision therein for local aggregation. The device then trains a new local model using the local data set. Finally, the block containing the newly trained local model is released. In the local training process of the global model, the local model is updated by adopting a random gradient descent (SGD) algorithm, and a local aggregation model is obtained by a federal average algorithm.
4. The method of claim 3, wherein the federated learning based on DAG blockchains is characterized in that: in S3, the main fog node collects local models to be aggregated, and preliminarily detects potential malicious models by using a fast detection algorithm based on isolated forests. Finally, the main fog node tests the precision of the potential malicious model by using a test data set of a task publisher, if the precision of the potential malicious model is more than beta different from the precision of the current global model, the model is determined as the malicious model, otherwise, the model is the normal model; and finally, selecting a normal model and then carrying out global aggregation to obtain a new global model.
5. The method of claim 4, wherein the federated learning based on DAG blockchains is characterized in that: in S4, the task publisher acquires the required target model from the master block chain and the attribute records of the local model of the device participating in the local training in the training process, where the attribute records are whether malicious models or not, calculates the reputation value of the corresponding device, feeds the reputation value back to the corresponding fog node, and forwards the reputation value to the master fog node to update the reputation value of the device in the internet of things.
CN202111186244.XA 2021-10-12 2021-10-12 Federal learning method based on DAG block chain Pending CN113919507A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111186244.XA CN113919507A (en) 2021-10-12 2021-10-12 Federal learning method based on DAG block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111186244.XA CN113919507A (en) 2021-10-12 2021-10-12 Federal learning method based on DAG block chain

Publications (1)

Publication Number Publication Date
CN113919507A true CN113919507A (en) 2022-01-11

Family

ID=79239371

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111186244.XA Pending CN113919507A (en) 2021-10-12 2021-10-12 Federal learning method based on DAG block chain

Country Status (1)

Country Link
CN (1) CN113919507A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115758350A (en) * 2022-11-09 2023-03-07 中央财经大学 Aggregation defense method and aggregation device for resisting virus exposure attack and electronic equipment
CN117114146A (en) * 2023-08-11 2023-11-24 南京信息工程大学 Method, device, medium and equipment for poisoning reconstruction of federal learning model

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115758350A (en) * 2022-11-09 2023-03-07 中央财经大学 Aggregation defense method and aggregation device for resisting virus exposure attack and electronic equipment
CN115758350B (en) * 2022-11-09 2023-10-24 中央财经大学 Aggregation defense method and device for resisting poisoning attack and electronic equipment
CN117114146A (en) * 2023-08-11 2023-11-24 南京信息工程大学 Method, device, medium and equipment for poisoning reconstruction of federal learning model
CN117114146B (en) * 2023-08-11 2024-03-29 南京信息工程大学 Method, device, medium and equipment for poisoning reconstruction of federal learning model

Similar Documents

Publication Publication Date Title
CN109460793B (en) Node classification method, model training method and device
CN111866954B (en) User selection and resource allocation method based on federal learning
CN113919507A (en) Federal learning method based on DAG block chain
CN112887145B (en) Distributed network slice fault detection method
Nguyen et al. Latency optimization for blockchain-empowered federated learning in multi-server edge computing
CN104298893B (en) Imputation method of genetic expression deletion data
CN115358487A (en) Federal learning aggregation optimization system and method for power data sharing
CN113268669B (en) Relation mining-oriented interest point recommendation method based on joint neural network
CN112637883A (en) Federal learning method with robustness to wireless environment change in power Internet of things
WO2023036184A1 (en) Methods and systems for quantifying client contribution in federated learning
CN109151953A (en) A kind of network insertion selection calculation method based on user and network bilateral income
Mehrizi et al. A Bayesian Poisson–Gaussian process model for popularity learning in edge-caching networks
CN113988441A (en) Power wireless network link quality prediction and model training method and device
CN114301935A (en) Reputation-based method for selecting edge cloud collaborative federated learning nodes of Internet of things
CN109948242A (en) Network representation learning method based on feature Hash
CN116669111A (en) Mobile edge computing task unloading method based on blockchain
CN113112032A (en) Flight delay prediction system and method based on federal learning
CN115051929A (en) Network fault prediction method and device based on self-supervision target perception neural network
Shu et al. Perf-al: Performance prediction for configurable software through adversarial learning
Guo et al. Feat: A federated approach for privacy-preserving network traffic classification in heterogeneous environments
CN112511619B (en) Method for matching transactions among resource nodes in wireless edge block chain scene
CN112738767A (en) Trust-based mobile edge user task scheduling method
CN110458432B (en) Cloud model-based reliability diagnosis method for electric power optical transmission network
CN115860856A (en) Data processing method and device, electronic equipment and storage medium
Atan et al. AI-empowered fast task execution decision for delay-sensitive IoT applications in edge computing networks

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