Abstract
In Federated Learning (FL), data heterogeneity (non-IID data) remains a primary obstacle to model convergence and performance. While traditional research focuses on optimizing training algorithms (e.g., FedProx, SCAFFOLD), this study investigates the impact of model architecture. We demonstrate that Vision Transformers (ViTs) and Swin Transformers are significantly more robust to data heterogeneity than traditional Convolutional Neural Networks (CNNs) like ResNet and EfficientNet. Our findings show that Transformers achieve higher accuracy, converge faster, and exhibit superior resistance to catastrophic forgetting in both parallel and serial FL paradigms.
Introduction
Federated Learning enables collaborative model training across decentralized data sources while preserving privacy. However, the "Grand Challenge" of FL is data heterogeneity—where local data distributions vary significantly across clients. This mismatch leads to weight divergence in parallel FL (e.g., FedAvg) and catastrophic forgetting in serial FL (e.g., Cyclic Weight Transfer).
Historically, the community has addressed these issues through algorithmic tweaks. This paper shifts the focus to Model Architecture, proposing that the inherent biases of the model itself play a crucial role in handling non-IID data.
Methodology
The researchers conducted a comprehensive empirical study comparing CNNs (ResNet, EfficientNet) against Vision Transformers (ViT, Swin Transformer). The evaluation spanned two primary FL paradigms:
- Parallel FL (FedAvg): Clients train locally and an aggregation server averages the weights.
- Serial FL (Cyclic Weight Transfer - CWT): A single model is passed sequentially from one client to the next.
The study utilized benchmarks including CIFAR-10 (with varying label skew), the Retina (Kaggle Diabetic Retinopathy) dataset for real-world medical imaging heterogeneity, and CelebA for massive-scale client scenarios. Data skewness was quantified using the Kolmogorov-Smirnov (KS) statistic.
Key Findings: Transformers vs. CNNs
Superior Robustness and Accuracy
Transformers consistently outperformed CNNs across all levels of data heterogeneity. On the most skewed CIFAR-10 splits, ViT-FedAvg surpassed ResNet-FedAvg by over 37%. In serial training on the Retina dataset, the performance gap reached a staggering 77.70%.
Resistance to Catastrophic Forgetting
A pivotal discovery was the Transformer's natural resistance to catastrophic forgetting. In serial FL, while ResNet accuracy on previous clients' data often dropped to near zero, Transformers maintained high performance. This suggests that the self-attention mechanism captures more stable, global features compared to the local, texture-biased filters of CNNs.
Communication Efficiency
Transformers reached target accuracy levels significantly faster. For instance, on CIFAR-10, a ViT reached the target in a single round, whereas ResNet required 85 rounds or failed to converge entirely.
Discussion and Feature Analysis
Visualizations using UMAP revealed that Transformers learn more distinct and organized feature representations in federated settings compared to CNNs. The global receptive field of self-attention allows Transformers to be less sensitive to local distribution shifts (e.g., different imaging equipment in hospitals) that typically degrade CNN performance.
Limitations
Despite their advantages, Transformers in FL have specific requirements:
- Pretraining: ViTs perform best when pretrained (e.g., on ImageNet); training from scratch in a federated environment remains difficult.
- Computational Cost: Transformers can be more memory-intensive, potentially challenging for resource-constrained edge devices.
Conclusion
This research highlights that architecture design is a powerful, yet underutilized, lever for overcoming data heterogeneity in Federated Learning. By adopting Vision Transformers, practitioners can achieve more robust and efficient global models, often outperforming complex optimization-based solutions.
Summary updated