# Improved Asynchronous Federated Learning for Data Injection Pollution
## 3 Design of the AFLI Algorithm
### Network Structure of the AFLI Algorithm Trainer  
The main symbols, nouns, and variables used in this section are shown in Table 4.  
In the framework of AFLI algorithm, the network structure of all participants is exactly the same; that is, the network structure is isomorphic. The network structure of each participant is shown in Figure 2. This article uses the residual network and the capsule network to extract the spatial features of the trainer's static images and their feature maps. The combination of the capsule network and the residual network in the extraction of features is achieved through the fusion strategy presented in Equation (6). \[\left\{ \begin{array}{l}\text{merged}\;\leftarrow\;b_{1}\oplus b_{2},\mathit{ dm}=3,\\ b_{1}=B(R(f\mid\theta_{R},\eta)\mid\theta_{1},\chi),\\ b_{2}=B(\text{Cap}(f\mid\theta_{C},\theta)\mid\theta_{2},\chi)\end{array} \right. \tag{6}\]  
The parameters in Equation (6) are the further reduced dimensionality feature matrix of the extracted features of the residual network and the capsule network. Since the sample sizes of the datasets used by this algorithm are all high, the dimension of the feature maps extracted by this algorithm is still high. The feature graph further learns from an additional convolution structure, and private network parameters that are two parallel convolutional modules are the shared network parameters. It can be seen from Equation (5) that the algorithm superimposed the features extracted by the different models onto the other in the third dimension. For a single trainer, the ultimate goal is to perform image classification, and this article adopts the loss of cross-entropy for the loss function of the classification of the data set in the image classification task, as shown in Equation (7). This loss function can effectively measure the difference between the model-predicted probability distribution and the true probability distribution, and is especially suitable for dealing with unbalanced sample problems. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters/Symbols** & **Meaning** \\ \hline disciplinarian & In this article, all participants who participated in the training were referred to under the framework of the AFLI algorithm \\ \(f\) & Input to both the capsule network and the residual network \\ \(\theta_{R}\) & Shared parameters of the residual network module for each trainer \\ \(\theta_{C}\) & Shared parameters of the capsule network module of each trainer \\ \(\eta,\theta\) & Private parameters of the residual network module and the capsule network module, respectively \\ \(R(f|\theta_{R},\eta)\) & Formal representation of the residual network \\ \(Cap(f|\theta_{C},\theta)\) & Formal representation of the capsule network \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Meanings of parameters and symbols. \[\left\{ \begin{array}{l}\text{loss }=\sum_{k=0}^{B}\sum_{l=0}^{L}-1\times p_{k,l} \times\log(p_{k,l}),\\ 0\leq p_{k,l}\leq 1,\forall p_{k,l}\end{array} \right. \tag{7}\]  
Here, \(B\) represents the number of samples used for the current training batch, \(L\) represents the number of labels, and the parameter is the probability that sample \(k\) is classified as \(l\) in the soft-max layer. In order to better independently update and transfer the parameters between the trainers following an independent parameter update, as shown in Figure 2, for every fixed step, the local trainers will communicate with the global trainer and upload a gradient. At the same time, the global-trainer-to-local-trainer parameters will be broadcast to local trainers so they can obtain and upload parameters. The specific process is shown in Equation (8). Figure 2: Network structure of each participant. \[\left\{