## 4 K-Anonymity-Based SHFL
### Secure Hierarchical Distributed Architecture
#### 4.1.2 K-Anonymity-Based Regrouping of Anonymous Clusters of SHFL
### Convergence

To explore the convergence behaviors of the proposed SHFL framework, we considered two scenarios of the number of LCs as \(\{10,15\}\) and four scenarios of the number of ILCs as \(\{2,5,8,10\}\), and tested the accuracy and loss on the MNIST and CIFAR-10 datasets. Each LC and ILC were assigned an equal-sized random subset of the training data. We continuously re-divided the dataset into equal parts to train the local model of all devices. We simulated these experiments for 300 and 500 communication rounds on MNIST and CIFAR-10, respectively, to investigate the trends of accuracy and loss of the distributed FL. Each client's LBS was altered by randomly swapping out eight labels depending on the cluster to which the client belonged, to maintain the anonymity of the LC and ILC structures. If all clients are part of the first cluster, the data points labeled \"1\" and \"7\" might be switched. Similarly, for the clients in the second cluster, the data points labeled \"3\" and \"5\" will be switched, and so on. In Figure 3, we present a realistic picture of the proposed SHFL, which shows the hierarchical architecture for multiple levels of LCs and ILCs. Figure 4 shows the simulation results of the four configuration settings of the LC and ILC in terms of accuracy and loss for the communication rounds on the MNIST dataset. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **MNIST** & **CIFAR-10** & **COVID-19** \\ \hline Parameter & & Values & \\ \hline Model & CNN & CNN & AlexNet \\ \hline Momentum & 0.5 & 0.3 & 0.1 \\ \hline Optimizer & SGD & SGD & SGD \\ \hline Batch size & 10 & 20 & 30 \\ \hline Learning rate & 0.25 & 0.5 & 0.5 \\ \hline Clients & 500 & 200 & 200 \\ \hline Client transmission power & 200 mW & 200 mW & 200 mW \\ \hline Communication rounds & 300 & 500 & 200 \\ \hline Local epochs & 200 & 200 & 100 \\ \hline Local update size & 20,000 nats & 20,000 nats & 20,000 nats \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Hyperparameters used in the proposed experiments. Figure 3: Network topologies for distributed federated learning of SHFL; the hierarchical architecture for multiple levels of LC and ILC is shown. The proposed model performs well in terms of high accuracy rate and low loss in the case of a less complicated network architecture with a limited clustering formulation size. This is because the network nodes grow with the number of clusters and the cluster size increases proportionally. In this regard, the proposed SHFL provides higher network scalability and higher accuracy rate with increasing network communication rounds. In Figure 4a, the network topology of 10 LCs and 2 ILCs results in 55% accuracy in only 300 communication rounds; furthermore, 15 LCs and 10 ILCs produce 85% accuracy. Similarly, in Figure 4b, the network topology of 10 LC, 2 ILC shows a higher loss, as a greater number of ILCs requires more computational resources. In the case of 10 LC, 2 ILC, the graph shows the minimum loss, which increases with increasing numbers of LCs and ILCs. The experimental results for the CIFAR-10 dataset are shown in Figure 5. In Figure 5a, we present the training accuracy, and in Figure 5b, we present the training loss of SHFL in 500 communication rounds. To provide a better comparison, we considered the same scenarios as for the MNIST dataset. The remaining parameters were the same as those described in Table 2. Figure 5a shows higher accuracy for higher numbers of LCs and ILCs; the accuracy decreases with decreasing numbers of LCs and ILCs. We attribute this performance gain to the hierarchical architecture of SHFL, which divides the computational resources equally among the clients. Furthermore, the degree of K-anonymity helps secure the maximum accuracy. Similarly, Figure 5b shows the minimum expected loss for the scenario of 10 LCs and 2 ILCs. As described above, a higher number of LCs and ILCs requires greater computational resources. Therefore, we can say that the optimal number of LCs and ILCs is between \(\approx 12\) and \(\approx 7\).