Scale-Invariant Adversarial Attack for Evaluating and Enhancing Adversarial Defenses

Mengting Xu, Tao Zhang, Zhongnian Li, Daoqiang ZhangarXiv 2022

Introduction

Adversarial attacks, such as the Projected Gradient Descent (PGD), are critical tools for evaluating the robustness of deep learning models. These attacks typically rely on the cross-entropy loss calculated over a model's "logits"—the raw output values before the final softmax layer. However, a significant yet often overlooked vulnerability exists: these logits can be rescaled (e.g., multiplied by a large constant) without altering the model's final classification decision. This paper introduces SI-PGD (Scale-Invariant Projected Gradient Descent), a novel attack that remains effective regardless of logit scaling, and proposes a corresponding Scale-Invariant (SI) defense mechanism to enhance model robustness.

The Vulnerability of Logit Scaling

The primary issue with standard adversarial attacks is "gradient vanishing." When logits are rescaled to very large values, the mathematical signals used by an attacker to find vulnerabilities become infinitesimally small. This can lead to a false sense of security, where a model appears robust simply because the attack failed to find a perturbation, rather than the model being inherently secure.

Accuracy after attack vs. rescaling factor on logits for standard PGD and SI-PGD.

As demonstrated in the figure above, the performance of standard PGD fluctuates significantly with logit scaling, while the proposed SI-PGD maintains a stable and effective attack success rate across all scales.

Scale-Invariant PGD (SI-PGD)

To overcome the scaling issue, SI-PGD replaces raw logits with the cosine angle between the features in the penultimate layer and the weights in the softmax layer. Because cosine values are naturally bounded between -1 and 1, they are inherently invariant to the scale of weights or features. This ensures that the attack always has a stable, non-vanishing gradient to follow, providing a more reliable evaluation of a model's true defensive capabilities.

Scale-Invariant Defense Mechanism

The authors further leverage this scale-invariant logic to develop a robust defense mechanism. By embedding a cosine-based margin loss as a regularization term during adversarial training, the model is encouraged to learn "angularly discriminative" representations.

Geometric interpretation of updating weight norm vs. weight direction in the SI mechanism.

Geometrically, while standard training might simply increase the magnitude (norm) of weights to achieve classification—which leads to gradient vanishing—the SI mechanism focuses on updating the direction (angle) of the weights. This approach is more stable and prevents the model from relying on gradient obfuscation, a common "fake" defense where the loss surface is made jagged to trip up attackers. SI-trained models exhibit smooth loss surfaces, indicating genuine robustness.

Experimental Results

The researchers evaluated their methods on standard benchmarks including CIFAR-10, CIFAR-100, and SVHN:

  • Attack Efficacy: SI-PGD consistently outperformed standard PGD and other variants across multiple defense models. On CIFAR-10, SI-PGD improved attack success rates by approximately 2% to 4% compared to standard PGD.
  • Defense Performance: Integrating the SI mechanism into popular frameworks like TRADES or MART yielded state-of-the-art results. For instance, MART-SI achieved the highest defense accuracy on the CIFAR-100 dataset.
  • SVHN Gains: On the SVHN dataset, the SI-enhanced version of standard adversarial training (AT-SI) saw a 2.06% increase in accuracy against PGD attacks compared to the original AT.

Conclusion

By identifying logit scaling as a fatal flaw in current adversarial evaluations, this work provides a more rigorous framework for testing and building robust models. The transition from magnitude-based to angle-based optimization via SI-PGD and the SI defense mechanism offers a stable path forward for adversarial machine learning. Future work will explore applying these scale-invariant principles to other adversarial constraints and domains beyond image classification.

Summary updated

BibTeX
@misc{xu2022scale,
  author = {Mengting Xu and Tao Zhang and Zhongnian Li and Daoqiang Zhang},
  title = {{Scale-Invariant Adversarial Attack for Evaluating and Enhancing Adversarial Defenses}},
  year = {2022},
  eprint = {2201.12527},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2201.12527},
}
Figure