Next Article in Journal
Design Methodology and Experimental Study of a Lower Extremity Soft Exosuit
Previous Article in Journal
A Novel 4H–SiC/Si Heterojunction IGBT Achieving Low Turn–Off Loss
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Blockchain-Based Federated-Learning Framework for Defense against Backdoor Attacks

1
School of Information Science and Engineering, Xinjiang University, Urumqi 830046, China
2
Key Laboratory of Signal Detection and Processing, Xinjiang Uygur Autonomous Region, Xinjiang University, Urumqi 830046, China
*
Author to whom correspondence should be addressed.
Electronics 2023, 12(11), 2500; https://doi.org/10.3390/electronics12112500
Submission received: 8 May 2023 / Revised: 25 May 2023 / Accepted: 30 May 2023 / Published: 1 June 2023
(This article belongs to the Section Artificial Intelligence)

Abstract

:
Federated learning (FL) is a technique that involves multiple participants who update their local models with private data and aggregate these models using a central server. Unfortunately, central servers are prone to single-point failures during the aggregation process, which leads to data leakage and other problems. Although many studies have shown that a blockchain can solve the single-point failure of servers, blockchains cannot identify or mitigate the effect of backdoor attacks. Therefore, this paper proposes a blockchain-based FL framework for defense against backdoor attacks. The framework utilizes blockchains to record transactions in an immutable distributed ledger network and enables decentralized FL. Furthermore, by incorporating the reverse layer-wise relevance (RLR) aggregation strategy into the participant’s aggregation algorithm and adding gradient noise to limit the effectiveness of backdoor attacks, the accuracy of backdoor attacks is substantially reduced. Furthermore, we designed a new proof-of-stake mechanism that considers the historical stakes of participants and the accuracy for selecting the miners of the local model, thereby reducing the stake rewards of malicious participants and motivating them to upload honest model parameters. Our simulation results confirm that, for 10% of malicious participants, the success rate of backdoor injection is reduced by nearly 90% compared to Vanilla FL, and the stake income of malicious devices is the lowest.

1. Introduction

Federated learning (FL) [1] is a technique that involves multiple participants who update their local models with private data and aggregate the models using a centralized server. However, the centralized server cannot detect the legitimacy of the local model. Thus, the centralized server is easily attacked by malicious participants, such as those implanting backdoors into the local model, causing incorrect predictions of classification results.
In FL, backdoor attacks are divided into attacker and defender attacks. Attackers can control one or more participants (malicious participants), whereas defenders are generally assumed to be participants rather than servers because servers would be easily infiltrated. In reality, only trusted servers can perform federated aggregation. Moreover, defenders are usually servers, but benign participants can also be regarded as defenders in some cases, particularly when attackers can only change the local training samples of participants but cannot modify their training process or trained model.
A blockchain is a distributed ledger with the fundamental characteristic of converting traditional centralized solutions into a distributed network structure [2,3]. This ensures data security on the blockchain through asymmetric encryption and other cryptographic technologies. At the same time, consensus mechanisms, smart contracts, and other mechanisms ensure the reliability of data on the blockchain, which is distributed among multiple participants.
FL and blockchain need multiple stakeholders to participate and achieve technological consensus to establish a trusted network. Both mechanisms show good complementarity. The distributed ledger characteristics of a blockchain naturally ensure the consistency and synchronization of the model parameter data and guarantee that the data shared among multiple stakeholders are secure, reliable, and transparent. This ensures that the exchanged model parameter data are transparent, traceable, and resistant to tampering and forgery. During the model-training process, participants are rewarded based on the quantity and quality of their training data, and the rewards are written onto the blockchain. The transparency and openness of the blockchain can encourage more stakeholders to join and simultaneously improve the degree of cooperation of stakeholders [4].
This article proposes the application of blockchain to FL to overcome barriers between centralized servers and participants and efficiently use computing resources [3]. Devices such as smartphones, IoT sensors, and vehicles generate large amounts of data, which creates a challenging situation: how to effectively apply the blockchain to FL to coordinate decentralized learning processes while maintaining learning security and data privacy.
Based on this goal, this paper proposes a blockchain-based FL (DBFL) framework to defend against backdoor attacks. This paper makes the following contributions:
  • We use the blockchain to attain FL. Recording transactions in the immutable distributed ledger network improves the traceability, auditability, and tamper resistance of the joint model and avoids the single-point failures of the centralized server.
  • We propose a new aggregation strategy where participants independently determine how aggregation is performed in the model, combined with reverse layer-wise relevance (RLR) [5], and further add gradient noise that limits the effectiveness of backdoor attacks.
  • A new proof-of-stake consensus mechanism (PoSA) is designed to consider the historical stakes of participants and the accuracy of their local models. The PoSA mechanism reduces the stake rewards of malicious participants to motivate them to upload honest model parameters, thereby making the model-learning process more reliable and trustworthy.
This work may have considerable implications for future research and provide a practical solution for protecting privacy and security in FL.
This paper is organized as follows: In Section 2, we provide a summary of related work. Section 3 describes the proposed framework. We then discuss our experimental results in Section 4 and demonstrate the effectiveness of our approach in different environments. Finally, Section 5 provides our conclusions.

2. Related Work

FL is a distributed-learning paradigm that enables the centralized server to learn an accurate global model [5]. However, some participants in this process may be malicious, submitting malicious local models to the centralized server through backdoor attacks [6] and causing incorrect classification or decreased model accuracy after aggregation.
According to the object of the attack, this article divides backdoor attacks into two types: attacks on training data and attacks on local models. Attacks on training data are further divided into attacks based on label flipping and attacks based on planting triggers. Attacks based on label flipping do not modify the input data, only the labels, whereas attacks based on planting triggers modify both the input data and labels, effectively constructing an adversarial sample. Attacks on local models are divided into attacks based on modifications to the training process and attacks based on modifications to the trained model. The former occurs during the training process, whereas the latter mainly occurs after the model has been trained.
A blockchain is a distributed shared ledger where all participants record all historical transaction models; it is decentralized and immutable [2]. Using the blockchain, FL promotes traceability, auditability, and tamper resistance, making the model-learning process more transparent and secure [7]. Therefore, many model verification methods based on the blockchain are applied in the FL framework.
Islam et al. presented an FL-based data accumulation scheme that combined drones and blockchains to attain secure accumulation and privacy of the model [8]. Zhang et al. designed a blockchain-based model migration approach to achieve secure model migration and speed up the training of the model while minimizing computation costs [9]. Rückel et al. proposed an FL system that combines a blockchain, local differential privacy, and zero-knowledge proof, using multivariate linear regression to achieve economic incentives, trust, and confidentiality requirements [10]. In another study, Dong et al. constructed a secure, reliable, decentralized, and federated learning system (FLock system) based on a blockchain to detect and block malicious participants through on-chain intelligent contracts while motivating participants to upload and review model parameters honestly [11]. Stephanie et al. presented a secure multi-party computation-based ensemble FL with a blockchain that enabled heterogeneous models to collaboratively learn from the data of healthcare institutions without violating users’ privacy [12]. Wang et al. designed a new block structure, new transaction types, and a credit-based incentive mechanism (PF PoFL) that allowed for efficient model evaluation and utterly decentralized reward allocation [13].
Kalapaaking et al. proposed blockchain-based FL with SMPC model verification to detect and defend against malicious model updates while maintaining the privacy of the model [14]. BEAS was the first N-party FL framework based on a blockchain that provided strict privacy protection via improved gradient pruning for training models, which resulted in rigorous privacy protection. An abnormal detection protocol was proposed to reduce the risk of data poisoning attacks [7]. Baucas et al. proposed a platform using FL and private blockchain technology within a fog-IoT network, which can effectively preserve the privacy of patients and the integrity of the predictive service [15].
This paper uses difference privacy (DP) for privacy protection. Adding noise (which only requires the incorporation of pre-computed noise through an addition operation) is more effective than using complex cryptographic tools. Moreover, using DP and a PoSA consensus, we can guarantee the trust and privacy of the entire training process, which is impossible with the currently used techniques.
We compare DBFL against existing state-of-the-art frameworks for decentralized FL. DBFL uses a multi-channel permissioned blockchain to store all model gradients, which enables rapid scalability, auditability, transparency, and trust amongst collaborating entities. DBFL has over these approaches communication efficiency and easy-to-implement data privacy and security guarantees. Table 1 shows the comparative analysis of the proposed DBFL framework against other existing frameworks.

3. DBFL Framework

3.1. DBFL Operation Process

DBFL comprises a set of participants N = N 1 , N 2 , N m , and similar to Vanilla FL, it executes the learning process through a series of communication R = R 1 ,   R 2 ,   R 3 , . All N N are assigned the following tasks in R j : global model aggregation and local model update. All participants receive the winning block b l o c k j 1 from the previous round R j 1 and add it to their blockchains. Through the recorded local models in b l o c k j 1 , participants use the dynamic adaptive aggregation mechanism (Section 3.2) in round R j to build the global model G j . In R j , all participants perform local updates based on data samples t r a i n w used in training and the number of local training rounds R j . This results in local model gradients L j w , which are encrypted using DP (Section 3.3) to obtain L ˜ j w . The variable L ˜ j w and basic rewards r j w are packaged as t x j w ( L ˜ j w ) , and finally, participants send t x j w ( L ˜ j w ) to the miner to which they are connected (Table 2).
A random selection of a part of N w m from the participants is assigned the following tasks: (i) the verification and signature validation of the local models collected and (ii) the collection, aggregation, and mining of all local updates for the ultimate winning block. If the signature of transaction t x j w ( L ˜ j w ) is verified, N w m extracts L ˜ j w from t x j w ( L ˜ j w ) . If the signature of t x j w ( L ˜ j w ) is not verified, N w m does not broadcast the L ˜ j w packaged in the unverified t x j w ( L ˜ j w ) .
Then, each miner N w m broadcasts t x j w ( L ˜ j w ) to all other miners. This ensures that each N w m has t x j w ( L ˜ j w ) , and, thus, each N w m can access all L ˜ j w . At the same time, miner N w m receives a verification reward r j w m v e r i by verifying the signature of a t x j w ( L ˜ j w ) .
If the signature is verified, N w m extracts L ˜ j w from t x j w ( L ˜ j w ) . Then, all local updates { L ˜ j w } are collected and placed in the privately constructed b l o c k j m for all N w . The content of the block is collected by hashing it and signing it with the private key, which is equivalent to proof-of-work mining with a difficulty of zero. The candidate block also contains all expected rewards r j w , r j w m v e r i , and r j w m . The participant with the highest score from N w m is selected as the best participant, and its constructed candidate block ( b l o c k j m ) is published to the blockchain as the final legitimate block ( b l o c k j ). All participants receive the winning block ( b l o c k j ) for this round and add it to their blockchains [2]. Using the local models recorded in b l o c k j , participants use the dynamic adaptive aggregation mechanism to build a global model G j + 1 for the next round of training.
Moreover, DBFL will first determine whether each participant N has successfully connected in each round (Figure 1).

3.1.1. Participant N i Failed to Connect before Starting Local Training

The participant N i will not receive the blocks and contact other participants to obtain the lost blocks for aggregation but will not receive stakes.

3.1.2. Participant N i Failed to Connect during Local Training

Going online again will connect other participants to obtain lost blocks for aggregation but not receive stakes.

3.1.3. Participants N i Failed to Have Connected after Local Training

Going online again will connect other participants to obtain lost blocks for aggregation and gain stakes.

3.1.4. The above Three Situations All Assume That the Miner Is Always Online

When the miner suddenly goes offline, the participants associated with it will be processed according to Section 3.1.1.
In reality, each participant N can be offline at any time. However, in the comparative experiment, to test the effectiveness of backdoor attacks, we set the probability parameters T and waiting time T w , T m always to be online and infinite waiting.

3.2. Dynamic Adaptive Aggregation Mechanism [16,17]

The gradient aggregation rule (GAR) aggregates gradients received from peers during each round. We designed the GAR to add robustness to the gradient generated by malicious participants who use backdoor attacks.
To improve the privacy of the FL aggregation process, we propose a dynamic adaptive aggregation mechanism that overcomes the drawbacks of traditional aggregation algorithms, which perform a single, undifferentiated aggregation. The proposed mechanism can adapt to local circumstances and determine the aggregation algorithm autonomously (Algorithm 1).
Algorithm 1: Dynamic adaptive aggregation mechanism
Input: N = N 1 , N 2 , N m , b l o c k j 1
Output: G j
1 initialization: Broadcast b l o c k j 1 to the network and receive L ˜ j 1 w form peers;
2 For each participant N N in parallel do
3    N .receive( b l o c k j 1 );
4   Check the legitimacy of the b l o c k j 1
5   If Verify(   b l o c k j 1 )=True then
6        N adds b l o c k j 1 to its own blockchain
7       Take the gradient of each participant from the b l o c k j 1 :
                b l o c k j 1 t x j w ( L ˜ j w ) ---> L ˜ j 1 w
8       Adaptive selection aggregation method ζ . combined with RLR:
                G j = ζ L ˜ j 1 w ;
9   Else
10       N refuses to accept the   b l o c k j 1
11 End
Furthermore, to defend against backdoor attacks, we specifically require the aggregation algorithm of each participant to include an RLR aggregation strategy. This strategy adjusts the learning rate during aggregation based on the symbol information updated by the participants in each global iteration. If the number of models updating in the same direction exceeds a certain threshold, the learning rate is updated to minimize the loss on that dimension [18]. Otherwise (i.e., if the process indicates an attacker is trying to guide the parameters to an incorrect classification), the learning rate is updated in the direction that would maximize the loss on the unwanted dimension by negating the learning rate of that dimension (i.e., by multiplying it by −1). We set hyperparameter θ to be the learning threshold. If
k s g n L j w θ ,
the learning rate is multiplied by 1; otherwise, it is multiplied by −1.
In this paper, DBFL uses FedAvg with RLR [5] and coordinate-wise median (COMED) with RLR [5] as the GAR. See Appendix A for the relevant assumptions and theorems.

3.3. Differential Privacy [19]

During each round, participant N w exchanges its random gradient with all other participants in the blockchain. Specifically, each participant maintains a true random gradient L j w and a perturbed gradient L ˜ j w that it wishes to share. The entire exchange process can be summarized in the following steps (Algorithm 2):
  • Local gradient calculation. Calculate the local gradient L j w by sampling a random local dataset.
  • Addition of noise. Add stochastic Gaussian noise to the shared local gradient L j w , with the noise variance represented by input variable ε .
  • Broadcast the gradient. Transmit the perturbed local gradient L ~ j w as a transaction to all other participants and receive the local gradients of other participants from the winning block.
Algorithm 2: Gradient Computation
Input: N = N 1 , N 2 , N m , R j , t r a i n w , G j
Output: t x j w ( L ˜ j w )
1 initialization:
2 For each participant N N in parallel do
  2.1 Local Computation:
     Randomly sample t r a i n w and compute local stochastic gradient L j w and r j w ;
  2.2 Adding Noise:
     Randomly generate Gaussian noise ξ j t N 0 , ε and add noise to the variable
      L ˜ j w = L j w + ξ j t ;
  2.3 Broadcast Gradients:
     Package gradient L ˜ j w and r j w into a transaction t x j w ( L ˜ j w ) , Broadcast
      t x j w ( L ˜ j w ) to the N w m ;
3 End

3.4. Threat Model

In FL, the training data is decentralized, and the aggregation server is only exposed to model updates. Given that, backdoor attacks are typically carried out by constructing malicious updates. The attacker tries to create an update that encodes the backdoor so that when the malicious update is aggregated with other updates, the aggregated model exhibits the backdoor. A prominent way of carrying backdoor attacks is through Trojans. A Trojan is a carefully crafted pattern that is leveraged to cause the desired misclassification. The toxic data are generated by (i) extracting all the base class instances that were constructed from the original validation data and (ii) adding backdoor patterns and relabeling them as the target class. In other words, the models with backdoors classify the base class examples that have backdoor patterns as the target class.
We assume that blockchain devices are rational [9]. These devices can evaluate their interests based on public information and maximize their benefits without performing operations that would harm them. Furthermore, we assume that blockchain devices are always on alert and do not trust each other.
We also assume that blockchain technology is credible. The blockchain is mainly maintained by devices with robust computation, storage, and communication capabilities and uses a consensus mechanism that is friendly to devices. Furthermore, most entities in the blockchain are reliable, and the records on the blockchain cannot be tampered with. Therefore, we can regard the blockchain as a trusted infrastructure, and we ignored attacks against it.

3.5. PoSA Blockchain Consensus

The PoSA blockchain consensus process deeply integrates the blockchain, PoSA consensus protocol [20], and GAR [16] aggregation functions. Specifically, the blockchain consensus includes two parts: an equity calculation and the choice of winners among the miners.

3.5.1. Calculation of Stakes

The PoSA consensus mechanism protects local model updates that are authorized for legitimate learning and ensures that these updates are recorded on the blockchain and used to update the global model. Because miners are responsible for aggregating local updates and recording them in a block, when a malicious device becomes a miner, it may attempt to disrupt the computation of the global model by placing false local updates and forged validator signatures in the blocks it mines. Therefore, avoiding blocks mined by malicious participants during selection is crucial for a robust blockchain FL.
Hence, inspired by the reward mechanism in VBFL [2] and reinforced by the role-switching strategy, PoSA rewards devices according to the roles they play, with r being the unit reward.
The various types of rewards are described below.
Basic reward. Participants that perform local updates in R j receive a proportional reward based on the number of data samples that train w used for training and the number of local training rounds R j (indicated by l e j w ). The basic reward for participants in R j is calculated as follows:
r j w = l e j w t r a i n w r
where r is the unit reward. To encourage participants to partake in the construction of the model, the basic reward accounts for 75% of the total profit generated during the model construction process.
Signature verification reward. The participant’s id is the public key, which is used to verify the signature of the transactions or blocks generated by the N wv . Participants partaking in mining tasks receive verification rewards r j w m v e r i by verifying the signature of a local update transaction t x j w . Formula (2) is used for calculation.
r j w m v e r i = t x j w r
Mining reward. Those participating in mining tasks in R j verify aggregated validator transactions t x j v l j w received from other participants and place them in a privately constructed winning block ( block j wm ). After the block is published to the blockchain, participants receive mining rewards. Formula (3) is used for the calculation.
r j w m = t x j w L ˜ j w r

3.5.2. PoSA Miner Options

If workers actively train the model, PoSA rewards them with worker stakes to incentivize them to contribute substantial amounts of high-quality data and legally execute as many epochs as possible. Therefore, as the communication loop continues, the accumulated interest in the equipment can demonstrate its total contribution to the entire learning process. When selecting blocks for the global model update, PoSA instructs participants to select the block produced by the miner with the highest score in N w m . Because this miner makes the greatest contribution to the learning process, it is considered the most trustworthy with the lowest probability of blocking this process.
The participant weight calculation is divided into two parts: the model accuracy ratio and the historical state ratio. The model accuracy ratio is defined as
α j = L L ˜ j w i = 1 n k L L ˜ i w
We used a shared dataset (MNIST) to test the model accuracy of the blockchain miners so that all miners obtain the same accuracy through their own test set. The historical stake ratio is defined as
β j = l N j w m i = 1 n k l N i w m
and the participant score is
Q j = ω α j + 1 ω β j
where the trade-off coefficient ω 0 , 1 .
In the current implementation, there may be a turn composed of all malicious devices in N wm . Malicious devices may be selected as the winning miner because they have more rights than other legitimate miners in N w m . The role-switching strategy ensures that miners are randomly selected in each new round, reducing the probability that malicious devices are continuously assigned the miner’s role. Furthermore, role switching can prevent “non-democratic side effects” [21] (i.e., the winning miner does not continuously choose the equipment with the highest rights). Preventing these side effects can alleviate the risk of damage to the device and the possibility of attacks against the learning process. In Section 4, we validate the effectiveness of miner selection under the PoSA consensus.

4. Experiment

All experiments were implemented and completed using PyTorch [22] on a virtual machine, which used NVIDIA A100 GPU and Intel (R) Xeon (R) CPU @ 2.60GHz from Dell Computer in Urumqi, China. Multi-GPU training is not conducted in the paper experiments. We evaluate our framework on the public MNIST dataset.
The model architecture used in our experiment is from [18], a five-layer convolutional neural network consisting of about 1.2M parameters, which is composed of two convolutional layers followed by max-pooling layers and two fully connected layers.
The MNIST dataset is a subset of the NIST dataset. The training set contains a total of 60,000 images and labels, while the test set contains a total of 10,000 images and labels. Each image is a handwritten digital image with 28 ∗ 28 pixels ranging from 0 to 9, with pixel values ranging from 0 to 255.
We report the hyperparameters of our experiments and briefly discuss our choices.
  • R: Number of rounds
  • W: Blockchain Worker Node
  • M: Blockchain Miner Node
  • F: Fraction of corrupt participants
  • P: Fraction of trojaned samples in a corrupt participant’s dataset
  • C: Fraction of selected participants for training in a round
  • E: Number of epochs in local training
  • B: Batch size of local training
  • T: Node online probability
  • Tw: Worker waiting time
  • Tm: Miner waiting time
  • η : learning rate
  • θ : Threshold for RLR
We start with a setting where data is distributed in i.i.d. among participants (Table 3). Concretely, we use the MNIST dataset and give each participant an equal number of samples from the training data via uniform sampling.
In all DBFL experiments, participants that performed the local update task received the most substantial stake rewards. Based on this, some participants were randomly selected for block-mining tasks. Each round of communication involved five local training iterations, a learning rate of 0.01, and a batch size of 128. We evaluated the performance of DBFL using the following standard metrics:
  • Test error: This is the percentage of incorrect predictions made using the test dataset. We measured test errors based on rounds, network size, backdoor attacks, and privacy budgets.
  • Stake accumulation: We measured the accumulation of stakes by the participants in the blockchain.
The following subsections provide a detailed analysis of the different aspects of the DBFL experiments.

4.1. Network Size Convergence

For simplicity, we represented the FL scheme as “PURE” (i.e., it does not utilize any DP techniques, GAR, or blockchain systems), and used “DP” to represent the learning scheme that is solely based on the “PURE” DP techniques. We compared DBFL with the PURE and DP schemes under non-attacked conditions. As shown in Figure 2, the test error almost converged after 20 rounds, but the fluctuations were large when N was small (≤5). When N = 20, all schemes achieved almost the same convergence.

4.2. Privacy Budget [19]

We tested our DBFL scheme by setting ε to 0.001, 0.005, and 0.02. Among these, ε = 0.001 represents the most robust privacy protection. The results shown in Figure 3 indicate that when N = 10, the convergence of noise with ε equal to 0.001, 0.005, and 0.02 was similar. However, when N = 20, larger values may have led to greater testing errors. These results indicate that the trade-off between accuracy and privacy protection should be carefully adjusted based on the specific requirements of privacy protection and model accuracy.

4.3. Backdoor Attacks Caused by Malicious Participants

We provide empirical evidence to demonstrate the effectiveness of the defense capabilities of our framework. The general process is as follows: We simulate an FL network with 10 participants, with 10% of them being malicious. We randomly select one participant as the malicious participant and insert a backdoor into the training set labels, with label “5” causing the data to be misclassified as “7” (Figure 4). The test set of the malicious participant is also injected with backdoor data to compare the backdoor accuracy. The toxic data are generated by (i) extracting all the base class instances constructed using the original validation data and (ii) adding backdoor patterns and relabeling them as the target class [23]. In other words, the models with backdoors classify the base class examples that have backdoor patterns as the target class.
After receiving and aggregating updates, we measure the two key performance indicators of the aggregation algorithm: validation accuracy (%), which represents the global accuracy of the validation set before backdoor injection, and backdoor accuracy (%), which represents the rate of success of relabeling data with backdoor patterns as the target class.
As shown in Table 4, DBFL1, DBFL2, and DBFL3 represent GAR using FedAvg with RLR and COMED with RLR as the model aggregation method but applying different ratios ((0.8, 0.2), (0.5, 0.5), and (0.2, 0.8), respectively). COMED with RLR performs better than FedAvg with RLR. Thus, as the percentage of participants using COMED with RLR as the aggregation strategy increases, the accuracy of the global model increases.

4.4. Effectiveness of PoSA

To evaluate the effectiveness of PoSA, we selected a case where 10% of the participants performed backdoor attacks [2,23]. We observed the accumulation of stakes for each participant. Taking DBFL3 as an example, we considered four cases that represented the proportion of historical stakes in the participant’s score, while N represented the number of malicious participants that performed backdoor attacks. When only historical stakes were considered, the stakes of the malicious participants were not affected. When ω = 0.5 or 1, the stakes of the malicious participants were the lowest, indicating that the local model gradient of the participants is crucial when evaluating them.
The miner selection mechanism in PoSA is related to the miners’ interests. Hence, we can evaluate the effectiveness of legal miner selection in PoSA by comparing the maliciousness of winning miners chosen based on model accuracy and historical stakes. For PoSA, we set the waiting time of the propagation block to infinite so that each miner could complete their block mining and receive propagation blocks from all other miners. The last propagation block was immediately determined as the legal block after the reception. The curve of accumulated stakes (Figure 5) revealed that because our framework considers both historical stakes and the accuracy of the participants’ models, the stakes of malicious participants grow slowly and remain the lowest during the round. Therefore, in the proposed framework, the blocks of malicious participants are less likely to be selected as the winning block.

5. Conclusions and Future Work

This article addresses how to effectively coordinate FL processes while maintaining learning security and user privacy [24]. We propose an FL framework that withstands backdoor attacks in a blockchain environment by incorporating an RLR aggregation strategy into the aggregation algorithm of the participant and adding gradient noise to limit the effectiveness of backdoor attacks. This framework effectively minimizes the risk of backdoor attacks and enhances the robustness of FL against backdoor attacks. Our DBFL framework also implements various blockchain functions, such as signature verification and simulation of chain resynchronization.
The DBFL framework proposed in this article runs in simulation mode. Hence, the development of more effective blockchain data structures, chain resynchronization algorithms, and fault tolerance mechanisms is needed to test the performance of DBFL in actual distributed systems [2].

Author Contributions

Conceptualization, L.L.; methodology, L.L.; software, L.L.; validation, L.L.; formal analysis, L.L.; writing—original draft preparation, L.L.; writing—review and editing, J.Q.; supervision, J.L.; funding acquisition, J.Q. All authors have read and agreed to the published version of the manuscript.

Funding

The Major Science and Technology Project of Xinjiang Uygur Autonomous Region under Grant No. 2020A03001 and the Open Project of Qinjiwei Autonomous Region Signal Key Laboratory of Information Technology.

Data Availability Statement

We evaluated our framework on the mnist dataset. There is a download link for the mnist dataset: http://yann.lecun.com/exdb/mnist/ (accessed on 10 March 2023).

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

We now turn to deriving the convergence rate for full-batch FedAvg with RLR. Lew and ξ k is randomness caused by the local batch variability. We use E to denote expectation with respect to all random variables. Let g k be the gradient of the K t h participant at the t t h rounds, i.e., g k t = f K ω t 1 k , ξ k t , and E D k g k t | F t = f K ω t 1 k , where F t is a filtration generated by all random variables at step t, i.e., a sequence of increasing σ-algebras F s F t for all s < t .
Finally, following Bernstein et al. [25], we assume that for all t , k , each component of the stochastic gradient vector g k t has a unimodal distribution that satisfies population-weighted symmetry [26]. In particular, let W be a random variable symmetric around zero, i.e., P r W w = P r W w for each w > 0 . We now consider a family of asymmetric distributions which are constructed by distorting an arbitrary symmetric distribution with a scalar parameter β > 0 such that P r W β = 0 = P r W = 0 and for all w > 0 P r W β w = 2 P r W w / 1 + β and P r W β w = / 2 β P r W w / 1 + β , or equivalently for all w > 0 .
P r W β w = β P r W < w
Condition (A1) is referred to as population-weighted symmetry. For a case of β = 1 , (A1) reduces to a standard symmetric distribution and corresponds to the assumption [25]. For β 1 , (A1) describes a class of asymmetric distributions [27]. As such, (A1) allows us to consider a broader class of distributions than distributions that are symmetric around the mean as in the case of Bernstein et al. [25].
Assumption A1. 
The gradient is Lipschitz continuous for each participant  k = 1 , K  and  L > 0 .
f k x f k y L x y                       x , y d
Assumption A2. 
Variance for each participant k = 1, … K is bounded.
E D k f k ω , ξ k t f k x σ 2 x d ,     K +
Assumption A3. 
Random variables  ξ k t  are independent for all i, k , t + .
Theorem A1. 
(Convergence Rate) For all i , k , t + , let  0 < P r 1 Ι k S t s g n t , i k θ F t p o < 0.25 , 0 < ν 1 p o / L  and  E ω t k < M , where  M > 0  is a universal clipping upper bound. Then, under Assumptions 1–3, we have the following convergence rate for our robust learning rate scheme
1 T t = 0 T 1 E f ω ^ t 2 η T f ω ^ 0 f * + L 2 M 2 + L η σ 2 n  
where  ω ^ t = 1 n k = 1 n ω t k  [5].

References

  1. McMahan, B.; Moore, E.; Ramage, D.; Hampson, S.; Arcas, B.A. Communication-Efficient Learning of Deep Networks from Decentralized Data. In Proceedings of the Artificial Intelligence and Statistics, Fort Lauderdale, FL, USA, 20–22 April 2017; pp. 1273–1282. [Google Scholar]
  2. Chen, H.; Asif, S.A.; Park, J.; Shen, C.-C.; Bennis, M. Robust blockchained federated learning with model validation and proof-of-stake inspired consensus. arXiv 2021, arXiv:2101.03300. [Google Scholar]
  3. Sarhan, M.; Lo, W.W.; Layeghy, S.; Portmann, M. HBFL: A hierarchical blockchain-based federated learning framework for collaborative IoT intrusion detection. Comput. Electr. Eng. 2022, 103, 108379. [Google Scholar] [CrossRef]
  4. Ozdayi, M.S.; Kantarcioglu, M.; Gel, Y.R. Defending against Backdoors in Federated Learning with Robust Learning Rate. In Proceedings of the AAAI Conference on Artificial Intelligence, Virtual, 22 February–1 March 2021; pp. 9268–9276. [Google Scholar]
  5. Yin, D.; Chen, Y.; Kannan, R.; Bartlett, P. Byzantine-Robust Distributed learning: Towards Optimal Statistical Rates. In Proceedings of the 35th International Conference on Machine Learning, Stockholm, Sweden, 10–15 July 2018; pp. 5650–5659. [Google Scholar]
  6. Xie, C.; Huang, K.; Chen, P.-Y.; Li, B. Dba: Distributed Backdoor Attacks against Federated Learning. In Proceedings of the International Conference on Learning Representations, Addis Ababa, Ethiopia, 30 March 2020. [Google Scholar]
  7. Mondal, A.; Virk, H.; Gupta, D. Beas: Blockchain Enabled Asynchronous & Secure Federated Machine Learning. arXiv 2022, arXiv:2202.02817. [Google Scholar]
  8. Islam, A.; Al Amin, A.; Shin, S.Y. FBI: A federated learning-based blockchain-embedded data accumulation scheme using drones for Internet of Things. IEEE Wirel. Commun. Lett. 2022, 11, 972–976. [Google Scholar] [CrossRef]
  9. Zhang, C.; Xu, Y.; Elahi, H.; Zhang, D.; Tan, Y.; Chen, J.; Zhang, Y. A blockchain-based model migration approach for secure and sustainable federated learning in iot systems. IEEE Internet Things J. 2022, 10, 6574–6585. [Google Scholar] [CrossRef]
  10. Rückel, T.; Sedlmeir, J.; Hofmann, P. Fairness, integrity, and privacy in a scalable blockchain-based federated learning system. Comput. Netw. 2022, 202, 108621. [Google Scholar] [CrossRef]
  11. Dong, N.; Sun, J.; Wang, Z.; Zhang, S.; Zheng, S. FLock: Defending Malicious Behaviors in Federated Learning with Blockchain. arXiv 2022, arXiv:2211.04344. [Google Scholar]
  12. Stephanie, V.; Khalil, I.; Atiquzzaman, M.; Yi, X. Trustworthy Privacy-preserving Hierarchical Ensemble and Federated Learning in Healthcare 4.0 with Blockchain. IEEE Trans. Ind. Inform. 2022, 1–10. [Google Scholar] [CrossRef]
  13. Wang, Y.; Peng, H.; Su, Z.; Luan, T.H.; Benslimane, A.; Wu, Y. A platform-free proof of federated learning consensus mechanism for sustainable blockchains. IEEE J. Sel. Areas Commun. 2022, 40, 3305–3324. [Google Scholar] [CrossRef]
  14. Kalapaaking, A.P.; Khalil, I.; Yi, X. Blockchain-based Federated Learning with SMPC Model Verification Against Poisoning Attack for Healthcare Systems. IEEE Trans. Emerg. Top. Comput. 2023, arXiv:2304.13360. [Google Scholar] [CrossRef]
  15. Baucas, M.J.; Spachos, P.; Plataniotis, K.N. Federated Learning and Blockchain-Enabled Fog-IoT Platform for Wearables in Predictive Healthcare. IEEE Trans. Comput. Soc. Syst. 2023, 1–10. [Google Scholar] [CrossRef]
  16. Xu, M.; Zou, Z.; Cheng, Y.; Hu, Q.; Yu, D.; Cheng, X. SPDL: Blockchain-secured and Privacy-preserving Decentralized Learning. arXiv 2022, arXiv:2201.01989 2022. [Google Scholar]
  17. Liu, G.; Ma, X.; Yang, Y.; Wang, C.; Liu, J. FedEraser: Enabling Efficient Client-Level Data Removal from Federated Learning Models. In Proceedings of the 2021 IEEE/ACM 29th International Symposium on Quality of Service (IWQOS), Tokyo, Japan, 25–28 June 2021; pp. 1–10. [Google Scholar]
  18. Sun, Z.; Kairouz, P.; Suresh, A.T.; McMahan, H.B. Can you really backdoor federated learning? arXiv 2019, arXiv:1911.07963. [Google Scholar]
  19. Proserpio, D.; Goldberg, S.; McSherry, F. Calibrating data to sensitivity in private data analysis. arXiv 2012, arXiv:1203.3453. [Google Scholar] [CrossRef]
  20. Buterin, V.; Griffith, V. Casper the friendly finality gadget. arXiv 2017, arXiv:1710.09437. [Google Scholar]
  21. Qu, X.; Wang, S.; Hu, Q.; Cheng, X. Proof of federated learning: A novel energy-recycling consensus algorithm. IEEE Trans. Parallel Distrib. Syst. 2021, 32, 2074–2085. [Google Scholar] [CrossRef]
  22. Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. Advances in Neural Information Processing Systems 32. PyTorch: An Imperative Style, High-Performance Deep Learning Library; Wallach, H., Larochelle, H., Beygelzimer, A., d’Alché-Buc, F., Fox, E., Garnett, R., Eds.; Curran Associates, Inc.: New York, NY, USA, 2019; pp. 8024–8035. Available online: http://papers.neurips.cc/paper/9015-pytorch-an-imperativestyle-high-performance-deep-learning-library.pdf (accessed on 10 March 2023).
  23. Liu, Y.; Ma, S.; Aafer, Y.; Lee, W.-C.; Zhai, J.; Wang, W.; Zhang, X. Trojaning attack on neural networks. In Proceedings of the 25th Annual Network and Distributed System Security Symposium (NDSS 2018), San Diego, CA, USA, 18–21 February 2018. [Google Scholar]
  24. Firdaus, M.; Rhee, K.-H. A joint framework to privacy-preserving edge intelligence in vehicular networks. In Proceedings of the Information Security Applications: 23rd International Conference, WISA 2022, Revised Selected Papers, 2023. Jeju Island, Republic of Korea, 24–26 August 2022; pp. 156–167. [Google Scholar]
  25. Bernstein, J.; Zhao, J.; Azizzadenesheli, K.; Anandkumar, A. signSGD with majority vote is communication efficient and fault tolerant. arXiv 2018, arXiv:1810.05291. [Google Scholar]
  26. Wolfe, D.A. A characterization of population weighted-symmetry and related results. J. Am. Stat. Assoc. 1974, 69, 819–822. [Google Scholar] [CrossRef]
  27. Rosenbaum, P.R.; Silber, J.H. Amplification of sensitivity analysis in matched observational studies. J. Am. Stat. Assoc. 2009, 104, 1398–1405. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Framework of DBFL.
Figure 1. Framework of DBFL.
Electronics 12 02500 g001
Figure 2. Error evolution under various network sizes of N = 5, 10, 15, and 20.
Figure 2. Error evolution under various network sizes of N = 5, 10, 15, and 20.
Electronics 12 02500 g002aElectronics 12 02500 g002b
Figure 3. Test error evolution with ε = 0.001 ,   0.005 ,   0.02 and N = 10, 20.
Figure 3. Test error evolution with ε = 0.001 ,   0.005 ,   0.02 and N = 10, 20.
Electronics 12 02500 g003
Figure 4. Examples before and after using Trojan horses in the MNIST dataset. The Trojan horse pattern is 5 × 5 with “@” placed in the bottom right corner of the object, and the backdoor task results in the model classifying Trojan horse “5” as “7”.
Figure 4. Examples before and after using Trojan horses in the MNIST dataset. The Trojan horse pattern is 5 × 5 with “@” placed in the bottom right corner of the object, and the backdoor task results in the model classifying Trojan horse “5” as “7”.
Electronics 12 02500 g004
Figure 5. Equity accumulation curve. (a) Complete equity accumulation curve of blockchain participants; (b) partially enlarged view in rounds 90–100.
Figure 5. Equity accumulation curve. (a) Complete equity accumulation curve of blockchain participants; (b) partially enlarged view in rounds 90–100.
Electronics 12 02500 g005
Table 1. “P” is Participants; “A” is Aggregator; “I” is Inference; “T” is Training; “DPS” is Data Poisoning; “MPS” is Model Poisoning; “BA” is Byzantine Attack; “FSS” is Function Secret Sharing protocol; “SMPC” is multi-party computation; “DP” is Differential Privacy; “BC” is Blockchain; “IP” is Identity Privacy; “S” is Scalability; “AU” is Asynchronous Updates; “DPS” is Dynamic Participants; “D” is Decentralized Premature; “PC” is Premature Convergence; “RM” is Reward Mechanism; — denotes non-existent party; ☾ denotes honest party; ☼ denotes semi-honest party; ☀ denotes dishonest party; × denotes does not provide property; √ denotes provides property.
Table 1. “P” is Participants; “A” is Aggregator; “I” is Inference; “T” is Training; “DPS” is Data Poisoning; “MPS” is Model Poisoning; “BA” is Byzantine Attack; “FSS” is Function Secret Sharing protocol; “SMPC” is multi-party computation; “DP” is Differential Privacy; “BC” is Blockchain; “IP” is Identity Privacy; “S” is Scalability; “AU” is Asynchronous Updates; “DPS” is Dynamic Participants; “D” is Decentralized Premature; “PC” is Premature Convergence; “RM” is Reward Mechanism; — denotes non-existent party; ☾ denotes honest party; ☼ denotes semi-honest party; ☀ denotes dishonest party; × denotes does not provide property; √ denotes provides property.
FrameworkThreat ModelPrivacy GuaranteesSecurity GuaranteesTechniques UsedFeatures
PAITDPS MPSBAFSSSMPC DPBCIP SAUDPSDPCRM
FBI [8]××××××××××
Zhang et al. [9]×××××××××
Rückel et al. [10]×××××××
FLock [11]××××××××
Stephanie et al. [12]××××××××
PF-PoFL [13]××××××
Kalapaaking et al. [14]××××
BEAS [7]××
Baucas et al. [15]××××××××××××
DBFL (ours)××××
Table 2. Symbolic representations used in our framework.
Table 2. Symbolic representations used in our framework.
SymbolsMeaning
N A node in the blockchain node set ( N = N 1 ,   N 2 , N m )
N w Blockchain Worker Node
N w m Blockchain Miner Node
T Participant Online Probability
T w Worker waiting time
T m Miner waiting time
R j The jth round of communication
t r a i n w Node local private training dataset
L j w Node j updates the local model in the R j round
G j R j round global model update
r j w Basic rewards obtained by blockchain node j
r j w m v e r i Verification signature reward obtained by miner node j
r j w m Mining reward obtained by miner node j
α j Accuracy ratio of blockchain winning miner node j model
β j Historical Equity Ratio blockchain winning miner node j model
b l o c k j m The blocks mined by the miner node j
b l o c k j The blocks mined by the winning miner node j
L . Accuracy function
l . Historical stakes function
ζ . Model aggregation method
Table 3. Hyperparameters for all i.i.d. experiments.
Table 3. Hyperparameters for all i.i.d. experiments.
RFCPEB θ η TTwTm
1000.110.5512840.011 (100%)
Table 4. Evolution of testing accuracy under different frameworks. Final backdoor, validation, and base class accuracies for different aggregations in i.i.d. settings.
Table 4. Evolution of testing accuracy under different frameworks. Final backdoor, validation, and base class accuracies for different aggregations in i.i.d. settings.
SchemeM ε RLR Used?Backdoor (%)Validation (%)Base (%)
PURE00N99.896.498.7
DP05 × 10−3N98.596.899
DBFL125 × 10−3Y9.695.697.7
DBFL225 × 10−3Y9.395.297
DBFL325 × 10−3Y9.194.897.4
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Li, L.; Qin, J.; Luo, J. A Blockchain-Based Federated-Learning Framework for Defense against Backdoor Attacks. Electronics 2023, 12, 2500. https://doi.org/10.3390/electronics12112500

AMA Style

Li L, Qin J, Luo J. A Blockchain-Based Federated-Learning Framework for Defense against Backdoor Attacks. Electronics. 2023; 12(11):2500. https://doi.org/10.3390/electronics12112500

Chicago/Turabian Style

Li, Lu, Jiwei Qin, and Jintao Luo. 2023. "A Blockchain-Based Federated-Learning Framework for Defense against Backdoor Attacks" Electronics 12, no. 11: 2500. https://doi.org/10.3390/electronics12112500

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop