# FLaMAS: Federated Learning Based on a SPADE [PERSON]
###### Abstract  
In recent years federated learning has emerged as a new paradigm for training machine learning models oriented to distributed systems. The main idea is that each node of a distributed system independently trains a model and shares only model parameters, such as weights, and does not share the training data set, which favors aspects such as security and privacy. Subsequently, and in a centralized way, a collective model is built that gathers all the information provided by all of the participating nodes. Several federated learning framework proposals have been developed that seek to optimize any aspect of the learning process. However, a lack of flexibility and dynamism is evident in many cases. In this regard, this study aims to provide flexibility and dynamism to the federated learning process. The methodology used consists of designing a multi-agent system that can form a federated learning framework where the agents act as nodes that can be easily added to the system dynamically. The proposal has been evaluated with different experiments on the SPADE platform; the results obtained demonstrate the benefits of the federated system while facilitating flexibility and scalability.  
artificial intelligence; federated learning; multi-agent systems; agent platforms; edge computing +
Footnote †: journal: Applied Sciences  
parameters. Usually, a central node will adequately aggregate the different parameters to obtain a single global model.  
Many proposals based on the federated learning paradigm have appeared in recent years. In the literature, there have been several surveys that discuss possible open challenges in the area, such as those presented in [7; 8; 9]. Among the different problems that are still open, current proposals often raise issues of flexibility and dynamism in large-scale IoT systems. Recognizing this, the main objective of this study was to demonstrate how multi-agent system (MAS) technology can be exploited to improve necessary data exchange and the aggregation process in a federated learning system [10] by improving its flexibility and dynamism.  
To achieve the proposed objective, we present the development of a multi-agent approach that gives support to a federated learning framework. This framework allows agents to perform training tasks locally and transfer only the trained model to a server agent in charge of generating the global model and sharing it with the rest of the agents. In addition, the agents in charge of training can enter or leave the system dynamically, which allows for a completely open system. Thus, the contributions of this investigation are the following: (i) design of a framework for federated learning based on multi-agent systems; (ii) development of the proposed framework on the SPADE [11] (Smart Python Agent Development Environment) multi-agent systems platform; and (iii) development of the necessary experiments to demonstrate the feasibility of the proposed development.  
The results obtained confirm how the proposed framework makes it possible to have an open multi-agent system where agents in charge of training can enter or leave the system without affecting the overall performance of the federated learning process. This results in greater flexibility and dynamism of the system. Moreover, the experiments undertaken showed that the proposed framework achieved higher accuracy in a shorter time and with a smaller number of epochs than a centralized solution.  
The rest of the paper is structured as follows. Section 2 discusses several related previous studies; Section 3 describes in detail the federated learning framework based on the SPADE platform; Section 4 presents several experiments and the results obtained; and, finally, Section 5 discusses some conclusions and future research.