Improving Robust Generalization with Diverging Spanned Latent Space

Owen Dou, Zhiqiang Gao, Hangchi Shen, Ziling Yuan, Shufei Zhang, Kaizhu HuangTMLR 2024

Abstract

Robust generalization (RG), concerning how deep neural networks could perform over adversarial examples generated from unseen dataset, has emerged as an active research topic. Albeit its crucial importance, most previous studies lack a well-founded theoretical analysis and certified error bounds. In this paper, we make a novel attempt to theoretically and empirically study how we could attain a better RG by learning discriminative representation, where the inconsistency of the inter-sample similarity matrix between clean and adversarial examples should be reduced. Our theoretical investigation discloses that introducing this inconsistency as a regularization term, named Gram matrix difference (GMD), will lead to tighter upper error bound and certify a better RG. Meanwhile, we demonstrate that previous efforts to reduce inter-class similarity and increase intra-class similarity among adversarial examples for enhanced adversarial robustness are approximate optimizations of our GMD approach. Furthermore, to avoid the vast optimization complexity introduced by the similarity matrix, we propose to optimize GMD by building a diverging spanned latent space for adversarial examples. On the algorithmic side, this regularization term is implemented as a novel adversarial training (AT) method --- Subspace Diverging (SD) --- to expand the volume difference between the whole latent space's linear span and subspaces' linear spans. Extensive experiments show that the proposed method can improve advanced AT methods and work remarkably well in various datasets including CIFAR-10, CIFAR-100, SVHN, and Tiny-ImageNet.

Introduction

Adversarial Training (AT) is the gold standard for defending neural networks, but it faces a persistent "robust generalization" problem. While a model might become nearly invincible against attacks on its training set, its performance often plummets when faced with adversarial examples generated from a test set. This is known as the robust accuracy gap.

The authors identify a key culprit: feature shift. Adversarial perturbations push data points away from their true class clusters. In the latent space, this manifests as an inconsistency in how samples relate to one another—adversarial examples show higher inter-class similarity and lower intra-class similarity than clean data. This paper provides a theoretical foundation and a practical algorithm, Subspace Diverging (SD), to minimize this inconsistency.

Methodology: Gram Matrix Difference and Subspace Diverging

The researchers propose a two-pronged approach to bridge the generalization gap:

  1. Gram Matrix Difference (GMD): They theoretically prove that the robust generalization error is upper-bounded by the difference between the "inter-sample relationship maps" (Gram matrices) of clean and adversarial data. Minimizing this difference theoretically guarantees better generalization.
  2. Subspace Diverging (SD): Since optimizing full Gram matrices is computationally expensive, the authors propose a proxy: maximizing the Volume Difference between the Whole latent space’s linear span and Subspaces’ linear spans (VDWS).
Inter-sample similarity matrices showing how FS+SD restores discriminative structure

As illustrated in the similarity matrices above, standard adversarial training (b) significantly disrupts the block-diagonal structure seen in clean data (a). The proposed FS+SD method (d) successfully restores this structure, ensuring that adversarial examples maintain relationships similar to their clean counterparts.

Experimental Results

The Subspace Diverging (SD) method was evaluated as a "plug-and-play" loss term added to existing AT frameworks like PGD-AT, TRADES, and AWP across multiple benchmarks including CIFAR-10, CIFAR-100, and Tiny-ImageNet.

Robust accuracy gap reduction across CIFAR-10, CIFAR-100, and Tiny-ImageNet

The results demonstrate a consistent reduction in the robust accuracy gap across all datasets. For instance, on CIFAR-10, adding SD to the AWP baseline boosted robust accuracy against PGD-20 attacks from 58.13% to 61.59%. On CIFAR-100, AWP+SD achieved 36.59% robust accuracy, outperforming the standard AWP at 33.86%. Crucially, the "robust accuracy gap" (the difference between training and test robust accuracy) was visibly reduced, confirming that the model wasn't just memorizing training-time attacks.

Conclusion

By shifting the focus from individual point-wise perturbations to the global geometry of the latent space, Subspace Diverging provides a theoretically grounded and empirically effective way to improve robust generalization. The method consistently improves state-of-the-art AT frameworks, making them more resilient to unseen adversarial examples. Future work may explore applying these "diverging spanned latent spaces" to fields like unsupervised domain adaptation or out-of-distribution detection.

Summary updated

BibTeX
@article{dou2024improving,
  author = {Owen Dou and Zhiqiang Gao and Hangchi Shen and Ziling Yuan and Shufei Zhang and Kaizhu Huang},
  title = {{Improving Robust Generalization with Diverging Spanned Latent Space}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=GdaP6GgvfN},
}
Figure