Deep learning models are notoriously fragile, often failing when faced with "adversarial examples"—images subtly altered to trick a classifier—or even simple natural corruptions like fog or blur. While self-supervised learning (SSL) has emerged as a promising way to build more robust representations, the "how" and "why" remain murky. This paper from Los Alamos National Laboratory provides a systematic study on integrating SSL with adversarial training, revealing that the way you combine these techniques makes all the difference.
TL;DR
Self-supervised learning can significantly boost model robustness, but only if integrated correctly. The authors find that using self-supervision as a simple auxiliary task can actually hurt robustness against large attacks; instead, the most effective approach is "ensemble adversarial training," where the model is forced to defend against attacks targeting both supervised and self-supervised objectives simultaneously.
What Problem Does This Paper Address?
The core challenge is the vulnerability of Convolutional Neural Networks (CNNs). Standard training makes them "brittle." Adversarial Training (AT)—training on images already perturbed by an attacker—is the gold standard for defense, but it often comes at the cost of standard accuracy.
Recent work suggested that SSL (learning from the data itself without labels, e.g., by predicting image rotation) could improve robustness. However, there wasn't a clear consensus on the best way to use it: Should it be a pre-training step? An auxiliary loss during training? Does the specific task (like rotation vs. jigsaw puzzles) matter? This paper aims to untangle these variables.
Methods
The authors evaluate three primary ways to incorporate a self-supervised (SS) task into Adversarial Training (AT):
- SS T1 (Auxiliary Task): The model minimizes supervised loss on adversarial images and SS loss on clean images.
- SS T2 (Passive SS Defense): The model minimizes both losses on adversarial images, but the adversarial examples are generated using only the supervised loss.
- SS T3 (Ensemble Adversarial Training): The model minimizes both losses on adversarial images, and the adversarial examples are generated to fool both the supervised and SS heads.
They primarily used Rotation Prediction (predicting if an image is rotated 0, 90, 180, or 270 degrees) and Jigsaw Puzzle Solving as their self-supervised tasks.
Datasets
- CIFAR-10: The standard benchmark for small-scale image classification.
- CIFAR-10C: A variant of CIFAR-10 containing 15 types of natural corruptions (e.g., noise, blur, weather effects) at various intensities, used to test "out-of-distribution" robustness.
Key Insights and Ideas
- The "Devil is in the Details": Simply adding an auxiliary SS loss (SS T1) acts as a regularizer. It improves accuracy on clean images and small perturbations but causes a sharper performance drop as the strength of the attack ($\epsilon_{test}$) increases beyond what the model saw during training.
- Ensemble is King: The SS T3 approach is the clear winner for pure robustness. By generating adversaries that target both tasks, the model learns a more "ensemble-like" defense. This makes it much harder for an attacker to find a single perturbation that breaks the model.
- No "Magic" Task: There is nothing uniquely special about predicting rotations. Swapping it for a jigsaw puzzle task yielded very similar robustness gains, suggesting that the benefit comes from the structure of the multi-task objective rather than the specific semantic content of the task.
- Pre-training vs. In-training: While adversarial SS pre-training helps if you're starting from scratch, it provides no additional benefit if you are already using the SS T3 strategy during the main adversarial training phase.
Key Results
- Adversarial Robustness: In $l_\infty$ attacks (where $\epsilon_{train} = 8/255$), the SS T3 method achieved a robust accuracy of 38.76% at a high test-time perturbation ($\epsilon_{test} = 10/255$), compared to 34.60% for the standard baseline.
- Natural Corruptions: Adding SS loss (T1 and T2) improved mean accuracy across all CIFAR-10C corruptions from 78.36% to over 80%. However, the "robust" T3 method actually saw a slight drop in clean accuracy (down to ~76.5%), highlighting the classic trade-off between standard performance and extreme robustness.
Limitations and Future Work
The study is primarily limited to the CIFAR-10 dataset and ResNet architectures. While these are standard for research, the authors acknowledge that results might vary on larger, more complex datasets like ImageNet.
Future work could explore more complex self-supervised tasks (like contrastive learning) or investigate if these findings hold for different model families, such as Vision Transformers (ViTs), which have different inherent robustness properties than CNNs.
Summary updated