SpaNN: Detecting Multiple Adversarial Patches on CNNs by Spanning Saliency Thresholds
Mauricio Byrd Victorica, György Dán, Henrik Sandberg · 2025
Read SpaNN: Detecting Multiple Adversarial Patches on CNNs by Spanning Saliency Thresholds by Mauricio Byrd Victorica, György Dán, Henrik Sandberg (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-18591.txt.
Introduction
Mauricio Byrd Victorica, György Dán, and Henrik Sandberg present a 2025 defense for image models under patch attack. In such attacks, a printed patch placed in a scene fools a model into missing or misnaming objects. Most past defenses assumed a single patch, and their cost grows when several patches appear.
Their detector, named SpaNN, reads the first layer of the target model and marks active spots using many cut-off levels at once. It then groups those spots and feeds group traits to a small classifier that flags attacks. The work needed does not depend on how many patches are present. Tests on four data sets beat prior defenses by wide margins.
Catalog record
| CREATOR | Mauricio Byrd Victorica, György Dán, Henrik Sandberg |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 78 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2506-18591
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
SpaNN: Detecting Multiple Adversarial Patches on CNNs by Spanning Saliency Thresholds Mauricio Byrd Victorica, György Dán, Henrik Sandberg Abstract State-of-the-art convolutional neural network models for object detection and image classification are vulnerable to physically realizable adversarial perturbations, such as patch attacks. Existing defenses have focused, implicitly or explicitly, on single-patch attacks, leaving their sensitivity to the number of patches as an open question or rendering them computationally infeasible or inefficient against attacks consisting of multiple patches in the worst cases. In this work, we propose SpaNN, an attack detector whose computational complexity is independent of the expected number of adversarial patches. The key novelty of the proposed detector is that it builds an ensemble of binarized feature maps by applying a set of saliency thresholds to the neural activations of the first convolutional layer of the victim model. It then performs clustering on the ensemble and uses the cluster features as the input to a classifier for attack detection. Contrary to existing detectors, SpaNN does not rely on a fixed saliency threshold for identifying adversarial regions, which makes it robust against white box adversarial attacks. We evaluate SpaNN on four widely used data sets for object detection and classification, and our results show that SpaNN outperforms state-of-the-art defenses by up to 11 and 27 percentage points in the case of object detection and the case of image classification, respectively. Our code is available at https://github.com/gerkbyrd/SpaNN . I Introduction Deep learning models achieve state-of-the-art performance on computer vision tasks, but they are vulnerable to adversarial attacks, i.e., input perturbations crafted to change the model’s output [ 1 , 2 , 3 ] . One class of adversarial attacks is digital attacks, which involve imperceptible perturbations of the input image, often bounded in some \ell_{p} norm. Several digital attack generation methods have been proposed in the past decade [ 1 , 4 , 5 , 6 ] , followed by corresponding defense schemes [ 7 , 8 , 9 , 10 ] . These attacks assume the adversary has direct access to the pixels of the input image provided to the model. In more recent years, focus has shifted towards physically realizable attacks [ 11 ] . They differ from digital attacks in that they are spatially constrained, and they typically involve applying a printable patch containing an adversarial pattern to an object in the physical scene. For instance, an adversarial patch can be applied in the form of a sticker [ 2 , 12 ] , a printed pattern on clothing [ 3 , 12 ] , or a projected image [ 13 ] . Unlike digital attacks, patch attacks do not assume access to the digital images in the deep learning model’s processing pipeline, and instead manipulate physical objects in the scene, which makes their implementation more feasible and eliminates the need to access the victim model’s input directly. Existing defenses against patch attacks either aim at detecting adversarial patches [ 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 ] or at recovering from patch attacks by localizing the patches and removing them [ 22 , 23 , 24 , 25 , 20 , 26 , 27 , 28 , 29 , 30 ] . The approach they follow for detecting patches is based on the patches’ impact on statistical properties of the input data, e.g., by computing gradients in the pixel domain [ 27 ] , by detecting unusually high activations in feature maps [ 22 , 15 ] , or by detecting high entropy regions in pixel space [ 23 ] . As a result, existing approaches for detecting patch attacks against convolutional neural networks (CNNs) suffer from two main limitations. First, most methods, explicitly or implicitly, assume a single patch per object [ 21 , 23 , 29 ] , or even a single patch per image [ 22 , 24 ] , making them vulnerable to attacks deviating from such assumptions. Second, they are based on one or more detection thresholds that are compared to image statistics in one or more feature spaces (e.g., thresholds on image entropy [ 23 ] or internal layers’ neural activations [ 22 , 17 , 15 ] ), and hence they require parameter tuning and adjustments to changes in the defended model or the input data distribution. In this paper, we propose SpaNN , a novel patch attack detection method that overcomes limitations of existing defenses. SpaNN achieves superior detection performance owing to two key ideas. First, detection in SpaNN is based on how the spatial patterns of important neurons in a shallow feature map change as the definition of important neurons changes. Second, the pattern changes used to distinguish attacked images from clean images are independent of the number of patches in the image. These two design choices make it possible for SpaNN to detect attacks regardless of the number of patches, while making it robust to adaptive attacks that maximize impact subject to remaining undetected. Our main contributions are as follows: i) We propose SpaNN , an approach for detecting multiple adversarial patches based on the clustering analysis of an ensemble of binarized saliency maps in feature space. ii) We evaluate the proposed detection method on various object detection and image classification tasks and show that SpaNN achieves an effective attack detection accuracy of at least 86.13% for object detection and 96.64% for image classification, for any number of patches. iii) We compare SpaNN to various baselines and show that it achieves state-of-the-art performance on single-patch detection, and establishes the new state-of-the-art for multiple-patch attacks. iv) In further experiments, we show that the computational cost of SpaNN is independent of the number of patches, and evaluate its effectiveness against an adaptive attacker. The rest of the paper is organized as follows. We discuss related works in Section II . We introduce the relevant background in Section III , and present SpaNN in Section IV . We present numerical results in Section V and we conclude the paper in Section VI . II Related Work Mechanisms to detect patch attacks against image classification and object detection CNN models have been proposed in recent works [ 22 , 23 , 24 , 15 , 21 ] . In Themis [ 22 ] , a sliding window is applied on the feature map produced by the first convolutional layer of a CNN model, to identify “patch candidates”, i.e., relatively dense areas in terms of neural activity. Attacks are then detected based on the effect that occluding the patch candidates has on the model’s output. Jedi [ 23 ] computes an entropy heat map for the input image using a threshold that is adjusted for each input image and then uses filtering and post-processing to keep only non-sparse high-entropy areas in the heat map. An autoencoder is used to construct patch masks corresponding to high-entropy areas, and the masks are applied to the input image before feeding it to the CNN model. Z-Mask [ 15 ] is a similar method to Jedi , where two over-activation heat maps are computed using Spatial Pooling Refinement (one focusing on the defended model’s shallow layers and the other