G ENERALIZABLE A DVERSARIAL T RAINING VIA S PECTRAL N ORMALIZATION
Anonymous authors
Paper under double-blind review
A BSTRACT
Deep neural networks (DNNs) have set benchmarks on a wide array of supervised learning tasks.
Trained DNNs, however, often lack robustness to minor adversarial perturbations to the input, which undermines their true practicality.
Recent works have increased the robustness of DNNs by ﬁtting networks using adversarially-perturbed training samples, but the improved performance can still be far below the performance seen in non-adversarial settings.
A signiﬁcant portion of this gap can be attributed to the decrease in generalization performance due to adversarial training.
In this work, we extend the notion of margin loss to adversarial settings and bound the generalization error for DNNs trained under several well-known gradient-based attack schemes, motivating an effective regularization scheme based on spectral normalization of the DNN’s weight matrices.
We also provide a computationally-efﬁcient method for normalizing the spectral norm of convolutional layers with arbitrary stride and padding schemes in deep convolutional networks.
We evaluate the power of spectral normalization extensively on combinations of datasets, network architectures, and adversarial training schemes.
I NTRODUCTION
Despite their impressive performance on many supervised learning tasks, deep neural networks (DNNs) are often highly susceptible to adversarial perturbations imperceptible to the human eye (Szegedy et al., 2013; Goodfellow et al., 2014b).
These “adversarial attacks" have received enormous attention in the machine learning literature over recent years (Goodfellow et al., 2014b; Moosavi Dezfooli et al., 2016; Carlini & Wagner, 2016; Kurakin et al., 2016; Papernot et al., 2016; Carlini &
Wagner, 2017; Papernot et al., 2017; Madry et al., 2018; Tramèr et al., 2018).
Adversarial attack studies have mainly focused on developing effective attack and defense schemes.
While attack schemes attempt to mislead a trained classiﬁer via additive perturbations to the input, defense mechanisms aim to train classiﬁers robust to these perturbations.
Although existing defense methods result in considerably better performance compared to standard training methods, the improved performance can still be far below the performance in non-adversarial settings (Athalye et al., 2018; Schmidt et al., 2018).
A standard adversarial training scheme involves ﬁtting a classiﬁer using adversarially-perturbed samples (Szegedy et al., 2013; Goodfellow et al., 2014b) with the intention of producing a trained classiﬁer with better robustness to attacks on future (i.e. test) samples.
Madry et al.
(2018) provides a robust optimization interpretation of the adversarial training approach, demonstrating that this strategy ﬁnds the optimal classiﬁer minimizing the average worst-case loss over an adversarial ball centered at each training sample.
This minimax interpretation can also be extended to distributionally-robust training methods (Sinha et al., 2018) where the offered robustness is over a Wasserstein-ball around the empirical distribution of training data.
Recently, Schmidt et al.
(2018) have shown that standard adversarial training produces networks that generalize poorly.
The performance of adversarially-trained DNNs over test samples can be signiﬁcantly worse than their training performance, and this gap can be far greater than the generalization gap achieved using standard empirical risk minimization (ERM).
This discrepancy suggests that the overall adversarial test performance can be improved by applying effective regularization schemes during adversarial training.
[Figure]
In this work, we propose using spectral normalization (SN) (Miyato et al., 2018) as a computationallyefﬁcient and statistically-powerful regularization scheme for adversarial training of DNNs.
SN has been successfully implemented and applied for DNNs in the context of generative adversarial networks (GANs) (Goodfellow et al., 2014a), resulting in state-of-the-art deep generative models for several benchmark tasks (Miyato et al., 2018).
Moreover, SN (Tsuzuku et al., 2018) and other similar Lipschitz regularization techniques (Cisse et al., 2017) have been successfully applied in non-adversarial training settings to improve the robustness of ERM-trained networks to adversarial attacks.
The theoretical results in (Bartlett et al., 2017; Neyshabur et al., 2017a) and empirical results in (Yoshida & Miyato, 2017) also suggest that SN can close the generalization gap for DNNs in non-adversarial ERM setting.
On the theoretical side, we ﬁrst extend the standard notion of margin loss to adversarial settings.
We then leverage the PAC-Bayes generalization framework (McAllester, 1999) to prove generalization bounds for spectrally-normalized DNNs in terms of our deﬁned adversarial margin loss.
Our approach parallels the approach used by Neyshabur et al.
(2017a) to derive generalization bounds in non-adversarial settings.
We obtain adversarial generalization error bounds for three well-known gradient-based attack schemes: fast gradient method (FGM) (Goodfellow et al., 2014b), projected gradient method (PGM) (Kurakin et al., 2016;
Madry et al., 2018), and Wasserstein risk minimization (WRM) (Sinha et al., 2018).
Our theoretical analysis shows that the adversarial generalization component will vanish by applying SN to all layers for sufﬁciently small spectral norm values.
On the empirical side, we show that SN can signiﬁcantly improve test performance after adversarial training.
We perform numerical experiments for three standard datasets (MNIST, CIFAR-10, SVHN) and various standard DNN architectures (including AlexNet (Krizhevsky et al., 2012), Inception (Szegedy et al., 2015), and ResNet (He et al., 2016)); in almost all of the experiments we obtain a better test performance after applying SN.
Figure 1 shows the training and validation performance for AlexNet ﬁt on the CIFAR10 dataset using FGM, PGM, and WRM, resulting in adversarial test accuracy improvements of 9 , 11 , and 4 percent, respectively.
To perform our numerical experiments, we develop a computationally-efﬁcient approach for normalizing the spectral norm of convolution layers with arbitrary stride and padding schemes.
To summarize, the main contributions of this work are:
Proposing SN as a regularization scheme for adversarial training of DNNs, 2.
Extending concepts of margin-based generalization analysis to adversarial settings and proving margin-based generalization bounds for three gradient-based adversarial attack schemes, 3.
Developing an efﬁcient method for normalizing the spectral norm of convolutional layers in deep convolution networks, 4.
Numerically demonstrating the improved test and generalization performance of DNNs trained with SN.
P RELIMINARIES
In this section, we ﬁrst review some standard concepts of margin-based generalization analysis in learning theory.
We then extend these notions to adversarial training settings.
2. S UPERVISED LEARNING , D EEP NEURAL NETWORKS , G ENERALIZATION ERROR
Consider samples { ( x 1 , y 1 ) , . .
, ( x n , y n ) } drawn i.i.d from underlying distribution P X ,Y .
We suppose X ∈ X and Y ∈ { 1 , 2 , . . .
, m } where m represents the number of different labels.
Given loss function (cid:96) and function class F = { f w , w ∈ W} parameterized by w , a supervised learner aims to ﬁnd the optimal function in F minimizing the expected loss (risk) averaged over the underlying distribution P .
We consider F nn as the class of d -layer neural networks with h hidden units per layer and activation functions σ : R → R .
Each f w : X → R m in F nn maps a data point x to an m -dimensional vector.
Speciﬁcally, we can express each f w ∈ F nn as f w ( x ) =
W d σ ( W d − 1 · · · σ ( W 1 x ) · · · )) .
We use (cid:107) W i (cid:107) 2 to denote the spectral norm of matrix W i , deﬁned as the largest singular value of W i , and (cid:107) W i (cid:107) F to denote W
i ’s Frobenius norm.
A classiﬁer f w ’s performance over the true distribution of data can be different from the training performance over the empirical distribution of training samples ˆ P .
The difference between the empirical and true averaged losses, evaluated on respectively training and test samples, is called the generalization error.
Similar to Neyshabur et al.
(2017a), we evaluate a DNN’s generalization performance using its expected margin loss deﬁned for margin parameter γ > 0 as
[Equation]
where f w ( X )[ j ] denotes the j th entry of f w ( X ) ∈ R m .
For a given data point X , we predict the label corresponding to the maximum entry of f w ( X ) .
Also, we use (cid:98) L γ ( f w ) to denote the empirical margin loss averaged over the training samples.
The goal of margin-based generalization analysis is to provide theoretical comparison between the true and empirical margin risks.
2. A DVERSARIAL ATTACKS , A DVERSARIAL TRAINING
A supervised learner observes only the training samples and hence does not know the true distribution of data.
Then, a standard approach to train a classiﬁer is to minimize the empirical expected loss (cid:96) over function class F = { f w : w ∈ W} , which is
[Equation]
This approach is called empirical risk minimization (ERM).
For better optimization performance, the loss function (cid:96) is commonly chosen to be smooth.
Hence, 0-1 and margin losses are replaced by smooth surrogate loss functions such as the cross-entropy loss.
However, we still use the margin loss as deﬁned in (1) for evaluating the test and generalization performance of DNN classiﬁers.
While ERM training usually achieves good performance over DNNs, several recent observations reveal that adding some adversarially-chosen perturbation to each sample can signiﬁcantly drop the trained DNN’s performance.
Given norm function (cid:107) · (cid:107) and adversarial noise power (cid:15) > 0 , the adversarial additive noise for sample ( x , y ) and classiﬁer f w is deﬁned to be
[Equation]
To provide adversarial robustness against the above attack scheme, a standard technique, which is called adversarial training, follows ERM training over the adversarially-perturbed samples by solving
[Equation]
Nevertheless, (3) and hence (4) are generally non-convex and intractable optimization problems.
Therefore, several schemes have been proposed in the literature to approximate the optimal solution of (3).
In this work, we analyze the generalization performance of the following three gradient-based methods for approximating the solution to (3).
We note that several other attack schemes such as DeepFool (Moosavi Dezfooli et al., 2016), CW attacks (Carlini & Wagner, 2017), target and least-likely attacks (Kurakin et al., 2016) have been introduced and examined in the literature, which can lead to interesting future directions for this work.
Fast Gradient Method (FGM) (Goodfellow et al., 2014b): FGM approximates the solution to (3) by considering a linearized DNN loss around a given data point.
Hence, FGM perturbs ( x , y ) by adding the following noise vector:
[Equation]
For the special case of (cid:96) ∞ -norm (cid:107) · (cid:107) ∞ , the above representation of FGM recovers the fast gradient sign method (FGSM) where each data point ( x , y ) is perturbed by the (cid:15) -normalized sign vector of the loss’s gradient.
For (cid:96) 2 -norm (cid:107) · (cid:107) 2 , we similarly normalize the loss’s gradient vector to have (cid:15)
Euclidean norm.
Projected Gradient Method (PGM) (Kurakin et al., 2016):
PGM is the iterative version of
FGM and applies projected gradient descent to solve (3).
PGM follows the following update rules for a given r number of steps:
[Equation]
Here, we ﬁrst ﬁnd the direction ν
( i ) w along which the loss at the i th perturbed point changes the most,
and then we move the perturbed point along this direction by stepsize α followed by projecting the resulting perturbation onto the set { δ : (cid:107) δ (cid:107) ≤ (cid:15) } with (cid:15) -bounded norm.
Wasserstein Risk Minimization (WRM) (Sinha et al., 2018):
WRM solves the following variant of (3) for data-point ( x , y ) where the norm constraint in (3) is replaced by a norm-squared
Lagrangian penalty term:
[Equation]
As discussed earlier, the optimization problem (3) is generally intractable.
However, in the case of
Euclidean norm (cid:107) · (cid:107) 2 , if we assume ∇ x (cid:96) ( f w ( x ) , y ) ’s
Lipschitz constant is upper-bounded by λ , then
WRM optimization (7) results in solving a convex optimization problem and can be efﬁciently solved using gradient methods.
To obtain efﬁcient adversarial defense schemes, we can substitute δ fgm w , δ pgm w , or δ wrm w for δ adv w in (4).
Instead of ﬁtting the classiﬁer over true adversarial examples, which are NP-hard to obtain, we can instead train the DNN over FGM, PGM, or WRM-adversarially perturbed samples.
2. A DVERSARIAL GENERALIZATION ERROR
The goal of adversarial training is to improve the robustness against adversarial attacks on not only the training samples but also on test samples; however, the adversarial training problem (4) focuses only on the training samples.
To evaluate the adversarial generalization performance, we extend the notion of margin loss deﬁned earlier in (1) to adversarial training settings by deﬁning the adversarial margin loss as
[Equation]
Here, we measure the margin loss over adversarially-perturbed samples, and we use (cid:98) L adv γ ( f w ) to denote the empirical adversarial margin loss.
We also use L fgm γ ( f w ) , L pgm γ ( f w ) , and L wrm γ ( f w ) to denote the adversarial margin losses with FGM (5), PGM (6), and WRM (7) attacks, respectively.
M ARGIN - BASED ADVERSARIAL G ENERALIZATION BOUNDS
As previously discussed, generalization performance can be different between adversarial and nonadversarial settings.
In this section, we provide generalization bounds for DNN classiﬁers under adversarial attacks in terms of the spectral norms of the trained DNN’s weight matrices.
The bounds motivate regularizing these spectral norms in order to limit the DNN’s capacity and improve its generalization performance under adversarial attacks.
We use the PAC-Bayes framework (McAllester, 1999; 2003) to prove our main results.
To derive adversarial generalization error bounds for DNNs with smooth activation functions σ , we ﬁrst extend a recent result on the margin-based generalization bound for the ReLU activation function (Neyshabur et al., 2017a) to general 1 -Lipschitz activation functions.
Theorem 1.
Consider F nn = { f w : w ∈ W } the class of d hidden-layer neural networks with h units per hidden-layer with 1 -Lipschitz activation σ satisfying σ (0) = 0 .
Suppose that X , X ’s support set, is norm-bounded as (cid:107) x (cid:107) 2 ≤ B, ∀ x ∈ X .
Also assume for constant M ≥ 1 any f w ∈ F nn satisﬁes
[Equation]
Here β w denotes the geometric mean of f w ’s spectral norms across all layers.
Then, for any η, γ > 0 , with probability at least 1 − η for any f w ∈ F nn we have:
[Equation]
where we deﬁne complexity score
Φ erm
[Equation]
Proof.
We defer the proof to the Appendix.
The proof is a slight modiﬁcation of Neyshabur et al.
(2017a)’s
proof of the same result for ReLU activation.
We now generalize this result to adversarial settings where the DNN’s performance is evaluated under adversarial attacks.
We prove three separate adversarial generalization error bounds for FGM, PGM, and WRM attacks.
For the following results, we consider F nn , the class of neural nets deﬁned in Theorem 1.
Moreover, we assume that the training loss (cid:96) (ˆ y, y ) and its ﬁrst-order derivative are 1 -Lipschitz.
Similar to Sinha et al.
(2018), we assume the activation σ is smooth and its derivative σ (cid:48) is 1 -Lipschitz.
This class of activations include ELU (Clevert et al., 2015) and tanh functions but not the ReLU function.
However, our numerical results in Table 1 from the Appendix suggest similar generalization performance between ELU and ReLU activations.
Theorem 2.
Consider F nn , X in Theorem 1 and training loss function (cid:96) satisfying the assumptions stated above.
We consider an FGM attack with noise power (cid:15) according to Euclidean norm (cid:107) · (cid:107) 2 .
For any f w ∈ F nn assume κ ≤ (cid:107)∇ x (cid:96) (cid:0) f w ( x ) , y (cid:1) (cid:107) 2 holds for constant κ > 0 , any y ∈ Y , and any x ∈ B (cid:15), (cid:107)·(cid:107)
( X ) (cid:15) -close to X ’s support set.
Then, for any η, γ > 0 with probability 1 − η the following bound holds for the FGM margin loss of any f w ∈ F nn
L fgm0 ( f w ) ≤ (cid:98)
L fgm γ ( f w ) + O (cid:18)(cid:115)
( B + (cid:15) ) 2 d 2 h log( dh )
Φ fgm (cid:15),κ ( f w ) + d log dn log M η γ 2 n (cid:19) , where Φ fgm (cid:15),κ ( f w ) :=
(cid:8)(cid:81) di =1 (cid:107) W
i (cid:107) 2 (1+( (cid:15)/κ )( (cid:81) di =1 (cid:107) W i (cid:107) 2 ) (cid:80) di
=1 (cid:81) ij =1 (cid:107) W j (cid:107) 2 ) (cid:9) 2 (cid:80) di
=1 (cid:107) W
i (cid:107) 2 F (cid:107) W i (cid:107) 22 .
Proof.
We defer the proof to the Appendix.
Note that the above theorem assumes that the change rate for the loss function around test samples is at least κ , which gives a baseline for measuring the attack power (cid:15) .
In our numerical experiments, we validate this assumption over standard image recognition tasks.
Next, we generalize this result to adversarial settings with PGM attack, i.e. the iterative version of FGM attack.
Theorem 3.
Consider F nn , X and training loss function (cid:96) for which the assumptions in Theoremhold.
We consider a PGM attack with noise power (cid:15) given Euclidean norm (cid:107) · (cid:107) 2 , r iterations for attack, and stepsize α .
Then, for any η, γ > 0 with probability 1 − η the following bound applies to the PGM margin loss of any f w ∈ F nn
[Equation]
Here we deﬁne Φ pgm (cid:15),κ,r,α ( f w ) as the following expression
[Equation]
where lip( ∇ [Equation] f
[Equation]
=
[Equation]
W j (cid:107) 2 provides an upper-bound on the Lipschitz constant of ∇ x (cid:96) ( f w (cid:0) x ) , y (cid:1) .
Proof.
We defer the proof to the Appendix.
In the above result, notice that if lip( ∇ (cid:96) ◦ f w ) /κ <
1 / (2 α ) then for any number of gradient steps the
PGM margin-based generalization bound will grow the FGM generalization error bound in Theorem 2 by factor 1 / (cid:0) 1 − (2 α/κ )lip( ∇ (cid:96) ◦ f w ) (cid:1) .
We next extend our adversarial generalization analysis to
WRM attacks.
Theorem 4.
For neural net class F nn and training loss (cid:96) satisfying Theorem 2’s assumptions, consider a WRM attack with Lagrangian coefﬁcient
λ and Euclidean norm (cid:107) · (cid:107) 2 .
Given parameter 0 < τ < 1 , assume lip( ∇ (cid:96) ◦ f w ) deﬁned in Theorem 3 is upper-bounded by λ (1 − τ ) for any f w ∈ F nn .
For any η > 0 , the following WRM margin-based generalization bound holds with probability 1 − η for any f w ∈ F nn : L wrm0 ( f w ) ≤ (cid:98) L wrm γ
[Equation]
where we deﬁne Φ wrm λ
[Equation]
f
[Equation]
[Table]
Proof.
We defer the proof to the Appendix.
As discussed by Sinha et al.
(2018), the condition lip( ∇ (cid:96) ◦ f w ) <
λ for the actual Lipschitz constant of ∇ (cid:96) ◦
f w is in fact required to guarantee WRM’s convergence to the global solution.
Notice that the WRM generalization error bound in Theorem 4 is bounded by the product of
[Table]
and the FGM generalization bound in Theorem 2.
S PECTRAL NORMALIZATION OF CONVOLUTIONAL LAYERS
To control the Lipschitz constant of our trained network, we need to ensure that the spectral norm associated with each linear operation in the network does not exceed some pre-speciﬁed β .
For fully-connected layers (i.e. regular matrix multiplication), please see Appendix B. For a general class of linear operations including convolution, Tsuzuku et al. (2018) propose to compute the operation’s spectral norm through computing the gradient of the Euclidean norm of the operation’s output.
Here, we leverage the deconvolution operation to further simplify and accelerate computing the spectral norm of the convolution operation.
Additionally, Sedghi et al.
(2018) develop a method for computing all the singular values including the largest one, i.e. the spectral norm.
While elegant, the method only applies to convolution ﬁlters with stride 1 and zero-padding.
However, in practice the normalization factor depends on the stride size and padding scheme governing the convolution operation.
Here we develop an efﬁcient approach for computing the maximum singular value, i.e. spectral norm, of convolutional layers with arbitary stride and padding schemes.
Note that, as also discussed by Gouk et al.
(2018), the i th convolutional layer output feature map ψ i is a linear operation of the input X :
[Equation]
where X has M feature maps, F i,j is a ﬁlter, and (cid:63) denotes the convolution operation (which also encapsulates stride size and padding scheme).
For simplicity, we ignore the additive bias terms here.
By vectorizing X and letting V i,j represent the overall linear operation associated with F i,j , we see that
[Equation]
and therefore the overall convolution operation can be described using
[Equation]
While explicitly reconstructing W is expensive, we can still compute σ ( W ) , the spectral norm of W , by leveraging the convolution transpose operation implemented by several modern-day deep learning packages.
This allows us to efﬁciently performs matrix multiplication with W T without explicitly constructing W .
Therefore we can approximate σ ( W ) using a modiﬁed version of power iteration (Algorithm 1), wrapping the appropriate stride size and padding arguments into the convolution and convolution transpose operations.
After obtaining σ ( W ) , we compute W SN in the same manner as for the fully-connected layers.
Like Miyato et al.
, we exploit the fact that SGD only makes small updates to W from training step to training step, reusing the same ˜ u and running only one iteration per step.
Unlike Miyato et al., rather than enforcing σ ( W )
=
β , we instead enforce the looser constraint σ ( W ) ≤ β : W [Equation] =
[Equation]
/ max
[Equation]
, (9) which we observe to result in faster training for supervised learning tasks.
Initialize ˜ u with a random vector matching the shape of the convolution input for t = 0 , ..., T − 1 do ˜ v ← conv ( W, ˜ u ) / (cid:107) conv ( W, ˜ u ) (cid:107)˜ u ← conv_transpose ( W, ˜ v ) / (cid:107)
conv_transpose ( W, ˜ v ) (cid:107)end for σ ← ˜ v · conv ( W, ˜ u )
N UMERICAL E XPERIMENTS
In this section we provide an array of empirical experiments to validate both the bounds we derived in Section 3 and our implementation of spectral normalization described in section 4.
We show that spectral normalization improves both test accuracy and generalization for a variety of adversarial training schemes, datasets, and network architectures.
All experiments are implemented in TensorFlow (Abadi et al., 2016).
For each experiment, we cross validate 4 to 6 values of β (see (9)) using a ﬁxed validation set of 500 samples.
For PGM, we used r = 15 iterations and α = 2 (cid:15)/r .
Additionally, for FGM and PGM we used (cid:96) 2 -type attacks (unless speciﬁed) with magnitude (cid:15)
= 0 .
E ˆ P [ (cid:107) X (cid:107) 2 ] (this value was approximately 2.44 for CIFAR10).
For WRM, we implemented gradient ascent as discussed by Sinha et al.
Additionally, for
WRM training we used a Lagrangian coefﬁcient of 0 .
002 E ˆ P [ (cid:107) X (cid:107) 2 ] for CIFAR10 and SVHN and a
Lagrangian coefﬁcient of 0 .
04 E ˆ P [ (cid:107) X (cid:107) 2 ] for MNIST in a similar manner to Sinha et al.
The code will be made readily available.
5. V ALIDATION OF SPECTRAL NORMALIZATION IMPLEMENTATION AND BOUNDS
We ﬁrst demonstrate the effect of the proposed spectral normalization approach on the ﬁnal DNN weights by comparing the (cid:96) 2 norm of the input x to that of the output f w ( x ) .
As shown in Figure 2(a), without spectral normalization ( β = ∞ in (9)), the norm gain can be large.
Additionally, because we are using cross-entropy loss, the weights (and therefore the norm gain) can grow arbitrarily high if we continue training as reported by Neyshabur et al.
(2017b).
As we decrease β , however, we produce more constrained networks, resulting in a decrease in norm gain.
At β = 1 , the gain of the network cannot be greater than 1, which is consistent with what we observe.
Additionally, we provide a comparison of our method to that of Miyato et al.
(2018) in Appendix A.1, empirically demonstrating that Miyato et al.
’s method does not properly control the spectral norm of convolutional layers, resulting in worse generalization performance.
Figure 2(b) shows that the (cid:96) 2 norms of the gradients with respect to the training samples are nicely distributed after spectral normalization.
Additionally, this ﬁgure suggests that the minimum gradient (cid:96) 2 -norm assumption (the κ condition in Theorems 2 and 3) holds for spectrally-normalized networks.
The ﬁrst column of Figure 3 shows that, as observed by Bartlett et al.
(2017), AlexNet trained using
ERM generates similar margin distributions for both random and true labels on CIFAR10 unless we normalize the margins appropriately.
We see that even without further correction, ERM training with
SN allows AlexNet to have distinguishable performance between the two datasets.
This observation suggests that SN as a regularization scheme enforces the generalization error bounds shown for spectrally-normalized DNNs by Bartlett et al.
(2017) and Neyshabur et al.
(2017a).
Additionally, the margin normalization factor (the capacity norm Φ in Theorems 1-4) is much smaller for networks trained with SN.
As demonstrated by the other columns in Figure 3, a smaller normalization factor results in larger normalized margin values and much tighter margin-based generalization bounds (a factor of 10 2 for ERM and a factor of 10 5 for FGM and PGM)
(see Theorems 1-4).
[Figure]
5. S PECTRAL NORMALIZATION IMPROVES GENERALIZATION AND ADVERSARIAL ROBUSTNESS
The phenomenon of overﬁtting random labels described by Zhang et al.
(2016) can be observed even for adversarial training methods.
Figure 4 shows how the FGM, PGM, or WRM adversarial training schemes only slightly delay the rate at which AlexNet ﬁts random labels on CIFAR10, and therefore the generalization gap can be quite large without proper regularization.
After introducing spectral normalization, however, we see that the network has a much harder time ﬁtting both the random and true labels.
With the proper amount of SN (chosen via cross validation), we can obtain networks that struggle to ﬁt random labels while still obtaining the same or better test performance on true labels.
We also observe that training schemes regularized with SN result in networks more robust to adversarial attacks.
Figure 5 shows that even without adversarial training, AlexNet with SN becomes more robust to FGM, PGM, and WRM attacks. Adversarial training improves adversarial robustness
[Figure]
more than SN by itself; however we see that we can further improve the robustness of the trained networks signiﬁcantly by combining SN with adversarial training
[Figure]
[Figure]
5. O THER DATASETS AND ARCHITECTURES
We demonstrate the power of regularization via SN on several combinations of datasets, network architectures, and adversarial training schemes.
The datasets we evaluate are CIFAR10, MNIST, and
SVHN.
We ﬁt CIFAR10 using the AlexNet and Inception networks described by Zhang et al.
(2016), 1-hidden-layer and 2-hidden-layer multi layer perceptrons (MLPs) with ELU activation andhidden nodes in each layer, and the ResNet architecture (He et al.
provided in TensorFlow for ﬁtting CIFAR10.
We ﬁt MNIST using the ELU network described by Sinha et al.
and the 1-hidden-layer and 2-hidden-layer MLPs.
Finally, we ﬁt SVHN using the same AlexNet architecture we used to ﬁt CIFAR10.
Our implementations do not use any additional regularization schemes including weight decay, dropout (Srivastava et al., 2014), and batch normalization (Ioffe & Szegedy, 2015) as these approaches are not motivated by the theory developed in this work; however, we provide numerical experiments comparing the proposed approach with weight decay, dropout, and batch normalization in Appendix A.2.
Table 1 in the Appendix reports the pre and post-SN test accuracies for all 42 combinations evaluated.
Figure 1 in the Introduction and Figures 7-9 in the Appendix show examples of training and validation curves on some of these combinations.
We see that the validation curve generally improves after regularization with SN, and the observed improvements in validation accuracy are conﬁrmed by the test accuracies reported in Table 1.
Figure 6 visually summarizes Table 1, showing how SN can often signiﬁcantly improve the test accuracy (and therefore decrease the generalization gap) for several of the combinations.
We also provide Table 2 in the Appendix which shows the proportional increase in training time after introducing SN with our TensorFlow implementation.
[Figure]
R ELATED W ORKS
Providing theoretical guarantees for adversarial robustness of various classiﬁers has been studied in multiple works.
Wang et al.
(2017) targets analyzing the adversarial robustness of the nearest neighbor approach.
Gilmer et al.
(2018) studies the effect of the complexity of the data-generating manifold on the ﬁnal adversarial robustness for a speciﬁc trained model.
Fawzi et al.
(2018) proves lower-bounds for the complexity of robust learning in adversarial settings, targeting the population distribution of data.
Xu et al.
(2009) shows that the regularized support vector machine (SVM) can be interpreted via robust optimization.
Fawzi et al.
(2016) analyzes the robustness of a ﬁxed classiﬁer to random and adversarial perturbations of the input data.
While all of these works seek to understand the robustness properties of different classiﬁcation function classes, unlike our work they do not focus on the generalization aspects of learning over DNNs under adversarial attacks.
Concerning the generalization aspect of adversarial training, Sinha et al.
(2018) provides optimization and generalization guarantees for WRM under the assumptions discussed after Theorem 4.
However, their generalization guarantee only applies to the Wasserstein cost function, which is different from the 0-1 or margin loss and does not explicitly suggest a regularization scheme.
In a recent related work, Schmidt et al.
(2018) numerically shows the wide generalization gap in PGM adversarial training and theoretically establishes lower-bounds on the sample complexity of linear classiﬁers in
Gaussian settings.
While our work does not provide sample complexity lower-bounds, we study the broader function class of DNNs where we provide upper-bounds on adversarial generalization error and suggest an explicit regularization scheme for adversarial training over DNNs.
Generalization in deep learning has been a topic of great interest in machine learning (Zhang et al., 2016).
In addition to margin-based bounds (Bartlett et al., 2017; Neyshabur et al., 2017a), various other tools including VC dimension (Anthony & Bartlett, 2009), norm-based capacity scores (Bartlett & Mendelson, 2002; Neyshabur et al., 2015), and ﬂatness of local minima (Keskar et al., 2016; Neyshabur et al., 2017b) have been used to analyze generalization properties of DNNs.
Recently, Arora et al.
(2018) introduced a compression approach to further improve the margin-based bounds presented by Bartlett et al.
; Neyshabur et al. (2017a).
The PAC-Bayes bound has also been considered and computed by Dziugaite & Roy (2017), resulting in non-vacuous bounds for MNIST.
A F URTHER EXPERIMENTAL RESULTS
[Table]
CIFAR
Inception
PGM (cid:96) ∞ 0.
CIFAR
Inception
WRM 1.
CIFAR 1-layer MLP
ERM 0.
CIFAR 1-layer MLP
FGM (cid:96)0.
CIFAR 1-layer MLP
PGM (cid:96)0.
CIFAR 1-layer MLP
WRM 0.
CIFAR 2-layer MLP
ERM 0.
CIFAR 2-layer MLP
FGM (cid:96)0.
CIFAR 2-layer MLP
PGM (cid:96)0.
CIFAR 2-layer MLP
WRM 0.
CIFAR
ResNet
ERM 1.
CIFAR
ResNet
PGM (cid:96)0.
CIFAR
ResNet
PGM (cid:96) ∞ 0.
CIFAR
ResNet
WRM 1.
MNIST
ELU-Net
ERM 1.
MNIST
ELU-Net
FGM (cid:96)0.
MNIST
ELU-Net
PGM (cid:96)0.
[Table] [Table]
-Net
WRM
[Table] [Table]
[Table] [Table]
MNIST
[Table]
ERM 1.
MNIST
[Table]
FGM
[Table]
MNIST [Table] layer MLP
PGM (cid:96)1.
MNIST 1-
[Table]
MLP
WRM 0.
[Table]
ERM
[Table] [Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
MNIST
[Table]
[Table] [Table]
[Table] [Table]
MNIST
[Table]
WRM
[Table]
[Table] [Table] [Table]
[Table]
AlexNet
[Table] [Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table]
AlexNet
[Table]
[Table] [Table] [Table] [Table]
[Table]
[Table]
[Table] [Table] [Table] [Table]
79 s 93 s 1.
CIFAR 1-layer MLP WRM 73 s 86 s 1. CIFAR 2-layer MLP ERM 23 s 37 s 1.
CIFAR 2-layer MLP FGM (cid:96)27 s 41 s 1. CIFAR 2-layer MLP PGM (cid:96)91 s 108 s 1.
CIFAR 2-layer MLP
WRM 85 s 103 s 1. CIFAR ResNet ERM 315 s 547 s 1.
CIFAR
ResNet
PGM (cid:96)2994 s 3300 s 1. CIFAR ResNet PGM (cid:96) ∞ 2980 s 3300 s 1.
CIFAR
ResNet WRM 3187 s 3457 s 1. MNIST ELU-Net
ERM 55 s 97 s 1. MNIST ELU-Net FGM (cid:96)91 s 136 s 1.
MNIST ELU-Net PGM (cid:96)614 s 676 s 1. MNIST
ELU-Net WRM 635 s 670 s 1. MNIST 1-layer MLP ERM 15 s 24 s 1.
MNIST 1-layer MLP FGM (cid:96)17 s 27 s 1. MNIST 1-layer MLP PGM (cid:96)57 s 71 s 1.
MNIST 1-layer MLP WRM 51 s 63 s 1. MNIST 2-layer MLP ERM 17 s 31 s 1.
MNIST 2-layer MLP FGM (cid:96)20 s 35 s 1. MNIST 2-layer MLP PGM (cid:96)67 s 89 s
[Table]
[Figure]
[Figure] [Figure] A.  C
OMPARISON OF PROPOSED METHOD
TO M IYATO ET AL . S METHOD For the optimal β chosen when ﬁtting AlexNet to CIFAR10 with PGM, we repeat the experiment using the spectral normalization approach suggested by Miyato et al.
This approach performs spectral normalization on convolutional layers by scaling the convolution kernel by the spectral norm of the kernel rather than the spectral norm of the overall convolution operation.
Because it does not account for how the kernel can amplify perturbations in a single pixel multiple times (see Section 4), it does not properly control the spectral norm.
In Figure 10, we see that for the optimal β reported in the main text, using Miyato et al.
(2018)’s
SN method results in worse generalization performance.
This is because although we speciﬁed that β
= 1 . 6 , the actual β obtained using Miyato et al.
(2018)’s method can be much greater for convolutional layers, resulting in overﬁtting (hence the training curve quickly approaches 1. accuracy).
The AlexNet architecture used has two convolutional layers.
For the proposed method, the ﬁnal spectral norms of the convolutional layers were both 1.60; for Miyato et al.
(2018)’s method, the ﬁnal spectral norms of the convolutional layers were 7.72 and 7.45 despite the corresponding convolution kernels having spectral norms of 1.60.
Our proposed method is less computationally efﬁcient in comparison to Miyato et al.
(2018)’s approach because each power iteration step requires a convolution operation rather than a division operation.
As shown in Table 3, the proposed approach is not signiﬁcantly less efﬁcient with our
TensorFlow implementation.
[Figure]
Miyato et al.
(2018)’s approach for CIFAR10 and various network architectures and training schemes.
These ratios were obtained by running the experiments on one NVIDIA Titan Xp GPU for 40 epochs.
[Table]
A. C OMPARISON OF PROPOSED METHOD TO WEIGHT DECAY , DROPOUT , AND BATCH NORMALIZATION
[Figure]
B S PECTRAL NORMALIZATION OF FULLY - CONNECTED LAYERS
For fully-connected layers, we approximate the spectral norm of a given matrix W using the approach described by Miyato et al.
(2018): the power iteration method.
For each W , we randomly initialize a vector ˜ u and approximate both the left and right singular vectors by iterating the update rules
[Equation]
T ˜ v (cid:107) 2 .
The ﬁnal singular value can be approximated with σ ( W ) ≈ ˜ v T W ˜ u .
Like Miyato et al.
, we exploit the fact that SGD only makes small updates to W from training step to training step, reusing the same ˜ u and running only one iteration per step.
Unlike Miyato et al., rather than enforcing σ ( W ) =
β , we instead enforce the looser constraint σ ( W ) ≤ β as described by Gouk et al.
[Equation]
, which we observe to result in faster training in practice for supervised learning tasks.
C P ROOFS C. P ROOF OF T HEOREM
First let us quote the following two lemmas from (Neyshabur et al., 2017a).
Lemma 1 (Neyshabur et al.
(2017a)) .
Consider F nn = { f w : w ∈ W} as the class of neural nets parameterized by w where each f w maps input x ∈ X to R m .
Let Q be a distribution on parameter vector chosen independently from the n training samples.
Then, for each η > 0 with probability at least 1 − η for any w and any random perturbation u satisfying Pr u (cid:0) max x ∈X (cid:107) f
w + u ( x ) − f w ( x ) (cid:107) [Equation]
≤ γ 4 (cid:1) ≥ 12 we have
[Equation]
Lemma 2 (Neyshabur et al.
(2017a)) .
Consider a d -layer neural net f w with 1 -Lipschitz activation function σ where σ (0)
= 0 .
Then for any norm-bounded input (cid:107) x (cid:107) 2 ≤ B and weight perturbation u : (cid:107) U i (cid:107) 2 ≤ 1 d (cid:107) W
i (cid:107) 2 , we have the following perturbation bound:
[Equation]
To prove Theorem 1, consider f (cid:101) w with weights (cid:101) w .
Since (1 + 1 d ) d ≤ e and 1 e ≤ (1 − 1 d ) d − 1 , for any weight vector w such that (cid:12)(cid:12) (cid:107) W
i
(cid:107) 2 −
[Equation]
(cid:107)
[Equation]
i (cid:107) 2 for every i we have:
[Equation]
[Equation] We apply Lemma 1, choosing Q to be a zero-mean multivariate Gaussian distribution with diagonal covariance matrix, where each entry of the i th layer U i has standard deviation ξ i = (cid:107) (cid:102)
W
i (cid:107) 2 β (cid:101) w ξ with ξ chosen later in the proof.
Note that β w deﬁned earlier in the theorem is the geometric average of spectral norms across all layers.
Then for the i th layer’s random perturbation vector u i ∼ N (0 , ξ 2 i I ) , we get the following bound from (Tropp, 2012) with h representing the width of the i th hidden layer:
[Equation]
We now use a union bound over all layers for a maximum union probability of 1 / 2 , which implies the normalized β
[Equation]
2 for each layer is upper-bounded by ξ (cid:112)
h log(4 hd ) .
Then for any w satisfying
[Equation]
for all i ’s
[Equation]
Here (a) holds, since
[Equation]
di
[Equation]
(cid:107) (cid:102) W
i (cid:107) 2 is true for each j .
Hence we choose ξ
[Equation]
) for which the perturbation vector satisﬁes the assumptions of Lemma 2.
Then
[Equation]
we bound the KL-divergence term in Lemma 1 as
[Equation]
= O
[Equation]
Note that (b) holds, because we assume (cid:12)(cid:12) (cid:107) W
i
(cid:107) 2 − (cid:107) (cid:102)
W
i (cid:107) 2 (cid:12)(cid:12) ≤ 1 d (cid:107) (cid:102) W i (cid:107) 2 implying
[Equation]
2 for each j .
Therefore, Lemma 1 implies with probability 1 − η we have the following bound hold for any w satisfying [Equation]
for all
[Equation]
Then, we can give an upper-bound over all the functions in F nn by ﬁnding the covering number of the set of (cid:101) w ’s where for each feasible w we have the mentioned condition satisﬁed for at least one of (cid:101) w ’s.
We only need to form the bound for ( γ 2 B ) 1 /d ≤ β w ≤ ( γ √ n 2 B ) 1 /d which can be covered using a cover of size dn 1 / 2 d as discussed in (Neyshabur et al., 2017a).
Then, from the theorem’s assumption we know each (cid:107) W
i
(cid:107) 2 will be in the interval [ 1 M β w , Mβ w ] which we want to cover such that for any β in the interval there exists a (cid:101) β satisfying | β − (cid:101)
β | ≤ (cid:101) β/d .
For this purpose we can use a cover of size 2 log
+1 /d M ≤ 2( d + 1) log M , 1 which combined for all i ’s gives a cover with size O (( d log M ) d ) whose logarithm is growing as d log( d log M ) .
This together with (15) completes the proof. [Equation]
P ROOF OF T HEOREM
We start by proving the following lemmas providing perturbation bound for FGM attacks.
Lemma 3.
Consider a d -layer neural net f w with 1 -Lipschitz and 1 -smooth ( 1 -Lipschitz derivative) activation σ where σ (0)
= 0 .
Let training loss (cid:96) :
( R m , Y ) → R also be 1 -Lipschitz and 1 -smooth for any ﬁxed label y ∈ Y .
Then, for any input x , label y , and perturbation vector u satisfying ∀ i : (cid:107) U i (cid:107) 2 ≤ 1 d (cid:107) W
i (cid:107) 2 we have
[Equation]
[-i (cid:107)(cid:107) W i (cid:107) 
-]
Proof.
Since for a ﬁxed y (cid:96) satisﬁes the same Lipschitzness and smoothness properties as σ , then (cid:107)∇ z
[Equation]
z , y ) [Equation] 2 ≤ 1 and applying the chain rule implies:
[Equation]
[Table]
[Equation]
The above result is a conclusion of Lemma 2 and the lemma’s assumptions implying (cid:13)(cid:13) ∇ x f w ( x ) (cid:13)(cid:13) 2 ≤ (cid:81) di =1 (cid:107) W i (cid:107) 2 for every x .
Now, we deﬁne ∆ k
= (cid:13)(cid:13) ∇ x f ( k ) w + u ( x ) − ∇ x f ( k ) w ( x ) (cid:13)(cid:13) 2 where f ( k ) w ( x ) :=
W k σ ( W k − 1 · · · σ ( W 1 x )) · · · ) denotes the DNN’s output at layer k .
With (17) in mind, we complete this lemma’s proof by showing the following inequality via induction:
[Equation]
The above equation will prove the lemma because for k ≤ d we have (1 + 1 d ) k ≤ (1 + 1 d ) d ≤ e .
For k = 0 , ∆
= 0 since f (0) w ( x ) = x and does not change with w .
Given that (18) holds for k we have
[Equation]
k
[-+
-]
[-k +1 (cid:107) 2 (cid:107) W k +1 (cid:107) 
-]
[-+ (cid:13)(cid:13) W k +
-]
[-+1 (cid:107) 2 (cid:107) W k +1 (cid:107) 
-]
[Equation]
[-+ (cid:13)(cid:13) W k +1 (cid:13)(cid:13) 2 ∆ k ≤ e (1 + 1 d ) k +
 (cid:0) k +1 (cid:89) i = (cid:107)-][Table]
[-W i (cid:107) 
-]
Therefore, combining (17) and (18) the lemma’s proof is complete
Before presenting the perturbation bound for FGM attacks, we ﬁrst prove the following simple lemma.
Lemma 4.
Consider vectors z 1 , z 2 and norm function (cid:107) · (cid:107) .
If max {(cid:107) z 1 (cid:107) , (cid:107) z 2 (cid:107)} ≥ κ , then
[Equation]
Proof.
Without loss of generality suppose (cid:107) z 2 (cid:107) ≤ (cid:107) z 1 (cid:107) and therefore κ ≤ (cid:107) z 1 (cid:107) .
Then,
[Equation]
Lemma 5.
Consider a d -layer neural network function f w with 1 -Lipschitz, 1 -smooth activation σ where σ (0) = 0 .
Consider FGM attacks with noise power (cid:15) according to Euclidean norm || · || 2 .
Suppose κ ≤ (cid:107)∇ x (cid:96) ( f w ( x ) , y ) (cid:107) 2 holds over the (cid:15) -ball around the support set X .
Then, for any norm-bounded perturbation vector u such that (cid:107) U
i (cid:107) 2 ≤ 1 d (cid:107) W
i
(cid:107) 2 .
∀ i , we have
[Equation]
(cid:21) .
Proof.
The FGM attack according to Euclidean norm is simply the DNN loss’s gradient normalized to have (cid:15) -Euclidean norm.
The lemma is hence a direct result of combining Lemmas 3 and 4.
To prove Theorem 2, we apply Lemma 1 together with the result in Lemma 5.
Similar to the proof for
Theorem 1, given weights (cid:101) w we consider a zero-mean multivariate Gaussian perturbation vector u with diagonal covariance matrix where each element in the i th layer u i varies with the scaled standard deviation ξ i = (cid:107) (cid:102)
W
i (cid:107) 2 β (cid:101) w ξ with ξ properly chosen later in the proof.
Consider weights w for which
[Equation]
Since u i ∼ N (0 , ξ 2 i I ) , (Tropp, 2012) shows the following bound holds
[Equation]
Then we apply a union bound over all layers for a maximum union probability of 1 / 2 implying the normalized β (cid:101) w (cid:107) U
i (cid:107) 2 (cid:107) (cid:102) W
i (cid:107) 2 for each layer is upper-bounded by ξ (cid:112)
h log(4 hd ) .
Now, if the assumptions of Lemma 5 hold for perturbation vector u given the choice of ξ , for the FGM attack with noise power (cid:15) according to Euclidean norm (cid:107) · (cid:107)
we have (cid:107) f
[Table]
Hence we choose ξ = γ
[Equation]
, (23) for which the assumptions of Lemmas 1 and 5 hold.
Assuming B ≥ 1 , similar to Theorem 1’s proof we can show for any w such that (cid:12)(cid:12) (cid:107) W
i (cid:107) 2 − (cid:107) (cid:102) W i (cid:107) 2 (cid:12)(cid:12) ≤ 1 d (cid:107) (cid:102) W i (cid:107)
we have
KL ( P w + u (cid:107) Q ) ≤ d (cid:88) i
= (cid:107) W
i
(cid:107) 2 F {+2 ξ 
+}
i
=
O (cid:18) d 2 ( B + (cid:15) )
2 h log( hd ) (cid:81) di
=1 (cid:107) (cid:102) W
i (cid:107) 22 (cid:8) 1 + (cid:15)κ (cid:0)(cid:81) di =1 (cid:107) (cid:102) W i (cid:107) 2 (cid:1) (cid:80) di =1 (cid:81) ij =1 (cid:107) (cid:102) W j (cid:107) 2 (cid:1)(cid:9)γd (cid:88) i =
(cid:107) W
i (cid:107) 2 F (cid:107) (cid:102) W i (cid:107)(cid:19) ≤ O (cid:18) d 2 ( B + (cid:15) ) 2 h log( hd ) (cid:81) di
=1 (cid:107) [Equation]
Then, applying Lemma 1 reveals that given any η > 0 with probability at least 1 − η for any w such that (cid:12)(cid:12) (cid:107) W
i
(cid:107) 2 − (cid:107) (cid:102)
W
i (cid:107) 2 (cid:12)(cid:12) ≤ 1 d (cid:107) (cid:102) W i (cid:107)
we have
[Equation]
where Φ
[Equation]
f
[Equation]
) :=
[Equation]
Note that similar to our proof for Theorem 1 we can ﬁnd a cover of size O (( d log M ) d dn 1 / 2 d ) for the spectral norms of the weights feasible set, where for any (cid:107) W i (cid:107) 2 we have a i such that (cid:12)(cid:12) (cid:107) W
i
(cid:107) 2 − a i (cid:12)(cid:12) ≤ a i /d .
Applying this covering number bound to (24) completes the proof.
C. P ROOF OF T HEOREM
We use the following two lemmas to extend the proof of Theorem 2 for FGM attacks to show Theorem 3 for PGM attacks.
Lemma 6.
Consider a d -layer neural network function f w with 1 -Lipschitz, 1 -smooth activation σ where σ (0) = 0 .
We consider PGM attacks with noise power (cid:15) according to Euclidean norm || · || 2 , r iterations and stepsize α .
Suppose κ ≤ (cid:107)∇ x (cid:96) (cid:0) f w ( x ) , y (cid:1) (cid:107) 2 holds over the (cid:15) -ball around the support set X .
Then for any perturbation vector u such that (cid:107) U
i (cid:107) 2 ≤ 1 d (cid:107) W
i
(cid:107) 2 for every i we have (cid:107)
[Equation]
Here lip( ∇ (cid:96) ◦ f w ) denotes the actual Lipschitz constant of ∇ x (cid:96) ( f w ( x ) , y ) .
Proof. We use induction to show this lemma for different r values. The result for case r = 1 is a direct consequence of Lemma 5. Suppose that the result is true for r = k .
Then, Lemmas 3 andimply
[Equation]
[Table]
(cid:89) j = (cid:107) W j (cid:107) 2 (cid:1) i {+(cid:88) j = (cid:107) U j (cid:107)(cid:107) W j (cid:107)(cid:21) +
+}
α κ lip( ∇ (cid:96) ◦ f w ) e 2 (2 α/κ )1 − (2 α/κ ) k lip( ∇ (cid:96) ◦ f w ) k 1 − (2 α/κ ) lip( ∇ (cid:96) ◦ f w ) (cid:0) d (cid:89) i = (cid:107) W
i (cid:107) 2 (cid:1) d (cid:88) i = (cid:20) (cid:107) U i (cid:107)(cid:107)
{+W i (cid:107) 
+}
+ ( (cid:107) x (cid:107) 2 + (cid:15) ) (cid:0) i (cid:89)
j = (cid:107) W j (cid:107) 2 (cid:1)
i (cid:88)
j = (cid:107) U j (cid:107)(cid:107)
W j (cid:107)(cid:21) =
e 2 (2 α/κ )1 − (2 α/κ ) k +1 lip( ∇ (cid:96) ◦ f w ) k
+ 1 − (2 α/κ ) lip( ∇ (cid:96) ◦ f w ) × (cid:0) d (cid:89)
i = (cid:107)
W
i (cid:107) 2 (cid:1) d (cid:88) i = (cid:20) (cid:107) U i (cid:107)(cid:107)
{+W i (cid:107) 
+}
+ ( (cid:107) x (cid:107) 2 + (cid:15) ) (cid:0) i (cid:89)
j = (cid:107) W j (cid:107) 2 (cid:1)
i (cid:88)
j = (cid:107) U j (cid:107)(cid:107) W j (cid:107)(cid:21) , where the last line follows from the equality (cid:80) ki =
s i = 1 −
s k
+1 1 − s .
Therefore, by induction the lemma holds for every value r ≥ 1 .
Lemma 7.
Consider a d -layer neural network function f w with 1 -Lipschitz, 1 -smooth activation σ where σ (0) = 0 .
Also, assume that training loss (cid:96) is 1 -Lipschitz and 1 -smooth.
Then,
[Equation]
Proof.
First of all note that according to the chain rule
[Equation]
Considering the above result, we complete the proof by inductively proving lip (cid:0) ∇ x f w ( x ) (cid:1) ≤ ( (cid:81) d i =1 (cid:107) W i (cid:107) 2 ) (cid:80) d i =1 (cid:81)
i − 1 j =1 (cid:107) W j (cid:107) 2 .
For d = 1 , ∇ x f w ( x ) is constant and hence the result holds.
Assume the statement holds for d = k .
Due to the chain rule,
[Equation]
and therefore for any x and v
[-+1 − ∇ x f ( k ) w ( x + v ) σ (cid:48) (cid:0) f ( k ) w ( x + v ) (cid:1) W Tk +1 (cid:13)(cid:13)≤ (cid:107) W k +1 (cid:107) 
-]
[Equation]
which shows the statement holds for d = k + 1 and therefore completes the proof via induction.
In order to prove Theorem 3, we note that for any norm-bounded (cid:107) x (cid:107) 2 ≤ B and perturbation vector u such that ∀ i, (cid:107) U
i (cid:107) 2 ≤ 1 d (cid:107) W
i
(cid:107)
we have
[Equation]
x + δ pgm ,r w ( x ))
(cid:107)≤ (cid:107) f w + u ( x + δ pgm ,r w + u ( x )) − f w ( x + δ pgm ,r w + u ( x )) (cid:107)+ (cid:107) f w ( x + δ pgm ,r w + u ( x )) − f w ( x + δ pgm ,r w ( x )) (cid:107)≤ e ( B + (cid:15) ) (cid:0) d (cid:89) i
= (cid:107) W
i
(cid:107) 2 (cid:1)
d (cid:88)
i =
(cid:107) U i (cid:107)(cid:107) W i (cid:107) 2 + e 2 (2 α/κ )1 − (2 α/κ ) r lip( ∇ (cid:96) ◦ f w ) r 1 − (2 α/κ ) lip( ∇ (cid:96) ◦ f w ) × (cid:0) d (cid:89) i = (cid:107) W
i
(cid:107) 22 (cid:1) d (cid:88) i = (cid:20) (cid:107) U
{+i (cid:107)(cid:107) W i (cid:107) 
 + ( B + (cid:15) ) (cid:0) i (cid:89)+}
j = (cid:107) W j (cid:107) 2 (cid:1) i (cid:88) j = (cid:107) U j (cid:107)(cid:107) W j (cid:107)(cid:21) ≤ e ( B + (cid:15) ) (cid:0) d (cid:89) i
= (cid:107) W
i
(cid:107) 2 (cid:1)
d (cid:88) i =
(cid:107) U i (cid:107)(cid:107) W i (cid:107) 2 +
[Equation]
[Table]
The last inequality holds since as shown in Lemma 7 lip (cid:0) ∇ x (cid:96) ( f w ( x ) , y ) (cid:1) ≤ lip( ∇ (cid:96) ◦ f w ) :
= (cid:0)(cid:81) di =1 (cid:107) W i (cid:107) 2 (cid:1) (cid:80) di =1 (cid:81) ij =1 (cid:107) W j (cid:107) 2 .
Here the upper-bound lip( ∇ (cid:96) ◦ f (cid:101) w ) for (cid:101)
w changes by a factor at most e 2 /r for w such that (cid:12)(cid:12) (cid:107) W
i
(cid:107) 2 − (cid:107) (cid:102)
W
i (cid:107) 2 (cid:12)(cid:12) ≤ 1 rd (cid:107) (cid:102) W
i (cid:107) 2 .
Therefore, given (cid:101) w if similar to the proof for Theorem 2 we choose a zero-mean multivariate Gaussian distribution Q for u with the i th layer
u i ’s standard deviation to be ξ i = (cid:107) (cid:102)
W
i (cid:107) 2 β ˜ w ξ where
[Equation]
= [Equation] Then for any w satisfying
[Equation]
, applying union bound shows that the assumption of Lemma 1 Pr
[Equation]
holds for Q , and further we have
[Equation]
ij
[Equation]
γ
[Equation]
d (cid:88) i =
[Equation]
(cid:107) W
[Equation]
(cid:107)
[Equation]
F (cid:107) (cid:102)
[Equation]
(cid:107)(cid:19) ≤ O (cid:18)
[Equation]
γ
[Equation]
d (cid:88)
i
[Equation]
(cid:107)
[Equation]
(cid:107)
[Equation]
(cid:107) W [Equation] (cid:107)(cid:19) Applying the above bound to Lemma 1 shows that for any η > 0 the following holds with probability 1 − η for any w where (cid:12)(cid:12) (cid:107) W
i
(cid:107) 2 − (cid:107) (cid:102)
W
i (cid:107) 2 (cid:12)(cid:12) ≤ 1 rd (cid:107) (cid:102) W
i (cid:107) 2 :
[Equation] f [Equation] O
[Equation]
(cid:19) , where we consider Φ pgm (cid:15),κ,r,α ( f w ) as the following expression
[Equation]
Using a similar argument to our proof of Theorem [Equation] we can properly cover the spectral norms for each W i with 2 rd log M points, such that for any feasible (cid:107) W i (cid:107) 2 value, satisfying the assumptions, we have value a i in our cover where (cid:12)(cid:12) (cid:107) W
i (cid:107) 2 − a i (cid:12)(cid:12) ≤ 1 rd a i .
Therefore, we can cover all feasible combinations of spectral norms with (2 rd log M ) d dn 1 / 2 d , which combined with the above discussion completes the proof.
C. P ROOF OF T HEOREM
We ﬁrst show the following lemma providing a perturbation bound for WRM attacks.
Lemma 8. Consider a d -layer neural net f w satisfying the assumptions of Lemma 3.
Then, for any weight perturbation u such that (cid:107) U
i (cid:107) 2 ≤ 1 d (cid:107) W
i
(cid:107)
we have
[Equation]
2 ≤ eλ − lip( ∇ (cid:96) ◦ f w )
[Equation]
[Table] [Equation] [Table]
[Equation]
[Table] [Equation] [Table]
[Equation]
[Table] [Equation] [Table]
[Equation]
[Table] [Equation] [Table]
[Equation]
[Table] [Equation] [Table]
[Equation]
[Table] [Equation] [Table]
[Equation]
[Table] [Equation] [Table]
[Equation]
[Table]
In the above inequality, lip( ∇ (cid:96) ◦ f w ) denotes the Lipschitz constant of ∇ x (cid:96) ( f w ( x ) , y ) .
Proof.
First of all note that for any x we have (cid:107) δ wrm w ( x ) (cid:107) 2 ≤ ( (cid:81) di
=1 (cid:107) W
i (cid:107) 2 ) /λ , because we assume lip( ∇ (cid:96) ◦ f w ) < λ implying WRM’s optimization is a convex optimization problem with the global solution δ wrm w ( x ) satisfying δ wrm w ( x ) = 1 λ ∇ (cid:96) ◦
f w ( x + δ wrm w ( x )) which is norm-bounded by lip( (cid:96) ◦
f w ) λ ≤ ( (cid:81) di
=1 (cid:107) W
i (cid:107) 2 ) /λ .
Moreover, applying Lemma 3 we have
[Equation]
=
[Equation]
which shows the following inequality and hence completes the proof:
[Equation]
δ wrm w + u ( x ) − δ wrm w ( x ) (cid:13)(cid:13)≤ eλ (cid:0) d (cid:89) i
= (cid:107) W
i
(cid:107) 2 (cid:1) d (cid:88) i = (cid:20) (cid:107) U
i (cid:107)(cid:107) W i (cid:107) 2 + (cid:0) (cid:107) x (cid:107) 2 + (cid:81) dj
=1 (cid:107) W j
(cid:107)λ (cid:1)(cid:0) i (cid:89)
j = (cid:107) W j (cid:107) 2 (cid:1)
i (cid:88)
j = (cid:107) U j (cid:107)(cid:107)
W j (cid:107)(cid:21) .
Combining the above lemma with Lemma 2, for any norm-bounded (cid:107) x (cid:107) 2 ≤ B and perturbation vector u where (cid:107) U
i (cid:107) 2 ≤ 1 d (cid:107) W
i
(cid:107) 2 , (cid:13)(cid:13)
f w + u ( x + δ wrm w + u ( x ))
− f w ( x + δ wrm w ( x )) (cid:13)(cid:13)≤ (cid:13)(cid:13)
f w + u ( x + δ wrm w + u ( x ))
− f w ( x + δ wrm w + u ( x ))
(cid:13)(cid:13) {+
+}
+ (cid:13)(cid:13)
f w ( x + δ wrm w + u ( x )) − f w ( x + δ wrm w ( x )) (cid:13)(cid:13)≤ e ( B + (cid:81) dj
=1 (cid:107) W j (cid:107)λ
[Table]
dj =1 (cid:107) W j
(cid:107)λ (cid:1)(cid:0) i (cid:89) j = (cid:107) W j (cid:107) 2 (cid:1) i (cid:88) j = (cid:107) U j (cid:107)(cid:107)
W j (cid:107)(cid:21) . Similar to the proofs of Theorems 2,3, given (cid:101) w we choose a zero-mean multivariate Gaussian distribution Q with diagonal covariance matrix for random perturbation u , with the i th layer
u i ’s standard deviation parameter ξ i = (cid:107) (cid:102) W
i (cid:107) 2 β ˜ w ξ where
[Equation]
Using a union bound suggests the assumption of Lemma 1 Pr u (cid:0) max x ∈X (cid:107) f w + u ( x + δ wrm w + u ( x ))
− f w ( x + δ wrm w ( x )) (cid:107) ∞
≤ γ 4 (cid:1) ≥ 12 holds for Q .
Then, for any w satisfying (cid:12)(cid:12) (cid:107) W i (cid:107) 2 − (cid:107) (cid:102) W
i (cid:107) 2 (cid:12)(cid:12) ≤ 1 4 d/τ (cid:107) (cid:102) W i (cid:107)
we have lip( (cid:96) [Table] ≤ [Table]
[Table] ≤ [Table] λ ≤
[Table] 1 − [Table] 2 ) λ which implies the guard-band τ for (cid:101) w applies to w after being modiﬁed by a factor 2 .
Hence,
[Table]
[Equation]
×
[Equation]
Using this bound in Lemma 1 implies that for any η > 0 the following bound will hold with probability 1 − η for any w where (cid:12)(cid:12) (cid:107) W i (cid:107) 2 − (cid:107) (cid:102) W i (cid:107) 2 (cid:12)(cid:12) ≤ 1 4 d
[Equation]
τ (cid:107) (cid:102) W
i (cid:107) 2 :
L wrm
[Equation] f [Equation] ≤
[Equation] L wrm γ [Equation] f
[Equation] + O
[Equation] γ
[Equation]
where we deﬁne Φ wrm λ ( f w ) to be (cid:8) d (cid:89)
i = (cid:107)
W
i (cid:107) 2 (cid:0)
[Equation]
Using a similar argument to our proofs of Theorems 2 and 3, we can cover the possible spectral norms for each W i with O ((8 d/τ ) log M ) points, such that for any feasible (cid:107) W i (cid:107) 2 value satisfying the theorem’s assumptions, we have value a i in our cover where (cid:12)(cid:12) (cid:107) W
i
(cid:107) 2 − a i (cid:12)(cid:12) ≤ 1 4 d/τ a i .
Therefore, we can cover all feasible combinations of spectral norms with O (((8 d/τ ) log M ) d dn 1 / 2 d ) , which combined with the above discussion ﬁnishes the proof.