M ANIFOLD R EGULARIZATION FOR L OCALLY S TABLE D EEP N EURAL N ETWORKS
Anonymous authors
Paper under double-blind review
A BSTRACT
We apply concepts from manifold regularization to develop new regularization techniques for training locally stable deep neural networks.
Our regularizers encourage functions which are smooth not only in their predictions but also their decision boundaries.
Empirically, our networks exhibit stability in a diverse set of perturbation models, including (cid:96) 2 , (cid:96) ∞ , and Wasserstein-based perturbations; in particular, against a state-of-the-art PGD adversary, a single model achieves both (cid:96) ∞ robustness of 40% at (cid:15) = 8 / 255 and (cid:96) 2 robustness of 48% at (cid:15) = 1 . 0 on
CIFAR-10.
We also obtain state-of-the-art veriﬁed accuracy of 21% in the same (cid:96) ∞ setting.
Furthermore, our techniques are efﬁcient, incurring overhead on par with two additional parallel forward passes through the network; in the case of
CIFAR-10, we achieve our results after training for only 3 hours, compared to more than 70 hours for standard adversarial training.
I NTRODUCTION
Recent results in deep learning highlight the remarkable performance deep neural networks can achieve on tasks using data from the natural world, such as images, video, and audio.
Though such data inhabits an input space of high dimensionality, the physical processes which generate the data often manifest signiﬁcant biases, causing realistic inputs to be sparse in the input space.
One way of capturing this intuition is the manifold assumption, which states that input data is not drawn uniformly from the input space, but rather supported on some smooth submanifold(s) of much lower dimension.
Starting with the work of Belkin et al.
(2006), this formulation has been studied extensively in the setting of semi-supervised kernel and regression methods, where algorithms exploit the unlabelled data points to learn functions which are smooth on the input manifold (Geng et al., 2012; Goldberg et al., 2008; Niyogi, 2013; Sindhwani et al., 2005; Tsang and Kwok, 2007;
Xu et al., 2010).
Such techniques have seen less use in the context of deep neural networks, owing in part to the ability of such models to generalize from relatively sparse data (Zhang et al., 2016).
Contributions We apply concepts from manifold regularization to train locally stable deep neural networks.
In light of recent results showing that neural networks suffer widely from adversarial inputs (Szegedy et al., 2013), our goal is to learn a function which does not vary much in the neighborhoods of natural inputs, independently of whether the network classiﬁes correctly.
We show that this deﬁnition of local stability has a natural interpretation in the context of manifold regularization, and propose an efﬁcient regularizer based on an approximation of the graph Laplacian when the data is sparse, i.e., the pairwise distances are large.
Crucially, our regularizer exploits the continuous piecewise linear nature of ReLU networks to learn a function which is smooth over the data manifold in not only its outputs but also its decision boundaries.
We evaluate our approach by training neural networks with our regularizers for the task of image classiﬁcation on CIFAR-10 (Krizhevsky et al., 2009).
Empirically, our networks exhibit robustness against a variety of adversarial models implementing (cid:96) 2 , (cid:96) ∞ , and Wasserstein-based attacks.
We also achieve state-of-the-art veriﬁed robust accuracy under (cid:96) ∞ of size (cid:15)
= 8 / 255 .
Furthermore, our regularizers are cheap: we simply evaluate the network at two additional random points for each training sample, so the total computational cost is on par with three parallel forward passes through the network.
Our techniques thus present a novel, regularization-only approach to learning robust neural networks, which achieves performance comparable to existing defenses while also being an order of magnitude more efﬁcient.
B ACKGROUND
Manifold regularization The manifold assumption states that input data is not drawn uniformly from the input domain X , also know as the ambient space , but rather is supported on a submanifold
M ⊂ X , called the intrinsic space .
There is thus a distinction between regularizing on the ambient space, where the learned function is smooth with respect to the entire input domain (e.g., Tikhonov regularization (Phillips, 1962;
Tikhonov et al., 2013)), and regularizing over the intrinsic space, which uses the geometry of the input submanifold to determine the regularization norm.
A common form of manifold regularization assumes the gradient of the learned function ∇ M f ( x ) should be small where the probability of drawing a sample is large; we call such functions “smooth”.
Let µ be a probability measure with support M .
This leads to the following intrinsic regularizer:
[Equation]
In general, we cannot compute this integral because M is not known, so Belkin et al.
(2006) propose the following discrete approximation that converges to the integral as the number of samples grows:
[Equation]
Here, the x 1 , ..., x N are samples drawn, by assumption, from the input manifold M according to µ , and L is a matrix of weights measuring the similarity between samples.
The idea is to approximate the continuous input manifold using a discrete graph, where the vertices are samples, the edge weights are distances between points, and the Laplacian matrix L encodes the structure of this graph.
A common choice of weights is a heat kernel: L i,j = L ( x i , x j ) := exp( −|| x i − x j || 2 /s ) .
To improve computational costs, weights are often truncated to the k -nearest neighbors or within some (cid:15) -ball.
Note that the Laplacian can also be interpreted as a discrete matrix operator, which converges under certain conditions to the continuous Laplace operator (Belkin and Niyogi, 2008).
ReLU networks Our development focuses on a standard architecture for deep neural networks: fully-connected feedforward networks with ReLU activations.
In general, we can write the function represented by such a network with n layers and parameters θ =
{ A i , b i } i =1 ,...,n
[Equation]
1 as
[Equation]
where the A i are the weight matrices and the b i are the bias vectors.
We call the z i “hidden activations”, or more simply, activations, and the ˆ z i “pre-activations”.
In this work, we consider networks in which σ ( · ) in (5) is the Rectiﬁed Linear Unit (ReLU)
[Equation]
It is clear from this description that ReLU networks are a family of continuous piecewise linear functions.
We denote the linear function induced by an input x as f x ( · ; θ ) , i.e., the analytic extension of the local linear component about x over the input domain.
Adversarial robustness One common measure of robustness for neural networks is against a norm-bounded adversary.
In this model, the adversary is given an input budget (cid:15) over a norm ||·|| in , and asked to produce an output perturbation δ over a norm | · | out .
A point x (cid:48) is an (cid:15) - δ adversarial example for an input pair ( x, y ) if
[Equation]
When the speciﬁc norm is either unimportant or clear from context, we also write the ﬁrst condition as x (cid:48) ∈ N (cid:15) ( x ) , where N (cid:15) ( x ) refers to the (cid:15) -ball or neighborhood about x .
If such an adversarial example does not exist, we say that the network is (cid:15) - δ robust at x .
Standard examples of || · || in include the (cid:96) 2 and (cid:96) ∞ “norm”, deﬁned for vectors as || x || ∞ :
= max i | x i | .
For classiﬁcation tasks, the adversary is successful if it produces an example in the (cid:15) -neighborhood of x which causes the network to misclassify.
In this case, we drop δ and say that the network is (cid:15) -robust at x .
Note that if f ( x ; θ ) is already incorrect, then x sufﬁces as an adversarial example.
R ELATED WORK
Manifold regularization was ﬁrst introduced by Belkin et al.
(2006) in the context of semi-supervised learning, where the goal was to leverage unlabeled samples to learn a function which behaves well (e.g., is smooth, or has low complexity) over the data manifold.
The use of manifold regularization for deep neural networks has been explored in several contexts (Tomar and Rose, 2014; 2016;
Hu et al., 2018; Zhu et al., 2018).
In particular, Lee et al.
(2015) combine manifold regularization with adversarial training and show improvements in standard test accuracy.
Our approach is to use manifold regularization to induce stability separately from accuracy.
We note that a similar decomposition between accuracy and stability forms the basis for the TRADES algorithm (Zhang et al., 2019), though the training procedure ultimately relies on adversarial training.
Hein and Andriushchenko (2017) propose a conceptually similar regularizer to minimize the difference between logits and show improved (cid:96) 2 certiﬁed robustness.
Finally, several prior works explore regularizing for robustness based on other differential forms (Ross and Doshi-Velez, 2017; Jakubovitz and
Giryes, 2018), though they only report results using the weaker single-step PGD adversary.
In particular, a recent work by Zhai et al.
(2020) uses randomized smoothing for (cid:96) 2 certiﬁed robustness, and claim similar computational advantage due to avoiding adversarial training, but still takehours to train, compared to only 3 hours in our approach.
Adversarial examples were introduced by Szegedy et al.
(2013), who found that naively trained neural networks suffer almost complete degradation of performance on natural images under slight perturbations which are imperceptible to humans.
A standard class of defenses is adversarial training , which is characterized by training on adversarially generated input points (Goodfellow et al., 2014).
In particular, the Projected Gradient Descent (PGD) attack (Kurakin et al., 2016; Madry et al., 2017) is widely considered to be an empirically sound algorithm for both training and evaluation of robust models.
However, such training methods rely on solving an inner optimization via an iterative method, effectively increasing the number of epochs by a multiplicative factor (e.g., an overhead of 5–10x for standard PGD).
Achieving robustness against multiple adversarial models has also been explored previously (Schott et al., 2018; Tramer and Boneh, 2019; Maini et al., 2019;
Croce and Hein, 2019b), though in most cases these works use weaker variants of the subset of standard adversaries we consider (e.g., a smaller (cid:15) or the single-step version of PGD).
Another approach is to train models which are provably robust .
One method is to use an exact veriﬁcation method, such as an MILP solver, to prove that the network is robust on given inputs (Tjeng et al., 2017).
In particular, Xiao et al.
(2019) use a similar loss based on ReLU pre-activations to learn stable ReLUs for efﬁcient veriﬁcation, but rely on a PGD adversary to train a robust model.
Certiﬁcation methods modify models to work directly with neighborhoods instead of points (Dvijotham et al., 2018; Gowal et al., 2018; Mirman et al., 2018; Wong et al., 2018).
In practice, the inference algorithms must overapproximate the neighborhoods to preserve soundness while keeping the representation compact as it passes through the network.
This strategy can be interpreted as solving a convex relaxation of the exact veriﬁcation problem.
Though certiﬁcation thus far has produced better lower bounds, veriﬁcation as a technique is fully general and can be applied to any model (given sufﬁcient time); recent work also suggests that methods using layerwise convex relaxations may face an inherent barrier to tight veriﬁcation (Salman et al., 2019).
S ETTING
We reframe the goal of learning functions that are robust using a perspective which decouples stability from accuracy.
The key observation is that we would like to train networks that are locally stable around natural inputs, even if the network output is incorrect.
This approach contrasts with adversarial training, which attempts to train the network to classify correctly on worst-case adversarial inputs.
In particular, recall that a network is (cid:15)
-robust at x if no point in the (cid:15) -neighborhood of x causes the network to misclassify.
We consider the related property of (cid:15) -stability
(cf.
Zheng et al.
Deﬁnition 4.1.
A function f is (cid:15) - δ stable at an input x
if for all x (cid:48) ∈ N (cid:15) ( x ) , | f ( x ) − f (cid:48)
( x ) | ≤ δ .
A classiﬁer f is (cid:15) -stable
at an input x if for all x (cid:48) ∈ N (cid:15) ( x ) , f ( x ) =
f ( x (cid:48) ) .
As (cid:15) -stability is independent of the correct label for x , we argue that (cid:15) -stability is a property of the function with respect to the input manifold and can thus be captured using manifold regularization.
For completeness, we state the following connection between robustness and stability:
Proposition 4.1.
A function f is (cid:15) - δ robust at an input x
iff f is (cid:15) - δ stable at x and f ( x ) =
y .
A classiﬁer f is (cid:15) -robust
at an input x iff f is (cid:15) -stable at x and f correctly classiﬁes x .
M ANIFOLD REGULARIZATION FOR DEEP NEURAL NETWORKS
Applying the regularization term in (2) yields, in the limit, a function which is smooth on the data manifold.
Unfortunately, a straightforward approach does not sufﬁce for our goal of learning (cid:15) -stable deep neural networks.
The ﬁrst problem is that smoothness on the data manifold does not yield (cid:15) -stability
(Stutz et al.
; indeed, we are concerned with the behavior of our function in an (cid:15) - neighborhood of the manifold, not just on the manifold.
The second observation is that convergence of the discrete approximation requires that the samples be dense over the input manifold; however, this assumption is almost certainly violated in most practical applications, particularly in the deep learning regime.
The next two sections are dedicated to these challenges.
5. R ESAMPLING FOR LOCAL SMOOTHNESS
We write the (cid:15) -neighborhood of a manifold M as M (cid:15) :
= { x : ∃ y ∈ M , || x − y || ≤ (cid:15) } .
Since (cid:15) -stability is deﬁned over the (cid:15) -neighborhood of every input point, we might want a function which is smooth over M (cid:15) instead of just M , e.g., by slightly perturbing every input point.
This strategy does produce samples from the (cid:15) -neighborhood of the data manifold, however note that the induced distribution is not uniform but rather the convolution of the choice of noise distribution with the uniform distribution over M .
Nevertheless, this procedure exhibits several properties we can exploit.
The ﬁrst is that for sufﬁciently small (cid:15) , we get nearly the same operator over M (cid:15) and M , so that smoothness over M (cid:15) does not sacriﬁce smoothness on the original data manifold M .
A more subtle property is that we can actually draw as many distinct points as we would like from M (cid:15) .
We leverage these extra points to build a regularizer which yields good estimations of the local smoothness.
Moreover, taking a discrete approximation of the form in Equation 2 with the resampled points from
M (cid:15) still converges to the original operator.
Formally, we can state the following:
Proposition 5.1.
Let (cid:15), s > 0 be given.
Let x 1 , ..., x n be n samples drawn uniformly at random from a submanifold M ⊂ X .
For each x i , pick c new points x i, 1 , ..., x i,c by sampling iid perturbations δ i, 1 , ..., δ i,c and setting x i,j = x
i
+ δ i,j , where ∀ i, j , || δ i,
j || < (cid:15) .
Given a kernel k s ( x, y ) =
exp( −|| x − y || 2 /s ) , let L and L c be the Laplacian matrices deﬁned by the n original samples and n · c new samples, respectively.
Then if (cid:15) 2 < s , we have that L and L c converge to the same operator in the limit as n → ∞ .
We prove this result in Appendix A. For our purposes, this result states that the resampled Laplacian enjoys the same behavior in the limit as the original Laplacian.
5. S PARSE APPROXIMATION OF RESAMPLED L APLACIAN
The Laplacian matrix is dense, and requires both O ( N 2 ) time and space to compute and store.
It is thus standard to employ heuristics for sparsifying Laplacians to derive efﬁcient algorithms; in this work, we consider the (cid:15) -neighborhood sparsiﬁer, denoted L (cid:15) , which is deﬁned as the Laplacian of the graph created by retaining only those edges whose weights are at most (cid:15) (Von Luxburg, 2007).
To motivate this approach, our main observation is that, under certain sparsity assumptions in the data, the resampled Laplacian will consist of two types of edges: very short edges between points resampled from the same (cid:15) -neighborhood, and very long edges between points sampled from different (cid:15) -neighborhoods.
For an appropriate choice of the scale factor s , the exponential form of the heat kernel causes the weights on the long edges to fall off very quickly compared to the short edges.
The following results gives bounds for this approximation of the regularizer in Equation 2 under a certain separation assumption in the data:
Proposition 5.2. Consider a function f and a set of points { x i } Ni =1 such that the pairwise differences bounded from above and below by 0 < c 1 ≤ || f
( x i ) − f ( x j ) || 22 ≤ c 2 < ∞ for all i (cid:54) =
j .
Let s be the parameter of the heat kernel k s = exp( −|| x i − x j || 2 /s ) .
Assume further that the points { x i } are separated in the sense that there exist at least O ( n ) pairs of points ( x i 1 , x i 2 ) , i ∈ S whose distances are bounded from above by √ s , and the remainder of the points have distances bounded from below by m √ s for some constant m > 1 .
Writing R ( L ) :
= (cid:80) Ni,j =
( f ( x i ) − f ( x j ))
2 L i,j , we have that
[Equation]
[Equation]
where b =
Θ(( c 1 /c 2 )(exp( m 2 ) /N )) .
We give a proof in Appendix A. In this work, we only consider bounded functions f , which allows us to apply this proposition. This result gives two bounds on the dense regularization R ( L ) in terms of R ( L (cid:15) ) .
The ﬁrst inequality says that the absolute approximation error is bounded by a term which vanishes unless the squared sample count N 2 grows as the exponential of the squared separation m 2 . The third inequality gives a tighter bound on the relative error in a term that vanishes unless the linear sample count N grows as the exponential of the squared separation m 2 , but requires that we have good control over the ratio c 1 /c 2 . Note that the dependence on c 1 /c 2 is unavoidable in the sense that a function which is very smooth in local neighborhoods of size s will necessarily have large relative contribution from the longer edges; however, in this case we still have a bound on the absolute contribution (though we trade the ratio c 1 /c 2 for a factor of N ). Crucially, in both cases the error bound depends on an exponential factor of the squared separation m 2 .
To provide some empirical evidence that the separation m can be made non-trivial in some settings, we offer the following statistics from CIFAR-10.
We select a random subset of 10,000 (20%) training samples.
For each of these points, we ﬁnd the closest point within the remaining 49, training samples, and compute the distance.
Using the (cid:96) 2 metric, we found a mean distance of 9.597, a median distance of 9.405, and the distance at the 10th percentile to be 5.867.
Conversely, we resample points in an (cid:96) ∞ ball of radius (cid:15) = 8 / 255 , which is contained in an (cid:96) 2 ball of radius √ 3 · 32 · 32 · 8 / 255 = 1 .
In fact, only 21 training samples, or 0.21% of the random subset, have a partner closer than twice the perturbation bounds.
Thus, after the resampling procedure, setting the scale parameter to s = (cid:15) 2 and taking the (cid:15) -neighborhood Laplacian should yield a good approximation to the full Laplacian.
Finally, to generalize this to larger datasets, for ﬁxed s one would expect that the separation m √ s between points grows with the dimension of the ambient space, which gives an exponential decay in the approximation error.
Indeed, this is one of the manifestations of the oft-cited curse of dimensionality (Hastie et al., 2009).
Due to our resampling procedure, we have at least c 2 N points whose squared pairwise distances are less than (cid:15) 2 , which motivates setting s ≈ (cid:15) 2 ; notice that this choice of s satisﬁes the assumptions of
Proposition 5.1 needed for convergence.
However, rather than ﬁnd the (cid:15) -neighborhood
Laplacian, we propose to compute the regularizer only using points resampled from the same (cid:15) -neighorhood, yielding the following sparse approximation of the intrinsic regularizer: [Equation]
[Equation]
We emphasize that this is a heuristic, motivated by computational efﬁciency, whose quality ultimately depends on the sparsity of the dataset and the particular choice of (cid:15) .
In particular, this approximation should not be used when the data is dense and there are many points that are within (cid:15) distance of each other.
However, the diagonal form of this approximation permits extremely efﬁcient computations, particularly on vectorized hardware.
5. H AMMING REGULARIZERS
We additionally leverage the structure of ReLU networks to induce a stronger regularization effect on the data manifold.
The central observation is that not just do we want the function computed by the neural network to be constant (i.e., smooth with respect to its outputs) on the manifold, we also want the network to produce its outputs in roughly the same way.
First, we identify every local linear component f x ( · ; θ ) with its “activation pattern”, i.e., the sequence of branches taken at each ReLU.
We will write f H ( x ; θ ) for the map that takes inputs x to their activation patterns, which live on the unit hypercube { 0 , 1 } N (where N is the number of
ReLUs in the network).
If we endow the hypercube with the standard Hamming distance d H , this induces a pullback (psuedo-)metric in the input space: d ∗ H ( x, y ) =
d H ( f H ( x ; θ ) , f H ( y ; θ )) .
Notice that the metric identiﬁcation is exactly the set of local linear components f x ( · ; θ ) .
Recall that the goal of regularization is to reduce the complexity of the learned function f in the (cid:15) -neighborhood of inputs x .
We argue that d ∗ H provides a concise measure of this complexity.
Speciﬁcally, if we consider the number of distinct local linear components in N (cid:15) ( x ) , then since d ∗ H is a psuedo-metric, we have that ∀ x (cid:48) ∈ N (cid:15) ( x ) , d ∗ H ( x, x (cid:48) ; θ ) =
if and only if N (cid:15) ( x ) is a single linear component.
Thus, minimizing d ∗ H between x and all
x (cid:48) ∈ N (cid:15) ( x ) reduces the number of linear components in the neighborhood of x .
In fact, by the triangle inequality, the same holds in the interior of any convex polytope deﬁned by a set of points { x i } i ∈
I where ∀ i, i (cid:48) ∈
I, d ∗ H ( x i , x i (cid:48) ; θ ) = 0 .
This makes minimizing d ∗ H very sample efﬁcient.
Treating f H ( · ; θ ) as an output of the network, we have the following (sparse) manifold regularizer:
[Equation]
which is just Equations 1 and 11 with the outputs f ( x ) replaced by the activation pattern map.
However, this loss term is not continuous in the inputs, and furthermore, the gradients vanish almost everywhere, so it does not generate good training signals.
We thus use a continuous relaxation:
[Equation]
This form is differentiable everywhere except when ˆ z
= ˆ y , and recovers the Hamming distance when we take α to inﬁnity (after scaling).
Qualitatively, sensitive activations (i.e., small | ˆ z | and | ˆ y | ) are permitted so long as they are precise.
Figure 1 presents the surface and contour plots of
H α .
Note that this idea can be extended more generally to other activation functions by penalizing differing pre-activations more when the second derivative of the activation function is large (and so the ﬁrst-order Taylor approximation has larger errors).
5. T RAINING WITH SPARSE MANIFOLD REGULARIZATION
For every sample x , we generate a new random maximal perturbation ρ ∈ {± (cid:15) } d and produce the pair of perturbed inputs x + := x + p and x − := x − p .
We compute the standard manifold regularization term as || f ( · , θ ) ||
2 I ∝ (cid:80) i
|| f
( x + i ) − f ( x − i )
||
For the Hamming regularizer, we use the (cid:96) 2 norm to combine the Hamming distances between pre-activations within a layer and normalize by twice the number of elements in each layer.
We sum over the layers, then normalize by the total number of layers.
Note that in both cases, the weights L ( x + i , x − i ) can be dropped since the distance between x + i and x − i is constant.
The ﬁnal optimization objective is thus
[Equation]
[Equation]
where V is the loss function, || f ( · , θ )
|| 2 K is the ambient regularizer (e.g., (cid:96) 2 regularization), and the γ K , γ I , γ H are hyperparameters which control the relative contributions of the different regularizers.
5. D ISCUSSION
Our development has focused on learning deep neural networks which are smooth when samples are sparse over the input manifold M .
While this property is related to (cid:15) -stability, in general the two are not equivalent.
Roughly, (cid:15) -stability is inherently a property about worst case behavior, whereas manifold regularization is aimed at learning a function which is smooth on average.
Nonetheless, we note that a function achieving zero loss with the manifold regularizer yields perfect stability (i.e., a constant function on the data manifold).
Next, we discuss our choice to focus on the sparse setting.
The basic idea is two-fold: ﬁrst, the requirement that the learned function be (cid:15) -stable signiﬁcantly alters the geometry of the input manifold; second, when data is sparse, the amount of information one can glean about the overall geometry of the input manifold is limited, as is evidenced by the vanishing weights in the Laplacian.
Our main hypothesis is that the combination of these two observations allows one to formulate a version of the regularizer built from resampled data, which maintains the same properties in the limit but yields more local information when data is sparse.
Conversely, consider the alternative approach, namely, directly learning a smooth function when it is possible to produce samples, not necessarily labelled, that are dense over the input manifold M .
Then given the central thesis behind this work, one would expect stability to improve.
In fact, the top four results for robust accuracy reported in Croce and Hein (2020) all exploit an additional dataset of unlabeled images which is orders of magnitude larger than the original training set (Carmon et al., 2019;
Hendrycks et al., 2019; Uesato et al., 2019; Wang et al., 2020).
E XPERIMENTAL RESULTS
We report results for two models trained on CIFAR-10 image classiﬁcation using our regularization techniques: a smaller CNN for exact veriﬁcation, following Xiao et al.
(2019); and a PreActResNet18 model (He et al., 2016)
for benchmarking against a variety of adversarial models.
We also include three ablation studies for the larger model, including one which does not use the sparsiﬁcation scheme developed in Section 5.2 (dense regularizer), and two using the individual regularizers to isolate their individual effects on stability (intrinsic / Hamming regularizer only).
Appendix B reports training details and hyperparameters; full experimental results (including MNIST, which is not discussed here) are in Appendix C.
6. S TABILITY
The main characteristic that differentiates our approach conceptually from existing methods for adversarial robustness is that we train our models using pure regularization, i.e., without reference to a particular adversary.
In comparison, most methods train and test using inputs produced by the same adversary.
While this procedure yields good performance against the adversary used during training, performance degrades signiﬁcantly when evaluated under different perturbation models.
In general, the bounds for various adversarial models are set so that maximal perturbations remain
[Table]
[Table] somewhat reasonable by human standards; thus, we expect a model that is stable in the general sense to be robust against a variety of adversaries, particularly those not seen during training.
In line with this observation
[Table]
we test a single model trained to be stable using manifold regularization against three norm-bounded perturbation models.
The ﬁrst two constitute the most common settings for adversarial robustness, namely, CIFAR-10 robustness using (cid:96) ∞ and (cid:96) 2 PGD adversaries bounded at (cid:15)
= 8 / 255 and 0 .
5 , respectively.
We also use a Wasserstein-based PGD adversary at (cid:15)
= 0 .
1 , which is a metric for images more closely aligned with human perceptions.
Our results indicates that a model trained using our manifold regularizer does in fact learn to be more stable on test images across a variety of different perturbation models (Table 1).
We obtained our results after training for 3 hours on one GPU, compared to several days for standard PGD training (Shafahi et al., 2019).
For comparison, we note that standard adversarial training using PGD from Madry et al.
(2017) , which forms the basis of every state-of-the-art approach for (cid:96) ∞ robustness (Croce and Hein, 2020), achieves negligible performance when evaluated in the (cid:96) 2 setting.
We also report results from Maini et al.
(2019), which was the only other approach in the literature to evaluate their models for both (cid:96) ∞ and (cid:96) 2 robustness at the full levels of (cid:15) using a PGD adversary
; their models are trained for 50 epochs with 50 steps of PGD against multiple adversaries in parallel ( ≈ 5000 effective epochs).
Finally, we also report results from Wong et al.
(2019) for comparison against the Wasserstein adversary.
Their results are obtained against a PGD adversary using a 50-step inner optimization (number of training epochs is not reported); their baseline model is trained to be certiﬁably robust against (cid:96) ∞ attacks of size (cid:15) = 2 / 255 , and achieves lower robustness than ours.
6. A BLATION STUDIES
We run several ablation studies to better understand the behavior of our methods.
The ﬁrst column of Table 2 reports the veriﬁable robustness of our smaller model, which outperforms the previous state of the art as reported in Xiao et al.
We emphasize that we provide this metric as a baseline for establishing a provable lower bound on the robustness achieved by our defense, compared to empirical robustness which is often a brittle measure of true robustness, particularly for newly proposed defenses (Athalye et al., 2018; Carlini et al., 2019; Tramer et al., 2020).
The second column of Table 2 presents robust accuracy against the standard PGD adversary used in the literature.
The dense regularizer has both lower robust and clean accuracy, which suggests an over-regularization effect stemming from longer edges that do not yield reliable information about the intrinsic geometry of the manifold.
Furthermore, training with the dense regularizer takes around 21.5 hours, or nearly 8 times longer than the sparse method (due to both the overhead of computing additional gradients during backpropogation, as well as the smaller batch sizes for offsetting the increased memory requirements for storing the dense Laplacian).
We also report the results from using intrinsic or Hamming regularizers alone, which indicate that both terms contribute jointly and individually to our performance.
For comparison, we report results for other approaches which are not variants of PGD (i.e., do not rely on solving a minimax problem at each training loop). [Table]
To the best of our knowledge [Table] Pang et al.
(2019) is the only other result in the literature which achieves non-trivial (cid:96) ∞ robust accuracy on the standard benchmark of CIFAR-10 at (cid:15) = 8 /using a regularization-only approach; their results are better than either of our regularizers used independently [Table] but signiﬁcantly worse than when the regularizers are used together
[Table]
in either the sparse or the dense setting.
For context, the best result in this setting is reported by Wang et al.
(2020) using a PGD variant at 65.04% robust accuracy.
C ONCLUSION
We design regularizers based on manifold regularization that encourage piecewise linear neural networks to learn locally stable functions.
We demonstrate this stability by showing that a single model trained using our regularizers is resilient against (cid:96) 2 , (cid:96) ∞ , and Wasserstein-based attacks.
We also achieve state-of-the-art veriﬁed robustness of 21% against (cid:96) ∞ -bounded perturbations of size (cid:15)
= 8 / 255 on CIFAR-10.
Critically, computing our regularizers relies only on random sampling, and thus does not require running an inner optimization loop to ﬁnd strong perturbations at training time.
As such, our techniques exhibit strong scaling, since they increase batch sizes rather than epochs during training, allowing us to train an order of magnitude faster than standard adversarial training.
This work thus presents the ﬁrst regularization-only approach to achieve comparable results to standard adversarial training against a variety of perturbation models.
A P ROOFS
Proof of Proposition 5.1.
Given a heat kernel k s ( x, y ) =
exp( −|| x − y || 2 /s ) and samples x 1 , ..., x N , we deﬁne the discrete operator L for an out-of-sample point x as
[Equation]
Our claim is that the original Laplacian L and the resampled Laplacian L (cid:48) c converge pointwise to the same continuous operator.
The proof proceeds in two parts.
First, we show that resampling once still yields convergence of the
Laplacian.
Notice that we can model the resampling procedure as a form of noise; our desired result follows immediately from the following result of Coifman and Lafon (2006):
Proposition A.1 (Criterion 5 in Coifman and Lafon (2006)) .
Suppose that X is a perturbed version of M , that is, there exists a perturbation function η : M → X with a small norm (the size of the perturbation) such that every point in X can be written as x + η ( x ) for some x ∈ M .
Then the approximation is valid as long as the scale parameter s remains larger than the size of the perturbation.
Since we have that the size of our perturbations is bounded by (cid:15) 2 < s , this gives us the desired result.
Next we show pointwise convergence holds for arbitrary resampling c .
This is a simple consequence of the linearity of the operator L .
We order the samples as x i,j , where i indexes the original data points i = 1 , ..., N , and j indexes the resample j = 1 , ..., c .
Furthermore, let L jc denote
the
Laplacian operator deﬁned only on the j th resampled points x i,j for i = 1 , ..., N .
Then
[Equation]
where the last line follows from the ﬁrst half of the proof.
Remarks.
We have shown that L (cid:48) converges pointwise to the discrete operator L .
However, for
L to converge to its continuous counterpart in Equation 1 (i.e., the Laplace-Beltrami operator), we actually need to take the scale of the kernel s to zero (see, e.g. the proofs of convergence in Belkin and Niyogi (2008);
Hein et al.
Then Proposition 5.1 implies that we also need to take (cid:15) to zero, so that in the limit we are just sampling from the unperturbed manifold.
In fact, it is possible to prove convergence without taking s to zero, however the continuous operator that is recovered no longer refers to the gradient but rather the value of the kernel over the manifold (Von Luxburg et al.
(2008) analyze this case).
The spectra of these operators are often used in various clustering algorithms; in the context of deep neural networks, these operators yield similar regularizers for “smoothness”, though for a different deﬁnition than the one used in this work.
Finally, it should also be noted that the convergence of these operators depends on the intrinsic dimension of the manifold; as we consider here an (cid:15) -neighborhood of the manifold which has the same dimension as the ambient space, our operators will converge more slowly (Wang (2015)).
Proof of Proposition 5.2.
We introduce ¯ L (cid:15) :
=
L − L (cid:15) , which is just the Laplacian on the complement of the (cid:15) neighborhood subgraph, i.e., the subgraph whose edges are at least (cid:15) .
Clearly
R ( L ) =
R (¯ L (cid:15) )
+ R ( L (cid:15) ) .
Then we have the following bounds:
[Equation]
where the a is a constant introduced for the O ( N ) edges in the graph of L (cid:15) .
Take b = ( ac 1 /c 2 )(exp( m 2 − 1) /N ) .
A simple rearrangement gives c 2 = ( b − 1 ac 1 )(exp( m 2 − 1) /N ) , thus we have that
[Equation]
[Equation]
Then the ﬁrst inequality follows from (24), the second inequality is trivial, and the third inequality follows from (23)–(28).
B E XPERIMENTAL METHODS AND HYPERPARAMETERS
We use a PreActResNet18 model (He et al., 2016) for the CIFAR-10 robustness experiments.
We train using SGD with a batch size of 128 and weight decay γ K of 5e-4.
We follow Maini et al.
(2019) for our learning rate schedule, which is piecewise linear and starts at 0 and goes to 0.1 over ﬁrst 40 epochs; 0.005 over the next 40 epochs; and 0 over the ﬁnal 20 epochs.
We increase epsilon from 2 to 8 over epochs 10 to 35.
We start the weight γ
I of the manifold regularization at 0.8 and the weight γ H of the Hamming regularization at 2,400; these increase linearly up to a factor offrom epochs 20 to 80.
We set the hyperparameter α = 8 .
We use this set of hyperparamaters for all the CIFAR-10 ablation studies (except when setting γ I or γ H to 0 for the ablation studies involving the individual regularizers).
For the dense regularizer, we used heat kernel with scale s = (cid:15) 2 as weights for the Laplacian.
We use a smaller batch size of 40 to offset the increased memory requirements of storing and computing the dense regularizer.
We use a two-layer convolutional neural network for the CIFAR-10 veriﬁcation experiments, consisting of 2x2 strided convolutions with 16 and 32 ﬁlters, then a 128 hidden unit fully connected layer.
This is the same model as used in Wong et al.
(2018) and Xiao et al.
(2019), except those works use a 100 hidden unit fully connected layer.
We use the same schedule for the learning rate and (cid:15) as in the PreActResNet18 model.
The weight γ I starts at 0.4 and the weight γ H starts at 9000; these increase linearly up to a factor of 10 from epochs 20 to 80.
We use the same hyperparameter α as for the PreActResNet18 model.
We use the CNN with four convolutional layers plus three fully-connected layers from Carlini and
Wagner (2017) for the MNIST robustness experiments.
We use the same schedule for the learning rate, (cid:15) , γ I , and γ H as in the PreActResNet18 model (except that (cid:15) scales to 0 . 3 ).
We use the same hyperparameter α as for the PreActResNet18 model.
To set the hyperparameters γ I and γ H on the PreActResNet18 model, we ran a grid search for γ I = 0 .
2 , ..., 1 . 0 and γ H /γ
I = 100 , 200 , ..., 500 and selected the settings which yielded the best robust accuracy against a 20-step (cid:96) ∞ PGD adversary with 10 restarts for (cid:15)
= 8 / 255 on the full training set; the range of γ H
/γ
I was set such that the corresponding losses were roughly equal for a randomly initialized, untrained network.
For reporting results, we train ﬁve models using the selected hyperparameters and report results using the one with the median performance on the test set against a 20-step (cid:96) ∞ PGD adversary at (cid:15) = 8 / 255 on CIFAR-10 or 0 .
3 on MNIST.
For the
PreActResNet18 model, robust accuracy over the 5 runs ranged from 40.1% to 41.5% with median 40.5%; clean accuracy ranged from 66.9% to 72.4% with median 70.0%.
For our stability results, we use the full version of AutoAttack+, an ensemble of attacks proposed by Croce and Hein (2020), for the (cid:96) 2 and (cid:96) ∞ perturbations.
We choose the attack because it is parameter-free, which reduces the possibility of misconﬁguration; empirically it is at least as strong as standard PGD, and has been successful in breaking many proposed defenses.
For the Wasserstein adversary, we use an implementation by Wong et al.
For comparing with standard PGD, we use a 20-step PGD adversary with 10 random restarts and a step size of 2 . 5 · (cid:15)/ 20 as implemented by Engstrom et al.
C A DDITIONAL EXPERIMENTS
We plot robustness curves for both CIFAR and MNIST against a standard 20-step PGD adversary with 10 restarts using both (cid:96) 2 and (cid:96) ∞ bounds in Figure 2.
These results show that, compared with models trained using standard PGD against (cid:96) ∞ perturbations, our methods perform on par (or substantially better, in the case of the (cid:96) 2 adversary on CIFAR-10) in a variety of settings, despite the disadvantage of not using the adversary during training.
We also used a stronger AutoAttack+ adversary for the CIFAR-10 results in Table 1, which we plot for reference as “ours (AA+)”.
For the CIFAR-10 results, we use a PreActResNet18 model trained with manifold regularization on
CIFAR-10 at (cid:15) = 8 / 255 .
The curves for PGD are taken from Madry et al.
Our ﬁndings mirror those in Schott et al.
(2018), namely, that a model trained using PGD on CIFAR-10 for (cid:96) ∞ performs poorly against (cid:96) 2 attacks.
We also ran a 500-step (cid:96) ∞ PGD adversary with 20 restarts at (cid:15) = 8 / 255 against our model, yielding 40.4% robust accuracy, which is plotted as “ours (PGD+)”.
For the MNIST results, we use the CNN architecture from Carlini and Wagner (2017), trained with manifold regularization on MNIST at (cid:15)
= 0 .
The curves for PGD are taken from Madry et al.
The difference in performance is much less dramatic in this case, which we attribute to the lower complexity of the task.
We note in particular that both methods experience a sharp drop in performance in the (cid:96) ∞ case for (cid:15) larger than the one used during training.
[Figure] [Figure]