# MDIFL: Robust Federated Learning Based on Malicious Detection and Incentives
###### 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. federated learning; malicious node detection; poisoning attacks; incentive mechanism; contract theory +
Footnote †: journal: Applied Sciences  
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. 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. The contribution of this research is to propose a Robust Federated Learning Based on Malicious Detection and Incentives (MDIFL).