Adversarial Patch
Tom B. Brown Dandelion Mané Aurko Roy Martín Abadi Justin Gilmer
cs.CV



A Unified Framework for Multiscale Modeling using the Mori-Zwanzig Formalism and the Variational Multiscale Method
    Karthik Duraisamy
    December 30, 2023
==================================================================================================================




We present a method to create universal, robust, targeted adversarial image patches in the real world. The patches are universal because they can be used to attack any scene, robust because they work under a wide variety of transformations, and targeted because they can cause a classifier to output any target class. These adversarial patches can be printed, added to any scene, photographed, and presented to image classifiers; even when the patches are small, they cause the classifiers to ignore the other items in the scene and report a chosen target class. 




§ INTRODUCTION



Deep learning systems are broadly vulnerable to adversarial examples, 
carefully chosen inputs that cause the network to change output without a visible change to a human <cit.>. These adversarial examples most commonly modify 
each pixel by only a small amount and can be found using a number of 
optimization strategies such as L-BFGS <cit.>, Fast Gradient Sign 
Method (FGSM) <cit.>, DeepFool 
<cit.>, Projected Gradient Descent (PGD) 
<cit.>, as well as the recently proposed 
Logit-space Projected Gradient Ascent (LS-PGA) 
<cit.> for discretized inputs. 
Other attack methods seek to modify only a 
small number of pixels in the image (Jacobian-based saliency map 
<cit.>), or a small patch at a fixed location of the image 
<cit.>.

Adversarial examples have been shown to generalize to the real world. Kurakin et al. <cit.> demonstrated that when printed out, an adversarially constructed image will continue to be adversarial to classifiers even under different lighting and orientations. Athalye et al. <cit.> recently demonstrated adversarial objects which can be 3d printed and misclassified by networks at different orientations and scales. Their adversarial objects are designed to be subtle perturbations of a normal object (e.g. a turtle that has been adversarially perturbed to be classified as a rifle). Another work <cit.> showed that one can fool facial recognition software by constructing adversarial glasses. These glasses were targeted in that they could be constructed to impersonate any person, but were custom made for the attacker's face, and were designed with a fixed orientation in mind. Even more recently, Evtimov et al. <cit.> demonstrated various methods for constructing stop signs that are misclassified by models, either by printing out a large poster that looks like a stop sign, or by placing various stickers on a stop sign. In terms of defenses there has been substantial work on increasing the adversarial robustness of image models to small L_p perturbations of the input <cit.>.

As seen above, a majority of prior work has focused on attacking with and defending against either small or imperceptible changes to the input. In this work we explore what is possible if an attacker no longer restricts themselves to imperceptible changes. We construct an attack that does not attempt to subtly transform an existing item into another. Instead, this attack generates an image-independent patch that is extremely salient to a neural network. This patch can then be placed anywhere within the field of view of the classifier, and causes the classifier to output a targeted class. Because this patch is scene-independent, it allows attackers to create a physical-world attack without prior knowledge of the lighting conditions, camera angle, type of classifier being attacked, or even the other items within the scene. 



This attack is significant because the attacker does not need to know what image they are attacking when constructing the attack. After generating an adversarial patch, the patch could be widely distributed across the Internet for other attackers to print out and use. Additionally, because the attack uses a large perturbation, the existing defense techniques which focus on defending against small perturbations may not be robust to larger perturbations such as these. Indeed recent work has demonstrated that state-of-the art adversarially trained models on MNIST are still vulnerable to larger perturbations than those used in training either by searching for a nearby adversarial example using a different metric for distance <cit.>, or by applying large perturbations in the background <cit.>.



§ APPROACH



The traditional strategy for finding a targeted adversarial example is as follows: given some classifier yx, some input x ∈^n, some target class y 
and a maximum perturbation ε, we want to find the input x that maximizes 
log(yx), subject to the constraint that x-x_∞≤ε. When yx is parameterized 
by a neural network, an attacker with access to the model can perform iterated gradient descent on x in order to find a suitable input x. This strategy can produce a well camouflaged attack, but requires modifying the target image. 

Instead, we create our attack by completely replacing a part of the image with our patch. We mask our patch to allow it to take any shape, and then train over a variety of images, applying a random translation, scaling, and rotation on the patch in each image, optimizing using gradient descent. In particular for a given image x ∈ℝ^w × h × c, patch p, patch location l, and patch transformations t (e.g. rotations or scaling) we define a patch application operator A(p, x, l, t) which first applies the transformations t to the patch p, and then applies the transformed patch p to the image x at location l (see figure <ref>). 




 

  * a trainable patch z ∈^n, 

  * a family of allowable affine transformations T from ^n →^n, 

  * and a binary mask m ∈{0, 1}^n.


The final image x must be realizable using the fixed mask m applied
on the trained patch z and some transformation t ∈ T.
More formally, we define a patch function p 
corresponding to every transformation t ∈ T that applies the transformed patch 
onto the image:

    p_t(x,z) = t(m⊙ z) + [ t(1-m) ⊙ x ],

where ⊙ refers to the pixel-wise Hadamard product.
Then the final adversarially perturbed image x must satisfy
x = p_t(x, z) for the final trained patch z and
some t ∈ T.


To obtain the trained patch p we use a variant of the Expectation over Transformation (EOT) framework of Athalye et al. <cit.>. In particular, the patch is trained to optimize the objective function


    p = max_px ∼ X, t ∼ T, l ∼ Llog(y | A(p, x, l, t)


where X is a training set of images, T is a distribution over transformations of the patch, and L is a distribution over locations in the image. Note that this expectation is over images, which encourages the trained patch to work regardless of what is in the background. This departs from most prior work on adversarial perturbations in the fact that this perturbation is universal in that it works for any background. Universal perturbations were identified in <cit.>, but these required changing every pixel in the image and results were not given in the physical world.

We also consider camouflaged patches which are forced to look like a given starting image. Here we simply add a constraint of the form ||p - p_orig||_∞ < ϵ to the patch objective. This will force the final patch to be within ϵ in the L_∞ norm of some starting patch p_orig.


We believe that this attack exploits the way image classification tasks are constructed. While images may contain several items, only one target label is considered true, and thus the network must learn to detect the most "salient" item in the frame. The adversarial patch exploits this feature by producing inputs much more salient than objects in the real world. Thus, when attacking object detection or image segmentation models, we expect a targeted toaster patch to be classified as a toaster, and not to affect other portions of the image.



§ EXPERIMENTAL RESULTS



To test our attack, we compare the efficacy of two whitebox attacks, a blackbox attack, and a control patch. The white box ensemble attack jointly trains a single patch across five ImageNet models: inceptionv3, resnet50, xception, VGG16, and VGG19. We then evaluate the attack by averaging the win rate across all five models. The white box single model attack does the same but only trains and evaluates on a single model. The blackbox attack jointly trains a single patch across four of the ImageNet models, and then evaluates the blackbox attack on a fifth model, which we did not access during training. The control is a picture of a toaster.



During training and evaluation, the patches are rescaled and then digitally inserted on a random location on a random ImageNet image. Figure 2 shows the results. 




Note that the patch size required to reliably fool the model in this universal setting (black box, on a targeted class, and over all images, locations and transformations) is significantly larger than those required to perform a non-targeted attack on a single image and a single location in the whitebox setting. For example, Su et al. <cit.> recently demonstrated that modifying 1 pixel on a 32x32 pixel CIFAR-10 image (0.1% of the pixels in the image) suffices to fool the majority of images with a non-targeted, non-universal whitebox attack. However, our attacks are still far more effective than naively inserting an image with the target class, as is shown in Figure 2 by the relatively poor performance of inserting a real toaster into the scene. 

Any of the attacks shown in Figure 2 can be camouflaged in order to reduce their saliency to a human observer. We create a disguised version of the patch by minimizing its L2 distance to a tie-dye pattern and applying a peace sign mask during training. The results from these experiments are found in Figure 3.



In our final experiment, we test the transferability of our attack into the physical world. We print the generated patch with a standard color printer, and put it a variety of real world situations. The results shown in Figure 1 demonstrate that the attack successfully fools the classifier, even when there are other objects within the scene. For a full video demonstration of the attack, see <https://youtu.be/i1sp4X57TL4>.

We also tested the black box + physical world effectiveness of the patch on the third party Demitasse application[<https://itunes.apple.com/us/app/demitasse-image-recognition-cam/id1138211169?mt=8>] and found some transferability of the patch but only when the patch takes up a significant fraction of the image. We did not optimize the patch for print-ability as in <cit.>, which perhaps explains why the patch is not as effective as in Figure <ref>, which tests black box for different models and not in the physical world. We invite curious readers to try the patch out for themselves by printing out this paper and using the patch in the Appendix. 



§ CONCLUSION



We show that we can generate a universal, robust, targeted patch that fools classifiers regardless of the scale or location of the patch, and does not require knowledge of the other items in the scene that it is attacking. Our attack works in the real world, and can be disguised as an innocuous sticker. These results demonstrate an attack that could be created offline, and then broadly shared.

There has been substantial work on defending against small L_p perturbations to natural images, at least partially motivated by security concerns <cit.>. Part of the motivation of this work is that potential malicious attackers may not be concerned with generating small or imperceptible perturbations to a natural image, but may instead opt for larger more effective but noticeable perturbations to the input - especially if a model has been designed to resist small L_p perturbations.  

Many ML models operate without human validation of every input and thus malicious attackers may not be concerned with the imperceptibility of their attacks. Even if humans are able to notice these patches, they may not understand the intent of the patch and instead view it as a form of art. This work shows that focusing only on defending against small perturbations is insufficient, as large, local perturbations can also break classifiers.







§ APPENDIX





abbrv

