Is PGD-Adversarial Training Necessary? Alternative Training via a Soft-Quantization Network with Noisy-Natural Samples Only

Tianhang ZhengarXiv 2018 · arXiv

TL;DR

This paper challenges the necessity of computationally expensive PGD adversarial training for robust deep learning models. They propose a novel training paradigm using a "soft-quantization" layer and noisy natural samples, achieving comparable robustness to PGD training but with significant speedups, even enabling robust training on ImageNet in just two days.

What Problem Does This Paper Address?

Deep neural networks (DNNs), despite their impressive performance, are notoriously vulnerable to adversarial attacks. Projected Gradient Descent (PGD) adversarial training has emerged as the state-of-the-art defense, significantly improving robustness against first-order attacks. However, PGD adversarial training is computationally prohibitive, especially for large datasets like ImageNet, as it requires generating adversarial examples for each training step. This high cost limits its practical applicability. The paper questions whether this expensive method is truly indispensable for achieving robust models.

Methods

The core of the proposed solution lies in reformulating the min-max objective of PGD adversarial training into a minimization problem. This new objective aims to minimize the original network loss plus the $l_1$ norms of its gradients across the entire data space.

  1. Soft-Quantization Layer: To address the $l_1$ norm minimization, the authors introduce a differentiable "soft-quantization" layer. This layer, placed after the input layer, approximates hard quantization but crucially provides finite gradients, allowing for gradient-based optimization. When trained with noisy natural samples, this layer encourages near-zero gradients in most data regions.
  2. Noisy-Natural Sample Training: The soft-quantization network is trained using natural samples that are augmented with uniform random noise. This noise injection is key to smoothing out the remaining "sharp" gradient areas, further enhancing robustness and approximating the effect of adversarial training without explicitly generating adversarial examples.

The authors show that this combination of soft-quantization and noisy-natural sample training effectively approximates the objective of PGD adversarial training, leading to robust models.

Datasets

The proposed method was evaluated on the following standard datasets:

  • MNIST
  • CIFAR-10
  • ImageNet

Key Insights and Ideas

  • Challenging the PGD Orthodoxy: The paper directly questions the necessity of PGD adversarial training, a widely accepted but computationally expensive defense.
  • Gradient Norm Minimization as a Robustness Proxy: The insight that minimizing the $l_1$ norm of gradients is a viable path to robustness, equivalent to the inner maximization step in PGD training, is central.
  • Soft-Quantization as a Differentiable Gradient Smoother: The soft-quantization layer acts as a clever mechanism to enforce low gradients, making the model less susceptible to small perturbations.
  • Noisy Training for Smoothness: Using noisy natural samples is a computationally efficient way to smooth out the remaining sharp gradient regions, complementing the soft-quantization layer.
  • Enabling Robustness on Large-Scale Datasets: The method's efficiency makes robust training on datasets like ImageNet feasible for the first time within practical timeframes.

Key Results

  • Comparable Robustness: The proposed soft-quantization network (NSQ) achieved comparable classification accuracy to PGD-adversarially-trained models under PGD and BPDA attacks on MNIST, CIFAR-10, and ImageNet.
  • Significant Speedup:
    • On MNIST, the NSQ method achieved a 24X speedup compared to PGD adversarial training, with training times reduced from hours to minutes.
  • On CIFAR-10, the NSQ training took 9 hours compared to over 3 days for PGD adversarial training.
  • ImageNet Breakthrough: For the first time, the paper demonstrates fine-tuning a robust ImageNet model within two days, a feat practically impossible with PGD adversarial training.
  • Performance on Smaller Perturbations: On MNIST, NSQ even surpassed PGD adversarial training under BPDA attacks when $l_\infty$ perturbations were smaller than 0.1/1.0.
  • State-of-the-Art on CIFAR-10: The white-box result on CIFAR-10 is noted as the second-best, only behind PGD adversarial training and its variants.
  • Strong ImageNet Performance: The method achieved significantly better Top-1 and Top-5 accuracies under PGD and BPDA attacks on ImageNet compared to a baseline, demonstrating its effectiveness on large-scale data.

Limitations and Future Work

  • Focus on $l_\infty$ Attacks: The defense method, like PGD adversarial training, primarily focuses on $l_\infty$ bounded adversarial attacks. It may be vulnerable to other types of attacks, such as CW-L2 or EAD.
  • Gradient Masking: The soft-quantization layer can induce gradient masking, which the authors address by evaluating against BPDA attacks. However, this is an inherent characteristic of their defense.
  • Hyperparameter Tuning: The performance of the soft-quantization layer depends on hyperparameters like $K$ (number of quantization levels) and $\alpha$ (sharpness parameter). While the paper provides guidance, optimal tuning might still be dataset-dependent.
  • Future Directions:
    • Investigating smarter designs for defense layers beyond simple soft-quantization.
  • Exploring the incorporation of some adversarial samples (e.g., FGSM) into the training stage, which are cheaper to generate than PGD samples, to further improve robustness.
  • Developing defenses that are robust to a wider range of adversarial attack types.

Summary updated

Abstract

Recent work on adversarial attack and defense suggests that PGD is a universal $l_\infty$ first-order attack, and PGD adversarial training can significantly improve network robustness against a wide range of first-order $l_\infty$-bounded attacks, represented as the state-of-the-art defense method. However, an obvious weakness of PGD adversarial training is its highly-computational cost in generating adversarial samples, making it computationally infeasible for large and high-resolution real datasets such as the ImageNet dataset. In addition, recent work also has suggested a simple "close-form" solution to a robust model on MNIST. Therefore, a natural question raised is that is PGD adversarial training really necessary for robust defense? In this paper, we give a negative answer by proposing a training paradigm that is comparable to PGD adversarial training on several standard datasets, while only using noisy-natural samples. Specifically, we reformulate the min-max objective in PGD adversarial training by a problem to minimize the original network loss plus $l_1$ norms of its gradients w.r.t. the inputs. For the $l_1$-norm loss, we propose a computationally-feasible solution by embedding a differentiable soft-quantization layer after the network input layer. We show formally that the soft-quantization layer trained with noisy-natural samples is an alternative approach to minimizing the $l_1$-gradient norms as in PGD adversarial training. Extensive empirical evaluations on standard datasets show that our proposed models are comparable to PGD-adversarially-trained models under PGD and BPDA attacks. Remarkably, our method achieves a 24X speed-up on MNIST while maintaining a comparable defensive ability, and for the first time fine-tunes a robust Imagenet model within only two days. Code is provided on \url{https://github.com/tianzheng4/Noisy-Training-Soft-Quantization}
BibTeX
@misc{zheng2018is,
  author = {Tianhang Zheng},
  title = {{Is PGD-Adversarial Training Necessary? Alternative Training via a Soft-Quantization Network with Noisy-Natural Samples Only}},
  year = {2018},
  eprint = {1810.05665},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1810.05665},
}
Figure