Robust Representation Learning via Asymmetric Negative Contrast and Reverse Attention

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

Introduction

Deep Neural Networks (DNNs) are highly susceptible to Adversarial Examples (AEs)—inputs with imperceptible perturbations designed to cause misclassification. While Adversarial Training (AT) is a standard defense, it often results in "defective" internal feature distributions. Specifically, models often fail in two ways: Lack of Exclusion, where features of different classes are clustered too closely, and Lack of Alignment, where natural images and their adversarial counterparts are mapped to distant points in the feature space.

Conceptual illustration of feature space optimization: (a) shows the defective distribution before optimization, and (b) shows the desired state after applying exclusion and alignment criteria.

The ANCRA Framework

To address these defects, we propose ANCRA (Asymmetric Negative Contrast and Reverse Attention), a training framework that enforces representation robustness through two novel mechanisms.

Asymmetric Negative Contrast (ANC)

Standard contrastive learning often suffers from "class confusion," where pushing a negative sample away inadvertently pushes a natural sample toward an incorrect class boundary. ANC mitigates this by using an asymmetric loss function. It "freezes" the gradient of the natural example while pushing the negative (other-class) example away based on predicted probabilities. This ensures that the feature space remains cleanly separated without distorting the representation of the original class.

Reverse Attention (RA)

Reverse Attention is a parameter-free mechanism that leverages the final linear classifier's weights as an "attention map." Since these weights encode the model's learned definition of a class, multiplying internal features by these weights forces features of the same class to align more closely. This "teacher" mechanism from the classifier helps refine intermediate representations to be more class-distinctive and robust.

The ANCRA framework overview, including Data Preprocessing (DP), the Computation Process with Reverse Attention (RA) modules, and the Asymmetric Negative Contrast (ANC) loss calculation.

Experimental Results

The ANCRA framework was evaluated on CIFAR-10, CIFAR-100, and Tiny-ImageNet by integrating it into established AT baselines like PGD-AT, TRADES, and MART.

The improvements were substantial. For instance, on CIFAR-10, applying ANCRA to PGD-AT increased robust accuracy against PGD attacks from 44.35% to 89.03%. Furthermore, ANCRA-based models achieved state-of-the-art performance on the RobustBench leaderboard for ResNet-18 architectures without extra data, outperforming previous methods by approximately 7%.

Conclusion and Future Work

ANCRA demonstrates that focusing on the quality of the internal feature space—specifically through exclusion and alignment—can yield significant gains in adversarial robustness. While the current implementation depends on the accuracy of initial predicted classes for the RA module, future research will explore more resilient attention mechanisms and the application of these criteria to other domains such as Natural Language Processing.

Summary updated

BibTeX
@misc{zhou2023robust,
  author = {Nuoyan Zhou and Decheng Liu and Dawei Zhou and Xinbo Gao and Nannan Wang},
  title = {{Robust Representation Learning via Asymmetric Negative Contrast and Reverse Attention}},
  year = {2023},
  eprint = {2310.03358},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.03358},
}
Figure