Fedcompass: Federated Clustered and Periodic Aggregation Framework for Hybrid Classical-Quantum Models Yueheng Wang, Xing He, Zinuo Cai, Rui Zhang, Ruhui Ma, Yuan Liu, Rajkumar Buyya Abstract Federated learning enables collaborative model training across decentralized clients under privacy constraints. Quantum computing offers potential for alleviating computational and communication burdens in federated learning, yet hybrid classical-quantum federated learning remains susceptible to performance degradation under non-IID data. To address this, we propose fedcompass , a layered aggregation framework for hybrid classical-quantum federated learning. fedcompass employs spectral clustering to group clients by class distribution similarity and performs cluster-wise aggregation for classical feature extractors. For quantum parameters, it uses circular mean aggregation combined with adaptive optimization to ensure stable global updates. Experiments on three benchmark datasets show that fedcompass improves test accuracy by up to 10.22% and enhances convergence stability under non-IID settings, outperforming six strong federated learning baselines. † † address: 1 School of Artificial Intelligence and Computer Science, Jiangnan University 2 Antai College of Economics & Management, Shanghai Jiao Tong University 3 School of Computer Science, Shanghai Jiao Tong University 4 Cloud Computing and Distributed Systems Laboratory, University of Melbourne 1 Introduction Nowadays, data privacy and potential leakage risks have become critical issues requiring urgent attention. Federated learning (FL) [ 19 ] , as a privacy-preserving distributed learning paradigm, effectively reduces the privacy risk by training models locally on client devices and uploading only parameter updates instead of raw data. Thanks to this characteristic, FL has been widely adopted in scenarios such as mobile healthcare [ 1 ] , IoT [ 12 ] , and distributed sensing [ 17 ] . However, this privacy protection mechanism also introduces significant communication and computational overhead, posing serious challenges to training efficiency, especially in large-scale or resource-constrained edge environments [ 20 ] . At the same time, as an emerging computational paradigm, quantum computing [ 15 ] leverages quantum superposition and entanglement to enable parallel information processing. Since current quantum devices remain in the Noisy Intermediate-Scale Quantum (NISQ) era [ 7 ] with limited error correction capabilities and communication reliability issues [ 13 ] , hybrid classical-quantum machine learning [ 4 ] has shown great potential. Such architecture employs classical neural networks for efficient feature extraction, and leverages quantum circuits to accelerate computation and enhance representational learning in specific tasks [ 3 ] , thereby opening new avenues for improving federated learning efficiency. However, federated learning often faces the challenge of non-IID data [ 8 ] in practice, which can easily lead to local model bias and difficulties in global convergence [ 10 ] . Although methods such as FedProx [ 9 ] , FedBN [ 11 ] , and FedPer [ 2 ] have achieved certain success in traditional scenarios, non-IID data still presents two major challenges in the classical-quantum federated learning setting. Firstly, significant differences in feature distributions among clients exacerbate the deviation in classical feature extraction layers, making it difficult to maintain global consistency after model aggregation. Secondly, quantum parameters are periodic [ 16 ] and sensitive to data distribution [ 5 ] . Direct arithmetic averaging can easily cause parameter period mismatch, aggravating training instability and leading to optimization conflicts between classical and quantum modules. To address the aforementioned challenges, we propose fedcompass , a layered aggregation optimization framework in the hybrid classical-quantum federated learning setting. To mitigate model deviation caused by differences in client feature distributions, fedcompass employs spectral clustering based on client category statistics and performs weighted aggregation within clusters to generate cluster-level classical feature extractors. To tackle the periodicity issue specific to quantum parameters, we introduce a circular mean for periodic parameters based on the unit circle, combined with an adaptive optimizer to achieve robust global updates. To validate the effectiveness and generalization capability of the proposed framework, we conduct extensive experiments on three datasets: MNIST, Fashion-MNIST, and CIFAR-10. The results demonstrate that fedcompass significantly improves test accuracy and convergence stability across various non-IID settings, consistently outperforming six mainstream federated learning baseline methods. The framework fully exemplifies its comprehensive advantages in accuracy, stability, and privacy preservation within hybrid classical-quantum federated learning environments. Figure 1: Overview of our mechanism. 2 The Proposed fedcompass Algorithm 2.1 Overview Fig. 1 illustrates the overall workflow of fedcompass . The server first initializes a hybrid global model composed of a classical feature extraction layer and a quantum classifier, which is distributed to all clients (Step 1). Subsequently, each client conducts end-to-end training of the model based on their local data (Step 2). After training, clients upload the updated model parameters along with their data class distribution vectors to the server (Step 3). The server employs a hierarchical aggregation strategy, processing the classical and quantum layers separately. For the classical layer, clients are dynamically clustered based on data distribution similarity, and weighted aggregation is performed within each cluster to generate cluster-level classical feature extractors (Step 4). For the quantum layer, the circular mean method is applied to aggregate quantum parameters, combined with an adaptive optimization strategy to achieve robust global updates (Step 5). Finally, the server distributes the updated cluster-level classical model parameters and global quantum parameters to the clients for the next round of training. 2.2 Cluster-Based Aggregation for Classical Feature Extraction Layer To address model bias caused by non-IID data distributions, we introduce a client clustering mechanism based on data distribution similarity in the classical network part, enhancing the model’s adaptability to data heterogeneity. Throughout the federated learning process, no raw data is uploaded, thereby ensuring privacy protection. Let the client set be \{c_{1},c_{2},\ldots,c_{N}\} , with corresponding datasets \{d_{1},d_{2},\ldots,d_{N}\} , a total number of classes C , and a data concentration parameter \alpha . During data partitioning, the concentration parameter \alpha controls the degree of data heterogeneity: a smaller \alpha indicates a more heterogeneous data distribution. Simultaneously, each client uploads its class distribution vector \vec{p} to the server as a statistical representation of its data features. This vector is a C -dimensional vector representing the proportion of samples from each class in the client’s local data, i.e., \vec{p}_{i}=(p_{i1},p_{i2},…,p_{iC}) , where p_{ij} denotes the proportion of class j data in client c_{i} . The server collects the local data distribution vectors \{{\vec{{p}}_{1},\vec{{p}}_{2},\ldots,\vec{{p}}_{N}}\} from the clients and computes a similarity matrix S based on these statistics: \displaystyle S_{ij}=\exp\left(-\lambda_{1}\mathrm{JS}(\vec{{p}}_{i},\vec{{p}}_{j})-\lambda_{2}\frac{\left|n_{i}-n_{j}\right|}{n_{i}+n_{j}}\right). (1) The similarity metric comprehensively evaluates the similarity between clients by considering both distribution divergence and sample size discrepancy. The Jensen–Shannon divergence \mathrm{JS}(\cdot,\cdot) measures the difference in class distribution patterns between clients. The second term serves as the relative difference in sample size, where n_{i} denotes the sample size of client c_{i} , reflecting the impact of data volume disparity on model updates. The hyperparameters \lambda_{1} and \lambda_{2} balance the weights of the two terms: increasing \lambda_{1} places greater emphasis on distribution consistency, while increasing \lambda_{2} prioritizes the alignment of sample size scales. Based on this, the server employs a spectral clustering algorithm grounded in the Normalized Cut criterion. It computes the normalized Laplacian matrix, performs eigenvalue decomposition, and applies K-means clustering to the top M eigenvectors to identify groups of clients with similar data distribution patterns. The clients are then grouped into M clusters \{\mathcal{C}_{1},\mathcal{C}_{2},\ldots,\mathcal{C}_{M}\} , with each cluster corresponding to a potential data distribution pattern, thereby achieving an effective partitioning of heterogeneous client groups. During the aggregation phase, the server receives the classical feature extraction layer parameters \theta_{c}^{(i)} uploaded by the clients and performs a weighted average aggregation within each cluster: \displaystyle\theta_{c}^{(m)}=\frac{\sum_{i\in\mathcal{C}_{m}}n_{i}\cdot\theta_{c}^{(i)}}{\sum_{i\in\mathcal{C}_{m}}n_{i}}, (2) where the weights are determined by the local sample size of each client, resulting in a cluster-shared classical model. Algorithm 1 Quantum Parameter Update and Aggregation. 1: Input: Client parameters \{\boldsymbol{\phi}_{i}\}_{i=1}^{N} , sample sizes \{n_{i}\}_{i=1}^{N} , previous global parameters \boldsymbol{\phi}_{t} , FedAdam states m_{t-1},v_{t-1} , hyperparameters \beta_{1},\beta_{2},\eta,\epsilon 2: Output: Updated global parameters \boldsymbol{\phi}_{t+1} , updated states m_{t},v_{t} 3: Compute client weights: \omega_{i}=n_{i}/\sum_{j}n_{j} 4: for each dimension j=1,\ldots,m do 5: Compute \bar{\phi}_{j} via Eq. 3 {Circular mean aggregation} 6: end for 7: Aggregated parameters: \bar{\boldsymbol{\phi}}=(\bar{\phi}_{1},\ldots,\bar{\phi}_{m}) 8: Construct gradient: \mathbf{g}_{t}=\boldsymbol{\phi}_{t}-\bar{\boldsymbol{\phi}} 9: Update moment: m_{t},v_{t} via Eq. 4 10: Bias correction: \hat{m}_{t},\hat{v}_{t} via Eq. 5 11: Global update: \boldsymbol{\phi}_{t+1} via Eq. 6 12: return \boldsymbol{\phi}_{t+1},m_{t},v_{t} 2.3 Global Aggregation Optimization for Periodic Quantum Classifier As a globally shared module, the quantum classifier requires consistency and stability in its parameters across all clients. To achieve this, we design a quantum parameter aggregation method on the server side based on periodic averaging and adaptive updating. This approach first employs circular mean to resolve inconsistencies caused by the periodicity of rotation angles, and then introduces an adaptive update mechanism to enhance the stability of global convergence. The overall quantum parameter aggregation and update process is described in Algorithm 1 . Let the quantum parameters uploaded by client c_{i} be \boldsymbol{\phi}_{i}=(\phi_{i}^{(1)},\phi_{i}^{(2)},\ldots,\phi_{i}^{(m)}) . For the j -th parameter dimension, the aggregation process is defined as: \displaystyle\bar{\phi}_{j}=\operatorname{atan2}\left(\sum_{i=1}^{N}\omega_{i}\sin(\phi_i^{(j)}),\sum_{i=1}^{N}\omega_{i}\cos(\phi_i^{(j)})\right), (3) where \omega_{i}={n_{i}}/{\sum_{j}n_{j}} is the client weight. This operation (line 5) maps angles to the unit circle for averaging before mapping them back to the angular space, thereby avoiding periodicity-induced inconsistencies. To further enhance the convergence stability of the global quantum classifier, we employ an adaptive optimizer on the server side (lines 7–11) to update the aggregated parameters globally. First, the average gradient \mathbf{g}_{t} for the quantum parameters in round t is computed based on the global quantum parameters \mathbf{g}_{t}=\boldsymbol{\phi}_{t}-\bar{\boldsymbol{\phi}} . Subsequently, momentum update, bias correction, and parameter update are performed as follows: m_{t}=\beta_{1}m_{t-1}+(1-\beta_{1})\mathbf{g}_{t},\quad v_{t}=\beta_{2}v_{t-1}+(1-\beta_{2})\mathbf{g}_{t}^{2}, (4) \hat{m}_{t}=\frac{m_{t}}{1-\beta_{1}^{t}},\quad\hat{v}_{t}=\frac{v_{t}}{1-\beta_{2}^{t}}, (5) \boldsymbol{\phi}_{t+1}=\boldsymbol{\phi}_{t}-\eta\cdot\frac{\hat{m}_{t}}{\sqrt{\hat{v}_{t}}+\epsilon}, (6) where \beta_{1} and \beta_{2} are momentum hyperparameters, \eta is the learning rate, and \epsilon is a numerical stability constant. The integration of the adaptive optimizer with the periodic constraints of quantum parameters ensures stable convergence of the quantum classifier under non-IID data distributions. Finally, the server distributes the updated cluster-level classical model parameters \theta_{c}^{(m)} and the quantum classifier parameters \boldsymbol{\phi}_{t+1} to the clients for the next round of training and aggregation. This design addresses the periodicity of quantum parameters while facilitating the transfer of discriminative capabilities across different clients through global sharing, thereby improving overall classification performance and convergence stability. 3 PERFORMANCE EVALUATION 3.1 Experiments Setup Datasets. We evaluate fedcompass and comparative methods on three datasets: MNIST, Fashion-MNIST, and CIFAR-10. From each dataset, we uniformly selected 4 classes to form a four-class classification task. The data was partitioned using a Dirichlet distribution [ 17 ] with two non-IID parameter settings, \alpha=0.3 and \alpha=0.7 . Models. We adopt a hybrid classical-quantum architecture, where a classical network performs feature extraction and a quantum network carries out classification. For MNIST, we use LeNet followed by a parameterized quantum circuit. For more complex datasets such as CIFAR-10 and Fashion-MNIST, the first two layers of ResNet-18 are employed for feature extraction, and the features are then passed to a quantum convolutional network. Training Settings. We simulate a federated learning environment with 10 clients. Each client performs 5 local epochs per communication round with a batch size of 32. Due to the high overhead of quantum training, the server conducts 5 global communication rounds in total. We use the Adam optimizer with a learning rate of 0.001 for updating both the local models and the server-side quantum parameters. Baselines. We compare fedcompass with the following six classical federated learning methods: (1) FedAvg [ 14 ] ; (2) FedProx [ 9 ] ; (3) FedBN [ 11 ] ; (4) FedPer [ 2 ] ; (5) FedNova [ 18 ] ; (6) Scaffold [ 6 ] . Implementation. We employ Ray as the distributed computing framework to coordinate multi-client parallel training tasks. The model construction and gradient calculation for the quantum part are implemented using the PennyLane library. The federated learning process is built and executed based on the Flower framework. 3.2 Results and Discussion We evaluate fedcompass on MNIST, Fashion-MNIST, and CIFAR-10 under two non-IID settings with \alpha = 0.3 and \alpha = 0.7, comparing it against six baseline methods. As shown in the accuracy results (Table 1 ) and convergence curves (Fig. 2 – 4 ), fedcompass consistently achieves the best performance in most scenarios. Table 1: Comparison of test accuracy of different federated learning algorithms across three datasets under non-IID settings. Best values are in bold and second best are underlined . Dataset MNIST Fashion-MNIST CIFAR-10 Non-IID Degree 0.30 0.70 0.30 0.70 0.30 0.70 FedAvg [ 14 ] 99.54 99.49 96.15 96.05 66.78 76.30 FedProx [ 9 ] 74.96 50.69 93.18 93.03 55.20 69.68 FedBN [ 11 ] 50.83 50.83 23.98 25.55 71.25 57.63 FedPer [ 2 ] 33.68 26.65 48.50 69.83 66.55 57.68 FedNova [ 18 ] 40.32 99.62 4.40 25.25 23.13 19.10 Scaffold [ 6 ] 40.29 47.17 64.65 85.15 38.53 54.28 fedcompass (Ours) 99.69 99.76 96.20 95.50 77.00 80.10 Table 2: Test accuracy of ablation study on CIFAR-10 across communication rounds. Round No Clustering No Circular Mean FedCompass 1 25.10 25.00 25.98 2 50.65 38.60 52.65 3 50.38 46.23 71.55 4 55.15 32.85 70.03 5 56.13 26.25 77.00 (a) \alpha=0.3 (b) \alpha=0.7 Figure 2: Convergence curves of test accuracy versus communication rounds on MNIST under non-IID settings. (a) \alpha=0.3 (b) \alpha=0.7 Figure 3: Convergence curves of test accuracy versus communication rounds on Fashion-MNIST under non-IID settings. (a) \alpha=0.3 (b) \alpha=0.7 Figure 4: Convergence curves of test accuracy versus communication rounds on CIFAR-10 under non-IID settings. fedcompass demonstrates the most significant improvement on the CIFAR-10 dataset. Under the condition of \alpha = 0.3, it achieves an accuracy of 77.00%, which is a 10.22% increase compared to FedAvg. This result depends on fedcompass ’s clustering mechanism, which effectively groups clients with similar class distributions, thereby reducing discrepancies in classical feature learning. When \alpha = 0.7, the accuracy further improves to 80.10%, outperforming FedAvg by 3.80%, confirming the robustness of our method across varying degrees of non-IID data. On MNIST, its performance approaches the dataset’s upper limit of 99.7%, while on Fashion-MNIST, the improvement is relatively smaller, indicating the dataset’s lower sensitivity to distribution shifts. Nonetheless, fedcompass still maintains leading results. Convergence analysis shows that fedcompass exhibits faster and more stable convergence under different heterogeneity conditions, with the advantage being particularly pronounced at \alpha = 0.3. In the ablation study(Table 2 ), fedcompass achieved the highest test accuracy, with steady improvement as the number of communication rounds increased, demonstrating the effectiveness of the complete framework. Removing the clustering mechanism for the classical layers resulted in a significant performance drop, particularly in the later rounds. This indicates that the absence of clustering grouping leads to divergence in the feature extractors, adversely affecting global convergence. Omitting the circular mean aggregation for quantum parameters yielded the lowest and most unstable performance. The substantial fluctuations reflect the adverse impact of misaligned periodicity in quantum rotation angles, underscoring the necessity of circular aggregation for coordinating periodic updates and avoiding optimization conflicts. 4 Conclusion This paper proposes fedcompass , a novel hybrid classical-quantum federated learning framework designed to address the challenges of non-IID data distribution. The method implements two key mechanisms, a spectral clustering-based client grouping strategy with within-cluster aggregation of classical feature extractors, and a circular mean aggregation method combined with adaptive optimization tailored for the periodic nature of quantum parameters. It provides an effective solution to data heterogeneity in hybrid federated learning while enhancing overall performance without compromising convergence.