Improving Adversarial Robustness via Probabilistically Compact Loss with Logit Constraints

Xin Li, Xiangrui Li, Deng Pan, Dongxiao Zhu

Introduction

Deep learning models are notoriously brittle. A tiny, imperceptible "adversarial" perturbation added to an image can flip a model's prediction from "panda" to "gibbon." While many defenses exist, they often come with significant drawbacks: Adversarial Training (AT) requires generating expensive adversarial examples during every training step, while other architectural defenses are rigid and difficult to adapt to new models.

Researchers have developed a new training objective called Probabilistically Compact (PC) loss with logit constraints that significantly boosts the adversarial robustness of Convolutional Neural Networks (CNNs). This method acts as a drop-in replacement for standard Cross-Entropy loss without requiring the massive computational overhead of traditional adversarial training.

The "Runner-up" Vulnerability

The authors identify a specific pattern in how models fail: when a CNN is fooled by a small perturbation, it doesn't just pick a random wrong class. Instead, it almost always misclassifies the image into one of the top few most probable false classes—the "runner-ups" for the original clean image.

Analysis of successful adversarial attacks showing that misclassifications predominantly target the top runner-up classes (2nd and 3rd) across different datasets and attack methods.

By empirically proving that adversarial attacks target the 2nd and 3rd most likely classes, the authors suggest that "pushing" these classes further away in probability space can make the model naturally harder to fool.

Methodology

The proposed approach integrates two components into a single training objective:

  1. Probabilistically Compact (PC) Loss: Unlike standard Cross-Entropy, which only maximizes the true class probability, PC loss explicitly maximizes the probability gap between the true class and all other classes. It enforces a "probability margin" ($\xi$), penalizing the model if runner-up classes get too close to the true class in terms of predicted probability.
  2. Logit Constraints: Probability gaps can be "melted" by small perturbations if the underlying logits (raw scores before the softmax layer) are unstable. Using a Lipschitz continuity argument, the authors constrain the difference between logits to ensure that small changes in input pixels do not lead to massive swings in output scores.

These components are combined into a single loss function that requires no extra data or specialized training loops.

Feature Space Organization

Visualizing the model's internal representations provides clear evidence of the method's efficacy. T-SNE visualizations show that models trained with PC loss create much tighter, more distinct clusters in the feature space compared to the "messy" boundaries produced by standard training.

t-SNE visualizations comparing the feature space organization of standard training (left) versus the proposed PC loss (right), demonstrating tighter and more distinct class clusters.

Key Results and Efficiency

The PC loss with logit constraints consistently outperformed standard Cross-Entropy (CE) and other specialized losses across seven diverse benchmarks (MNIST, CIFAR-10/100, SVHN, and Tiny ImageNet):

  • White-Box Attacks: On CIFAR-10, under a strong PGD attack, the proposed method maintained 27.6% accuracy, while standard CE dropped to 0.0%.
  • Black-Box Attacks: On SVHN, it achieved 58.0% accuracy against SPSA attacks, compared to just 4.0% for the baseline.
  • Efficiency: Crucially, these gains come with zero additional training time compared to standard training, making it highly scalable for large datasets where adversarial training is often prohibitively slow.

Furthermore, the authors rigorously tested against "gradient-free" attacks (SPSA) to prove the model is truly robust and not merely relying on "gradient masking."

Conclusion

While the method significantly improves robustness, it does not completely close the gap between clean and adversarial accuracy—a challenge that remains an open problem. Future research directions include investigating these predictive behaviors in non-image classification settings and exploring how this loss might improve model interpretability. Nonetheless, PC loss represents a powerful, efficient tool for building "innate" robustness into deep learning models from the start.

Summary updated

BibTeX
@inproceedings{li2021improving,
  author = {Xin Li and Xiangrui Li and Deng Pan and Dongxiao Zhu},
  title = {{Improving Adversarial Robustness via Probabilistically Compact Loss with Logit Constraints}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i10.17030},
}
Figure