Jedi: Entropy-Based Localization and Removal of Adversarial Patches

Bilel Tarchoun, Anouar Ben Khalifa, Mohamed Ali Mahjoub, Nael B. Abu-Ghazaleh, Ihsen Alouani

Abstract

Real-world adversarial physical patches were shown to be successful in compromising state-of-the-art models in a variety of computer vision applications. Existing defenses that are based on either input gradient or features analysis have been compromised by recent GAN-based attacks that generate naturalistic patches. In this paper, we propose Jedi, a new defense against adversarial patches that is resilient to realistic patch attacks. Jedi tackles the patch localization problem from an information theory perspective; leverages two new ideas: (1) it improves the identification of potential patch regions using entropy analysis: we show that the entropy of adversarial patches is high, even in naturalistic patches; and (2) it improves the localization of adversarial patches, using an autoencoder that is able to complete patch regions from high entropy kernels. Jedi achieves high-precision adversarial patch localization, which we show is critical to successfully repair the images. Since Jedi relies on an input entropy analysis, it is model-agnostic, and can be applied on pre-trained off-the-shelf models without changes to the training or inference of the protected models. Jedi detects on average 90% of adversarial patches across different benchmarks and recovers up to 94% of successful patch attacks.

Introduction

Deep Neural Networks (DNNs) are notoriously fragile when faced with adversarial patches. Unlike traditional adversarial attacks that subtly alter every pixel, patches are spatially constrained—like a sticker on a stop sign—but can be extremely aggressive. The "cat and mouse" game has recently shifted: attackers now use GANs to create "naturalistic" patches that resemble real-world objects (e.g., a patch that looks like a toaster but makes a car detector fail). Existing defenses often rely on detecting high pixel gradients or feature-space anomalies, which these naturalistic patches can easily bypass. Jedi addresses a critical gap: the failure to accurately localize the patch, which often leads to poor image restoration or "lost predictions" where the defense itself breaks the model's ability to see the original object.

Methodology

Jedi is a novel, model-agnostic defense that uses information theory to defeat adversarial patches. The defense operates as a three-step pipeline:

  1. Locating High Entropy Kernels: Adversarial patches—even naturalistic ones—contain a statistically higher amount of information (Shannon entropy) than natural image neighborhoods. Jedi uses a sliding window to create an entropy heat map, applying a dynamic threshold to isolate "kernels" of high entropy.
  2. Patch Shape Reconstruction: Entropy kernels are often noisy or incomplete. Jedi feeds these kernels into a Sparse Autoencoder (SAE) trained to recognize typical patch shapes and "fill in the blanks," producing a precise binary mask of the adversarial region.
  3. Patch Suppression (Inpainting): Once localized, the patch is surgically removed. Jedi uses a coherence transport-based inpainting method to fill the masked area with pixels sampled from the surrounding neighborhood, allowing the underlying DNN to make a correct prediction.
The Jedi defense pipeline: (1) High entropy kernel identification, (2) Patch localization via autoencoder, and (3) Patch suppression through inpainting.

Key Insights: Entropy as a Discriminator

The most significant insight of this work is that adversarial perturbations are inherently "unpredictable" from an information-theory perspective. To fool a model across various inputs (universal perturbation), a patch must pack a high density of conflicting signals into a small area. This makes its entropy significantly higher than natural semantic structures.

Empirical evidence of entropy as a discriminator: (a) distribution of entropy for patches vs. natural datasets; (b) entropy levels over attack iterations compared to natural images and random noise.

The authors found that while attackers could attempt to create "low-entropy" patches to bypass Jedi, the attack success rate plummeted (from 64% to 8%). This suggests that high entropy is a fundamental requirement for effective adversarial patches.

Experimental Results

Jedi was evaluated across diverse benchmarks including ImageNet, Pascal VOC 07, CASIA, and INRIA, testing against standard, YOLO-specific, and GAN-based naturalistic patches.

  • High Precision: Jedi accurately localizes patches with an Intersection-over-Union (IoU) score twice as high as competing methods like LGS or Jujutsu.
  • Superior Recovery: On ImageNet, Jedi recovered 94% of successful patch attacks, significantly outperforming LGS (75%) and Jujutsu (65%).
  • Resilience: While GAN-based patches successfully bypassed other defenses, Jedi maintained a high recovery rate (up to 76%).
  • Efficiency: Jedi is up to 10x faster than certified defenses like Patch Cleanser while providing better empirical robustness on large-scale datasets.

Conclusion

Jedi demonstrates that entropy-based localization is a powerful, model-agnostic tool for securing computer vision systems. By focusing on the information density of adversarial signals, it achieves high-precision localization and effective image recovery without requiring model retraining.

Summary updated

BibTeX
@inproceedings{tarchoun2023jedi,
  author = {Bilel Tarchoun and Anouar Ben Khalifa and Mohamed Ali Mahjoub and Nael B. Abu-Ghazaleh and Ihsen Alouani},
  title = {{Jedi: Entropy-Based Localization and Removal of Adversarial Patches}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  url = {https://openreview.net/forum?id=4yVzEgN0NO},
}
Figure