Enhancing Robust Representation in Adversarial Training: Alignment and Exclusion Criteria

Nuoyan Zhou, Decheng Liu, Dawei Zhou, Xinbo Gao, Nannan Wang · DOI

Abstract

Deep neural networks are vulnerable to adversarial noise. Adversarial Training (AT) has been demonstrated to be the most effective defense strategy to protect neural networks from being fooled. However, we find AT omits to learning robust features, resulting in poor performance of adversarial robustness. To address this issue, we highlight two criteria of robust representation: (1) Exclusion: the feature of examples keeps away from that of other classes; (2) Alignment: the feature of natural and corresponding adversarial examples is close to each other. These motivate us to propose a generic framework of AT to gain robust representation, by the asymmetric negative contrast and reverse attention. Specifically, we design an asymmetric negative contrast based on predicted probabilities, to push away examples of different classes in the feature space. Moreover, we propose to weight feature by parameters of the linear classifier as the reverse attention, to obtain class-aware feature and pull close the feature of the same class. Empirical evaluations on three benchmark datasets show our methods greatly advance the robustness of AT and achieve state-of-the-art performance.

Introduction

Deep Neural Networks (DNNs) are notoriously fragile; tiny, human-imperceptible adversarial perturbations can trick high-performing classifiers into making egregious errors. While Adversarial Training (AT) is the current gold standard for defense, it often results in a "defective" feature distribution. Standard AT models frequently cluster images from different classes too closely, leading to class confusion, while natural images and their adversarial counterparts are pushed too far apart, causing inconsistency.

To resolve this, we propose two fundamental geometric criteria for a robust feature space: Exclusion and Alignment. Exclusion ensures that features of different classes remain distinct, while Alignment ensures that a natural image and its adversarial twin share a similar representation.

Conceptual illustration of the feature space before and after optimization using the proposed criteria.

The ANCRA Framework

We introduce ANCRA (Asymmetric Negative Contrast and Reverse Attention), a framework designed to enforce these criteria without adding extra model parameters. The framework is built on three pillars:

1. Exclusion via Asymmetric Negative Contrast (ANC)

Standard contrastive learning can inadvertently push a sample into the territory of another class while trying to distance it from a third. ANC addresses this "class confusion" by using an asymmetric approach based on predicted probabilities. It surgically reduces the model's confidence in incorrect classes for "Other-class Examples" (OEs), ensuring clear boundaries between categories.

2. Alignment via Reverse Attention (RA)

To pull natural and adversarial features together, we propose Reverse Attention. This module uses the weights of the model's linear classifier to weight feature channels. Since images of the same class share the same classifier weights, this mechanism naturally pulls their features closer, making them "class-aware" and consistent across perturbations.

Overview of the ANCRA framework, detailing the Data Preprocessing, Reverse Attention, and Asymmetric Negative Contrast modules.

3. Targeted Negative Sampling

Instead of random negative samples, ANCRA utilizes targeted adversarial attacks to generate the most challenging negatives. This forces the model to learn sharper, more resilient decision boundaries by focusing on the most confusing examples.

Experimental Results

We evaluated ANCRA on CIFAR-10, CIFAR-100, and Tiny-ImageNet. The results demonstrate significant improvements over baseline AT methods:

  • Robustness Gains: On CIFAR-10, ANCRA increased robust accuracy against PGD attacks by approximately 40-45% compared to standard PGD-AT.
  • State-of-the-Art Performance: ANCRA outperformed top-tier defenses like AWP and MART. On the RobustBench leaderboard (ResNet-18), ANCRA-based models surpassed previous leaders by roughly 7% in robust accuracy.
  • Versatility: ANCRA acts as a "plug-and-play" enhancement that can be integrated into existing methods like TRADES or MART to consistently boost performance.

Conclusion

ANCRA addresses the fundamental flaws in the feature distributions produced by standard adversarial training. By enforcing Exclusion and Alignment through parameter-free mechanisms like Reverse Attention and Asymmetric Negative Contrast, we achieve a more robust and consistent representation. Future work will explore scaling these criteria to larger datasets and further refining the resilience of the attention mechanism to initial misclassifications.

Summary updated

BibTeX
@misc{zhou2023enhancing,
  author = {Nuoyan Zhou and Decheng Liu and Dawei Zhou and Xinbo Gao and Nannan Wang},
  title = {{Enhancing Robust Representation in Adversarial Training: Alignment and Exclusion Criteria}},
  year = {2023},
  eprint = {2310.03358},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.03358},
}
Figure