Abstract
Federated Learning (FL) is a distributed learning paradigm that can learn a global or personalized model from decentralized datasets on edge devices. However, in the computer vision domain, model performance in FL is far behind centralized training due to the lack of exploration in diverse tasks with a unified FL framework. FL has rarely been demonstrated effectively in advanced computer vision tasks such as object detection and image segmentation. To bridge the gap and facilitate the development of FL for computer vision tasks, in this work, we propose a federated learning library and benchmarking framework, named FedCV, to evaluate FL on the three most representative computer vision tasks: image classification, image segmentation, and object detection. We provide non-I.I.D. benchmarking datasets, models, and various reference FL algorithms. Our benchmark study suggests that there are multiple challenges that deserve future exploration: centralized training tricks may not be directly applied to FL; the non-I.I.D. dataset actually downgrades the model accuracy to some degree in different tasks; improving the system efficiency of federated training is challenging given the huge number of parameters and the per-client memory cost. We believe that such a library and benchmark, along with comparable evaluation settings, is necessary to make meaningful progress in FL on computer vision tasks.
Introduction
Federated Learning (FL) has emerged as a promising paradigm for training machine learning models on decentralized data while preserving privacy. However, a significant performance gap remains between FL and centralized training in the computer vision (CV) domain. While centralized models achieve state-of-the-art (SOTA) results on benchmarks like CIFAR and ImageNet, FL performance often lags behind significantly. This gap is exacerbated by the lack of a unified framework that supports advanced CV tasks beyond simple image classification.
The FedCV Framework
To address these challenges, we introduce FedCV, a comprehensive library and benchmarking framework designed to evaluate FL across the three most representative CV tasks: image classification, image segmentation, and object detection. FedCV is built upon the FedML research library, extending it with specialized APIs for complex vision architectures and distributed computing capabilities.
Key features of the framework include:
- Diverse Task APIs: Support for image classification (e.g., EfficientNet, ViT), segmentation (e.g., DeepLabV3+), and object detection (e.g., YOLOv5).
- Realistic Data Partitioning: The framework uses Latent Dirichlet Allocation (LDA) to partition standard datasets (like CIFAR-100, PASCAL VOC, and COCO) into non-identical and independent distributions (non-I.I.D.), mimicking real-world edge device heterogeneity.
- Distributed Computing: Multi-GPU and cross-server communication protocols to make training massive CV models computationally affordable.
- Reference Implementations: Built-in support for state-of-the-art FL algorithms including FedAvg, FedOpt, FedNova, and FedProx.
Key Insights and Benchmarking Results
Our extensive benchmarking using FedCV reveals several critical findings that challenge standard deep learning assumptions:
- Centralized Tricks Fail in FL: Standard optimizers like Momentum SGD can actually perform worse than vanilla SGD in federated settings. Because each client's data is non-I.I.D., accumulated momentum pushes local models in divergent directions, hurting global convergence.
- The Power of Fine-Tuning: For image classification, starting with pre-trained models is essential, providing a 20× speedup and ~20% higher accuracy than training from scratch.
- Scratch Training for Segmentation: Interestingly, training from scratch for image segmentation performed nearly as well as using pre-trained backbones (less than 2% difference). This is encouraging for fields like medical imaging where standard natural image backbones may not be optimal.
- System Bottlenecks: Training large models like Vision Transformers (ViT) incurs massive communication overhead—5.68 hours of communication cost for ViT versus just 0.26 hours for EfficientNet.
- Performance Gaps in Detection: While centralized YOLOv5 achieves >0.95 mAP, the federated version struggles to break 0.85 mAP, highlighting that object detection in FL requires significant future algorithmic research.
Conclusion
FedCV provides the necessary infrastructure to bridge the gap between algorithmic FL research and practical computer vision applications. By exposing the limitations of centralized training tricks in federated environments and providing a robust benchmarking suite, we hope to catalyze future research into FL-specific optimizers, efficient communication, and privacy-preserving data augmentation. FedCV is publicly available at: https://github.com/FedML-AI/FedCV.
Summary updated