Downstream-agnostic Adversarial Examples

Ziqi Zhou, Shengshan Hu, Ruizhi Zhao, Qian Wang, Leo Yu Zhang, Junhui Hou, Hai Jin

Abstract

Self-supervised learning (SSL) has revolutionized the deployment of deep learning models by providing high-quality, pre-trained encoders that serve as general-purpose feature extractors. However, this "pre-train once, use everywhere" paradigm introduces a significant security bottleneck: a single vulnerability in an encoder can be inherited by any downstream application. This paper introduces AdvEncoder, a framework designed to generate downstream-agnostic universal adversarial examples. By exploiting the texture-based biases of SSL encoders through high-frequency component (HFC) targeting, AdvEncoder produces perturbations and patches that effectively disrupt a wide variety of downstream tasks—including classification, image retrieval, and object detection—without requiring knowledge of the specific task or the user's dataset. Our evaluation across 14 SSL methods demonstrates that these vulnerabilities are deeply embedded in the encoders and resistant to standard defensive measures.

Introduction

In the current AI landscape, companies like Google and Meta release massive pre-trained encoders (such as SimCLR, MoCo, or DINO) that act as the foundation for specialized models. Developers typically take these encoders, append a task-specific head, and fine-tune them with limited labeled data. While efficient, this architecture creates a massive security risk. Traditional adversarial attacks are task-specific, requiring the attacker to know the target label (e.g., misclassifying a "cat" as a "toaster"). In the context of SSL, the attacker faces a unique challenge: creating a single adversarial perturbation that remains effective regardless of the downstream task the user eventually builds.

AdvEncoder addresses this challenge by shifting the focus from label-based deception to feature-space disruption. By targeting the fundamental ways encoders represent data, AdvEncoder creates "universal" noise that breaks the utility of the feature extractor itself.

Methodology

AdvEncoder is a generative attack framework. Rather than optimizing noise for a single image, it trains a generator network to produce universal adversarial noise. The framework relies on three core pillars to ensure the attack is both effective and stealthy.

1. Frequency-based Guidance

Deep Neural Networks (DNNs) are known to be biased toward image textures rather than global shapes. SSL encoders, which learn representations without semantic labels, are particularly reliant on these low-level features. AdvEncoder exploits this by utilizing a High-Frequency Component (HFC) filter. The attack specifically targets and alters the high-frequency texture information, which is critical for how encoders distinguish between different data points.

2. Multi-Part Loss Function

To guide the generator, the authors employ a composite loss function:

  • Adversarial Loss ($L_{adv}$): This utilizes the InfoNCE loss to maximize the distance in the latent space between the original image's feature vector and the poisoned image's feature vector.
  • HFC Loss ($L_{hfc}$): This maximizes the discrepancy between the high-frequency components of the original and poisoned images, specifically disrupting texture-based recognition.
  • Quality Loss ($L_q$): This ensures the perturbation remains small and visually subtle, maintaining the "stealth" required for an effective adversarial attack.

3. Attack Variants

The framework supports two primary attack modes:

  • Adv-PER (Perturbation): A subtle, global noise layer added across the entire image.
  • Adv-PAT (Patch): A localized, visible adversarial sticker placed on the image, which often proves more robust against certain defenses.

Experimental Evaluation

The authors conducted an exhaustive evaluation involving 14 different SSL methods, including MoCo v2/v3, SimCLR, BYOL, DINO, and Barlow Twins. The attack generators were trained on surrogate datasets (CIFAR10 and ImageNet) and tested on diverse downstream datasets such as STL10 and GTSRB (Traffic Signs). The evaluation spanned multiple tasks, including image classification, retrieval, object detection, and semantic segmentation.

Key Insights and Results

Texture as the Achilles' Heel

The research confirms that because SSL encoders lack semantic guidance during pre-training, they rely heavily on texture. By "blinding" the encoder to these high-frequency features, AdvEncoder effectively collapses the encoder's ability to produce meaningful representations. This results in feature space clustering, where adversarial images are grouped together regardless of their original content, making it impossible for downstream classifiers to draw clean decision boundaries.

High Success and Transferability

The results were stark. Adv-PAT (the patch attack) achieved an average Attack Success Rate (ASR) of over 90% across 224 experimental settings. Furthermore, the attacks proved to be highly transferable; a generator trained to attack a SimCLR encoder could successfully fool a MoCo or BYOL encoder. This suggests that the underlying vulnerabilities are common across different SSL architectures.

Task Agnosticism

A critical finding was the validation of the "downstream-agnostic" claim. Attacks generated using a simple classification surrogate were equally effective at breaking image retrieval and object detection tasks. This proves that the vulnerability is "baked into" the encoder's weights and persists even after the model is fine-tuned on a completely different dataset.

Resistance to Defense

The authors tested four common defensive strategies: Gaussian noise, fine-tuning, pruning, and adversarial training. While adversarial training provided some protection against subtle perturbations (Adv-PER), the Adv-PAT (patch) remained almost entirely unaffected. This highlights a significant gap in current SSL security protocols.

Conclusion

AdvEncoder demonstrates that the current paradigm of sharing pre-trained SSL encoders carries inherent risks. The reliance on texture-based features makes these models highly susceptible to downstream-agnostic attacks that are difficult to defend against with standard techniques. As SSL continues to grow in popularity, there is an urgent need for specialized defense mechanisms designed to "purify" encoders and ensure that vulnerabilities are not inherited by the vast ecosystem of downstream applications.

Summary updated

BibTeX
@inproceedings{zhou2023downstream,
  author = {Ziqi Zhou and Shengshan Hu and Ruizhi Zhao and Qian Wang and Leo Yu Zhang and Junhui Hou and Hai Jin},
  title = {{Downstream-agnostic Adversarial Examples}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  url = {https://openreview.net/forum?id=83NZbaxfC6},
}
Figure