Simple Black-Box Adversarial Perturbations for Deep Networks
Nina Narodytska, Shiva Prasad Kasiviswanathan
Introduction
Convolutional neural networks (CNNs) are among the most popular techniques employed for computer vision tasks, including but not limited to image recognition, localization, video tracking, and image and video segmentation (Goodfellow et al., 2016). Though these deep networks have exhibited good performances for these tasks, they have recently been shown to be particularly susceptible to adversarial perturbations to the input images (Szegedy et al., 2014; Goodfellow et al., 2015; Moosavi-Dezfooli et al., 2016; Papernot et al., 2016c, b; Kurakin et al., 2016; Grosse et al., 2016; Zagoruyko, 2016b). Vulnerability of these networks to adversarial attacks can lead to undesirable consequences in many practical applications using them. For example, adversarial attacks can be used to subvert fraud detection, malware detection, or mislead autonomous navigation systems (Papernot et al., 2016c; Grosse et al., 2016). Further strengthening these results is a recent observation by Kurakin et al. (2016) who showed that a significant fraction of adversarial images crafted using the original network are misclassified even when fed to the classifier through a physical world system (such as a camera).
In this paper, we investigate the problem of robustness of state-of-the-art convolutional neural networks (CNNs) to simple black-box adversarial attacks. The rough goal of adversarial attacks is as follows: Given an image that is correctly classified by a machine learning system (say, a CNN), is it possible to construct a transformation of (say, by adding a small perturbation to some or all the pixels) that now leads to misclassification by the system. Since large perturbations can trivially lead to misclassification, the attacks seek to limit the amount of perturbation applied under some chosen metric. More often than not, in these attacks, the modification done to the image is so subtle that the changes are imperceptible to a human eye. Our proposed attacks also share this property, in addition to being practical and simplistic, thus highlighting a worrying aspect about lack of robustness prevalent in these modern vision techniques.
There are two main research directions in the literature on adversarial attacks based on different assumptions about the adversarial knowledge of the target network. The first line of work assumes that the adversary has detailed knowledge of the network architecture and the parameters resulting from training (or access to the labeled training set) (Szegedy et al., 2014; Goodfellow et al., 2015; Moosavi-Dezfooli et al., 2016; Papernot et al., 2016c). Using this information, an adversary constructs a perturbation for a given image. The most effective methods are gradient-based: a small perturbation is constructed based on the gradients of the loss function w.r.t. the input image and a target label. Often, adding this small perturbation to the original image leads to a misclassification. In the second line of work an adversary has restricted knowledge about the network from being able to only observe the network’s output on some probed inputs (Papernot et al., 2016b). Our work falls into this category. While this black-box model is a much more realistic and applicable threat model, it is also more challenging because it considers weak adversaries without knowledge of the network architecture, parameters, or training data. Interestingly, our results suggest that this level of access and a small number of queries provide sufficient information to construct an adversarial image.
As we operate in a black-box setting, we use a gradient-free approach to adversarial image generation. Papernot et al. (2016b) were the first to discuss a black-box attack against deep learning systems. Their attack crucially relies on the observation that there is a transferability (generalization) property in adversarial examples, i.e., adversarial examples form one model transfers to another. Our proposed attacks on the other hand is much more simple and direct, does not require this transferability property, and hence is more effective in constructing adversarial images, in addition to having some other computational advantages. We demonstrate that our method is capable of constructing adversarial images for several network architectures trained on different datasets. In particular in this paper, we consider the CIFAR10, MNIST, SVHN, STL10, and ImageNet1000 datasets, and two popular network architectures, Network-in-Network (Lin et al., 2014) and VGG (Simonyan and Zisserman, 2014). In Table 1, we show four images from the ImageNet1000 dataset. The original images are in the upper row. The bottom row shows the corresponding perturbed images produced by our algorithm which are misclassified by a VGG CNN-S network (Chatfield et al., 2014a).
In this work, we present simple and effective black-box adversarial attacks on deep convolutional neural networks. We make the following main contributions in this paper.
The first question we investigate is the influence of perturbing a single pixel on the prediction. To do so, we devise a simple scheme, based on randomly selecting a single pixel and applying a strong perturbation to it. Somewhat surprisingly, we noticed that a few trails of this random experiment is already quite enough in generating adversarial images for low resolution image sets. In fact, in many cases, for misclassification, the amount of perturbation needed to be applied to the selected pixel is also quite small. For high-resolution images, a similar phenomena holds, except our scheme now picks a random set of around 50 pixels. These simple experiments show the ease of generating adversarial images for modern deep CNNs without knowledge of either the network architecture or its parameters. There is however one shortcoming in these approaches in that the perturbed image might have pixel values that are outside some expected range.
We overcome this above shortcoming by showing that lower perturbation suffices if we carefully select the pixels for perturbation. The approach is based the idea of greedy local search, an iterative search procedure, where in each round a local neighborhood is used to refine the current image and in process minimizing the probability of the network assigning high confidence scores to the true class label. Again while the algorithm is quite simple, it is rather effective in generating adversarial images with quite small perturbations. We also show an interesting connection between the pixels chosen for perturbation by our approach and the saliency map of an image, as defined by Simonyan et al. (2014), that ranks pixels based on their influence on the output score. In effect our approach identifies pixels with high saliency scores but without explicitly using any gradient information (as needed in the definition of saliency map (Simonyan et al., 2014)). Intuitively, in each round, our local-search based approach computes an implicit approximation to the gradient of the current image by understanding the influence of a few pixels on the output, which is then used to update the current image.
We perform extensive experimental evaluations, and show that our local-search based approach reliably generates adversarial examples with little perturbation (even when compared to a recent elegant adversarial attack proposed by Goodfellow et al. (2015) which needs perfect knowledge of the network). Another feature of our attack is that, by design, our approach only perturbs a very small fraction of the pixels during the adversarial image generation process (e.g., on the ImageNet1000 dataset we on average perturb only about % of the pixels per image). Most previous attacks require the ability to perturb all the pixels in the image.
Our approaches naturally extend to a stronger notion of misclassification (that we refer to as -misclassification), where the goal is to ensure that the true label of the image does not even appear in the top- predictions of the network (obtained by sorting the confidence score vector). This notion especially captures the fact that many modern systems (e.g., ImageNet competition entrants) are evaluated based on top- predictions. To the best of our knowledge, these are the first adversarial attacks on deep neural networks achieving -misclassification.
Related work
Starting with the seminal paper by Szegedy et al. (2014), which showed that the state-of-the-art neural networks are vulnerable to adversarial attacks, there has been significant attention focused on this problem. The research has led to investigation of different adversarial threat models and scenarios (Papernot et al., 2016c, b; Grosse et al., 2016; Kurakin et al., 2016; Fawzi et al., 2016), computationally efficient attacks (Goodfellow et al., 2015), perturbation efficient attacks (Moosavi-Dezfooli et al., 2016), etc.
Szegedy et al. (2014) used a box-constrained L-BFGS technique to generate adversarial examples. They also showed a transferability (or generalization) property for adversarial examples, in that adversarial examples generated for one network might also be misclassified by a related network with possibly different hyper-parameters (number of layers, initial weights, etc.). However, the need for a solving a series of costly penalized optimization problems makes this technique computationally expensive for generating adversarial examples. This issue was fixed by Goodfellow et al. (2015) who motivated by the underlying linearity of the components used to build a network proposed an elegant scheme based on adding perturbation proportional to sign of the network’s cost function gradient. Recently, Moosavi-Dezfooli et al. (2016) used an iterative linearization procedure to generate adversarial examples with lesser perturbation. Another recent attack proposed by Papernot et al. (2016c) uses a notion of adversarial saliency maps (based on the saliency maps introduced by (Simonyan et al., 2014)) to select the most sensitive input components for perturbation. This attack has been adapted by Grosse et al. (2016) for generating adversarial samples for neural networks used as malware classifiers. However, all these above described attacks require perfect knowledge of the target network’s architecture and parameters which limits their applicability to strong adversaries with the capability of gaining insider knowledge of the target system.
Our focus in this paper is the setting of black-box attacks, where we assume that an adversary has only the ability to use the network as an oracle. The adversary can obtain output from supplied inputs, and use the observed input-output relationship to craft adversarial images.These kind of attacks are also known as differential attacks motivated by the use of the term in differential cryptanalysis (Biham and Shamir, 1991). In the context of deep neural networks, a black-box attack was first proposed by Papernot et al. (2016b) with the motivation of constructing an attack on a remotely hosted system.Papernot et al. (2016a) have recently extended this attack beyond deep neural networks to other classes of machine learning techniques. Their general idea is to first approximate the target network by querying it for output labels, which is used to train a substitute network, which is then used to craft adversarial examples for the original network. The success of the attack crucially depends on the transferability property to hold between the original and the substitute network. Our black-box attack is more direct, and completely avoids the transferability assumption, making it far more applicable. We also avoid the overhead of gathering data and training a substitute network. Additionally, our techniques can be adapted to a stronger notion of misclassification.
A complementary line of work has focused on building defenses against adversarial attacks. Although designing defenses is beyond scope of this paper, it is possible that adapting the previous suggested defense solutions such as Jacobian-based regularization (Gu and Rigazio, 2015) and distillation (Papernot et al., 2016d) can reduce the efficacy of our proposed attacks. Moreover, the recently proposed technique of differentially private training (Abadi et al., 2016) can also prove beneficial here.
The study of adversarial instability have led to development of solutions that seeks to improve training to in return increase the robustness and classification performance of the network. In some case, adding adversarial examples to the training (adversarial training) set can act like a regularizer (Szegedy et al., 2014; Goodfellow et al., 2015; Moosavi-Dezfooli et al., 2016). The phenomenon of adversarial instability has also been theoretically investigated for certain families of classifiers under various models of (semi) random noise (Fawzi et al., 2015, 2016). However, as we discuss later, due to peculiar nature of adversarial images generated by our approaches, a simple adversarial training is only mildly effective in preventing future similar adversarial attacks.
The security of machine learning in settings distinct from deep neural networks is also an area of active research with various known attacks under different threat models. We refer the reader to a recent survey by McDaniel et al. (2016) and references therein.
Preliminaries
We denote by NN a trained neural network (trained on some set of training images). NN takes an image as an input and outputs a vector , where denotes the probability as determined by NN that image belongs to class . We denote a function that returns a set of indices that are the top- predictions (ranked by decreasing probability scores with ties broken arbitrarily) of the network NN. For example, if , then (corresponding to the location of the entry ). Similarly, , , etc.
Adversarial Goal.
A neural network NN -misclassifies an image with true label iff the output of the network satisfies .
In other words, -misclassification means that the network ranks the true label below at least other labels. Traditionally the literature on adversarial attacks have only considered the case where . Note that an adversary that achieves a -misclassification for is a stronger adversary than one achieving an -misclassification (-misclassification implies -misclassification for all ). If , we simply say that NN misclassifies the image.
In our setting, an adversary Adv is a function that takes in image as input and whose output is another image (with same number of coordinates as ). We define an adversarial image as one that fools a network into -misclassification.
Given access to an image , we say that an is a -adversarial image (resp. adversarial image) if and (resp. and ).
The goal of adversarial attacks is to design this function Adv that succeeds in fooling the network for a large set of images. Ideally, we would like to achieve this misclassificationNote that the misclassification is at test time, once the trained network has been deployed. by adding only some small perturbation (under some metric) to the image. The presence of adversarial images shows that there exist small perturbations in input that produce large perturbations at the output of the last layer.
Adversarial threat models can be divided into two broad classes.More fine-grained classification has also been considered in (Papernot et al., 2016c) where adversaries are categorized by the information and capabilities at their disposal. The first class of models roughly assumes that the adversary has a total knowledge of the network architecture and the parameters resulting from training (or access to the labeled training set). The second class of threat models, as considered in this paper, make no assumptions about the adversary having access to the network architecture, network parameters, or the training set. In this case, the adversary has only a black-box (oracle) access to the network, in that it can query the network NN on an image and observe the output . In our experimental section (Section 6), we also consider a slight weakening of this black-box model where the adversary has only the ability to use a proxy of the network NN as an oracle.
A black-box threat model in the context of deep neural networks was first considered by Papernot et al. (2016b). There is however one subtle difference between the threat model considered here and that considered by Papernot et al. (2016b) in what the adversary can access as an output. While the adversary presented in (Papernot et al., 2016b) requires access to the class label assigned by the network which is the same level of access needed by our simple randomized adversary (presented in Section 4), our local-search adversary (presented in Section 5) requires access to (the probability assigned to the true label by the network on input ) and the vector (for checking whether -misclassification has been achieved). Our adversarial approaches does not require access to the complete probability vector (). Also as pointed out earlier, compared to (Papernot et al., 2016b), our approach is more direct (needs no transferability assumption), requires no retraining, and can be adapted to achieve -misclassification rather than just -misclassification.
Black-box Generation: A First Attempt
In this section, we present a simple black-box adversary that operates by perturbing a single pixel (or a small set of pixels) selected at random. In the next section, we build upon this idea to construct an adversary that achieves better success by making adaptive choices.
Starting point of our investigation is to understand the influence of a single pixel in an adversarial setting. Most existing adversarial attacks operate by applying the same perturbation on each individual pixel while minimizing the overall perturbation (Szegedy et al., 2014; Goodfellow et al., 2015; Moosavi-Dezfooli et al., 2016), while recent research have yielded attacks that perturb only a fraction of the pixels (Papernot et al., 2016c, b; Grosse et al., 2016). However, in all these cases, no explicit restriction is placed on the number of pixels that can be perturbed. Therefore, it is natural to ask: whether it is possible to force the network to misclassify an image by modifying a single pixel? If so, how strong should this perturbation be? We run several experiments to shed light on these questions. For simplicity, in this section, we focus the case of -misclassification, even though all discussions easily extend to the case of -misclassification for . We begin with a useful definition.
In the definition of critical pixel we have not considered how well the original image is classified by NN, i.e., whether . In particular, if then by definition all pixels in the image are critical even without any perturbation. In our experiments, we ignore these images and only focus on images where , which we refer to as good images (Definition 4). Given a trained neural network NN and an image , a pixel in is a critical pixel if a perturbation of this pixel generates an image that is misclassified by the network NN. In other words, is a critical pixel in if there exists another neighboring image which differs from only in values at the pixel location such that .
In the following, we say a pixel in image is critical iff .
Critical Pixels are Common.
Our first experiment is to investigate existence of critical pixels in the considered dataset of images. To do so, we perform a simple procedure that picks a location in the image and applies the Pert function to this pixel to obtain a perturbed image . Then the perturbed image is run through the trained network, and we check whether it was misclassified or not. If the perturbed image is misclassified then we have identified a critical pixel. While we can exhaustively repeat this procedure for all pixels in an image, for computational efficiency we instead perform it only on a fraction of randomly chosen pixels, and our results somewhat surprisingly suggest that in many cases this is sufficient to generate an adversarial image. Algorithm RandAdv presents the pseudo-code for this experiment. Algorithm RandAdv, selects random pixels (with replacement) and performs checks whether the pixel is critical or not. The algorithm output is an unbiased estimate for the fraction of critical pixels in the input image . Note that the algorithm can fail in generating an adversarial image (i.e., in finding any critical pixel for an image). The following definition will be useful for our ensuing discussion.
We say that an image with true label is good for a network NN iff (i.e., NN predicts as the most likely label for ).
Our first observation is that sometimes even small perturbation to a pixel can be sufficient to obtain an adversarial image. Table 2 shows two images and their adversarial counterparts, with . Often, original and adversarial images are indistinguishable to the human eye, but sometimes the critical pixel is visible (Table 2).
We also tried to understand the effect of larger perturbation parameter values. We set to half the number of pixels in each image. After usual training of the neural network using the training set (see Section 6 for more details about training), we ran Algorithm RandAdv on randomly drawn images from the test set of the corresponding dataset. In our experiments, we varied perturbation parameter in the range . Before we consider our results, we note some of the perturbation values that we use to construct the adversarial image might construct images that are not in the original image space.We fix this shortcoming using a local-search based strategy in the next section. However, these results are still somewhat surprising, because even though we allow large (even out-of-range) perturbation, it is applied to exactly one pixel in the image, and it appears that it suffices to even pick the pixel at random.
Figures 3 and 4 show results for datasets (more details about the datasets and the networks are presented in Section 6). On the x-axis we show the perturbation parameter . In Figure 3, the y-axis represents the output of Algorithm RandAdv averaged over good images for the network.Note by focusing on good images, we make sure that we are only accounting for those cases where perturbation is needed for creating an adversarial image. The first observation that we can make is that the critical pixels are common, and in fact, as grows the fraction of critical pixels increases. For example, in CIFAR10, with , almost 80% (on average) of the pixels randomly selected are critical. In Figure 4, the y-axis represents the fraction of successful adversarial images generated by Algorithm RandAdv, i.e., fraction of inputs where Algorithm RandAdv is successful in finding at least one critical pixel. Again we notice that as grows it gets easier for Algorithm RandAdv to construct an adversarial image.
Another observation is that for the MNIST and STL10 datasets, Algorithm RandAdv succeeds in finding fewer critical pixels as compared to SVHN and CIFAR10 datasets. We give the following explanation for this observation. The majority of pixels in an MNIST image belong to the background, hence, these pixels are less likely to be critical. On the other hand, STL10 contains high resolution images, , where perhaps a single pixel has less of an impact on the output prediction. The latter observation motivated us to generalize the notion of a critical pixel to a critical set.
Given a trained neural network NN and an image , a critical set of is a set of pixels in such that a perturbation of these pixels generates an image that is misclassified by the network NN.
The general goal will be to find critical sets of small size in an image. With this notion of critical set, we considered constructing adversarial images on the high-resolution ImageNet1000 dataset. We can modify the definition of (from (1)) where instead of a single pixel we perturb all the pixels in a set. Similarly, we can devise a simple extension to Algorithm RandAdv to operate with a set of pixels and to output an unbiased estimate for the fraction of critical sets of some fixed size ( in our case) in the input image.Searching over all pixel sets of size pixels is computationally prohibitive, which again motivates the need for a randomized strategy as proposed in Algorithm RandAdv. Note that a set size of pixels is still a tiny fraction of all the pixels in a standard (center) crop of size , namely just . We use a larger perturbation parameter than before, and set () the budget on the number of trials on an image as . Figure 5 shows our results. Overall, we note that we can draw similar conclusions as before, i.e., increasing the perturbation parameter creates more critical sets making them easier to find and relatively small perturbations are sufficient to construct adversarial images.
Black-box Generation: A Greedy Approach
We adapt this general procedure to search critical sets efficiently as explained below. Our optimization problem will try to minimize the probability that the network determines an perturbed image has the class label of the original image, and by using a local-search procedure we generate perturbed images which differ from the original image in only few pixels. Intuitively, in each round, our local-search procedure computes an implicit approximation to the gradient of the current image by understanding the influence of a few pixels on the output, which is then used to update the current image.
First, we need to define the cost function . Let be the image (with true label ) whose adversarial image we want to generate for a target neural network NN. For some input image , we use the objective function which equals the probability assigned by the network NN that the input image belongs to class . More formally,
with denoting the probability as determined by NN that image belongs to class . Our local-search procedure aims to minimize this function.
Second, we consider how to form a neighborhood set of images. As mentioned above, the local-search procedure operates in rounds. Let be the image after round . Our neighborhood will consist of images that are different in one pixel from the image . In other words, if we measure the distance between and any image in the neighborhood as the number of perturbed pixels, then this distance is the same (equal to one) for all of them. Therefore, we can define the neighborhood in terms of a set of pixel locations. Let be a set of pixel locations. For the first round is randomly generated. At each subsequent round, it is formed based on a set of pixel locations which were perturbed in the previous round. Let denote the pixel locations that were perturbed in round (formally defined below). Then
where is a parameter. In other words, we consider pixels that were perturbed in the previous round, and for each such pixel we consider all pixels in a small square with the side length centered at that pixel. This defines the neighborhood considered in round .
Third, we describe the transformation function of a set of pixel locations. The function takes as input an image , a set of pixel locations , a parameter that defines how many pixels will be perturbed by , and two perturbation parameters and . In round of the local-search procedure, the function outputs a new image, such that exactly pixels of are perturbed, and an auxiliary set of pixel locations to record which pixels where perturbed at this round, so we have . Next we describe transformations that performs in round . As the first step, constructs a set of perturbed images based on :
where Pert is the perturbation function defined through (1). Then it computes the score of each image in as
We want to point out that the function uses two perturbation parameters, and . The value of is kept small in the range $ppp$ automatically during the search. We defer this discussion to the experimental section.
Algorithm LocSearchAdv shows the complete pseudocode of our local-search procedure. At the high level, the algorithm takes an image as input, and in each round, finds some pixel locations to perturb using the above defined objective function and then applies the above defined transformation function to these selected pixels to construct a new (perturbed) image. It terminates if it succeeds to push the true label below the th place in the confidence score vector at any round. Otherwise, it proceeds to the next round (for a maximum of rounds). Note that the number of pixels in an image perturbed by Algorithm LocSearchAdv is at most and in practice (see Tables 4, 5,and 6 in Section 6) it is much less. In round , we query the network at most the number of times as the number of pixels in which after the first round is at most (again in practice this is much less because of the overlaps in the neighborhood squares).
In Section 6, we demonstrate the efficacy of Algorithm LocSearchAdv in constructing adversarial images. We first highlight an interesting connection between the pixels perturbed and their influences measured by a notion of called saliency map.
Computing the exact saliency scores for an image requires complete access to the network NN, which we do not assume. However, a natural hypothesis is that the pixels selected by Algorithm LocSearchAdv for perturbation are related to pixels with large saliency scores. We use the ImageNet1000 dataset to test this hypothesis. In Figure 3, we present some qualitative results. As can be seen from the pictures, the pixels perturbed by Algorithm LocSearchAdv appear correlated with pixels with high saliency scores. Quantitatively, we observed that the pixels that occupy top-10% of the saliency map, on average contain more than 23% of the pixels chosen by Algorithm LocSearchAdv for perturbation (and this overlap only grows when we consider a bigger chunk of pixels picked by their saliency scores). Note that this is correlation is not though a random occurrence. For an image , let denote the set of pixels in that rank among the top-10% in the saliency map. If we pick a random set of around pixels (this is on average number of pixels perturbed per image by Algorithm LocSearchAdv perturbs, see Table 5), we expect only about % to them to intersect with and standard tail bounds show that the probability that at least % of the pixels of this random set intersects with is extremely small.We can also use here a standard hypothesis testing for a proportion. The null-hypothesis is that the probability of intersection equals as with random Bernoulli trails, and test statistic indicates that the null-hypothesis can be rejected at significance level . Therefore, it appears that Algorithm LocSearchAdv rediscovers part of the high salient score pixels but without explicitly computing the gradients.
Experimental Evaluation
We start by describing our experimental setup. We used Caffe and Torch machine learning frameworks to train the networks. All algorithms to generate adversarial images were implemented in Lua within Torch 7. All experiments were performed on a cluster of GPUs using a single GPU for each run.
We use 5 popular datasets: MNIST (handwritten digits recognition dataset), CIFAR10 (objects recognition dataset), SVHN (digits recognition dataset), STL10 (objects recognition dataset), and ImageNet1000 (objects recognition dataset).
Models.
We trained Network-in-Network (Lin et al., 2014) and VGG (Simonyan and Zisserman, 2014) for MNIST, CIFAR, SVHN, STL10, with minor adjustments for the corresponding image sizes. Network-in-Network is a building block of the commonly used GoogLeNet architecture that has demonstrated very good performance on medium size datasets, e.g. CIFAR10 (Zagoruyko, 2015). VGG is another powerful network that proved to be useful in many applications beyond image classification, like object localization (Ren et al., 2015). We trained each model in two variants: with and without batch normalization (Ioffe and Szegedy, 2015). Batch normalization was placed before a ReLU layer in all networks. For the ImageNet1000 dataset, we used pre-trained VGG models from (Chatfield et al., 2014b) (we did not train them from scratch due to limited resources). All Caffe VGG models were converted to Torch models using the loadcaffe package (Zagoruyko, 2016a). These models use different normalization procedures which we reproduced for each model based on provided descriptions. Tables 4 and 5 (the second column ErrTop-1) show the top- (base) error for all datasets and models that we considered. The results are comparable with the known state-of-the-art results on these datasets (Benenson, 2016).
Related Techniques.
There are quite a few approaches for generating adversarial images (as discussed in Section 2). Most of these approaches require access to the network architecture and its parameter values (Szegedy et al., 2014; Goodfellow et al., 2015; Moosavi-Dezfooli et al., 2016; Papernot et al., 2016c).Therefore, not entirely suited for a direct comparison with our black-box approach. The general idea behind these attacks is based on the evaluating the network’s sensitivity to the input components in order to determine a perturbation that achieves the adversarial misclassification goal. Among these approaches, the attack approach (known as the “fast-gradient sign method”) suggested by Goodfellow et al. (2015) stands out for being able to efficiently generate adversarial images. Here we compare the performance of our local-search based attack against this fast-gradient sign method.Another reason for picking this approach for comparison is that it is also heavily utilized in the recent black-box attack suggested by Papernot et al. (2016b), where they require additional transferability assumptions which is not required by our attack.
Implementing Algorithm LocSearchAdv.
Experimental Observations.
For ease of comparison with the fast-gradient sign method (Goodfellow et al., 2015), we set and focus on achieving -misclassification. Tables 4 and 5 show the results of our experiments on the test sets. The first column shows the dataset name. The second column (ErrTop-1) presents the top- misclassification rate on the corresponding test dataset without any perturbation (base error). ErrTop-1(Adv) is the top- misclassification rate where each original image in the test set was replaced with an generated perturbed image (using either our approach or the fast-gradient sign method (Goodfellow et al., 2015) which is denoted as FGSM).Note that by explicitly constraining the number of pixels that can be perturbed, as we do in our approach, it might be impossible to get to a 100% misclassification rate on some datasets. Similarly, the fast-gradient sign method fails to achieve a 100% misclassification rate even with larger values of (Moosavi-Dezfooli et al., 2016).
In the following, we say an adversarial generation technique Adv, given an input image , succeeds in generating an adversarial image for a network NN iff and . The conf column shows the average confidence over all successful adversarial images for the corresponding technique. The ptb column shows the average (absolute) perturbation added per coordinate in cases of successful adversarial generation. More formally, let denote the test set and denote the set of images in on which Adv is successful. Then,
As is quite evident from these results, Algorithm LocSearchAdv is more effective than the fast-gradient sign method in generating adversarial images, even without having access to the network architecture and its parameter values. The difference is quite prominent for networks trained with batch normalization as here we noticed that the fast-gradient sign method has difficulties producing adversarial images.In general, we observed that models trained with batch normalization are somewhat more resilient to adversarial perturbations probably because of the regularization properties of batch normalization (Ioffe and Szegedy, 2015). Another advantage with our approach is that it modifies a very tiny fraction of pixels as compared to all the pixels perturbed by the fast-gradient sign method, and also in many cases with far less average perturbation. Putting these points together demonstrates that Algorithm LocSearchAdv is successful in generating more adversarial images than the fast-gradient sign method, while modifying far fewer pixels and adding less noise per image. On the other side, the fast-gradient sign method takes lesser time in the generation process and generally seems to produce higher confidence scores for the adversarial (misclassified) images.
Table 5 shows the results for several variants of VGG network trained on the ImageNet1000 dataset. These networks do not have batch normalization layers (Chatfield et al., 2014b; Zagoruyko, 2016a). We set for the fast-gradient sign method as a different pre-processing technique was used for this network (we converted these networks from pre-trained Caffe models). Results are similar to that observed on the smaller datasets. In most cases, our proposed local-search based approach is more successful in generating adversarial images while on average perturbing less than % of the pixels.
Case of Larger k𝑘k’s.
We now consider achieving -misclassification for using Algorithm LocSearchAdv. In Table 6, we present the results as we change the goal from -misclassification to -misclassification on the CIFAR10 dataset. We use the same parameters as before for Algorithm LocSearchAdv. As one would expect, as we increase the value of , the effectiveness of the attack decreases, perturbation and time needed increases. But overall our local-search procedure is still able to generate a large fraction of adversarial images at even with a small perturbation and computation time, meaning that these images will fool even a system that is evaluated on a top- classification criteria. We are not aware of a straightforward extension of the fast-gradient sign method (Goodfellow et al., 2015) to achieve -misclassification.
Even Weaker Adversarial Models.
We also consider a weaker model where the adversary does not even have a black-box (oracle) access to the network (NN) of interest, and has to rely on a black-box access to somewhat of a “similar” (proxy) network as NN. For example, the adversary might want to evade a spam filter A, but might have to develop adversarial images by utilizing the output of a spam filter B, which might share properties similar to A.
We trained several modifications of Network-in-Network model for the CIFAR10 dataset, varying the initial value of the learning rate, the size of filters, and the number of layers in the network. We observed that between 25% to 43% of adversarial images generated by Algorithm LocSearchAdv using the original network were also adversarial for these modified networks (at ). The transferability of adversarial images that we observe here has also been observed with other attacks too (Szegedy et al., 2014; Goodfellow et al., 2015; Papernot et al., 2016b, a) and demonstrates the wider applicability of all these attacks.
Conclusion
We investigate the inherent vulnerabilities in modern CNNs to practical black-box adversarial attacks. We present approaches that can efficiently locate a small set of pixels, without using any gradient information, which when perturbed lead to misclassification by a deep neural network. Our extensive experimental results, somewhat surprisingly, demonstrates the effectiveness of our simple approaches in generating adversarial examples.
Defenses against these attacks is an interesting research direction. However, we note that here that by limiting the perturbation to some pixels (being localized) the adversarial images generated by our local-search based approach do not represent the distribution of the original data. This means for these adversarial images, the use of adversarial training (or fine-tuning), a technique of training (or fine-tuning) networks on adversarial images to build more robust classifiers, is not very effective. In fact, even with adversarial training we noticed that the networks ability to resist new local-search based adversarial attack improves only marginally (on average between 1-2%). On the other hand, we suspect that one possible counter-measure to these localized adversarial attacks could be based on performing a careful analysis of the oracle queries to thwart the attempts to generate an adversarial image.
Finally, we believe that our local-search approach can also be used for attacks against other machine learning systems and can serve as an useful tool in measuring the robustness of these systems.
The authors would like to thank Hamid Maei for helpful initial discussions.