Introduction
Self-supervised learning (SSL) has revolutionized the development of foundation models by enabling the use of vast amounts of unlabeled data. Simultaneously, Federated Learning (FL) has emerged as a vital framework for training models on decentralized data while preserving user privacy. The intersection of these fields—Federated Self-supervised Learning (FedSSL)—promises to unlock the potential of private, unlabeled data distributed across edge devices.
However, a fundamental mathematical hurdle persists: in standard supervised federated learning, the global objective is simply the sum of local objectives. In SSL, this additive property does not hold. This discrepancy, known as objective misalignment, leads to significant performance degradation, particularly when data is non-identically and independently distributed (non-i.i.d.) across clients.
Presented at ICML 2024, "FedSC: Provable Federated Self-supervised Learning with Spectral Contrastive Objective over Non-i.i.d. Data" introduces a novel algorithm designed to bridge this gap. FedSC is the first FedSSL method to provide a theoretical convergence guarantee while achieving state-of-the-art performance on heterogeneous datasets.
The Challenge: Objective Misalignment
The core issue in FedSSL stems from the nature of contrastive learning. In a centralized setting, the model learns by pulling "positive pairs" (different views of the same image) together and pushing "negative pairs" (different images) apart.
In a federated setting using standard Federated Averaging (FedAvg), clients only perform contrastive learning on their local data. Consequently, the model only learns intra-client contrast. If a client's local dataset is biased—for example, containing only images of a specific category—the model fails to learn how to distinguish those samples from categories held by other clients. This lack of inter-client contrast prevents the global model from reaching its full potential. Previous attempts to solve this required sharing raw data representations or complex predictor networks, which are either privacy-invasive or communication-intensive.
The FedSC Framework
FedSC (Federated Spectral Contrastive) addresses misalignment by leveraging the Spectral Contrastive (SC) objective. Mathematically, the SC objective allows the global SSL loss to be decomposed into three distinct components:
- Intra-client contraction: Aligning local positive pairs.
- Intra-client contrast: Separating local negative pairs.
- Inter-client contrast: Separating negative pairs across different clients.
To facilitate inter-client contrast without compromising privacy, FedSC introduces a mechanism where clients share compact correlation matrices ($R$) of their data representations. These matrices ($H \times H$, where $H$ is the feature dimension) are significantly smaller than the full model or the predictor weights used in other frameworks, making them communication-efficient.
The FedSC Workflow
- DP-CalR (Differentially Private Calculation of R): Clients compute their local correlation matrices and apply Gaussian noise to ensure Differential Privacy (DP).
- Aggregation: The central server aggregates these local matrices to form a global correlation matrix, which is then broadcast back to the clients.
- Local Training: Clients utilize the global correlation information to perform inter-client contrast during local SGD updates, effectively aligning their local gradients with the global objective.
Theoretical and Empirical Results
A major contribution of this work is the first theoretical convergence guarantee for a FedSSL algorithm. The authors prove that while standard FedAvg approaches hit a constant error floor in SSL, FedSC converges to the global optimum at a rate of $O(1/\sqrt{T})$.
Performance Benchmarks
The researchers evaluated FedSC against state-of-the-art (SOTA) methods like FedU, FedEMA, and FedCA using SVHN, CIFAR-10, and CIFAR-100 datasets partitioned into non-i.i.d. clusters.
- Superior Accuracy: On CIFAR-100 with 20 clients, FedSC achieved 58.35% accuracy, outperforming the next best SOTA (FedCA) by 6%.
- Robustness to Heterogeneity: In a highly non-i.i.d. CIFAR-10 scenario (1 class per client), FedSC reached 80.06% accuracy, significantly surpassing standard FedAvg-based SSL.
- Privacy and Efficiency: The method proved robust to partial client participation and maintained high performance even under strong privacy constraints ($\epsilon=3$). Furthermore, sharing correlation matrices was shown to be more communication-efficient than sharing predictor networks.
Conclusion and Future Directions
FedSC represents a significant advancement in making federated self-supervised learning both provable and practical. By enabling inter-client contrast through privacy-preserving correlation matrices, it overcomes the fundamental misalignment problem that has hindered previous FedSSL approaches.
While currently optimized for the Spectral Contrastive objective, future work may extend this framework to other SSL objectives like SimCLR or Masked Autoencoders (MAE). Additionally, integrating Differential Privacy for model weights alongside the existing DP for correlation matrices could provide a more holistic end-to-end privacy guarantee.
Summary updated