# Wireless Traffic Prediction Based on a Gradient Similarity Federated Aggregation Algorithm
## 2 Related Work
### Federated Learning  
Federated Learning (FL), first proposed by Google in 2016, provides a collaborative training architecture based on deep learning. FL is a distributed learning framework in which raw data is collected and stored on multiple edge clients, and model training is locally performed on the clients, and then the models are progressively optimized to learn the models through client interaction with a central server. Its classical architecture diagram is shown in Figure 1.  
As shown in Figure 1, the global model is initialized by the client application and trained based on local data, and the local model is obtained after the local training is completed, and its parameters or gradient information is uploaded to the central server, which aggregates the local client model based on the aggregation algorithm to generate a new global model, and then sends the new round of global models to each edge client again to iterate the above process until the final global model is obtained.  
It is shown that the performance of federated learning is similar to that of centralized learning when the client data have Independent Identically Distributed (IID) characteristics. However, when the multi-client data are Non-IID, the performance of the federation learning algorithm is significantly reduced. Therefore, solving the problem of statistical heterogeneity of data is an urgent prerequisite to be addressed before deploying federated learning algorithms. To address this issue, a data-sharing strategy is proposed in the literature [5] for creating a globally shared data subset to integrate the local data features of the participating training clients to overcome the data heterogeneity challenge faced by FL. In addition, how to aggregate each client model to the global model while ensuring its  
Figure 1: Classic architecture of federated learning.  
generalization capability is a critical issue in federation learning. FedAvg is currently the mainstream federation aggregation scheme, the core idea of which is to weight the average of each local model participating in the aggregation according to the ratio of the amount of data each client has to the total training data, and its process can be described as:  
Assuming \(K\) clients participate in federation training, each client has multiple training data volumes \(n_{k}\) and local model weights \(w_{k}^{t+1}\) in the (\(t+1\))st global iteration, and the FedAvg aggregation approach can be expressed as Equation (1):  
\[w_{G}^{t+1}=\sum\limits_{k=1}^{K}\frac{n_{k}}{n}w_{k}^{t+1} \tag{1}\]  
where \(w_{G}^{t+1}\) is the global model parameters after the \(t+1\) st communication aggregation, \(n\) denotes the total amount of data for \(K\) clients and \(\sum\limits_{k=1}^{K}n_{k}=n\), and \(w\) denotes the parameters of the local model of the \(k\)th client at \(t+1\) communication rounds.  
However, in the federation learning aggregation process, FedAvg's aggregation approach by averaging the model parameters or gradients across clients is difficult to guarantee the generalization ability of the global model generated by the final aggregation, in addition to the fact that federation learning cannot observe the amount of data from the clients of edge computing nodes. Therefore, the aggregation weight assignment using the actual data volume is difficult to achieve, and the quantity of data does not represent the quality of data. To address this problem, this paper proposes a federated aggregation scheme based on gradient similarity, which considers the similarity of gradient information among individual clients and performs two-level aggregation of client models based on similarity knowledge. The simulation experiments show that the scheme can achieve better results.