Benchmarking Robust Self-Supervised Learning Across Diverse Downstream Tasks

Antoni Kowalczuk, Jan Dubinski, Atiyeh Ashari Ghomi, Yi Sui, George Stein, Jiapeng Wu, Jesse C. Cresswell, Franziska Boenisch, Adam Dziedzic

TL;DR

While self-supervised vision foundation models excel at transferring to various downstream tasks, their adversarial robustness does not generalize as smoothly. This paper demonstrates that state-of-the-art defenses designed to secure these models actually fail against task-specific attacks on dense prediction tasks like semantic segmentation and depth estimation, while simultaneously degrading clean performance.

What Problem Does This Paper Address?

Vision foundation models trained via self-supervised learning (SSL)—such as DINO and DINOv2—have become highly popular due to their versatility. A single pre-trained encoder can be adapted to multiple downstream tasks, from simple image classification to complex, pixel-level dense predictions like semantic segmentation and depth estimation.

However, evaluating whether these foundation models are secure against adversarial attacks has historically been limited to a single task: image classification. This paper addresses a critical gap: Does adversarial robustness in SSL encoders transfer across diverse downstream tasks? If a foundation model is hardened against attacks in a task-agnostic way, does that protection hold up when a user deploys it for segmentation or depth estimation?

Methods

The authors propose a comprehensive framework to evaluate robustness at two distinct levels:

  1. Embedding-level Attack (EmbedAttack): A task-agnostic attack operating directly on the encoder's representation space. It introduces imperceptible perturbations to an input image to drastically alter the resulting embedding vector ($z$).
  2. Downstream Task Attacks: Task-specific attacks that leverage direct access to the final output of the downstream models. These include standard Projected Gradient Descent (PGD) for classification, SegPGD for semantic segmentation, and DepthPGD for depth estimation.
Overview of embedding-level vs. downstream task-specific adversarial attacks on an SSL framework.

To defend the models, the authors evaluate a state-of-the-art defense framework called Decoupled Adversarial Contrastive Learning (DeACL). DeACL uses knowledge distillation to fine-tune an encoder, forcing its adversarial embeddings to match the clean embeddings of a frozen, pre-trained model.

Datasets

The framework was benchmarked across a wide variety of standard computer vision datasets:

  • Linear Classification: CIFAR10, CIFAR100, and STL10.
  • Semantic Segmentation: ADE20k, CityScapes, and PASCAL VOC 2012.
  • Depth Estimation: NYU-Depth v2.
  • Pre-training & Defense Fine-tuning: ImageNet.

Key Insights and Ideas

  • The Defense is an Illusion for Dense Tasks: DeACL fine-tuning successfully defends encoders against the embedding-level attack (EmbedAttack). However, it remains almost entirely ineffective against task-specific downstream attacks like SegPGD and DepthPGD.
  • The Distribution Alignment Trap: The defense only showed a slight improvement against classification PGD attacks when evaluated on the STL10 dataset. Why? Because STL10 is a subset of ImageNet (the dataset used for DeACL fine-tuning). On completely different distributions like CIFAR10, the defense failed entirely against downstream PGD.
  • The Performance Trade-Off: Hardening the encoder via adversarial fine-tuning inherently degrades its "clean" performance (accuracy or mIoU on unperturbed images) across all downstream tasks.
  • Rapid Saturation: During adversarial fine-tuning, robustness against embedding attacks peaks very early (around 10 epochs), after which prolonged training yields diminishing returns and further harms clean data accuracy.

Key Results

  • Classification: On CIFAR10, a standard DINOv1 encoder's accuracy drops from 94% to 0% under a PGD attack. Applying the DeACL defense recovers EmbedAttack accuracy to 73%, but the downstream PGD attack still completely crushes it down to just 2%.
  • Semantic Segmentation: On the CityScapes dataset, both EmbedAttack and SegPGD reduce a standard encoder's mean Intersection over Union (mIoU) from ~0.65 to nearly 0.01. While DeACL mitigates EmbedAttack (bringing mIoU back up to 0.31), it leaves the model completely vulnerable to SegPGD (mIoU remains at a broken 0.03).
  • Depth Estimation: On NYU-Depth v2, adversarial attacks significantly increase the Root Mean Square Error (RMSE). DeACL fails to provide any notable protection against DepthPGD.
The evolution of model robustness across classification, segmentation, and depth estimation tasks during DeACL fine-tuning.

Limitations and Future Work

The primary limitation highlighted by this work is that current representation-layer defenses are too narrow; they protect the embedding space but fail to anticipate how downstream task adaptors can be exploited.

To build truly robust foundation models, the authors suggest shifting toward multi-perturbation adversarial training (simultaneously training against multiple attack types like $\ell_1, \ell_2, \ell_\infty$). Furthermore, they conclude that practitioners cannot rely solely on a hardened encoder; they must also perform robust fine-tuning specifically tailored to each intended downstream task.

Summary updated

Abstract

Large-scale vision models have become integral in many applications due to their unprecedented performance and versatility across downstream tasks. However, the robustness of these foundation models has primarily been explored for a single task, namely image classification. The vulnerability of other common vision tasks, such as semantic segmentation and depth estimation, remains largely unknown. We present a comprehensive empirical evaluation of the adversarial robustness of self-supervised vision encoders across multiple downstream tasks. Our attacks operate in the encoder embedding space and at the downstream task output level. In both cases, current state-of-the-art adversarial fine-tuning techniques tested only for classification significantly degrade clean and robust performance on other tasks. Since the purpose of a foundation model is to cater to multiple applications at once, our findings reveal the need to enhance encoder robustness more broadly. Our code is available at ${github.com/layer6ai-labs/ssl-robustness}$.
BibTeX
@misc{kowalczuk2024benchmarking,
  author = {Antoni Kowalczuk and Jan Dubinski and Atiyeh Ashari Ghomi and Yi Sui and George Stein and Jiapeng Wu and Jesse C. Cresswell and Franziska Boenisch and Adam Dziedzic},
  title = {{Benchmarking Robust Self-Supervised Learning Across Diverse Downstream Tasks}},
  year = {2024},
  eprint = {2407.12588},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.12588},
}
Figure