Self-Supervised Adversarial Training

Kejiang Chen, Yuefeng Chen, Hang Zhou, Xiaofeng Mao, Yuhong Li, Yuan He, Hui Xue, Weiming Zhang, Nenghai Yu

TL;DR

This paper introduces Self-supervised Adversarial Training (SAT), a novel defense mechanism that leverages self-supervised learning and mutual information maximization to build neural networks resilient to adversarial attacks. By combining k-Nearest Neighbor (kNN) classification with a training objective that forces clean and adversarial images to share similar feature representations, the authors achieve significant robustness gains—especially on datasets with limited labeled data.

What Problem Does This Paper Address?

Deep learning models are notoriously "brittle." A tiny, invisible-to-humans perturbation (an adversarial example) can trick a state-of-the-art classifier into making a confident, wrong prediction.

While Adversarial Training (AT)—training a model on these malicious examples—is the most effective defense, it usually requires a massive amount of labeled data and often significantly degrades the model's accuracy on "clean" (unperturbed) images. The authors observe that Self-supervised Learning (SSL), which learns representations from the data itself without human labels, naturally tends to produce more robust and semantic embeddings. They set out to bridge the gap between SSL's natural robustness and the explicit defense power of adversarial training.

Methods

The authors propose a two-pronged approach:

  1. SSL + kNN Classification: Instead of using a standard linear layer (which has a rigid decision boundary), they use a pre-trained self-supervised model (like AMDIM) as a feature extractor and a k-Nearest Neighbor (kNN) classifier. The intuition is that even if an adversarial attack moves a sample across a linear boundary, it likely remains closer to its original neighbors in the high-dimensional feature space.
  2. Self-supervised Adversarial Training (SAT): To further harden the model, they introduce a training phase that maximizes the Mutual Information (MI) between the representations of clean images ($z$) and their adversarial counterparts ($\hat{z}$).
  3. Adversarial Generation: They generate adversarial examples by perturbing images to move their features away from their original cluster in the feature space.
  4. MI Maximization: Using a Noise Contrastive Estimator (NCE), the model is updated to ensure that the feature representation of a "poisoned" image is as similar as possible to its original clean version, while remaining distinct from other unrelated images.

Crucially, this entire defense process does not require ground-truth labels, making it highly flexible for semi-supervised or unsupervised settings.

Datasets

The researchers evaluated their method on two standard computer vision benchmarks:

  • CIFAR-10: 60,000 small (32x32) images across 10 classes.
  • STL-10: 10 classes, but designed for unsupervised learning with 100,000 unlabeled images and only 5,000 labeled ones. Images were resized to 64x64 for the experiments.

Key Insights and Ideas

  • The "Natural" Robustness of SSL: Self-supervised features are inherently more resistant to attacks than supervised ones. On CIFAR-10, a standard self-supervised model had a Defense Success Rate (DSR) of ~52%, compared to only ~19% for a supervised model.
  • kNN as a Robust Head: The paper demonstrates that kNN is a more robust "decision maker" than Linear Regression (LR). Because kNN relies on local density rather than a global hyperplane, it is harder for small perturbations to "flip" the predicted class.
  • Feature-Space Alignment: By maximizing mutual information, SAT effectively "collapses" the distance between a clean image and its adversarial version in the latent space. This forces the network to ignore the adversarial noise and focus on the underlying semantic content.

Key Results

  • Superiority over Supervised Learning: On CIFAR-10, the self-supervised approach (SSL) achieved a 51.9% DSR against small perturbations, dwarfing the supervised version's 18.7%.
  • Effectiveness on STL-10: On the label-scarce STL-10 dataset, the SSL approach actually outperformed supervised learning in both clean accuracy (86.13% vs 75.41%) and robustness.
  • SAT vs. Traditional AT: While traditional adversarial training (like MAT or ALP) performs slightly better when labels are abundant (CIFAR-10), SAT is significantly more efficient in terms of training time and performs better on datasets with few labels (STL-10).
  • Optimization Resistance: The $\ell_2$ distance required to successfully attack the SSL model was nearly double that of the supervised model, indicating a much higher "barrier to entry" for attackers.

Limitations and Future Work

  • Clean Accuracy Trade-off: Like most adversarial defense methods, there is a slight drop in accuracy on clean images when SAT is applied compared to pure SSL.
  • Computational Cost: Generating adversarial examples during the training loop is still computationally expensive, though the authors note SAT is faster than some supervised alternatives.
  • Scaling: While the results on STL-10 are promising, future work is needed to see how these self-supervised defenses scale to massive, high-resolution datasets like ImageNet.
  • Future Direction: The authors suggest exploring how to design self-supervised tasks that naturally encourage even stronger robustness without explicit adversarial training.

Summary updated

BibTeX
@inproceedings{chen2020self,
  author = {Kejiang Chen and Yuefeng Chen and Hang Zhou and Xiaofeng Mao and Yuhong Li and Yuan He and Hui Xue and Weiming Zhang and Nenghai Yu},
  title = {{Self-Supervised Adversarial Training}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2020},
  doi = {10.1109/icassp40776.2020.9054475},
}
Figure