Abstract
A central challenge in training classification models in the real-world federated system is learning with non-IID data. To cope with this, most of the existing works involve enforcing regularization in local optimization or improving the model aggregation scheme at the server. Other works also share public datasets or synthesized samples to supplement the training of under-represented classes or introduce a certain level of personalization. Though effective, they lack a deep understanding of how the data heterogeneity affects each layer of a deep classification model. In this paper, we bridge this gap by performing an experimental analysis of the representations learned by different layers. Our observations are surprising: (1) there exists a greater bias in the classifier than other layers, and (2) the classification performance can be significantly improved by post-calibrating the classifier after federated training. Motivated by the above findings, we propose a novel and simple algorithm called Classifier Calibration with Virtual Representations (CCVR), which adjusts the classifier using virtual representations sampled from an approximated gaussian mixture model. Experimental results demonstrate that CCVR achieves state-of-the-art performance on popular federated learning benchmarks including CIFAR-10, CIFAR-100, and CINIC-10.
Introduction
Federated Learning (FL) allows multiple clients to train a model collaboratively without sharing their raw data. However, a major hurdle is data heterogeneity (non-IID data). When clients have very different data distributions, local models "drift" apart, leading to poor global performance. Most existing research attempts to fix this during training by adding complex regularization terms. This paper takes a diagnostic approach, asking exactly where the model fails within its internal layers.
Analysis of Layer-wise Bias
To understand the impact of heterogeneity, the authors perform a diagnostic study using Centered Kernel Alignment (CKA) to measure representation similarity across different clients' models. The analysis reveals that similarity drops significantly as you go deeper into the network. While the early feature extractor layers manage to learn reasonably consistent representations, the final classifier layer becomes heavily biased toward the specific classes seen by each client during local training.
As shown in the CKA similarity trends, the classifier (Layer 7) is the least consistent across clients. This "classifier bias" is the primary bottleneck in FL with non-IID data. When visualized as a heatmap, the classifier layer shows much lower similarity between different clients compared to initial layers.
Classifier Calibration with Virtual Representations (CCVR)
Based on these findings, the authors proposed CCVR, a simple post-processing step that works in four stages after standard FL training is complete:
- Feature Distribution Estimation: Each client computes the mean and covariance of the features (the output of the second-to-last layer) for each class they possess.
- Aggregation: The server collects these statistics and aggregates them to estimate a global Gaussian distribution for each class.
- Virtual Representation Generation: The server samples "virtual" feature vectors from these estimated distributions.
- Classifier Re-Training: The server freezes the feature extractor and re-trains only the classifier layer using these virtual features.
This approach is privacy-preserving because clients only share statistical summaries (means and covariances), not raw images or feature vectors.
Key Results and Insights
CCVR consistently improved the performance of all baseline FL algorithms, including FedAvg, FedProx, and MOON.
- Massive Gains on CINIC-10: Applying CCVR to FedAvg improved accuracy from 60.20% to 69.99%—a nearly 10% absolute gain.
- Robustness to Heterogeneity: The more heterogeneous the data, the more CCVR helped. For CIFAR-10 with high skew, it boosted FedAvg by over 2.6%.
- Decoupling is Key: By decoupling feature learning from classifier training, CCVR allows the model to benefit from collaborative feature learning while "fixing" the decision boundaries at the end.
Conclusion
The study concludes that the feature extractor layers are surprisingly robust to heterogeneity, and the performance drop in FL is primarily due to the classifier layer's weights being biased toward local label distributions. CCVR provides a simple yet effective post-hoc fix that can outperform complex training-time regularization methods.
Summary updated