The methodology was evaluated using Python, leveraging li-braries such as TensorFlow and PyTorch for Graph Convolutional Networks (GCNs), Graph Attention Networks (GATs), Generative Adversarial Networks (GANs), and Deep Reinforcement Learning (DRL). Common clustering tasks were performed using Scikit-learn, while OpenAI Gym provided the Proximal Policy Optimization (PPO) envfigureironment. Data processing and visualization were achieved using NumPy, Pandas, Matplotlib, and Seaborn. Experiments were con-ducted on a high-end system equipped with an Intel i7 CPU, an NVIDIA GTX 1660 GPU, and 16GB RAM.
For comparison purposes, two representative baseline methods, namely ROFL and BFL, are considered in the experimental evaluation. ROFL follows a resource-oriented federated learning strategy, where client participation and coordination are guided by system-level constraints without adaptive clustering or learning-based assignment. BFL represents a basic federated learning setup with static client selection and synchronous aggregation. To ensure fairness and reproducibility, all baseline methods use the same datasets, model architectures, number of clients, communication rounds, and training configurations as the proposed approach, differing only in their coordination and client management mechanisms.
Comparison with baselines
A comparison study was conducted against two baseline methods:
-
Resource Optimizing Federated Learning (ROFL): This baseline employs static clustering methods like KMeans and heuristic algorithms such as Genetic Al-gorithms (GA) and Particle Swarm Optimization (PSO) for resource allocation. However, ROFL lacks dynamic clustering capabilities and fails to address data imbal-ance, relying solely on synchronous FedAvg for model aggregation7.
-
Blockchain-Based Federated Learning with Device Clustering (BFL): BFL utilizes label similarity-based clustering and blockchain for secure communications. However, it suffers from poor performance in address-ing data imbalance and resource heterogeneity. Further-more, its synchronous FedAvg approach leads to com-munication delays and inefficient resource utilization48.

Semi-synchronous federated learning workflow
Proposed method enhancements
The proposed approach extends these works by incorporating the following improvements:
-
1)
Adaptive Device Clustering with GCNs/GATs: Un-like the static clustering methods in ROFL and BFL, the proposed approach uses Graph Convolutional Net-works (GCNs) and Graph Attention Networks (GATs) to enable adaptive and context-aware device clustering. This improves resource allocation and reduces commu-nication overhead7,48.
-
2)
Dynamic Device Assignment with DRL-PPO: A Deep Reinforcement Learning-based PPO agent dy-namically assigns devices to edge servers based on real-time metrics. This significantly enhances resource utilization compared to the static or heuristic methods used in ROFL and BFL7.
-
3)
GAN-Based Data Augmentation: To address data imbalance, GANs generate synthetic data that improve the accuracy of local models. This approach outper-forms the static label balancing technique employed in BFL48.
-
4)
Semi-Synchronous Federated Learning: The pro-posed framework combines FedProx for local train-ing with periodic asynchronous updates and FedAvg for global aggregation. This hybrid approach balances model consistency and convergence speed while avoiding the bottlenecks associated with synchronous up-dates in ROFL and BFL7,48.
These enhancements collectively address the limitations of existing baselines and optimize federated learning performance in terms of resource allocation, communication efficiency, data balance, and convergence speed.
Silhouette score
1)Purpose.
Measures how similar an object is to its own cluster com-pared to other clusters, indicating the quality of clustering.
2) Mathematical Formulation For each data point I in (14), (15), (16):
|Ci|
$$\:a\left(i\right)=\frac{1}{\mid\:{\mathcal{C}}_{i}\mid\:-1}\sum\:_{\begin{array}{c}j\in\:{\mathcal{C}}_{i}\\\:j\ne\:i\end{array}}d(i,j)$$
(14)
$$\:b\left(i\right)=\underset{k\ne\:i}{\text{m}\text{i}\text{n}}\left(\frac{1}{\mid\:{\mathcal{C}}_{k}\mid\:}\sum\:_{j\in\:{\mathcal{C}}_{k}}(di,j))\right)$$
(15)
$$\:s\left(i\right)=\frac{b\left(i\right)-a\left(i\right)}{\text{max}\left\{a\left(i\right),\text{\hspace{0.17em}}b\left(i\right)\right\}}$$
(16)
The overall Silhouette Score for the dataset is (17):
$$\:\text{Silhouette\:Score}=\frac{1}{N}\sum\:_{i=1}^{N}s\left(i\right)$$
(17)
where N is the total number of data points.
3) Interpretation.
-
s(i) ranges from − 1 to + 1.
-
s(i) ≈ + 1: Data point is well-clustered.
-
s(i) ≈ 0: Data point lies between clusters.
-
s(i) ≈ − 1: Data point may have been assigned to the wrong cluster.
Clustering time
1) Purpose.
Measures the computational time required to perform the clustering algorithm.
2) Mathematical Formulation in Eq. (18)
$$\:T={t}_{\text{end}}-{t}_{\text{start}}$$
(18)
where:
-
T: Total clustering time.
-
tend: Time when clustering completes.
-
tstart: Time when clustering starts.
3) Interpretation.
i Index of a specific data point.
a(i) Average distance between data point i and all other points in the same cluster.
b(i) Minimum average distance between data point i and points in the nearest neighboring cluster.
s(i) Silhouette score for data point i.
Davies-bouldin index (DBI)
1) Purpose.
Evaluates the average similarity ratio of each cluster with its most similar cluster, considering intra-cluster and inter-cluster distances.
2) Mathematical Formulation For each cluster I in (19) and (20):
$$\:{R}_{ij}=\frac{{S}_{i}+{S}_{j}}{d\left({\varvec{\mu\:}}_{i},{\varvec{\mu\:}}_{j}\right)}$$
(19)
$$\:{R}_{i}=\underset{j\ne\:i}{\text{max}{R}_{ij}}$$
(20)
The Davies-Bouldin Index is Eq. (21):
$$\:\text{DBI}=\frac{1}{K}\sum\:_{i=1}^{K}{R}_{i}$$
(21)
where:
3) Interpretation.
Data distribution fairness
1) Purpose.
Assesses how evenly data is distributed across devices or clusters, ensuring no device is disproportionately burdened Table 4.
2) Mathematical Formulation in (22), (23) and (24)
$$\:{\mu\:}_{l}=\frac{1}{V}\sum\:_{i=1}^{V}{l}_{i}$$
(22)
$$\:{\sigma\:}_{l}=\sqrt{\frac{1}{V}\sum\:_{i=1}^{V}{\left({l}_{i}-{\mu\:}_{l}\right)}^{2}}$$
(23)
$$\:{\text{CV}}_{l}=\frac{{\sigma\:}_{l}}{{\mu\:}_{l}}$$
(24)
where:
-
n: Number of devices.
-
di: Data size assigned to device i.
-
µ: Mean data distribution across devices.
-
σ: Standard deviation of data distribution.
3) Interpretation.
Communication overhead
1) Purpose.
Quantifies the additional data transmitted due to the method, such as synchronization messages, model updates, or coordi-nation data.
2) Mathematical Formulation (25)
$$\:C=\sum\:_{t=1}^{T}\sum\:_{i=1}^{N}{c}_{i,t}$$
(25)
where:
-
C: Total communication overhead.
-
T: Total number of communication rounds.
-
n: Number of devices.
-
ci, t: Communication cost for device i at round t.
3) Interpretation.
Redistribution time
1) Purpose.
Measures the time taken to redistribute data or tasks among devices or clusters after the initial assignment.
2) Mathematical Formulation in (26)
$$\:{T}_{r}={t}_{\text{end}}^{\text{redistribution}}-{t}_{\text{start}}^{\text{redistribution}}$$
(26)
where:
-
Tr: Total redistribution time.
-
tend_redistribution: Time when redistribution completes.
-
tstart_redistribution: Time when redistribution starts.
3) Interpretation.
-
Shorter Tr enhances overall system efficiency, espe-cially in dynamic environments.
-
Longer Tr may lead to delays and reduced responsive-ness in the system.
Resource utilization
1) Purpose
Evaluates how effectively computational resources (CPU, GPU, memory) are utilized across devices.
2) Mathematical Formulation in (27) and (28)
$$\:{U}_{j,r}=\frac{{\text{UsedResource}}_{j,r}}{{\text{TotalResource}}_{j,r}}$$
(27)
$$\:{U}_{r}=\frac{1}{J}\sum\:_{j=1}^{J}{U}_{j,r}$$
(28)
where:
-
Uj, r: Resource utilization for device j and resource r.
-
Ur: Average resource utilization for resource r.
-
n: Number of devices.
3) Interpretation.
-
Higher average utilization indicates efficient use of re-sources.
-
Excessively high values may lead to bottlenecks, over-heating, or reduced performance.
-
Lower values suggest underutilization of available re-sources.
Latency
1) Purpose.
Measures the time delay experienced in the system, such as data transmission or processing delays.
2) Mathematical Formulation in (29)
$$\:L={L}_{\text{transmission}}+{L}_{\text{processing}}+{L}_{\text{queueing}}$$
(29)
where:
-
L: Total latency.
-
Ltransmission: Latency due to data transmission.
-
Lprocessing: Latency due to data processing.
-
Lqueueing: Latency due to data waiting in queues.
3) Interpretation.
-
Lower latency is desirable for real-time applications and overall system responsiveness.
-
Higher latency can degrade user experience and system performance, especially in time-sensitive tasks.
Load balance
1) Purpose.
Assesses how evenly the computational or data load is dis-tributed among devices or servers.
2) Mathematical Formulation in (30), (31) and (32)
$$\:{\mu\:}_{l}=\frac{1}{V}\sum\:_{i=1}^{V}{l}_{i}$$
(30)
$$\:{\sigma\:}_{l}=\sqrt{\frac{1}{V}\sum\:_{i=1}^{V}{\left({l}_{i}-{\mu\:}_{l}\right)}^{2}}$$
(31)
$$\:{\text{CV}}_{l}=\frac{{\sigma\:}_{l}}{{\mu\:}_{l}}$$
(32)
where:
-
µl: Mean load across devices.
-
σl: Standard deviation of load across devices.
-
CVl: Coefficient of Variation for load balance.
-
n: Number of devices.
-
li: Load assigned to device i.
3) Interpretation.
Global model accuracy
1) Purpose.
Evaluates the performance of the federated learning model across all devices on a global test dataset.
2) Mathematical Formulation.
A = T × 100%.
where:
-
A: Global model accuracy percentage.
-
C: Number of correct predictions.
-
T: Total number of predictions.
3) Interpretation.
-
Higher accuracy signifies better model performance and generalization across different datasets.
-
Lower accuracy indicates potential issues with model training, data distribution, or algorithm efficacy.
Training time per round
1) Purpose.
Measures the duration of each training iteration or round in the federated learning process.
2) Mathematical Formulation in Eq. (33)
$$\:{T}_{\text{train},t}={t}_{\text{end},t}^{\text{train}}-{t}_{\text{start},t}^{\text{train}}$$
(33)
where:
-
Ttrain, t: Training time for round t.
-
tend_train, t: Time when training completes for round t.
-
tstart_train, t: Time when training starts for round t.
3) Interpretation.
Staleness of updates
1) Purpose.
Quantifies the delay or lag in the model updates contributed by devices, which can affect convergence and accuracy.
2) Mathematical Formulation.
For each update u from device j in (34) and (35):
$$\:{S}_{u}={t}_{\text{current}}-{t}_{u}$$
(34)
$$\:S=\frac{1}{m}\sum\:_{u=1}^{m}{S}_{u}$$
(35)
where:
-
m: Total number of updates.
-
tcurrent_round: Timestamp of the current round.
-
tu: Timestamp when update u was generated.
3) Interpretation.
-
Lower staleness values indicate more timely updates, enhancing model convergence and accuracy.
-
Higher staleness can lead to outdated updates, poten-tially degrading model performance and slowing con-vergence.
The scalability of the proposed framework is supported by its hierarchical and distributed design. The computational complexity is mainly driven by local model training, which scales as \(\:O(N\cdot\:D\cdot\:P)\) where N is the number of devices, D is the local dataset size, and P is the number of model parameters. In contrast, the GNN embedding process scales with the graph structure and remains manageable due to sparse connectivity, while K-means clustering operates on compact embeddings. Additionally, the PPO-based scheduling is executed at the edge level, significantly reducing its complexity in large-scale deployments. Therefore, the framework can be extended to thousands of devices by leveraging parallelism across edge servers.
D. Ablation Study.
To analyze the individual contribution of each module, an ablation study is conducted by selectively disabling key components of the proposed framework. Table 5 summarizes the impact of removing each module on accuracy, clustering quality, and latency, clearly highlighting their respective roles in overall performance improvement.

Davies-bouldin index for MNIST dataset.
As reported in Table 6, the proposed clustering approach consistently achieves favorable clustering quality across all datasets, as indicated by higher Silhouette scores and lower Davies–Bouldin Index (DBI) values. While the clustering time increases for more complex datasets such as CIFAR-10, the results demonstrate an effective balance between clustering accuracy and computational efficiency.

Silhouette score for MNIST dataset.
Figure 4: The Davies-Bouldin Index (DBI) evaluates the quality of clusters produced by different clustering tech-niques on the MNIST dataset. Lower DBI values indicate better cluster separation and compactness. MNIST serves as a simple baseline to compare clustering methods, with lower DBI values suggesting more effective cluster creation in basic scenarios.
Figure 5: Silhouette Score on MNIST measures how well each method forms clusters. Since MNIST is simple, better scores here establish a baseline for comparing performance on more complex data, providing a foundation to understand baseline clustering performance before advancing to more complex scenarios.
Figure 6: The computational cost of clustering MNIST data is used as a reference. This helps understand how clustering techniques scale when applied to more challenging datasets like Fashion-MNIST or CIFAR-10 for long-term behavior forecasting.

Clustering time for MNIST dataset.

Global model accuracy over rounds for MNIST dataset.
Figure 7: Global accuracy during training rounds for the MNIST dataset using various federated learning methods. MNIST results serve as a baseline to compare more complex datasets, identifying strategies that converge quickly and es-tablishing a foundation for understanding complexity-related effects.
Figure 8: The plot depicts a bar graph of computational cost in clustering versus the number of devices on the x-axis for the Fashion-MNIST dataset. Each bar represents one clustering technique; the higher the bar, the greater the complexity and the better scalability and efficiency of techniques with more complex datasets.
Figure 9: compares the Davies-Bouldin Index for Fashion-MNIST. This experiment really tests the ability of clustering algorithms to deal with moderate complexity, ensuring that cluster quality remains high as data complexity incrementally rises from MNIST to CIFAR-10.
Figure 10: Clustering quality in terms of Silhouette Score for Fashion-MNIST dataset—compares the ability of differ-ent clustering methods to form good clusters. This figure provides a slightly harder test than MNIST, helping to determine which clustering methods still have high-quality clusters as data complexity rises.

Clustering time for fashion-MNIST dataset.

Davies-Bouldin Index for fashion-MNIST dataset.

Silhouette score for fashion-MNIST dataset.
Figure 11: This figure shows how global model accuracy changes over training rounds for different federated learning methods on Fashion-MNIST. Comparing these trends with MNIST and CIFAR-10 scenarios helps determine how strategies scale and whether moderate dataset complexity enables certain methods to excel in convergence speed and accuracy.

Global model accuracy over rounds for fashion-MNIST dataset.

Silhouette score for CIFAR-10 dataset.
Figure 12: shows the Silhouette Score on CIFAR-10, which tests how well the different clustering techniques actu-ally group devices into coherent and well-separated clusters. Higher scores indicate better-defined clusters. Since CIFAR-10 is a more complex scenario with much more intricate data distributions, this figure helps to determine which methods.
retain clustering quality in spite of added complexity.
Figure 13: measures the Davies-Bouldin Index for the CIFAR-10 dataset—it assesses how compact clusters are and how well separated they are. The lower the value, the better the clustering quality. Compared with the Silhouette Score, this metric further points out whether some clustering methods consistently produce well-structured groups under the complexity posed by CIFAR-10 data.
Figure 14: This figure shows the time taken to cluster the CIFAR-10 dataset. It presents the computational require-ments for different numbers of devices so that one may know how complexity can increase the time of clustering. Some methodologies can grow significantly more, which could be informative in their sustainability and efficiency in large and complex scenarios.

Davies-Bouldin Index for CIFAR-10 dataset.

Clustering time for CIFAR-10 dataset.

Global model accuracy over rounds for CIFAR-10 dataset.
Figure 15: Tracks how global model accuracy evolves over training rounds for different federated learning methods on CIFAR-10. Observing these trends helps identify which approaches converge faster and achieve higher performance, while also showing the impact of varying device counts on scalability and resilience.
As shown in Table 7, the proposed framework consistently outperforms the baseline methods across all datasets in terms of classification accuracy. The performance gap becomes more pronounced on more complex datasets such as CIFAR-10, highlighting the effectiveness of the proposed approach in handling data heterogeneity and challenging learning scenarios.

Redistribution time for data redistribution strategies.

Communication overhead for device assignment strategies.
Figure 16: shows the redistribution time under different strategies as the number of devices increases. Lower redis-tribution times indicate more efficient strategies in which the models can respond quickly to changing conditions without any single device becoming a bottleneck.
Figure 17: This figure illustrates the communication over-head for different device assignment strategies with an in-creasing number of devices. Discovering means to reduce the network load is very necessary in large-scale IoT deployment to make it efficient and responsive.

Load balance for device assignment strategies.
Figure 18: evaluates the load balancing achieved by dif-ferent device assignment strategies in consideration of a different number of devices. The better the load balancing, the less the resource constraints and the better the overall utilizationthus showing the scalability and fairness of the assignment schemes.
As summarized in Table 8, the proposed framework achieves lower communication overhead and improved load balance compared to static and heuristic assignment strategies. In addition, the reduced redistribution time demonstrates the efficiency of the proposed assignment and coordination mechanisms, particularly in moderate-scale device settings.

Energy consumption for number of devices.
Figure 19 illustrates the energy consumption behavior of the baseline federated learning approach compared to the proposed framework as the number of IoT devices increases. As observed, the baseline method exhibits a rapid growth in energy consumption due to increased communication overhead and inefficient participation of devices.
In contrast, the proposed approach demonstrates a significantly slower growth trend. This improvement is primarily attributed to the intelligent device scheduling mechanism based on PPO, which selectively activates devices, as well as the clustering strategy that reduces redundant communication. As a result, the proposed framework achieves better energy efficiency, particularly in large-scale scenarios. These results confirm that incorporating energy-aware decision-making into the learning process can effectively mitigate the energy cost in industrial IoT environments while maintaining system performance.
