A gradient selection method for blockchain-based federated learning of drones
By using blockchain technology and the RCF anomaly detection algorithm in drone federated learning to identify and filter abnormal gradients, the problem of poisoning attacks in the drone network is solved, and the accuracy and security of the model are improved.
Patent Information
- Application Number
- CN202311632525.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-01
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-12-01
AI Technical Summary
In a wireless network composed of drone terminal equipment and base station edge nodes, it is difficult to identify illegal drone terminal equipment and prevent poisoning attacks. Especially when malicious drones upload abnormal gradients, poisoning attacks cannot be effectively prevented.
The blockchain-based gradient selection method of UAV federated learning is used to perform system identity authentication and gradient anomaly detection on the UAV terminal equipment through the base station edge node. The RCF anomaly detection algorithm is used to determine the abnormal model gradient, and the normal model gradient is Upload to the blockchain for subsequent processing to prevent poisoning attacks.
Effectively identify illegal drone terminal equipment, avoid using abnormal model gradients, improve model accuracy and attack resistance, and enhance data security.
Smart Images

Figure CN117596592B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of unmanned aerial vehicle technology, and in particular to a gradient selection method for unmanned aerial vehicle federated learning based on blockchain. Background Art
[0002] Federated Learning is an emerging distributed machine learning method. Unlike traditional distributed machine learning, federated learning requires a decentralized distribution system to ensure the privacy and security of base stations, and to conduct effective machine learning under the premise of ensuring data security and exchange and training efficiency. Blockchain, with its anonymity, immutability, and distribution, provides a safe and reliable solution between multiple untrusted participants. Through consensus mechanisms, smart contracts, etc., the reliability of chain data is guaranteed between multiple untrusted distributed participants. Therefore, blockchain can provide data confidentiality for data exchange in federated learning to protect base station privacy, ensure data security between participants, and ensure data consistency for multiple participants to provide data for model training. The value-driven incentive mechanism of blockchain can also increase the enthusiasm of participants to provide data and update network model parameters.
[0003] However, when the machine learning model training that combines federated learning, blockchain, and edge computing is applied to a wireless network composed of drone terminal devices and base station edge nodes, the following problems still exist: when an illegal drone terminal device launches a poisoning attack during local training, the base station edge node cannot identify the illegal drone terminal device; in addition, if abnormal gradients uploaded by malicious drone terminal devices are used, poisoning attacks cannot be effectively prevented. Summary of the invention
[0004] In order to solve the above problems existing in the existing technology, the present invention provides a gradient selection method for UAV federated learning based on blockchain.
[0005] An embodiment of the present invention provides a gradient selection method for blockchain-based federated learning of unmanned aerial vehicles, comprising: each unmanned aerial vehicle terminal device uploads a model gradient obtained through local training to a base station edge node to which it belongs; after receiving the model gradient uploaded by each unmanned aerial vehicle terminal device, the base station edge node performs system identity authentication on each unmanned aerial vehicle terminal device; the base station edge node performs gradient anomaly detection on each unmanned aerial vehicle terminal device that passes the system identity authentication, and determines whether the model gradient uploaded by each unmanned aerial vehicle terminal device that passes the system identity authentication is an abnormal model gradient or a normal model gradient; the base station edge node filters the abnormal model gradient, and uploads part or all of the normal model gradient to the blockchain for subsequent processing, so as to prevent poisoning attacks by avoiding the use of abnormal model gradients.
[0006] Preferably, after the base station edge node receives the model gradient uploaded by each drone terminal device, it performs system identity authentication on each drone terminal device, including: the base station edge node verifies whether each drone terminal device is registered; if the drone terminal device is not registered, the base station edge node determines that the drone terminal device has not passed the system identity authentication and discards the model gradient of the drone terminal device; if the drone terminal device is registered, the base station edge node determines that the drone terminal device has passed the system identity authentication.
[0007] Preferably, the base station edge node performs gradient anomaly detection on each drone terminal device that has passed the system identity authentication, and determines whether the model gradient uploaded by each drone terminal device that has passed the system identity authentication is an abnormal model gradient or a normal model gradient, including: for any drone terminal device that has passed the system identity authentication, the base station edge node uses the RCF anomaly detection algorithm to calculate the effective gradient range, and determines whether the model gradient of the drone terminal device is within the effective gradient range; if the model gradient of the drone terminal device is within the effective gradient range, the base station edge node marks the model gradient of the drone terminal device as a normal gradient; if the model gradient of the drone terminal device is not within the effective gradient range, the base station edge node marks the model gradient of the drone terminal device as an abnormal gradient.
[0008] Preferably, the RCF anomaly detection algorithm comprises:
[0009]
[0010] Among them, Q k,j is the RCF anomaly detection result of the model gradient of the jth UAV terminal device in the kth base station edge node; E k,j is the model gradient of the jth UAV terminal device collected by the kth base station edge node; x is the average gradient; std is the standard deviation; W is the number of gradients collected by the current base station edge node; the function sig is used to determine whether the current model gradient is abnormal, the abnormal model gradient is marked as 0, and the normal model gradient is marked as 1.
[0011] Preferably, the base station edge node uploading part of the normal model gradients to the blockchain comprises: the base station edge node randomly selects a number of normal model gradients from all normal model gradients, and uploads them to the blockchain.
[0012] Preferably, the base station edge node uploading part of the normal model gradients to the blockchain includes: the base station edge node selects high-quality drone model gradients from all normal model gradients using all normal model gradients and the historical accumulated rewards of the drones to which all normal model gradients belong; and the base station edge node uploads the selected high-quality drone model gradients to the blockchain.
[0013] Preferably, the base station edge node uses all normal model gradients and the historical cumulative rewards of the drones to which all normal model gradients belong to, and selects high-quality drone model gradients from all normal model gradients, including: the base station edge node receives the historical cumulative rewards of registered drone terminal devices sent by the blockchain; the base station edge node uses the historical cumulative rewards of each drone terminal device to calculate the current cumulative reward value of each drone terminal device; the base station edge node selects a high-quality model gradient from the normal model gradient according to the current cumulative reward value of each drone terminal device.
[0014] Preferably, the base station edge node uses the historical cumulative rewards of each drone terminal device to calculate the current cumulative reward value of each drone terminal device, including:
[0015] R k =r k *y k
[0016]
[0017] Among them, R k represents the current cumulative reward value of the kth registered drone terminal device; r k represents the historical cumulative reward value of the kth registered drone terminal device; y k Represents the normalized immediate reward.
[0018] Preferably, the base station edge node selects a high-quality model gradient from the normal model gradient according to the current cumulative reward value of each drone terminal device, including: the base station edge node sorts the drone terminal devices according to the current cumulative reward value of each drone terminal device, selects the drone terminal device with a larger current cumulative reward value, and uses the model gradient of the selected drone terminal device as the high-quality model gradient.
[0019] Preferably, the subsequent processing of the blockchain includes: the blockchain uses the high-quality model gradient to perform model gradient aggregation to obtain a global model gradient.
[0020] The base station edge node of the present invention can identify illegal drone terminal devices through system identity authentication, and use an anomaly detection algorithm to determine abnormal model gradients and normal model gradients, thereby preventing poisoning attacks by avoiding the use of abnormal model gradients and improving the accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a flow chart of a gradient selection method for blockchain-based UAV federated learning provided by the present invention;
[0022] Figure 2 It is a UAV-BFL system architecture diagram provided by the present invention;
[0023] Figure 3 It is a schematic diagram of the basic architecture of local training neural network of each drone terminal device provided by the present invention;
[0024] Figure 4a and Figure 4b Schematic diagram of optimization results of key parameters of the UAV-BFL algorithm provided by the present invention;
[0025] Figure 5a , Figure 5b , Figure 5c , Figure 5d It is a schematic diagram of the accuracy results of the UAV-BFL algorithm provided by the present invention on the Cifar10 data set;
[0026] Figure 6a , Figure 6b , Figure 6c , Figure 6d It is a schematic diagram of the accuracy results of the UAV-BFL algorithm provided by the present invention on the Mnist data set;
[0027] Figure 7a , Figure 7b , Figure 7c It is a schematic diagram of the recall index experimental results of the poisoning attack on the Cifar10 dataset provided by the present invention;
[0028] Figure 8a , Figure 8b , Figure 8c It is a schematic diagram of the recall index experimental results of the Mnist dataset poisoning attack provided by the present invention. DETAILED DESCRIPTION
[0029] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0030] The present invention combines the federated learning framework with the blockchain, uses the blockchain technology to select the model gradients obtained from the UAV model training under the federated learning framework, and performs global parameter aggregation on the selected high-quality gradient parameters. The method of the present invention is applied to a network including UAV terminal devices and blockchains, which can at least improve the anti-attack capability and have stronger security.
[0031] Example 1
[0032] Figure 1 This is a flowchart of a gradient selection method for blockchain-based UAV federated learning provided by the present invention. Figure 1 As shown, including:
[0033] Step S101: Each UAV terminal device uploads the model gradient obtained through local training to the base station edge node to which it belongs;
[0034] Step S102: After receiving the model gradient uploaded by each drone terminal device, the base station edge node performs system identity authentication on each drone terminal device;
[0035] Step S103: the base station edge node performs gradient anomaly detection on each drone terminal device that has passed the system identity authentication, and determines whether the model gradient uploaded by each drone terminal device that has passed the system identity authentication is an abnormal model gradient or a normal model gradient;
[0036] Step S104: The base station edge node filters abnormal model gradients and uploads part or all of the normal model gradients to the blockchain for subsequent processing to prevent poisoning attacks by avoiding the use of abnormal model gradients.
[0037] Furthermore, after the base station edge node receives the model gradient uploaded by each drone terminal device, it performs system identity authentication on each drone terminal device, including: the base station edge node verifies whether each drone terminal device is registered; if the drone terminal device is not registered, the base station edge node determines that the drone terminal device has not passed the system identity authentication and discards the model gradient of the drone terminal device; if the drone terminal device has been registered, the base station edge node determines that the drone terminal device has passed the system identity authentication.
[0038] Specifically, the base station edge node performs gradient anomaly detection on each drone terminal device that has passed the system identity authentication, and determines whether the model gradient uploaded by each drone terminal device that has passed the system identity authentication is an abnormal model gradient or a normal model gradient, including: for any drone terminal device that has passed the system identity authentication, the base station edge node uses the RCF anomaly detection algorithm to calculate the effective gradient range, and determines whether the model gradient of the drone terminal device is within the effective gradient range; if the model gradient of the drone terminal device is within the effective gradient range, the base station edge node marks the model gradient of the drone terminal device as a normal gradient; if the model gradient of the drone terminal device is not within the effective gradient range, the base station edge node marks the model gradient of the drone terminal device as an abnormal gradient.
[0039] The RCF anomaly detection algorithm includes:
[0040]
[0041] Among them, Q k,j is the RCF anomaly detection result of the model gradient of the jth UAV terminal device in the kth base station edge node; E k,j is the model gradient of the jth UAV terminal device collected by the kth base station edge node; x is the average gradient; std is the standard deviation; W is the number of gradients collected by the current base station edge node; the function sig is used to determine whether the current model gradient is abnormal, the abnormal model gradient is marked as 0, and the normal model gradient is marked as 1.
[0042] Furthermore, the base station edge node uploading part of the normal model gradients to the blockchain includes: the base station edge node randomly selects a number of normal model gradients from all normal model gradients, and uploads them to the blockchain.
[0043] Furthermore, the base station edge node uploading part of the normal model gradients to the blockchain includes: the base station edge node using all normal model gradients and the historical accumulated rewards of the drones to which all normal model gradients belong, to select high-quality drone model gradients from all normal model gradients; the base station edge node uploading the selected high-quality drone model gradients to the blockchain.
[0044] Specifically, the base station edge node uses all normal model gradients and the historical cumulative rewards of the drones to which all normal model gradients belong to select high-quality drone model gradients from all normal model gradients, including: the base station edge node receives the historical cumulative rewards of registered drone terminal devices sent by the blockchain; the base station edge node uses the historical cumulative rewards of each drone terminal device to calculate the current cumulative reward value of each drone terminal device; the base station edge node selects a high-quality model gradient from the normal model gradient according to the current cumulative reward value of each drone terminal device.
[0045] Specifically, the base station edge node uses the historical cumulative rewards of each drone terminal device to calculate the current cumulative reward value of each drone terminal device, including:
[0046] R k =r k *y k
[0047]
[0048] Among them, R k represents the current cumulative reward value of the kth registered drone terminal device; r k represents the historical cumulative reward value of the kth registered drone terminal device; y k Represents the normalized immediate reward.
[0049] Specifically, the base station edge node selects a high-quality model gradient from the normal model gradient according to the current cumulative reward value of each drone terminal device, including: the base station edge node sorts the drone terminal devices according to the current cumulative reward value of each drone terminal device, selects the drone terminal device with a larger current cumulative reward value, and uses the model gradient of the selected drone terminal device as the high-quality model gradient.
[0050] Furthermore, the blockchain performs subsequent processing including: the blockchain uses the high-quality model gradient to perform model gradient aggregation to obtain a global model gradient.
[0051] The base station edge node of the present invention can identify illegal drone terminal devices through system identity authentication, and use an anomaly detection algorithm to determine abnormal model gradients and normal model gradients, thereby preventing poisoning attacks by avoiding the use of abnormal model gradients and improving the accuracy of the model.
[0052] Example 2
[0053] like Figure 2As shown, the UAV-BFL system architecture provided by the present invention consists of three entities: UAV terminal equipment, base station edge node, and blockchain. For the convenience of research, the global network of the UAV terminal equipment and blockchain of the present invention is a homogeneous network.
[0054] 1) Drone terminal equipment: The drone terminal equipment in each region is the mobile user terminal participating in the federated training. It is responsible for training on the local data set and uploading the model gradient to the nearby base station edge node.
[0055] 2) Base station edge node: The base station edge node is located near the drone terminal device and is composed of servers with certain computing capabilities. The base station edge node first performs hash verification on whether the drone terminal device is registered, filters out unregistered drone terminal devices, and performs gradient anomaly detection on registered drone terminal devices.
[0056] Among them, the anomaly detection method adopts the RCF algorithm, and the detection formula involved is as follows:
[0057]
[0058] In the formula, Q k,j is the RCF anomaly detection result of the model gradient of the jth UAV terminal device in the kth base station edge node; parameter E k,j is the gradient of the jth drone collected by the kth base station, x is the average gradient, std is the standard deviation, and W is the number of gradients collected by the current base station. The function sig is used to determine whether the current gradient is abnormal. The abnormal gradient is marked as 0 and the normal gradient is marked as 1. Then the gradient is reversed using the reverse sorting method to finally get the sorting result.
[0059] 3) Blockchain: Blockchain is responsible for the registration of drone terminal devices, base station edge nodes and the aggregation of the global gradient model.
[0060] The blockchain sends the historical cumulative rewards of registered drones to the base station edge node based on the gradient request sent by the base station edge node. The reward function formula is as follows:
[0061] R k =r k *y k
[0062]
[0063] In the formula, R k represents the historical cumulative reward of the kth drone registered, y k Represents the normalized immediate reward.
[0064] According to the reward function formula and the following formula, the base station recalculates whether the gradient uploaded by each drone is a high-quality gradient. For example, the sample of the normal gradient in the RCF anomaly detection result of the model gradient of the jth drone terminal device in the kth base station edge node is multiplied by the current cumulative reward to obtain the cumulative probability before the current drone is selected, and then reverse sorting is performed. Finally, the last 2 / 3 of the gradients are selected as high-quality gradients and uploaded to the blockchain. The blockchain performs secure aggregation based on the uploaded gradients and trains the global network. The global network broadcasts the global shared parameters to each drone at a regular interval.
[0065]
[0066] The UAV-BFL system process mainly includes the following steps:
[0067] Step 1: The base station detects abnormalities in the gradient uploaded by the drone terminal device and uploads the gradient to the blockchain;
[0068] The base station edge node receives the model gradient obtained by the drone terminal device by training the model on the local data set, and performs anomaly detection on the received model gradient to obtain anomaly detection results.
[0069] Step 2: The base station uploads the anomaly detection result to the blockchain.
[0070] Step 3: The blockchain calculates the incentive value (reward value) of all registered drones based on the drone gradient anomaly detection results uploaded by the base station, and updates the incentive value (reward value) of all registered drones in the incentive list of registered drones.
[0071] Step 4: The blockchain transmits the updated incentive list back to the base station.
[0072] Step 5: The base station jointly selects high-quality model gradients based on the updated incentive list and gradient anomaly detection results, and uploads the selected high-quality model gradients to the blockchain.
[0073] Specifically, a normal model gradient is obtained from the gradient anomaly detection result, and the reward values of the registered drones of the normal model gradient are sorted according to the size of the reward value to obtain a sorting result, and the normal model gradients of drones with multiple larger reward values are selected from the sorting result as high-quality model gradients. For example, the reward values are sorted in order from small to large, and the last 2 / 3 reward values are selected therefrom, and the normal model gradients of the registered drones to which these reward values belong are used as high-quality model gradients, that is, the last 2 / 3 normal model gradients are used as high-quality model gradients.
[0074] Step 6: The blockchain securely aggregates high-quality model gradients to obtain the global model gradients for the next round of training.
[0075] Step 7: The blockchain realizes the transmission of the global optimal parameters.
[0076] Among them, the anomaly detection algorithm described in step 2 can adopt the RCF algorithm. The Random Cut Forest (RCF) algorithm is an unsupervised algorithm used by Amazon for anomaly detection, which is based on the idea of random forest. The main idea of the RCF algorithm is to use random trees to segment the data and calculate the path length from each data point to the root node. Then, the RCF algorithm uses these path lengths to calculate the anomaly score of each data point. Its operation process is as follows: First, the RCF algorithm constructs a set of random trees, each of which is constructed based on random sampling of the data set, that is, each random tree is constructed by randomly selecting a part of the data from the original data set, and the segmentation rule of each random tree is also randomly selected; Calculation of path length: For each data point, the RCF algorithm calculates the path length from the root node of each random tree, and takes the average of these path lengths as the anomaly score of the data point. The calculation of path length is based on a method called "cutting plane", which is similar to the segmentation process in decision trees; Calculation of anomaly score: The RCF algorithm takes the average path length of each data point as its anomaly score. The higher the anomaly score, the more likely the data point is an outlier. Identification of outliers: For a given threshold, the RCF algorithm identifies data points with anomaly scores higher than the threshold as outliers.
[0077] Compared with traditional distance- or density-based anomaly detection algorithms, the RCF algorithm has the following advantages: The RCF algorithm does not require any parameters to be specified in advance or the form of data distribution assumptions to be made. The RCF algorithm is suitable for high-dimensional data and is not easily affected by the "curse of dimensionality". The RCF algorithm has high computational efficiency and can process large-scale data sets. The RCF algorithm is insensitive to isolated points in the data, which enables it to effectively process noisy data sets. In general, the RCF algorithm is an efficient, flexible, and unsupervised anomaly detection algorithm based on random forests, which is suitable for various types of data sets and application scenarios.
[0078] Example 3
[0079] 1. Experimental environment
[0080] The UAV-BFL algorithm proposed in this invention can be quickly deployed and run on GPU. The experimental hardware conditions are shown in Table 1.
[0081] Table 1 Experimental hardware conditions
[0082]
[0083] The experiment was conducted under Ubuntu 18.04 system with the hardware configuration of Intel i7-8700K CPU, GTX 1080T GPU, and 16GB RAM. Go language was used to process the blockchain-related parts of the solution, Pytorch 1.4.0 was used to train the deep learning model, and the Python and Go interfaces were built through the go-python v1.0 library. The network structure adopts a convolutional neural network (CNN, conventional neural network), which consists of two 5×5 convolutional layers, a fully connected layer, and a softmax output layer. The weights in the model are initialized to random values sampled from a normal distribution N (0, 0.022), and the deviations are initialized to 0. The basic architecture of the local training neural network is as follows: Figure 3 As shown in the figure, the algorithm of the present invention sets a shared parameter α after normalization of each convolutional layer. k During the training process, the shared parameter α of each layer k Participate in training together with the gradient of this layer.
[0084] The datasets used in the present invention are Cifar10 and Mnist image classification datasets. Experimental hyperparameter settings: batch size is 64, learning rate is set to 0.001, truncation loss is 100, optimization function uses AdamOptimizer+nonlinear adaptive parameters, the number of local drone training devices is 5, and the adaptive parameters of the last 3 layers of the shared network are: θ, β, α. The experimental conditions are set as shown in Table 2.
[0085] Table 2 Experimental conditions settings
[0086]
[0087]
[0088] 2. Dataset
[0089] The UAV-BFL algorithm and the comparison algorithm are compared on multiple data sets. The experimental data sets used in the present invention are MNIST and CIFAR10. These two data sets can represent the data of medium complexity collected by the local device. The data set distribution is shown in Table 3.
[0090] Table 3 Experimental dataset allocation
[0091]
[0092] Among them, the global trainer (blockchain) does not allocate data sets, but only uses the model gradients uploaded by the base station edge nodes to update the shared parameters, and then performs secure aggregation. The data sets allocated to each drone terminal device satisfy the following formula.
[0093]
[0094] During the data set allocation process of this algorithm, the data sets of all local trainers (UAV terminal devices) are randomly sampled. The number of sample categories contained in the sampled data sets is determined by the specific sampling process. During the sample sampling process, this algorithm avoids each trainer having samples of all categories.
[0095] Table 4 Comparison of algorithms and evaluation indicators
[0096]
[0097] In Table 4, UAV-BFL-None-RCF means that the RCF abnormal gradient detection algorithm or module is not used in the UAV-BFL system, UAV-BFL-None-DP means that the adaptive parameter module is not used in the UAV-BFL system, and the encryption algorithm uses the adaptive differential algorithm. The calculation formulas of the four accuracy indicators are as follows:
[0098]
[0099] Where TP is a true positive case, FP is a false positive case, FN is a false negative case, and TN is a true negative case; P and R are precision and recall, respectively.
[0100] True Positive: Predicted to be positive, actually positive. The positive sample is successfully predicted as positive. TP (True Positive)
[0101] False Positive: Predicted as positive, but actually negative. Negative samples are mistakenly predicted as positive. FP (False Positive) is a false positive. True Negative: Predicted as negative, but actually negative. Negative samples are successfully predicted as negative. TN (True Negative)
[0102] False negative: Predicted to be negative, but actually positive. Positive samples are mistakenly predicted to be negative. FN (False Negative) is also called missed report.
[0103] 3. Experimental data analysis
[0104] 1) Classification accuracy experiment.
[0105] The global loss of the UAV-BFL algorithm and the convergence of the adaptive parameter training process are shown in Figure 2. Figure 4a and 4b As shown, the test result curves of the four indicators are as follows Figure 5a , Figure 5b , Figure 5c , Figure 5d and Figure 6a , Figure 6b , Figure 6c , Figure 6d shown.
[0106] Since the initial values of θ, β, and α are all 1, and the activation function is sigmoid, the overall convergence speed is fast. In order to reflect the synchronous change trend of the three and the global total loss during the training process, θ, β, and α are multiplied by 5 based on the original values to obtain the final curve.
[0107] Table 5 Experimental results of UAV-BFL algorithm loss and adaptive parameters
[0108]
[0109] It can be seen from Table 5 that the deeper the shared layer, the slower the convergence speed of the adaptive parameters, and finally they all reach the convergence state. After convergence, the convergence values of the adaptive parameters of different shared network layers are different. The network layer with shallower shared layers is easier to converge, and vice versa, it is more difficult to converge and the parameter values after convergence are quite different.
[0110] Table 6 Comparison of accuracy on Cifar10 and Mnist datasets (Global)
[0111]
[0112] based on Figure 7a , Figure 7b , Figure 7c The accuracy comparison results of the algorithm of the present invention on the Cifar10 and Mnist datasets and the accuracy improvement compared with other algorithms are shown in Tables 6 and 7.
[0113] The adaptive factors of the present invention are distributed in different layers of the neural network. They are added to the inter-layer training as adaptive factors and participate in the optimization process of the model algorithm as regular terms of the loss function. Therefore, the present invention studies the influence of adaptive nonlinear factors of different layers on the model accuracy and sets up a comparative experiment. The results of the comparative experiment are shown in Table 7.
[0114] Table 7. Accuracy improvement of the algorithm on Cifar10 and Mnist datasets
[0115]
[0116] It can be seen from Table 7 that the influence of adaptive nonlinear factors of different layers on the accuracy is obvious. The maximum accuracy of the algorithm of the present invention on the Cifar10 dataset is improved by 3.37% (Recall) and the minimum accuracy is improved by 0.55% (Accuracy); on the Mnist dataset, the maximum accuracy is improved by 1.02% (F1) and the minimum accuracy is improved by 0.41% (Accuracy). It can be seen from the above comparative experimental results that the algorithm of the present invention can achieve a higher accuracy rate in various comparative indicators.
[0117] 2) Poisoning attack experiment.
[0118] The present invention constructs noise samples by randomly replacing sample labels, and the proportions of constructing noise samples are 10%, 20%, and 30% respectively. Based on this, poisoning attack experiments are carried out. The poisoning attack experiments are only carried out on the Cifar10 dataset. Figure 7a , Figure 7b , Figure 7c and Figure 8a , Figure 8b , Figure 8c The experimental results are summarized in Table 8.
[0119] Table 8 Comparison results of poisoning attack recall index (Global)
[0120]
[0121] Table 9 Recall index improvement rate of poisoning attack on Cifar10 and Mnist datasets
[0122]
[0123] It can be seen from Table 9 that the algorithm of the present invention can obtain relatively high accuracy when the poisoning attack ratios are 10%, 20% and 30% respectively. Compared with the comparison algorithm, the recall index of the poisoning attack of the algorithm of the present invention is improved by 28.32% (F1) at most and 10.72% at least. It can be seen from the experimental results that the algorithm of the present invention can obtain relatively high accuracy under random attacks of sample labels, which indicates that the algorithm of the present invention has been verified in high-quality client selection and blockchain cumulative reward strategy.
[0124] In summary, the present invention has at least the following advantages:
[0125] 1) The present invention designs a gradient filtering algorithm to deal with poisoning attacks. Specifically, the RCF anomaly detection algorithm is used to select abnormal gradients uploaded by drones in the same area, and two-thirds of normal gradients are randomly selected and uploaded to the blockchain to achieve gradient aggregation and broadcast of optimized parameters. It can detect a certain proportion of poisoning attacks and ensure that federated learning is safer;
[0126] 2) The UAV-BFL algorithm of the present invention adopts a high-quality UAV terminal device gradient screening mechanism to select more high-quality UAV terminal devices to participate in federated training, which can improve the accuracy of the model;
[0127] 3) The present invention transfers part of the computing functions of the drone terminal device to the edge node of the base station, which reduces the requirements for the storage capacity and computing power of the drone and solves the problem of insufficient storage and computing power of each drone terminal device;
[0128] 4) The present invention uses blockchain technology to make federated learning tamper-proof and anti-single-point failure-resistant.
[0129] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the present invention is not limited thereby. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the present invention shall be within the scope of the present invention.
Claims
1. A gradient selection method for blockchain-based UAV federated learning, characterized in that: include: Each drone terminal device uploads the model gradient obtained through local training to the edge node of the base station to which it belongs; After receiving the model gradient uploaded by each drone terminal device, the base station edge node performs system identity authentication on each drone terminal device; The base station edge node performs gradient anomaly detection on each drone terminal device that has passed the system identity authentication, and determines whether the model gradient uploaded by each drone terminal device that has passed the system identity authentication is an abnormal model gradient or a normal model gradient, which includes: For any drone terminal device that has passed the system identity authentication, the base station edge node uses the RCF anomaly detection algorithm to calculate the effective gradient range and determine whether the model gradient of the drone terminal device is within the effective gradient range; If the model gradient of the drone terminal device is within the valid gradient range, the base station edge node marks the model gradient of the drone terminal device as a normal gradient; If the model gradient of the drone terminal device is not within the valid gradient range, the base station edge node marks the model gradient of the drone terminal device as an abnormal gradient; The base station edge node filters abnormal model gradients and uploads part or all of the normal model gradients to the blockchain for subsequent processing to prevent poisoning attacks by avoiding the use of abnormal model gradients.
2. The method according to claim 1, characterized in that After the base station edge node receives the model gradient uploaded by each drone terminal device, the system identity authentication of each drone terminal device includes: The base station edge node verifies whether each drone terminal device is registered; If the drone terminal device is not registered, the base station edge node determines that the drone terminal device has not passed the system identity authentication and discards the model gradient of the drone terminal device; If the drone terminal device has been registered, the base station edge node determines that the drone terminal device has passed the system identity authentication.
3. The method according to claim 2, characterized in that The RCF anomaly detection algorithm includes: Among them, Q k,j is the RCF anomaly detection result of the model gradient of the jth UAV terminal device in the kth base station edge node; E k,j is the model gradient of the jth UAV terminal device collected by the kth base station edge node; x is the average gradient; std is the standard deviation; W is the number of gradients collected by the current base station edge node; the function sig is used to determine whether the current model gradient is abnormal, the abnormal model gradient is marked as 0, and the normal model gradient is marked as 1.
4. The method according to claim 3, characterized in that The base station edge node uploads part of the normal model gradient to the blockchain including: The base station edge node randomly selects a number of normal model gradients from all normal model gradients and uploads them to the blockchain.
5. The method according to claim 3, characterized in that: The base station edge node uploads part of the normal model gradient to the blockchain including: The base station edge node selects high-quality drone model gradients from all normal model gradients using all normal model gradients and historical accumulated rewards of drones to which all normal model gradients belong; The base station edge node uploads the selected high-quality drone model gradient to the blockchain.
6. The method according to claim 5, characterized in that The base station edge node uses all normal model gradients and the historical accumulated rewards of all drones to which the normal model gradients belong to, and selects high-quality drone model gradients from all normal model gradients, including: The base station edge node receives the historical accumulated rewards of the registered drone terminal device sent by the blockchain; The base station edge node calculates the current accumulated reward value of each drone terminal device using the historical accumulated rewards of each drone terminal device; The base station edge node selects a high-quality model gradient from the normal model gradients according to the current accumulated reward value of each drone terminal device.
7. The method according to claim 6, characterized in that The base station edge node uses the historical accumulated rewards of each drone terminal device to calculate the current accumulated reward value of each drone terminal device, including: R k =r k *y k Among them, R k represents the current cumulative reward value of the kth registered drone terminal device; r k represents the historical cumulative reward value of the kth registered drone terminal device; y k Represents the normalized immediate reward.
8. The method according to claim 6, characterized in that The base station edge node selects a high-quality model gradient from the normal model gradient according to the current accumulated reward value of each drone terminal device, including: The base station edge node sorts the drone terminal devices according to the current cumulative reward value of each drone terminal device, selects the drone terminal device with a larger current cumulative reward value, and uses the model gradient of the selected drone terminal device as the high-quality model gradient.
9. The method according to claim 8, characterized in that The subsequent processing of the blockchain includes: The blockchain uses the high-quality model gradient to perform model gradient aggregation to obtain a global model gradient.
Citation Information
Patent Citations
User screening method, system and device based on local model gradient in federated learning and storage medium
CN113344220A
Scheduling and resource allocation method for high-performance hierarchical federated edge learning
CN113504999A
Four-rotor unmanned aerial vehicle attack detection method based on neural network
CN115416860A
Backdoor attack defense method in federated learning based on multi-dimensional index dynamic identification
CN116150745A
Distributed model training method and system for unmanned aerial vehicle group reservoir water quality detection
CN116610958A
