# A Federated Incremental Learning Algorithm Based on Dual Attention Mechanism Mechanism
## 3 Federated Incremental Learning Algorithm  
In addition to data privacy protection in FL, dealing with the dynamic changes in training tasks is also essential to research content. For example, in recommender systems, user data will be updated dynamically. The traditional training model is in the face of new tasks and data. Retraining all the old and new data will cost much training. Therefore, whether the user data can be dynamically updated has become the key to measuring the pros and cons of an algorithm. We need a federated learning algorithm that can cope with the dynamic changes in training tasks and keep the data confidential. In FL, scholars have found that large-sample client weight parameters are large and have a significant impact on the final model training. The imbalance of importance, and the problem that the importance of features is difficult to capture. This paper introduces a dual attention mechanism in the federated incremental learning framework. We hope to reduce the impact of considerable sample client data noise on the global model, improve the ability of the global model to capture essential client features, and achieve more excellent business value. The idea of this algorithm is as follows:  
(1) As traditional federated learning can only be trained in a batch setting and needs to be retrained in the face of new tasks and data, more flexible strategies are required to handle large-scale and dynamic real-world object classification situations. This paper proposes a federated incremental learning framework that can cope with the dynamic changes in training tasks and keep the data confidential. We combine the care strategy with a federated learning framework, and dynamically classify samples based on the nearest mean rule to handle resource increases without retraining dynamically. Therefore, the framework can reduce the cost of data storage and model retraining when adding classes, and also reduce the risk of data leakage due to model gradient updates.  
(2) Aiming at the problem of sample imbalance in each client, the client with a large sample size greatly significatlueunces the final model training result. On the federatedincremental learning framework, this paper designs a channel attention neural network model on the client-side and uses it as a local model for federated learning. This model adds the SE module based on the classical graph convolutional neural network, which can help the model to obtain the importance of the features of the respective overall samples of each client during model training and can effectively reduce the influence of noise.  
(3) For traditional federated learning, the initial parameters of the global model are randomized, and the initial randomized parameters will affect the convergence speed of the global model. A pre-training module is added to the federated incremental learning framework, and the same number of samples are extracted from each client as pre-training data. The federated averaging model is used for training to obtain a global model on the server, which can speed up the model convergence. In addition, extracting the same number of samples from each client can ensure the balance of pre-training samples, to the impact of large sample clients on the global model.  
(4) The federated learning design aims to jointly train a high-quality global model for the client. Still, when the client data is unbalanced, the significant sample client weight parameter significantly impacts the final model training result. On the federated incremental learning framework, this paper designs a federated aggregation algorithm based on the feature attention mechanism in the global model to provide appropriate attention weights for each local model. This weight corresponds to the model parameters of each layer of the neural network, and the attention weight value is used as the aggregation coefficient, which can enhance the capture performance of the global model for key feature information.