CSAHFL:Clustered Semi-Asynchronous Hierarchical Federated Learning for Dual-layer Non-IID in Heterogeneous Edge Computing Networks
Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 5580-5588.
https://doi.org/10.24963/ijcai.2025/621
Keywords
- Machine Learning: ML: Clustering
- Machine Learning: ML: Federated learning
Abstract
Federated Learning (FL) enables collaborative model training across distributed devices without sharing raw data. Hierarchical Federated Learning (HFL) is a new paradigm of FL that leverages the Edge Servers (ESs) layer as an intermediary to perform partial local model aggregation in proximity, reducing core network transmission overhead. However, HFL faces new challenges: (1) The two-stage aggregation process between client-edge and edge-cloud results in a dual-layer non-IID issue, which may significantly compromise model training accuracy. (2) The heterogeneity and mobility of clients further impact model training efficiency. To address these challenges, we propose a novel Clustered Semi-Asynchronous Hierarchical Federated Learning (CSAHFL) framework that integrates adaptive semi-asynchronous intra-cluster aggregation at client-edge layer and dynamic distribution-aware inter-cluster aggregation at edge-cloud layer, collaboratively enhancing model performance and scalability in heterogeneous and mobile environments. We conducte experiments under varying degrees of dual-layer non-IID in both static and high-mobility scenarios. The results demonstrate significant advantages of CSAHFL over representative state-of-the-art methods.
- [Chai et al., 2021] Zheng Chai, Yujing Chen, Ali Anwar, Liang Zhao, Yue Cheng, and Huzefa Rangwala. Fedat: A high-performance and communication-efficient feder- ated learning system with asynchronous tiers. In Proceed- ings of the international conference for high performance computing, networking, storage and analysis, pages 1-16, 2021.
- [Cui et al., 2022] Yangguang Cui, Kun Cao, Junlong Zhou, and Tongquan Wei. Optimizing training efficiency and cost of hierarchical federated learning in heterogeneous mobile-edge cloud computing. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Sys- tems, 42(5):1518-1531, 2022.
- [Deng et al., 2024] Yongheng Deng, Feng Lyu, Tengxi Xia, Yuezhi Zhou, Yaoxue Zhang, Ju Ren, and Yuanyuan Yang. A communication-efficient hierarchical federated learning framework via shaping data distribution at edge. IEEE/ACM Transactions on Networking, 2024.
- [Elbir et al., 2021] Ahmet M Elbir, Anastasios K Pa- pazafeiropoulos, and Symeon Chatzinotas. Federated learning for physical layer design. IEEE Communications Magazine, 59(11):81-87, 2021.
- [Feng et al., 2022] Chenyuan Feng, Howard H Yang, Deshun Hu, Zhiwei Zhao, Tony QS Quek, and Geyong Min. Mobility-aware cluster federated learning in hierar- chical wireless networks. IEEE Transactions on Wireless Communications, 21(10):8441-8458, 2022.
- [Huang et al., 2022] Wei Huang, Tianrui Li, Dexian Wang, Shengdong Du, Junbo Zhang, and Tianqiang Huang. Fair- ness and accuracy in horizontal federated learning. Infor- mation Sciences, 589:170-185, 2022.
- [Krizhevsky et al., 2009] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny im- ages. 2009.
- [Li et al., 2020] Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. Pro- ceedings of Machine learning and systems, 2:429-450, 2020.
- [Li et al., 2022] Qinbin Li, Yiqun Diao, Quan Chen, and Bingsheng He. Federated learning on non-iid data silos: An experimental study. In 2022 IEEE 38th international conference on data engineering (ICDE), pages 965-978. IEEE, 2022.
- [Liu et al., 2020] Lumin Liu, Jun Zhang, SH Song, and Khaled B Letaief. Client-edge-cloud hierarchical feder- ated learning. In ICC 2020-2020 IEEE international con- ference on communications (ICC), pages 1-6. IEEE, 2020.
- [Luo et al., 2020] Siqi Luo, Xu Chen, Qiong Wu, Zhi Zhou, and Shuai Yu. Hfel: Joint edge association and resource allocation for cost-efficient hierarchical federated edge learning. IEEE Transactions on Wireless Communications, 19(10):6535-6548, 2020.
- [Ma et al., 2024a] Qianpiao Ma, Yang Xu, Hongli Xu, Jianchun Liu, and Liusheng Huang. Feduc: A unified clus- tering approach for hierarchical federated learning. IEEE Transactions on Mobile Computing, 2024.
- [Ma et al., 2024b] Qianpiao Ma, Yang Xu, Hongli Xu, Jianchun Liu, and Liusheng Huang. Feduc: A unified clus- tering approach for hierarchical federated learning. IEEE Transactions on Mobile Computing, 23(10):9737-9756, 2024.
- [McMahan et al., 2017] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Ar- cas. Communication-efficient learning of deep networks from decentralized data. In Artificial intelligence and statistics, pages 1273-1282. PMLR, 2017.
- [Morell Martínez et al., 2022] José Ángel Morell Martínez, Enrique Alba-Torres, et al. Dynamic and adaptive fault- tolerant asynchronous federated learning using volunteer edge devices. 2022.
- [Netzer et al., 2011] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Baolin Wu, Andrew Y Ng, et al. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsu- pervised feature learning, volume 2011, page 4. Granada, 2011.
- [Pandya et al., 2023] Sharnil Pandya, Gautam Srivastava, Rutvij Jhaveri, M Rajasekhara Babu, Sweta Bhattacharya, Praveen Kumar Reddy Maddikunta, Spyridon Mastorakis, Md Jalil Piran, and Thippa Reddy Gadekallu. Fed- erated learning for smart cities: A comprehensive sur- vey. Sustainable Energy Technologies and Assessments, 55:102987, 2023.
- [Pervej et al., 2024] Md Ferdous Pervej, Richeng Jin, and Huaiyu Dai. Hierarchical federated learning in wireless networks: Pruning tackles bandwidth scarcity and system heterogeneity. IEEE Transactions on Wireless Communi- cations, 2024.
- [Prigent et al., 2024] Cédric Prigent, Alexandru Costan, Gabriel Antoniu, and Loïc Cudennec. Enabling federated learning across the computing continuum: Systems, chal- lenges and future directions. Future Generation Computer Systems, 2024.
- [Qian et al., 2004] Gang Qian, Shamik Sural, Yuelong Gu, and Sakti Pramanik. Similarity between euclidean and co- sine angle distance for nearest neighbor queries. In Pro- ceedings of the 2004 ACM symposium on Applied comput- ing, pages 1232-1237, 2004.
- [Qin et al., 2021] Zhijin Qin, Geoffrey Ye Li, and Hao Ye. Federated learning and wireless communications. IEEE Wireless Communications, 28(5):134-140, 2021.
- [Rani et al., 2023] Sita Rani, Aman Kataria, Sachin Kumar, and Prayag Tiwari. Federated learning for secure iomt- applications in smart healthcare systems: A comprehen- sive review. Knowledge-based systems, 274:110658, 2023.
- [Shahid et al., 2021] Osama Shahid, Seyedamin Pouriyeh, Reza M Parizi, Quan Z Sheng, Gautam Srivastava, and Liang Zhao. Communication efficiency in federated learning: Achievements and challenges. arXiv preprint arXiv:2107.10996, 2021.
- [Singh et al., 2022a] Parminder Singh, Gurjot Singh Gaba, Avinash Kaur, Mustapha Hedabou, and Andrei Gurtov. Dew-cloud-based hierarchical federated learning for intru- sion detection in iomt. IEEE journal of biomedical and health informatics, 27(2):722-731, 2022.
- [Singh et al., 2022b] Pushpa Singh, Murari Kumar Singh, Rajnesh Singh, and Narendra Singh. Federated learning: Challenges, methods, and future directions. In Federated Learning for IoT Applications, pages 199-214. Springer, 2022.
- [Tian et al., 2022] Chunlin Tian, Li Li, Zhan Shi, Jun Wang, and ChengZhong Xu. Harmony: Heterogeneity-aware hi- erarchical management for federated learning system. In 2022 55th IEEE/ACM International Symposium on Mi- croarchitecture (MICRO), pages 631-645. IEEE, 2022.
- [Vahidian et al., 2023] Saeed Vahidian, Mahdi Morafah, Weijia Wang, Vyacheslav Kungurtsev, Chen Chen, Mubarak Shah, and Bill Lin. Efficient distribution similar- ity identification in clustered federated learning via prin- cipal angles between client data subspaces. In Proceed- ings of the AAAI conference on artificial intelligence, vol- ume 37, pages 10043-10052, 2023.
- [Wang et al., 2022] Zhiyuan Wang, Hongli Xu, Jianchun Liu, Yang Xu, He Huang, and Yangming Zhao. Accelerat- ing federated learning with cluster construction and hier- archical aggregation. IEEE Transactions on Mobile Com- puting, 22(7):3805-3822, 2022.
- [Wen et al., 2023] Jie Wen, Zhixia Zhang, Yang Lan, Zhihua Cui, Jianghui Cai, and Wensheng Zhang. A survey on fed- erated learning: challenges and applications. International Journal of Machine Learning and Cybernetics, 14(2):513- 535, 2023.
- [Wu et al., 2023] Qiong Wu, Xu Chen, Tao Ouyang, Zhi Zhou, Xiaoxi Zhang, Shusen Yang, and Junshan Zhang. Hiflash: Communication-efficient hierarchical federated learning with adaptive staleness control and heterogeneity- aware client-edge association. IEEE Transactions on Par- allel and Distributed Systems, 34(5):1560-1579, 2023.
- [Xiao et al., 2017] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for bench- marking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
- [Yang et al., 2022] Lei Yang, Yingqi Gan, Jiannong Cao, and Zhenyu Wang. Optimizing aggregation frequency for hier- archical model training in heterogeneous edge computing. IEEE Transactions on Mobile Computing, 22(7):4181- 4194, 2022.
- [Zhang et al., 2024] Ruizhuo Zhang, Wenjian Luo, Yongkang Luo, Hongwei Zhang, and Jiahai Wang. Afl-dcs: An asynchronous federated learning framework with dynamic client scheduling. Engineering Applications of Artificial Intelligence, 133:107927, 2024.
References were extracted automatically from the PDF and may contain errors.
Full text extracted automatically from the PDF; figures, tables and equations may differ. The PDF is the version of record.
1 Introduction
Federated learning (FL) [McMahan et al., 2017] has emerged as a promising paradigm to enable collaborative training of machine learning models across distributed clients without sharing raw data. By ensuring data privacy, FL has found widespread applications in domains such as healthcare [Wen et al., 2023], the Internet of Things (IoT) [Rani et al., 2023], and smart cities [Pandya et al., 2023]. However, the practical deployment of FL is hindered by the prohibitively high communication costs arising from the iterative exchange of model updates between clients and the cloud server. This issue is further exacerbated when clients' local training data are nonIID, as achieving the desired learning accuracy requires more aggregation rounds [Shahid et al., 2021; Qin et al., 2021]. Additionally, as model architectures grow increasingly complex, the volume of transmitted model updates grows significantly, further amplifying the communication burden in FL systems [Elbir et al., 2021].
∗Corresponding author

To address these challenges, Hierarchical federated learning (HFL) has been proposed as an advanced extension of traditional FL [Wang et al., 2022]. HFL adopts a multilayer architecture, comprising clients, edge servers (ESs), and a central cloud server. By leveraging the intermediate ESs layer for local model aggregation, HFL significantly reduces the frequency of direct communication between clients and the cloud, thereby lowering communication overhead. Recent advancements in HFL have addressed key challenges in communication efficiency, computational scalability, and model convergence by introducing multi-layer design [Cui et al., 2022; Pervej et al., 2024; Ma et al., 2024a]. HFL aligns naturally with the layered structure of many real-world systems. For instance, in IoT applications, sensors first transmit updates to local gateways (i.e., ESs), which then coordinate with a cloud server for global model training, reducing latency and enabling distributed learning efficiency [Singh et al., 2022a].
Despite its potential, the practical implementation of HFL is hindered by several challenges:
Dual-layer Non-IID in HFL. Unlike traditional FL, where heterogeneity is primarily observed at the client level [Li et al., 2022], HFL introduces an intermediate aggregation layer at ESs, resulting in intra-edge heterogeneity (variation among clients under the same ES) and inter-edge heterogeneity (variation across different ESs). This dual-layer non-IID characteristic further complicates the convergence of the global model. For example, clients associated with the same edge server might exhibit highly diverse data distributions, while pronounced disparities across ESs can further hinder global aggregation [Huang et al., 2022]. Figure 1 illustrates the duallayer non-IID data distribution.
Heterogeneous client capabilities. Clients in HFL often exhibit varying computational resources, including differences in CPU/GPU performance, memory capacity, and network bandwidth, which give rise to variable update latencies and potential bottlenecks during the aggregation process. To address these, adaptive scheduling is required to accommodate such variations without stalling the overall training [Singh et al., 2022b].
Client mobility and dynamic participation. In dynamic environments such as vehicular systems, clients frequently join or drop out of the training process due to mobility or resource constraints. In addition, clients may move between ESs regions during training. Such mobility disrupts local update consistency and complicates hierarchical aggregation, thereby impeding convergence of the global model [Prigent et al., 2024; Morell Mart´ınez et al., 2022].
While existing studies have explored solutions to address individual aspects of these challenges in HFL, a comprehensive framework capable of simultaneously mitigating multiple issues remains lacking. In this paper, we propose a novel Clustered Semi-Asynchronous Hierarchical Federated Learning (CSAHFL) framework, which integrates adaptive semi-asynchronous intra-cluster aggregation at the clientedge layer and dynamic distribution-aware inter-cluster aggregation at the edge-cloud layer, collaboratively enhancing model performance and scalability in heterogeneous and dynamic environments. Specifically, we introduce a privacypreserving one-shot clustering method that groups clients by data distribution similarity. This method incurs minimal computational overhead and supports efficient cross-edge cluster identification. At the client-edge layer, our adaptive semiasynchronous aggregation mechanism dynamically adjusts each client's workload based on real-time availability, thereby increasing participation rates for low-capacity clients and reducing idle time. At the edge-cloud layer, we employ a dynamic distribution-aware inter-cluster aggregation strategy that assigns weights to aggregated edge models according to their similarity to the global objective, effectively mitigating inter-cluster disparities. Together, these features enable CSAHFL to comprehensively address the dual-layer non-IID heterogeneity inherent in HFL. Our contributions in this paper are as follows.
- We propose the CSAHFL framework, which effectively tackles the dual-layer non-IID heterogeneity in HFL by incorporating a privacy-preserving one-shot clustering, intra-cluster aggregation at the client-edge layer and inter-cluster aggregation at the edge-cloud layer.
- We design an adaptive semi-asynchronous update mechanism that reduces the impact of client heterogeneity by dynamically balancing workload allocation while ensuring efficient model training.
- We introduce three different Edge non-IID (ENIID) configurations to gain insights into the impact of dual-layer non-IID on model performance. We conducted experiments in both static and high-mobility scenarios, and the experimental results demonstrate that our proposed method CSAHFL exceeds the performance of state-ofthe-art algorithms.
2 RelatedWork
HFL extends traditional FL by introducing an intermediate layer of ESs, thereby reducing communication overhead and enabling more efficient model aggregation. However, communication efficiency and heterogeneity in both client capabilities and data distributions remain significant barriers to its practical deployment.
Several studies have targeted communication optimization in HFL. HierFedAVG [Liu et al., 2020] was the first to propose the client-edge-cloud hierarchical Federated Learning system, enabling faster model training and better communication-computation trade-offs by leveraging partial model aggregation at edge servers. RAF [Yang et al., 2022] proposed a dynamic aggregation strategy to minimize the number of communication rounds, while HED-FL [Pervej et al., 2024] introduced a compression technique to reduce transmitted data size. HFEL [Luo et al., 2020] formulates a joint resource-allocation and edge-association problem, developing an efficient scheduling algorithm that minimizes global cost and enhances training performance. Although these approaches have markedly improved communication efficiency, they do not consider how data heterogeneity affects model accuracy.
To address devices and data heterogeneity, HELCHFL [Cui et al., 2022] developed a client selection mechanism that prioritizes devices with greater computational power. SARE [Deng et al., 2024] maximized diversity in edgeaggregated data by shaping local distributions to alleviate non-IID effects. HARMONY [Tian et al., 2022] designed a hierarchical coordination scheme that balances local data distribution characteristics and global training round requirements to improve model accuracy and convergence speed. HiFlash [Wu et al., 2023] integrated deep reinforcement learning for adaptive staleness control alongside a heterogeneity-aware client-edge association strategy.
Nonetheless, these approaches focuses primarily on the client level, lacking investigation into the non-IID discrepancies among ESs.
Although prior HFL research has enhanced communication efficiency and mitigated client-level heterogeneity, existing approaches still fall short of addressing the combined challenges posed by dual-layer non-IID data distributions and heterogeneous device capabilities. In this paper, we bridge these gaps.
3 The Proposed CSAHFLMethod
3.1 ProblemDefinition
We provide the definition of the problem based on the Cloudbased FL. HFL consists of N clients, M Edge Servers and one cloud server. Each client n owns a local data set Dn = {(xi, yi)}|Dn| i=1 where xi denotes the i-the input sample and yi is the corresponding labeled output for client n's federated learning task. Clients are divided into M disjoint groups based on their geographical locations, each of which is associated with one ES. The overall objective of the HFL is to minimize the global loss function, which is defined as:
where Fj(w) is the loss of function for ES j, nj is the total data size of clients assigned to ES j, N is the total data size across all clients.
At each ES j, the local loss function Fj(w) is defined as:
where Sj is the set of clients assigned to ES k, ni is the data size of client i, Fi(w) = E(x,y)∼Pi [ℓ(fw(x), y)] is the local loss function for client i, with ℓ being the loss function.
The final optimization objective is to minimize:
This problem encapsulates the dual-layer aggregation process, aiming to produce a globally optimized model while efficiently handling hierarchical data distributions.
3.2 Overview of CSAHFL
We propose Clustered Semi-Asynchronous Hierarchical Federated Learning (CSAHFL), a framework that integrates three interdependent components to work in harmony to handle data and system heterogeneity. As shown in Figure 2. The CSAHFL comprises: (1) Privacy-preserving one-shot clustering module: Clients are grouped into clusters based on data-distribution similarity without revealing raw data. It ensures efficient clustering with minimal computational and communication overhead. These clusters form the basis for all subsequent aggregations. (2) Adaptive semi-asynchronous intra-cluster aggregation at the client-edge layer: Each client dynamically adjusts its aggregation interval according to realtime availability and resource constraints, minimizing idle time and ensuring that low-capacity clients continuously contribute to local model updates. (3) Dynamic distributionaware inter-cluster aggregation at the edge-cloud layer: Updated cluster models are aggregated at the cloud by assigning weights proportional to inter-cluster distribution similarity, thereby mitigating the impact of heterogeneity across ESs and yielding a robust, globally consistent model. We provide one global aggregation iteration of CSAHFL in Algorithm 1.

3.3 Privacy Preserving One-Shot Clustering Module
Clients in HFL often exhibit heterogeneous (non-IID) data distributions, which impede both local and global model convergence. To alleviate these effects, clients with similar distributions can be grouped into clusters, thereby reducing interclient variability and enabling localized training within each cluster. This strategy naturally exploits the HFL architecture, where ESs mediate between clients and the central cloud. Here, we employ principal angles to quantify distributional similarity among clients. Unlike iterative clustering methods, this approach performs clustering in a single step, incurring no additional computational overhead during training[Vahidian et al., 2023].
The cosine similarity metric is extended to measure the similarity between subspaces using principal angles. For two subspaces X ⊂ Rn and Y ⊂ Rn , the smallest principal angle Θ1 is defined as:
Principal angles quantify subspace distances, providing a robust similarity metric for clustering[Qian et al., 2004].
To ensure privacy, each client computes a truncated singular value decomposition (SVD) of its dataset Di, retaining only the top p singular vectors:
These vectors, serving as low-dimensional data signatures, are transmitted to the server while preserving privacy by avoiding raw data sharing.
We construct a proximity matrix A, where each element Ai,j represents the smallest principal angle between the subspaces Uip and Ujp :
Smaller values of Ai,j indicate higher similarity. Hierarchical clustering (HC) is applied to A to group clients into K clusters, with the clustering threshold β determining the number of clusters C = {C1, C2, ...CK}.
3.4 Adaptive Semi-Asynchronous Intra-Cluster Aggregation at the Client-Edge Layer
To address resource heterogeneity among clients and improve their participation rates in HFL, we propose an adaptive semi-asynchronous intra-cluster aggregation mechanism at the client-edge layer, which tries to unify each client's round time to the limited aggregation interval Tθ by adaptively adjusting the workload concerning its real-time availability, effectively mitigate the impact of weak or stale clients while enhancing training efficiency.
Adaptive Local Trainning
At each ES communication round, the ES randomly samples n clients to construct the collection S and distributes the edge model to clients, each selected client would perform one data batch full model training to estimate its pre-epoch computation time tunit and report it to the ES. Sequentially, the ES calculates each client's total time, the total time ttotal consists of computation time tcmp and communication time tcom, which is defined as:
where NBS is the number of batches, determined by dividing the dataset size by the batch size B, Emax is a hyperparameter representing the upper bounds for training epochs, M is model's file size and Bw is real-time network bandwidth.
The ES dynamically adjusts the aggregation interval Tθ, is defined as:
where median(Ttotal) represents the typical time consumption among clients, IQR(Ttotal) captures the variability in client performance, and α is a tunable parameter to control the degree of tolerance for stragglers. By dynamically adjusting Tθ, the ES ensures that the majority of clients can complete their training tasks and report updates within the designated interval.
Each client i then adjusts its workload Ei to ensure timely completion within Tθ:
Semi-Asynchronous Intra-Cluster Aggregation
Clients that successfully report updates within Tθ are included in the aggregation set Sk for cluster k. For clients that fail to submit updates, their contributions are asynchronously included in the aggregation process during subsequent iterations to ensure their updates are not discarded. The aggregated edge model for cluster k is computed as:
where ni and nj are the local dataset sizes of synchronous client i and asynchronous client j, N k edge = ∑i∈Sk ni + ∑j∈Ak nj is the total dataset size for all reporting clients in cluster k, including both synchronous Sk and asynchronous Ak sets. τj is a discount factor applied to asynchronous updates from client j to account for potential staleness in their contributions, where τj = 1/(1+γj), γj represents the number of delayed rounds for the update from client j. wt i and wtj represent the local model updates from synchronous and asynchronous clients at round t.
After intra-cluster aggregation, the ES maintains K updated cluster models {w1 edge , w2 edge , ..., wK edge}.
Algorithm 1 CSAHFL Under One Global Aggregation
Input: Cluster set C, initial global model w0 g , aggregation interval Tθ , maximum epoch Emax
Output: Final global model wg.
for each cluster Ck, k = 1, 2, . . . , K in parallel do
ES sends the current cluster model wk,t edge to all clients in Ck
for each client i ∈ Ck in parallel do
Client i estimates unit computation time tunit and reports it to ES.
ES computes total time Ttotal and adjusts the aggregation interval Tθ dynamically,
Tθ = median(Ttotal) + α · IQR(Ttotal)
Client i updates workload,
Client i performs local training for Ei and sends wt i to ES.
ES aggregates updates:
*/
Cloud server receives all updated cluster models {w1 edge, . . . , wK edge}
Aggregate cluster models: wg = ∑Kk=1 λkwk edge return wg
3.5 Dynamic Distribution-Aware Inter-Cluster Aggregation at the Edge-Cloud Layer
At the edge-cloud layer, the central server performs a dynamic aggregation of the K cluster models received from ESs. This aggregation considers both the data distribution similarity between clusters and the data quantity associated with each cluster, ensuring a more balanced and robust global model update.
The global model wg is updated by aggregating the cluster models {w1 edge , w2 edge , . . . , wK edge}. The aggregation formula is given as:
where λk is the weight assigned to cluster k, reflecting its importance in the global aggregation. The weight λk for each cluster k is dynamically calculated based on two factors: the quantity and distribution similarity.
Clusters with more data contribute proportionally more to the global model. The quantity weight ωqua k is defined as:
Clusters whose data distribution aligns more closely with the global target distribution are given higher weights. The distribution weight ωdis k is calculated using a similarity metric such as KL divergence:
where DKL(Pk∥Pg) is KL divergence between the distribution Pk of cluster d and the target global distribution Pg.
The final weight λk is computed as a combination of the two factors:
4 Experiments
We consider an HFL system consisting of 200 clients, 5 ESs, and one cloud server, assuming each ES authorizes the same number of clients with the approximate amount of training data. We conducted experiments in two scenarios: static and high-mobility. In the static scenario, each client remains associated with one ES throughout the entire training process. In the high-mobility scenario, we follow the experimental framework in MACFL [Feng et al., 2022], which establishes a theoretical foundation based on Markov chains for the dynamic transition of clients.
4.1 Experiment Settings
Datasets. We validate our proposed CSAHFL on three popular datasets: Fashion-MNIST [Xiao et al., 2017], CIFAR10 [Krizhevsky et al., 2009] and SVHN [Netzer et al., 2011].
Non-IID setting. To create data with dual-layer non-IID, we considers the widely used label skew non-IID data distribution. We first randomly assign each ES x classes of the total labels and then each client randomly selects y classes from the labels assigned to its corresponding ES. We focus on analyzing the impact of Edge non-IID (ENIID) on model performance. Therefore, y is uniformly set to 20%, while x is configured under the following three settings.
- EIID: Assign each ES all classes. The datasets among ESs are IID.
- ENIID50%: Assign each ES a total of 50% classes. The datasets among ESs are non-IID.
- ENIID30%: Assign each ES a total of 30% classes. The degree of non-IID between ESs is the highest.
Baselines. We compare CSAHFL against the following set of baselines. (1) FedAVG [McMahan et al., 2017] is a classical cloud-based FL. (2) FedProx [Li et al., 2020] optimizes statistical heterogeneity and system heterogeneity by adding a proximal term, we perform it in the client-edge aggregation layer. For baselines that adopt different clustering strategies and communication mechanisms based on HFL. (3) HierFedAVG [Liu et al., 2020] is a cloud-edge-client HFL that performs synchronous updates in both client-edge and edgecloud aggregation. (4) FedAT [Chai et al., 2021] combines synchronous intra-tier training and asynchronous cross-tier training, and conducts client clustering based on their latencies. (5) MACFL [Feng et al., 2022] is a mobility-aware cluster algorithm by redesigning the local update rule and model aggregation. (6) HiFlash [Wu et al., 2023] combines client-edge synchronous and edge-cloud asynchronous aggregation with adaptive staleness control and heterogeneityaware client-edge association. (7) FedUC [Ma et al., 2024b] proposes a time-sharing scheduling algorithm to minimize intra-cluster aggregation latency. Considering that the FedAVG and FedAT algorithms are not affected by mobile scenarios, we do not repeat their results in the experiments.
Metrics. We use two common metrics to measure performance: average test accuracy and training time to achieve target accuracy.
Client Heterogeneity and Mobility Setting. Each client runs on a different thread and has a random computation delay obeying a normal distribution[Zhang et al., 2024](minimum=2s, maximum=128s, µ=63, σ=40). In the presence of user mobility, we assume all the users are uniformly distributed over the entire network at the beginning of time. Each user will stay or move to a neighboring ES according to staying probability ps, denotes the probability that users staying at the current ES [Feng et al., 2022]. ps=1 represents a static scenario. For the mobile scenario, we set ps=0.5, meaning the probability of a client staying at the current ES to participate in training is 0.5.
Parameter Settings. For each dataset, the number of samples selected by clients for one training session is B = 10, the number of local epoch is E = 10, the learning rate is η = 0.01, the optimization algorithm used for local training of clients is SGD, the number of rounds the ES aggregates its clients' local models is re = 3, and the number of rounds the cloud server aggregates ESs' edge models is rc = 50. The total number of communication rounds equals re × rc.
4.2 Performance Analysis
We conducted experiments on three datasets. As shown in Tables 1 and 2, CSAHFL consistently outperforms all baseline methods across all datasets, ENIID settings, and mobility scenarios, highlighting its robustness to data heterogeneity and client mobility. Some representative training curves are illustrated in Figure 3.
| Dataset | Fashion-MNIST | CIFAR10 | SVHN | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ENIID setting | EIID | ENIID50% | ENIID30% | EIID | ENIID50% | ENIID30% | EIID | ENIID50% | ENIID30% | |
| FedAVG | 87.50±1.01 | 83.26±0.97 | 83.08±1.32 | 48.52±0.98 | 48.45±0.34 | 47.74±1.02 | 84.58±0.26 | 83.78±0.55 | 83.83±0.56 | |
| FedProx | 87.93±0.92 | 82.96±0.74 | 80.97±0.74 | 45.28±0.56 | 45.28±0.78 | 40.86±0.84 | 85.04±0.93 | 82.65±1.30 | 78.65±0.95 | |
| HierFedAVG | 87.43±0.80 | 83.97±0.46 | 81.44±0.79 | 45.51±0.75 | 45.57±1.10 | 44.13±0.74 | 85.05±0.18 | 84.92±1.50 | 82.90±0.74 | |
| ps = 1 FedAT | 83.47±2.32 | 82.31±4.94 | 77.01±3.37 | 51.22±1.84 | 47.11±3.43 | 37.64±0.80 | 82.05±3.92 | 78.82±1.11 | 75.15±0.79 | |
| MACFL | 88.02±0.37 | 84.95±0.58 | 81.65±0.91 | 53.02±1.34 | 49.77±0.34 | 47.77±0.34 | 87.77±0.38 | 84.13±0.74 | 81.63±0.74 | |
| HiFlash | 89.12±1.35 | 85.24±0.29 | 81.48±0.52 | 65.08±0.42 | 60.58±1.02 | 49.37±0.64 | 88.49±0.42 | 84.92±0.67 | 80.59±0.37 | |
| FedUC | 88.14±1.17 | 83.97±1.32 | 82.44±1.45 | 60.98±1.19 | 58.94±0.74 | 54.70±0.85 | 86.62±1.22 | 83.79±0.64 | 82.38±1.38 | |
| CSAHFL | 92.14±0.21 | 91.11±0.15 | 88.49±0.43 | 69.35±0.31 | 68.06±0.27 | 64.75±0.34 | 90.68±0.20 | 89.62±0.18 | 88.17±0.56 | |
| FedProx | 86.96±1.01 | 82.27±2.63 | 79.86±0.98 | 45.64±2.78 | 46.63±1.52 | 43.32±0.65 | 83.96±1.48 | 82.68±1.65 | 81.57±0.33 | |
| HierFedAVG | 86.59±0.21 | 83.80±1.32 | 81.39±2.96 | 44.58±1.57 | 44.04±0.64 | 41.88±1.04 | 83.44±0.27 | 81.62±0.33 | 80.67±1.53 | |
| ps = 0.5 MACFL | 88.44±0.62 | 85.97±0.15 | 83.01±0.97 | 54.06±1.15 | 46.02±0.13 | 50.81±0.27 | 86.06±0.80 | 83.71±0.42 | 82.79±1.50 | |
| HiFlash | 87.71±0.87 | 87.13±0.23 | 85.09±1.12 | 64.83±0.59 | 63.47±0.44 | 62.97±0.13 | 86.92±0.63 | 86.20±0.24 | 83.54±0.29 | |
| FedUC | 86.70±0.98 | 83.36±1.56 | 82.57±1.42 | 60.51±1.86 | 56.34±1.30 | 54.85±1.23 | 84.19±0.92 | 82.03±0.55 | 80.97±2.05 | |
| CSAHFL | 92.82±0.34 | 91.8±0.42 | 88.27±0.58 | 70.68±0.56 | 68.35±0.20 | 64.55±0.30 | 89.72±0.14 | 89.03±0.29 | 88.11±0.49 | |
| ENIID setting | EIID | ENIID50% | ENIID30% | ||||
|---|---|---|---|---|---|---|---|
| Target | 60% | 85% | 60% | 82% | 60% | 80% | |
| FedAVG | 823 (1.17×) | 5043 (3.62×) | 987 (1.37×) | 8028 (6.46×) | 1302 (1.85×) | 6229 (3.59×) | |
| FedProx | 1341 (1.90×) | 5387 (3.87×) | 1836 (2.56×) | 10137 (8.16×) | 1869 (2.65×) | 11353 (6.54×) | |
| HierFedAVG | 1780 (2.52×) | 6712 (4.82×) | 1811 (2.52×) | 7258 (5.84×) | 1811 (2.65×) | 11464 (6.61×) | |
| ps = 1 | FedAT | 706 (1×) | 10528 (7.56×) | 718 (1×) | 7134 (5.74×) | 705 (1×) | - |
| MACFL | 1632 (2.31×) | 6465 (4.64×) | 1796 (2.50×) | 6912 (5.57×) | 1751 (2.48×) | 5787 (3.32×) | |
| HiFlash | 1400 (1.98×) | 2775 (1.99×) | 1407 (1.96×) | 4299 (4.46×) | 1380 (1.96×) | 3197 (1.84×) | |
| FedUC | 718 (1.02×) | 3493 (2.50×) | 730 (1.02×) | 2665 (2.15×) | 1283 (1.82×) | 3250 (1.87×) | |
| CSAHFL | 724 (1.03×) | 1392 (1×) | 743 (1×) | 1242 (1×) | 989 (1.40×) | 1735 (1×) | |
| FedProx | 1776 (2.39×) | 7619 (5.12×) | 2296 (3.23×) | 11068 (8.93×) | 2091 (2.81×) | 10776 (5.86×) | |
| HierFedAvg | 1819 (2.44×) | 7164 (4.81×) | 1776 (1.79×) | 6958 (5.61×) | 3202 (4.30×) | 11438 (6.22×) | |
| ps = 0.5 | MACFL | 1795 (2.41×) | 5909 (3.97×) | 1807 (1.82×) | 5089 (4.10×) | 1735 (2.33×) | 4374 (2.38×) |
| HiFlash | 882 (1.19×) | 6497 (4.37×) | 1093 (1.10×) | 1733 (1.40×) | 824 (1.11×) | 2224 (1.21×) | |
| FedUC | 853 (1.12×) | 5012 (3.37×) | 1065 (1.07×) | 3793 (3.06×) | 912 (1.22×) | 3612 (1.96×) | |
| CSAHFL | 744 (1×) | 1488 (1×) | 991 (1×) | 1240 (1×) | 745 (1×) | 1840 (1×) | |
Impact of Edge Non-IID on Model Performance
The severity of ENIID directly correlates with a decline in model performance. Across all datasets, the model accuracy decreases as the data distribution transitions from EIID to ENIID30%. (1) In the EIID scenario, all methods perform relatively well due to the balanced data distribution across ESs. For example, On CIFAR10, CSAHFL achieves 69.35%, significantly outperforming FedAvg 48.52%. (2) In the ENIID50% scenario, as data heterogeneity increases, model performance begins to degrade. For example, on CIFAR10, FedAT's accuracy drops from 51.22% (EIID) to 47.11% (ENIID50%), while CSAHFL maintains a high accuracy of 68.06%. (3) Under the most extreme ENIID30% scenario, traditional methods experience significant performance degradation. On CIFAR10, FedProx achieves only 43.32%, while CSAHFL achieves a much higher accuracy of 64.55%.
Impact of Client Mobility on Model Performance
In high-mobility scenarios, client mobility introduces additional challenges, causing accuracy drops for all methods. The accuracy drops in high-mobility scenarios are primarily due to inconsistent data distributions. However, the accuracy improvement observed in HiFlash algorithms may be attributed to client mobility providing a greater variety of data sample choices for edge model updates. CSAHFL achieves the highest accuracy across all datasets and non-IID settings.
4.3 Hyperparameter Analysis
We investigate the effect of the aggregation interval factor α, the number of max local epoch Emax, and the clustering threshold β on system performance. The results are summarized as follows:
Interval factor α andmax local epochEmax. We conduct a combined analysis of α and Emax to study their impact on training time. As shown in α is tuned across the set {0.5, 1.0, 1.5, 2.0}, while Emax is varied across {5,10,20,30}. Smaller α values result in tighter aggregation intervals, allowing fewer clients with longer computation times to complete training and participate in aggregation. Larger α extends the aggregation interval, enabling more clients to complete full training rounds with Emax, but at the cost of increased overall training time. On the other hand, weaker clients with lower computational capacity reduce their local epochs E to finish training within the aggregation interval. This dynamic adjustment helps maintain their participation in the aggregation process while keeping their training times manageable. As shown in Figure 4(a), the optimal balance is achieved when α=1.5 and Emax=10, which balances training efficiency and sufficient client participation. which minimizes training time while allowing sufficient clients to participate with Emax.

Clustering threshold β. The results suggest that β has a significant impact on both the number of clusters and model performance. At lower values of β (β < 5), the final accuracy increases rapidly, indicating faster model convergence due to fewer clusters and more concentrated client collaboration. As shown in Figure 4(b), a moderate value β ≈ 20 achieves the best trade-off, maximizing model accuracy while maintaining a reasonable number of clusters.
4.4 Ablation Study
To validate the effectiveness of the CSAHFL framework, we designed three different ablation experiment methods. (1) w/o C (without clustering): the client-edge clustering mechanism is removed, and clients are randomly assigned to edge servers without considering data distribution similarity. (2) w/o SA (without Adaptive Semi-Asynchronous Aggregation): Semi-asynchronous aggregation is replaced with a synchronous strategy, requiring all clients to complete local training before aggregation. (3) w/o D (Without Distribution- Aware Inter-Cluster Aggregation): The inter-cluster aggregation at the edge-cloud level is replaced by uniform weighting, ignoring data distribution differences across edge servers.

| ENIID Setting | Method | ps = 1 | ps = 0.5 | ||
|---|---|---|---|---|---|
| ACC | Target Time | ACC | Target Time | ||
| EIID | w/o C w/o SA w/o D | 90.12 91.53 91.21 | 1432 5210 1398 | 89.65 91.41 90.89 | 1497 5108 1537 |
| ENIID50% | w/o C w/o SA w/o D | 86.34 88.72 89.06 | 1503 5419 1408 | 85.92 89.03 88.74 | 1607 6238 1718 |
| ENIID30% | w/o C w/o SA w/o D | 82.2 85.17 84.69 | 1545 6193 1473 | 81.87 81.64 83.87 | 1633 6501 1829 |
As shown in Table 3, removing the clustering module leads to a significant accuracy drop in non-IID scenarios, especially under ENIID30% (82.20% vs. 90.12%). This demonstrates that clustering clients based on data similarity effectively mitigates data heterogeneity at the client-edge layer. Without semi-asynchronous aggregation, the framework experiences slower convergence, particularly in dynamic scenarios (ps = 0.5). This highlights the importance of adaptive client participation for reducing idle time and improving efficiency. Uniform aggregation weights at the edge-cloud layer reduce the framework's ability to handle inter-edge data heterogeneity, as evidenced by the lower accuracy in ENIID50% (89.03% vs. 88.74%).
5 Conclusions and FutureWork
This paper presents the CSAHFL framework, which effectively addresses dual-layer non-IID challenges and client heterogeneity through privacy-preserving clustering, adaptive semi-asynchronous intra-cluster aggregation, and dynamic distribution-aware inter-cluster aggregation. Experiments demonstrate its superior performance in both static and high-mobility scenarios. However, our approaches lack adaptability to dynamic data changes. Future work will investigate personalized federated learning to enhance adaptability in evolving environments.
Acknowledgements
This work was supported by the National Key Research and Development Program of China (2023YFF0725103), National Natural Science Foundation of China (U22B2038,62192784).
@inproceedings{ijcai2025p621,
title = {CSAHFL:Clustered Semi-Asynchronous Hierarchical Federated Learning for Dual-layer Non-IID in Heterogeneous Edge Computing Networks},
author = {Li, Aijing and Du, Junping and Liu, Dandan and Shao, Yingxia and Zhao, Tong and Ye, Guanhua},
booktitle = {Proceedings of the Thirty-Fourth International Joint Conference on
Artificial Intelligence, {IJCAI-25}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {James Kwok},
pages = {5580--5588},
year = {2025},
month = {8},
note = {Main Track},
doi = {10.24963/ijcai.2025/621},
url = {https://doi.org/10.24963/ijcai.2025/621},
}
TY - CPAPER TI - CSAHFL:Clustered Semi-Asynchronous Hierarchical Federated Learning for Dual-layer Non-IID in Heterogeneous Edge Computing Networks AU - Li, Aijing AU - Du, Junping AU - Liu, Dandan AU - Shao, Yingxia AU - Zhao, Tong AU - Ye, Guanhua T2 - Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence, IJCAI-25 PB - International Joint Conferences on Artificial Intelligence Organization PY - 2025 SP - 5580 EP - 5588 DO - 10.24963/ijcai.2025/621 UR - https://doi.org/10.24963/ijcai.2025/621 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: