Skip to main content
QUICK REVIEW

[Paper Review] Adversarial Training for Free!

Ali Shafahi, Mahyar Najibi|arXiv (Cornell University)|Apr 29, 2019
Adversarial Robustness in Machine LearningComputer Science48 references2 citations
TL;DR

This paper proposes a novel 'free' adversarial training method that reuses gradient information from standard backpropagation to generate adversarial examples at no additional computational cost, achieving robustness comparable to PGD-based adversarial training. The approach enables training robust ImageNet models on a single workstation with 4x P100 GPUs in just two days, attaining 40% accuracy against PGD attacks.

ABSTRACT

Adversarial training, in which a network is trained on adversarial examples, is one of the few defenses against adversarial attacks that withstands strong attacks. Unfortunately, the high cost of generating strong adversarial examples makes standard adversarial training impractical on large-scale problems like ImageNet. We present an algorithm that eliminates the overhead cost of generating adversarial examples by recycling the gradient information computed when updating model parameters. Our "free" adversarial training algorithm achieves comparable robustness to PGD adversarial training on the CIFAR-10 and CIFAR-100 datasets at negligible additional cost compared to natural training, and can be 7 to 30 times faster than other strong adversarial training methods. Using a single workstation with 4 P100 GPUs and 2 days of runtime, we can train a robust model for the large-scale ImageNet classification task that maintains 40% accuracy against PGD attacks. The code is available at https://github.com/ashafahi/free_adv_train.

Motivation & Objective

  • To address the high computational cost of adversarial training, which limits its use in large-scale deep learning applications.
  • To eliminate the overhead of generating adversarial examples by reusing gradients from standard training.
  • To enable robust model training on large-scale datasets like ImageNet using modest computational resources.
  • To achieve robustness comparable to strong PGD-based adversarial training without incurring additional training time.

Proposed method

  • The method performs a single backward pass that simultaneously updates model parameters and adversarial perturbations using the same gradient computation.
  • It leverages the gradient of the loss with respect to input perturbations during backpropagation, avoiding separate forward passes for adversarial example generation.
  • The approach uses a non-targeted adversarial attack formulation, solving max_δ l(x+δ, y, θ) subject to ||δ||_∞ ≤ ϵ.
  • The algorithm integrates adversarial training into standard SGD by reusing the same backward pass for both model weights and perturbations.
  • It applies the same optimization scheme as natural training but includes perturbation updates in the same backward pass.
  • The method is compatible with standard deep learning frameworks and requires no architectural changes or additional components like GANs.

Experimental results

Research questions

  • RQ1Can adversarial training be made as efficient as natural training by reusing gradient computations?
  • RQ2Does reusing gradients for both model weights and perturbations maintain robustness comparable to PGD-based adversarial training?
  • RQ3Can this method scale to large-scale datasets like ImageNet with only modest hardware?
  • RQ4How does the robustness of 'free' adversarial training compare to PGD-based training under strong attacks?
  • RQ5Can higher-capacity models trained with this method achieve better robustness without increased training cost?

Key findings

  • The proposed 'free' adversarial training achieves 40% robust accuracy against PGD attacks on ImageNet using only 4x P100 GPUs and 2 days of training.
  • On CIFAR-10 and CIFAR-100, the method achieves robustness comparable to PGD-based adversarial training, with slight improvements in some cases.
  • Free training is 7 to 30 times faster than conventional adversarial training methods, with a 3.46× speedup over 2-PGD training.
  • ResNet-152 trained with free adversarial training achieves 36.99% robust accuracy under PGD-50 attacks, outperforming ResNet-50 by ~4% in robustness.
  • The method maintains high natural accuracy (64.446% for ResNet-152) while achieving strong robustness, demonstrating that capacity and robustness scale together.
  • The approach enables robust ImageNet training on a single workstation, making adversarial training accessible to labs without large-scale GPU clusters.

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.