I
MPROVING A DVERSARIAL R OBUSTNESS VIA C HANNEL - WISE A CTIVATION S UPPRESSING
Anonymous authors
Paper under double-blind review
A BSTRACT
The study of adversarial examples and their activations have attracted signiﬁcant attention for secure and robust learning with deep neural networks (DNNs).
Different from existing works, in this paper, we highlight two new characteristics of adversarial examples from the channel-wise activation perspective: 1) the activation magnitudes of adversarial examples are higher than that of natural examples; and 2) the channels are activated more uniformly by adversarial examples than natural examples.
We ﬁnd that, while the state-of-the-art defense adversarial training has addressed the ﬁrst issue of high activation magnitude via training on adversarial examples, the second issue of uniform activation remains.
This motivates us to suppress redundant activations from being activated by adversarial perturbations during the adversarial training process, via a Channel-wise Activation Suppressing (CAS) strategy.
We show that CAS can train a model that inherently suppresses adversarial activations, and can be easily applied to existing defense methods to further improve their robustness.
Our work provides a simple but generic training strategy for robustifying the intermediate layer activations of DNNs.
I NTRODUCTION
Deep neural networks (DNNs) have become standard models for solving real-world complex problems, such as image classiﬁcation (He et al., 2016),
speech recognition
(Wang et al., 2017), and natural language processing (Devlin et al., 2019).
DNNs can approximate extremely complex functions through a series of linear ( e.g. convolution) and non-linear ( e.g. ReLU activation) operations.
Despite their superb learning capabilities, DNNs have been found to be vulnerable to adversarial examples (Szegedy et al., 2014; Goodfellow et al., 2015).
Small adversarial perturbations on the input can cause signiﬁcant changes on DNN output, leading to completely failed predictions.
A body of works have been proposed as defense techniques against adversarial examples, such as input denoising (Liao et al., 2018; Bai et al., 2019), defensive distillation (Papernot et al., 2016), gradient regularization (Gu & Rigazio, 2014), model compression (Das et al., 2018) and adversarial training (Goodfellow et al., 2015; Madry et al., 2018).
Among these methods, adversarial training is arguably one of the most effective approaches (Athalye et al., 2019).
Adversarial training is a data augmentation technique that trains DNNs on adversarial rather than natural examples.
In adversarial training, natural examples are augmented (or perturbed) with the worst-case perturbations found within a small L p -norm ball around them.
This augmentation has been shown to effectively smooth out the loss landscape around the natural examples, and force the network to focus more on the pixels that are most relevant to the class.
Apart from these interpretations, it is still unclear, from the intermediate activation perspective, why small input perturbations can accumulate across intermediate layers to ﬂip the output, and how adversarial training can help mitigate such accumulations.
The study of intermediate layer activations has thus become crucial for developing more in-depth understanding and robust DNNs.
In this paper, we show that, if studied from a channel-wise perspective, strong connections between certain characteristics of intermediate activations and adversarial robustness can be established.
Our channel-wise analysis is motivated by the fact that different convolution ﬁlters (or channels) learn different patterns, which when combined together, describe a speciﬁc type of object.
We study the adversarial examples from a new perspective of channels in activations.
Different from the existing activation works assuming different channels are of equal importance, we focus on the relationship between channels.
Intuitively, different channels of an intermediate layer contribute differently to the class prediction, thus have different levels of vulnerabilities (or robustness) to adversarial perturbations.
Given an intermediate DNN layer, we ﬁrst apply global average pooling to obtain the channel-wise activations, based on which, we show that the activation magnitudes of adversarial examples are higher than that of natural examples.
This means that adversarial perturbations generally have the signal-boosting effect on the channels.
We also ﬁnd that the channels are activated more uniformly by adversarial examples than that by natural examples.
In other words, some redundant (or low contribution) channels that are not activated by natural examples, yet are activated by adversarial examples.
We show that adversarial training can effectively address the high magnitude problem, yet fails to address the uniform channel activation problem, that is, some redundant and low contributing channels are still activated.
To a certain extent, this explains why adversarial training works but its performance is not satisfactory.
In this work, we propose a new training strategy named Channel-wise Activation Suppressing (CAS), which adaptively learns (with an auxiliary classiﬁer) the importance of different channels to class prediction, and leverages the learned channel importance to adjust the channels dynamically in the training phase. The
robustness of existing state-of-the-art adversarial training methods can be consistently improved if applied with our CAS training strategy.
Our key contributions are summarized as follows
: • We identify, from a channel-wise activation perspective, two connections between DNN activations and adversarial robustness: 1) the activations of adversarial examples are of higher magnitude than that of natural examples; and 2) the channels are activated more uniformly by adversarial examples than that by natural examples.
Adversarial training only addresses the ﬁrst issue of high activation magnitude, yet fails to address the second issue of uniform channel activation.
• We propose a novel training strategy to train robust DNN intermediate layers via Channelwise Activation Suppressing (CAS).
In the training phase, CAS suppresses redundant channels dynamically by reweighting the channels based on their contributions to the class prediction.
CAS is a generic intermediate-layer robustiﬁcation technique that can be applied to any DNNs along with existing defense methods.
• We empirically show that our CAS training strategy can consistently improve the robustness of current state-of-the-art adversarial training methods.
It is generic, effective, and can be easily incorporated into many existing defense methods.
We also provide a complete analysis on the beneﬁt of channel-wise activation suppressing to adversarial robustness.
R ELATED W ORK
Adversarial Defense.
Many adversarial defense techniques have been proposed since the discovery of adversarial examples (Liao et al., 2018; Bai et al., 2019; Papernot et al., 2016; Das et al., 2018).
Among them, many are found to have caused obfuscated gradients and can be circumvented by Back
Pass Differentiable Approximation (BPDA), Expectation over Transformation (EOT) or Reparameterization (Athalye et al., 2019).
Adversarial training (AT) has been demonstrated to be the most effective defense (Athalye et al., 2019), which solves the following min-max problem:
[Equation]
where, F is a DNN model with parameters ✓ , x is a natural example with class label y , x 0 is the adversarial example within the L p -norm ball B ✏ ( x ) = { x 0 : k x 0  x k p  ✏ } centered at x ,
F ( x 0 , ✓ ) is the output of the network, and L is the classiﬁcation loss ( e.g. the cross-entropy loss).
The inner maximization problem is dependent on the adversarial examples x 0 generated within the ✏ -ball, while the outer minimization problem optimizes model parameters under the worst-case perturbations found by the inner maximization.
There are other variants of adversarial training with new objective functions or regularizations.
For example, TRADES (Zhang et al., 2019) optimizes a trade-off objective of adversarial robustness and accuracy.
MART (Wang et al., 2020b) applies a distinctive emphasis on misclassiﬁed versus correctly classiﬁed examples.
However, apart from Under these improvements, it is still unclear how adversarial training can help produce state-of-the-art robustness from the activation perspective.
Activation Perspective of Adversarial Robustness.
Some previous works have investigated the adversarial robustness from the architecture perspective, such as skip connection (Wu et al., 2020) and batch normalization (Galloway et al., 2019).
As for intermediate activations, Zhang et al.
(2018) certiﬁes the robustness of neural networks with different activation functions.
Xu et al.
(2019) explores the inﬂuence of adversarial perturbations on activations from suppression, promotion and balance perspectives.
Other works develop new activation operations with the manifold-interpolating data-dependent function in Wang et al.
(2020a)
and adaptive quantization techniques in Rakin et al.
While these works all directly modify the activation functions, there are also works focusing on the activation outputs.
For instance, k -Winner-Takes-All ( k WTA) (Xiao et al., 2020) takes the largest k feature values in each activation layer to enhance adversarial robustness.
However, this has recently been shown not robust against adaptive attacks (Tramer et al., 2020).
Stochastic Activation
Pruning (SAP) (Dhillon et al., 2018) takes the randomness and the value of features into consideration.
Each activation is chosen with a probability proportional to its absolute value.
Adversarial
Neural Pruning (ANP) (Madaan & Hwang, 2020) prunes out the features that are vulnerable to adversarial inputs using Bayesian method.
Prototype Conformity Loss (PCL) (Mustafa et al., 2019) is used to cluster class-wise features and pushes class centers away from each other.
Feature Denoising (FD) (Xie et al., 2019) adds denoising layers to the network for sample-wise denoising on feature maps.
However, these methods are developed based on observations on the full output ( e.g. the entire feature or activation map that does not distinguish different channels) of DNN intermediate layers.
In contrast, our CAS explores both channel importance and channel correlations, and the suppressing is done with the guidance of the labels.
C HANNEL - WISE A CTIVATION AND A DVERSARIAL R OBUSTNESS
In this part, we investigate two characteristics of DNN intermediate activations from a channel-wise perspective, and show two empirical connections between channel-wise activations and adversarial robustness.
Speciﬁcally, we train ResNet-18 (He et al., 2016) and VGG16 (Simonyan & Zisserman, 2014) on CIFAR-10 (Krizhevsky et al., 2009) using both standard training and adversarial training under typical settings.
We then apply global average pooling to extract the channel-wise activations from the penultimate layer.
We investigate the extracted channel-wise activations of both natural and adversarial examples from two perspectives: 1) the magnitude of the activations, and 2) the activation frequency of the channels.
[Figure]
Channel-wise Activation Magnitude.
Figure 1 illustrates the averaged activation magnitudes for both natural test examples and the corresponding adversarial examples crafted by PGD-20 attack (Madry et al., 2018).
For standard models (trained on natural examples), the activation magnitudes of adversarial examples are generally higher than that of natural examples as shown in Figure 1(a)/1(c).
Adversarial perturbation exhibits a clear signal-boosting effect on the channels, which leads to the accumulation of adversarial distortions from the input to the out layer of the network.
As shown in Figure 1(b)/1(d), adversarial training can effectively narrow the magnitude gap between natural and adversarial examples, interestingly by decreasing the activation magnitudes of adversarial examples.
This is because adversarial training can restrict the Lipschiz constant of the model at deeper layers ( i.e. layers close to the output), which reduces the magnitude gaps caused [Figure] by adversarial perturbations (Finlay et al., 2018; Sinha et al., 2019).
Note that network architecture also inﬂuences activation magnitudes.
Figure 1 show that magnitudes in VGG have much more zero values than those in ResNet, i.e. VGG produces more sparse channels than ResNet.
Channel-wise Activation Frequency.
Given a speciﬁc class, different convolution ﬁlters learn different patterns associated with the class.
Similar to the robust vs. non-robust feature differentiation in adversarial training (Ilyas et al., 2019), the intermediate ﬁlters (or channels) can also be robust or non-robust.
Intuitively, for natural examples in the same class, robust channels produce more generic patterns and should be activated more frequently, yet the non-robust ones should be activated less frequently.
As such, non-robust channels can cause more variations to the next layer if activated by adversarial perturbations, increasing the vulnerability to adversarial examples.
To investigate this, we visualize the activation frequency of the channel-wise activations in Figure 2.
Here, we take one speciﬁc class ( e.g. class 0) of CIFAR-10 as an example.
A channel is determined as activated if its activation value is larger than a threshold ( e.g. 1% of the maximum activation value over allchannels).
We count the activation frequency for each channel by natural and their PGD adversarial examples separately on standard or adversarially trained ResNet-18 models, and sort the channels in descending order according to the activation frequency by natural examples.
As can be observed in
Figure 2(a), adversarial examples activate the channels more uniformly, and they tend to frequently activate those that are rarely activated by natural examples ( e.g. the right region in Figure 2(a)).
This observation is consistent across different classes.
The low frequency channels are non-robust channels, and correspond to those redundant activations that are less important for the class prediction.
It can also be observed that adversarial perturbation also inhibits those high frequency channels of natural examples (the left region of Figure 2(a)).
Figure 2(b) shows that, by training on adversarial examples, adversarial training can force the channels to be activated in a similar frequency by both natural and adversarial examples.
However, there are still a certain proportion of the redundant channels ( e.g. channels #350 - #500) that are activated by adversarial examples.
This motivates us to propose a Channel-wise Activation Suppressing (CAS) training strategy to avoid those redundant channels from being activated by adversarial examples.
Figure 2(c) shows the effectiveness of our CAS strategy applied with adversarial training, that is, our CAS can suppress all channels, especially those low frequency ones on natural examples.
More visualizations of channel-wise activation frequency for other adversarial training methods can be found in Appendix C.
P ROPOSED C HANNEL - WISE A CTIVATION S UPPRESSING
In this section, we introduce our Channel-wise Activation Suppressing (CAS) training strategy, which dynamically learns and incorporates the channel importance (to the class prediction) into the training phase to train a DNN model that inherently suppresses those less important channels.
Overview.
Figure 3 illustrates our CAS training strategy.
The CAS module consists of a global average pooling operation ( i.e. GAP in the CAS module) to obtain the channel-wise activations, and an auxiliary classiﬁer ( i.e. FC in the CAS module) to learn the channel importance.
The learned channel importance is then multiplied back to the original activations for adjustment, and the ad- [Figure] FC Layer 𝑴 𝒚/(cid:3549)𝒚 𝒍 𝒍 ReLU
ReLU … … …
FC …
Block Input CE Loss CAS Loss GAP 𝑴 𝟎𝒍 𝒑 𝒇 𝒍 (cid:3560)𝒇 𝒍
Loss
𝒇 𝒍 (cid:3552)𝒇 𝒍 (cid:3560)𝒇 𝒍 𝑴 (cid:2778) 𝒍 ⊗𝑴 𝒚/(cid:3549)𝒚 𝒍 𝒍 … … 𝒇 𝒍 (cid:3549)𝒑 𝒍 justed activations are then passed into the next layer for model training entire network and the auxiliary classiﬁer are trained simultaneously using a combination of the CAS loss and the CE loss.
The CAS module can be attached to any intermediate layer of a DNN.
4. CAS M ODULE
Denote the l -th activation layer output of network F as f l 2 R H ⇥ W ⇥ K , where H, W, K represent the height, width, channel of the activation map, respectively.
In CAS module, we ﬁrst apply the
GAP operation on the raw activation f l to obtain the channel-wise activation ˆ f l 2 R K .
Formally, for the k -th channel,
[Equation]
The channel-wise activation ˆ f l is then passed into the auxiliary classiﬁer to perform multi-class classiﬁcation with a fully-connected (FC) layer.
For C classes, the parameters of the auxiliary classiﬁer can be written as M l =
[ M l 1 , M l 2 , .., M lC ] 2 R K ⇥ C , which can identify the importance of each channel to a speciﬁc class, and will be applied to reweight the original activations f l in a channel-wise manner.
In the training phase, the ground-truth label y is utilized as the index to determine the channel importance, i.e. M ly 2 R K .
While for the test phase, since the ground-truth label is not available, we simply take the weight component M l ˆ y l 2 R K that is associated to the predicted class ˆ y l as the channel importance (detailed analysis can be found in Section 5.1).
The computed channel importance is then applied to reweight the original activation map f l as follows:
[Equation]
where ⌦ represents the channel-wise multiplication.
The adjusted ˜ f l will be passed into the next layer via forward propagation.
Note that, so far, neither the auxiliary nor the network is trained, just computing the channel importance and adjusting the activations in a channel-wise manner.
4. M ODEL T RAINING
We can insert S Channel-wise Activation Suppressing (CAS) modules into S different intermediate layers of DNNs.
The CAS modules can be considered as auxiliary components of the network, and can be trained using standard training or different types of adversarial training.
Here, we take the original adversarial training (Madry et al., 2018) as an example, and deﬁne the loss functions to simultaneously train the network and our CAS modules.
Each of our CAS modules has a FC layer.
Taking one inserted CAS module after the l -th activation layer of network F for examples, the CAS loss function can then be deﬁned as,
[Equation]
where C is the number of classes, ˆ p l = softmax ( ˆ f l M l ) 2 R C is the prediction score of the classiﬁer in CAS module, and x 0 is the adversarial example used for training. Note that L CAS is the cross
Under review as a conference paper at ICLRentropy loss deﬁned on the auxiliary classiﬁer.
Similarly, it can also be extended to multiple CAS modules.
The overall objective function for adversarial training with our CAS strategy is:
[Equation]
where  is a tunable parameter balancing the strength of CAS.
Besides the original adversarial training (AT) (Madry et al., 2018), we can also combine CAS with other defense techniques such as TRADES (Zhang et al., 2019) and MART (Wang et al., 2020b).
In Appendix B, we summarize the loss functions of the original AT, TRADES, MART, and their combined versions with our CAS.
The complete training procedure of our CAS is described in Algorithm 1 in Appendix A.
E XPERIMENTS
In this section, we ﬁrst provide a comprehensive understanding of our CAS training strategy, then evaluate its robustness on benchmark datasets against various white-box and black-box attacks.
5. E MPIRICAL U NDERSTANDING OF CAS
In this part, we ﬁrst show the channel-suppressing effect and robustness of our CAS, then analyze the effectiveness of our CAS when applied at different layers of DNN.
A parameter analysis of
CAS can be found in Appendix D. In Appendix E, we show that CAS can also help representation learning and natural training.
Experimental Settings.
We adversarially train ResNet-18 for 200 epochs on CIFAR-10 using SGD with momentum 0.9, weight decay 2e-4, and initial learning rate 0.1 which is divided by 10 at 75-th and 90-th epoch.
We use PGD-10 ( ✏ = 8 / 255 and step size 2 / 255 ) with random start for training.
The robustness (accuracy on adversarial examples) is evaluated under attacks: FGSM (Goodfellow et al., 2015), PGD-20 (Madry et al., 2018), and CW 1 (Carlini & Wagner, 2017) optimized by PGD.
[Figure]
[Figure]
[Table]
Channel Suppressing Effect.
We compare CAS with three activation- or feature-based defense
Here, we train k WTA with 20% sparse largest values in each activation layer, SAP with typical random pruning and PCL with warm-up training by CE loss and then ﬁne-tuning with the added
PCL loss.
Figure 4 shows the activation frequencies at the penultimate layer of ResNet-18 trained by different methods.
While k WTA, SAP and PCL demonstrate a certain level of channel suppressing, their effects are not as signiﬁcant as our CAS training.
k WTA and SAP hardly have the channel suppressing effect ( e.g. channel #350 - #500 in Figure 4(a) and channel #380 - #500 in Figure 4(b)), for the reason that they improve robustness mainly by introducing certain randomness into the
[Table]
activations, and thus can be easily attacked by some adaptive attacks (Tramer et al., 2020; Athalye et al., 2019).
PCL still frequently activates many redundant channels ( e.g. channel #150 - # in Figure 4(c)).
This is because PCL does not directly enforce channel suppression.
Different to these methods, our CAS demonstrates the most effective channel suppression.
As a side note, due to the dynamic thresholding, the frequency distributions should be compared within the same model between natural and adversarial examples not across different models.
Within the same model, the closer the frequency distribution of the adversarial examples is to that of the natural examples, the better the adversarial robustness ( i.e. the adversarial accuracy is closer to the natural accuracy).
From this point of view, our CAS can effectively reduce the activation frequency gap between natural and adversarial examples, producing superior robustness.
The natural accuracies and robustness of these methods are reported in Table 1.
Due to the randomness introduced in k WTA and SAP, they are not robust against average PGD (Avg-PGD) using margin loss (Tramer et al., 2020) or Expectation
Over Transformation (EOT) (Athalye et al., 2019) attacks.
Our CAS training strategy does not rely on randomness, thus is robust even against Avg-PGD or EOT attacks.
We next verify that explicit Channel Suppressing (CS) is indeed essential to the improved robustness of CAS.
Speciﬁcally, we remove CS deﬁned in Equation 3 from CAS, then retrain ResNet-18 using adversarial training with the CAS loss deﬁned in Equation 5.
Table 2 shows that the robustness can not be improved without explicit channel suppressing.
CAS at Different Layers.
We insert the CAS module into different blocks of ResNet-18, and show the different robustness improvements in Table 3.
Intuitively, deeper layer activations are more correlated to the class prediction, thus should beneﬁt more from our CAS training.
Shallow layers, however, may suffer from inaccurate channel importance estimations.
As demonstrated in Table 3, it is indeed the case: the largest improvement is obtained when applying CAS at Block
( e.g. after the ReLU output of Block4).
The robustness can also be improved when inserting CAS into Block or both the Block3 and Block
(‘Block3+4’), though notably less signiﬁcant that that at Block4.
[Table]
Robustness of the CAS Module.
Since our CAS module suppresses channel-wise activations according to the label (during training) or the prediction (during testing), it might raise the concerns of whether the CAS module itself is robust or how the misclassiﬁcation in CAS module would affect the ﬁnal results.
One observation is that, when the CAS module is inserted to deep layers that are close to the ﬁnal layer of the network, it can learn to make very similar predictions with the ﬁnal layer.
For an empirical analysis, we test the robustness of the CAS module against different attacks in Table 4.
The results indicate that our CAS module is robust by itself, leading to both higher natural accuracies and
[Table]
[Table]
R OBUSTNESS E VALUATION
In this section, we evaluate our CAS on CIFAR-10 (Krizhevsky et al., 2009) and SVHN (Netzer et al., 2011) datasets with ResNet-18 (He et al., 2016).
We apply our CAS training strategy to several state-of-art adversarial training approaches: 1) AT (Adversarial Training)
(Madry et al., 2018), 2)
TRADES (Zhang et al., 2019), and 3) MART (Wang et al., 2020b).
We follow the default settings as stated in their papers.
More results on WideResNet-34-10 (Zagoruyko & Komodakis, 2016) and
VGG16 (Simonyan & Zisserman, 2014) can be found in Appendix F.1 and F.2.
Experimental Settings.
The training settings for CIFAR-10 are the same as Section 5.1.
For SVHN, we adversarially train ResNet-18 using SGD with momentum 0.9, weight decay 5e-4, initial learning rate 0.01 which is divided by 10 at 75-th and 90-th epoch, and training attack PGD-10 ( ✏ = 8 /and step size 1 / 255 ) with random start.
White-box Robustness
We evaluate the robustness of all defense models against three types of white-box attacks: FGSM, PGD-20 (step size ✏ / 10 ) and CW 1 (optimized by PGD).
To fairly compare our method with baselines, we use adaptive white-box attack for our CAS models, i.e. the attacks are performed on the joint loss of CE and CAS.
Here, we report the robustness of the models obtained at the last training epoch in Table 5.
As shown in Table 5, our CAS can improve both the natural accuracy and the robustness of all baseline methods, resulting in noticeably better robustness.
The improvement against CW 1 attack is more signiﬁcant than against FGSM or PGDattacks.
This is because the prediction margins are enlarged by our CAS training with the channel suppression.
As shown in Figure 9 (Appendix E), the deep representations learned by CAS-trained models are more compact within each class, while are more separated across different classes.
This makes margin-based attacks like CW 1 more difﬁcult to succeed.
Robustness results obtained at the best checkpoint throughout the entire training process and the learning curves are provided in Appendix F.3.
Our CAS can also improve the robustness of the best checkpoint model for each baseline defense. Thus the improvement of our CAS is reliable and consistent, and is not caused by the effect of overﬁtting (Rice et al., 2020).
Recently, several new attacks such as AutoAttack (Croce & Hein, 2020b) and Fast Adaptive Boundary (FAB) attack (Croce & Hein, 2020a) have been proposed for more accurate evaluation of DNN robustness to adversarial examples.
Our experiment results against the AutoAttack are reported in Appendix F.4, where our CAS consistently improves the robustness of the baseline methods.
This conﬁrms that our CAS training strategy can bring real robustness rather than obfuscated gradients (Athalye et al., 2019).
We have also evaluated our CAS training strategy under various attack perturbation constrains ✏ in Appendix F.5.
Black-box Robustness
We evaluate the black-box robustness of CAS and the baseline methods against both transfer and query-based attacks.
For transfer attack, the adversarial examples are generated on CIFAR-10/SVHN test images by applying PGD-20 and CW 1 attacks on a naturally trained ResNet-50.
For query-based attack, we adopt N Attack (Li et al., 2019).
Since N Attack requires a lot of queries, we randomly sample 1,000 images from CIFAR-10/SVHN test set and limit the maximum query to 20,000.
We test both black-box attacks on the models obtained at the last training epoch.
The results are reported in Table 6.
For both transfer and query-based attacks, our CAS can improve the robustness of all defense models by a considerable margin.
Especially against the N Attack, our CAS training strategy can improve AT, TRADES and MART by ⇠ 30% - 40% .
One reason why our CAS is particularly more effective against N Attack is that N Attack utilizes a similar margin objective function as CW 1 , which can be effectively blocked by channel suppressing.
[Table] [Table]
C ONCLUSION
In this paper, we investigated intermediate activations of deep neural networks (DNNs) from a novel channel-wise perspective, in the context of adversarial robustness and adversarial training.
We highlight two new characteristics of the channels of adversarial activations: 1) higher magnitude, and 2) more uniform activation frequency.
We ﬁnd that standard adversarial training improves robustness by addressing the ﬁrst issue of higher magnitude, however, it fails to address the second issue of uniform activation frequency.
To overcome this, we proposed the Channel-wise Activation Suppressing (CAS), which dynamically learns the channel importance and leverages the learned channel importance to suppress the channel activations during the training process.
When combined with adversarial training, we show that, CAS can train DNNs that inherently suppress redundant channels from being activated by adversarial examples.
Our CAS is a simple but generic training strategy that can be easily plugged into different defense methods to further improve their robustness, and can be readily applied to robustify the intermediate layers of DNNs. A A LGORITHM OF CAS T RAINING B A S UMMARY OF THE A DVERSARIAL L OSS F UNCTIONS USED WITH CAS When combined with our CAS, the training loss is a combination of the original adversarial loss and our CAS loss.
Table 7 deﬁnes the exact loss functions used for AT (Madry et al., 2018), TRADES (Zhang et al., 2019), MART (Wang et al., 2020b) and their CAS enhanced versions.
Here, we assume the CAS module is attached to S number of layers of the network.
ˆ p s and M s denote the prediction score and weights of the auxiliary classiﬁer in the s -th CAS module, respectively. [Table] [Table] C C HANNEL - WISE A CTIVATION S UPPRESSING ON M ORE D ATASETS AND D EFENSE M ODELS
Here, we visualize the channel suppressing effect of our CAS training strategy on more defense models: TRADES (Zhang et al., 2019) and MART (Wang et al., 2020b).
We train ResNet-18 (He et al., 2016) on CIFAR-10 (Krizhevsky et al., 2009).
The CAS modules are attached to the ﬁnal block of ResNet-18.
Figure 5 illustrates the channel activation frequencies of the original defense models and their improved versions with our CAS.
As can be observed, our CAS can suppress the redundant channels consistently in both defense models.
This restricts the channel-wise activations to be more class-correlated.
More importantly, the channel activations are suppressed to a similar frequency distribution between the natural and the adversarial examples.
We further compare the channel-wise activation of natural versus adversarial examples on SVHN and ImageNet in Figure 6 and Figure 7.
For SVHN, we choose examples of class 0 and construct the adversarial examples by PGD-20 with ✏ = 8 / 255 . We count the channel activation frequency of naturally trained, adversarial trained and CAS trained models.
As shown in Figure 6, neurons # - #500 in Figure 6(a) and neurons #250 - #400 in Figure 6(b), are frequently activated by adversarial examples while in Figure 6(c), our CAS can effectively suppress these redundant activations.
Under For ImageNet, as it is extremely time consuming to perform adversarial training, we adopt the standard pre-trained ResNet-152 from torchvision.models 1 and an adversarially trained ResNetfrom the Github repository 2 .
We select 5,900 dog images from the validation set of ImageNet (class #151-#269) and generate the adversarial examples using PGD-30 ( ✏ =16/255, ↵ =1/255).
We count the channel activations at the penultimate layer of ResNet-152.
It can be observed in Figure 7(a) that adversarial examples activate more uniformly than natural examples.
While in Figure 7(b), adversarially trained models can align the activation distribution of the natural examples with that of the adversarial examples to some extent, however, the activation frequency of the adversarial examples are still higher than that of the natural examples.
This indicates that there are still redundant channels and non-robust features in this adversarially trained ResNet-152 model.
[Figure]
[Figure]
[Figure]
D S ENSITIVITY OF CAS TO P ARAMETER
As mentioned in Section 4, the parameter  on the CAS loss controls the suppressing strength.
To test the sensitivity of CAS training under different  , we insert a CAS module to Block4 of ResNet18, and train the network on CIFAR-10 using AT+CAS under  2 [0 , 0 . 5 , 1 , 2 , 5 , 10 , 20] .
Note that  = 0 indicates the standard adversarial training (AT).
We test the robustness of the models in a white-box setting against FGSM, PGD-20 and CW 1 .
As shown in Figure 8, the models trained with larger  are generally more robust, especially against the CW 1 attack.
This is because larger  increases the strength of channel suppressing, leading to larger inter-class margins.
As we further show in Figure 9, the representations learned with CAS are more separated between different classes, and are more compact within the same class.
This tends to increase the difﬁculty of margin-based attacks like white-box CW 1 attack and black-box N attack.
E CAS I MPROVES R EPRESENTATION L EARNING
The representations learned by natural or adversarial training with or without our CAS strategy are illustrated in Figure 9.
The t-SNE (Maaten & Hinton, 2008) 2D embeddings are computed on deep features extracted at the penultimate layer of ResNet-18 on CIFAR-10.
As can be observed, our
CAS training improves representation learning for both natural training and adversarial training.
This is largely attributed to the strong channel suppressing capability of our CAS training.
Channel suppressing helps learn high-quality representations with high inter-class separation and intra-class compactness.
Interestingly, our CAS training can even improve the performance of natural training from 92.75% to 94.56%.
This implies that our CAS is a generic training strategy that can beneﬁt both model training and representation learning.
Although CAS is not a direct regularization technique, it can achieve a similar representation regularization effect as existing representation enhancing techniques like the center loss (Wen et al., 2016).
F M ORE E XPERIMENTAL R ESULTS F. W IDE R ES N ET R ESULTS ON CIFAR-
The white-box robustness of WideResNet-34-10 (Zagoruyko & Komodakis, 2016) models trained using AT, AT+CAS, TRADES, TRADES+CAS, MART and MART+CAS are reported in Table 8.
We attach the CAS module to the last two convolution layers of the network, and set  = 2 .
The training settings are the same as used for ResNet-18, except that, here we use weight decay 5e-4.
The ‘best’ and ‘last’ results indicate the best and last checkpoints, respectively.
For our CAS, we generate the attacks using the same adaptive white-box attacks as used in Section 5.2.
The robustness of AT,
TRADES and MART can be consistently improved by our CAS training.
The most improvements are achieved on AT.
These results conﬁrm that our CAS training can lead to consistent improvements to different adversarial training methods on more complex models. [Figure] [Table] [Table]
[Table]
[Table]
[Table] CAS 88. [Table] TRADES 86.
TRADES
[Table]
MART 84.
MART +CAS 87.
F. VGG16 R ESULTS ON CIFAR-
Similar to the above WideResNet experiments, here we report the results of VGG16 (Simonyan &
Zisserman, 2014) on CIFAR-10 in Table 9.
For VGG16, we attach the CAS module to its last three convolution layers, and set  = 3 .
We can see that our CAS training can enhance the robustness of ‘best’ models by a remarkable margin of 7%-10%.
Note that the accuracy of natural training is also improved by a considerable margin.
Compared with complex models like WideResNet, our CAS training is even more beneﬁcial for small capacity models ( e.g. VGG16).
[Table]
F. R OBUSTNESS R ESULTS AT THE BEST CHECKPOINT
We report the white-box robustness of the ‘best’ ( i.e. the best checkpoint) models of ResNeton SVHN and CIFAR-10 in Table 10, as a supplementary to the ‘last’ ( i.e. the last checkpoint) results in Table 5.
Again, our CAS can also improve the robustness of the ‘best’ checkpoint models consistently.
This proves that our CAS can improve both the robustness and the natural accuracy throughout the entire training process.
[Table]
R OBUSTNESS AGAINST A UTO A TTACK
We report the white-box AutoAttack (Croce & Hein, 2020b) evaluation results of ResNet-18 on
CIFAR-10 in Table 11.
AutoAttack is an ensemble of two proposed Auto-PGD attacks and the other two complementary attacks (Croce & Hein, 2020a).
AutoAttack has been shown can produce more accurate robustness evaluations on a wide range of adversarial training defenses.
As shown in Table 11, although less signiﬁcant than against regular attacks like PGD and CW, our CAS training can still improve the robustness of AT, TRADES and MART by a noticeable margin.
This conﬁrms that the improvements brought by our CAS training is ‘real’ and substantial, rather than obfuscated gradients nor improper evaluation. [Table]
F. M ORE R OBUSTNESS E VALUATIONS OF CAS
The robustness of the CAS module is further evaluated in this section.
By producing large margins, the CAS module and the channel suppression operation can make more boundary adversarial examples be correctly classiﬁed than that in the baseline models.
However, this may also increase the risk of causing imbalanced margin and imbalanced gradients.
To test this, we evaluate CAS against a recent Margin Decomposition (MD) attack (Jiang et al., 2020).
We use the default setting of MD attack as stated in the original paper.
The results are reported in Table 12, where it shows our CAS is robust against the MD attack. We also test our CAS against PGD-20 with step size ✏ / 10 and various attack strengths. This result is presented in Table 13. The robustness of CAS decreases with the increase of ✏ , which proves that the robustness of CAS is not a result of obfuscated gradients.
[Table]
PGD-20 under different ✏ . Attack strength ✏ 2/ 4/ 8/ 16/ 32/
AT +CAS 79. TRADES +CAS 80.
MART +CAS 81. C HANNEL A CTIVATION F REQUENCY UNDER D IFFERENT T HRESHOLDS In Figure 2, we have shown the activation frequency of standard training (STD), adversarial training (AT) and CAS-based adversarial training (AT+CAS) on a ResNet-18 model with the threshold of 1%. That is, a channel is determined as activated if its activation count is larger that 1% of the maximum activation count over all 512 channels.
In Figure 10, we show the distribution of activation frequency under different thresholds ( e.g. 0.5%, 1%, 5%).
Larger threshold will truncate more low-count activations.
The plots show that different thresholds will introduce some noise to the distributions but the general patterns do not change.
[Figure]