(De)Randomized Smoothing for Certifiable Defense against Patch Attacks
Alexander Levine, Soheil Feizi
Introduction
In recent years, adversarial attacks have become a topic of great interest in machine learning . However, in many instances the threat models considered for these attacks (e.g. small distortions to every pixel of an image) implicitly require the attacker to be able to directly interfere with the input to a neural network. This limits practicality of such attacks as well as defenses against them. On the other hand, the development of physical adversarial attacks , in which small visible changes are made to real world objects in order to disrupt classification of images of these objects, represents a more concerning security threat. Unlike attacks, physical adversarial attacks can be perceptible (e.g. adding an adversarial sticker on a stop sign is a perceptible change). Nevertheless, humans would still correctly classify the attacked image while the classification model would fail to predict the correct label. Therefore, the attacked image is an adversarial example.
Physical adversarial attacks can often be modeled as “patch” adversarial attacks, in which the attacker can make arbitrary changes to pixels within a region of bounded size. Indeed, there is often a direct relationship between the two: for example, the universal patch attack proposed by is an effective physical sticker attack. The attack method proposed in is universal in a sense that pixels of the adversarial patch do not depend on the attacked image. Image-specific patch attacks have also been proposed, such as LaVAN , which reduces ImageNet classification accuracy to 0% using only a pixel square patch (on images of size ). In this paper, we consider all attacks (image-specific or universal) on square patches of size .
Practical defenses against patch attacks have been proposed. For the aforementioned pixel attacks on ImageNet, claims the current state-of-the-art practical defense. However, has recently broken this defense, reducing the classification accuracy on ImageNet to 14%. In the same work, also proposes the first certified defense against patch adversarial attacks, which uses interval bound propagation . In a certifiably robust classification scheme, in addition to providing a classification for each image, the classifier may also return an assurance that the classification will provably not change under any distortion of a certain magnitude and threat model. One then reports both the clean accuracy (normal accuracy) of the model, as well as the certified accuracy (percent of images which are both correctly classified, and for which it is guaranteed that the classification will not change under a certain attack type). Unlike practical defenses, certified defenses guarantee that no future adversary (under a certain threat model) will break the defense.
The certified defense proposed by , however, does not scale well to practical classification tasks on complex inputs such as CIFAR-10 or ImageNet samples. Specifically, while this certified defense performs well on MNIST, it achieves poor certified accuracy on CIFAR-10 and, to quote from the paper itself, “is unlikely to scale to ImageNet.” In this work, we propose a certified defense against patch attacks which overcomes these issues. In particular, our certifiable defense method leads to the following results:
Notably, our method achieves a more than percentage point increase in certified robustness on CIFAR-10 compared to . Moreover, our method has top-1 certified accuracy on ImageNet classification which is approximately equal to the 14% empirical accuracy of the state-of-the art practical defense under the attack proposed by (although our clean accuracy is lower, 44% vs. 71%). On MNIST, which is often regarded as a toy dataset in deep learning applications, our method also achieves a relatively high certified robustness (but not as high as the method of ) and clean accuracy (slightly higher than that of ). Further, the certified defense proposed by also has a computationally expensive training algorithm: the training time for the reported best model was 8.4 GPU hours for MNIST, and 15.4 GPU hours for CIFAR-10, using NVIDIA 2080 Ti GPUs. Our models, by contrast, took approximately 1.0 GPU hour to train on MNIST, and 2.5 GPU hours to train on CIFAR-10, on the same model of GPU.
Our certifiably robust classification scheme is based on randomized smoothing, a class of certifiably robust classifiers which have been proposed for various threat models, including , and and Wasserstein metrics. All of these methods rely on a similar mechanism where noisy versions of an input image are used in the classification. Such noisy inputs are created either by adding random noise to all pixels or by removing (ablating) some of the pixels . A large number of noisy images are then classified by a base classifier and then the consensus of these classifications is reported as the final classification result. For an adversarial image at a bounded distance from , the probability distributions of possible noisy images which can be produced from and will substantially overlap. This implies that, if a sufficiently large fraction of noisy images derived from are classified to some class , then with high confidence, a plurality of noisy images derived from will also be assigned to this class.
Patch adversarial attacks can be considered a special case of (sparse) adversarial attacks: in an attack, the adversary can choose a limited number of pixels and apply unbounded distortions to them. A patch adversarial attack is therefore a sparse adversarial attack where the attacker is additionally constrained to selecting only a block of adjacent pixels to attack, rather than any arbitrary pixels. The current state-of-the-art certified defense against sparse adversarial attacks is a randomized smoothing method proposed by . In this method, a base classifier, , is trained to make classifications based on only a small number of independently randomly-selected pixels: the rest of the image is ablated, meaning that it is encoded as a null value. At test time, the final classification is taken as the class most likely to be returned by on a randomly ablated version of the image.
In practice, we find that applying the defense method developed in for sparse attacks directly to patch attacks yields poor results (see Figure 1). This is because the defense proposed in does not incorporate the additional structure of the attack. For patch attacks, we can use the fact that the attacked pixels form a contiguous square to develop a more effective defense. In this paper, we propose a structured ablation scheme, where instead of independently selecting pixels to use for classification, we select pixels in a correlated way in order to reduce the probability that the adversarial patch is sampled. Empirically, structured ablation certificates yields much improved certified accuracy to patch attacks, compared to the naive certificate.
By reducing the total number of possible ablations of an image, structured ablation allows us to de-randomize our algorithm, yielding improved, deterministic certificates. For robustness, achieves the largest median certificates on MNIST by using a base classifier which classifies using only out of pixels. There are ways to make this selection. It is therefore not feasible to evaluate precisely the probability that returns any particular class : one must estimate this based on random samples. Using our proposed methods, the number of possible ablations is small enough so that it is tractable to classify using all possible ablations: we can exactly evaluate the probability that returns each class. Our certificate is therefore exact, rather than probabilistic, so our classifications are provably robust in an absolute sense.
Determinism provides another benefit: the absence of estimation error increases the certified accuracies that can be reported. Additionally, because estimation error is no longer a concern, derandomization allows us to use more rich information from the base classifier without incurring an additional cost in increased estimation error. We take advantage of this to allow the base classifier to abstain in cases where it cannot make a high-confidence prediction towards any class. This leads to substantially increased certificates on MNIST, although the effects on CIFAR-10 are not significant.
After the initial distribution of this work, improved upon it by proposing a tighter certificate. In a concurrent work to ours, also proposes a method similar to “block smoothing” proposed below.
Certifiable Defenses against Patch Attacks
As mentioned in the introduction, patch attacks can be regarded as a restricted case of attacks. In particular, let be the magnitude of an adversarial attack: the attacker modifies pixels and leaves the rest unchanged. A patch attack, with an adversarial patch, is also an attack, with . We can then attempt to apply existing certifiably robust classification schemes for the threat model to the patch attack threat model: we simply need to certify to an radius of . Consider specifically the smoothing-based certifiably robust classifier introduced by . In this classification scheme, given an input image , the base classifier classifies a large number of distinct randomly-ablated versions of , in each of which only pixels of the original image are randomly and independently selected to be retained and used by the base classifier . Therefore, for any choice of pixels that the attacker could choose to attack, the probability that any of these pixels is also one of the pixels used in ’s classification is:
where is the number of attacked pixels, is the number of retained pixels used by the base classifier, and the overall dimensions of the input image are . To understand this, note that the classifier has opportunities to choose an attacked pixel, and out of pixels are attacked. Clearly, if does not use any of the attacked pixels, then its output will not be corrupted by the attacker. Therefore, the attacker can change the output of with probability at most . Let be the majority classification at (i.,e., ). If with probability greater than , then for any distorted image , one can conclude that with probability greater than , and therefore that . As discussed in the introduction, while this technique produces state-of-the-art guarantees against general attacks, it yields rather poor certified accuracies when applied to patch attacks, because it does not take advantage of the structure of the attack (See Figure 1; data for MNIST are provided in supplementary material.).
2 Proposed Method: Structured Ablation
To exploit the restricted nature of patch attacks, we propose two structured ablation methods, which select correlated groups of pixels to reduce the probability that the adversarial patch is sampled:
Block Smoothing: In this method, we select a single square block of pixels, and ablate the rest of the image. The number of retained pixels is then . Note that for an adversarial patch, out of the possible selections for blocks to use for classification, of them will intersect the patch. Thus, we have:
As illustrated in Figure 2, this implies a substantially decreased probability of intersecting the adversarial patch, compared to sampling pixels independently.
Band Smoothing: In this method, we select a single band (a column or a row) of pixels of width , and ablate the rest of the image. In the case of a column, the number of retained pixels is then . For an adversarial patch, out of the possible selections for bands to use for classification, of them will intersect the patch. Then we have:
For both of these methods, it is tractable to use the base classifier to classify all possible ablated versions of an image (i.e. and possible ablations for block and column smoothing, respectively). This allows us to exactly compute the smoothed classifier, , yielding deterministic certificates.
Our experiments show that structured ablation produces higher certified accuracy than randomized ablation. This is because, for similar values of , structured ablation methods yield much higher base classifier accuracies (Figure 3). Empirically, we find that the band method (and specifically, column smoothing) produces the most certifiably robust classifiers (Figure 5). In supplementary materials, we explore structured ablation using multiple blocks or bands of pixels.
The final smoothed classification is simply the plurality class returned: In the case of ties, we deterministically return the smaller-indexed class. Because the adversarial patch only intersects blocks, the adversary can only alter the output of of the evaluations of the base classifier. This yields the following guarantee:
For any image , base classifier , smoothing block size , and patch size , if:
then for any image which differs from only in an patch, .
In Theorem 1, the indicator function term () is present because we break ties deterministically by label index during the final classification. Proofs are provided in supplementary materials.
Note that the classifier counts can be though of as exact estimates for the probability that the base classifier returns the class , simply scaled up by a factor of . For the column smoothing case (or row smoothing, by simple transpose), we can compute a similar certificate. In this case, the base classifier is , where is now the width of the retained column of pixels, and is the position of the leftmost edge of this column. We then only need to sum over one dimension:
Again, we classify using To derive the final guarantee, we now use that the adversarial patch will overlap with only columns:
For any image , base classifier , smoothing column size , and patch size , if:
then for any image which differs from only in an patch, .
In practice, we use a deep network as our base classifier, and set if the logit corresponding to class is greater than a threshold hyperparameter . This allows the base classifier to abstain from classifying in the case that there is no usable information in the retained block, as well as to “vote” for multiple classes, which may be beneficial if the base classifier top-1 accuracy is low.
The input of to the neural network used as the base classifier is a copy of the image , with all pixels except for those in the retained block or band replaced with a specially-encoded ‘NULL’ value. We encode the additional ‘NULL’ value in the input in the same manner described for randomized ablation by for each dataset tested: this involves adding additional color channels, so that the NULL value is distinct from all real pixel colors. During training, as in prior smoothing works, we train on ablated samples, using a single randomly-determined ablation pattern (selection of block or column to retain) on all samples in each batch.
3 Comparison to Conventional Randomized Smoothing
In conventional randomized smoothing, rather than computing the probability that returns each class directly, one must instead lower-bound, with high confidence, the probability that returns the plurality class and upper-bound the probabilities that returns all other classes, based on samples. This leads to decreased certified accuracy due to estimation error. Additionally, all of these bounds must hold simultaneously: in order to ensure that the gap between and is sufficiently large for each to prove robustness, one must bound the population probabilities for every class. Some works do this directly using a union bound, leading to increased error as the number of classes increases. Others, following , instead only use samples to lower-bound the probability that the base classifier returns the top class. One can then upper bound all other class probabilities by observing that . In other words, rather than determining whether will stay the plurality class at an adversarial point, one instead determines whether will stay the majority class. This is also the estimation method used by for certificates: this is why, when describing that method in Section 2.1, we gave the condition for certification as . In our deterministic method, we can use a less strict condition, that , where for block smoothing, and for column smoothing. (As described above, we can sometimes even certify in the equality case, when it is assured that will be selected if there is a tie between the class probabilities at the distorted point.)
In this work, we sidestep the estimation problem entirely by computing the population probabilities exactly. This substantially reduces evaluation time: for example, column smoothing on CIFAR-10 requires 32 forward passes, compared to for randomized ablation . (We provide measured evaluation times in supplementary material.) However, by avoiding the assumption of , that all probability not assigned to is instead assigned to a single adversarial class, we can make an additional optimization: we can add an ‘abstain’ option. If there is no compelling evidence for any particular class in an ablated image (i.e., if all logits are below a threshold value ), our classifier abstains. This prevents blocks which contain no information from being assigned to an arbitrary, likely incorrect class. Figure 5-a shows that this significantly increases the certified accuracy on MNIST, although it has little effect on CIFAR-10. Our threshold system also allows the base classifier to select multiple classes, if there is strong evidence for each of them. This is intended to increase certified accuracy in the case of a large number of classes, where the top-1 accuracy of the base classifier might be low: if the correct class consistently occurs within the top several classes, it may still be possible to certify robustness.
In a concurrent work, also proposes a derandomization of a randomized smoothing technique. However, the threat model considered is quite different: develops a defense against label-flipping poisoning attacks, where the adversary changes the labels of training samples. Notably, ‘s result only applies directly to linear base classifiers. By making this restriction, is able to analytically determine the probabilities of returning each class. By contrast, our de-randomized technique for patch attacks does not restrict the architecture of the base classifier , in practice a deep network.
Results
Certified robustness against patch attacks is presented for patches on MNIST and CIFAR-10 in Figure 5, using both block and column smoothing (On MNIST, we also tested smoothing with rows rather than columns, with slightly worse results: see supplementary materials.) Results in the figures are using a validation set of 5,000 images; the final results reported in Table 1 are on a separate test set of 5,000 images. On both datasets, we have found that column smoothing produces better certified accuracies than block smoothing. However, the performance gap is larger on MNIST than on CIFAR-10. We have also tested with the base classifier returning only the top-one class, rather than thresholding the logits to abstain on low confidence predictions. We find that thresholding produces a large improvement on MNIST, but has had little effect on CIFAR-10. This is possibly because MNIST images, when ablated, will often have zero information (i.e., be entirely black), while in natural images, the retained region will always have some information. In both datasets, we found that the column smoothing certificates are not highly sensitive to the threshold hyperparameter .
Experiments using multiple blocks and columns, rather than just a single block or column for each base classification, are presented in supplementary materials.
In Figure 6, we show how our certificates scale to different patch sizes, beyond the standard . On CIFAR-10, we maintain high certified accuracy even at a patch size of . Notably, the optimal column width seems not to depend on the patch size, suggesting that a single trained model can defend against a broad class of patch attacks.
On ImageNet-1000 (ILSVRC2012), we have tested certified robustness to patch attacks with column smoothing alone, using column width , and over the hyperparameter range . We have used 1,000 images for validation, and 1,000 for test, using the optimal ; test set results are presented in Table 1. Full validation results for all datasets are presented as tables in supplementary materials.
We also compare column smoothing certificates for MNIST and CIFAR-10 to randomized column smoothing smoothing certificates on both datasets: see Table 2. We find that the “derandomization” improves the certificates independently of the effect of thresholding (for example, it increases the certified accuracy on CIFAR-10 by nearly 7 percentage points.)
We evaluated the empirical robustness of our method, specifically column smoothing, on CIFAR-10, using a modified version of the IFGSM patch attack from . In particular, because the zero-one base-classifications are non-differentiable, we cannot attack directly. Instead, in order to generate the attacks, we use a surrogate model in which returns SoftMax scores. Note that this is similar to ’s attack on Gaussian-smoothed classifiers, but there is no need to consider random sampling in this case. Further details on the attack are provided in supplementary materials. Results are presented in Figure 7-a. We note that, as expected, our certified lower bounds hold, and furthermore that our model is significantly more robust to patch adversarial attacks compared with an undefended baseline model. We also evaluated the robustness of our attack to a non-patch adversarial attack, specifically an -bounded IFGSM attack. Because all base classifiers are attacked simultaneously in this model, our method provides no robustness guarantee, and one might worry that the model could be particularly vulnerable to the attack. However, while the accuracy under this attack was reduced compared to an undefended baseline model, this was not a dramatic effect: see Figure 7-b.
Conclusion
Patch adversarial attacks are important threat models because they formalize physical adversarial attacks. In this work, we propose Structured Ablation, a provably robust defense against patch attacks. Our method, an adaptation of randomized smoothing, significantly outperforms the state-of-the-art certified defense for patch attacks on CIFAR-10, and, unlike previous methods, scales to ImageNet.
Broader Impact
Adversarial patch attacks are extremely relevant to security threats posed by adversarial machine learning. In particular, patch attacks model physical adversarial attacks, in which real-world objects are manipulated in order to disrupt computer vision systems. Malicious use of such attacks could therefore be catastrophically damaging in highly critical applications of computer vision, such as self-driving cars. For example, consider an adversary that puts adversarial stickers on stop signs to cause significant errors in classification of those images by deep models deployed in autonomous vehicles. Such an attack could cause significant damage. Moreover, the existence of such vulnerabilities in deep models can harm the confidence of users of systems that employ such models, which could slow adoption of these systems. Our proposed techniques in this paper provide new provable and guaranteed defenses against these attacks, advancing the effort to mitigate these issues.
We note that the algorithms described in this paper are purely defensive. That is, this work does not reveal (in any way obvious to the authors) any unknown vulnerabilities in existing computer vision systems. While we do develop an adversarial attack against our classifier, this attack is a straightforward extension of existing work on adversarial attacks to smoothed classifiers : implementing this attack represents necessary due diligence to evaluate the robustness of our defense.
One possible negative outcome of provable robustness guarantees is that they may cause users to be overconfident in the reliability of machine learning systems in general. As we have demonstrated in Section 3.1, our techniques do not provide robustness to general adversarial attacks other than patch attacks. Further, a guarantee of robustness is not a guarantee of correctness: in fact, the accuracy of our classifiers is reduced compared to undefended models. Users should be aware of these issues before applying these techniques in critical applications.
Additionally, we acknowledge that, as for any computer vision advance, malicious actors could also use the techniques demonstrated here. For example, the application of these techniques could make it more difficult to thwart excessive and unwanted surveillance, posing a potential privacy concern. However, given the important safety applications described above, we believe that making this work available will have an overall positive impact.
Acknowledgements
This project was supported in part by NSF CAREER AWARD 1942230, grants from NIST 60NANB20D134, HR001119S0026, HR00111990077, HR00112090132 and Simons Fellowship on “Foundations of Deep Learning.”
References
Appendix A Proofs
We first prove the block smoothing algorithm. Recall the definitions and statement of Theorem 1. In particular, recall the base classification counts :
And recall the definition of the smoothed classifier:
where in the case of ties, we choose the smaller-indexed class as the argmax solution.
For any image , base classifier , smoothing block size , and patch size , if:
then for any image which differs from only in an patch, .
Let represent the upper-right corner of the patch in which and differ. Note that, for all , the output of will be equal to the output of , unless the block retained (starting at ) intersects with the adversarial patch (starting at ). This condition occurs only when both is in the range between and , inclusive, and is in the range between and , inclusive. Note that there are values each for and which meet this condition, and therefore such pairs . Therefore in all but cases.
Note that if , then the intersecting values for , taking into account the wrapping behavior of , will be through , and through (see Figure 4 in the main text): there are still such values, and a similar argument applies to .
Therefore, because ,
Now, consider any , such that . There are two cases:
: In this case, in the event that , we have that . Therefore, a sufficient condition for is that . By Equation 10 and triangle inequality, this must be true if , or equivalently, if .
: In this case, in the event that , we have that . Therefore, a sufficient condition for is that . By Equation 10 and triangle inequality, this must be true if .
Therefore, if , then no class other than can be output by . ∎
The column smoothing method can be proved similarly. For completeness, we state and prove Theorem 2 here as well. Recall
For any image , base classifier , smoothing band size , and patch size , if:
then for any image which differs from only in an patch, .
Let represent the upper-right corner of the patch in which and differ. Note that, for all , the output of will be equal to the output of , unless the band (of width ) retained, starting at column , intersects with the adversarial patch (starting at ). This condition occurs only when is in the range between and , inclusive. Note that there are values for which meet this condition. Therefore in all but cases.
Again, if , then the intersecting values for , taking into account the wrapping behavior of will be through , and through : there are still such values. Therefore, because ,
The rest of the proof proceeds exactly as in the block smoothing case, with substituted for . ∎
Appendix B Full Validation Result Tables for Column and Block Smoothing
Tables 3 and 5 present the full validation set clean and certified accuracies for patches on MNIST and CIFAR-10, respectively, for all tested values of parameters and , and for both block and column smoothing. Note that this is presented in Figure 5 in the main text. Table 4 presents the validation set clean and certified accuracies for patches on ImageNet using column smoothing, for all four tested values of the hyperparameter .
Appendix C Results for Row Smoothing
We also tested smoothing with rows, rather than columns, on MNIST. This resulted in slightly lower certified accuracy under patch attacks (45.32% validation set certified accuracy, versus 53.22% using column smoothing). Full results are presented in Table 6.
Appendix D Multi-column and Multi-block Derandomized Smoothing
In the main text, we argued for having the base classifier use a single contiguous group of pixels on the grounds that, compared to selecting individual pixels, it provides for a smaller risk of intersecting the adversarial patch. However, there may be some benefit to getting information from multiple distinct areas of an image, even if there is some associated increase in . Rather than just looking at the extremes of entirely independent pixels (Table 10) versus a single band or block (Figure 5 in the main text) we also explored, on MNIST, the intermediate case of using a small number of bands or blocks. In Table 7, we show all mathematically possible multiple-column certificates on MNIST, as well as several certificates for multiple-blocks with . Interestingly, while the certificates using multiple columns are far below optimal, the certified accuracy for two blocks is only marginally below the best single-block certified accuracy.
For smoothing with multiple blocks or multiple columns, we consider only blocks or columns aligned to a grid starting at the upper-left corner of the image. For example, if using block size , we consider only retaining blocks with upper-left corner , where and are both multiples of . This prevents retained blocks from overlapping, and also reduces the (large) number of possible selections of multiple blocks, allowing for derandomized smoothing.
Let the number of retained blocks or bands be , and, as in the paper, let the block or band size be , the image size be , and the adversarial patch size be . For the block case, note that there are such axis-aligned blocks. Of these, the adversarial patch will overlap at most blocks. For example, for a adversarial patch, using block size , the adversarial patch will overlap exactly blocks, regardless of position: see Figure 8.
When performing derandomized smoothing, we classify all possible choices of blocks. Of these classifications, at least
will use none of the at most blocks which may be affected by the adversary. Therefore, the number of classifications which might be affected by the adversary is at most:
We can then use the above quantity in place of the number of classifications that might be affected by the adversarial patch in standard block smoothing (Equation 4). This modification, in addition to classifying all selections of axis-aligned blocks, is sufficient to adapt the certification algorithm to a multi-block setting.
The column case is similar: there are axis-aligned bands (defined as bands which start at a column index which is a multiple of ). Of these, the adversarial patch will overlap at most bands. When performing smoothing, we classify all possible choices of bands. Of these classifications, at least
will use none of the at most bands which may be affected by the adversary. Therefore, the number of classifications which might be affected by the adversary is at most:
Full validation set results for multi-block and multi-band smoothing are shown in Table 7.
Appendix E Comparison with Randomized Structured Ablation
As discussed in the main text, there are two benefits to derandomization: first, we can eliminate estimation error, and second, it allows the classifier to abstain or select multiple classes without complicating estimation. In order to distinguish these effects, we present in Tables 8 and 9 the certificates on MNIST and CIFAR-10 using randomized column smoothing (with the estimation scheme from ), versus deterministic column smoothing. We compare to both the “Top-1 class” method (without abstaining or thesholding) as well as to the thresholding method, with . We find that derandomization alone, without the thresholding method, provides a considerable improvement (around 6 percentage points increase on MNIST, around 7 percentage points on CIFAR-10). On MNIST (although not on CIFAR-10), the thresholding scheme provides a large additional improvement.
Appendix F Sparse Randomized Ablation for Patch adversarial Attacks
In Table 10, we provide the certified accuracies computed from applying sparse Randomized Ablation to patch adversarial attacks, as discussed in Section 2.1 of the main text.
Appendix G Adversarial Attack Details
In order to test adversarial attacks against our structured ablation model (in particular the column smoothing model) we must work around the non-differentiability of the base classifier with respect to the image. We accomplish this using a method similar to the attack on smooth classifiers proposed by .
In particular, as described in Section 2.2.1 in the main text, the base classifier in our model is implemented using a neural network: let represent the (SoftMax-ed) logits of this neural network:
Rather than attacking , we instead attack a soft smooth classifier, :
The objective of the adversary (as in ) is now applied to this soft classifier:
where is the true label. The IFGSM patch attack proposed by proceeds by first randomly selecting a patch to attack, and then attacking it with standard IFGSM, without imposing any magnitude constraint on the attack (other than as required to produce a feasable image). This is repeated many times on many random patches. However, the most successful attack so far is recorded at each step of optimization, and finally returned at the end of the attack. (Note that this is the most successful attack over all steps of all random initializations.) In , this is taken as whichever perturbed version of the image maximizes the objective (Equation 16). Because we ultimately care about the “hard” smoothed classifier , we instead just evaluate the final “hard” classification at each step. We record an attack to return only if it is actually successful at making the final classification incorrect. Note that this does not impose significant computational costs, because we already have the value of each ‘soft’ base classifier at each step.
As mentioned in the main text, for the patch attack, we perform 80 random starts, 150 iterations per random start, and use a step size of 0.05. When attacking patches, we uniformly randomly initialize the pixels in the attacked region. For IFGSM, we used IFGSM for 50 iterations and a step size of : for this, we did not randomize the pixel values before optimizing, but rather started at the initial . Training parameters for baseline models were identical to those for column-smoothed models, except that a regular, full ResNet-18 model was used.
Appendix H Evaluation Times
Data on evaluation times (using the optimal hyperparameters to maximize certified accureacy for each method) are shown in Table 11. We used NVIDIA 2080 Ti GPUs for our experiments.
Appendix I Architecture and Training Details
As discussed in the paper, we used the method introduced by to represent images with pixels ablated: this requires increasing the number of input channels from one to two for greyscale images (MNIST) and from three to six for color images. For MNIST, we used the simple CNN architecture from the released code of , consisting of two convolutional layers and three fully-connected layers. For CIFAR-10 and ImageNet, we used modified versions ResNet-18 and ResNet-50, respectively, with the number of input channels increased to six. Training details are presented in Table 12.
For randomized smoothing experiments, we follow the empirical estimation methods proposed by . We certify to confidence, using 1000 random samples to select the putative top class, and 10000 random samples to lower-bound the probability of this class. For sparse randomized ablation on MNIST, we use released pretrained models from .