Robust Pre-Training by Adversarial Contrastive Learning

Ziyu Jiang, Tianlong Chen, Ting Chen, Zhangyang Wang

TL;DR

Adversarial Contrastive Learning (ACL) is a novel pre-training framework designed to build deep learning models that are both highly accurate and resilient to adversarial attacks. By integrating adversarial perturbations into a self-supervised contrastive learning pipeline, ACL demonstrates that models can learn robust representations from unlabeled data. This approach significantly outperforms previous state-of-the-art methods, even when labeled data is extremely scarce (e.g., using only 1% of available labels).

The Challenge of Robustness-Aware Pre-Training

Deep neural networks are notoriously fragile; a tiny, imperceptible "adversarial perturbation" added to an image can easily trick a model into misclassifying it. While Adversarial Training (AT)—training the model on these malicious examples—is an effective defense, it comes with a high "sample complexity" cost. In other words, making a model robust traditionally requires significantly more labeled data than standard training.

Because labeling data is expensive and time-consuming, researchers have increasingly turned to Self-Supervised Learning (SSL) to learn useful representations from raw, unlabeled data. However, most SSL methods focus purely on standard accuracy, neglecting robustness. This paper tackles the challenge of "robustness-aware" pre-training: leveraging unlabeled data to build a foundational model that is naturally resistant to adversarial attacks.

Methods: Injecting Adversarial Attacks into Contrastive Learning

The authors build upon the popular contrastive learning framework, SimCLR. In standard SimCLR, a model is taught that two different "views" (random augmentations) of the same image should have similar internal representations.

ACL modifies this process by injecting adversarial attacks. The authors explored three main variants to formulate the contrastive task:

Workflow comparison of ACL variants
  1. Adversarial-to-Adversarial (A2A): Both views of the image are perturbed by an adversarial attack (using Projected Gradient Descent, or PGD).
  2. Adversarial-to-Standard (A2S): One view is adversarially perturbed, while the other remains a "clean" standard augmentation.
  3. Dual Stream (DS): Identified as the optimal solution, this variant combines a standard contrastive stream (clean-to-clean) with an adversarial stream (attacked-to-attacked).

A critical technical insight in the ACL framework is the use of Dual Batch Normalization (BN). Because clean images and adversarial images possess fundamentally different statistical distributions, forcing them through the same BN layers confuses the model. ACL uses independent BN parameters for the standard and adversarial branches, allowing the network to learn high-quality features for both domains simultaneously.

Key Insights

  • Robustness as Feature Invariance: Adversarial fragility often stems from a "non-smooth" feature space, where small input changes lead to massive jumps in internal representations. Contrastive learning is an ideal antidote because its core objective is to make representations invariant to input changes.
  • The Power of the Dual Stream: The A2A approach proved to be "too aggressive," often degrading standard accuracy. The Dual Stream (DS) approach acts as a regularizer, perfectly balancing the need for high standard accuracy with the demand for robust features.
  • Label Efficiency Breakthrough: By building a robust foundation during the unsupervised pre-training phase, the model requires very few labels during fine-tuning to achieve high performance, effectively inheriting the label efficiency of standard contrastive learning.

Key Results

ACL (DS) sets a new state-of-the-art for unsupervised robust pre-training. Evaluated on standard computer vision benchmarks, it consistently outperforms existing methods.

Performance comparison of RI, Selfie, and ACL(DS)

As shown above, on the CIFAR-10 dataset, ACL outperforms the previous best method (Selfie) by 2.99% in robust accuracy and 2.14% in standard accuracy.

The results are even more dramatic in semi-supervised settings. When only 1% of labels are available on CIFAR-10, ACL achieves a robust accuracy of 50.67%. For comparison, the previous state-of-the-art (UAT++) only reached 30.46% under the same constraints. Furthermore, the authors demonstrated that ACL (DS) provides superior protection against a wide variety of unforeseen image corruptions (tested on CIFAR-10-C), proving that the learned robustness generalizes well beyond the specific attacks seen during training.

Limitations and Future Work

While highly effective, the authors note a few areas for further exploration:

  • Computational Cost: Generating adversarial examples via PGD during the pre-training phase is computationally expensive compared to standard SSL.
  • Scaling: The experiments were primarily conducted on the CIFAR datasets. Testing the scalability of ACL on much larger datasets, such as ImageNet, is a logical next step.
  • Attack Diversity: The current work focuses on $\ell_\infty$ norm perturbations. Future iterations could incorporate a wider variety of adversarial attack types to create even more general-purpose robust models.

Summary updated

BibTeX
@inproceedings{jiang2020robust,
  author = {Ziyu Jiang and Tianlong Chen and Ting Chen and Zhangyang Wang},
  title = {{Robust Pre-Training by Adversarial Contrastive Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=NGZXzm187Hv},
}
Figure