Label Smoothing and Adversarial Robustness

Weijia Jia, Chaohao Fu, Hongbin Chen, Na Ruan, Weijia Jia 0001arXiv 2020

Introduction

Label smoothing (LS) is a widely adopted regularization technique used to improve the generalization of deep neural networks. By replacing "hard" one-hot labels with "soft" targets, models are discouraged from becoming overconfident. Recent observations suggested that LS also provides a significant boost to adversarial robustness. This paper investigates whether this robustness is a genuine property of the model or a "mirage" caused by gradient masking—a phenomenon where the model's gradients become uninformative for standard attack algorithms.

Methodology

The authors employ a multi-faceted approach to deconstruct the apparent robustness of LS-trained models.

Theoretical and Conceptual Analysis

The study derives the relationship between loss functions and model logits, demonstrating that LS acts as a "margin suppressor." Unlike standard training, which allows class margins to grow indefinitely, LS constrains these margins within a finite range. A 1D toy example illustrates how this shift in decision boundaries can move them beyond the reach of simple gradient-based search methods, creating a false sense of security.

Empirical Stress Testing

To verify the stability of LS robustness, the researchers evaluated models (primarily WideResNet-34-10) on MNIST, CIFAR-10, and CIFAR-100 benchmarks. They moved beyond standard Projected Gradient Descent (PGD) to more sophisticated attacks designed to bypass gradient masking:

  • Output Diversified Initialization (ODI): Uses diverse starting points to find better adversarial directions.
  • AutoAttack (AA): An ensemble of four complementary attacks.
  • Transferability Tests: Evaluating if adversarial examples generated on a naturally trained model can fool an LS-trained model.

Key Insights: The Mirage of Robustness

The investigation reveals that the robustness attributed to LS is highly volatile and dependent on attack parameters.

Table 1: Initial robustness results showing high accuracy for LS-trained models against standard attacks like FGSM and PGD.

As shown in the initial evaluations (Table 1), LS appears to offer substantial protection. On CIFAR-10, a model with LS maintains over 75% accuracy against PGD. However, this performance is deceptive. The "logit limitation" imposed by LS prevents the formation of the steep gradient landscapes that standard attacks rely on. Consequently, attacks like PGD often get trapped in local sub-optimals, failing to find the true adversarial directions that still exist.

Furthermore, LS-trained models exhibit high transfer vulnerability. They are easily compromised by adversarial examples crafted for standard, naturally trained models, suggesting that the underlying decision boundaries remain fundamentally insecure.

Results: The Collapse of Defense

The most striking finding is the complete collapse of LS-based "robustness" when faced with stronger, more diverse attacks.

Table 2: Comparison of defense methods across various attacks. LS robustness fails dramatically against ODI and AutoAttack (AA) compared to dedicated adversarial training (Madry, Zhang).

While LS achieves high natural accuracy (94.74%) and appears robust against PGD (74.83%), its performance drops to near zero against the ODI attack (0.15%) and significantly degrades against AutoAttack (6.86%). In contrast, established adversarial training methods like those by Madry or Zhang maintain consistent robust accuracy (around 49-53%) across all attack types. This disparity confirms that LS does not provide true adversarial robustness but rather masks gradients from specific optimization-based attacks.

Conclusion

Label smoothing provides a "false sense of security" regarding adversarial threats. While it remains a valuable tool for improving natural generalization, its apparent robustness is a byproduct of gradient masking rather than a fundamental hardening of the model. This research highlights the critical importance of using diverse and adaptive attack suites, such as AutoAttack, to evaluate new defense mechanisms and avoid being misled by "mirage" robustness. Future work should focus on combining the generalization benefits of LS with the genuine stability of adversarial training.

Summary updated

BibTeX
@misc{jia2020label,
  author = {Weijia Jia and Chaohao Fu and Hongbin Chen and Na Ruan and Weijia Jia},
  title = {{Label Smoothing and Adversarial Robustness}},
  year = {2020},
  eprint = {2009.08233},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2009.08233},
}
Figure