# Hierarchical Federated Learning for Edge-Aided Unmanned Aerial Vehicle Networks
## 3 Hierarchical FL Algorithm
We use similar settings to Scenario II, while increasing the number of users from FEMNIST dataset to 3500. In addition, for the purpose of performance comparison, we report the accuracy of the model in every \(k_{1}k_{2}\) times. For the MNIST dataset in Scenario I, we construct a convolutional neural network (CNN) with four layers: the first two convolutional layers using 10 and 20 filters, respectively, with a kernel size of 5, followed by two fully connected layers with 50 and 10 units, respectively. The FEMNIST dataset in Scenario II is evaluated using a similar CNN: two convolutional layers using 32 and 64 filters with a kernel size of 5 and two fully connected layers with 1024 and 62 units. At each UAV, the stochastic gradient descent is used to update the local models, where the batch size is set to 32, and the learning rate is set to 0.01 with exponential weight decay of 0.995 after every step of the global aggregation. ### Evaluation Metrics

We split the data of each user into 90% training and 10% test sets, and report the results on the test set. In order to evaluate the performance of the model, we measure the top-1 accuracy of all users and average them to obtain the average test accuracy of the whole network. Since the average accuracy might not take poorly performing users into account, we also measure what percentage of users are achieving the desired target accuracy threshold. This allows to better understand the fairness of the model in non-i.i.d. scenarios, where the underlying data distribution can heavily affect the accuracy of the global model in a particular user. We set the target accuracy threshold to 98% and 80% for Scenario I and Scenario II, respectively. ### Experimental Results

Figure 3 shows a performance comparison between the proposed hierarchical FL algorithm and other existing FL algorithms, such as FedAvg [5], HierFAVG [22], and HFEL [23] for Scenario I. In this figure, we set \(k_{1}\) to 10 and \(C\) to 0.2. The naive FL algorithm in [5] performs worst and even achieves low accuracy (below 70% in terms of average accuracy after 50 rounds). Although another FL algorithm developed in [22; 23] performs better than that of [5], it still fails to achieve the desired accuracy level (e.g., above 98%) for the case with the label distribution skew. On the other hand, the proposed hierarchical FL algorithm not only achieves the highest accuracy (98.3% average test accuracy across the UAVs), but also converges very fast and stably (fewer than 20 iterations of the global aggregation). Experiments conducted with the FEMNIST in Scenario II also demonstrate a similar trend as shown in Figure 4, where the proposed hierarchical FL algorithm still significantly outperforms the other FL algorithms. In Table 1, we compare the percentage of UAVs that achieve the target accuracy of 98% in both Scenarios I and II. From Table 1, it can be seen that the proposed hierarchical FL algorithm considerably outperforms the others in both scenarios. Specifically, in Scenario I, the proposed hierarchical FL algorithm has 66% of the UAVs reaching the target accuracy level, higher than those of the FL algorithms in [22; 23], more than two times. Note that the naive FL algorithm in [5] only has 6% of UAVs above 98% accuracy, which is very low. Experiments for Scenario II also show the clear advantage of the proposed hierarchical

Figure 4: Performance comparisons of the various FL algorithms for Scenario II. Figure 3: Test accuracy of the various FL algorithms over communication rounds for Scenario I.

FL algorithm over the other FL algorithms. Specifically, we can see the performance gain around 10% compared to [22; 23], and it is almost 10 times better compared to [5]. The performance gain is even greater for the case with label distribution skew. The trend continues in Scenario III, where the proposed algorithm performs even better in both of the metrics compared to other schemes.