## 6 Use Case: Privacy Identity Management Enrollment
### Machine Learning
#### 6.5.2 Secure Federated Aggregation  
In this section, we present the developed components for performing Federated Learning (FL) in our application. The FL framework comprises two main subcomponents: the aggregation server and the client application. The aggregation server, developed by our team, is responsible for model aggregation. The client application can be any endpoint in any application, but for demonstration purposes, we have developed a demo client app.  
During the development process and based on feedback from end-users and developers, we identified a significant challenge related to data availability in Federated Learning. The issue arises because data is stored locally in the devices' local storage. Consequently, if a user changes or loses their device, their data will be lost forever without any possibility of retrieval. Furthermore, in our case, children did not have their own devices (tablets) but used a shared clinician's tablet. This shared usage exacerbates the data availability problem. To mitigate this deployment threat, we designed our system to store the data on a central server while protecting it using AES-256 cryptography. This approach ensures that users can grant access to their data to authorized users, maintaining both availability and security.  
The Federated Learning architecture involves several key actors and processes. Figure 5 illustrates the overall flow of our FL component.  
The main actors/components of the FL approach are the following:  
* **Shared Device:** This is the endpoint where data is generated and initially processed. In our demonstration, this is a shared tablet used by children under clinician supervision.
* **Secure Data Storage:** This database collects encrypted user data and stores it to address the data availability problem.
* **Web Clients:** The clinicians can access the data of the children they monitor (if their parents have granted permission) and train a local machine learning model.
* **Aggregation Server:** The central server that receives model updates from web clients, aggregates these updates, and improves the global model.  
The main activities that are essential for performing the federated aggregation process are as follows:  
* **Data Generation and Secure Storage:** Children generate data through their interaction with the game, and the generated data (game scores) is encrypted and sent to secure storage.  
Figure 5: FL general architecture.  
* **Model Update Process:** Each clinician accesses the data that they have been granted permission to train a local model on and periodically sends the model updates (not the raw data) to the aggregation server.
* **Aggregation Process:** The aggregation server collects the model updates from multiple client devices, aggregates these updates to form a new global model, and sends the updated global model back to the client devices.  
The flow begins with client devices training their local models using the data available to them. Once the local training is completed, the clients send the model updates to the aggregation server. The aggregation server then aggregates these updates to refine the global model. This updated global model is subsequently sent back to the clients, who use it as the new starting point for further local training. This iterative process continues, enhancing the model's accuracy without compromising data privacy.