Next Article in Journal
Current Orientations of Surgical–Prosthetic Rehabilitation: Analogue, Digital and Biomechanical Considerations
Next Article in Special Issue
ReliaMatch: Semi-Supervised Classification with Reliable Match
Previous Article in Journal
Utilization of Merge-Sorting Method to Improve Stitching Efficiency in Multi-Scene Image Stitching
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

MDIFL: Robust Federated Learning Based on Malicious Detection and Incentives

1
State Key Laboratory of Public Big Data, College of Computer Science and Technology, Guizhou University, Guiyang 550025, China
2
Institute of Artificial Intelligence and Blockchain, Guangzhou University, Guanzhou 510000, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2023, 13(5), 2793; https://doi.org/10.3390/app13052793
Submission received: 7 January 2023 / Revised: 3 February 2023 / Accepted: 20 February 2023 / Published: 21 February 2023

Abstract

:
Federated Learning (FL) is an emerging distributed framework that enables clients to conduct distributed learning and globally share models without requiring data to leave the local. In the FL process, participants are required to contribute data resources and computing resources for model training. However, the traditional FL lacks security guarantees and is vulnerable to attacks and damages by malicious adversaries. In addition, the existing incentive methods lack fairness to participants. Therefore, accurately identifying and preventing malicious nodes from doing evil, while effectively selecting and incentivizing participants, plays a vital role in improving the security and performance of FL. In this paper, we propose a Robust Federated Learning Based on Malicious Detection and Incentives (MDIFL). Specifically, MDIFL first uses a gradient similarity to calculate reputation, thereby maintaining the reputation of participants and identifying malicious opponents, and then designs an effective incentive mechanism based on contract theory to achieve collaborative fairness. Extensive experimental results demonstrate that the proposed MDIFL can not only preferentially select and effectively motivate high-quality participants, but also correctly identify malicious adversaries, achieve fairness, and improve model performance.

1. Introduction

The Internet of Things (IoT) has grown rapidly in recent years. Among them, the data generated by emerging IoT applications such as autonomous driving, surveillance and smart home is growing exponentially [1]. Therefore, we need to use advanced machine learning techniques to process these large amounts of data. However, in traditional machine learning, all data are uploaded to the cloud data center for centralized training, which not only requires a lot of time and communication costs for data transmission, but also causes serious data leakage and privacy issues. In addition, it is impractical to upload all data to the cloud, and applications with high real-time requirements should be quickly calculated and stored at edge nodes. In order to solve these problems, federated learning (FL) [2,3,4] was proposed, which uses distributed and edge deployment to realize the original data from not going out of the local area, so as to achieve the purpose of protecting privacy and reducing unnecessary communication resources. Similarly, edge nodes such as sensors, small cells, and servers in Mobile Edge Computing (MEC) can work with remote clouds to complete large-scale distributed tasks.
As shown in Figure 1, participants in federated learning obtain local gradients through training on local datasets. Different gradients will be uploaded to the cloud at the same time, and the aggregator will aggregate and update the model, and then return the updated gradients to the participants. This process continues iteratively until convergence. Although the distributed nature of federated learning provides a certain degree of privacy protection, due to the different geographical and equipment conditions of each user device, there may be malicious nodes launching poisoning attacks [5]. For example, using polluted data for model training will lead to a decrease in the performance of the global model or even training failure, or data leakage without authorization. In addition, due to differences in the computing power and equipment, some participants can only train low-quality gradients, and the long-term aggregation of low-quality gradients will also lead to a decrease in the performance of the global model. Therefore, the selection of participants is very important. It is not only necessary to select high-quality participants from many participants to join the model training, for example, participants with high-quality data [6,7], but also to accurately identify and remove malicious nodes to ensure that the model training is minimally impacted. In addition, in real federated learning, rational participants will not actively participate in model training and actively contribute their own resources. Therefore, it is equally important to design an incentive mechanism to motivate participants [8,9].
However, the existing methods mainly focus on eliminating the single point of the failure problem, lack of effective malicious node detection, and cannot prevent the adversary from destroying the model training in time [10,11]. In addition, some judgment methods of the malicious node are likely to cause misjudgment, resulting in the final training of a low-performance model [12,13]. It is necessary to design an efficient node selection method.
In the MEC [14], participants will first consider whether it is beneficial to themselves, and then choose to contribute their own resources accordingly, and will not make choices that are not beneficial to themselves. Without fair incentives, free-riders attacks are likely to occur [15]. These schemes require effective incentive mechanisms to achieve collaborative fairness.
The contribution of this research is to propose a Robust Federated Learning Based on Malicious Detection and Incentives (MDIFL). First, we propose a node selection method, which uses reputation to select participants, and judges malicious nodes through gradient similarity. Once a malicious node triggers a large-scale pollution model or is suspected more than three times, the mechanism will remove the malicious node. While preferentially selecting participants with high-quality data to join the model training, it is also possible to correctly identify and exclude malicious participants. Secondly, we also propose an incentive mechanism based on contract theory to increase the willingness of participants to join, realize the mutual benefit of participants, and encourage participants to contribute their own high-quality data and computing resources as much as possible with a fair and reasonable incentive method. Furthermore, we evaluate the performance of the proposed MDIFL scheme through extensive experiments. Extensive experiments on benchmark datasets demonstrate that MDIFL can achieve high security and cooperative fairness, and improve the performance of the algorithm.
The structure of this paper is as follows. We review related work in Section 2, describe the MDIFL scheme in detail in Section 3, and present and discuss experimental results in Section 4. Finally, this work is concluded in Section 5.

2. Literature Review

In this section, we review the relevant literature on node selection and participant incentives in order to connect our study with existing research.

2.1. Node Selection Issue

Due to the large number of heterogeneous clients in the federated learning environment, the adverse effect of data heterogeneity will be exacerbated if participants are randomly selected. Therefore, it is crucial to preferentially select high-quality participants, which can quickly improve the model performance. Lai et al. [16] propose an actor selection framework (Oort) that can identify and select those actors for training and testing who have both data that provide the greatest utility in improving model accuracy and the ability to run training quickly. Chai et al. [17] proposed a layer-based federated learning system (TiFL), which divides participants into layers based on their training performance and selects clients from the same layer in each round of training. Wang et al. [18] propose an experience-driven federated learning framework (Favor) based on reinforcement learning, which intelligently selects client devices to participate in each round of federated learning to counteract the bias introduced by the non-IID data and accelerate convergence. Kang et al. [19] took reputation as a fair measure, and used a multi-weight subjective logic model to efficiently calculate the reputation of participants to select reliable participants for federated learning to defend against unreliable model updates in mobile networks.
In addition, although the data set does not leave the local area during the federated learning process, a certain degree of privacy protection is achieved, but the federated learning may also be subject to poisoning attacks [20]. For model poisoning, Bhagoji et al. [21] propose two key stealth concepts to detect malicious updates, use an alternating minimization strategy to improve the stealth of the attack, and demonstrate that effective and covert model poisoning attacks are possible. In addition, since the participants participating in the model training task are all rational, if malicious participants appear, they may destroy the training of the model by changing the gradient parameters of the model uploaded to the aggregator. Fang et al. [22] conducted a systematic study on the local model poisoning attack of federated learning, and the results demonstrated that the Byzantine-robust federated learning method can not defend against poisoning attacks in all cases; thus, new defense measures need to be proposed to resist a poison attack. Zhang et al. [23] proposed an unsupervised approach, where the server predicts the model updates of participants in each iteration based on historical model updates, identifies whether participants are malicious, and removes most of the malicious participants. Xu et al. [12] proposed a precision-based malicious node detection mechanism; through the results of each training, each participant is marked with a reputation score, and nodes with a reputation score below zero will lose the opportunity to join any training process. Xu et al. [13] proposed a novel robust and fair federated learning (RFFL) framework to maintain the reputation of each participant by uploading gradients to check each participant’s contribution, thereby identifying non-contributing or malicious participation to be removed.
However, the scheme proposed by Xu et al. [12] did not take into account that malicious nodes may accumulate reputation scores to prepare for future evil and continue to participate in training. During the training process, when a malicious node has a great impact on the model training, the mechanism will still choose to deduct the reputation score. As long as the reputation score is non-negative, the malicious node will continue to participate in the model training. Therefore, when the reputation score is large enough, malicious nodes may perform large-scale destruction behaviors many times, which will greatly reduce the performance of the global model, resulting in model training failure. Similarly, RFFL in [13] only sets a threshold to identify malicious nodes, and it is easy to exclude those participants whose model performance is low due to external factors in a certain training. In this regard, the judgment method we propose considers each round of the independent judgment of malicious nodes and double threshold settings, which is more comprehensive than existing methods.

2.2. Incentive Mechanism

Incentives are an important research area in federated learning because the participants are rational. Xu et al. [12] proposed a contribution-based incentive mechanism, using the improvement of model accuracy and model training time to quantify the contribution of participants, and according to the ranking of the participants’ contribution, each participant’s different degrees of substitution Coin rewards. Kang et al. [19] combined reputation with contract theory to incentivize high-reputation mobile devices with high-quality data to participate in model learning. Lim et al. [24] proposed a hierarchical incentive framework, using contract theory and alliance game theory to reward workers and model owners, respectively. Kang et al. [25] adopted contract theory to design an effective incentive mechanism to simulate mobile devices with high-quality data to participate in federated learning. Li et al. [26] propose a novel optimization objective (q-FFL) inspired by a fair resource allocation in wireless networks, which encourages a fairer distribution of accuracy across devices in a joint network.
The above method only considers that the participants’ own choices will affect the final reward, which may cause the participants to only consider their own interests. However, in MDIFL, the interests of participants are also related to the decision-making of other participants. When the participants motivate each other and contribute considerable resources, there will be additional benefits, so as to achieve higher benefits together.

3. Materials and Methods

In this section, we will select high-quality participants to join the model training to improve the performance of the model, and identify malicious nodes to avoid damage to the model training task. In addition, we use the contract theory to implement a reasonable incentive mechanism, increase the willingness of participants to join the training task of the federated learning model, and contribute their own data resources and computing resources.

3.1. Node Selection

To improve model performance, cosine similarity has been used to determine the quality of gradients [27,28]. In terms of participant selection, we use cosine similarity to determine the gradient quality of participants’ training epochs, resulting in gradient similarity. The reputation is calculated through the gradient similarity, and participants with a high reputation will be selected to join the model training in each round of training. In other words, the higher the reputation, the higher the quality of the data the participant has, and the better the performance of the final trained model. The reputation of the participants is calculated by the aggregator. Here, we consider that there are N participants, P = { P 1 , P 2 , , P i , , P N } is shown as the set of all participants. Initially, at the beginning of model training, the reputation of each participant will be initialized to zero, and  R i is used to represent the reputation of participant P i , which can be specifically expressed as Equation (1).
R i = β R i t 1 + ( 1 β ) ( 1 e R i t ) s . t . R i t = c o s ( Δ ω g t , Δ ω i t ) = Δ ω g t · Δ ω i t Δ ω g t · Δ ω i t
Among them, β is a weight factor. We use β , which can be specified by the model aggregator, to control the degree of importance between the early and late reputation of the participants. If the model aggregator pays attention to the early reputation of the participants, then the value of β is set close to 1. Oppositely, the model aggregator pays attention to the late reputation of the participants, then sets the value of β to be small. R i t is the reputation obtained by participant P i in the t-th round of training, and the similarity is evaluated by calculating the cosine value of the angle between the global gradient parameter Δ ω g t and the local gradient parameter Δ ω i t of participant P i in the t-th round. The smaller the angle, the higher the similarity, and the better the performance of the trained model.
During the first round of model training, the model aggregator randomly selects participants to join the training and calculates the reputation of each participant. In the following training rounds, the model aggregator will sort all participants according to their reputation values, and at the beginning of each round of training, they will give priority to participants with higher reputations to join. This is conducted to improve the quality of the participants who join the training. For ease of reference, we refer readers to Table 1 for commonly used notations.
In terms of malicious node detection, gradient similarity is also used to judge whether a participant is malicious. If a participant behaves maliciously, resulting in a decrease in the accuracy of the training model or a failure in training, the malicious node will be punished accordingly. Here, we simulate three kinds of nodes, namely malicious nodes (M_P), general nodes (S_P) and high-quality nodes (G_P). Among them, the general node refers to the node with average data quality, we call it S_P; this node does not intentionally do evil, but because of other reasons such as low data quality, the performance of the model trained each time is low. If it is kept low for a long time, the performance of the model participates in global aggregation, which may eventually degrade the performance of the entire model. Equation (2) shows the judgment method of malicious nodes.
P i = m P i , i f R i t < λ 2 s P i , i f λ 2 R i t < λ 1 g P i , i f R i t λ 1
m P i , s P i and g P i refer to identified malicious nodes, suspected nodes and high-quality nodes, respectively. Here, we need to set two thresholds as λ 1 and λ 2 as a criterion for judging malicious nodes. This can be divided into three situations:
Case1: When R i t is less than λ 2 , the participant P i is set as the malicious node m P i , and the node is prohibited from continuing to participate in this federated learning model training task.
Case2: When R i t is greater than λ 2 and less than λ 1 , the participant P i is set as the suspected node s P i . At this time, the participant may be malicious, or may have low cosine similarity due to low-quality local data or low computing power, but it has little impact on model training. Such actors cannot appear more than once, otherwise it will degrade the performance of the whole model. Therefore, when the number of suspected nodes s P i is greater than 3, it is also forbidden to continue to participate in this federated learning model training task.
Case3: When R i t is greater than λ 1 , the participant P i is set as a high-quality node g P i , and is allowed to continue to participate in this federated learning model training task.
In addition, you need to pay attention to the setting of the threshold λ . If the threshold λ is set to be small, malicious nodes cannot be accurately identified, but if the threshold λ is set large, it is easy to judge high-quality nodes as malicious nodes. Here, we have obtained a relatively suitable value range of the threshold λ based on a large number of test experiments and experience. At the same time, the threshold λ can also be set to an appropriate threshold λ according to the security expectations of different schemes and different data. Similarly, the allowed number of occurrences of s P i can also be set according to the safety expectation. When the safety expectation is low, multiple occurrences of s P i can be allowed, and on the contrary, the number of occurrences of s P i will be reduced.
The malicious node detection mechanism we proposed effectively avoids the situation where participants do not do evil in the early stage, accumulate a large number of reputation scores, and then destroy the global model to a large extent. It also allows participants to appear as case2 no more than three times, so as to avoid misjudgment. The specific detailed implementation is given in Algorithm 1.
Algorithm 1: MDIFL Algorithm for Server
Applsci 13 02793 i001

3.2. Incentive Mechanism

With the help of contract theory in economics, this paper proposes an incentive mechanism based on contract theory to encourage participants to contribute more computing resources and data resources to model training. In traditional contract theory [25], different types of participants can maximize their own interests only when they choose contracts designed corresponding to their types. However, in the incentive mechanism we propose, the benefits of participants are not only related to the type of contract they choose, but are also related to the decisions of other participants. Each participant needs to choose a contract designed for its type, and there will be additional benefits when motivating each other and contributing considerable resources, so as to achieve higher benefits together.

3.2.1. Problem Formulation

The resources consumed by participants can be divided into computing resources and communication resources [25]. The time it takes for participant P n to iterate once in local model training is
T n c m p = c n s n f n
c n is the number of CPU cycles for single data training, s n is the size of the local data sample of participant P n , and f n is the computing resource contributed by each participant P n for local model training, that is, the CPU cycle frequency. The transfer rate of participant P n can be expressed as
r n = B l n ( 1 + ρ n h n N 0 )
B is the transmission bandwidth, ρ n is the transmission power of participant P n , N 0 is the background noise, h n is the channel gain of the peer-to-peer link between participant P n and the aggregator. Considering the data size σ of the local model update as a constant, the transmission time of the local model update can be obtained as
T n c o m = σ B l n ( 1 + ρ n h n N 0 )
In this way, the total time for a complete global iteration of participant P n can be expressed as
T n t = τ T n c m p + T n c o m
τ is the number of local model update iterations. In addition, the CPU energy consumption of participant P n is
E n c m p ( f n ) = ζ c n s n f n 2
ζ denotes the effective capacitance parameter of the computing chipset of participant P n . The energy consumed by participant P n to transmit local model updates in global iterations is
E n c o m = T n c o m · ρ n = σ ρ n B l n ( 1 + ρ n h n N 0 )
The total energy consumption of a complete global iteration of participant P n can be obtained as
E n t = τ E n c m p + E n c o m
The types of participants can be divided into M categories, θ 1 < θ 2 < θ 3 < < θ m < < θ M , n { 1 M } . Among them, θ m represents the quality of the data that the participants have. The larger θ m means the higher the quality of the data the participants have, the higher the willingness to participate in the training. Similarly, participants can be divided into M categories from high to low according to the amount of data they have, s 1 < s 2 < s 3 < < s m < < s M , n { 1 M } . The larger s m means the more data it has. That is to say, the participants of type M are the best participants, whereas the participants of type 1 are relatively the worst. If participants provide more large and high-quality data, this will make the model performance higher. Model performance can be expressed as
M ( θ n , s n ) = 1 e φ ( θ n s n )
φ is the weighting factor. Assuming that the number of participants in the model training task S is | S | , the total profit function of the entire training task can be expressed as
p ( s ) = n = 1 | S | [ ( 1 e φ ( θ n s n ) ) G n ] s . t . G n = γ E n t = γ ( τ ζ c n s n f n 2 + σ ρ n B l n ( 1 + ρ n h n N 0 ) )
G n is the cost consumed by the participants, and γ is the predefined weight parameter for energy consumption.
Due to information asymmetry, for different types of participants with different data quality, the aggregator should design corresponding different types of contracts to maximize benefits. Therefore, we can obtain the maximized utility function of participant P n , as follows
m a x U n = R n G n + l o g ( ω p ( s \ { n } ) p ( s ) + 1 ) s . t . A n = l o g ( ω p ( s \ { n } ) p ( s ) + 1 )
R n and A n are the corresponding contract rewards and extra income of type n participants, respectively. p ( s \ n ) is the total profit function of the remaining participants in the training task, except the participant P n in the training task S. ω is the weight parameter. If a participant behaves maliciously, the aggregator will prohibit the participant from continuing to participate in the model training and stop reward distribution.
In this way, we can obtain the maximum utility function of the aggregator as
m a x U a = p ( s ) n = 1 | S | A n | S | C     = n = 1 | S | [ ( 1 e φ ( θ n s n ) ) G n A n | S | C   s . t . C = μ T n t = μ ( τ c n s n f n + σ B l n ( 1 + ρ n h n N 0 ) )
C is the communication cost and μ is a predefined weight parameter for time.

3.2.2. Optimal Contract Design

The contract theory uses the self-disclosure mechanism under information asymmetry. In order to make the contract feasible, each contract must meet the following constraints to ensure that each participant receives a fair and appropriate incentive reward.
  • Individual Rationality (IR): Participants will only participate in the task of federated learning model training if their maximum utility is not less than zero, i.e.,
    U n = R n G n + A n 0
  • Incentive Compatibility (IC): Each participant of type m can maximize utility only if he chooses the contract R m designed for his type, i.e.,
    R n G n + A n R m G n + A n , n , m { 1 , , N } , n m
According to the above definition, we have the following lemma.
Lemma 1.
Monotonicity.
For any feasible contract, when θ n θ m , we obtain R n R m , n , m { 1 , , N } , n m . Therefore, it should be satisfied
0 < R 1 < R 2 < < R m < < R n 0 < s 1 < s 2 < < s m < < s n
Lemma 2.
The other individual rationality constraints also hold if the individual rationality constraints of type 1 participants are satisfied, where type 1 refers to the type of participants with the worst data quality.
Lemma 3.
Local downward Incentive constraint.
According to the monotonicity of Lemma 1, the incentive compatibility condition can be simplified as a local downward Incentive constraint (LDIC), which can be expressed as
R n τ E n c m p + A n R n 1 τ E n 1 c m p + A n 1 , n { 2 , , N }
Under the constraints of individual rationality and incentive compatibility, we can obtain rewards [25], which can be expressed as
R n = τ E 1 c m p + E n c o m + k = 1 | S | Δ k
Δ k = τ E k c m p τ E k 1 c m p , and Δ 1 = 0 . We can rewrite the utility function to obtain
m a x U n = τ E 1 c m p + E n c o m + k = 1 | S | Δ k γ ( τ ζ c n s n f n 2 + σ ρ n B l n ( 1 + ρ n h n N 0 ) ) + A n s . t . R 1 G 1 + A 1 > 0 R n G n + A n R m G m + A m n = 1 | S | R n R m a x
R m a x is the total reward budget.

4. Experiment Results and Discussion

In this section, we provide the experimental setup, then perform numerical experiments and analyze the experimental results to evaluate our proposed MDIFL.

4.1. Experimental Setup

4.1.1. Datasets

We conduct experiments on three datasets, namely MNIST [29], CIFAR-10 [30] and text classification datasets: Movie Review (MR) [31]. MNIST is a large database of handwritten digits collected by the National Institute of Standards and Technology. The training set contains 60,000 images and labels, and the test set contains 10,000 images and labels. CIFAR-10 is a small dataset for universal object recognition. A total of 10 categories of the RGB color images are included, and there are 50,000 training images and 10,000 test images in the dataset. MR contains both positive and negative comments. We use a two-layer convolutional neural network (CNN) for MNIST and a three-layer CNN for CIFAR10, and a text embedding CNN for MR. In addition, we vary the dataset size for heterogeneous data in addition to considering the standard independent and identically distributed (I.I.D) data distribution (UNI). We randomly partition 3000, 6000, 12,000 MNIST examples among 5, 10, 20 participants, respectively, following power-law partitioning (POW) [32]. Obviously, each participant has a different number of examples, with the first participant receiving the fewest examples and the last participant receiving the most examples.

4.1.2. Baselines

To verify the effectiveness of our proposed method, we examine the performance by two metrics, predictive performance and robustness. The classic FedAvg [32], q-FFL for fair resource allocation in [26] and the state-of-the-art RFFL proposed in [13] are compared with our method MDIFL.

4.1.3. Attack Settings

We consider three types of adversaries, namely free-riders [33], label flipping attack in directed poisoning [34] and non-directed poisoning attack [35].
  • Free-riders: Free-riders is a passive attack, which means that participants only use the global model to update their own local model and refuse to provide valuable local information to the global model. They usually upload random gradients.
  • Targeted poisoning attack: This is such as label-flipping, which refers to the fact that the labels of honest training examples of one class are flipped to another class, while the characteristics of the data remain unchanged. For example, the adversary is trained using ‘1’ as the label for the actual image ‘7’, resulting in distorted gradients.
  • Non-targeted poisoning attack: Randomize the sign, rescale the gradient, and invert the value, respectively.
In addition, we also consider a non-malicious actor (S_P), whose trained model performs poorly due to having low-quality data, etc.

4.1.4. Hyper-Parameters

We set the reputation weight as β = 0.9, and the thresholds for judging malicious nodes in MNIST and CIFAR10 as λ 1 = 0.6 and λ 2 = 0.5 , and in MR λ 1 = 0.4 and λ 2 = 0.35 .

4.2. Reputation Setting and Malicious Node Identification Analysis of MDIFL

In this section, we analyze the proposed MDIFL’s reputation setting method and malicious node identification method. We set up three types of participants: (1) malicious nodes (M_P), such as: free-riders and label-flipping, etc.; (2) participants who do not intend to do evil, but have low-quality data or other factors that lead to low performance of the trained model (S_P); (3) high-quality nodes (G_P).
As shown in Figure 2, M_P is directly assigned a reputation of 0 after being identified in the first round, and will not be able to continue to participate in federated learning training tasks in the future. After the S_P class participants are identified three times, they also lose the opportunity to continue to participate in the training and assign the reputation value to 0. At the beginning of the next training, we will provide priority to selecting participants with a high reputation from the remaining G_P to continue to participate in model training.
The method of MDIFL judging malicious nodes is described in detail in Figure 3, and we select some representative nodes among all nodes as a display. Among them, it can be clearly observed that M_P cannot participate in training after the malicious node is identified in the first round. S_P was identified three times; thus, the gradient similarity is in the range of ( λ 1 , λ 2 ) , and it was also excluded.

4.3. Comparison of MDIFL with Other Methods under Different Datasets

In terms of a predictive performance, Table 2 illustrates the maximum accuracy of the model performance in different cases. We cooperate with the incentive mechanism and node selection, and it can be clearly observed that MDIFL is superior to other methods as a whole, especially for heterogeneous data, where POW is used to split data.
In terms of robustness, we compare FedAvg and RFFL with our method MDIFL in different data sets with 20% and 110% malicious nodes, respectively, and use accuracy as the evaluation index.
As shown in Figure 4 and Figure 5, the accuracy comparison of different schemes is shown in MNIST and CIFAR10, and the number of S_P is set to 20% of the number of honest participants. It can be observed that the addition of a small number of S_P participants has a little effect on MNIST, but the final convergence accuracy of FedAvg and RFFL is still lower than that of MDIFL. This is due to the fact that a small amount of S_P does not have a large impact on the overall model performance. However, under CIFAR10, FedAvg and RFFL are relatively affected. It can be observed that the accuracy of the early model fluctuates greatly, and finally converges to a lower position than MDIFL.
In addition, as shown in Figure 6 and Figure 7, in MNIST and CIFAR10, the accuracy comparison of different schemes is shown, respectively, when the number of S_P is set to 110% of the number of honest participants. It can be clearly observed that after adding a large number of S_P class participants, the accuracy of FedAvg and RFFL under the two data sets both dropped significantly in the early stage and fluctuated greatly. This is because neither FedAvg nor RFFL can recognize S_P. When a large number of models trained by S_P are aggregated, the overall model accuracy will be reduced and the performance will be poor. Therefore, FedAvg and RFFL cannot maintain a stable accuracy under the influence of such participants. On the contrary, MDIFL can identify such participants and exclude them in time, effectively avoiding the impact on the overall model. It can be found that the accuracy of our proposed MDIFL has been rising steadily and reached a better accuracy.
In addition, we also analyzed five attack methods, and the results are shown in Table 3 and Table 4. It can be observed that FedAvg is not robust to the three attack methods of non-directional poisoning under the MNIST of UNI data segmentation, no matter whether the number of malicious adversaries is 20% or 110%. RFFL has certain robustness to these five attack methods, but it cannot accurately identify S_P, resulting in a low performance of the overall model.
Table 5 shows that although RFFL can correctly identify free-rider attacks, directed poisoning attacks and non-directed poisoning attacks, it cannot recognize S_P. FedAvg also does not recognize S_P. If the number of S_P is large enough, the long-term aggregation of gradients uploaded by such participants will affect the overall model accuracy, resulting in the final training of a low-performance model. Since MDIFL has added the method of identifying and judging S_P, the accuracy has been improved. These results all show that MDIFL is the most robust overall.
Moreover, we also put MDIFL under different amount of free-riders for comparison. The results show that our proposed MDIFL can handle any number of malicious nodes. As shown in Figure 8, the number of malicious nodes is set to 2, 5 and 11, respectively. In the first round of training, as the number of malicious nodes increases, the accuracy of the model decreases. After the malicious nodes are accurately identified and removed in time, it can be clearly observed that the accuracy increases rapidly until it becomes stable, and finally the model can reach convergence. However, when the number of malicious nodes reaches a certain level, there will be fewer relatively honest nodes. The accuracy of the model trained in this way may not be high, and the model convergence speed will slow down. Therefore, when most of the participants are malicious, stop and end the model training.

5. Conclusions

In this study, we propose a Robust Federated Learning Based on Malicious Detection and Incentives (MDIFL). Based on the gradient similarity, we preferentially select high-quality nodes to participate in training, and identify malicious nodes, so as to prevent damage to model training from being destroyed. The incentive mechanism of collaborative fairness is realized by introducing contract theory. A large number of experiments were carried out on three data sets, and two data distribution methods of UNI and POW were also considered. The experimental results show that, compared with the existing methods, MDIFL can not only correctly identify various types of adversaries, but also eliminate malicious nodes in time, ensuring that the performance of the model will not be degraded, while achieving high accuracy, and also implement fair rewards for different types of participants. We conclude that the used method is effective in detecting malicious nodes and incentivizing participants.
However, the study was not without its flaws. Although FL does not require data to leave the local area, the gradient parameters of the model may still be attacked, resulting in privacy leaks. Therefore, in future work, we will consider privacy protection for the gradient parameters of the model, and techniques such as differential privacy or homomorphic encryption can be used to find a more secure training strategy. In addition, it is also considered to optimize the number of iterations in the training process, so that model training can quickly achieve a higher accuracy with fewer rounds.

Author Contributions

Conceptualization, R.W. and Y.C.; methodology, R.W.; validation, R.W.; data curation, R.W.; writing—original draft preparation, R.W.; writing—review and editing, R.W.; visualization, R.W; supervision, C.T. and Y.L.; funding acquisition, Y.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research is supported in part by the National Natural Science Foundation (61962009, 62202118), in part by Top Technology Talent Project from Guizhou Education Department (Qianjiao ji [2022]073).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Mao, Y.; You, C.; Zhang, J.; Huang, K.; Letaief, K.B. A survey on mobile edge computing: The communication perspective. IEEE Commun. Surv. Tutorials 2017, 19, 2322–2358. [Google Scholar] [CrossRef] [Green Version]
  2. Konečnỳ, J.; McMahan, H.B.; Yu, F.X.; Richtárik, P.; Suresh, A.T.; Bacon, D. Federated learning: Strategies for improving communication efficiency. arXiv 2016, arXiv:1610.05492. [Google Scholar]
  3. Yang, Q.; Liu, Y.; Chen, T.; Tong, Y. Federated machine learning: Concept and applications. ACM Trans. Intell. Syst. Technol. (TIST) 2019, 10, 1–19. [Google Scholar] [CrossRef]
  4. Kairouz, P.; McMahan, H.B.; Avent, B.; Bellet, A.; Bennis, M.; Bhagoji, A.N.; Bonawitz, K.; Charles, Z.; Cormode, G.; Cummings, R.; et al. Advances and open problems in federated learning. Found. Trends® Mach. Learn. 2021, 14, 1–210. [Google Scholar] [CrossRef]
  5. Lyu, L.; Yu, H.; Ma, X.; Chen, C.; Sun, L.; Zhao, J.; Yang, Q.; Philip, S.Y. Privacy and robustness in federated learning: Attacks and defenses. IEEE Trans. Neural Netw. Learn. Syst. 2022, 1–21. [Google Scholar] [CrossRef] [PubMed]
  6. Cho, Y.J.; Wang, J.; Joshi, G. Client selection in federated learning: Convergence analysis and power-of-choice selection strategies. arXiv 2020, arXiv:2010.01243. [Google Scholar]
  7. Ribero, M.; Vikalo, H. Communication-efficient federated learning via optimal client sampling. arXiv 2020, arXiv::2007.15197. [Google Scholar]
  8. Khan, L.U.; Pandey, S.R.; Tran, N.H.; Saad, W.; Han, Z.; Nguyen, M.N.; Hong, C.S. Federated learning for edge networks: Resource optimization and incentive mechanism. IEEE Commun. Mag. 2020, 58, 88–93. [Google Scholar] [CrossRef]
  9. Zhan, Y.; Zhang, J.; Hong, Z.; Wu, L.; Li, P.; Guo, S. A survey of incentive mechanism design for federated learning. IEEE Trans. Emerg. Top. Comput. 2021, 10, 1035–1044. [Google Scholar] [CrossRef]
  10. Lu, Y.; Huang, X.; Dai, Y.; Maharjan, S.; Zhang, Y. Blockchain and federated learning for privacy-preserved data sharing in industrial IoT. IEEE Trans. Ind. Inform. 2019, 16, 4177–4186. [Google Scholar] [CrossRef]
  11. Yin, B.; Yin, H.; Wu, Y.; Jiang, Z. FDC: A secure federated deep learning mechanism for data collaborations in the Internet of Things. IEEE Internet Things J. 2020, 7, 6348–6359. [Google Scholar] [CrossRef]
  12. Xu, Y.; Lu, Z.; Gai, K.; Duan, Q.; Lin, J.; Wu, J.; Choo, K.K.R. BESIFL: Blockchain Empowered Secure and Incentive Federated Learning Paradigm in IoT. IEEE Internet Things J. 2021, 22, 1–15. [Google Scholar] [CrossRef]
  13. Xu, X.; Lyu, L. A reputation mechanism is all you need: Collaborative fairness and adversarial robustness in federated learning. arXiv 2020, arXiv:2011.10464. [Google Scholar]
  14. Wang, S.; Tuor, T.; Salonidis, T.; Leung, K.K.; Makaya, C.; He, T.; Chan, K. Adaptive federated learning in resource constrained edge computing systems. IEEE J. Sel. Areas Commun. 2019, 37, 1205–1221. [Google Scholar] [CrossRef] [Green Version]
  15. Kim, H.; Park, J.; Bennis, M.; Kim, S.L. On-device federated learning via blockchain and its latency analysis. arXiv 2018, arXiv:1808.03949. [Google Scholar]
  16. Lai, F.; Zhu, X.; Madhyastha, H.V.; Chowdhury, M. Oort: Informed participant selection for scalable federated learning. arXiv 2020, arXiv:2010.06081. [Google Scholar]
  17. Chai, Z.; Ali, A.; Zawad, S.; Truex, S.; Anwar, A.; Baracaldo, N.; Zhou, Y.; Ludwig, H.; Yan, F.; Cheng, Y. Tifl: A tier-based federated learning system. In Proceedings of the 29th International Symposium on High-Performance Parallel and Distributed Computing, Stockholm, Sweden, 23–26 June 2020; pp. 125–136. [Google Scholar]
  18. Wang, H.; Kaplan, Z.; Niu, D.; Li, B. Optimizing federated learning on non-iid data with reinforcement learning. In Proceedings of the IEEE INFOCOM 2020-IEEE Conference on Computer Communications, Toronto, ON, Canada, 6–9 July 2020; pp. 1698–1707. [Google Scholar]
  19. Kang, J.; Xiong, Z.; Niyato, D.; Xie, S.; Zhang, J. Incentive mechanism for reliable federated learning: A joint optimization approach to combining reputation and contract theory. IEEE Internet Things J. 2019, 6, 10700–10714. [Google Scholar] [CrossRef]
  20. Mothukuri, V.; Parizi, R.M.; Pouriyeh, S.; Huang, Y.; Dehghantanha, A.; Srivastava, G. A survey on security and privacy of federated learning. Future Gener. Comput. Syst. 2021, 115, 619–640. [Google Scholar] [CrossRef]
  21. Bhagoji, A.N.; Chakraborty, S.; Mittal, P.; Calo, S. Analyzing federated learning through an adversarial lens. In Proceedings of the International Conference on Machine Learning, PMLR, Long Beach, CA, USA, 10–15 June 2019; pp. 634–643. [Google Scholar]
  22. Fang, M.; Cao, X.; Jia, J.; Gong, N.Z. Local model poisoning attacks to byzantine-robust federated learning. In Proceedings of the 29th USENIX Conference on Security Symposium, Boston, MA, USA, 12–14 August 2020; pp. 1623–1640. [Google Scholar]
  23. Zhang, Z.; Cao, X.; Jia, J.; Gong, N.Z. FLDetector: Defending federated learning against model poisoning attacks via detecting malicious clients. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Washington, DC, USA, 14–18 August 2022; pp. 2545–2555. [Google Scholar]
  24. Lim, W.Y.B.; Xiong, Z.; Miao, C.; Niyato, D.; Yang, Q.; Leung, C.; Poor, H.V. Hierarchical incentive mechanism design for federated machine learning in mobile networks. IEEE Internet Things J. 2020, 7, 9575–9588. [Google Scholar] [CrossRef]
  25. Kang, J.; Xiong, Z.; Niyato, D.; Yu, H.; Liang, Y.C.; Kim, D.I. Incentive design for efficient federated learning in mobile networks: A contract theory approach. In Proceedings of the 2019 IEEE VTS Asia Pacific Wireless Communications Symposium (APWCS), Singapore, 28–30 August 2019; pp. 1–5. [Google Scholar]
  26. Li, T.; Sanjabi, M.; Beirami, A.; Smith, V. Fair resource allocation in federated learning. arXiv 2019, arXiv:1905.10497. [Google Scholar]
  27. Cao, X.; Fang, M.; Liu, J.; Gong, N.Z. Fltrust: Byzantine-robust federated learning via trust bootstrapping. arXiv 2020, arXiv:2012.13995. [Google Scholar]
  28. Fung, C.; Yoon, C.J.; Beschastnikh, I. The limitations of federated learning in sybil settings. In Proceedings of the 23rd International Symposium on Research in Attacks, Intrusions and Defenses (RAID 2020), San Sebastian, Spain, 14–15 October 2020; pp. 301–316. [Google Scholar]
  29. LeCun, Y.; Bottou, L.; Bengio, Y.; Haffner, P. Gradient-based learning applied to document recognition. Proc. IEEE 1998, 86, 2278–2324. [Google Scholar] [CrossRef] [Green Version]
  30. Krizhevsky, A.; Hinton, G. Learning Multiple Layers of Features from Tiny Images. Technical Report, University of Toronto. 2009. Available online: http://www.cs.utoronto.ca/~kriz/learning-features-2009-TR.pdf (accessed on 12 November 2022).
  31. Pang, B.; Lee, L. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. arXiv 2005, arXiv:cs/0506075. [Google Scholar]
  32. McMahan, B.; Moore, E.; Ramage, D.; Hampson, S.; y Arcas, B.A. Communication-efficient learning of deep networks from decentralized data. In Proceedings of the Artificial Intelligence and Statistics. PMLR, Fort Lauderdale, FL, USA, 20–22 April 2017; pp. 1273–1282. [Google Scholar]
  33. Yang, Q.; Liu, Y.; Cheng, Y.; Kang, Y.; Chen, T.; Yu, H. Federated learning. Synth. Lect. Artif. Intell. Mach. Learn. 2019, 13, 1–207. [Google Scholar]
  34. Biggio, B.; Nelson, B.; Laskov, P. Support vector machines under adversarial label noise. In Proceedings of the Asian Conference on Machine Learning, PMLR, Taoyuan, Taiwan, 13–15 November 2011; pp. 97–112. [Google Scholar]
  35. 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]
Figure 1. An example of a federated learning framework in IoT. Among them, the red squares represent the contaminated gradient parameters uploaded by malicious nodes; the yellow squares represent the low-quality gradient parameters obtained after training by participants with low-quality data; the blue squares represent normal gradient parameters.
Figure 1. An example of a federated learning framework in IoT. Among them, the red squares represent the contaminated gradient parameters uploaded by malicious nodes; the yellow squares represent the low-quality gradient parameters obtained after training by participants with low-quality data; the blue squares represent normal gradient parameters.
Applsci 13 02793 g001
Figure 2. Reputations of the participants. (a) Participants’ reputations under UNI split MNIST. (b) Participants’ reputations under POW split MNIST.
Figure 2. Reputations of the participants. (a) Participants’ reputations under UNI split MNIST. (b) Participants’ reputations under POW split MNIST.
Applsci 13 02793 g002
Figure 3. MDIFL judges the effect of malicious nodes.
Figure 3. MDIFL judges the effect of malicious nodes.
Applsci 13 02793 g003
Figure 4. Accuracy comparison of MDIFL, FedAvg and RFFL. (a) Ten honest participants and 20% of S_P under UNI split MNIST. (b) Ten honest participants and 20% of S_P under POW split MNIST.
Figure 4. Accuracy comparison of MDIFL, FedAvg and RFFL. (a) Ten honest participants and 20% of S_P under UNI split MNIST. (b) Ten honest participants and 20% of S_P under POW split MNIST.
Applsci 13 02793 g004
Figure 5. Accuracy comparison of MDIFL, FedAvg and RFFL. (a) Ten honest participants and 20% of S_P under UNI split CIFAR10. (b) Ten honest participants and 20% of S_P under POW split CIFAR10.
Figure 5. Accuracy comparison of MDIFL, FedAvg and RFFL. (a) Ten honest participants and 20% of S_P under UNI split CIFAR10. (b) Ten honest participants and 20% of S_P under POW split CIFAR10.
Applsci 13 02793 g005
Figure 6. Accuracy comparison of MDIFL, FedAvg and RFFL. (a) Ten honest participants and 110% of S_P under UNI split MNIST. (b) Ten honest participants and 110% of S_P under POW split MNIST.
Figure 6. Accuracy comparison of MDIFL, FedAvg and RFFL. (a) Ten honest participants and 110% of S_P under UNI split MNIST. (b) Ten honest participants and 110% of S_P under POW split MNIST.
Applsci 13 02793 g006
Figure 7. Accuracy comparison of MDIFL, FedAvg and RFFL. (a) Ten honest participants and 110% of S_P under UNI split CIFAR10. (b) Ten honest participants and 110% of S_P under POW split CIFAR10.
Figure 7. Accuracy comparison of MDIFL, FedAvg and RFFL. (a) Ten honest participants and 110% of S_P under UNI split CIFAR10. (b) Ten honest participants and 110% of S_P under POW split CIFAR10.
Applsci 13 02793 g007
Figure 8. Changes in accuracy of MDIFL with different numbers of free-riders.
Figure 8. Changes in accuracy of MDIFL with different numbers of free-riders.
Applsci 13 02793 g008
Table 1. Symbol table.
Table 1. Symbol table.
SymbolDescription
PCollection of participants
β Reputation weighting factor
m P i Malicious participant
s P i Suspected as malicious participant
g P i Good participant
Δ ω g t Global gradient of round t
Δ ω i t Local gradient of participant P i in round t
R i t Cosine similarity between Δ ω g t and Δ ω i t
λ 1 Threshold for judging malicious nodes 1
λ 2 Threshold for judging malicious nodes 2
Table 2. Maximum accuracy (%) including S_P in different situations.
Table 2. Maximum accuracy (%) including S_P in different situations.
MNISTCIFAR10MR
N10105
Data SplitUNIPOWUNIPOWPOW
FedAvg9494393752
q-FFL8527413612
RFFL9493454253
MDIFL9696515356
Table 3. Maximum accuracy (%) of five attack modes for MNIST under UNI with 10 G_P and additional 20% M_P.
Table 3. Maximum accuracy (%) of five attack modes for MNIST under UNI with 10 G_P and additional 20% M_P.
Free-RidersLabel-
Flipping
Sign-
Randomizing
Re-ScalesValue-
Inverting
FedAvg968910109
RFFL9696969696
MFSFL9696969696
Table 4. Maximum accuracy (%) of five attack modes for MNIST under UNI with 10 G_P and additional 110% M_P.
Table 4. Maximum accuracy (%) of five attack modes for MNIST under UNI with 10 G_P and additional 110% M_P.
Free-RidersLabel-
Flipping
Sign-
Randomizing
Re-ScalesValue-
Inverting
FedAvg938894109
RFFL9696969696
MFSFL9696969696
Table 5. Maximum accuracy (%) and Attack success rate (%) for MNIST under UNI with 10 G_P and additional 110% S_P.
Table 5. Maximum accuracy (%) and Attack success rate (%) for MNIST under UNI with 10 G_P and additional 110% S_P.
Maximum AccuracyAttack Success Rate
FedAvg94.50.7
RFFL94.00.5
MFSFL95.80
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

Wu, R.; Chen, Y.; Tan, C.; Luo, Y. MDIFL: Robust Federated Learning Based on Malicious Detection and Incentives. Appl. Sci. 2023, 13, 2793. https://doi.org/10.3390/app13052793

AMA Style

Wu R, Chen Y, Tan C, Luo Y. MDIFL: Robust Federated Learning Based on Malicious Detection and Incentives. Applied Sciences. 2023; 13(5):2793. https://doi.org/10.3390/app13052793

Chicago/Turabian Style

Wu, Ruolan, Yuling Chen, Chaoyue Tan, and Yun Luo. 2023. "MDIFL: Robust Federated Learning Based on Malicious Detection and Incentives" Applied Sciences 13, no. 5: 2793. https://doi.org/10.3390/app13052793

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