# Edge Federated Optimization for Heterogeneous Data
## 5 Experimental Results
### Experimental Environment  
To construct the federated learning environment, we combined a local PC and two ReComputer Jetson Nano J1010 devices from NVIDIA Corporate, Santa Clara, CA, USA. The local PC is used to create a virtual machine (VM) for controlling and coordinating the entire system's operation. The hardware configuration includes an Intel(R) Core (TM) i9-10900 KF CPU @ 3.70 GHz, 128 GB RAM, and a Nvidia RTX 3080 graphics card. The embedded device, the ReComputer Jetson Nano J1010 device, is equipped with a quad-core ARM(r) Cortex(r)-A57 MPCore processor designed for edge computing to support efficient data processing and machine learning tasks at the device's edge. Due to the requirements of the Flower development environment, we configured a PyTorch software environment compatible with Python 3.8 on this device. Note that, due to the support limitations of Nvidia JetPack 4.6.1, Python versions above 3.6 are not supported for GPU acceleration. Therefore, in our experimental setup, although the Jetson Nano device has GPU computing capabilities, we could only utilize the CPU for computations in this environment.  
Figure 6 shows the federated learning architecture employed in this experiment, which includes a central server and two clients. Communication between each client and the server is facilitated through gRPC [54], which is a high-performance, open-source, and general-purpose RPC framework led by Google, allowing for remote procedure calls. The following are the steps in the operation process:  
1. Server: On the server side, we have deployed the FedProx algorithm, which is a federated learning algorithm designed to handle heterogeneous data distributions from different clients. The primary responsibility of the server is to coordinate the entire learning process, including receiving model updates from clients, aggregating them, and distributing the updated global model back to the clients.
2. Client 1 and Client 2: Each client (such as Client 1 and Client 2 in Figure 6) has its own dataset for local model training. Clients utilize their hardware to perform local computations. Once a client completes local model training, it sends model updates back to the server via gRPC.  
Model Update and Aggregation:  
As the server receives updates and performs aggregation, the global model gradually evolves. The aggregated model is then redistributed to all clients, which subsequently commence the next round of local training using the new parameters. This iterative learning cycle enhances the model's generalization capabilities and enables it to better handle data from different sources.  
To evaluate the system performance, a baseline algorithm (i.e., the FedAvg) and the proposed FedProx algorithm are examined with the following model optimization strategies for Clients 1 and 2:  
* Strategy 1: Both Client 1 and Client 2 have an initial configuration.
* Strategy 2: Client 1 (Frozen layer); Client 2 (Initial configuration)
* Strategy 3: Both Client 1 and Client 2 are Frozen layer.
* Strategy 4: Client 1 (Frozen layer with unstructured pruning); Client 2 (Initial configuration with unstructured pruning)
* Strategy 5: Client 1 (Frozen layer with structured pruning); Client 2 (Initial configuration with structured pruning)