Robust Feature-Level Adversaries are Interpretability Tools
Abstract
The literature on adversarial attacks in computer vision typically focuses on pixellevel perturbations.
These tend to be very difﬁcult to interpret.
Recent work that manipulates the latent representations of image generators to create “feature-level” adversarial perturbations gives us an opportunity to explore perceptible, interpretable adversarial attacks.
We make three contributions.
First, we observe that feature-level attacks provide useful classes of inputs for studying representations in models.
Second, we show that these adversaries are versatile and highly robust.
We demonstrate that they can be used to produce targeted, universal, disguised, physically-realizable, and black-box attacks at the ImageNet scale.
Third, we show how these adversarial images can be used as a practical interpretability tool for identifying bugs in networks.
We use these adversaries to make predictions about spurious associations between features and classes which we then test by designing “copy/paste” attacks in which one natural image is pasted into another to cause a targeted misclassiﬁcation.
Our results suggest that feature-level attacks are a promising approach for rigorous interpretability research.
They support the design of tools to better understand what a model has learned and diagnose brittle feature associations.
Introduction
State-of-the-art neural networks are vulnerable to adversarial examples.
Conventionally, adversarial inputs for visual classiﬁers take the form of small-norm perturbations to natural images [65, 17].
These perturbations reliably cause conﬁdent misclassiﬁcations.
However, to a human, they typically appear as random or mildly-textured noise.
Consequently, it is difﬁcult to interpret these attacks–they rarely generalize to produce human-comprehensible insights about the target network. In other words, beyond the observation that such attacks are possible, it is hard to learn much about the underlying target network from these pixel-level perturbations.
In contrast, many real-world failures of biological vision are caused by perceptible, human-describable features.
For instance, the ringlet butterﬂy’s predators are stunned by adversarial "eyespots" on its wings (Appendix A.1, Fig. 7).
This falls outside the scope of conventional adversarial examples because the misclassiﬁcation results from a feature-level change to an object/image.
The adversarial eyespots are robust in the sense that the same attack works across a variety of different observers, backgrounds, and viewing conditions.
Furthermore, because the attack relies on high-level features, it is easy for a human to describe it.
[Figure] This work takes inspiration from the ringlet butterﬂy’s eyespots and similar examples in which a model is fooled in the real world by an interpretable feature (e.g. [45]).
Our goal is to design adversaries that reveal easily-understandable weaknesses of the victim network.
We focus on two desiderata for adversarial perturbations: attacks must be (1) interpretable (i.e. describable) to a human, and (2) robust so that interpretations generalize.
We refer to these types of attacks as “featurelevel” adversarial examples.
Several previous works have created attacks by perturbing the latent representations of an image generator (e.g., [23]), but thus far, approaches have been small in scale, limited in robustness, and not interpretability-driven (See Section 2).
We build on this prior work to propose an attack method that generates feature-level attacks against computer vision models.
This method works on ImageNet scale models and creates robust, featurelevel adversarial examples.
We test three methods of introducing adversarial features into source images either by modifying the generator’s latents and/or inserting a generated patch into natural images.
In contrast to previous works that have enforced the “adversarialness” of attacks only by inserting small features or restricting the distance between an adversary and a benign input, we also introduce methods that regularize the feature to be perceptible yet disguised to resemble something other than the target class.
We show that our method produces robust attacks that provide actionable insights into a network’s learned representations.
Fig.
1 demonstrates the interpretability beneﬁts of this type of feature-level attack.
It compares a conventional, pixel-level, adversarial patch, created using the method from [6], with a feature-level attack using our method.
While both attacks attempt to make a network misclassify a bee as a ﬂy, the pixel-level attack exhibits high-frequency patterns and lacks visuallycoherent objects.
On the other hand, the feature-level attacks displays easily describable features: the colored balls.
We can validate this insight by considering the network performance when a picture of a trafﬁc light is inserted into the image a bee.
In this example, the image classiﬁcation moves from a 55% conﬁdence that the image is a bee to a 97% conﬁdence that the image is of a ﬂy.
Section.
studies these types of “copy/paste” attacks more in depth.
Our contributions are threefold.
Conceptual Insight: We observe that robust feature-level adversaries can used to produce useful types of inputs for studying the representations of deep networks 2.
Robust Attacks: We introduce methods for generating feature-level adversaries that are uniquely versatile and able to produce targeted, universal, disguised, physically-realizable, and black-box attacks at the ImageNet scale.
See Table 1. 3.
Interpretability: We generalize from our adversarial examples to design copy/paste attacks, verifying that our adversaries help us understand the network well enough to exploit it.
The following sections contain background, methods, experiments, and discussion.
Appendix A.11 has a high-level summary for a lay-audience.
Code is available at https://github.com/thestephencasper/feature_level_adv. [Table]
Related Work
Here [Table] we contextualize our approach with others related to improving on conventional adversarial examples [65, 17].
Table 1 summarizes capabilities.
Inspiration from Nature: Mimicry is common in nature, and sometimes, rather than holistically imitating another species, a mimic will only display particular features.
For example, many animals use adversarial eyespots to confuse predators [63] (see Appendix A.1 Fig. 7a).
Another example is the mimic octopus which imitates the patterning, but not the shape, of a banded sea snake.
We show in Figure 7b that a ResNet50 classiﬁes an image of one as a sea snake.
Generative Modeling: An approach related to ours has been to train a generator or autoencoder to produce small adversarial perturbations that are applied to natural inputs.
This has been done to synthesize imperceptible attacks that are transferable, universal, or efﬁcient to produce [19, 40, 41, 50, 72, 18, 71].
Rather than training a generator, ours and other works have perturbed the latents of pretrained generative models to produce perceptible alterations.
[37] did this with a differentiable image renderer.
Others [54, 62, 28, 27, 59, 23] have used deep generative networks, and [68] aimed to create more semantically-understandable attacks by using an autoencoder with a “disentangled” embedding space.
Our work is different in four ways.
(1) These works focus on small classiﬁers trained on simple datasets (MNIST [35], Fashion MNIST [73], SVHN [43], CelebA [38], BDD [74],
INRIA [8], and MPII [1]) while we work at the ImageNet [52] scale.
(2) We do not simply rely on [Table] [Figure] using small features or restricting the distance to a benign image to enforce the adversarialness of attacks.
We introduce techniques that regularize the adversarial feature to be perceptible yet disguised to resemble something other than the target class.
(3) We evaluate three distinct ways of inserting adversarial features into images.
(4) Our work is interpretability-oriented.
Attacks in the Physical World: Physical-realizability demonstrates robustness.
We show that our attacks work when printed and photographed.
This directly relates to [33] who found that pixel-space adversaries could do this to a limited extent in controlled settings.
More recently, [56, 6, 14, 2, 36, 66, 31, 30] created adversarial clothing, stickers, or objects.
In contrast with these, we also produce attacks in the physical world that are disguised as a non-target class.
Adversaries and Interpretability: Using adversarial examples to better interpret networks has been proposed by [10] and [67].
We use ours to discover human-describable feature/class associations learned by a network.
This relates to [16, 34, 69] who debug networks by searching over transformations, textural changes, and feature feature alterations.
More similar to our work are [7, 42, 22], who use feature visualization [46] and network dissection [3] to interpret the network.
Each use their interpretations to design “copy/paste” attacks in which one natural image pasted inside another causes an unrelated misclassiﬁcation.
We add to this work with a new method to identify such adversarial features.
Unlike any previous approach, ours does so in a way that allows for targeted attacks that take into account an arbitrary distribution of source images.
Methods
We adopt the “unrestricted” adversary paradigm [62] under which an attack is successful if the network’s classiﬁcation differs from an oracle’s
(e.g., a human).
Our adversaries can only change a small, ﬁxed portion of either the generator’s latent or the image.
We use white-box access to the network, though we present black-box attacks based on transfer from an ensemble in Appendix A.6.
Our attacks involve perturbing the latent representation in some layer of an image generator to produce an adversarial feature-level alteration.
Fig.
2 depicts our approach.
We test three types of attacks, “patch”, “region” and “generalized patch” (plus a fourth in Appendix A.5 which we call “channel” attacks).
We ﬁnd patch attacks to generally be the most successful.
Patch: We use the generator to produce a square patch that is inserted into a natural image [57]. [Figure] a t c h [Figure]
r
[Figure] I [Figure] t
i
[Figure]
R e g i o n
C r o pp
[Figure]
r o
[Figure]
r
[Figure]
li z
[Figure]
P a t c h
[Figure]
r e
I n
[Figure]
r t i
[Figure]
n
[Figure]
Region: Starting with some generated image, we randomly select a square column of the latent in a generator layer which spans the channel dimension and replace it with a learned insertion.
This is analogous to a square patch in the pixel representation.
We keep insertion location ﬁxed over training.
The modiﬁed latent is passed through the rest of the generator, producing the adversarial image.
Generalized Patch: These patches can be of any shape, hence the name “generalized” patch.
We ﬁrst generate a region attack and then extract a generalized patch from it.
We do this by taking the absolute-valued pixel-level difference between the original and adversarial image, applying a
Gaussian ﬁlter for smoothing, and creating a binary mask from the top decile of these pixel differences.
We apply this mask to the generated image to isolate the region that the perturbation altered.
We can then treat this as a patch and overlay it onto an image in any location.
Basic Attacks: For all attacks, we train a perturbation δ to the latent of the generator to minimize a loss that optimizes for both attacking the classiﬁer and appearing interpretable:
[Equation]
1) with X a distribution over source images (e.g., a dataset or generation distribution), T a distribution over transformations, L a distribution over insertion locations (this only applies for patches and generalized patches), C the target classiﬁer, A an image-generating function, L x-ent a targeted crossentropy loss for attacking the classiﬁer, y targ the target class, and L reg a regularization loss.
The adversary has no control over X , T , or L , so it must learn features that work on the network independent of any particular source image, transformation, or insertion location.
For all of our attacks, L reg contains a total variation loss, TV ( a ) , to discourage high-frequency patterns.
“Disguised” Attacks: Ideally, a feature-level adversarial example should appear to a human as easily-describable but should not resemble the attack’s target class.
We call such attacks “disguised.”
Here, the main goal is not to fool a human, but to help them learn about what types of realistic features might cause the model to make a mistake.
To train these disguised attacks, we use additional terms in L reg as proxies for these two criteria.
We differentiably resize the patch or the extracted generalized patch and pass it through a GAN discriminator and auxiliary classiﬁer.
We then add weighted terms to the regularization loss based on the discriminator’s
( D ) logistic loss for classifying the input as fake, the output entropy ( H ) of some classiﬁer ( C (cid:48) ), and/or the negative of the classiﬁer’s crossentropy loss for labeling the input as the attack’s target class.
Note that C (cid:48) could either be the same or different than the target classiﬁer C .
With all of these terms, the regularization objective is
[Equation]
Here, P ( a ) returns the extracted and resized patch from adversarial image a .
In order, these three new terms encourage the adversarial feature to (1) look realistic, and (2) look like some speciﬁc class, but (3) not the target class.
The choice of disguise class is left entirely to the training process.
Experiments
[Figure]
[Figure]
shows the proportion of attacks in which the patch was not classiﬁed by the network as the target class when viewed on its own.
Mean target class conﬁdence (y axis) gives the empirical target class conﬁdences of 250 patch attacks
Each is over source images gives randomly sampled We use BigGAN generators from [5, 70], and perturb the post-ReLU outputs of the internal ‘GenBlocks.’
We also found that training slight perturbations to the BigGAN’s inputs improved performance. We used the BigGAN discriminator and adversarially trained classiﬁers from [12] for disguise regularization.
By default, we attacked a ResNet50 [20], restricting patch attacks to 1/16 of the image and region and generalized patch attacks to 1/8.
Appendix A.2 has additional details.
First, in Section 4.1 we show that these feature level adversaries are highly robust to suggest that interpretations based on them are generalizable.
Second, in Section 4.
we put these interpretations to the test and show that our feature level adversaries can help one understand a network well enough to exploit it.
4.1 Robust Attacks
Figure 3 shows examples of targeted, universal, and disguised feature-level patch (top), region (middle), and generalized patch (bottom) attacks which were each trained with all of the disguise regularization terms from Eq.
We ﬁnd the disguises to be effective, particularly for the patches (top row), but imperfect.
Appendix
A.3 discusses this and what it may suggest about networks and size bias.
Performance versus Disguise: Here, we study our patch attacks in depth to test how effective they are at attacking the network and how successfully they can help to identify non-targetclass features that can fool the network.
We compared seven different approaches.
The ﬁrst was our full approach using the generator and all disguise regularization terms from Eq. 2.
The rest were ablation tests in which we omitted the generator (No Gen), the discriminator (No Disc) regularization term (No Reg), the entropy regularization term (No Ent), the crossentropy regularization term (No Patch X-ent), all three regularization terms (Only Gen), and ﬁnally the discriminator and all three regularization terms (Brown et al. ’17).
This ﬁnal unregularized, pixel-level method resulted in the same approach as Brown et al.
For each test, all else was kept identical including penalizing total variation, training under transformations, and initializing the patch as a generator output.
[Figure] For each method, we generated universal attacks with random target classes until we obtainedsuccessfully “disguised” ones in which the resulting adversarial feature was not classiﬁed by the network as the target class when viewed on its own.
Fig.
4 plots the success rate versus the distribution of target class mean conﬁdences for each type of attack.
For all methods, these universal attacks have variable target class conﬁdences due in large part to the random selection of target class.
Some attacks are stochastically Pareto dominated by others.
For example, the pixel-space Brown et al.
(2017) attacks were the least effective at attacking the target network and had the third least disguise rate.
In other cases, there is a tradeoff between attack performance and disguise which can be controlled using the regularization terms from Eq.
We also compare our attacks to two baselines using resized natural images from the target class and randomly sampled patches from the center of target class images.
These resulted in a mean target class conﬁdences of 0.0024 and 0.0018 respectively.
Notably, Fig. 4 does not capture everything that one might care about in these attacks.
It does not show any measure of how “realistic” the resulting patches look.
In Appendix A.4, Fig.
9 plots the same target class conﬁdence data from the y axis in Fig.
4 versus the disguise class label conﬁdence from an Inception-v3 which we use as a proxy for how realistic a human would ﬁnd the patch.
It suggests that the best attacks for producing patches that appear realistic are the “All” and “No Disc” methods.
In Appendix A.10, Figs. 13 14, and 15 give examples of successful “All”, “Only Gen”, and “Brown et al. ’
17” attacks respectively.
Because they were initialized from generator outputs, some of the “Brown et al. ’
17” attacks have a veneer-like resemblance to non-target class features.
Nonetheless, they contain higher-frequency patterns and less coherent objects in comparison to the two sets of feature-level attacks.
We subjectively ﬁnd the “All” attacks to be the best disguised.
Physical-Realizability:
To test their ability to transfer to the physical world, we generatedadditional targeted, universal, and disguised adversarial patches.
We used the generator and all regularization terms (the “All” condition from above).
We selected the 10 with the best mean target class conﬁdence, printed them, and photographed each next to 9 objects from different ImageNet classes.
We conﬁrmed that photographs of each object were correctly classiﬁed without a patch.
Figure 5 shows successful examples.
Meanwhile, resizable and printable versions of all these patches and others are in Appendix A.10.
The mean and standard deviation of the target class conﬁdences for our attacks in the physical world were 0.312 and 0.318 respectively ( n = 90 , not i.i.d.).
This means that these patches’ mean effectiveness dropped by less than 12 when transferring to the physical world.
Black-Box Attacks: In Appendix A.6, we show that our targeted universal attacks can transfer from an ensemble to a held-out model.
4.2 Interpretability
If an adversarial feature successfully fools the victim network, this suggests that the network associates that feature in context of a source image with the target class.
We ﬁnd that our adversaries can suggest both beneﬁcial and harmful feature-class associations.
In Appendix A.7, Fig.
11 provides a simple example of each.
Simply developing an interpretation, however, is easy.
Showing that one leads to a useful understanding of the network is harder. One challenge in the explainable AI literature is to develop interpretations that go beyond seeming-plausible and stand up to scrutiny [51].
Robust feature level adversarial patches can easily be used to develop hypotheses about the network’s behavior, e.g. “The network thinks that bee features plus colorful balls implies a ﬂy.”
But are these valid, useful interpretations of the network?
In other words, are our adversaries adversarial because of their interpretable qualities, or is it because of hidden motifs?
We verify interpretations by using our attacks to make and validate predictions about how to fool the target network with natural objects.
Validating Interpretations with Copy/Paste Attacks: A “copy-paste” attack is created by inserting one natural image into another to cause an unexpected misclassiﬁcation.
They are more restricted than patch attacks because the features pasted into an image must be natural objects.
As a result, they are of high interest for physically-realizable attacks because they suggest combinations of real objects that yield unexpected classiﬁcations.
They also have precedent in the real world.
For example, subimage insertions into pornographic images have been used to evade NSFW content detectors [75].
To develop copy/paste attacks, we select a source and target class, generate class-universal adversarial features, and manually analyze them for motifs that resemble natural objects.
Here, we used basic attacks without the disguise regularization terms from Eq.
We then paste images of these objects into natural images and pass them through the classiﬁer.
Fig.
6 shows four types of copy/paste attacks.
In each odd row, we show six patch, region, and generalized patch adversaries that were used to guide the design of a copy/paste attack.
In each even row are the copy/paste adversaries for the 6 (of 50) images for the source class for which the insertion resulted in the highest target class conﬁdence increase along with the mean target class conﬁdences before and after patch insertion for those 6.
The success of these attacks shows their usefulness for interpreting the target network because they require that a human understands the mistake the model is making like “Bee ∧ Trafﬁc Light → Fly” well enough to manually exploit it.
Given the differences in the adversarial features that are produced in the Bee → Fly and Trafﬁc Light → Fly attacks, Fig.also demonstrates how our attacks take the distribution of source images into account.
Three prior works [7, 42, 22] have developed copy/paste attacks, also via interpretability tools.
Unlike [42, 22], our approach allows for targeted attacks.
And unlike all three, rather than simply identifying features associated with a class, our adversaries generate adversarial features for a target class conditional on any distribution over source images (i.e. the source class) with which the adversaries are trained.
Little work has been done on copy/paste adversaries, and thus far, methods have either not allowed for targeted attacks or have required a human in the loop.
This makes objective comparisons difﬁcult.
However we provide examples of a feature-visualization based method inspired by [7] in Appendix A.8 to compare with ours.
For the Indian → African Elephant attack, the source and target class share many features, and we ﬁnd no evidence that feature visualization is able to suggest useful features for copy/paste attacks.
This suggests that our attacks’ ability to take the source image distribution into account may be more helpful for discovering certain weaknesses compared to the baseline inspired by [7].
Discussion and Broader Impact
Here we use feature-level adversarial examples to attack and interpret deep networks in order to contribute to a more practical understanding of network vulnerabilities.
As an attack method, our approach is versatile.
It can produce targeted, universal, disguised, physically-realizable, blackbox, and copy/paste attacks at the ImageNet scale.
Furthermore, this method can be used as an interpretability tool to help diagnose ﬂaws in models.
We ground the notion of interpretability in the ability to make predictions about when a model will fail.
Finally, we demonstrate this through the design of targeted copy/paste attacks for any distribution over source inputs.
Like any work on adversarial attacks, our approach could be used maliciously to make a system fail, but we emphasize their diagnostic value.
Understanding threats is a prerequisite to avoiding them.
Given the robustness and versatility of our attacks, we argue that they may be valuable for continued work to address threats that systems may face in practical applications.
There are at least two ways in which these methods can be useful.
The ﬁrst is for adversarial training.
Training networks on adversarial images has been shown to improve their robustness to the attacks that are used [12].
But this does not guarantee robustness to other types of adversarial inputs (e.g. [21]).
Our feature-level attacks are categorically different from conventional pixel-level ones, and our copy/paste attacks show how networks can be fooled by novel combinations of natural objects, failures that are outside the conventional paradigm for adversarial [Figure]
robustness (e.g., [12]).
Consequently, we expect that adversarial training on broader classes of attacks such as the one we propose here will be valuable for designing more robust models.
As a promising sign, we show in Appendix A.9 that adversarial training is useful for our attacks.
The second is for rigorously diagnosing ﬂaws.
We show that feature-level adversaries aid the discovery of exploitable spurious feature/class associations (Fig. 6) and a socially-harmful bias (Appendix
A.7 Fig.
Our approach could also be extended beyond what we have demonstrated here.
For example, our methods may be useful for feature visualization [46] of a network’s internal neurons.
An analogous approach to ours can also be used in Natural Language Processing [61, 49], and we are currently working on a method for this.
Furthermore, it may be valuable to use these adversaries to identify generalizable ﬂaws in networks that humans can easily understand but with minimal human involvement.
This would be much more scalable and prevent human priors from inﬂuencing interpretations.
Toward this goal, we are currently working on methods for the fully-automated discovery of copy/paste attacks.
A limitation of our approach is that when multiple desiderata are optimized for at the same time (e.g., universality + transformation robustness + disguise), attacks are generally less successful, more time-consuming, and require more screening to ﬁnd good ones.
This could be a bottleneck for large-scale adversarial training.
Ultimately, this type of attack is limited by the efﬁciency and quality of the generator, so future work should leverage advances in generative modeling.
Our evaluation method is also limited to be a proof-of-concept for the design of copy/paste attacks.
Future work should evaluate this more rigorously.
We are currently working toward developing a benchmark for interpretability tools based on their ability to aid a human in rediscovering trojans [15] that have been implanted into a model.
As AI becomes increasingly capable, it becomes more important to design models that are reliable.
Each of the 11 proposals for building safe AI outlined in [25] explicitly call for adversarial robustness and/or interpretability tools, and recent work from [77] on high-stakes reliability in AI found that interpretability tools strengthened their ability to produce inputs for adversarial training.
Given the close relationship between interpretability and adversarial robustness, continued study of the connections between them will be key for building safer AI systems.
Acknowledgments
We thank Cassidy Laidlaw, Miles Turpin, Will Xiao, and Alexander Davies for insightful discussions and feedback and Kaivu Hariharan for help with coding.
This work was conducted in part with funding from the Harvard Undergraduate ofﬁce of Research and Fellowships. A Appendix A.1 Adversarial Features in Nature
Fig.
7 shows examples of robust feature-level adversaries in nature. A.2 Methodological Details
We found that performing crossentropy and entropy regularization (Eq. 2) for disguise using adversarially-trained auxiliary classiﬁers produced more easily interpretable results.
This aligns with ﬁndings that adversarially-trained networks tend to learn more interpretable representations [13, 53] and better approximate the human visual system [55]. Thus, for crossentropy and entropy regularization, we used an (cid:15) =
4 L 2 and (cid:15) =
3 L ∞ robust ResNet50s from [12].
For discriminator regularization, we use the BigGAN class-conditional discriminator with a uniform class vector input (as opposed to a one-hot vector).
For patch adversaries, we train under colorjitter, Gaussian blur,
Gaussian noise, random rotation, and random perspective transformations to simulate real-world variations in conditions.
For region and generalized patch ones, we only use Gaussian blurring and horizontal ﬂipping.
Also for region and generalized patch adversaries, we promote subtlety by penalizing the difference from the original image using the LPIPs perceptual distance [76, 60].
All experiments were implemented with PyTorch [48], and implementations of all of our work can be run from Google Colab notebooks which we provide.
We estimate that our project involved a total of < 400 hours of compute, mostly on 12GB NVIDIA Tesla K80 GPUs. A.3 How Successful are our Disguises? All of our attacks are designed to be “adversarial” in either one or two different ways.
First, all are limited to manipulating only a certain portion of the image or latent. Second, some of our attacks are trained to be disguised as discussed in Section 3.
We subjectively ﬁnd that our methods for disguise are generally useful . For example, compare Fig.
13 to Fig. However, some of these features are not well disguised. Consider the patch of a at the top left of Fig.
13 whose target class is a pufferﬁsh but which is disguised as a crane. We ﬁnd it clear that the patch depicts a crane, and the network agrees when shown the patch as a full image. However, the image also seems to have patterning and coloring that resembles a pufferﬁsh. Furthermore, when shrunk to the size of a patch and inserted into a source image for an attack, the ﬁner, more crane-like features may be less prominent, and the pufferﬁsh-like ones may be more prominent.
This suggests that the the adversary may be exploiting size biases. Ultimately, to the extent that the patch resembles the target class, it is not disguised and arguably not adversarial. However, we emphasize three things. First, we ﬁnd the disguise classes to generally be much more prominent in these patches than the target class.
Second, being able to recognize target class features when the target class is known versus unknown are very different tasks. It is key to note such framing effects [26]. And third, very few attack methods are always successful at the ImageNet
[Figure]
scale, and some need for screening should be expected when optimizing an adversarial example for a complex objective (e.g. universality + transformation robustness + disguise).
We believe the studying human responses to feature-level adversaries and the links between interpretable representations, robustness, and similarity to human cortex [9] may be promising directions for better understanding both networks and biological brains.
A.4 Attack Performance versus Disguise
In the main paper Section 4.1, Fig.
4 plots the successful disguise rate of attacks alongside their distribution of mean target class conﬁdences.
However, this leaves out how effective each type of attack is at appearing realistic to a human. Here, we use the target class conﬁdence of an Inception-v [64] as a proxy for how realistic a patch appears to a human. Fig. 9 plots the mean target class conﬁdences for successfully-disguised attacks versus their Inception-v3 disguise label conﬁdence.
This suggests that the attacks that are the best at producing realistic-looking patches are the “All” ones with the generator and all regularization terms and the “No Disc” ablations which omit the discriminator regularization term.
A.5 Channel Attacks
In contrast to the region attacks presented in the main paper, we experiment here with channel attacks.
For region attacks, we optimize an insertion to the latent activations of a generator’s layer which spans the channel dimension but not the height and width.
This is analogous to a patch attack in pixel-space.
For channel attacks, we optimize an insertion which spans the height and width dimensions but only involves a certain proportion of the channels.
This is analogous to an attack that only modiﬁes the R,
G, or B channel of an image in pixel-space.
Unlike the attacks in Section, 4, we found that it was difﬁcult to create universal channel attacks (single-image attacks, however, were very easy).
Instead, we relaxed this goal and created class-universal ones which are meant to cause any generated example from a source class to be misclassiﬁed as a target.
We also manipulate 1 / 4 th of the latent instead of 1 / 8 th as we do for region attacks. Mean target class conﬁdences and examples from the top 5 attacks out of 16 are shown in Fig. They induce textural changes somewhat like adversaries crafted by [16] and [4]. A.6 Black-Box Attacks
Adversaries are typically created using ﬁrst order optimization on an input to a network which requires that the parameters are known.
However, they are often transferrable between models [47], and one method for developing black-box attacks is to train against a different model and then transfer to the intended target.
We do this for our adversarial patches and generalized patches by attacking a large ensemble of AlexNet [32], VGG19 [58], Inception-v3 [64], DenseNet121 [24], ViT[11, 39], and
[Figure]
Universal Patch Attacks Ablation Tests, n=250 ea.
[Figure] [Figure] two robust ResNet50s [12], and then transferring to ResNet50 [20]. Otherwise, these attacks were identical to the ones in Fig.
3 including a random source/target class and optimization for disguise.
Many were unsuccessful, but a sizable fraction were able to work on the ResNet50 with a mean conﬁdence of over 0.1 for randomly sampled images.
The top 5 out of 64 of these attacks for patch and generalized patch adversaries are shown in Fig
A.7 Discovering Feature-Class Associations
Fig.
11 shows two simple examples of using feature-level attacks to identify feature-class associations.
It shows one positive example in which the barbershop class is desirably associated with barber-polestripe-like features and one negative example in which the bikini class is undesirably associated with [Figure] a particular type of skin. Notably the ability to simply identify feature associated with a target class is not a unique capability of our attacks and could also be achieved with feature visualization [46].
[42, 22, 7] each used interpretability methods to guide the development of copy/paste adversaries. [42] and [22], used network dissection [3] to develop interpretations of neurons and ﬁt a semantic description to neurons which they combined with analysis of weight magnitudes. This allowed them to identify cases in which the networks learned undesirable feature-class associations.
However, this approach cannot be used to make a targeted search for copy/paste attacks that will cause a given source class to be misclassiﬁed as a given target.
More similar to our work is [7] who found inspiration for successful copy/paste adversaries by creating a dataset of visual features and comparing the differences between ones which the network assigned the source versus target label.
We take inspiration from this approach to create a baseline against which to compare our method for designing copy/paste attacks from Section 4.2.
Given a source and target class such as a bee and a ﬂy, we optimize a set of inputs to a network for each class in order to maximize the activation of the output node for that class.
[41] refers to these as class impressions .
We develop these inputs using the Lucent [29] package.
We do this for the same source/target class pairs as in Fig.
6 and display 6 per class in Fig. In each subﬁgure, the top row gives class impressions of the source class, and the bottom gives them for the target. Each class impression is labeled with the network’s conﬁdences for the source and target class. In analyzing these images, we ﬁnd limited evidence of trafﬁc-light-like features in the ﬂy class impressions, and we ﬁnd no evidence of more blue coloration in the African elephant class impressions than the Indian ones.
These class impressions seem comparable but nonredundant with our method from Section 4.2.
However, our approach may have an advantage over the use of class impressions in that it is equipped to design features that look like the target class conditional on a distribution of source images.
Contrastingly, a class impression is only meant to visualize features typical of the target class.
This may be why our adversarial attacks are able to suggest that inserting a trafﬁc light into a bee image or a blue object into an Indian elephant image can cause a misclassiﬁcation as a ﬂy or African elephant respectively.
Bees and Flies and Indian and African elephant are pairs of similar classes.
For cases in which the source and target are related, the class impressions may share many of the same features and thus be less effective for identifying adversarial features that work conditional on the source image distribution.
A.9 Defense via Adversarial Training
Adversarial training is a common effective means for improving robustness.
Here, to test how effective it is for our attacks, for 5 pairs of similar classes, we generate datasets of 1024 images evenly split between each class and between images with and without adversarial perturbations.
This prevents the network from learning to make classiﬁcations based on the mere presence or absence of a patch.
We do this separately for channel, region, and patch adversaries before treating the victim network as a binary classiﬁer and training on the examples.
We report the post-training minus pre-training accuracies in Tbl.
2 and ﬁnd that across the class pairs and attack methods, the adversarial training improves binary classiﬁcation accuracy by a mean of 42%.
[Table] A.10 Examples: Resizable, Printable Patches See Figs.
13, 14, and 15 for feature-level and pixel-level control adversarial images.
We encourage readers to experiment with these images (which were optimized to attack a ResNet50) or with others which can be created using our provided code.
In doing so, one might ﬁnd a mobile app to be convenient.
We used Photo Classiﬁer.
A.11 High-Level Summary
Here, we provide an easily-readable summary of this work, meant especially for readers who may be less familiar with machine learning jargon.
Historically, it has proven difﬁcult to write conventional computer programs that classify images.
But recently, immense progress has been made through neural networks which can now classify images into hundreds or thousands of categories with high accuracy.
Despite this performance, we still don’t fully understand the features that they use to classify images.
Somewhat worryingly, past work has demonstrated that it is easy to take an image that the network classiﬁes correctly and perturb its pixel values by a tiny amount in such a way that the network will misclassify it.
For example, we can take a cat, make human-imperceptible changes to the pixels, and make the network believe that it is a dog.
This process of designing an image that the network will misclassify is called an “adversarial attack.”
Unfortunately, conventional adversarial attacks tend to produce perturbations that are not interpretable.
To a human, they usually appear as pixelated noise (when exaggerated to be visible).
As a result, they do not help us understand how networks will process human-describable inputs, and they do little to help us understand practical ﬂaws in networks.
Here, our goal is to develop different types of adversarial features that can be useful as debugging tools for these networks.
There are two properties that we want our adversarial images to have.
First, we want them to be feature-level (not pixel-level) so that a human can interpret them, and second, we want them to be robust so that interpretations are generalizable.
In one sense, this is not a new idea.
Quite the opposite, in fact – there are examples of this the animal kingdom.
Figure 7 shows examples of adversarial eyespots on a peacock and butterﬂy and adversarial patterns on a mimic octopus.
These are interpretable, robust to a variety of viewing conditions, and give us useful information about how biological brains process these visual features.
The key technique that we use to create adversarial images involves an image generating network.
Instead of perturbing pixels to cause an image to be misclassiﬁed, we perturb the internal state of the generator in order to induce a feature-level change to the output image.
We also found that optimizing adversarial features under transformations to the images (like blurring, cropping, rotating, etc.) and using some additional terms in our optimization objective to encourage more realistic and better-disguised images improved results.
Our ﬁrst key ﬁnding is that these attacks are very robust and versatile.
For example, among other capabilities, we demonstrate that they can be universal (working for any image which we apply them to) and physically-realizable (working in the physical world when printed and photographed).
Our second key ﬁnding is that these adversaries are useful for interpreting networks.
We use them as a way of producing useful classes of inputs for understanding ways that they can fail.
Our strategy is to prove that these adversaries can help use understand the network well enough to exploit it.
We analyze our adversarial features to get ideas for real-world features that resemble them.
Then we test this interpretation by creating “copy/paste” attacks in which one natural image is pasted into another in order to cause a particular misclassiﬁcation.
Some of these are unexpected. For example, in Fig. 6, we ﬁnd that a trafﬁc light can make a bee look like a ﬂy. Together, our ﬁndings suggest that feature-level adversaries are very versatile attacks and practical debugging tools for ﬁnding ﬂaws in networks. One implication is that by training networks on these adversaries, we might be able to make them more robust to failures that are due to feature-level properties of images.
We also argue that these adversaries should be used as a practical debugging tool to diagnose problems in networks.
[Table]
[Figure]
[Figure]
[Figure] [Figure]
[Figure]