Resource-efficient Layer-wise Federated Self-supervised Learning

Ye Lin Tun, Chu Myaet Thwal, Huy Q. Le, Minh N. H. Nguyen, Eui-Nam Huh, Choong Seon Hong

TL;DR

Federated Self-Supervised Learning (FedSSL) allows edge devices to collaboratively train models on unlabeled data without sacrificing privacy, but its high computational and communication demands often overwhelm edge hardware. This paper introduces LW-FedSSL, a layer-wise training framework that trains models incrementally—one layer at a time—slashing memory, compute, and communication costs by up to 5× while maintaining competitive accuracy.

What Problem Does This Paper Address?

Edge devices (like smartphones, IoT sensors, and medical devices) generate massive amounts of data, most of which is unlabeled. Combining Federated Learning (FL) for privacy with Self-Supervised Learning (SSL) to learn representations without human labels seems like a match made in heaven.

However, modern SSL backbones—such as Vision Transformers (ViTs)—are computationally heavy. Edge devices typically lack the RAM, processing power (GFLOPs), and network bandwidth required to train these large models end-to-end. While one might try to reduce the training batch size to save memory, doing so drastically degrades the representation quality in contrastive SSL algorithms. The authors address this critical bottleneck, aiming to make FedSSL viable for resource-constrained edge hardware.

Methods

Instead of training the entire network simultaneously, the authors propose breaking the training process down into sequential stages:

  1. LW-FedSSL (Layer-Wise Federated SSL): Training is divided into multiple stages. At each stage, a new layer is appended to the model. Crucially, all previously trained layers are frozen and act purely as static feature extractors. Only the newly added layer and the SSL projection/prediction heads are actively trained and exchanged with the server. This keeps the local computational footprint small and flat throughout the training lifecycle.
  2. Prog-FedSSL (Progressive Federated SSL): As a point of comparison, the authors also explore a progressive strategy. Like LW-FedSSL, it introduces layers stage-by-stage, but it keeps all accumulated layers active and trainable. This increases resource consumption over time but serves as a high-performance middle ground between layer-wise and full end-to-end training.

Both methods are designed to be agnostic to the underlying SSL framework and were evaluated using MoCoV3, BYOL, and SimCLR backbones.

Comparison of FedSSL (end-to-end), LW-FedSSL (layer-wise), and Prog-FedSSL (progressive) training paradigms.

Datasets

The authors evaluated their approach using a variety of computer vision benchmarks:

  • Pre-training: The COCO dataset was used to construct local client datasets, distributed heterogeneously across 10 clients using a Dirichlet distribution to simulate real-world data variance.
  • Downstream Evaluation: CIFAR-10, CIFAR-100, Tiny ImageNet, and Caltech-101.
  • Medical Benchmarks: To prove real-world utility on complex data, they tested on four subsets of the MedMNIST collection: PathMNIST, BloodMNIST, DermaMNIST, and OrganAMNIST.

Key Insights and Ideas

  • Decoupling Memory from Batch Size: Contrastive SSL typically requires massive batch sizes to expose the model to enough "negative samples." In standard training, large batch sizes cause memory usage to skyrocket. Because LW-FedSSL only keeps a single layer active, it can accommodate large batch sizes on low-memory devices without a sharp rise in peak RAM.
  • Natural Regularization of Client Divergence: In FL, clients training on different data distributions tend to drift apart (weight divergence). The authors discovered that freezing prior layers and only updating one layer at a time naturally constrains this drift ($L_2$ norm distance). This stabilizes the server aggregation step.
  • Modularity: Because each stage operates as an independent FL training loop, LW-FedSSL easily integrates with other FL optimizations, such as depth dropout or proximal alignment mechanisms.

Key Results

  • Massive Resource Savings: When integrated with MoCoV3, LW-FedSSL achieved a 3.34× reduction in memory usage, 4.20× fewer GFLOPs, and a 5.07× lower communication cost compared to standard end-to-end FedMoCoV3, all while maintaining comparable downstream accuracy.
Resource consumption (Memory, FLOPs, and Communication) across training epochs/rounds.
  • Prog-FedSSL Outperformance: While Prog-FedSSL is less resource-efficient than LW-FedSSL, it actually outperformed standard end-to-end training on several datasets (e.g., achieving a 63.48% average accuracy vs. FedMoCoV3's 60.79%), proving that progressive layer addition can benefit self-supervised representation learning.
  • Resilience to Client Dropout: In realistic partial-participation settings (where only 25% or 50% of clients check in per round, or clients drop out due to network instability), LW-FedSSL consistently and significantly outperformed end-to-end training.

Limitations and Future Work

  • Worst-Case Communication Overhead: The 5.07× communication savings assumes clients only download the active layer. If a client drops out for an entire stage and rejoins later, it must download the full sub-model up to that stage. However, the authors note that even in this worst-case scenario, LW-FedSSL still yields a 2.5× communication saving over end-to-end baselines.
  • Static Stage Scheduling: The current framework splits communication rounds evenly across a fixed number of stages. Future work could explore adaptive scheduling—dynamically deciding when to freeze a layer and add the next based on convergence rates or real-time client resource availability.

Summary updated

BibTeX
@misc{tun2024resource,
  author = {Ye Lin Tun and Chu Myaet Thwal and Huy Q. Le and Minh N. H. Nguyen and Eui-Nam Huh and Choong Seon Hong},
  title = {{Resource-efficient Layer-wise Federated Self-supervised Learning}},
  year = {2024},
  eprint = {2401.11647},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.11647},
}
Figure