# Federated Learning for Edge Computing: A Survey
## 3 Federated Learning
### Architectures  
There are two significant types of architecture in FL: centralized and decentralized. FL [45], based on a centralized aggregation of local learning models for different IoT applications, is often considered. In this case, each device trains its local model on its private data. These updated local models are then sent to a central aggregation server. The central aggregation server is responsible for computing the global FL model. Figure 3 (Centralized) shows an example of FL architecture with a server to which clients are connected. This central server then aggregates this information for model updating purposes. Adversaries can still obtain some original data information, even if the data holders only make their abstract aggregated information available to others. The centralized server can be located at the network's edge or in the cloud so that clients can connect and communicate with it. The article [47] describes the training and creation of a global model in IoT, which is based on a centralized server. The devices Raspberry Pi single-board computers we used. The training aimed to be able to detect IoT intrusions. To evaluate the effectiveness of the proposed approach, the authors conducted rigorous experiments on the NSL-KDD dataset. Figure 3: Architecture design of centralized FL vs. decentralized FL [46]. At the same time, the article compares FL training with a centralized server and centralized training, where the data is stored on a single computing machine. Centralized learning is so far defined as the most accurate. However, it has its disadvantages in terms of privacy and security. The results of several experiments demonstrate that FL with a centralized server is close in terms of performance and reliability to the results with the central approach of the methods used today as training models on a single machine. On the other hand, the choice of clients in FL significantly impacts the system's performance. Equipment failure during the process, long response time for uploading and updating models, and clients with less relevant data can limit and drastically reduce the accuracy of the global model. Very similar research has been conducted in paper [48], where authors focused on several ML methods such as decision tree (DT), random forest (RF), support vector machine (SVM), and k-Nearest Neighbor (k-NN), as well as the top-rated deep neural network (DNN). This paper aimed to evaluate the accuracy of the models using FL with a central server and centralized learning for cyber-attack detection in IoT and IIoT sectors. All these measurements and experiments are then re-evaluated with similar results for all ML methods. Although a centralized design is commonly used in existing studies, a decentralized design is preferred in some aspects because concentrating information on a single server may pose a risk. While the centralized design is easier to implement, new studies are starting to emerge where the decentralized FL design is used. However, the security of FL is increasingly being questioned due to constant attacks on the global model or user privacy data by malicious clients or central servers. New ways to prevent data leakage to third parties are constantly being explored to protect the data. Researchers have proposed several data privacy protection schemes within distributed ML architectures to avoid privacy leakage. Secure multi-party computation is a common approach. Each party or client uses ML techniques to build a local model on its private data. Because of this, FL is continuously improved and updated with new technological advances [46]. Three decentralized projects are available: peer-to-peer (P2P), graph, and blockchain. In P2P designed FL, the parties are equally privileged and treated equally [49]. The paper [50] discusses the design of a novel P2P algorithm for training machine learning models to detect non-IID anomalies, including mechanisms to locally rebalance training datasets by synthetically generating data points from a minority class.