# Improved Asynchronous Federated Learning for Data Injection Pollution
## 3 Design of the AFLI Algorithm  
### Basic Composition of AFLI  
In this study, the AFLI algorithm consists of three core parts. The first is data contamination. In order to explore the influence of data pollution on the convergence of training parameters, this study divides data pollution into two categories: (1) build noise samples, where the data set is expanded by adding \(\lambda,0<\lambda\leq 3\) salt and salt noise \(\mu,0\leq\mu<1\); (2) label pollution, which replaces the real labels of some samples with wrong labels. In order to avoid excessive noise samples that interfere with the study results, the study strictly controlled the proportion of noise samples to within three times the upper limit. Secondly, for abnormal gradient detection, the ITF algorithm was used to identify and exclude abnormal gradients. Finally, in the federated learning framework, participants implemented secure parameter transmission using RSA encryption technology. In this study, the initial dataset was extended several times to uniformly name the newly generated dataset, as detailed in Table 2.  
In federated learning, the number of labels in the dataset plays a crucial role in the aggregation process. For datasets with different label distributions, especially in the presence of label contamination (as seen in Cdata2 and Zdata2), the aggregation process may be skewed due to inconsistent or erroneous label assignments across local trainers. This can affect the model's ability to converge efficiently. To mitigate this, our approach pre-processes datasets to reduce label contamination and uses anomaly detection techniques to filter out corrupted gradients during parameter updates.  
Data Injection Pollution, such as salt-and-pepper noise and label contamination, poses significant challenges in federated learning by introducing erroneous or misleading data during model training. In our experiments, datasets like Cdata2 and Zdata2 were deliberately polluted with noise and mislabeling to simulate real-world scenarios, where data are not always clean. The AFLI algorithm combats these issues by using anomaly detection during gradient transmission, effectively identifying and filtering out abnormal gradients that could disrupt the aggregation process. This method can improve the robustness of the model, as demonstrated by its increased accuracy and reduced performance degradation under polluted conditions.  
In this study, the process of generating salt-and-pepper noise samples was relatively simple and is therefore not detailed. Next, we will present some examples of noisy images and present the mathematical formula used to construct the sample pseudo-labels, as detailed in Equation (3). The basic information of the datasets used in this study is detailed in Table 3.  
\[\left\{\begin{array}{l}\mathrm{I}_{i,j}\gets k,0\leq k\leq L_{r}k\
eq \mathrm{I}_{i,j}\\ \mathrm{II}_{i,j}\gets k,0\leq k\leq L,k\
eq\mathrm{II}_{i,j}\end{array}\right. \tag{3}\]  
where \(\mathrm{I}_{i,j}\) and \(\mathrm{II}_{i,j}\) are the labels of I and these two classes of datasets, i is the sample number and j is the sample label. Construct noise samples based on the salt and salt noise of the pepper and pepper function and randomly shuffled labels 3.  
By adding the noise subset and the random label subset to the original datasets ZXSFL and 2 CLS, we successfully achieved a great expansion of the dataset and plan to conduct comparative experiments based on these two types of expanded sample sets.