PAD: Patch-Agnostic Defense against Adversarial Patch Attacks
Lihua Jing Rui Wang Wenqi Ren Xin Dong Cong Zou

Stabilizing quantum simulations of lattice gauge theories by dissipation
    Hendrik Weimer
    April 29, 2024
========================================================================


Adversarial patch attacks present a significant threat to real-world object detectors due to their practical feasibility.
Existing defense methods, which rely on attack data or prior knowledge, struggle to effectively address a wide range of adversarial patches.
In this paper, we show two inherent characteristics of adversarial patches, semantic independence and spatial heterogeneity, independent of their appearance, shape, size, quantity, and location. Semantic independence indicates that adversarial patches operate autonomously within their semantic context, while spatial heterogeneity manifests as distinct image quality of the patch area that differs from original clean image due to the independent generation process.
Based on these observations, we propose PAD, a novel adversarial patch localization and removal method that does not require prior knowledge or additional training.
PAD offers patch-agnostic defense against various adversarial patches, compatible with any pre-trained object detectors. 
Our comprehensive digital and physical experiments involving diverse patch types, such as localized noise, printable, and naturalistic patches, exhibit notable improvements over state-of-the-art works.
Our code is available at https://github.com/Lihua-Jing/PADhttps://github.com/Lihua-Jing/PAD.


    




§ INTRODUCTION




Adversarial attacks substantially challenge the security of object detectors, leading to potentially severe consequences in various fields (e.g., autonomous driving). Traditional adversarial attacks typically involve adding perturbations to the entire image. However, modifying every pixel is unrealistic in real-world attack scenarios. Adversarial patch attacks, on the other hand, focus on introducing disturbances in a limited area. Their practical feasibility makes them one of the most threatening forms of adversarial attacks.






Defenses against adversarial patch attacks on object detectors can be broadly categorized into three main types: i) modifying or intervening within detection models <cit.>, ii) locating and eliminating adversarial patch regions in images<cit.>, and iii) certiﬁably robust defenses <cit.>. 
Among these,  methods falling under the second category, which act as preprocessing, offer the broadest range of applications. 

Researchers have explored various patch localization methods to effectively remove adversarial patches from images. Denoising-based defenses <cit.> smooth out noise-like regions in images, providing an effective defense against early localized noise patches. However, they fail to address natural-looking patches. 

External segmenter-based defenses <cit.> train an adversarial patch segmentation model for patch localization, using adversarial images generated by existing attack techniques. However, the reliance on training data makes them ineffective against unseen patch types. 

Entropy-based defenses <cit.> achieve patch localization by identifying high entropy kernels and patch shape reconstruction. Nevertheless, the entropy threshold setting requires prior knowledge of the distribution for clean data and patches, and shape reconstruction relies on training data, posing challenges in practical applications. 

Despite progress in certain aspects, these methods face a common challenge of locating various adversarial patches without relying on prior attack knowledge. As shown in Figure <ref>, these three categories of methods fail to effectively remove patch areas.


In this paper, we propose a new approach for various adversarial patch localization without relying on prior attack knowledge (e.g., appearance, shape, size, or quantity). The proposed approach is derived from two inherent characteristics of adversarial patches: semantic independence and spatial heterogeneity.

Semantic independence implies zero information gain from the surrounding semantic space, while spatial heterogeneity refers to inconsistent image quality in the same space introduced by adversarial patches.
In both digital and physical attacks, the adversarial patch, added as a separate component to the image or environment, is semantically independent in the image. The surroundings provide no information about the content of adversarial patches, and vice versa. Additionally, different imaging devices, generation processes, and compression methods may lead to variations in image quality. With a source different from the original clean data, the quality of patch regions exhibits heterogeneity compared to other areas in space.

Based on these observations, we propose to identify patch areas by quantifying local semantic independence and spatial heterogeneity. We measure the information gain between adjacent regions based on mutual information, and evaluate residuals from recompression at different quality factors to address the unequal impact upon areas of varying quality. While complex backgrounds confuse entropy-based methods <cit.> since the high information density caused by complicated textures, our method exhibits more robustness as semantic correlations remain between adjacent background areas.
In addition, to eliminate the reliance on training data, we present a patch localization and removal pipeline that requires no prior knowledge or additional training. Different from current works, our defense accurately identifies the patch region mask without any reference to existing adversarial images and imposes no limitations on the quantity or proportion of patches in the image.

Our contributions can be summarized as follows:


    
  * We reveal two inherent characteristics of adversarial patches, semantic independence and spatial heterogeneity, and propose patch locating based on mutual information and recompression, which is agnostic to patch appearance, shape, size, location, and quantity.
    
  * We propose a patch-agnostic defense (PAD) method for adversarial patch localization and removal, which requires no prior attack knowledge or additional training and is compatible with any object detector.
    
  * We conduct experiments on adversarial patches with different appearances, shapes, sizes, locations, and quantities, evaluating the defense effectiveness of PAD in both digital and physical scenes. Experimental results demonstrate our superior defense performance compared to the current state-of-the-art methods.





§ RELATED WORK








 §.§ Adversarial Patch Attacks


The concept of adversarial patch attacks is first introduced by <cit.>. They develop a generic patch capable of deceiving image classifiers and demonstrate the feasibility of physical attacks by attaching the patch in real-world scenarios. 
Early research on adversarial patch attacks primarily focuses on localized noise <cit.>. 
DPatch <cit.> is the pioneering work on patch attacks specifically designed for object detection, targeting both bounding box regression and object classification components of the detection system. PatchAttack <cit.> proposes a reinforcement learning-based attack method to induce misclassification by superimposing small texture patches on the input image. 
Some work focus on physical attacks <cit.>.  <cit.> and <cit.> attach patches to traffic signs, leading to the misidentification of those signs. <cit.> proposes a printable adversarial patch for pedestrian detection, introducing non-printable loss in the optimization process. <cit.> and <cit.> explore the integration of adversarial patches into wearable clothing.
<cit.>, <cit.> and <cit.> train generative adversarial networks (GANs) to generate natural-looking patches that match the visual properties of normal images.





 §.§ Defenses against Patch Attacks


Adversarial training <cit.>, which enhances model robustness by adding adversarial examples during training, is one of the most popular and effective defenses against digital attacks. However, such methods are not suitable for defending pre-trained models already in use and require significant resources for retraining when new attacks emerge, making them not so practical.

Some defense methods involve modification of specific models <cit.>. <cit.> investigates the use of spatial context constraints in YOLOv2 <cit.> to enhance defense robustness against adversarial patches. <cit.> introduces a patch class into YOLOv2, enabling the detection of objects of interest as well as adversarial patches. <cit.> proposes adversarial patch feature energy(APE), and defense is achieved by incorporating an APE discovery and suppression module into the network. Although good defense effects can be achieved on specific detection models, they cannot directly provide defense for a wide range of object detectors.

To provide more general defense, researchers have explored locating patch areas in images and eliminating their effects <cit.>. Since early adversarial patches are usually in the form of localized noise, some defense methods focus on reducing the impact of noise-like areas in input images. LGS <cit.> observes that patch attacks introduce concentrated high-frequency noise and proposes gradient smoothing for regions with significant gradients. APM <cit.> and SAC <cit.> train external segmentation networks to locate noise-like regions. While these methods effectively defend against localized noise-based patch attacks, they struggle to counter the new types of natural-looking patches. DW <cit.> and Jujutsu <cit.> utilize saliency maps to identify patch areas and cover them to mitigate their impact on classification. In object detection tasks, which involve bounding box regression in addition to classification, accurately localizing patches becomes challenging using saliency maps. Jedi <cit.> and <cit.> use entropy to locate patch areas, but prior knowledge of entropy distribution of clean dataset and patch area is required.

In recent years, some researchers have proposed certifiably robust defenses against adversarial patches <cit.>. DetectorGuard <cit.> is an attack detection defense that raises an alert when an attack is detected without removing the adversarial patches, resulting in a loss of model functionality during an attack. ObjectSeeker <cit.> requires ensuring that, under at least one partition, the remaining images do not contain any adversarial patch pixels. As a result, there will be trouble handling attack scenarios with large patch proportions or multiple patches.

Different from these methods, PAD is derived from two general characteristics of patches that are independent of their appearance, shape, size, quantity, and location, allowing us to eliminate various patches without relying on prior attack knowledge.





§ PRELIMINARIES







Differing from traditional adversarial attacks, adversarial patch attacks impose restrictions on the attacker, limiting the area where perturbations can be introduced. Within this constraint, the attacker has the flexibility to manipulate the pixels within the designated patch region.

We denote a clean image with dimensions w× h× c as X∈ℝ ^w× h× c. The adversarial patch, denoted as P_adv, can take any shape. The generation of P_adv is typically controlled by the loss function L_patch, which varies depending on the specific attack objective. Since our goal is to defend against various patch attacks, irrespective of their intention to conceal the target object, misclassify it, or generate false detections of non-existent objects, we do not make assumptions about L_patch.

The resulting adversarial image X_adv∈ℝ ^w× h× c, produced by attack techniques, can be expressed as follows:

    X_adv = M_patch⊙ A(P_adv,X,l,t) + (1-M_patch)⊙ X,

where M_patch∈{0,1}^w× h represents the patch region in image X, with elements set to 1 within P_adv and 0 elsewhere. A(P_adv,X,l,t) denotes the patch application function, incorporating patch transformations such as scaling and rotation denoted by t, and patch location denoted by l. ⊙ refers to element-wise multiplication. In the case of attack methods that can be used physically, A(P_adv,X,l,t) typically involves completely replacing the image area at position l with the transformed patch.









§ METHOD









 §.§ Defense Pipeline


In this section, we introduce the pipeline of PAD, as shown in Figure <ref>. Firstly, we analyze the input image using the two inherent characteristics that all adversarial patches possess to obtain heat maps, H_mi and H_cd, which highlight the regions in the image that exhibit semantic independence and spatial heterogeneity, respectively. Next, we employ the Fusion block to merge H_mi and H_cd, generating the patch localization map H_p that accurately reflects the areas in the image that possess both of these characteristics.

To make the patch masks more accurate, we introduce the Segment Anything Model (SAM) <cit.>. Different from the segmentation models introduced in prior methods, since we do not need it to have recognition capabilities for adversarial patches, SAM can be replaced with any pre-trained segmentation models with similar capabilities, without additional training. In other words, we do not rely on known patch attack methods to generate adversarial images for training, preventing our defense from losing effectiveness when encountering new attack methods. With SAM's zero-shot segmentation capability, we segment the edges of all regions in the image and obtain masks for each region. We then match each mask with H_p and consider all masks with Intersection over Area (IoA) greater than threshold t_m as the final patch masks.

The calculation of IoA can be stated as follows:


    IoA(mask, H_p)=area(mask⋂ H_p)/area(mask).



If the localization of adversarial patches is accurate enough, the removal process only needs to be able to eliminate the impact of the patches. Therefore, we employ a simple and fast inpainting method that is commonly used in previous works <cit.>: filling the patch area with all black pixels. We also compare the coherence transport-based inpainting method <cit.> with all-black, more details can be found in supplementary material. 





 §.§ Semantic Independence Localization




Semantic independence evaluation. The semantic independence of a region can be measured by its semantic correlation with surrounding regions. The smaller the semantic correlation, the stronger the independence. For two adjacent regions, A and B, their semantic correlation can be defined as the information gain they provide to each other. Given knowledge about region A, it quantifies how much information can be inferred about region B, i.e., the reduction in uncertainty about B given knowledge of A. 

This can be expressed using mutual information:







    I(A;B)=H(A)-H(A|B)=H(B)-H(B|A)

where H(∗) represents information entropy, and H(∗|∗) represents conditional entropy.

Semantic independence localization based on mutual information.  Building on the analysis above, we perform adversarial patch discovery by computing the semantic independence of local regions across the entire image. We set up a sliding window, and calculate the mutual information between each window and its four neighboring windows (up, down, left, right). The average value of these mutual information scores is used as the heat value for the current window, generating a heat map for the entire image. We use W_cur to denote the current window, and  W_up,  W_down,  W_left,  W_right represent the four neighboring windows of the same size respectively. For each i in {up, down, left, right  }, the mutual information between W_i and W_cur can be expressed as follows:


    I(W_i;W_cur)=∑_w_i∈ W_i∑_w_c∈ W_curp(w_i,w_c)log_p(w_i,w_c)/p(w_i)p(w_c).



The heat value within W_cur can be expressed as follows:


    H_mi [ x_cur: x_cur+d,  y_cur: y_cur+d ]  =1/n∑_i=1^nI(W_i;W_cur) ,


where(x_cur, y_cur) denotes the coordinates of the upper left corner of the window W_cur, H_mi denotes the heat map generated by Semantic Independence Localization module, d denotes the size of the sliding window, and n denotes the number of neighboring windows. n equals 4 for most windows, 2 or 3 for windows located at the edge of the image.





 §.§ Spatial Heterogeneity Localization






Impact of compression on image quality. Image compression leverages the insensitivity to certain components of human eyes to reduce storage space. Taking the most commonly used JPEG compression as an example, after color space transformation, it undergoes block-based Discrete Cosine Transform (DCT) to the image, converting the spatial domain into the frequency domain. The transformed low-frequency components have larger values, mainly concentrated in the upper-left corner, while high-frequency components have smaller values, distributed in lower-right regions. Subsequently, the DCT coefficients are quantized so that smaller coefficients close to 0 completely become 0, and non-zero values also generate a large number of repetitions, thereby reducing the coding length. Using F(x,y,i) to represent the DCT coefficient of channel i at location (x,y), the quantization process can be expressed as:



    F_q(x,y,i) =round(F(x,y,i)/Q(x,y,i) ) ,


where Q(x,y,i) represents the corresponding quantization step size. A larger Q leads to greater quantization loss and poorer image quality.

Spatial heterogeneity localization through recompression. For an image containing regions of varying quality, compressing the entire image will affect each quality region differently, providing valuable clues for identifying abnormal regions in the image <cit.>. Inspired by this, we locate adversarial patches based on the quality differences during recompression. For a clean image with quality factor Q_c, the patch area with quality factor Q_p, we set different quality factors  Q_r to re-compress the attacked image X_adv, and calculate the squared difference of pixel values before and after re-compression, as follows:



    D(x,y,Q_r)=1/c∑_i=1^c [ f(x,y,i)- f_Q_r (x,y,i)  ] ^2 ,


where c denotes the number of channels.
When Q_r is close to Q_p, the D values of the patch region are minimized. When Q_r is close to Q_c, the D values of the uncovered region are minimized. 
To enhance the robustness to texture variations in the image, we apply convolutional smoothing and perform normalization.





 §.§ Fusion Block


Section <ref> and <ref> aim to identify potential adversarial patch regions from the perspectives of semantic independence and spatial heterogeneity. In the fusion block, we merge the heat maps obtained from these two methods. Additionally, to mitigate the influence of cluttered backgrounds, we apply adaptive thresholding and morphological operations to further process the fused results.

Heatmap fusion. Given the local mutual information heat map H_mi and the recompression difference heat map H_cd which have different value ranges, we first normalize them individually to scale the values into the range [ 0,255  ]. The normalization process can be expressed as follows:

    H_mi^' (x,y)=H_mi(x,y)-min(H_mi)/max(H_mi)-min(H_mi)× 255,


    H_cd^' (x,y)=H_cd(x,y)-min(H_cd)/max(H_cd)-min(H_cd)× 255.

After normalization, we perform a weighted sum of H_mi^' and H_cd^' to obtain the fused heat map, H_fuse^':

    H_fuse (x,y)=r_mi×  H_mi^' (x,y)+(1-r_mi)× H_cd^' (x,y),

where r_mi∈ [ 0,1  ] denotes the weight of  mutual information heat map.

Adaptive thresholding. Since the heat values are significantly affected by the image content, using a static threshold may filter out adversarial patches or incorrectly treat other regions as adversarial patches, thus degrading the performance of the model. Therefore, we automatically set an adaptive threshold based on the distribution of the heat map for each image, and then set elements in H_fuse that are below the threshold to 0. The threshold here can be expressed as follows:

    thresh=(1-j)× Sort(H_fuse)[i]+j× Sort(H_fuse)[i+1],


    i=⌊ (n-1)× p ⌋ , j=(n-1)× p-i,

where p is a fixed hyperparameter, n represents the number of elements in H_fuse, and Sort(H_fuse) represents sorted H_fuse in ascending order based on the heat values.

Morphological operations. To eliminate the interference of background with high heat values but unrelated to adversarial patches, we apply an OPEN-CLOSE-OPEN operation to the heat map after thresholding. The opening operation involves erosion followed by dilation and is mainly used to remove isolated small dots and bridges between different regions in the heat map. The closing operation involves dilation followed by erosion and is mainly used to fill in a few concave regions in the patch area that were filtered out by the threshold. The kernel size for the opening and closing operations is adaptively selected based on the image size, more details can be found in the supplementary material.




§ DEFENSE EVALUATION ON DIGITAL ATTACKS









 §.§ Evaluation Settings


Target object detectors and dataset. In our experiments, we use Faster R-CNN <cit.> with a ResNet-50 <cit.> backbone, YOLOv2 <cit.>, YOLOv3 <cit.>, YOLOv5s <cit.> and YOLOv8n <cit.> as our target object detectors. 

All models are pre-trained on MS COCO <cit.>. Since most existing adversarial patch attacks that can be used physically are developed for pedestrian detectors <cit.>, we mainly focus on the INRIA Person dataset <cit.> which consists of 614 person detection images for training and 288 for testing. Only test images are adopted since there is no training part in PAD. Experiments on other datasets can be found in supplementary material.

Adversarial patch attacks. To evaluate the defense effectiveness of PAD against different types of patches, we employ 11 distinct patches generated by DPatch <cit.>, YOLO adversarial patch <cit.>, and Naturalistic Patch <cit.>, covering localized noise, printable, and natural-looking patches. DPatch generates a specific-sized patch (75×75 and 100×100 in our experiments) located in the upper left corner of each image, using 200 iterations with a learning rate of 0.01. The YOLO adversarial patch (P1-P6) and Naturalistic Patch (OBJ, OBJ-CLS, and Upper) generate multiple patches of varying sizes and positions based on the detectable pedestrians in the image. We also conduct defense experiments against two more attacks <cit.><cit.>, the relevant results can be found in the supplementary material.



Implementation details. Throughout our experiments, we used fixed hyperparameter values for different patch types without any adjustments. We set r_mi to 0.5 in Heatmap fusion, which assigns equal weights to Semantic Independence Localization and Spatial Heterogeneity Localization. The value of p in Adaptive thresholding is set to 0.8. The IoA threshold t_m for mask matching is set to 0.5.

We compare PAD with four state-of-the-art adversarial patch defenses: LGS <cit.>, SAC <cit.>, Jedi <cit.>, and ObjectSeeker <cit.>, corresponding to denoising-based, external segmenter-based, entropy-based and certifiably robust defenses respectively. For LGS, we set the block size to 30, overlap to 5, threshold to 0.1, and smoothing factor to 2.3. For Jedi, due to the reliance on the prior entropy distribution values of the clean dataset and the patch region, using default parameters in code is less effective, we perform parameter tuning for some patches. 





 §.§ Overall Defense Performance



 In object detection tasks, Average Precision (AP) is a widely used evaluation metric that assesses the area under the Precision-Recall Curve, representing the overall performance of a model. Therefore, we utilize mean Average Precision (mAP) at Intersection over Union (IoU) 0.5 to demonstrate the effectiveness of the attacks and defenses. We conduct experiments on different detectors, attacks, and defenses mentioned above and report the results in Table <ref>. Due to space limitations, it only shows results on Faster R-CNN, YOLOv3, and YOLOv5s. Results on YOLOv2 and YOLOv8n can be found in the supplementary material.

The results demonstrate that PAD achieves the best defense performance against various adversarial patch attacks on different detectors. For natural-looking patches (P1-P6) <cit.>, which are more challenging to detect by both humans and machines, the mAP increases by more than 10% on average (absolute) compared to the suboptimal method. 

From the experimental results, it can be observed that ObjectSeeker <cit.> performs poorly under these attacks, some even worse than undefended. This is because ObjectSeeker can only defend against hiding attacks, and the assumption does not hold when encountering multiple patches. SAC <cit.> is best at defending against localized noise patches since its segmenter is trained on noise-like patch data. However, its performance significantly drops when facing natural-looking patches, with almost no defense capabilities against some of the patches. 

The performance of Jedi <cit.> is unstable,  due to the influence of non-patch high-entropy regions. In contrast, PAD demonstrates robustness against various patches, benefiting from the universality of semantic independence and spatial heterogeneity and the complete independence from prior knowledge of attacks.

We also report the mAP of clean samples after defense in Table <ref>. PAD achieves a similarly high clean performance as the vanilla object detectors (0.02% drop on Faster R-CNN, 0.34% drop on YOLOv3, and 0.45% rise on YOLOv5s). For clean images without patches, although areas with relatively high values may remain after heat map threshold processing, they are usually scattered and will be eroded during subsequent morphological operations, thus not significantly impacting the model's performance.







 §.§ Patch Localization Performance


Patch localization is a crucial step in the defense process, as it forms the foundation for subsequent patch removal. Therefore, we conducted a further evaluation of the patch localization performance. For accurate quantification, we propose a new metric called Patch Localization Recall. For each ground truth mask M_patch corresponding to an introduced patch region, we calculate the IoA between M_patch and the generated masks M_defense obtained by the defense method, and mark this patch using the following notation:

    F_m={
    	1    IoA(M_patch, M_defense) ≥ 0.5
    
    	0    IoA(M_patch, M_defense) < 0.5
    
    	.



    Recall_patch = ∑_m=1^M F_m/M.




Since there is no patch localization process in certifiably robust defense,
and the localization results of LGS <cit.> are not continuous regions, we primarily compare PAD with SAC <cit.> and Jedi <cit.>. The results are presented in Table <ref>, showing a significant improvement ( 30%-55% absolute and  2-3x relative) over existing state-of-the-art works. In the case of YOLO adversarial patch <cit.> and Naturalistic Patch <cit.>, the ground truth masks include small regions that can be easily mistaken for the background. This is because the attack involves covering almost every visible pedestrian in the image with a patch, including small individuals in the distance. As a result, achieving high Patch Localization Recall values becomes more challenging. However, PAD still demonstrates effective performance against these attacks.



SAC <cit.> exhibits good performance for DPatch <cit.>, as its segmenter is trained on adversarial images generated with PGD <cit.>, which falls under the category of localized noise. However, it struggles when faced with natural-looking patches that it has not encountered before, leading to almost zero Patch Localization Recall. Jedi <cit.> performs poorly on DPatch-75, which may caused by the difficulty in the prior entropy distribution values adjustment. In contrast, PAD achieves high Patch Localization Recall for different types of patches, as it does not rely on prior knowledge or existing attack data.

According to the definition of Patch Localization Recall, It is natural to think that a defense method can achieve a high Patch Localization Recall by generating a mask with the widest possible coverage. However, removing a large number of non-patch areas from the image will inevitably result in a decrease in detection mAP. PAD achieves the highest values in both Patch Localization Recall and detection mAP, showcasing superior defense performance. We provide visualization of the patch localization process in Figure <ref>.






 §.§ Ablation Study




To investigate the individual impacts of semantic independence and spatial heterogeneity in PAD, we conduct an ablation study
that involves using only the H_mi from Semantic Independence Localization and only the H_cd from Spatial Heterogeneity Localization. Partial results on YOLOv8n are presented in Table <ref>. It can be observed that the full method, which combines semantic independence and spatial heterogeneity, achieves more stable overall performance.





Additionally, we have observed that spatial heterogeneity tends to outperform semantic independence in digital attack experiments. In digital attacks, patch generation is completely independent of the original clean image and less affected by interference, resulting in more pronounced heterogeneity, leading to better performance. However, in physical attacks where the patch is physically printed and imaged alongside other parts of the scene, the manifestation of heterogeneity may become weaker, and the role of semantic independence becomes more significant. In such cases, semantic independence outperforms spatial heterogeneity.

In this paper, to validate the defense performance of PAD without any parameter tuning, equal weights are assigned to Semantic Independence Localization and Spatial Heterogeneity Localization. By adjusting the weight allocation for digital attacks and physical attacks respectively, PAD can achieve even better results.








§ DEFENSE EVALUATION ON PHYSICAL ATTACKS



To validate the effectiveness of PAD against physical attacks, we conducted experiments using a publicly available dataset that consists of physical adversarial patches <cit.>, as well as physical attack videos captured by our own. We kept all parameters unchanged, ensuring that the implementation details remained consistent with the digital experiments.




 §.§ Evaluation on APRICOT


APRICOT <cit.> consists of 1,011 photos with high resolution captured in real-world environments, encompassing both indoor and outdoor scenes. Each photo contains a printed physical adversarial patch, which varies in size, shape, location, viewing angle, and lighting conditions. These patches are generated to cause false detection of non-existent objects, targeting 10 specific classes.




We use Faster R-CNN <cit.> model pretrained on MS COCO <cit.> as our target object detector and evaluate the defense performance on the development set. Since this is a targeted attack, we use the Attack Success Rate (ASR) as our evaluation metric, setting the IoU threshold to 0.10 and the confidence threshold to 0.30. We present the results after applying different defense methods in Figure <ref>.






The results show that PAD, without any prior attack knowledge or training data of adversarial patches, significantly reduces the attack success rate to 2.27%. Moreover, SAC <cit.> utilizes APRICOT data with accurate masks to train its patch segmenter, getting an attack success rate of only 0.1% lower than PAD, highlighting the superiority of PAD. We provide examples of defended images produced by different defense methods in Figure <ref>, demonstrating our robustness against physical world patches of various sizes, shapes, lighting conditions, and angles.



 






 §.§ Evaluation on physical attack videos


To further evaluate the effectiveness of PAD against a wider range of patch types in the physical world, we print nine different patches, including P1-P6 <cit.>, OBJ, OBJ-CLS, and Upper <cit.>, and capture videos in five different indoor and outdoor scenes while holding these patches.

Due to the significant impact of lighting, distance, and angles on the success rate of physical attacks, we conduct extensive practical filming and testing to select a subset comprising images with relatively higher attack success rates. The final defense test set consists of 1100 photos, more details about the data distribution can be found in the supplementary material.  





We use YOLOv8n as the target object detector and compare the defense performance of PAD with Jedi <cit.> and SAC <cit.> on this test set. The PR curves in Figure <ref> demonstrate the superiority of PAD over the compared state-of-the-art methods. We show an example of the test image and defense result in Figure <ref>.





§ CONCLUSION




In this paper, we identify two inherent characteristics of adversarial patches that are independent of their appearance, shape, size, location, and quantity. Leveraging these characteristics, we propose a patch-agnostic defense (PAD) method, which perform adversarial patch localization and removal without prior attack knowledge. PAD offers patch-agnostic defense against a wide range of adversarial patches, significantly enhancing the robustness of various pre-trained object detectors. Without training, PAD eliminates the reliance on existing attack data, making it more adaptable and capable of defending against novel patch attacks that have not been encountered yet. Our experimental results demonstrate the effectiveness in both digital space and the physical world, highlighting the practicality of PAD across different attack scenarios.



Acknowledgements. This work is supported in part by the National Natural Science Foundation of China Under Grants No.62176253 and No.U20B2066.




    ieeenat_fullname
    





