TL;DR
Standard self-supervised learning (SSL) relies on point-estimate optimization (MAP), collapsing rich parameter uncertainty down to a single set of weights. This paper introduces Bayesian BYOL (BBYOL), which applies Cyclical Stochastic Gradient Hamiltonian Monte Carlo (cSGHMC) to sample diverse representations across multimodal posterior distributions. Marginalizing over these sampled representations yields notable gains in downstream classification accuracy, model calibration, and out-of-distribution (OOD) detection.
What Problem Does This Paper Address?
Popular self-supervised methods (like BYOL and SimCLR) train deep encoders to produce invariant representations without human supervision. However, they are traditionally optimized using standard stochastic gradient descent (SGD), yielding a single deterministic point estimate (a Maximum A-Posteriori, or MAP, solution).
Because the parameter landscape of deep neural networks is vast and highly multimodal, a single set of weights fails to capture parameter uncertainty and limits representation diversity. Furthermore, point-estimate models often struggle with overconfident downstream predictions and inadequate out-of-distribution (OOD) detection. The authors aim to bridge Bayesian deep learning and self-supervised visual representation learning by treating the encoder weights and resulting feature embeddings probabilistically.
Methods
The authors build their Bayesian framework on top of BYOL (Bootstrap Your Own Latent), which optimizes an online network to predict representations of a target network updated via an exponential moving average (EMA).
- Prior over Parameters: A standard Gaussian prior $\mathcal{N}(0, I)$ is placed over the parameters $\theta$ of the online encoder.
- Posterior Sampling with cSGHMC: Instead of standard SGD, the online network parameters are sampled using Cyclical Stochastic Gradient Hamiltonian Monte Carlo (cSGHMC):
- Injects scaled Gaussian noise into momentum-based gradient updates, ensuring the trajectory samples from the true posterior rather than collapsing to a local mode.
- Uses a cyclical cosine learning rate schedule (50 epochs per cycle) to escape local minima and explore different modes of the parameter posterior.
- Noise injection begins late in each cycle (epoch 45), collecting one posterior sample at each cycle's conclusion (typically the final 4 to 6 cycles).
- Model Averaging for Downstream Tasks: After pretraining, the collected model samples are fine-tuned. At test time, predictions are computed by marginalizing (ensembling) over the sampled representations: $$p(y^* \mid x^*, \mathcal{D}) \approx \frac{1}{T} \sum_{t=1}^T p(y^* \mid x^*, \theta^{(t)})$$
Datasets
Experiments evaluate pretraining, fine-tuning, and downstream performance across five computer vision benchmarks:
- CIFAR-10 & CIFAR-100: Small-scale natural images ($32 \times 32$).
- STL-10: $96 \times 96$ images; pretraining leverages its 100,000 unlabeled images.
- ImageNet-10: 10-class subset of ImageNet ($224 \times 224$).
- Tiny-ImageNet: Downscaled ImageNet images ($64 \times 64$).
- SVHN (Street View House Numbers): Used exclusively as an unseen out-of-distribution (OOD) test set for models pretrained on CIFAR-10 and CIFAR-100.
No new datasets were introduced.
Key Insights and Ideas
- Noise Mitigates Representation Collapse: The Gaussian noise injected during SGHMC updates naturally prevents representations from collapsing—a persistent challenge in non-contrastive self-supervised learning—encouraging richer feature diversity.
- Cyclical Exploration Finds True Diversity: A cyclical learning rate enables the MCMC chain to traverse multiple loss valleys, producing weights that capture meaningfully distinct representations of the same input data.
- Ensembling Embeddings Directly Boosts Calibration: Ensembling as few as two or three posterior samples (BBYOL-ENS) yields significant drops in Negative Log Likelihood (NLL), demonstrating that Bayesian SSL features lead to well-calibrated downstream classifiers.
Key Results
Fine-tuning the pretrained ResNet-18 representations on 100% labeled downstream data shows consistent improvements in accuracy (ACC) and calibration (NLL):
- STL-10: Accuracy jumps from 65.3% (BYOL) to 77.9% (BBYOL) and 78.1% (BBYOL-ENS). NLL drops from 96.2 to 60.4.
- Tiny-ImageNet: Accuracy improves from 69.8% to 76.5% (BBYOL-ENS), with NLL improving from 94.1 to 72.5.
- CIFAR-10 & CIFAR-100: BBYOL-ENS increases CIFAR-10 accuracy from 74.0% to 77.3% (NLL drops from 72.3 to 65.0) and CIFAR-100 accuracy from 44.6% to 47.5% (NLL drops from 210.0 to 193.3).
- Out-of-Distribution Detection (tested on SVHN):
- On CIFAR-100 $\to$ SVHN, predictive mean entropy increases from 2.00 (BYOL) to 2.30 (BBYOL-ENS-12), and NLL drops from 2.62 to 2.30, confirming that BBYOL assigns greater uncertainty to unseen data.
Limitations and Future Work
- Theoretical Formalization of Embedding Uncertainty: The authors explicitly note that the connection between uncertainty in the latent representation space and predictive uncertainty in label space needs deeper formal exploration.
- Downstream Integration: Currently, downstream evaluation fine-tunes collected samples separately with standard optimization. Future work proposes using the Bayesian SSL model directly as an informative prior in a fully Bayesian downstream model.
- Computational Cost: Running MCMC cycles requires substantial compute (up to 24 GPU hours per model) and requires storing and evaluating multiple network checkpoints at test time.
Summary updated