Robust Semantic Segmentation: Strong Adversarial Attacks and Fast Training of Robust Models

Francesco Croce, Naman D. Singh, Matthias HeinarXiv 2023 · arXiv · OpenReview

Abstract

While a large amount of work has focused on designing adversarial attacks against image classifiers, only a few methods exist to attack semantic segmentation models. We show that attacking segmentation models presents task-specific challenges, for which we propose novel solutions. Our final evaluation protocol outperforms existing methods, and shows that those can overestimate the robustness of the models. Additionally, so far adversarial training, the most successful way for obtaining robust image classifiers, could not be successfully applied to semantic segmentation. We argue that this is because the task to be learned is more challenging, and requires significantly higher computational effort than for image classification. As a remedy, we show that by taking advantage of recent advances in robust ImageNet classifiers, one can train adversarially robust segmentation models at limited computational cost by fine-tuning robust backbones.

Introduction

Adversarial robustness—the study of how small, intentional perturbations to an input can fool a model—has been heavily explored in image classification. However, semantic segmentation is a much tougher nut to crack. In classification, an attacker only needs to flip one label; in segmentation, they must ideally flip the predictions of hundreds of thousands of pixels simultaneously.

The authors identify two major gaps in current research:

  1. Evaluation Gap: Standard attacks (like PGD using cross-entropy loss) are inefficient for segmentation. Because cross-entropy gradients are largest for pixels that are already misclassified, the optimizer wastes effort "over-attacking" failed pixels instead of focusing on the ones that are still correct. This leads to a false sense of security.
  2. Training Gap: Adversarial training (AT) is notoriously slow. Scaling it to complex segmentation architectures and large datasets like ADE20K is computationally prohibitive for most researchers.

Methods

The paper introduces two major contributions to bridge these gaps:

Semantic Ensemble Attack (SEA)

To provide a rigorous "stress test," the authors developed SEA, an ensemble of three novel attacks designed to overcome the limitations of standard cross-entropy:

  • Jensen-Shannon (JS) Divergence Loss: Unlike cross-entropy, the gradient of the JS loss vanishes as a pixel becomes more misclassified. This forces the attack to focus its "budget" on pixels that the model is still predicting correctly.
  • Masked Cross-Entropy (MCE): This explicitly ignores pixels that are already misclassified, preventing the optimization from getting stuck on already "won" pixels.
  • Progressive Radius Reduction (red-$\epsilon$): Instead of attacking with a fixed perturbation budget (radius), the attack starts with a large radius and gradually shrinks it, helping the optimizer find better adversarial directions.

Pre-trained ImageNet Robust AT (PIR-AT)

Instead of performing expensive adversarial training from scratch, the authors found that adversarial robustness is a transferable feature. By initializing the segmentation model's backbone with a model already adversarially trained on ImageNet, they can achieve state-of-the-art robustness with significantly fewer training epochs on the target segmentation task.

Results and Analysis

The authors evaluated their methods on PASCAL-VOC and the more challenging ADE20K dataset.

Visual Robustness Comparison

The qualitative difference between a standard "clean" model and a robust model trained via PIR-AT is stark. Under targeted attacks, clean models often collapse into predicting a single target class (e.g., "sky" or "grass") across the entire image, whereas robust models maintain the structural integrity of the scene.

Visual comparison of clean vs. robust models under targeted attacks.

Quantitative Performance

SEA consistently outperformed previous state-of-the-art attacks like SegPGD and CosPGD. As shown in the table below, SEA achieves lower robust accuracy and mIoU across various datasets and perturbation budgets ($\epsilon$), revealing that previous methods significantly overestimated model robustness.

Table comparing SEA against previous SOTA attacks across PASCAL-VOC and ADE20K.

Key quantitative findings include:

  • Superior Attacks: SEA reduced model accuracy by an additional 17.2% in some cases compared to prior SOTA.
  • Efficiency Gains: PIR-AT achieved better robustness than standard AT while being up to 6 times faster to train.
  • First Robust ADE20K Models: The authors established the first truly robust models for ADE20K, achieving up to 55.5% robust accuracy at $\epsilon = 4/255$.

Conclusion

This work demonstrates that existing "robust" segmentation models are often "paper tigers" that fail against more sophisticated attacks like SEA. By leveraging robust ImageNet backbones through PIR-AT, the researchers provide a path toward training resilient segmentation models efficiently. Future work will look into black-box attacks and further optimizing training objectives to close the remaining gap between clean and robust performance.

Summary updated

Abstract

While a large amount of work has focused on designing adversarial attacks against image classifiers, only a few methods exist to attack semantic segmentation models. We show that attacking segmentation models presents task-specific challenges, for which we propose novel solutions. Our final evaluation protocol outperforms existing methods, and shows that those can overestimate the robustness of the models. Additionally, so far adversarial training, the most successful way for obtaining robust image classifiers, could not be successfully applied to semantic segmentation. We argue that this is because the task to be learned is more challenging, and requires significantly higher computational effort than for image classification. As a remedy, we show that by taking advantage of recent advances in robust ImageNet classifiers, one can train adversarially robust segmentation models at limited computational cost by fine-tuning robust backbones.
BibTeX
@misc{croce2023robust,
  author = {Francesco Croce and Naman D. Singh and Matthias Hein},
  title = {{Robust Semantic Segmentation: Strong Adversarial Attacks and Fast Training of Robust Models}},
  year = {2023},
  eprint = {2306.12941},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.12941},
}
Figure