B REAKING CERTIFIED DEFENSES : S EMANTIC ADVERSARIAL EXAMPLES WITH SPOOFED ROBUSTNESS CERTIFICATES
Anonymous authors
Paper under double-blind review
A BSTRACT
To deﬂect adversarial attacks, a range of “certiﬁed” classiﬁers have been proposed.
In addition to labelling an image, certiﬁed classiﬁers produce (when possible) a certiﬁcate guaranteeing that the input image is not an (cid:96) p -bounded adversarial example.
We present a new attack that exploits not only the labelling function of a classiﬁer, but also the certiﬁcate generator.
The proposed method applies large perturbations that place images far from a class boundary while maintaining the imperceptibility property of adversarial examples.
The proposed “Shadow Attack” causes certiﬁably robust networks to mislabel an image and simultaneously produce a “spoofed” certiﬁcate of robustness.
I NTRODUCTION
Conventional training of neural networks has been shown to produce classiﬁers that are highly sensitive to adversarial perturbations (Szegedy et al., 2013; Biggio et al., 2013), “natural looking” images that have been manipulated to cause misclassiﬁcation by a neural network (Figure 1).
While a wide range of defenses exist that harden neural networks against such attacks (Madry et al., 2017; Shafahi et al., 2019), defenses based on heuristics and tricks are often easily breakable Athalye et al.
This has motivated work on certiﬁably secure networks — classiﬁers that produce a label for an image, and also (when possible) a rigorous guarantee that the input is not adversarially manipulated (Cohen et al., 2019; Zhang et al., 2019b).
To date, all work on certiﬁable defenses has focused on deﬂecting (cid:96) p -bounded attacks,
where p =or ∞ (Cohen et al., 2019; Gowal et al., 2018; Wong et al., 2018).
After labelling an image, these defenses then check whether there exists an image of a different label within (cid:15) units (in the (cid:96) p metric) of the input, where (cid:15) is a security parameter chosen by the user.
If the classiﬁer assigns all images
Natural
[Figure]
within the (cid:15) ball the same class label, then a certiﬁcate is issued, and the input image known not to be an (cid:96) p adversarial example.
In this work, we demonstrate how a system that relies on certiﬁcates as a measure of label security can be exploited.
We present a new class of adversarial examples that target not only the classiﬁer output label, but also the certiﬁcate.
We do this by adding adversarial perturbations to images that are large in the (cid:96) p norm (larger than the (cid:15) used by the certiﬁcate generator), and produce attack images that are surrounded by a large ball exclusively containing images of the same label.
The resulting attacks produce a “spoofed” certiﬁcate with a seemingly strong security guarantee despite being adversarially manipulated.
Note that the statement made by the certiﬁcate (i.e., that the input image is not an (cid:15) adversarial example in the chosen norm) is still technically correct, however in this case the adversary is hiding behind a certiﬁcate to avoid detection by a certiﬁable defense.
In summary, we consider methods that attack a certiﬁed classiﬁer in the following sense:
• Imperceptibility: the adversarial example “looks like” its corresponding natural base example, • Misclassiﬁcation: the certiﬁed classiﬁer assigns an incorrect label to the adversarial example, and • Strongly certiﬁed: the certiﬁed classiﬁer provides a strong/large-radius certiﬁcate for the adversarial example.
While the existence of such an attack does not invalidate the certiﬁcates produced by certiﬁable systems, it should serve as a warning that certiﬁable defenses are not inherently secure, and one should take caution when relying on certiﬁcates as an indicator of label correctness.
B ACKGROUND
In the white-box setting, where the attacker knows the victim’s network and parameters, adversarial perturbation are often constructed using ﬁrst-order gradient information (Carlini & Wagner, 2017;
Kurakin et al., 2016; Moosavi-Dezfooli et al., 2016) or using approximations of the gradient (Uesato et al., 2018; Athalye et al., 2018).
The prevailing formulation for crafting attacks uses an additive adversarial perturbation, and perceptibility is minimized using an (cid:96) p -norm constraint.
For example, (cid:96) ∞ -bounded attacks limit how much each pixel can move, while (cid:96)
adversarial attacks limit the number of pixels that can be modiﬁed, without limiting the size of the change to each pixel (Wiyatno & Xu, 2018).
It is possible to craft imperceptible attacks without using (cid:96) p bounds (Brown et al., 2018).
For example, Hosseini & Poovendran (2018) use shifting color channels, and Engstrom et al.
(2017) use rotation and translation to craft “semantic” adversarial examples.
In Figure 1, we produce semantic adversarial examples using the method of Hosseini & Poovendran (2018) which is a greedy approach that transforms the image into HSV space, and then, while keeping V constant, tries to ﬁnd the smallest S perturbation causing misclassiﬁcation 1 .
Other variants use generative models to construct natural looking images causing misclassiﬁcation (Song et al., 2018; Dunn et al., 2019).
In practice, many of the defenses which top adversarial defense leader-board challenges are noncertiﬁed defenses (Madry et al., 2017; Zhang et al., 2019a; Shafahi et al., 2019).
The majority of these defenses make use of adversarial training , in which attack images are crafted during training and injected into the training set.
These non-certiﬁed defenses are mostly evaluated against PGDbased attacks, resulting in an upper-bound on robustness.
Certiﬁed defenses, on the other-hand, provably make networks resist (cid:96) p -bounded perturbations of a certain radius.
For instance, randomized smoothing (Cohen et al., 2019) is a certiﬁable defense against (cid:96) 2 -norm bounded attacks, and CROWN-IBP (Zhang et al., 2019b) is a certiﬁable defense against l ∞ -norm bounded perturbations.
Both of these defenses produce a class label, and also a guarantee that the image could not have been crafted by making small perturbations to an image of a different label.
To the best of our knowledge, prior works have focused on making adversarial examples that satisfy the imperceptibility and misclassiﬁcation conditions, but none have investigated manipulating certiﬁcates, which is our focus here.
The reminder of this paper is organized as follows.
In section 2 we introduce our new approach
Shadow Attack for generating adversarial perturbations.
This is a hybrid model that allows various kinds of attacks to be compounded together, resulting in perturbations of large radii.
In sectionwe present an attack on “randomized smoothing” certiﬁcates (Cohen et al., 2019).
Section 4 shows an ablation study and show why the elements of the Shadow Attack are important for successfully manipulating certiﬁed models.
In section 5 we generate adversarial examples for “CROWN-IBP” (Zhang et al., 2019b).
Finally, we discuss results and wrap up in section 6.
T HE S HADOW A TTACK
Because certiﬁcate spooﬁng requires large perturbations (larger than the (cid:96) p ball of the certiﬁcate), we propose a simple attack that ensembles numerous modes to create large perturbations.
Our attack can be seen as the generalization of the well-known PGD attack, which creates adversarial images by modifying a clean base image.
Given a loss function L and an (cid:96) p -norm bound (cid:15) for some p ≥ 0 ,
PGD attacks solve the following optimization problem:
[Equation]
where θ are the network parameters and δ is the adversarial perturbation to be added to the clean input image x .
Constraint 2 promotes imperceptibility of the resulting perturbation to the human eye by limiting the perturbation size.
In the shadow attack, instead of solving the above constrained optimization problem, we solve the following problem with a range of penalties:
[Equation]
where λ c , λ tv , λ s are scalar penalty weights.
Penalty TV( δ ) forces the perturbation δ to have small total variation ( TV ), and so appear more smooth and natural.
Penalty C ( δ ) limits the perturbation δ globally by constraining the change in the mean of each color channel c .
This constraint is needed since total variation is invariant to constant/scalar additions to each color channel, and it is desirable to supress extreme changes in the color balances of images.
Penalty Dissim( δ ) promotes perturbations δ that assume similar values in each color channel.
In the case of an RGB image of shape 3 × W × H , if Dissim( δ ) is small, the perturbations to red, green, and blue channels are similar, i.e., δ R,w,h
≈ δ G,w,h
≈ δ B,w,h , ∀ ( w, h ) ∈ W × H .
This amounts to making the pixels darker/lighter, without changing the color balance of the image.
Later, in section 3, we suggest two ways of enforcing such similarity between RGB channels and we ﬁnd both of them effective:
• 1-channel attack strictly enforces δ R,i ≈ δ G,i ≈ δ B,i , ∀ i by using just one array to simultaneously represent each color channel δ W × H .
On the forward pass, we duplicate δ to make a 3-channel image.
In this case, Dissim( δ ) = 0 , and the perturbation is greyscale.
• 3-channel attack uses a 3-channel perturbation δ 3 × W × H , along with the dissimilarity metric Dissim( δ )
= (cid:107) δ R − δ B (cid:107) p
+ (cid:107) δ R − δ G (cid:107) p + (cid:107) δ B − δ G (cid:107) p .
All together, the three penalties minimize perceptibility of perturbations by forcing them to be ( a ) small, ( b ) smooth, and ( c ) without dramatic color changes (e.g. swapping blue to red).
At the same time, these penalties allow perturbations that are very large in (cid:96) p -norm.
2. C REATING UNTARGETED ATTACKS
We focus on spooﬁng certiﬁcates for untargeted attacks, in which the attacker does not specify the class into which the attack image moves.
To achieve this, we generate an adversarial perturbation for all possible wrong classes ¯ y and choose the best one as our strong attack:
[Equation]
where y is the true label/class for the clean image x , and L is a spooﬁng loss that promotes a large certiﬁcate.
We examine different choices for L for different certiﬁcates below.
A TTACKS ON R ANDOMIZED S MOOTHING
The randomized Smoothing method, ﬁrst proposed by Lecuyer et al.
and later improved by
Li et al.
(2018), is an adversarial defense against l 2 -norm bounded attacks.
Cohen et al.
(2019) prove a tight robustness gaurantee under the (cid:96) 2 norm for smoothing with gaussian noise.
Their study was the ﬁrst certiﬁable defense for the ImageNet dataset (Deng et al., 2009).
The method constructs certiﬁcates by ﬁrst creating many copies of an input image contaminated with random Gaussian noise of standard deviation σ .
Then, it uses a base classiﬁer (a neural net) to make a prediction for all of the images in the randomly augmented batch.
Depending on the level of consensus among the class labels of these random images, a certiﬁed radius is calculated that can be at most 4 σ (in the case of perfect consensus).
Intuitively, if the image is far away from the decision boundary, the base classiﬁer should predict the same label for each noisy copy of the test image, in which case the certiﬁcate is strong.
On the other hand, if the image is adjacent to the decision boundary, the base classiﬁer’s predictions for the
Guassian augmented copies may vary.
If the variation is large, the smoothed classiﬁer abstains from making a prediction.
To spoof strong certiﬁcates (large certiﬁed radius) for an incorrect class, we must make sure that the majority of a batch of noisy images around the adversarial image are assigned the same (wrong) label.
We do this by minimizing the cross entropy loss relative to a chosen (incorrect) label, averaged over a large set of randomly perturbed images.
To this end, we minimize equation 4, where L is chosen to be the average cross-entropy over a batch of Gaussian perturbed copies.
This method is analogous to the technique presented by Shafahi et al.
(2018) for generating universal perturbations that are affective when added to a large number of different images.
R ESULTS
Cohen et al.
(2019) show the performance of the Gaussian smoothed classiﬁer on CIFAR-
(Krizhevsky et al.) and ImageNet (Deng et al., 2009).
To attack the CIFAR and ImageNet smoothed classiﬁers, we use 400 randomly sampled Gaussian images, λ tv = 0 .
3 , λ c = 1 . 0 , and performsteps of SGD with learning rate 0 .
We choose the functional regularizers C ( δ ) and TV( δ ) to be
C ( δ ) = (cid:107) Avg( | δ R | ) , Avg( | δ G | ) , Avg( | δ B | ) (cid:107) 22 , and TV ( δ i,j ) =
anisotropic-TV ( δ i,j ) 2 , where | · | is the element-wise absolute value operator, and Avg computes the average.
For the
Dissim regularizer, we experiment with both the 1-Channel attack that ensures Dissim( δ ) = 0 , and the 3-Channel attack by setting Dissim( δ )
=
(cid:107) ( δ R − δ G ) 2 , ( δ R − δ B ) 2 , ( δ G − δ B ) 2 (cid:107) 2 and λ s = 0 .
For the validation examples on which the smoothed classiﬁer does not abstain (see Cohen et al.
(2019) for more details), the less-constrained 3-channel attack is always able to ﬁnd an adversarial example while the 1-channel attack also performs well, achieving 98.5% success.
In section 4 we will discuss in more detail other differences between 1-channel and 3-channel attacks.
The results are summarized in Table 1.
For the various base-models and choices of σ , our adversarial examples are able to produce certiﬁed radii that are on average larger than the certiﬁed radii produced for natural images.
For ImageNet, since attacking all 999 remaining target classes is computationally expensive, we only attacked target class IDs 100, 200, 300, 400, 500, 600, 700, 800, 900, and 1000.
Smoothing method for Shadow Attack images and also natural images (larger radii means a stronger/more conﬁdent certiﬁcate).
Dataset
[Table]
[Figure]
Figure 2 depicts a sample adversarial example built for the smoothed ImageNet classiﬁer that produces a large certiﬁcate.
The adversarial perturbation causes the batch of gaussian augmented black swan images to get misclassiﬁed as hooks.
For more, see appendix 16.
A BLATION STUDY OF THE ATTACK PARAMETERS
In this section we perform an ablation study on the parameters of the Shadow Attack to evaluate ( i ) the number of SGD steps needed, ( ii ) the importance of λ s (or alternatively using 1-channel attacks), and ( iii ) the effect of λ tv .
The default parameters for all of the experiments are as follows unless explicitly mentioned: We use 30 SGD steps with learning rate 0 .
1 for the optimization.
All experiments except part ( b ) use 1-channel attacks for the sake of simplicity and efﬁciency (since it has less parameters).
We assume λ tv = 0 .
3 , λ c = 20 , and use batch-size 50 .
We present results using the ﬁrst example from each class of the CIFAR-10 validation set.
Figure 3 shows how the adversarial example evolves during the ﬁrst few steps of optimization (See appendix 13 for more examples).
Also, ﬁgures 4, 5, and 6 show the evolution of L ( δ ) , TV( δ ) , and
C ( δ ) , respectively (Note that we use 1-channel attacks, so Dissim( δ ) is always 0).
We ﬁnd that taking just 10 SGD steps is enough for convergence on CIFAR-10, but for our main results (i.e. attacking Randomized Smoothing in section 3 and attacking CROWN-IBP in section 5) we takesteps to be safe.
original
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
To explore the importance of λ s we use 3-channel attacks and vary λ s to produce different images in ﬁgure 11 2 .
Also, ﬁgure 7 shows the mean Dissim( δ ) for different values of λ s (0 ≤ λ s ≤ 5 . 0) .
We also plot the histogram of the certiﬁcate radii in ﬁgure 9.
Figure 10 compares 1-Channel vs 3-Channel attacks for some of randomly selected CIFAR-10 images.
Finally, we explore the effect of λ tv on imperceptibility of the perturbations in Figure 12.
See table 15 for more images, and ﬁgure 8 for the impact of parameters on TV( δ ) .
A TTACKS ON CROWN-IBP
Interval Bound Propagation (IBP) methods have been recently studied as a defense against (cid:96) ∞ - bounded attacks.
Many recent studies such as Gowal et al.
Xiao et al.
; Wong et al.
; Mirman et al.
(2018) have investigated IBP methods to train provably robust networks.
To the best of our knowledge, the CROWN-IBP method by Zhang et al.
(2019b) achieves state-ofthe-art performance for MNIST (LeCun & Cortes, 2010),
Fashion-MNIST (Xiao et al., 2017), and
[Figure] [Figure]
CIFAR-10 datasets among certiﬁable (cid:96) ∞ defenses.
In this section we focus on attacking Zhang et al.
(2019b) using CIFAR-10.
IBP methods (over)estimate how much a small (cid:96) ∞ -bounded noise in the input can impact the classiﬁcation layer.
This is done by propagating errors from layer to layer, computing bounds on the maximum possible perturbation to each activation.
During testing, the user chooses an (cid:96) ∞ perturbation bound (cid:15), and error propagation is used to bound the magnitude of the largest achievable perturbation in network output.
If the output perturbation is not large enough to ﬂip the image label, then a certiﬁcate is produced.
If the output perturbation is large enough to ﬂip the image label, then a certiﬁcate is not produced.
During network training, IBP methods include a term in the loss function that promotes tight error bounds that result in certiﬁcates.
Our attack directly uses the loss function term used during IBP network training in addition to the
Shadow Attack penalties; we search for an image that is visually similar to the base image, while producing a bound on the output perturbation that is too small to ﬂip the image label.
We attack 4 classes of networks released by Zhang et al.
(2019b) for CIFAR-10.
There are two classes of IBP architectures, one of them consists of 9 small models and the other consists oflarger models.
For each class of architectures, there are two sets of pre-trained models: one for (cid:15) = 2 / 255 and one for (cid:15)
= 8 / 255 .
We use the same hyper-parameters and regularizers as in 3.
For the sake of efﬁciency, we only do 1-channel attacks.
We attack the 4 classes of models and for each class, we report the min, mean, and max of the robustness errors and compare them with those of the CROWN-IBP paper.
To quantify the success of our attack, we deﬁne two metrics of error.
For natural images, we report the rate of “robust errors,” which are images that are either (i) incorrectly labeled, or (ii) correctly labelled but without a certiﬁcate.
In constrast, for attack images, we report the rate of “attack errors,” which are either (i) correctly classiﬁed or (ii) incorrectly classiﬁed but without a certiﬁcate.
Table 2 shows the robust error on natural images, and the attack error on Shadow Attack images for the
CROWN-IBP models.
With (cid:15) = 2 / 255 , our attack ﬁnds adversarial examples that certify roughly 40% of the time (i.e., attack error < 60%).
With (cid:15) = 8 / 255 , our attack ﬁnds adversarial examples that are incorrectly classiﬁed, and yet certify even more often than natural images.
0.30 original
[Table]
CONCLUSION
We demonstrate that it is possible to produce adversarial examples with “spoofed” certiﬁed robustness by using large-norm perturbations.
Our adversarial examples are built using a Shadow Attack that produces smooth and natural looking perturbations that are often less perceptible than those of the commonly used (cid:96) p -bounded perturbations, while being large enough in norm to escape the certiﬁcation regions of state of the art principled defenses.
This work suggests that the certiﬁcates produced by certiﬁably robust classiﬁers, while mathematically rigorous, are not always good indicators of robustness or accuracy.
A A PPENDIX
In this section, we include the complete results of our ablation study.
As we mentioned in section 4, we show results on a subset of CIFAR-10 dataset, including one example per class.
Figure 13 shows that taking a few optimization steps is enough for the resulting images to look natural.
Figureand 15, respectively, show the effect of λ s and λ TV on the perceptibility of perturbations.
original
5.0 original
[Figure]
0.30 original
I MAGE N ET R ESULTS
In this section, we show some examples generated by the Shadow Attack that spoof certiﬁcates for a Randomized Smoothed classiﬁer on Imagenet.