S PARSITY M EETS R OBUSTNESS
C HANNEL P RUNING
FOR
THE
F EYNMAN -K AC
F ORMALISM
P RINCIPLED
R OBUST D EEP N EURAL N ETS
Anonymous authors
Paper under double-blind review
A BSTRACT
Deep neural nets (DNNs) compression is crucial for adaptation to mobile devices.
Though many successful algorithms exist to compress naturally trained DNNs, developing efﬁcient and stable compression algorithms for robustly trained DNNs remains widely open.
In this paper, we focus on a co-design of efﬁcient DNN compression algorithms and sparse neural architectures for robust and accurate deep learning.
Such a co-design enables us to advance the goal of accommodating both sparsity and robustness.
With this objective in mind, we leverage the relaxed augmented Lagrangian based algorithms to prune the weights of adversarially trained
DNNs, at both structured and unstructured levels.
Using a Feynman-Kac formalism principled robust and sparse DNNs, we can at least double the channel sparsity of the adversarially trained ResNet20 for CIFAR10 classiﬁcation, meanwhile, improve the natural accuracy by 8 .
69 % and the robust accuracy under the benchmark 20 iterations of IFGSM attack by 5 .
I NTRODUCTION
Robust deep neural nets (DNNs) compression is a fundamental problem for secure AI applications in resource-constrained environments such as biometric veriﬁcation and facial login on mobile devices, and computer vision tasks for the internet of things (IoT) (Cheng et al., 2017; Yao et al., 2017;
Mohammadi et al., 2018).
Though compression and robustness have been separately addressed in recent years, much less is studied when both players are present and must be satisﬁed.
To date, many successful techniques have been developed to compress naturally trained DNNs, including neural architecture re-design or searching (Howard et al., 2017; Zhang et al., 2018b), pruning including structured (weights sparsiﬁcation) (Han et al., 2015; Srinivas & Babu, 2015) and unstructured (channel-, ﬁlter-, layer-wise sparsiﬁcation)
(Yang et al., 2019;
He et al., 2017), quantization (Zhou et al., 2017; Yin et al., 2019; Courbariaux et al., 2016), low-rank approximation (Denil et al., 2013), knowledge distillation (Polino et al., 2018), and many more (Alvarez & Salzmann, 2016; Liu et al., 2015).
[Figure]
The adversarially trained (AT) DNN is more robust than the naturally trained (NT) DNN to adversarial attacks (Madry et al., 2018; Athalye et al., 2018).
However, adversarial training (denoted as
AT if no ambiguity arises, and the same for NT) also dramatically reduces the sparsity of the trained
DNN’s weights.
As shown in Fig.
1, start from the same default initialization in PyTorch, the NT
ResNet20’s weights are much sparser than that of the AT counterpart, for instance, the percent of weights that have magnitude less than 10 − 3 for NT and AT ResNet20 are 8.66% and 3.64% (averaged over 10 trials), resp.
This observation motivates us to consider the following two questions:
Can we re-design the neural architecture with minimal change on top of the existing one such that the new DNN has sparser weights and better robustness and accuracy than the existing one?
Can we develop efﬁcient compression algorithms to compress the AT DNNs with minimal robustness and accuracy degradations?
We note that under the AT, the recently proposed Feynman-Kac formalism principled ResNet ensemble (Wang et al., 2019a) has much sparser weights than the standard ResNet, which gives a natural answer to the ﬁrst question above.
To answer the second question, we leverage state-of-the-art relaxed augmented Lagrangian based sparsiﬁcation algorithms (Dinh & Xin, 2018;
Yang et al., 2019) to perform both structured and unstructured pruning for the AT DNNs.
We focus on unstructured and channel pruning in this work.
1. N OTATION
Throughout this paper we use bold upper-case letters A , B to denote matrices, bold lower-case letters x , y to denote vectors, and lower case letters x , y and α , β to denote scalars.
For vector x = ( x 1 , . . .
, x d ) (cid:62) , we use (cid:107) x
(cid:107) =
(cid:107) x (cid:107) 2 = (cid:112) x 21 + · · · + x 2 d to represent its (cid:96) 2 -norm; (cid:107) x (cid:107) 1 = (cid:80) di =1 |
x
i | to represent its (cid:96) 1 -norm; and (cid:107) x (cid:107)
= (cid:80) di
=1 χ { x i (cid:54) =0 } to represent its (cid:96) 0 -norm.
For a function f : R d → R , we use ∇ f ( · ) to denote its gradient.
Generally, w t represents the set of all parameters of the network being discussed at iteration t , e.g. w t = ( w t 1 , w t 2 , ..., w tM ) , where w tj is the weight on the j th layer of the network at the t -th iteration.
Similarly, u t = ( u t 1 , u t 2 , ..., u tM ) is a set of weights with the same dimension as w t , whose value depends on w t and will be deﬁned below.
We use N ( 0 , I d × d ) to represent the d -dimensional Gaussian, and use notation O ( · ) to hide only absolute constants which do not depend on any problem parameter.
1. O RGANIZATION
This paper is organized in the following way: In section 2, we list the most related work to this paper.
In section 3, we show that the weights of the recently proposed Feynman-Kac formalism principled
ResNet ensemble are much sparser than that of the baseline ResNet, providing greater efﬁciency for compression.
In section 4, we present relaxed augmented Lagrangian-based algorithms along with theoretical analysis for both unstructured and channeling pruning of AT DNNs.
The numerical results are presented in section 5, followed by concluding remarks.
Technical proofs and more related results are provided in the appendix.
R ELATED W ORK
Compression of AT DNNs: Gui et al.
(2019) considered a low-rank form of the DNN weight matrix with (cid:96) 0 constraints on the matrix factors in the AT setting.
Their training algorithm is a projected gradient descent (PGD) (Madry et al., 2018) based on the worst adversary.
In their paper, the sparsity in matrix factors are unstructured and require additional memory.
Sparsity and Robustness: Guo et al.
(2018) shows that there is a relationship between the sparsity of weights in the DNN and its adversarial robustness.
They showed that under certain conditions, sparsity can improve the DNN’s adversarial robustness.
The connection between sparsity and robustness has also been studied recently by Ye et al.
, Rakin et al.
(2019), and et al.
In our paper, we focus on designing efﬁcient pruning algorithms integrated with sparse neural architectures to advance DNNs’ sparsity, accuracy, and robustness.
Feynman-Kac formalism principled Robust DNNs: Neural ordinary differential equations (ODEs) (Chen et al., 2018) are a class of DNNs that use an ODE to describe the data ﬂow of each input data.
Instead of focusing on modeling the data ﬂow of each individual input data, Wang et al.
(2019a; 2018a); Li & Shi (2017) use a transport equation (TE) to model the ﬂow for the whole input distribution.
In particular, from the TE viewpoint, Wang et al. (2019a) modeled training ResNet (He et al., 2016) as ﬁnding the optimal control of the following TE
[Equation]
, with T being the training set.
(1) where G ( x , w ( t )) encodes the architecture and weights of the underlying ResNet, u ( x , 0) serves as the classiﬁer, g ( x ) is the output activation of ResNet, and y i is the label of x i .
Wang et al.
(2019a) interpreted adversarial vulnerability of ResNet as arising from the irregularity of u ( x , 0) of the above TE.
To enhance u ( x , 0) ’s regularity, they added a diffusion term, 12 σ 2 ∆ u ( x , t ) , to the governing equation of (1) which resulting in the convection-diffusion equation (CDE).
By the
Feynman-Kac formula, u ( x , 0) of the CDE can be approximated by the following two steps:
• Modify ResNet by injecting Gaussian noise to each residual mapping.
• Average the output of n jointly trained modiﬁed ResNets, and denote it as En n ResNet.
Wang et al.
(2019a) have noticed that EnResNet can improve both natural and robust accuracies of the AT DNNs.
In this work, we leverage the sparsity advantage of EnResNet to push the sparsity limit of the AT DNNs.
R EGULARITY AND S PARSITY OF THE F EYNMAN -K AC F ORMALISM P RINCIPLED R OBUST DNN S ’ W EIGHTS
From a partial differential equation (PDE) viewpoint, a diffusion term to the governing equation (1) not only smooths u ( x , 0) , but can also enhance regularity of the velocity ﬁeld G ( x , w ( t ))
(Ladyˇzenskaja et al., 1988).
As a DNN counterpart, we expect that when we plot the weights of
EnResNet and ResNet at a randomly select layer, the pattern of the former one will look smoother than the latter one.
To validate this, we follow the same AT with the same parameters as that used in (Wang et al., 2019a) to train En 5 ResNet20 and ResNet20, resp.
After the above two robust models are trained, we randomly select and plot the weights of a convolutional layer of ResNet20 whose shape is 64 × 64 × 3 × 3 and plot the weights at the same layer of the ﬁrst ResNet20 in En 5 ResNet20.
As shown in Fig.
2 (a) and (b), most of En 5 ResNet20’s weights are close to 0 and they are more regularly distributed in the sense that the neighboring weights are closer to each other than ResNet20’s weights.
The complete visualization of this randomly selected layer’s weights is shown in the appendix.
As shown in Fig.
2 (c) and (d), the weights of En 5 ResNet20 are more concentrated at zero than that of ResNet20, and most of the En 5 ResNet20’s weights are close to zero.
[Figure]
U NSTRUCTURED AND C HANNEL P RUNING WITH AT 4. A LGORITHMS
In this subsection, we introduce relaxed, augmented Lagrangian-based, pruning algorithms to sparsify the AT DNNs.
The algorithms of interest are the Relaxed Variable-Splitting Method (RVSM)
(Dinh & Xin, 2018) for weight pruning (Algorithm 1), and its variation, the Relaxed Group-wise
Splitting Method (RGSM) (Yang et al., 2019) for channel pruning (Algorithm 2).
Our approach is to apply the RVSM/RGSM algorithm together with robust PGD training to train and sparsify the model from scratch.
Namely, at each iteration, we apply a PGD attack to generate adversarial images x (cid:48) , which are then used in the forward-propagation process to generate preditions y (cid:48) .
The back-propagation process will then compute the appropriate loss function and apply
RVSM/RGSM to update the model.
Previous work on RVSM mainly focused on a one-hidden layer setting; In this paper, we extend this result to the general setting.
To the best of our knowledge, this is the ﬁrst result that uses RVSM/RGSM in an adversarial training scenario.
To explain our choice of algorithm, we discuss a classical algorithm to promote sparsity of the target weights, the alternating direction of multiplier method (ADMM)
(Boyd et al., 2011; Goldstein & Osher, 2009).
In ADMM, instead of minimizing the original loss function f ( w ) , we seek to minimize the (cid:96) 1 regularized loss function, f ( w ) + λ (cid:107) u (cid:107) 1 , by considering
the following augmented
Lagrangian
[Equation]
which can be easily solved by applying the following iterations
[Equation]
Although widely used in practice, ADMM has several drawbacks when it is used to regularize
DNN’s weights.
First, one can improve the sparsity of the ﬁnal learned weights by replacing (cid:107) u (cid:107)with (cid:107) u (cid:107) 0 ; but (cid:107) · (cid:107) 0 is not differentiable, thus current theory of optimization does not apply (Wang et al., 2018b).
Second, the update w t +1 ← arg min w L β ( w , u t , z t ) is not a reasonable step in practice, as one has to fully know how f ( w ) behaves.
In most ADMM adaptation on DNN, this step is replaced by a simple gradient descent.
Third, the Lagrange multiplier term, (cid:104) z , w − u (cid:105) , seeks to close the gap between w t and u t , and this in turn reduces sparsity of u t .
The RVSM we will implement is a relaxation of ADMM.
RVSM drops the Lagrangian multiplier, and replaces λ (cid:107) u (cid:107) 1 with λ (cid:107) u (cid:107) 0 , and resulting in the following relaxed augmented Lagrangian
[Equation]
The above relaxed augmented Lagrangian can be solved efﬁciently by the iteration in Algorithm 1.
RVSM can resolve all the three issues associated with ADMM listed above in training robust DNNs with sparse weights: First, by removing the linear term (cid:104) z , w − u (cid:105) , one has a closed form formula for the update of u t without requiring (cid:107) u (cid:107) 0 to be differentiable.
Explicitly, u t = H √ 2 λ/β ( w t ) =
( w t 1 χ {| w 1 | > √ 2 λ/β } , ..., w td χ {| w 1 | > √ 2 λ/β } ) , where H α ( · ) is the hardthresholding operator with parameter α .
Second, the update of w t is a gradient descent step itself, so the theoretical guarantees will not deviate from practice.
Third, without the Lagrange multiplier term z t , there will be a gap between w t and u t at the limit (ﬁnally trained DNNs).
However, the limit of u t is much sparser than that in the case of ADMM.
At the end of each training epoch, we replace w t by u t for the validation process.
Numerical results in Section 5 will show that the AT DNN with parameters u t usually outperforms the traditional ADMM in both accuracy and robustness.
Input: η, β, λ , max epoch , max batch
Initialization: w
Deﬁne: u 0 = H √ 2 λ/β ( w 0 ) for t = 0 , 1 , 2 , ..., max epoch do for batch
= 1 , 2 , ..., max batch do w t +1 ← w t − η ∇ f ( w t ) − ηβ ( w t − u t )
u t +1 ← arg min u L β ( u , w t ) =
H √ 2 λ/β ( w t ) end for end for
Input : η, β, λ 1 , λ 2 , max epoch , max batch
Objective: ˜ f ( w ) =
f ( w ) + λ 2 (cid:107) w (cid:107) GL
Initialization: Initialize w 0 , deﬁne ufor g = 1 , 2 , ..., G do u 0 g = Prox λ 1 ( w 0 g ) end for for t = 0 , 1 , 2 , ..., max epoch do for batch
= 1 , 2 , ..., max batch do w t +1 =
w t − η ∇ ˜ f
( w t ) − ηβ ( w t − u t ) for g = 1 , 2 , ..., G do u t +1 g
=
Prox λ 1 ( w tg ) end for end for end for
RGSM is a method that generalizes RVSM to structured pruning, in particular, channel pruning.
Let w = { w 1 , ..., w g , ..., w G } be the grouped weights of convolutional layers of a DNN, where G is the total number of groups.
Let I g be the indices of w in group g .
The group Lasso (GLasso) penalty and group- (cid:96)
penalty (Yuan & Lin, 2007) are deﬁned as
[Equation]
and the corresponding Proximal (projection) operators are
[Equation]
where sgn ( w g ) :
= w g / (cid:107) w g (cid:107) 2 .
The RGSM method is described in Algorithm 2, which improves on adding group Lasso penalty directly in the objective function (Wen et al., 2016) for natural DNN training (Yang et al., 2019).
4. T HEORETICAL G UARANTEES
We propose a convergence analysis of the RVSM algorithm to minimize the Lagrangian (4).
Consider the following empirical adversarial risk minimization (EARM)
[Equation]
where the classiﬁer F ( · , w ) is a function in the hypothesis class H , e.g. ResNet and its ensembles, parametrized by w .
Here, L ( F ( x i , w ) , y i ) is the appropriate loss function associated with F on the data-label pair ( x i , y i ) , e.g. cross-entropy for classiﬁcation and root mean square error for regression problem.
Since our model is trained using PGD AT, let
[Equation]
where x (cid:48) is obtained by applying the PGD attack to the clean data x (Wang et al., 2019a;
Goodfellow et al., 2014a; Madry et al., 2018;
Na et al., 2018).
In a nutshell, f ( w ) is the population adversarial loss of the network parameterized by w = ( w 1 , w 2 , ..., w M ) .
Before proceeding, we ﬁrst make the following assumption:
Assumption 1.
Let w 1 , w 2 , ..., w M be the weights in the M layers of the given DNN, then there exists a positive constant L such that for all t ,
[Equation]
Assumption 1 is a weaker version of that made by Wang et al.
(2019b)
; Sinha et al.
(2018), in which the empirical adversarial loss function is smooth in both the input x and the parameters w .
Here we only require the population adversarial loss f to be smooth in each layer of the DNN in the region of iterations.
An important consequence of Assumption 1 is
[Equation]
Theorem 1.
Under the Assumption 1, suppose also that the RVSM algorithm is initiated with a small stepsize η such that η < 2 β + L .
Then the Lagrangian L β ( w t , u t ) decreases monotonically and converges sub-sequentially to a limit point ( ¯ w , ¯ u ) .
The proof of Theorem 1 is provided in the Appendix.
From the descent property of L β ( w t , u t ) , classical results from optimization (Nesterov, 2014) can be used to show that after T
= O (1 /(cid:15) 2 ) iterations, we have ∇ w t L β ( w t , u t )
=
O ( (cid:15) ) , for some t ∈ (0 , T ] .
The term (cid:107) u (cid:107) 0 promotes sparsity and β 2 (cid:107) w − u (cid:107) 2 helps keep w close to u .
Since u = H √ 2 λ/β ( w ) , it follows that ¯ w will have lots of very small (and thus negligible) components.
This result justiﬁes the sparsity in the limit ¯ u .
N UMERICAL R ESULTS
In this section, we verify the following advantages of the proposed algorithms:
• RVSM/RGSM is efﬁcient for unstructured/channel-wise pruning for the AT DNNs.
• After pruning by RVSM and RGSM, EnResNet’s weights are signiﬁcantly sparser than the baseline ResNet’s, and more accurate in classifying both natural and adversarial images.
These two merits lead to the fact that a synergistic integration of RVSM/RGSM with the FeynmanKac formula principled EnResNet enables sparsity to meet robustness.
We perform AT by PGD integrated with RVSM, RGSM, or other sparsiﬁcation algorithms on-theﬂy.
For all the experiments below, we run 200 epochs of the PGD ( 10 iterations of the iterative fast gradient sign method (IFGSM 10 ) with α = 2 / 255 and (cid:15) = 8 / 255 , and an initial random perturbation of magnitude (cid:15) ).
The initial learning rate of 0 .
1 decays by a factor of 10 at the 80 th, 120 th, and 160 th epochs, and the RVSM/RGSM/ADMM sparsiﬁcation takes place in the back-propagation stage.
We split the training data into 45 K/ 5 K for training and validation, and the model with the best validation accuracy is used for testing.
We test the trained models on the clean images and attack them by
FGSM, IFGSM 20 , and C&W with the same parameters as that used in (Wang et al., 2019a; Zhang et al., 2019; Madry et al., 2018).
We denote the accuracy on the clean images and under the FGSM,
IFGSM 20 (Goodfellow et al., 2014b), C&W (Carlini & Wagner, 2016), and NAttack (Li et al., 2019)attacks as A 1 , A 2 , A 3 , A 4 , and A 5 , resp.
A brief introduction of these attacks is available in the appendix.
We use both sparsity and channel sparsity to measure the performance of the pruning algorithms, where the sparsity is deﬁned to be the percentage of zero weights; the channel sparsity is the percentage of channels whose weights’ (cid:96) 2 norm is less than 1 E − 15 .
5. M ODEL C OMPRESSION FOR AT R ES N ET AND E N R ES N ETS
First, we show that RVSM is efﬁcient to sparsify ResNet and EnResNet.
Table 1 shows the accuracies of ResNet20 and En 2 ResNet20 under the unstructured sparsiﬁcation with different sparsity controlling parameter β .
We see that after the unstructured pruning by RVSM, En 2 ResNet20 has much sparser weights than ResNet20.
Moreover, the sparsiﬁed En 2 ResNet20 is remarkably more accurate and robust than ResNet20.
For instance, when β = 0 .
5 , En 2 ResNet20’s weights are 16 .
42 % sparser than ResNet20’s ( 56 .
34 % vs. 39 .
Meanwhile, En 2 ResNet20 boost the natural and robust accuracies of ResNet20 from 74 .
67 %, and 57 .
24 % to 78 .
54 %, and 65 . 57 %, resp.
We perform a few independent trials, and the random effects is small.
[Table]
Second, we verify the effectiveness of RGSM in channel pruning.
We lists the accuracy and channel sparsity of ResNet20, En 2 ResNet20, and En 5 ResNet20 in Table 2.
Without any sparsiﬁcation,
En 2 ResNet20 improves the four type of accuracies by 4.27% (76.07% vs. 80.34%), 5.87% (51.24% vs. 57.11%), 2.77% (47.25% vs. 50.02%), and 7.47% (59.30% vs. 66.77%), resp.
When we set β = 1 , λ 1 = 5 e − 2 , and λ 2 = 1 e − 5 , after channel pruning both natural and robust accuracies of
ResNet20 and En 2 ResNet20 remain close to the unsparsiﬁed models, but En 2 ResNet20’s weights are 33.48% (41.48% vs. 8%) sparser than that of ResNet20’s.
When we increase the channel sparsity level by increasing λ 1 to 1 e − 1 , both the accuracy and channel sparsity gaps between ResNet20 and
En 2 ResNet20 are enlarged.
En 5 ResNet20 can future improve both natural and robust accuracies on top of En 2 ResNet20.
For instance, at ∼ 55% (53.36% vs. 56.74%) channel sparsity, En 5 ResNet can improve the four types of accuracy of En 2 ResNet20 by 4.66% (80.53% vs. 75.87%), 2.73% (57.38% vs. 54.65%), 2.86% (50.63% vs. 47.77%), and 1.11% (66.52% vs. 65.41%), resp.
[Table]
Third, we show that an ensemble of small ResNets via the Feynman-Kac formalism performs better than a larger ResNet of roughly the same size in accuracy, robustness, and sparsity.
We
AT En 2 ResNet20 ( ∼ 0 .
54 M parameters) and ResNet38 ( ∼ 0 .
56 M parameters) with and without channel pruning.
As shown in Table 3, under different sets of parameters, after RGSM pruning,
En 2 ResNet20 always has much more channel sparsity than ResNet38, also much more accurate and robust.
For instance, when we set β = 1 , λ 1 = 5 e − 2 , and λ 2 = 1 e − 5 , the AT ResNet38 and
En 2 ResNet20 with channel pruning have channel sparsity 17.67% and 41.48%, resp.
Meanwhile,
En 2 ResNet20 outperforms ResNet38 in the four types of accuracy by 0.36% (78.28% vs. 77.92%), 3.02% (56.53% vs. 53.51%), 0.23% (49.58% vs. 49.35%), and 6.34% (66.56% vs. 60.32%), resp.
When we increase λ 1 , the channel sparsity of two nets increase.. As shown in Fig.
3, En 2 ResNet20’s channel sparsity growth much faster than ResNet38’s, and we plot the corresponding four types of accuracies of the channel sparsiﬁed nets in Fig. 4.
[Table]
a 78.
En 2 ResNet  5.E1.E78.
ResNet  5.E1.E77.
En 2 ResNet  1.E1.E76.
ResNet  1.E1.E72.
[Figure]
[Table]
5. RVSM/RGSM VERSUS ADMM
In this subsection, we will compare RVSM, RGSM, and ADMM (Zhang et al., 2018a) 2 for unstructured and channel pruning for the AT ResNet20, and we will show that RVSM and RGSM iterations can promote much higher sparsity with less natural and robust accuracies degradations than ADMM.
We list both natural/robust accuracies and sparsities of ResNet20 after ADMM, RVSM, and RGSM pruning in Table 4.
For unstructured pruning, ADMM retains slightly better natural ( ∼ 1 . 3 %) and robust ( ∼ 0 .
7 %, ∼ 0 .
5 %, and 0 .
2 % under FGSM, IFGSM 20 , and C&W attacks) accuracies.
However, RVSM gives much better sparsity ( 80 . 91 % vs. 10 . 89 %).
In the channel pruning scenario,
RVSM signiﬁcantly outperforms ADMM in all criterion including natural and robust accuracies and channel sparsity, as the accuracy gets improved by at least 5 .
19 % and boost the channel sparsity from 4 .
44 % to 25 .
Part of the reason for ADMM’s inefﬁciency in sparsifying DNN’s weights is due to the fact that the ADMM iterations try to close the gap between the weights w t and the auxiliary variables u t , so the ﬁnal result has a lot of weights with small magnitude, but not small enough to be regarded as zero (having norm less than 1e-15).
The RVSM does not seek to close this gap, instead it replaces the weight w t by u t , which is sparse, after each epoch.
This results in a much sparser ﬁnal result, as shown in Figure 5: ADMM does result in a lot of channels with small norms; but to completely prune these off, RVSM does a better job.
Here, the channel norm is deﬁned to be the (cid:96) 2 norm of the weights in each channel of the DNN (Wen et al., 2016).
[Figure]
5. B EYOND R ES N ET E NSEMBLE AND B EYOND CIFAR 5. B EYOND R ES N ET E NSEMBLE
In this part, we show that the idea of average over noise injected ResNet generalizes to other types of DNNs, that is, the natural and robust accuracies of DNNs can be improved by averaging over noise injections.
As a proof of concept, we remove all the skipping connections in ResNet20 and
En 2 ResNet20, in this case, the model no longer involves a TE and CDE.
As shown in Table 5, removing the skip connection degrades the performance signiﬁcantly, especially for En 2 ResNet (all the four accuracies of the AT En 2 ResNet20 reduces more than the AT ResNet20’s).
These results conﬁrm that skip connection is crucial, without it the TE model assumption breaks down, and the utility of EnResNets reduces.
However, the ensemble of noise injected DNNs still improves the performance remarkably.
[Table]
Next, let us consider the sparsity, robustness, and accuracies of ResNet20 and En 2 ResNet20 without any skip connection, when they are AT using weights sparsiﬁcation by either RVSM or RGSM.
For RVSM pruning, we set β
= 5 E − 2 and λ = 1 E − 6 ; for RGSM channel pruning, we set β
= 5 E − 2 , λ 1 = 5 E − 2 , and λ 2 = 1 E − 5 .
We list the corresponding results in Table 6.
We see that under both RVSM and RGSM pruning, En 2 ResNet20 is remarkably more accurate on both clean and adversarial images, and signiﬁcantly sparser than ResNet20.
When we compare the results in Table 6 with that in Tables 1 and 2, we conclude that once we remove the skip connections, the sparsity, robustness, and accuracy degrades dramatically.
[Table]
5. B EYOND CIFAR
Besides CIFAR10, we further show the advantage of EnResNet + RVSM/RGSM in compressing and improving accuracy/robustness of the AT DNNs for CIFAR100 classiﬁcation.
We list the natural and robust accuracies and channel sparsities of the AT ResNet20 and En 2 ResNet20 with different
RGSM parameters (n/a stands for do not perform channel pruning) in Table 7.
For λ 1 = 0 . 05 ,
RGSM almost preserves the performance of the DNNs without channel pruning, while improving channel sparsity by 7 .
11 % for ResNet20, and 16 .
89 % for En 2 ResNet20.
As we increase λ 1 to 0.1, the channel sparsity becomes 18 .
37 % for ResNet20 and 39 .
23 % for En 2 ResNet20.
Without any channel pruning, En 2 ResNet20 improves natural accuracy by 4 .
68 % vs. 46 .
02 %), and robust accuracies by 5 .
25 % ( 30 . 2 % vs. 24 .
02 % ( 26 . 25 % vs. 23 .
23 %), and 7 .
06 % vs. 32 .
42 %), resp., under the FGSM, IFGSM 20 , and C&W attacks.
Even in very high channel sparsity scenario ( λ 1 = 0 . 05 ), En 2 ResNet20 still dramatically increase A 1 , A 2 , A 3 , and
A 4 by 2 .
90 %, 4 . 31 %, 1 . 89 %, and
5 . 86 %, resp.
These results are similar to the one obtained on the CIFAR10 in Table 2.
These results further conﬁrm that RGSM together with the Feynman-Kac formalism principled ResNets ensemble can signiﬁcantly improve both natural/robust accuracy and sparsity on top of the baseline ResNets.
C ONCLUDING R EMARKS
The Feynman-Kac formalism principled AT EnResNet’s weights are much sparser than the baseline
ResNet’s.
Together with the relaxed augmented Lagrangian based unstructured/channel pruning
[Table]
algorithms, we can compress the AT DNNs much more efﬁciently, meanwhile signiﬁcantly improves both natural and robust accuracies of the compressed model.
As future directions
[Table]
we propose to quantize EnResNets and to integrate neural ODE into our framework
[Table]
A P ROOF OF T HEOREM
By the arg min update of u t , L β ( w t +1 , u t +1 ) ≤ L β ( w t +1 , u t ) .
It remains to show
L β ( w t +1 , u t ) ≤ L β ( w t , u t ) .
To this end, we show
[Equation]
the conclusion then follows by a repeated argument.
Notice the only change occurs in the ﬁrst layer w t 1 .
For simplicity of notation, only for the following chain of inequality
[Equation]
let w t
=
( w t 1 , ..., w tM ) and w t +1 = ( w t +11 , w t 2 , ..., w tM ) .
Then for a ﬁxed u :=
u t
[Equation]
we have
[Equation]
Thus, when η ≤ 2 β + L , we have L β ( w t +1 , u ) ≤ L β ( w t , u ) .
Apply the above argument repeatedly, we arrive at
[Equation]
This implies L β ( w t , u t ) decreases monotonically.
Since L β ( w t , u t ) ≥ 0 , ( w t , u t ) must converge sub-sequentially to a limit point ( ¯ w , ¯ u ) .
This completes the proof.
B A DVERSARIAL A TTACKS U SED IN T HIS W ORK
We focus on the (cid:96) ∞ norm based untargeted attack.
For a given image-label pair { x , y } , a given ML model F ( x , w ) , and the associated loss L ( x , y ) :
= L ( F ( x , w ) , y ) :
• Fast gradient sign method (FGSM) searches an adversarial, x (cid:48) , within an (cid:96) ∞ -ball as x (cid:48)
=
x + (cid:15) · sign ( ∇ x L ( x , y )) .
• Iterative FGSM (IFGSM M )
(Goodfellow et al., 2014b) iterates FGSM and clip the range as x ( m )
=
Clip x ,(cid:15) (cid:110) x
( m − 1) + α · sign (cid:16) ∇ x ( m − 1) L ( x ( m − 1) , y ) (cid:17)(cid:111) , w/ x (0) =
x , m = 1 , · · · , M. • C&W attack (Carlini & Wagner, 2016) searches the minimal perturbation ( δ ) attack as min
δ || δ || ∞ , subject to F ( w , x + δ ) =
t, x + δ ∈ [0 , 1] d , for ∀ t (cid:54) =
y. • NAttack (Li et al., 2019) is an effective gradient-free attack.
C M ORE V ISUALIZATIONS OF THE DNN S ’ W EIGHTS
In section 3, we showed some visualization results for part of the weights of a randomly selected convolutional layer of the AT ResNet20 and En 5 ResNet20.
The complete visualization results of this selected layer are shown in Figs.
6 and 7, resp., for ResNet20 and En 5 ResNet20.
These plots further veriﬁes that:
• The magnitude of the weights of the adversarially trained En 5 ResNet20 is signiﬁcantly smaller than that of the robustly trained ResNet20.
• The overall pattern of the weights of the adversarially trained En 5 ResNet20 is more regular than that of the robustly trained ResNet20.
[Figure] [Figure]