Skip to main content
QUICK REVIEW

[Paper Review] Online Adversarial Purification based on Self-Supervision

Changhao Shi, Chester Holtz|arXiv (Cornell University)|Jan 23, 2021
Adversarial Robustness in Machine LearningComputer Science33 references12 citations
TL;DR

This paper proposes Self-supervised Online Adversarial Purification (SOAP), a test-time defense that leverages self-supervised representation learning to purify adversarial examples without retraining. By jointly optimizing classification and a label-independent self-supervised task during training, SOAP enables iterative, gradient-based purification at inference time, achieving competitive robust accuracy against strong adversaries with minimal training overhead and robustness even when adversaries know the defense strategy.

ABSTRACT

Deep neural networks are known to be vulnerable to adversarial examples, where a perturbation in the input space leads to an amplified shift in the latent network representation. In this paper, we combine canonical supervised learning with self-supervised representation learning, and present Self-supervised Online Adversarial Purification (SOAP), a novel defense strategy that uses a self-supervised loss to purify adversarial examples at test-time. Our approach leverages the label-independent nature of self-supervised signals and counters the adversarial perturbation with respect to the self-supervised tasks. SOAP yields competitive robust accuracy against state-of-the-art adversarial training and purification methods, with considerably less training complexity. In addition, our approach is robust even when adversaries are given knowledge of the purification defense strategy. To the best of our knowledge, our paper is the first that generalizes the idea of using self-supervised signals to perform online test-time purification.

Motivation & Objective

  • To address the vulnerability of deep neural networks to adversarial examples, which can misclassify inputs with imperceptible perturbations.
  • To reduce the computational burden of adversarial training by shifting robustness to test-time purification.
  • To explore whether self-supervised signals—being label-agnostic—can be used to detect and reverse adversarial perturbations.
  • To design a defense that remains effective even when adversaries are aware of the purification mechanism.
  • To generalize adversarial purification beyond image-specific autoencoders or GANs by using versatile self-supervised pretext tasks.

Proposed method

  • Jointly train a deep neural network on a classification head and an auxiliary self-supervised task (e.g., rotation prediction, contrastive learning, or reconstruction) during standard training.
  • At test time, apply iterative projected gradient descent (PGD) to minimize the self-supervised loss while keeping the classifier input fixed, effectively purifying the input toward the clean data manifold.
  • Use a shared encoder for both classification and purification, ensuring that the same representation is used for both tasks.
  • Define a combined objective for adversarial attacks that jointly optimize for cross-entropy loss and the auxiliary self-supervised loss, simulating an adversary aware of the purification mechanism.
  • Select self-supervised tasks that are invariant to label shifts but sensitive to distributional shifts caused by adversarial noise, enabling effective perturbation correction.
  • Apply the purification process iteratively until convergence, using the auxiliary loss as a regularizer to guide the input toward a clean, natural representation.

Experimental results

Research questions

  • RQ1Can self-supervised representation learning be used to purify adversarial examples at test time without requiring retraining or model fine-tuning?
  • RQ2Does the label-independence of self-supervised signals make them effective for detecting and reversing adversarial perturbations?
  • RQ3Can a test-time purification method achieve robust accuracy competitive with state-of-the-art adversarial training while reducing training complexity?
  • RQ4Is the defense robust even when adversaries are aware of the purification mechanism and can adapt their attacks accordingly?
  • RQ5Can this approach generalize beyond images and be applied to other data modalities with appropriate self-supervised tasks?

Key findings

  • SOAP achieves competitive robust accuracy on MNIST and CIFAR-10, outperforming standard adversarial training in some settings, especially under black-box FGSM attacks.
  • On the FCN architecture, SOAP-DR (reconstruction-based) achieves 97.57% robust accuracy under FGSM black-box attacks, surpassing FGSM adversarial training (79.76%) and approaching PGD adversarial training (96.02%).
  • When adversaries are aware of the defense and optimize against both the classification and auxiliary loss, the attack success rate decreases, particularly for reconstruction and label consistency tasks.
  • For rotation prediction, robust accuracy remains stable across varying attack trade-off parameters, indicating higher sensitivity to such attacks compared to other tasks.
  • The method maintains strong performance even when the adversary uses a substitute model to generate black-box adversarial examples, demonstrating resilience in transfer-based attack scenarios.
  • The test-time purification adds negligible computational cost per sample, making it practical for real-world deployment.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.