Making Self-supervised Learning Robust to Spurious Correlation via Learning-speed Aware Sampling

Weicheng Zhu, Sheng Liu, Carlos Fernandez-Granda, Narges Razavian

Abstract

Self-supervised learning (SSL) models frequently exploit spurious correlations in unlabeled data, resulting in biased representations that fail to generalize to correlation-conflicting cases. We introduce Learning-speed Aware SSL (LA-SSL), a novel sampling strategy that mitigates feature suppression without requiring prior knowledge of specific biases. By tracking the learning speed of individual samples—where "hard" examples that conflict with shortcuts are learned more slowly—LA-SSL dynamically upsamples these informative cases. Our method is framework-agnostic and demonstrates consistent improvements across contrastive, non-contrastive, and generative SSL models on both synthetic and real-world benchmarks.

Introduction

While self-supervised learning has revolutionized training without labels, it remains susceptible to "feature suppression." In many datasets, easy-to-learn visual features (e.g., age or gender) are accidentally correlated with target attributes (e.g., disease presence). SSL models often prioritize these shortcuts to minimize training loss, neglecting more subtle but essential features. This reliance on spurious correlations leads to poor performance on minority groups or "correlation-conflicting" samples. Existing de-biasing techniques typically require explicit labels for the biasing attributes, which is impractical in a truly self-supervised setting.

The LA-SSL Framework

The core insight behind LA-SSL is that neural networks learn shortcuts first. Samples aligning with spurious correlations exhibit high learning speeds, while conflicting samples are learned significantly slower.

Comparison of learning speeds between Uniform and LA-SSL sampling. Uniform sampling shows a wide gap between aligned and conflict samples, which LA-SSL narrows by upsampling the latter.

LA-SSL implements a four-step process to leverage this signal:

  1. Learning Speed Tracking: For each image, the model calculates a learning speed score based on the similarity between different augmented views.
  2. EMA Stabilization: To account for noise from random data augmentation, an Exponential Moving Average (EMA) tracks stable learning speeds over multiple epochs.
  3. Inverse Sampling: A dynamic sampling probability is applied. Images with high learning speeds (shortcuts) are downsampled, while those with low speeds (hard examples) are upsampled.
  4. Linear Scaling: A simple linear function with two hyperparameters—a threshold ($r$) and a scaling factor ($\gamma$)—maps speeds to sampling weights.

This "plug-and-play" approach requires no extra forward or backward passes, making it highly efficient and compatible with various SSL frameworks like SimCLR, BarlowTwins, DINO, and Masked Autoencoders (MAE).

Experimental Evaluation

We evaluated LA-SSL on three benchmarks:

  • Corrupted CIFAR-10: A synthetic dataset with varying levels of noise-to-label correlation (95% to 99.5%).
  • CelebA: A real-world face dataset where "Blond Hair" is spuriously correlated with "Gender."
  • MIMIC-CXR: A large-scale chest X-ray dataset where "Age" is correlated with "No Findings."

Results and Discussion

LA-SSL consistently outperforms standard uniform sampling. Spectral analysis reveals that LA-SSL produces a "flatter" distribution of singular values, indicating that the model captures a more diverse set of features rather than compressing information into a few dominant shortcut features.

Performance comparison of SimCLR vs. LA-SSL on CelebA and MIMIC-CXR datasets across AUC, Precision, and Recall metrics.

Key quantitative gains include:

  • Corrupted CIFAR-10: At the 95% correlation setting, LA-SSL improved downstream classification accuracy from 44.08% to 48.02%.
  • CelebA: For the minority group (blond males), LA-SSL significantly boosted precision (from 63.80% to 66.66%) and recall (from 37.22% to 38.88%).
  • MIMIC-CXR: In the medical domain, LA-SSL improved the Area Under the Curve (AUC) for the underperforming "Old" patient subgroup from 73.75 to 74.89.

Conclusion

LA-SSL provides a robust, label-free method for de-biasing SSL models by exploiting internal learning dynamics. While highly effective, the method assumes that "good" features are harder to learn than spurious ones. Future work could explore scenarios where multiple attributes share similar learning speeds or integrate interpretability tools to identify the specific shortcuts being mitigated.

Summary updated

BibTeX
@article{zhu2025making,
  author = {Weicheng Zhu and Sheng Liu and Carlos Fernandez-Granda and Narges Razavian},
  title = {{Making Self-supervised Learning Robust to Spurious Correlation via Learning-speed Aware Sampling}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2025},
  url = {https://openreview.net/forum?id=gxGHSViEA5},
}
Figure