Improving Adversarial Robustness by Encouraging Discriminative Features

Chirag Agarwal, Anh Nguyen, Dan SchonfeldarXiv 2018

Introduction

Deep neural networks (DNNs) have achieved remarkable success across various domains, yet they remain susceptible to adversarial examples—carefully crafted inputs designed to deceive models into making incorrect predictions with high confidence. This vulnerability poses significant security risks in real-world applications. This paper investigates the underlying geometric properties of feature spaces that contribute to this fragility. The authors hypothesize that standard training objectives, such as softmax cross-entropy, focus primarily on inter-class separation but fail to ensure intra-class compactness. This results in expansive regions of low-probability space between classes, which adversaries can exploit to "push" data points across decision boundaries with minimal perturbation.

Methodology: Shrinking the "Pockets"

To address this issue, the authors propose a defense mechanism based on Center Loss. While standard softmax loss encourages the model to separate different classes, center loss explicitly minimizes the distance between each feature vector and its corresponding class center. The total loss function is defined as:

$$L = L_{softmax} + \lambda L_{center}$$

By minimizing this combined objective, the network is forced to learn highly discriminative features characterized by low intra-class variance and high inter-class variance. This process effectively "shrinks" the adversarial pockets by creating dense, isolated clusters for each class, making it significantly harder for an attacker to find a small perturbation that moves a sample into a different class's territory.

Visualizing the Geometry of Robustness

The impact of center loss on the feature space is most apparent when visualizing the activations of the penultimate layer. In a standard model ($D_S$), class features often appear as sprawling, elongated "fans" or "streaks." When center loss is introduced ($D_{SC}$), these distributions collapse into much tighter, more distinct clusters.

Comparison of feature distributions between a standard model ($D_S$) and a model trained with center loss ($D_{SC}$).

As shown in the visualization above, the $D_{SC}$ model produces a much cleaner separation with significantly less "empty" space between classes compared to the vanilla $D_S$ model.

Synergy with Adversarial Training

One of the paper's key findings is that encouraging discriminative features is complementary to existing defense strategies like Adversarial Training (AT). AT involves training the model on adversarial examples to improve its robustness. When AT is combined with center loss ($DAT_{SC}$), the resulting feature clusters are even more robust than those produced by standard AT ($DAT_S$).

Comparison of feature distributions under adversarial training without ($DAT_S$) and with ($DAT_{SC}$) center loss.

The visualization in Figure 4 demonstrates that even under the constraints of adversarial training, center loss continues to enforce tighter clustering, which translates to superior performance against sophisticated attacks.

Experimental Results

The authors evaluated their approach on MNIST, CIFAR-10, and CIFAR-100 datasets using various architectures, including ResNet and DenseNet.

  • MNIST: Adding center loss improved accuracy against the Fast Gradient Sign Method (FGSM) from 70.34% to 78.93%.
  • CIFAR-10: In a ResNet-18 model subjected to a Projected Gradient Descent (PGD) attack, the standard model's accuracy plummeted to 0.81%, whereas the center loss model ($D_{SC}$) maintained 29.26%.
  • Combined Defense: On CIFAR-10, the $DAT_{SC}$ model achieved an adversarial accuracy of 66.10% against the Basic Iterative Method (BIM), outperforming standard adversarial training ($DAT_S$) which reached 60.45%.

Conclusion

This research highlights that the density and compactness of class clusters in the feature space are critical factors for adversarial robustness. By incorporating center loss, models can learn more discriminative features that leave less room for adversarial perturbations. While there is a slight trade-off between robustness and clean accuracy in some complex datasets, the significant gains in adversarial stability suggest that encouraging intra-class compactness is a promising direction for building more secure deep learning systems.

Summary updated

BibTeX
@misc{agarwal2018improving,
  author = {Chirag Agarwal and Anh Nguyen and Dan Schonfeld},
  title = {{Improving Adversarial Robustness by Encouraging Discriminative Features}},
  year = {2018},
  eprint = {1811.00621},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.00621},
}
Figure