NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Certified Defences Against Adversarial Patch Attacks on Semantic Segmentation

Maksym Yatsura, Kaspar Sakmann, N. Grace Hua, Matthias Hein, Jan Hendrik Metzen

Adversarial patch attacks are an emerging security threat for real-world deep learning applications. Researchers have recently developed Demasked Smoothing, the first framework to provide certified robustness guarantees for semantic segmentation models against these attacks. By decoupling image reconstruction from the segmentation task, the method allows any off-the-shelf model to become certifiably robust without the need for expensive retraining or architectural changes.

The Threat: Adversarial Patches in Semantic Segmentation

Adversarial patches—localized, high-contrast stickers or prints placed in the physical world—pose a significant threat to safety-critical systems like self-driving cars. While a human simply sees a sticker on a stop sign or a wall, a deep learning model might be tricked into seeing a "speed limit 80" sign or fail to recognize the road entirely.

An example of an adversarial patch placed in an urban scene, aiming to disrupt semantic segmentation.

Most existing "certified" defenses (which provide mathematical guarantees that an attack cannot succeed) are designed for basic image classification. Semantic segmentation is much harder because the model must predict a label for every single pixel. Furthermore, modern Vision Transformers (ViTs) use global self-attention, meaning a tiny patch in the corner of an image can theoretically corrupt the prediction of a pixel on the opposite side. Before Demasked Smoothing, there were no certified defenses specifically tailored for the dense, pixel-wise requirements of semantic segmentation.

How Demasked Smoothing Works

The authors introduce a pipeline consisting of four main steps:

  1. Masking: The input image is divided into several versions, each with different regions "blacked out" (masked). The masking strategy (e.g., vertical columns) ensures that any adversarial patch of a certain size can only affect a small, known subset of these masked images.
The masking strategy ensures that an adversarial patch is completely hidden in at least some of the masked image variations.
  1. Demasking (Inpainting): Instead of passing "broken" images with holes to the segmentation model, the authors use a state-of-the-art inpainting model (ZITS) to fill in the masked areas. This key innovation "tricks" the downstream model into seeing a complete, natural-looking image.
  2. Segmentation: An arbitrary, pre-trained segmentation model (like Swin Transformer or DeepLab) processes each inpainted image.
  3. Aggregation:
  4. Certified Recovery: For each pixel, the system takes a majority vote across all masked versions. If the number of masks is large enough relative to the number of masks a patch can corrupt, the majority vote is mathematically guaranteed to remain stable.
  5. Certified Detection: The system checks for consistency. If the predictions across different masked versions disagree significantly, the system flags the input as a potential attack.

Key Insights and Innovations

  • Decoupling is Power: By using an independent inpainting model, the authors removed the requirement that the segmentation model be specifically trained on masked data. This makes the defense "plug-and-play" for existing high-performance models.
  • The Power of Column Masking: The researchers found that masking vertical columns is particularly effective for outdoor and indoor scenes. Because these scenes often have a horizontal layout (ground, objects, sky), a vertical slice provides enough contextual clues for the inpainter to reconstruct the missing parts accurately.
  • Handling Global Receptive Fields: The paper proves that even if a model has a global receptive field (like a Transformer), the masking and voting logic still holds because the "influence" of the patch is physically restricted to specific masked versions.

Results and Performance

The framework was evaluated on challenging benchmarks like ADE20K and COCO-Stuff-10K using state-of-the-art models (BEiT, Swin Transformer, PSPNet).

  • Certified Detection: On the ADE20K dataset, the method can certify 63.55% of pixels against a patch occupying 1% of the image area.
  • Certified Recovery: It achieved a certified mean recall of 46.22% against a 0.5% patch.
  • Efficiency: While previous methods required specialized architectures (which often have lower accuracy), Demasked Smoothing maintains high "clean" performance because it uses standard, top-tier models.

Limitations and Future Directions

While groundbreaking, the approach has some limitations. Because the system must run the segmentation model multiple times (once for each mask), inference is slower than a standard model, though these passes can be parallelized. Additionally, as the adversarial patch gets larger, the number of masks required to "hide" it increases, which eventually degrades the inpainter's ability to reconstruct the scene accurately. Finally, it remains difficult to certify very small objects; if a patch completely covers a distant pedestrian, no amount of inpainting can "guess" what was hidden underneath.

As inpainting technology continues to improve, the authors suggest that the clean performance and certification rates of this framework will naturally improve alongside it.

Summary updated

BibTeX
@inproceedings{yatsura2023certified,
  author = {Maksym Yatsura and Kaspar Sakmann and N. Grace Hua and Matthias Hein and Jan Hendrik Metzen},
  title = {{Certified Defences Against Adversarial Patch Attacks on Semantic Segmentation}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=b0JxQC7JLWh},
}
Figure