Disentangling Adversarial Robustness and Generalization.

David Stutz, Matthias Hein, Bernt Schiele · DOI

Abstract

Obtaining deep networks that are robust against adversarial examples and generalize well is an open problem. A recent hypothesis even states that both robust and accurate models are impossible, i.e., adversarial robustness and generalization are conflicting goals. In an effort to clarify the relationship between robustness and generalization, we assume an underlying, low-dimensional data manifold and show that:

  1. regular adversarial examples leave the manifold;
  2. adversarial examples constrained to the manifold, i.e., on-manifold adversarial examples, exist;
  3. on-manifold adversarial examples are generalization errors, and on-manifold adversarial training boosts generalization;
  4. regular robustness and generalization are not necessarily contradicting goals. These assumptions imply that both robust and accurate models are possible. However, different models (architectures, training strategies etc.) can exhibit different robustness and generalization characteristics. To confirm our claims, we present extensive experiments on synthetic data (with known manifold) as well as on EMNIST, Fashion-MNIST and CelebA.

Introduction

In deep learning, adversarial examples—imperceptible perturbations that cause misclassification—pose a significant challenge. A prominent theory suggests an inherent trade-off between a model's standard accuracy and its adversarial robustness. This paper challenges that notion by introducing the perspective of the data manifold: the lower-dimensional subspace where natural data resides. By distinguishing between perturbations that move data off this manifold versus those that stay on it, we demonstrate that robustness and generalization are not inherently at odds.

Disentangling Adversarial Examples

The core of this work lies in differentiating two types of adversarial attacks:

  1. Regular (Off-Manifold) Adversarial Examples: Standard attacks (e.g., PGD) typically add high-frequency noise that moves the image into regions of the input space with near-zero probability under the true data distribution.
  2. On-Manifold Adversarial Examples: These perturbations are constrained to stay within the data manifold. They represent semantic changes that are "natural" but still lead to misclassification.
Conceptual overview of regular vs. on-manifold adversarial examples.

By analyzing these two categories, we can clarify how robustness to each relates to standard test accuracy (generalization).

Methodology

To find on-manifold adversarial examples, we utilize generative models (VAE-GANs) to approximate the data manifold. We then search for perturbations in the latent space that, when decoded, result in misclassified images that still appear realistic. We test our hypotheses on standard benchmarks (EMNIST, Fashion-MNIST, CelebA) and a custom synthetic dataset, FONTS, where the "true" manifold is known by construction, allowing for rigorous verification.

Key Findings

Regular Robustness vs. Generalization

Our experiments show that regular adversarial examples are significantly further from the data manifold than natural test images. Interestingly, for a fixed model architecture, increasing training data improves generalization but has negligible impact on robustness against these off-manifold attacks. This suggests that regular robustness and standard generalization are largely independent phenomena, rather than conflicting ones.

On-Manifold Robustness IS Generalization

An on-manifold adversarial example is essentially a "hard" natural example. Consequently, robustness to these examples is equivalent to good generalization. We found that on-manifold adversarial training acts as a powerful form of data augmentation. On the FONTS dataset, it significantly reduced test error, especially in low-data regimes.

Visual Realism and Semantic Changes

Unlike the grainy noise seen in regular attacks, on-manifold adversarial examples result in plausible semantic transformations. For instance, a shirt might be subtly altered to look like a pullover, or a digit '7' might be morphed into a '3'.

Visual comparison of regular vs. on-manifold attacks across different datasets.

Conclusion

This research demonstrates that the perceived trade-off between accuracy and robustness is not fundamental. Instead, it is a matter of sample complexity; robust models are harder to train because they must learn to ignore off-manifold noise while accurately mapping the manifold. By leveraging on-manifold training, we can actually improve a model's ability to generalize to new, natural data. Future work will focus on improving manifold approximation for high-resolution, complex datasets to further unlock these generalization benefits.

Summary updated

BibTeX
@inproceedings{stutz2018disentangling,
  author = {David Stutz and Matthias Hein and Bernt Schiele},
  title = {{Disentangling Adversarial Robustness and Generalization.}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  doi = {10.1109/cvpr.2019.00714},
}
Figure