Title: MMA TRAINING: DIRECT INPUT SPACE MARGIN MAXIMIZATION THROUGH ADVERSARIAL TRAINING

Abstract: We study adversarial robustness of neural networks from a margin maximization perspective, where margins are defined as the distances from inputs to a classifier's decision boundary. Our study shows that maximizing margins can be achieved by minimizing the adversarial loss on the decision boundary at the "shortest successful perturbation", demonstrating a close connection between adversarial losses and the margins. We propose Max-Margin Adversarial (MMA) training to directly maximize the margins to achieve adversarial robustness. Instead of adversarial training with a fixed , MMA offers an improvement by enabling adaptive selection of the "correct" as the margin individually for each data point. In addition, we rigorously analyze adversarial training with the perspective of margin maximization, and provide an alternative interpretation for adversarial training, maximizing either a lower or an upper bound of the margins. Our experiments empirically confirm our theory and demonstrate MMA training's efficacy on the MNIST and CIFAR10 datasets w.r.t. ∞ and 2 robustness. Code and models are available at

1. INTRODUCTION:

Figure 1 : Illustration of decision boundary, margin, and shortest successful perturbation on application of an adversarial perturbation.

Despite their impressive performance on various learning tasks, neural networks have been shown to be vulnerable to adversarial perturbations (Szegedy et al., 2013; Biggio et al., 2013 ). An artificially constructed imperceptible perturbation can cause a significant drop in the prediction accuracy of an otherwise accurate network. The level of distortion is measured by the magnitude of the perturbations (e.g. in ∞ or 2 norms), i.e. the distance from the original input to the perturbed input. Figure 1 shows an example, where the classifier changes its prediction from panda to bucket when the input is perturbed from the blue sample point to the red one. Figure 1 also shows the natural connection between adversarial robustness and the margins of the data points, where the margin is defined as the distance from a data point to the classifier's decision boundary. Intuitively, the margin of a data point is the minimum distance that x has to be perturbed to change the classifier's prediction. Thus, the larger the margin is, the farther the distance from the input to the decision boundary is, the more robust the classifier is w.r.t. this input.

Although naturally connected to adversarial robustness, "directly" maximizing margins has not yet been thoroughly studied in the adversarial robustness literature. Instead, the method of minimax adversarial training (Huang et al., 2015; Madry et al., 2017) is arguably the most common defense to adversarial perturbations due to its effectiveness and simplicity. Adversarial training attempts to minimize the maximum loss within a fixed sized neighborhood about the training data using projected gradient descent (PGD). Despite advancements made in recent years (Hendrycks et al., 2019; Zhang et al., 2019a; Shafahi et al., 2019; Zhang et al., 2019b; Stanforth et al., 2019; Carmon et al., 2019) , adversarial training still suffers from a fundamental problem, the perturbation length has to be set and is fixed throughout the training process. In general, the setting of is arbitrary, based on assumptions on whether perturbations within the defined ball are "imperceptible" or not. Recent work (Guo et al., 2018; Sharma et al., 2019) has demonstrated that these assumptions do not consistently hold true, commonly used settings assumed to only allow imperceptible perturbations in fact do not. If is set too small, the resulting models lack robustness, if too large, the resulting models lack in accuracy. Moreover, individual data points may have different intrinsic robustness, the variation in ambiguity in collected data is highly diverse, and fixing one for all data points across the whole training procedure is likely suboptimal.

Instead of improving adversarial training with a fixed perturbation magnitude, we revisit adversarial robustness from the margin perspective, and propose Max-Margin Adversarial (MMA) training for "direct" input margin maximization. By directly maximizing margins calculated for each data point, MMA training allows for optimizing the "current robustness" of the data, the "correct" at this point in training for each sample individually, instead of robustness w.r.t. a predefined magnitude.

While it is intuitive that one can achieve the greatest possible robustness by maximizing the margin of a classifier, this maximization has technical difficulties. In Section 2, we overcome these difficulties and show that margin maximization can be achieved by minimizing a classification loss w.r.t. model parameters, at the "shortest successful perturbation". This makes gradient descent viable for margin maximization, despite the fact that model parameters are entangled in the constraints.

We further analyze adversarial training (Huang et al., 2015; Madry et al., 2017) from the perspective of margin maximization in Section 3. We show that, for each training example, adversarial training with fixed perturbation length is maximizing a lower (or upper) bound of the margin, if is smaller (or larger) than the margin of that training point. As such, MMA training improves adversarial training, in the sense that it selects the "correct" , the margin value for each example.

Finally in Section 4, we test and compare MMA training with adversarial training on MNIST and CIFAR10 w.r.t. ∞ and 2 robustness. Our method achieves higher robustness accuracies on average under a variety of perturbation magnitudes, which echoes its goal of maximizing the average margin. Moreover, MMA training automatically balances accuracy vs robustness while being insensitive to its hyperparameter setting, which contrasts sharply with the sensitivity of standard adversarial training to its fixed perturbation magnitude. MMA trained models not only match the performance of the best adversarially trained models with carefully chosen training under different scenarios, it also matches the performance of ensembles of adversarially trained models.

In this paper, we focus our theoretical efforts on the formulation for directly maximizing the input space margin, and understanding the standard adversarial training method from a margin maximization perspective. We focus our empirical efforts on thoroughly examining our MMA training algorithm, comparing with adversarial training with a fixed perturbation magnitude.

1.1. RELATED WORKS:

Although not often explicitly stated, many defense methods are related to increasing the margin. One class uses regularization to constrain the model's Lipschitz constant (Cisse et al., 2017; Ross & Doshi-Velez, 2017; Hein & Andriushchenko, 2017; Sokolic et al., 2017; Tsuzuku et al., 2018) , thus samples with small loss would have large margin since the loss cannot increase too fast. If the Lipschitz constant is merely regularized at the data points, it is often too local and not accurate in a neighborhood. When globally enforced, the Lipschitz constraint on the model is often too strong that it harms accuracy. So far, such methods have not achieved strong robustness. There are also efforts using first-order approximation to estimate and maximize input space margin (Matyasko & Chau, 2017; Elsayed et al., 2018; Yan et al., 2019) . Similar to local Lipschitz regularization, the reliance on local information often does not provide accurate margin estimation and efficient maximization. Such approaches have also not achieved strong robustness so far. Croce et al. (2018) aim to enlarge the linear region around a input example, such that the nearest point, to the input and on the decision boundary, is inside the linear region. Here, the margin can be calculated analytically and hence maximized. However, the analysis only works on ReLU networks, and the implementation so far only works on improving robustness under small perturbations. We defer some detailed discussions on related works to Appendix B, including a comparison between MMA training and SVM.

1.2. NOTATIONS AND DEFINITIONS:

We focus on K-class classification problems. Denote S = {x i , y i } as the training set of inputlabel data pairs sampled from data distribution D. We consider the classifier as a score function Theorem 2.1 summarizes the theoretical results, where we show separately later 1) how to calculate the gradient of the margin under some smoothness assumptions; 2) without smoothness, margin maximization can still be achieved by minimizing the loss at the shortest successful perturbation.

Calculating gradients of margins for smooth loss and norm: Denote L LM θ (x + δ, y) by L(δ, θ) for brevity. It is easy to see that for a wrongly classified example (x, y), δ * is achieved at 0 and thus ∇ θ d θ (x, y) = 0. Therefore we focus on correctly classified examples. Denote the Lagrangian as L θ (δ, λ) = δ + λL(δ, θ). For a fixed θ, denote the optimizers of L θ (δ, λ) by δ * and λ * . The following theorem shows how to compute ∇ θ d θ (x, y). Proposition 2.1. Let (δ) = δ . Given a fixed θ, assume that δ * is unique, (δ) and L(δ, θ) are C 2 functions in a neighborhood of (δ * , θ), and the matrix

∂ 2 (δ * ) ∂δ 2 + λ * ∂ 2 L(δ * ,θ) ∂δ 2 ∂L(δ * ,θ) ∂δ ∂L(δ * ,θ) ∂δ 0 is full rank, then ∇ θ d θ (x, y) = C(θ, x, y) ∂L(δ * , θ) ∂θ , where C(θ, x, y) = ∂ (δ * ) ∂δ , ∂L(δ * ,θ) ∂δ ∂L(δ * ,θ) ∂δ 2 2

is a scalar.

Remark 2.1. By Proposition 2.1, the margin's gradient w.r.t. to the model parameter θ is proportional to the loss' gradient w.r.t. θ at δ * , the shortest successful perturbation. Therefore to perform gradient ascent on the margin, we just need to find δ * and perform gradient descent on the loss.

Margin maximization for non-smooth loss and norm: Proposition 2.1 requires the loss function and the norm to be C 2 at δ * . This might not be the case for many functions used in practice, e.g. ReLU networks and the ∞ norm. Our next result shows that under a weaker condition of directional differentiability (instead of C 2 ), learning θ to maximize the margin can still be done by decreasing L(δ * , θ) w.r.t. θ, at θ = θ 0 . Due to space limitations, we only present an informal statement here. Rigorous statements can be found in Appendix A.2. Proposition 2.2. Let δ * be unique and L(δ, θ) be the loss of a deep ReLU network. There exists some direction v in the parameter space, such that the loss L(δ, θ)| δ=δ * can be reduced in the direction of v. Furthermore, by reducing L(δ, θ)| δ=δ * , the margin is also guaranteed to be increased.

Figure 2 illustrates the relationship between the margin and the adversarial loss with an imaginary example. Consider a 1-D example in Figure 2 (a), where the input example x is a scalar. We perturb x in the positive direction with perturbation δ. As we fix (x, y), we overload L(δ, θ) = L LM θ (x + δ, y), which is monotonically increasing on δ, namely larger perturbation results in higher loss. Let L(•, θ 0 ) (the dashed curve) denote the original function before an update step, and δ * 0 = arg min L(δ,θ0)≥0 δ denote the corresponding margin (same as shortest successful perturbation in 1D). As shown in Figure 2 (b), as the parameter is updated to θ 1 such that L(δ * 0 , θ 1 ) is reduced, the new margin δ * 1 = arg min L(δ,θ1)≥0 δ is enlarged. Intuitively, a reduced value of the loss at the shortest successful perturbation leads to an increase in margin.

where δ * = arg min L SLM θ (x+δ,y)≥0 δ is found with the SLM loss, and

H θ = {i : d θ (x i , y i ) < d max } is the set

of examples that have margins smaller than the hinge threshold.

2.3. FINDING THE OPTIMAL PERTURBATION δ *:

To implement MMA, we still need to find the δ * , which is intractable in general settings. We propose an adaptation of the projected gradient descent (PGD) (Madry et al., 2017) attack to give an approximate solution of δ * , the Adaptive Norm Projective Gradient Descent Attack (AN-PGD). In AN-PGD, we apply PGD on an initial perturbation magnitude init to find a norm-constrained perturbation δ 1 , then we search along the direction of δ 1 to find a scaled perturbation that gives L = 0, we then use this scaled perturbation to approximate * . Note that AN-PGD here only serves as an algorithm to give an approximate solution of δ * , and it can be decoupled from the remaining parts of MMA training. Other attacks that can serve a similar purpose can also fit into our MMA training framework, e.g. the Decoupled Direction and Norm (DDN) attack (Rony et al., 2018) . Algorithm 1 describes the Adaptive Norm PGD Attack (AN-PGD) algorithm.

Algorithm 1 Adaptive Norm PGD Attack for approximately solving δ * . Inputs: (x, y) is the data example. init is the initial norm constraint used in the first PGD attack. Outputs: δ * , approximate shortest successful perturbation. Parameters: max is the maximum perturbation length. PGD(x, y, ) represents PGD perturbation δ with magnitude . 

2.4. ADDITIONAL CLEAN LOSS DURING TRAINING:

In practice, we observe that when the model is only trained with the objective function in Eq. ( 7), the input space loss landscape is very flat, which makes PGD less efficient in finding δ * for training, as shown in Figure 3 . Here we choose 50 examples from both the training and test sets respectively, then perform the PGD attack with = 8/255 and keep those failed perturbations. For each example, we linearly interpolate 9 more points between the original example and the perturbed example, and plot their logit margin losses. In each sub-figure, the horizontal axis is the relative position of the interpolated example: e.g. 0.0 represents the original example, 1.0 represents the perturbed example with = 8/255, 0.5 represents the average of them. The vertical axis is the logit margin loss. Recall that when L LM θ (x + δ, y) < 0, the perturbation δ fails. OMMA-32 in Figure 3a represents model trained with only L MMA θ in Eq. ( 7) with d max = 8. PGD-8 Figure 3b represents model trained with PGD training (Madry et al., 2017 ) with = 8. As one can see, OMMA-32 has "flatter" loss curves compared to PGD-8. This could potentially weaken the adversary during training, which leads to poor approximation of δ * and hampers training.

To alleviate this issue, we add an additional clean loss term to the MMA objective in Eq. ( 7) to lower the loss on clean examples, such that the input space loss landscape is steeper. Specifically, we use the following combined loss

EQUATION

The model trained with this combined loss and d max = 32 is the MMA-32 shown in Figure 3c . Algorithm 2 summarizes our practical MMA training algorithm. During training for each minibatch, we 1) separate it into 2 batches based on if the current prediction matches the label; 2) find δ * for each example in the "correct batch"; 3) calculate the gradient of θ based on Eqs. ( 7) and (8).

3. UNDERSTANDING ADVERSARIAL TRAINING W.R.T. MARGIN:

Through our development of MMA training in the last section, we have shown that margin maximization is closely related to adversarial training with the optimal perturbation length δ * . In this section, we further investigate the behavior of adversarial training in the perspective of margin maximization. Adversarial training (Huang et al., 2015; Madry et al., 2017) minimizes the "worst-case" loss under a fixed perturbation magnitude , as follows.

EQUATION

Looking again at Figure 2 , we can see that an adversarial training update step does not necessarily increase the margin. In particular, as we perform an update to reduce the value of loss at the fixed perturbation , the parameter is updated from θ 0 to θ 1 . After this update, we can imagine two different scenarios for the updated loss functions L θ1 (•) (the solid curve) in Figure 2 (c) and (d). In both (c) and (d), L θ1 ( ) is decreased by the same amount. However, the margin is increased in (c) with δ * 1 > δ * 0 , but decreased in (d) with δ * 1 < δ * 0 . Formalizing the intuitive analysis, we present two theorems connecting adversarial training and margin maximization. For brevity, fixing (x, y), let

L(δ, θ) = L LM θ (x + δ, y), d θ = d θ (x, y), and * θ (ρ) = min δ:L(δ,θ)≥ρ δ . Theorem 3.1. Assuming an update from adversarial training changes θ 0 to θ 1 , such that ρ * = max δ ≤ L(δ, θ 0 ) > max δ ≤ L(δ, θ 1 ), then 1) if = d θ0 , then ρ * = 0, * θ1 (ρ * ) = d θ1 ≥ d θ0 = * θ0 (ρ * ); 2) if < d θ0 , then ρ * ≤ 0, * θ0 (ρ * ) ≤ d θ0 , * θ1 (ρ * ) ≤ d θ1 , and * θ1 (ρ * ) ≥ * θ0 (ρ * ); 3) if > d θ0 , then ρ * ≥ 0, * θ0 (ρ * ) ≥ d θ0 , * θ1 (ρ * ) ≥ d θ1 , and * θ1 (ρ * ) ≥ * θ0 (ρ * ). Remark 3.1.

In other words, adversarial training, with the logit margin loss and a fixed 1) exactly maximizes the margin, if is equal to the margin; 2) maximizes a lower bound of the margin, if is less than the margin; 3) maximizes an upper bound of the margin, if is greater than the margin.

Next we look at adversarial training with the cross entropy loss through the connection between cross entropy and the soft logit margin loss from Proposition 2.4. We first look at adversarial training on the SLM loss. Fixing (x, y),

let d SLM θ = d SLM θ (x, y), and * SLM,θ (ρ) = min L SLM θ (x+δ,y)≥ρ δ . Corollary 3.1. Assuming an update from adversarial training changes θ 0 to θ 1 , such that max δ ≤ L SLM θ0 (x + δ, y) > max δ ≤ L SLM θ1 (x + δ, y), if ≤ d SLM θ0 , then ρ * = max δ ≤ L SLM θ0 (x + δ, y) ≤ 0, * SLM,θ0 (ρ * ) ≤ d θ0 , * SLM,θ1 (ρ * ) ≤ d θ1 , and * SLM,θ1 (ρ * ) ≥ * SLM,θ0 (ρ * ).

(x + δ * , y). Combined with Remark 3.2, these suggest:

Adversarial training with cross entropy loss (Madry et al., 2017) approximately maximizes a lower bound of the margin, if is smaller than or equal to the SLM-margin.

On the other hand, when is larger then the margin, such a relation no longer exists. When is too large, adversarial training is maximizing an upper bound of the margin, which might not necessarily increase the margin. This suggests that for adversarial training with a large , starting with a smaller then gradually increasing it could help, since the lower bound of the margin is maximized at the start of training. Results in Sections 4.1 and 4.2 corroborate exactly with this theoretical prediction.

4. EXPERIMENTS:

We empirically examine several hypotheses and compare MMA training with different adversarial training algorithms on the MNIST and CIFAR10 datasets under ∞ / 2 -norm constrained perturbations. Due to space limitations, we mainly present results on CIFAR10-∞ for representative models in Table 1 . Full results are in Table 2 to 15 in Appendix F. Implementation details are also left to the appendix, including neural network architecture, training and attack hyperparameters.

Our results confirm our theory and show that MMA training is stable to its hyperparameter d max , and balances better among various attack lengths compared to adversarial training with fixed perturbation magnitude. This suggests that MMA training is a better choice for defense when the perturbation length is unknown, which is often the case in practice.

Measuring Adversarial Robustness: We use the robust accuracy under multiple projected gradient descent (PGD) attacks (Madry et al., 2017) as the robustness measure. Specifically, given an example, each model is attacked by both repeated randomly initialized whitebox PGD attacks and numerous transfer attacks, generated from whitebox PGD attacking other models. If any one of these attacks succeed, then the model is considered "not robust under attack" on this example. For each dataset-norm setting and for each example, under a particular magnitude , we first perform N randomly initialized whitebox PGD attacks on each individual model, then use N • (m -1) PGD attacks from all the other models to perform transfer attacks, where m is the total number of models considered under each setting (e.g. CIFAR10-∞ ). In our experiments, we use N = 10 for models trained on CIFAR10, thus the total number of the "combined" (whitebox and transfer) set of attacks is 320 for CIFAR10-∞ (m = 32). 3 We use ClnAcc for clean accuracy, AvgAcc for the average over both clean accuracy and robust accuracies at different 's, AvgRobAcc for the average over only robust accuracies under attack.

Correspondence between d max and : In MMA training, we maximize each example's margin until the margin reaches d max . In standard adversarial training, each example is trained to be robust at . Therefore in MMA training, we usually set d max to be larger than in standard adversarial training. It is difficult to know the "correct" value of d max , therefore we test different d max values, and compare a group of MMA trained models to a group of PGD trained models.

4.1. EFFECTIVENESS OF MARGIN MAXIMIZATION DURING TRAINING:

As discussed in Section 3, MMA training enlarges margins of all training points,while PGD training, by minimizing the adversarial loss with a fixed , might fail to enlarge margins for points with initial margins smaller than . This is because when d θ (x, y) < , PGD training is maximizing an upper bound of d θ (x, y), which may not necessarily increase the margin. To verify this, we track how the margin distribution changes during training processes in two models under the CIFAR10-24 case, MMA-3.0 vs PGD-2.5. We use MMA-d max to denote the MMA trained model with the combined loss in Eq. ( 8) and hinge threshold d max , and PGDto represent the PGD trained (Madry et al., 2017) model with fixed perturbation magnitude . Specifically, we randomly select 500 training points, and measure their margins after each training epoch. We use the norm of the 1000-step DDN attack (Rony et al., 2018) to approximate the margin. The results are shown in Figure 4 , where each subplot is a histogram (rotated by 90 • ) of margin values. For the convenience of comparing across epochs, we use the vertical axis to indicate margin value, and the horizontal axis for counts in the histogram. The number below each subplot is the corresponding training epoch. Margins mostly concentrate near 0 for both models at the beginning. As training progresses, both enlarge margins on average. However, in PGD training, a portion of the margins stay close to 0 throughout the training process, at the same time, also pushing some margins to be even higher than 2.5, likely because PGD training continues to maximize lower bounds of this subset of the total margins, as we discussed in Section 3, the value that the PGD-2.5 model is trained for. MMA training, on the other hand, does not "give up" on those data points with small margins. At the end of training, 37.8% of the data points for PGD-2.5 have margins smaller than 0.05, while only 20.4% for MMA. As such, PGD training enlarges the margins of "easy data" which are already robust enough, but "gives up" on "hard data" with small margins. Instead, MMA training pushes the margin of every data point, by finding the proper . In general, when the attack magnitude is unknown, MMA training is more capable in achieving a better balance between small and large margins, and thus a better balance among adversarial attacks with various 's as a whole.

4.2. GRADUALLY INCREASING HELPS PGD TRAINING WHEN IS LARGE:

Our previous analysis in Section 3 suggests that when the fixed perturbation magnitude is small, PGD training increases the lower bound of the margin. On the other hand, when is larger than the margin, PGD training does not necessarily increase the margin. This is indeed confirmed by our experiments. PGD training fails at larger , in particular = 24/255 for the CIFAR10-∞ as shown in Table 1 . We can see that PGD-24's accuracies at all test 's are around 10%.

Aiming to improve PGD training, we propose a variant of PGD training, named PGD with Linear Scaling (PGDLS), in which we grow the perturbation magnitude from 0 to the fixed magnitude linearly in 50 epochs. According to our theory, gradually increasing the perturbation magnitude could avoid picking a that is larger than the margin, thus managing to maximizing the lower bound of the margin rather than its upper bound, which is more sensible. It can also be seen as a "global magnitude scheduling" shared by all data points, which is to be contrasted to MMA training that gives magnitude scheduling for each individual example. We use PGDLSto represent these models and show their performances also in Table 1 . We can see that PGDLS-24 is trained successfully, whereas PGD-24 fails. At = 8 or 16, PGDLS also performs similar or better than PGD training, confirming the benefit of training with small perturbation at the beginning.

4.3. COMPARING MMA TRAINING WITH PGD TRAINING:

From the first three columns in Table 1 , we can see that MMA training is very stable with respect to its hyperparameter, the hinge threshold d max . When d max is set to smaller values (e.g. 12 and 20), MMA models attain good robustness across different attacking magnitudes, with the best clean accuracies in the comparison set. When d max is large, MMA training can still learn a reasonable model that is both accurate and robust. For MMA-32, although d max is set to a "impossible-tobe-robust" level at 32/255, it still achieves 84.36% clean accuracy and 47.18% robust accuracy at 8/255, thus automatically "ignoring" the demand to be robust at larger 's, including 20, 24, 28 and 32, recognizing its infeasibility due to the intrinsic difficulty of the problem. In contrast, PGD trained models are more sensitive to their specified fixed perturbation magnitude. In terms of the overall performance, we notice that MMA training with a large d max , e.g. 20 or 32, achieves high AvgAcc values, e.g. 28.86% or 29.39%. However, for PGD training to achieve a similar performance, needs to be carefully picked (PGD-16 and PGDLS-16), and their clean accuracies suffer a significant drop.

We also compare MMA models with ensembles of PGD trained models. PGD-ens/PGDLS-ens represents the ensemble of PGD/PGDLS trained models with different 's. The ensemble produces a prediction by performing a majority vote on label predictions, and using the softmax scores as the tie breaker. MMA training achieves similar performance compared to the ensembled PGD models. PGD-ens maintains a good clean accuracy, but it is still marginally outperformed by MMA-32 w.r.t. robustness at various 's. Further note that 1) the ensembling requires significantly higher computation costs both at training and test times; 2) Unlike attacking individual models, attacking ensembles is still relatively unexplored in the literature, thus our whitebox PGD attacks on the ensembles may not be sufficiently effective;5 and 3) as shown in Appendix F, for MNIST-∞ / 2 , MMA trained models significantly outperform the PGD ensemble models.

Comparison with TRADES: TRADES (Zhang et al., 2019b) improves PGD training by decoupling the minimax training objective into an accuracy term and an robustness regularization term. We compare MMA-32 with TRADES6 in Table 1 as their clean accuracies are similar. We see that TRADES outperforms MMA on the attacks of lengths that are less than = 12/255, but it sacrifices the robustness under larger attacks. We note that MMA training and TRADES' idea of optimizing a calibration loss are progresses in orthogonal directions and could potentially be combined.

Testing on gradient free attacks: As a sanity check for gradient obfuscation (Athalye et al., 2018) , we also performed the gradient-free SPSA attack (Uesato et al., 2018) , to all our ∞ -MMA trained models on the first 100 test examples. We find that, in all cases, SPSA does not compute adversarial examples successfully when gradient-based PGD did not.

5. CONCLUSIONS:

In this paper, we proposed to directly maximize the margins to improve adversarial robustness. We developed the MMA training algorithm that optimizes the margins via adversarial training with perturbation magnitude adapted both throughout training and individually for the distinct datapoints in the training dataset. Furthermore, we rigorously analyzed the relation between adversarial training and margin maximization. Our experiments on CIFAR10 and MNIST empirically confirmed our theory and demonstrate that MMA training outperforms adversarial training in terms of sensitivity to hyperparameter setting and robustness to variable attack lengths, suggesting MMA is a better choice for defense when the adversary is unknown, which is often the case in practice. Proof. Recall (δ) = δ . Here we compute the gradient for d θ (x, y) in its general form. Consider the following optimization problem:

d θ (x, y) = min δ∈∆(θ) (δ),

where ∆(θ) = {δ : L θ (x+δ, y) = 0}, and L(δ, θ) are both C 2 functions7 . Denotes its Lagrangian by L(δ, λ), where L(δ, λ) = (δ) + λL θ (x + δ, y) For a fixed θ, the optimizer δ * and λ * must satisfy the first-order conditions (FOC)

EQUATION

L θ (x + δ, y)| δ=δ * = 0.

Put the FOC equations in vector form,

G((δ, λ), θ) = ∂ (δ) ∂δ + λ ∂L θ (x+δ,y) ∂δ L θ (x + δ, y) δ=δ * ,λ=λ * = 0.

Note that G is C 1 continuously differentiable since and L(δ, θ) are C 2 functions. Furthermore, the Jacobian matrix of G w.r.t (δ, λ) is

∇ (δ,λ) G((δ * , λ * ), θ) = ∂ 2 (δ * ) ∂δ 2 + λ * ∂ 2 L(δ * ,L(δ,θ)) ∂δ 2

∂L(δ * ,θ) ∂δ ∂L(δ * ,θ) ∂δ 0 which by assumption is full rank. Therefore, by the implicit function theorem, δ * and λ * can be expressed as a function of θ, denoted by δ * (θ) and λ * (θ).

To further compute ∇ θ d θ (x, y), note that d θ (x, y) = (δ * (θ)). Thus,

EQUATION

where the second equality is by Eq. ( 10). The implicit function theorem also provides a way of computing ∂δ * (θ) ∂θ which is complicated involving taking inverse of the matrix ∇ (δ,λ) G((δ * , λ * ), θ).

Here we present a relatively simple way to compute this gradient. Note that by the definition of δ * (θ), L(δ * (θ), θ) ≡ 0. and δ * (θ) is a differentiable implicit function of θ restricted to this level set. Differentiate with w.r.t. θ on both sides:

EQUATION

)

Combining Eq. ( 11) and Eq. ( 12),

EQUATION

Lastly, note that

∂ (δ) ∂δ + λ ∂L θ (x + δ, y) ∂δ δ=δ * ,λ=λ * 2 = 0.

Published as a conference paper at ICLR 2020 Therefore, one way to calculate λ * (θ) is by

λ * (θ) = ∂ (δ) ∂δ ∂L θ (x+δ,y) ∂δ ∂L θ (x+δ,y) ∂δ ∂L θ (x+δ,y) ∂δ δ=δ * A.2 PROOF OF PROPOSITION 2.2

We provide more detailed and formal statements of Proposition 2.2.

For brevity, consider a K-layers fully-connected ReLU network, f (θ; x) = f θ (x) as a function of θ.

f (θ; x) = V D K W K D K-1 W K-1 • • • D 1 W K x (14)

where the D k are diagonal matrices dependent on ReLU's activation pattern over the layers, and W k 's and V are the weights (i.e. θ). Note that f (θ; x) is a piecewise polynomial functions of θ with finitely many pieces. We further define the directional derivative of a function g, along the direction of v, to be:

g (θ; v) := lim t↓0 g(θ + t v) -g(θ)

t .

Note that for every direction v, there exists α > 0 such that f (θ; x) is a polynomial restricted to a line segment [θ, θ + α v]. Thus the above limit exists and the directional derivative is well defined.

We first show the existence of v and t for l(θ 0 + t v) given any . Let l θ0, v, (t) := sup δ ≤ L(δ, θ 0 + t v). Proposition A.1. For > 0, t ∈ [0, 1], and θ 0 ∈ Θ, there exists a direction v ∈ Θ, such that the derivative of l θ0, v, (t) exists and is negative. Moreover, it is given by l θ0, v, (t) = L (δ * , θ 0 ; v).

Proof. [Proof sketch] Since θ 0 is not a local minimum, there exists a direction d, such that

L (δ * , θ 0 ; v) = ∂L(δ * ,θ0+t v) ∂t is negative.

The Danskin theorem provides a way to compute the directional gradient along this direction v. We basically apply a version of Danskin theorem for directional absolutely continuous maps and semicontinuous maps (Yu, 2012). 1. the constraint set {δ : δ ≤ } is compact; 2. L(θ 0 + t v; x + δ, y) is piecewise Lipschitz and hence absolutely continuous (an induction argument on the integral representation over the finite pieces). 3. L(θ 0 + t v; x + δ, y) is continuous on both δ and along the direction v and hence upper semi continuous. Hence we can apply Theorem 1 in Yu (2012).

Therefore, for any > 0, if θ 0 is not a local minimum, then there exits a direction d, such that for

EQUATION

Our next proposition provides an alternative way to increase the margin of f θ . Proposition A.2. Assume f θ0 has a margin 0 , and θ 1 such that l θ0, v, 0 (t) ≤ l θ1, v, 0 (0) , then f θ1 has a larger margin than 0 .

Proof. Since f θ0 has a margin 0 , thus max

δ ≤ 0 L(θ 0 ; x + δ, y) = 0 Further by l θ0, v, 0 (t) ≤ l θ0, v, 0 (0) , sup δ ≤ L(δ, θ 0 + t v) ≤ sup δ ≤ L(δ, θ 0 ).

To see the equality (constraint not binding), we use the following argument. The envolope function's continuity is passed from the continuity of L(θ 0 ; x + δ, y). The inverse image of a closed set under continuous function is closed. If δ * lies in the interior of max δ ≤ 0 L v, (θ 0 ; x + δ, y) ≥ 0, we would have a contradiction. Therefore the constraint is not binding, due to the continuity of the envolope function. By Eq. ( 15), max δ ≤ 0 L(θ 1 ; x + δ, y) < 0. So for the parameter θ 1 , f θ1 has a margin 1 > 0 .

Therefore, the update θ 0 → θ 1 = θ 0 + t v increases the margin of f θ .

A.3 PROOF OF PROPOSITION 2.3:

Proof.

L LM θ (x, y) = (max

EQUATION

= log(exp(max

EQUATION

≤ log(exp(

EQUATION

≤ log((K -1) exp(max

EQUATION

= log(K -1) + (max

EQUATION

Therefore,

L SLM θ (x, y) -log(K -1) ≤ L LM θ (x, y) ≤ L SLM θ (x, y).

A.4 A LEMMA FOR LATER PROOFS:

The following lemma helps relate the objective of adversarial training with that of our MMA training. Here, we denote L θ (x + δ, y) as L(δ, θ) for brevity. Lemma A.1. Given (x, y) and θ , assume that L(δ, θ) is continuous in δ, then for ≥ 0, and ρ ≥ L(0, θ) ∈ Range(L(δ, θ)), it holds that min

EQUATION

Proof. Eq. ( 23). We prove this by contradiction. Suppose max δ ≤ L(δ, θ) > ρ. When = 0, this violates our asssumption ρ ≥ L(0, θ) in the theorem. So assume > 0. Since L(δ, θ) is a continuous function defined on a compact set, the maximum is attained by δ such that δ ≤ and L( δ, θ) > ρ.

Note that L(δ, θ)) is continuous and ρ ≥ L(0, θ), then there exists δ ∈ 0, δ i.e. the line segment connecting 0 and δ, such that δ < and L( δ, θ) = ρ. This follows from the intermediate value theorem by restricting L(δ, θ) onto 0, δ . This contradicts min L(δ,θ)≥ρ δ = .

If Eq. ( 24). Assume that min L(δ,θ)≥ρ δ > , then {δ : L(δ, θ) ≥ ρ} ⊂ {δ : δ > }. Taking complementary set of both sides, {δ : δ ≤ } ⊂ {δ : L(δ, θ) < ρ}. Therefore, by the compactness of {δ : δ ≤ }, max δ ≤ L(δ, θ) < ρ, contradiction.

max δ ≤ L(δ, θ) < ρ, then {δ : δ ≤ } ⊂ {δ : L(δ, θ) < ρ}. Every point p ∈ {δ : δ ≤ } is in

A.5 PROOF OF THEOREM 3.1

Proof. Recall that L(δ, θ) = L LM θ (x + δ, y), d θ = d θ (x, y), * θ (ρ) = min δ:L(δ,θ)≥ρ δ , and ρ * = max δ ≤ L(δ, θ 0 ) > max δ ≤ L(δ, θ 1 ).

We first prove that ∀ , * θ1 (ρ * ) ≥ * θ0 (ρ * ) by contradiction. We assume * θ1 (ρ * ) < * θ0 (ρ * ). Let δ * θ (ρ) = arg min δ:L(δ,θ)≥ρ δ , which is δ * θ1 (ρ * ) < δ * θ0 (ρ * ) . By Eq. ( 24), we have δ * θ0 (ρ * ) ≤ . Therefore, δ * θ1 (ρ * ) < . Then there exist a δ # ∈ {δ : δ ≤ } such that L(δ # , θ 1 ) ≥ ρ * . This contradicts max δ ≤ L(δ, θ 1 ) < ρ * . Therefore * θ1 (ρ * ) ≥ * θ0 (ρ * ). For 1), = d θ0 . By definition of margin in Eq. ( 1), we have ρ * = max δ ≤d θ 0 L(δ, θ 0 ) = 0. Also by definition of * θ (ρ), * θ0 (0) = d θ0 and * θ1 (0) = d θ1 . For 2), < d θ0 . We have

ρ * = max δ ≤ L(δ, θ 0 ) ≤ max δ ≤d θ 0 L(δ, θ 0 ) = 0. Therefore * θ0 (ρ * ) ≤ * θ0 (0) = d θ0 and * θ1 (ρ * ) ≤ * θ1 (0) = d θ1 . For 3), > d θ0 . We have ρ * = max δ ≤ L(δ, θ 0 ) ≥ max δ ≤d θ 0 L(δ, θ 0 ) = 0. Therefore * θ0 (ρ * ) ≥ * θ0 (0) = d θ0 and * θ1 (ρ * ) ≥ * θ1 (0) = d θ1 .

B MORE RELATED WORKS:

We next discuss a few related works in details.

First-order Large Margin: Previous works (Matyasko & Chau, 2017; Elsayed et al., 2018; Yan et al., 2019) have attempted to use first-order approximation to estimate the input space margin.

For first-order methods, the margin will be accurately estimated when the classification function is linear. MMA's margin estimation is exact when the shortest successful perturbation δ * can be solved, which is not only satisfied by linear models, but also by a broader range of models, e.g. models that are convex w.r.t. input x. This relaxed condition could potentially enable more accurate margin estimation which improves MMA training's performance. Hard-Margin SVM (Vapnik, 2013) in the separable case: Assuming that all the training examples are correctly classified and using our notations on general classifiers, the hard-margin SVM objective can be written as:

EQUATION

On the other hand, under the same "separable and correct" assumptions, MMA formulation in Eq. ( 3) can be written as

EQUATION

which is maximizing the average margin rather than the minimum margin in SVM. Note that the theorem on gradient calculation of the margin in Section 2.1 also applies to the SVM formulation of differentiable functions. Because of this, we can also use SGD to solve the following "SVM-style" formulation:

EQUATION

)

As our focus is using MMA to improve adversarial robustness which involves maximizing the average margin, we delay the maximization of minimum margin to future work. 

Maximizing:



C DETAILED SETTINGS FOR TRAINING:

With respect to the weights on L CE and L MMA in Eq. ( 8), we tested 3 pairs of weights, (1/3, 2/3), (1/2, 1/2) and (2/3, 1/3), in our initial CIFAR10 ∞ experiments. We observed that (1/3, 2/3), namely (1/3 for L CE and 2/3 for L MMA ) gives better performance. We then fixed it and use the same values for all the other experiments in the paper, including the MNIST experiments and 2 experiments.

We The LeNet5 is composed of 32-channel conv filter + ReLU + size 2 max pooling + 64-channel conv filter + ReLU + size 2 max pooling + fc layer with 1024 units + ReLU + fc layer with 10 output classes. We do not preprocess MNIST images before feeding into the model.

For training LeNet5 on all MNIST experiments, for both PGD and MMA training, we use the Adam optimizer with an initial learning rate of 0.0001 and train for 100000 steps with batch size 50. In our initial experiments, we tested different initial learning rate at 0.0001, 0.001, 0.01, and 0.1 and do not find noticeable differences.

We use the WideResNet-28-4 as described in Zagoruyko & Komodakis (2016) for our experiments, where 28 is the depth and 4 is the widen factor. We use "per image standardization"9 to preprocess CIFAR10 images, following Madry et al. (2017) .

For training WideResNet on CIFAR10 variants, we use stochastic gradient descent with momentum 0.9 and weight decay 0.0002. We train 50000 steps in total with batch size 128. The learning rate is set to 0.3 at step 0, 0.09 at step 20000, 0.03 at step 30000, and 0.009 at step 40000. This setting is the same for PGD and MMA training. In our initial experiments, we tested different learning rate at 0.03, 0.1, 0.3, and 0.6, and kept using 0.3 for all our later experiments. We also tested a longer training schedule, following Madry et al. (2017) , where we train 80000 steps with different learning rate schedules. We did not observe improvement with this longer training, therefore kept using the 50000 steps training.

For models trained on MNIST, we use 40-step PGD attack with the soft logit margin (SLM) loss defined in Section 3, for CIFAR10 we use 10 step-PGD, also with the SLM loss. For both MNIST and CIFAR10, the step size of PGD attack at training time is

2.5 number of steps • In AN-PGD, we always perform 10 step bisection search after PGD, with the SLM loss. For AN-PGD, the maximum perturbation length is always 1.05 times the hinge threshold: max = 1.05d max . The initial perturbation length at the first epoch, init , have different values under different settings. init = 0.5 for MNIST 2 , init = 0.1 for MNIST ∞ , init = 0.5 for CIFAR10 2 , init = 0.05 for CIFAR10 2 . In epochs after the first, init will be set to the margin of the same example from last epoch.

Trained models: Various PGD/PGDLS models are trained with different perturbation magnitude , denoted by PGD-or PGDLS-. PGD-ens/PGDLS-ens represents the ensemble of PGD/PGDLS trained models with different 's. The ensemble makes prediction by majority voting on label predictions, and uses softmax scores as the tie breaker. We perform MMA training with different hinge thresholds d max , also with/without the additional clean loss (see next section for details). We use OMMA to represent training with only L MMA θ in Eq. ( 7), and MMA to represent training with the combined loss in Eq. ( 8). When train For each d max value, we train two models with different random seeds, which serves two purposes: 1) confirming the performance of MMA trained models are not significantly affected by random initialization; 2) to provide transfer attacks from an "identical" model. As such, MMA trained models are named as OMMA/MMA-d max -seed. Models shown in the main body correspond to those with seed "sd0".

For MNIST-∞ , we train PGD/PGDLS models with = 0.1, 0.2, 0.3, 0.4, 0.45. We also train OMMA/MMA models with d max = 0.45, each with two random seeds. We also consider a standard model trained on clean images, PGD-ens, PGDLS-ens, and the PGD trained model from Madry et al. (2017) . Therefore, we have in total m = 2 × 5 + 2 × 2 + 4 = 18 models under MNIST-∞ .

For MNIST-2 , we train PGD/PGDLS models with = 1.0, 2.0, 3.0, 4.0. We also train OMMA/MMA models with d max = 2.0, 4.0, 6.0, each with two random seeds. We also consider a standard model trained on clean images, PGD-ens, PGDLS-ens, and the DDN trained model from Rony et al. (2018) . Therefore, we have in total m = 2 × 4 + 2 × 3 × 2 + 4 = 24 models under MNIST-2 .

For CIFAR10-∞ , we train PGD/PGDLS models with = 4, 8, 12, 16, 20, 24, 28, 32 . We also train OMMA/MMA models with d max = 12, 20, 32, each with two random seeds. We also consider a standard model trained on clean images, PGD-ens, PGDLS-ens, and the PGD trained model from Madry et al. (2017) . Therefore, we have in total m = 2 × 8 + 2 × 3 × 2 + 4 = 32 models under CIFAR10-∞ .

For CIFAR10-2 , we train PGD/PGDLS models with = 0.5, 1.0, 1.5, 2.0, 2.5. We also train OMMA/MMA models with d max = 1.0, 2.0, 3.0, each with two random seeds. We also consider a standard model trained on clean images, PGD-ens, PGDLS-ens, and the DDN trained model from Rony et al. (2018) . Therefore, we have in total m = 2 × 5 + 2 × 3 × 2 + 4 = 26 models under MNIST-2 .

With regard to ensemble models, for MNIST-2 PGD/PGDLS-ens, CIFAR10-2 PGD/PGDLS-ens, MNIST-∞ PGDLS-ens, and CIFAR10-∞ PGDLS-ens, they all use the PGD (or PGDLS) models trained at all testing (attacking) 's. For CIFAR10-∞ PGD-ens, PGD-24,28,32 are excluded for the same reason.

D DETAILED SETTINGS OF ATTACKS:

For both ∞ and 2 PGD attacks, we use the implementation from the AdverTorch toolbox (Ding et al., 2019b) . Regarding the loss function of PGD, we use both the cross entropy (CE) loss and the Carlini & Wagner (CW) loss. 10As previously stated, each model will have N whitebox PGD attacks on them, N/2 of them are CE-PGD attacks, and the other N/2 are CW-PGD attacks. Recall that N = 50 for MNIST and N = 10 for CIFAR10. At test time, all the PGD attack run 100 iterations. We manually tune the step size parameter on a few MMA and PGD models and then fix them thereafter. The step size for MNIST-∞ when = 0.3 is 0.0075, the step size for CIFAR10-∞ when = 8/255 is 2/255, the step size for MNIST-2 when = 1.0 is 0.25, the step size for CIFAR10-2 when = 1.0 is 0.25. For other values, the step size is linearly scaled accordingly.

The ensemble model we considered uses the majority vote for prediction, and uses softmax score as the tie breaker. So it is not obvious how to perform CW-PGD and CE-PGD directly on them. Here we take 2 strategies. The first one is a naive strategy, where we minimize the sum of losses of all the models used in the ensemble. Here, similar to attacking single models, we CW and CE loss here and perform the same number attacks.

The second strategy is still a PGD attack with a customized loss towards attacking ensemble models. For the group of classifiers in the ensemble, at each PGD step, if less than half of the classifiers give wrong classification, we sum up the CW losses from correct classifiers as the loss for the PGD attack. If more than half of the classifiers give wrong classification, then we find the wrong prediction that appeared most frequently among classifiers, and denote it as label0, with its corresponding logit, logit0. For each classifier, we then find the largest logit that is not logit0, denoted as logit1. The loss we maximize, in the PGD attack, is the sum of "logit1 -logit0" from each classifier. Using this strategy, we perform additional (compared to attacking single models) whitebox PGD attacks on ensemble models. For MNIST, we perform 50 repeated attacks, for CIFAR10 we perform 10. These are also 100-step PGD attacks.

We expect more carefully designed attacks could work better on ensembles, but we delay it to future work.

For the SPSA attack (Uesato et al., 2018) , we run the attack for 100 iterations with perturbation size 0.01 (for gradient estimation), Adam learning rate 0.01, stopping threshold -5.0 and 2048 samples for each gradient estimate. For CIFAR10-∞ , we use = 8/255. For MNIST-∞ , we use = 0.3.

E EFFECTS OF ADDING CLEAN LOSS IN ADDITION TO THE MMA LOSS:

We further examine the effectiveness of adding a clean loss term to the MMA loss. We represent MMA trained models with the MMA loss in Eq. ( 7) as MMA-d max . In Section 2.4, we introduced MMAC-d max models to resolve MMA-d max model's problem of having flat input space loss landscape and showed its effectiveness qualitatively. Here we demonstrate the quantitative benefit of adding the clean loss.

We observe that models trained with the MMA loss in Eq. ( 7) have certain degrees of TransferGaps. The term TransferGaps represents the difference between robust accuracy under "combined (white-box+transfer) attacks" and under "only whitebox PGD attacks". In other words, it is the additional attack success rate that transfer attacks bring. For example, OMMA-32 achieves 53.70% under whitebox PGD attacks, but achieves a lower robust accuracy at 46.31% under combined (white-box+transfer) attacks, therefore it has a TransferGap of 7.39% (See Appendix F for full results.). After adding the clean loss, MMA-32 reduces its TransferGap at = 8/255 to 3.02%. This corresponds to our observation in Section 2.4 that adding clean loss makes the loss landscape more tilted, such that whitebox PGD attacks can succeed more easily.

Recall that MMA trained models are robust to gradient free attacks, as described in Section 4.3. Therefore, robustness of MMA trained models and the TransferGaps are likely not due to gradient masking.

We also note that TransferGaps for both MNIST-∞ and 2 cases are almost zero for the MMA trained models, indicating that TransferGaps, observed on CIFAR10 cases, are not solely due to the MMA algorithm, data distributions (MNIST vs CIFAR10) also play an important role.

Another interesting observation is that, for MMA trained models trained on CIFAR10, adding additional clean loss results in a decrease in clean accuracy and an increase in the average robust accuracy, e.g. OMMA-32 has ClnAcc 86.11%, and AvgRobAcc 28.36%, whereas MMA-32 has ClnAcc 84.36%, and AvgRobAcc 29.39%. The fact that "adding additional clean loss results in a model with lower accuracy and more robustness" seems counter-intuitive. However, it actually confirms our motivation and reasoning of the additional clean loss: it makes the input space loss landscape steeper, which leads to stronger adversaries at training time, which in turn poses more emphasis on "robustness training", instead of clean accuracy training.

F FULL RESULTS AND TABLES:

We present all the empirical results in Table 4 to 15. Specifically, we show model performances under combined (whitebox+transfer) attacks in Tables 4 to 7 . This is our proxy for true robustness measure. We show model performances under only whitebox PGD attacks in Tables 8 to 11 . We show TransferGaps in Tables 12 to 15 .

In these tables, PGD-Madry et al. models are the "secret" models downloaded from https:// github.com/MadryLab/mnist_challenge and https://github.com/MadryLab/ cifar10_challenge/. DDN-Rony et al. models are downloaded from https://github. com/jeromerony/fast_adversarial/. TRADES models are downloaded from https: //github.com/yaodongyu/TRADES.

For MNIST PGD-Madry et al. models, our whitebox attacks brings the robust accuracy at = 0.3 down to 89.79%, which is at the same level with the reported 89.62% on the website, also with 50 repeated random initialized PGD attacks. For CIFAR10 PGD-Madry et al. models, our whitebox attacks brings the robust accuracy at = 8/255 down to 44.70%, which is stronger than the reported 45.21% on the website, with 10 repeated random initialized 20-step PGD attacks. As our PGD attacks are 100-step, this is not surprising.

We also compared TRADES with MMA trained models under ∞ attacks. On MNIST, overall TRADES outperforms MMA except that TRADES fails completely at large perturbation length of 0.4. This may be because TRADES is trained with attacking length = 0.3, and therefore cannot defend larger attacks. On CIFAR10, we compare MMA-32 with TRADES as their clean accuracies are similar. Similar to the results on MNIST, we see that TRADES outperforms MMA on the attacks of lengths that are less than = 12/255, but it sacrifices the robustness under larger attacks. We also note that MMA training and TRADES' idea of optimizing a calibration loss are progresses in orthogonal directions and could potentially be combined.

As we mentioned previously, DDN training can be seen as a specific instantiation of the general MMA training idea, and the DDN-Rony et al. models indeed performs very similar to MMA trained models when d max is set relatively low. Therefore, we do not discuss the performance of DDN-Rony et al. separately.

In Section 4, we have mainly discussed different phenomena under the case of CIFAR10-∞ . For CIFAR10-2 , we see very similar patterns in Tables 7, 11 and 15. These include • MMA training is fairly stable to d max , and achieves good robustness-accuracy trade-offs.

On the other hand, to achieve good AvgRobAcc, PGD/PGDLS trained models need to have large sacrifices on clean accuracies. We suspect that this is due to the "easiness" of this specific task on MNIST, where finding proper for each individual example is not necessary, and a global scheduling of is enough. We note that this phenomenon confirms our understanding of adversarial training from the margin maximization perspective in Section 3.

Under the case of MNIST-2 , we notice that MMA training almost does not need to sacrifice clean accuracy in order to get higher robustness. All the models with d max ≥ 4.0 behaves similarly w.r.t. both clean and robust accuracies. Achieving 40% robust accuracy at = 3.0 seems to be the robustness limit of MMA trained models. On the other hand, PGD/PGDLS models are able to get higher robustness at = 3.0 with robust accuracy of 44.5%, although with some sacrifices to clean accuracy. This is similar to what we have observed in the case of CIFAR10.

We notice that on both MNIST-∞ and MNIST-2 , unlike CIFAR10 cases, PGD(LS)-ens model performs poorly in terms of robustness. This is likely due to that PGD trained models on MNIST usually have a very sharp robustness drop when the used for attacking is larger than the used for training.

Another significant differences between MNIST cases and CIFAR10 cases is that TransferGaps are very small for OMMA/MMA trained models on MNIST cases. This again is likely due to that MNIST is an "easier" dataset. It also indicates that the TransferGap is not purely due to the MMA training algorithm, it is also largely affected by the property of datasets. Although previous literature (Ding et al., 2019a; Zhang et al., 2019c ) also discusses related topics on the difference between MNIST and CIFAR10 w.r.t. adversarial robustness, they do not directly explain the observed phenomena here. We delay a thorough understanding of this topic to future work.

F.1 ADDITIONAL EVALUATION WITH THE CW-2 ATTACK:

We run the CW-2 attack (Carlini & Wagner, 2017) on the first 1000 test examples for models trained with 2 attacks. This gives the minimum 2 norm a perturbation needs to change the prediction. For each model, we show the clean accuracy, also mean, median, 25th percentile and 75th percentile of these minimum distances in Tables 2 and 3 below.

Looking at CW-2 results, we have very similar observations as compared to the observations we made based on robust accuracies (under PGD attacks) at different 's and the average robust accuracy.

On MNIST, for MMA trained models as d max increases from 2.0 to 6.0, the mean minimum distance goes from 2.15 to 2.76, with the clean accuracy only drops to 97.7% from 99.3%. On the contrary, when we perform PGD/PGDLS with a larger , e.g. = 4.0, the clean accuracy drops significantly to 91.8%, with the mean minimum distance increased to 2.53. Therefore MMA training achieves better performance on both clean accuracy and robustness under the MNIST-2 case.

On CIFAR10, we observed that MMA training is fairly stable to d max , and achieves good robustnessaccuracy trade-offs. With carefully chosen value, PGD-1.0/PGDLS-1.0 models can also achieve similar robustness-accuracy tradeoffs as compared to MMA training. However, when we perform PGD training with a larger , the clean accuracy drops significantly. 

:

In adversarial training(Madry et al., 2017), the constraint on the inner max does NOT have such problem.

N = 50 for models trained on MNIST. Total number of attacks is 900 for MNIST-∞ (m = 18), 1200 for MNIST-2 (m = 24) and 260 for CIFAR10-2 (m = 26). We explain relevant details in Appendix C.

Here we choose CIFAR10-2 because the DDN-2 attack is both fast and effective for estimating margins.

Attacks on ensembles are explained in Appendix D.

Downloaded models from https://github.com/yaodongyu/TRADES

Note that a simple application of Danskin's theorem would not be valid as the constraint set ∆(θ) depends on the parameter θ.

github.com/jeromerony/fast_adversarial

Description can be found at https://www.tensorflow.org/api_docs/python/tf/image/ per_image_standardization. We implemented our own version in PyTorch.

The CW loss is almost equivalent to the logit margin (LM) loss. We use CW loss for the ease of comparing with literature. Here CW (x) = min{max j =y fj(x) -fy(x), 0}. When the classification is correct, CW and LM loss have the same gradient.

Figures and Tables:

Figure 2: A 1-D example on how margin is affected by decreasing the loss at different locations.

Figure 3: Visualization of loss landscape in the input space for MMA and PGD trained models.

Figure 4: Margin distributions during training, under the CIFAR10-2 case. Each blue histogram represents the margin value distribution of MMA-3.0, and the orange represents PGD-2.5.

the open set {δ : L(δ, θ) < ρ}, there exists an open ball with some radius r p centered at p such that B rp ⊂ {δ : L(δ, θ) < ρ}. This forms an open cover for {δ : δ ≤ }. Since {δ : δ ≤ } is compact, there is an open finite subcover U such that: {δ : δ ≤ } ⊂ U ⊂ {δ : L(δ, θ) < ρ}. Since U is finite, there exists h > 0 such that {δ : δ ≤ + h} ⊂ {δ : L(δ, θ) < ρ}. Thus {δ : L(δ, θ) ≥ ρ} ⊂ {δ : δ > + h}, contradicting min L(δ,θ)≥ρ δ = again.

Cross-)Lipschitz Regularization:Sokolic et al. (2017);Tsuzuku et al. (2018) enlarges their margin by controlling the global Lipschitz constant, which in return places a strong constraint on the model and harms its learning capabilities. Instead, our method, alike adversarial training, uses adversarial attacks to estimate the margin to the decision boundary. With a strong method, our estimate is much more precise in the neighborhood around the data point, while being much more flexible due to not relying on a global Lipschitz constraint.

Adding the clean loss is indeed effective. Most of the loss curves are more tilted, and the losses of perturbed examples are lower. We use L CB θ for MMA training in the rest of the paper due to its higher performance. A more detailed comparison between L CB θ and L MMA The training set {(x i , y i )}. Outputs: the trained model f θ (•). Parameters: contains perturbation lengths of training data. min is the minimum perturbation length. max is the maximum perturbation length. A(x, y, init ) represents the approximate shortest successful perturbation returned by an algorithm A (e.g. AN-PGD) on the data example (x, y) and at the initial norm init .

Table content: <table><tr><td colspan="3">Algorithm 2 Max-Margin Adversarial Training.</td><td/></tr><tr><td colspan="5">Inputs: 1: Randomly initialize the parameter θ of model f , and initialize every element of as min</td></tr><tr><td colspan="2">2: repeat</td><td/><td/></tr><tr><td colspan="3">3: Read minibatch B = {(x1, y1), . . . , (xm, ym)}</td><td/></tr><tr><td colspan="5">4: Make predictions on B and into two: wrongly predicted B0 and correctly predicted B1</td></tr><tr><td colspan="2">5: Initialize an empty batch B adv 1</td><td/><td/></tr><tr><td colspan="2">6: for (xi, yi) in B1 do</td><td/><td/></tr><tr><td>7: 8:</td><td colspan="2">Retrieve perturbation length i from δ  *  i = A(xi, yi, i)</td><td/></tr><tr><td>9:</td><td>Update the i in as δ  *  i . If δ  *  i</td><td colspan="3">&lt; dmax then put (xi + δ  *  i , yi) into B adv 1</td></tr><tr><td>10:</td><td>end for</td><td/><td/></tr><tr><td colspan="3">11: Calculate gradients of j∈B 0 L CE θ (xj, yj)+ 1 3</td><td>j∈B 1 L CE θ (xj, yj)+ 2 3</td><td>j∈B adv 1</td><td>L CE θ (xj, yj), the com-</td></tr><tr><td/><td colspan="3">bined loss, on B0, B1, and B adv 1 , w.r.t. θ, according to Eqs. (7) and (8)</td></tr><tr><td colspan="3">12: Perform one step gradient step update on θ</td><td/></tr><tr><td colspan="2">13: until meet training stopping criterion</td><td/><td/></tr><tr><td/><td/><td/><td>θ</td><td>is delayed to Appendix E.</td></tr><tr><td colspan="3">2.5 THE MMA TRAINING ALGORITHM</td><td/></tr></table>

Accuracies of representative models trained on CIFAR10 with ∞ -norm constrained attacks. Robust accuracies are calculated under combined (whitebox+transfer) PGD attacks. AvgAcc averages over clean and all robust accuracies; AvgRobAcc averages over all robust accuracies.

Table content: <table><tr><td>CIFAR10 Model</td><td>Cln Acc</td><td>AvgAcc</td><td>AvgRobAcc</td><td colspan="8">RobAcc under different , combined (whitebox+transfer) attacks 4 8 12 16 20 24 28 32</td></tr><tr><td>PGD-8</td><td>85.14</td><td>27.27</td><td>20.03</td><td>67.73</td><td>46.47</td><td>26.63</td><td>12.33</td><td>4.69</td><td>1.56</td><td>0.62</td><td>0.22</td></tr><tr><td>PGD-16</td><td>68.86</td><td>28.28</td><td>23.21</td><td>57.99</td><td>46.09</td><td>33.64</td><td>22.73</td><td>13.37</td><td>7.01</td><td>3.32</td><td>1.54</td></tr><tr><td>PGD-24</td><td>10.90</td><td>9.95</td><td>9.83</td><td>10.60</td><td>10.34</td><td>10.11</td><td>10.00</td><td>9.89</td><td>9.69</td><td>9.34</td><td>8.68</td></tr><tr><td>PGDLS-8</td><td>85.63</td><td>27.20</td><td>19.90</td><td>67.96</td><td>46.19</td><td>26.19</td><td>12.22</td><td>4.51</td><td>1.48</td><td>0.44</td><td>0.21</td></tr><tr><td>PGDLS-16</td><td>70.68</td><td>28.44</td><td>23.16</td><td>59.43</td><td>47.00</td><td>33.64</td><td>21.72</td><td>12.66</td><td>6.54</td><td>2.98</td><td>1.31</td></tr><tr><td>PGDLS-24</td><td>58.36</td><td>26.53</td><td>22.55</td><td>49.05</td><td>41.13</td><td>32.10</td><td>23.76</td><td>15.70</td><td>9.66</td><td>5.86</td><td>3.11</td></tr><tr><td>MMA-12</td><td>88.59</td><td>26.87</td><td>19.15</td><td>67.96</td><td>43.42</td><td>24.07</td><td>11.45</td><td>4.27</td><td>1.43</td><td>0.45</td><td>0.16</td></tr><tr><td>MMA-20</td><td>86.56</td><td>28.86</td><td>21.65</td><td>66.92</td><td>46.89</td><td>29.83</td><td>16.55</td><td>8.14</td><td>3.25</td><td>1.17</td><td>0.43</td></tr><tr><td>MMA-32</td><td>84.36</td><td>29.39</td><td>22.51</td><td>64.82</td><td>47.18</td><td>31.49</td><td>18.91</td><td>10.16</td><td>4.77</td><td>1.97</td><td>0.81</td></tr><tr><td>PGD-ens</td><td>87.38</td><td>28.10</td><td>20.69</td><td>64.59</td><td>46.95</td><td>28.88</td><td>15.10</td><td>6.35</td><td>2.35</td><td>0.91</td><td>0.39</td></tr><tr><td>PGDLS-ens</td><td>76.73</td><td>29.52</td><td>23.62</td><td>60.52</td><td>48.21</td><td>35.06</td><td>22.14</td><td>12.28</td><td>6.17</td><td>3.14</td><td>1.43</td></tr><tr><td>TRADES</td><td>84.92</td><td>30.46</td><td>23.65</td><td>70.96</td><td>52.92</td><td>33.04</td><td>18.23</td><td>8.34</td><td>3.57</td><td>1.4</td><td>0.69</td></tr></table>

Although both their and our methods adversarially train the model with different perturbation magnitudes, the motivations are completely different.Dynamic Adversarial Training:Wang et al. (2019)  improve adversarial training's convergence by dynamically adjusting the strength (the number of iterations) of PGD attacks, based on its proposed First-Order Stationary Condition. In a sense, MMA training is also dynamically adjusting the attack strength. However, our aim is margin maximization and the strength here represents the magnitude of the perturbation.B.1 DETAILED COMPARISON WITH ADVERSARIAL TRAINING WITH DDNFor 2 robustness, we also compare to models adversarially trained on the "Decoupled Direction and Norm" (DDN) attack(Rony et al., 2018), which is concurrent to our work. The DDN attack aims to achieve successful perturbation with minimal 2 norm, thus, DDN could be used as a drop-in replacement for the AN-PGD attack for MMA training. We performed evaluations on the downloaded 8 DDN trained models.The DDN MNIST model is a larger ConvNet with similar structure to our LeNet5, and the CIFAR10 model is wideresnet-28-10, which is similar but larger than the wideresnet-28-4 that we use.DDN training, "training on adversarial examples generated by the DDN attack", differs from MMA in the following ways. When the DDN attack does not find a successful adversarial example, it returns the clean image, and the model will use it for training. In MMA, when a successful adversarial example cannot be found, it is treated as a perturbation with very large magnitude, which will be ignored by the hinge loss when we calculate the gradient for this example. Also, in DDN training, there exists a maximum norm of the perturbation. This maximum norm constraint does not exist for MMA training. When a perturbation is larger than the hinge threshold, it will be ignored by the hinge loss. There also are differences in training hyperparameters, which we refer the reader to Rony et al. (2018) for details. Despite these differences, in our experiments MMA training achieves similar performances under the 2 cases. While DDN attack and training only focus on 2 cases, we also show that the MMA training framework provides significant improvements over PGD training in the ∞ case.

Table content: <table/>

train LeNet5 models for the MNIST experiments and use wide residual networks (Zagoruyko & Komodakis, 2016) with depth 28 and widen factor 4 for all the CIFAR10 experiments. For all the experiments, we monitor the average margin from AN-PGD on the validation set and choose the model with largest average margin from the sequence of checkpoints during training. The validation set contains first 5000 images of training set. It is only used to monitor training progress and not used in training.Here all the models are trained and tested under the same type of norm constraints, namely if trained on ∞ , then tested on ∞ ; if trained on 2 , then tested on 2 .

Table content: <table/>

Adding additional clean loss increases the robustness of the model, reduce TransferGap, at a cost of slightly reducing clean accuracy. As a simpler datasets, different adversarial training algorithms, including MMA training, have very different behaviors on MNIST as compared to CIFAR10. We first look at MNIST-∞ . Similar to CIFAR10 cases, PGD training is incompetent on large 's, e.g. PGD-0.4 has significant drop on clean accuracy (to 96.64%) and PGD-0.45 fails to train. PGDLS training, on the other hand, is able to handle large 's training very well on MNIST-∞ , and MMA training does not bring extra benefit on top of PGDLS.

Table content: <table/>

CW-2 attack results on models trained on MNIST with 2 -norm constrained attacks.

Table content: <table><tr><td>MNIST Model</td><td>Cln Acc</td><td>Avg Norm</td><td>25% Norm</td><td>Median Norm</td><td>75% Norm</td></tr><tr><td>STD</td><td>99.0</td><td>1.57</td><td>1.19</td><td>1.57</td><td>1.95</td></tr><tr><td>PGD-1.0</td><td>99.2</td><td>1.95</td><td>1.58</td><td>1.95</td><td>2.33</td></tr><tr><td>PGD-2.0</td><td>98.6</td><td>2.32</td><td>1.85</td><td>2.43</td><td>2.82</td></tr><tr><td>PGD-3.0</td><td>96.8</td><td>2.54</td><td>1.79</td><td>2.76</td><td>3.39</td></tr><tr><td>PGD-4.0</td><td>91.8</td><td>2.53</td><td>1.38</td><td>2.75</td><td>3.75</td></tr><tr><td>PGDLS-1.0</td><td>99.3</td><td>1.88</td><td>1.53</td><td>1.88</td><td>2.24</td></tr><tr><td>PGDLS-2.0</td><td>99.3</td><td>2.23</td><td>1.82</td><td>2.30</td><td>2.68</td></tr><tr><td>PGDLS-3.0</td><td>96.9</td><td>2.51</td><td>1.81</td><td>2.74</td><td>3.29</td></tr><tr><td>PGDLS-4.0</td><td>91.8</td><td>2.53</td><td>1.46</td><td>2.79</td><td>3.72</td></tr><tr><td>MMA-2.0</td><td>99.3</td><td>2.15</td><td>1.81</td><td>2.22</td><td>2.58</td></tr><tr><td>MMA-4.0</td><td>98.5</td><td>2.67</td><td>1.86</td><td>2.72</td><td>3.52</td></tr><tr><td>MMA-6.0</td><td>97.7</td><td>2.76</td><td>1.84</td><td>2.72</td><td>3.61</td></tr></table>

CW-2 attack results on models trained on CIFAR10 with 2 -norm constrained attacks.

Table content: <table><tr><td>CIFAR10 Model</td><td>Cln Acc</td><td>Avg Norm</td><td>25% Norm</td><td>Median Norm</td><td>75% Norm</td></tr><tr><td>STD</td><td>95.1</td><td>0.09</td><td>0.05</td><td>0.08</td><td>0.13</td></tr><tr><td>PGD-0.5</td><td>89.2</td><td>0.80</td><td>0.32</td><td>0.76</td><td>1.21</td></tr><tr><td>PGD-1.0</td><td>83.8</td><td>1.01</td><td>0.30</td><td>0.91</td><td>1.62</td></tr><tr><td>PGD-1.5</td><td>76.0</td><td>1.11</td><td>0.04</td><td>0.96</td><td>1.87</td></tr><tr><td>PGD-2.0</td><td>71.6</td><td>1.16</td><td>0.00</td><td>0.96</td><td>2.03</td></tr><tr><td>PGD-2.5</td><td>65.2</td><td>1.19</td><td>0.00</td><td>0.88</td><td>2.10</td></tr><tr><td>PGDLS-0.5</td><td>90.5</td><td>0.79</td><td>0.34</td><td>0.76</td><td>1.17</td></tr><tr><td>PGDLS-1.0</td><td>83.8</td><td>1.00</td><td>0.30</td><td>0.91</td><td>1.59</td></tr><tr><td>PGDLS-1.5</td><td>77.6</td><td>1.10</td><td>0.11</td><td>0.97</td><td>1.83</td></tr><tr><td>PGDLS-2.0</td><td>73.1</td><td>1.16</td><td>0.00</td><td>0.98</td><td>2.02</td></tr><tr><td>PGDLS-2.5</td><td>66.0</td><td>1.19</td><td>0.00</td><td>0.88</td><td>2.13</td></tr><tr><td>MMA-1.0</td><td>88.4</td><td>0.85</td><td>0.32</td><td>0.80</td><td>1.27</td></tr><tr><td>MMA-2.0</td><td>84.2</td><td>1.03</td><td>0.26</td><td>0.92</td><td>1.62</td></tr><tr><td>MMA-3.0</td><td>81.2</td><td>1.09</td><td>0.21</td><td>0.92</td><td>1.73</td></tr></table>

Accuracies of models trained on MNIST with ∞ -norm constrained attacks. These robust accuracies are calculated under both combined (whitebox+transfer) PGD attacks. sd0 and sd1 indicate 2 different random seeds.

Table content: <table><tr><td>MNIST Model</td><td>Cln Acc</td><td>AvgAcc</td><td>AvgRobAcc</td><td colspan="4">RobAcc under different , combined (whitebox+transfer) attacks 0.1 0.2 0.3 0.4</td></tr><tr><td>STD</td><td>99.21</td><td>35.02</td><td>18.97</td><td>73.58</td><td>2.31</td><td>0.00</td><td>0.00</td></tr><tr><td>PGD-0.1</td><td>99.40</td><td>48.85</td><td>36.22</td><td>96.35</td><td>48.51</td><td>0.01</td><td>0.00</td></tr><tr><td>PGD-0.2</td><td>99.22</td><td>57.92</td><td>47.60</td><td>97.44</td><td>92.12</td><td>0.84</td><td>0.00</td></tr><tr><td>PGD-0.3</td><td>98.96</td><td>76.97</td><td>71.47</td><td>97.90</td><td>96.00</td><td>91.76</td><td>0.22</td></tr><tr><td>PGD-0.4</td><td>96.64</td><td>89.37</td><td>87.55</td><td>94.69</td><td>91.57</td><td>86.49</td><td>77.47</td></tr><tr><td>PGD-0.45</td><td>11.35</td><td>11.35</td><td>11.35</td><td>11.35</td><td>11.35</td><td>11.35</td><td>11.35</td></tr><tr><td>PGDLS-0.1</td><td>99.43</td><td>46.85</td><td>33.71</td><td>95.41</td><td>39.42</td><td>0.00</td><td>0.00</td></tr><tr><td>PGDLS-0.2</td><td>99.38</td><td>58.36</td><td>48.10</td><td>97.38</td><td>89.49</td><td>5.53</td><td>0.00</td></tr><tr><td>PGDLS-0.3</td><td>99.10</td><td>76.56</td><td>70.93</td><td>97.97</td><td>95.66</td><td>90.09</td><td>0.00</td></tr><tr><td>PGDLS-0.4</td><td>98.98</td><td>93.07</td><td>91.59</td><td>98.12</td><td>96.29</td><td>93.01</td><td>78.96</td></tr><tr><td>PGDLS-0.45</td><td>98.89</td><td>94.74</td><td>93.70</td><td>97.91</td><td>96.34</td><td>93.29</td><td>87.28</td></tr><tr><td>MMA-0.45-sd0</td><td>98.95</td><td>94.13</td><td>92.93</td><td>97.87</td><td>96.01</td><td>92.59</td><td>85.24</td></tr><tr><td>MMA-0.45-sd1</td><td>98.90</td><td>94.04</td><td>92.82</td><td>97.82</td><td>96.00</td><td>92.63</td><td>84.83</td></tr><tr><td>OMMA-0.45-sd0</td><td>98.98</td><td>93.94</td><td>92.68</td><td>97.90</td><td>96.05</td><td>92.35</td><td>84.41</td></tr><tr><td>OMMA-0.45-sd1</td><td>99.02</td><td>94.03</td><td>92.78</td><td>97.93</td><td>96.02</td><td>92.44</td><td>84.73</td></tr><tr><td>PGD-ens</td><td>99.28</td><td>57.98</td><td>47.65</td><td>97.25</td><td>89.99</td><td>3.37</td><td>0.00</td></tr><tr><td>PGDLS-ens</td><td>99.34</td><td>59.04</td><td>48.96</td><td>97.48</td><td>90.40</td><td>7.96</td><td>0.00</td></tr><tr><td>PGD-Madry et al.</td><td>98.53</td><td>76.04</td><td>70.41</td><td>97.08</td><td>94.83</td><td>89.64</td><td>0.11</td></tr><tr><td>TRADES</td><td>99.47</td><td>77.94</td><td>72.56</td><td>98.81</td><td>97.27</td><td>94.11</td><td>0.05</td></tr></table>

Accuracies of models trained on CIFAR10 with ∞ -norm constrained attacks. These robust accuracies are calculated under both combined (whitebox+transfer) PGD attacks. sd0 and sd1 indicate 2 different random seeds.

Table content: <table><tr><td>CIFAR10 Model</td><td>Cln Acc</td><td>AvgAcc</td><td>AvgRobAcc</td><td>4</td><td colspan="8">RobAcc under different , combined (whitebox+transfer) attacks 8 12 16 20 24 28</td><td>32</td></tr><tr><td>STD</td><td>94.92</td><td>10.55</td><td>0.00</td><td>0.00</td><td/><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td></tr><tr><td>PGD-4</td><td>90.44</td><td>22.95</td><td>14.51</td><td colspan="2">66.31</td><td>33.49</td><td>12.22</td><td>3.01</td><td>0.75</td><td>0.24</td><td>0.06</td><td>0.01</td></tr><tr><td>PGD-8</td><td>85.14</td><td>27.27</td><td>20.03</td><td colspan="2">67.73</td><td>46.47</td><td>26.63</td><td>12.33</td><td>4.69</td><td>1.56</td><td>0.62</td><td>0.22</td></tr><tr><td>PGD-12</td><td>77.86</td><td>28.51</td><td>22.34</td><td colspan="2">63.88</td><td>48.22</td><td>32.13</td><td>18.67</td><td>9.48</td><td>4.05</td><td>1.56</td><td>0.70</td></tr><tr><td>PGD-16</td><td>68.86</td><td>28.28</td><td>23.21</td><td colspan="2">57.99</td><td>46.09</td><td>33.64</td><td>22.73</td><td>13.37</td><td>7.01</td><td>3.32</td><td>1.54</td></tr><tr><td>PGD-20</td><td>61.06</td><td>27.34</td><td>23.12</td><td colspan="2">51.72</td><td>43.13</td><td>33.73</td><td>24.55</td><td>15.66</td><td>9.05</td><td>4.74</td><td>2.42</td></tr><tr><td>PGD-24</td><td>10.90</td><td>9.95</td><td>9.83</td><td colspan="2">10.60</td><td>10.34</td><td>10.11</td><td>10.00</td><td>9.89</td><td>9.69</td><td>9.34</td><td>8.68</td></tr><tr><td>PGD-28</td><td>10.00</td><td>10.00</td><td>10.00</td><td colspan="2">10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td></tr><tr><td>PGD-32</td><td>10.00</td><td>10.00</td><td>10.00</td><td colspan="2">10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td></tr><tr><td>PGDLS-4</td><td>89.87</td><td>22.39</td><td>13.96</td><td colspan="2">63.98</td><td>31.92</td><td>11.47</td><td>3.32</td><td>0.68</td><td>0.16</td><td>0.08</td><td>0.05</td></tr><tr><td>PGDLS-8</td><td>85.63</td><td>27.20</td><td>19.90</td><td colspan="2">67.96</td><td>46.19</td><td>26.19</td><td>12.22</td><td>4.51</td><td>1.48</td><td>0.44</td><td>0.21</td></tr><tr><td>PGDLS-12</td><td>79.39</td><td>28.45</td><td>22.08</td><td colspan="2">64.62</td><td>48.08</td><td>31.34</td><td>17.86</td><td>8.69</td><td>3.95</td><td>1.48</td><td>0.65</td></tr><tr><td>PGDLS-16</td><td>70.68</td><td>28.44</td><td>23.16</td><td colspan="2">59.43</td><td>47.00</td><td>33.64</td><td>21.72</td><td>12.66</td><td>6.54</td><td>2.98</td><td>1.31</td></tr><tr><td>PGDLS-20</td><td>65.81</td><td>27.60</td><td>22.83</td><td colspan="2">54.96</td><td>44.39</td><td>33.13</td><td>22.53</td><td>13.80</td><td>7.79</td><td>4.08</td><td>1.95</td></tr><tr><td>PGDLS-24</td><td>58.36</td><td>26.53</td><td>22.55</td><td colspan="2">49.05</td><td>41.13</td><td>32.10</td><td>23.76</td><td>15.70</td><td>9.66</td><td>5.86</td><td>3.11</td></tr><tr><td>PGDLS-28</td><td>50.07</td><td>24.20</td><td>20.97</td><td colspan="2">40.71</td><td>34.61</td><td>29.00</td><td>22.77</td><td>16.83</td><td>11.49</td><td>7.62</td><td>4.73</td></tr><tr><td>PGDLS-32</td><td>38.80</td><td>19.88</td><td>17.52</td><td colspan="2">26.16</td><td>24.96</td><td>23.22</td><td>19.96</td><td>16.22</td><td>12.92</td><td>9.82</td><td>6.88</td></tr><tr><td>MMA-12-sd0</td><td>88.59</td><td>26.87</td><td>19.15</td><td colspan="2">67.96</td><td>43.42</td><td>24.07</td><td>11.45</td><td>4.27</td><td>1.43</td><td>0.45</td><td>0.16</td></tr><tr><td>MMA-12-sd1</td><td>88.91</td><td>26.23</td><td>18.39</td><td colspan="2">67.08</td><td>42.97</td><td>22.57</td><td>9.76</td><td>3.37</td><td>0.92</td><td>0.35</td><td>0.12</td></tr><tr><td>MMA-20-sd0</td><td>86.56</td><td>28.86</td><td>21.65</td><td colspan="2">66.92</td><td>46.89</td><td>29.83</td><td>16.55</td><td>8.14</td><td>3.25</td><td>1.17</td><td>0.43</td></tr><tr><td>MMA-20-sd1</td><td>85.87</td><td>28.72</td><td>21.57</td><td colspan="2">65.44</td><td>46.11</td><td>29.96</td><td>17.30</td><td>8.27</td><td>3.60</td><td>1.33</td><td>0.56</td></tr><tr><td>MMA-32-sd0</td><td>84.36</td><td>29.39</td><td>22.51</td><td colspan="2">64.82</td><td>47.18</td><td>31.49</td><td>18.91</td><td>10.16</td><td>4.77</td><td>1.97</td><td>0.81</td></tr><tr><td>MMA-32-sd1</td><td>84.76</td><td>29.08</td><td>22.11</td><td colspan="2">64.41</td><td>45.95</td><td>30.36</td><td>18.24</td><td>9.85</td><td>4.99</td><td>2.20</td><td>0.92</td></tr><tr><td>OMMA-12-sd0</td><td>88.52</td><td>26.31</td><td>18.54</td><td colspan="2">66.96</td><td>42.58</td><td>23.22</td><td>10.29</td><td>3.43</td><td>1.24</td><td>0.46</td><td>0.13</td></tr><tr><td>OMMA-12-sd1</td><td>87.82</td><td>26.24</td><td>18.54</td><td colspan="2">66.23</td><td>43.10</td><td>23.57</td><td>10.32</td><td>3.56</td><td>1.04</td><td>0.38</td><td>0.14</td></tr><tr><td>OMMA-20-sd0</td><td>87.06</td><td>27.41</td><td>19.95</td><td colspan="2">66.54</td><td>45.39</td><td>26.29</td><td>13.09</td><td>5.32</td><td>1.96</td><td>0.79</td><td>0.23</td></tr><tr><td>OMMA-20-sd1</td><td>87.44</td><td>27.77</td><td>20.31</td><td colspan="2">66.28</td><td>45.60</td><td>27.33</td><td>14.00</td><td>6.04</td><td>2.23</td><td>0.74</td><td>0.25</td></tr><tr><td>OMMA-32-sd0</td><td>86.11</td><td>28.36</td><td>21.14</td><td colspan="2">66.02</td><td>46.31</td><td>28.88</td><td>15.98</td><td>7.44</td><td>2.94</td><td>1.12</td><td>0.45</td></tr><tr><td>OMMA-32-sd1</td><td>86.36</td><td>28.75</td><td>21.55</td><td colspan="2">66.86</td><td>47.12</td><td>29.63</td><td>16.09</td><td>7.56</td><td>3.38</td><td>1.31</td><td>0.47</td></tr><tr><td>PGD-ens</td><td>87.38</td><td>28.10</td><td>20.69</td><td colspan="2">64.59</td><td>46.95</td><td>28.88</td><td>15.10</td><td>6.35</td><td>2.35</td><td>0.91</td><td>0.39</td></tr><tr><td>PGDLS-ens</td><td>76.73</td><td>29.52</td><td>23.62</td><td colspan="2">60.52</td><td>48.21</td><td>35.06</td><td>22.14</td><td>12.28</td><td>6.17</td><td>3.14</td><td>1.43</td></tr><tr><td>PGD-Madry et al.</td><td>87.14</td><td>27.22</td><td>19.73</td><td colspan="2">68.01</td><td>44.68</td><td>25.03</td><td>12.15</td><td>5.18</td><td>1.95</td><td>0.64</td><td>0.23</td></tr><tr><td>TRADES</td><td>84.92</td><td>30.46</td><td>23.65</td><td colspan="2">70.96</td><td>52.92</td><td>33.04</td><td>18.23</td><td>8.34</td><td>3.57</td><td>1.4</td><td>0.69</td></tr></table>

Accuracies of models trained on MNIST with 2 -norm constrained attacks. These robust accuracies are calculated under both combined (whitebox+transfer) PGD attacks. sd0 and sd1 indicate 2 different random seeds.

Table content: <table/>

Accuracies of models trained on CIFAR10 with 2 -norm constrained attacks. These robust accuracies are calculated under both combined (whitebox+transfer) PGD attacks. sd0 and sd1 indicate 2 different random seeds.

Table content: <table><tr><td>CIFAR10 Model</td><td>Cln Acc</td><td>AvgAcc</td><td>AvgRobAcc</td><td colspan="5">RobAcc under different , combined (whitebox+transfer) attacks 0.5 1.0 1.5 2.0 2.5</td></tr><tr><td>STD</td><td>94.92</td><td>15.82</td><td>0.00</td><td>0.01</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td></tr></table>

Accuracies of models trained on MNIST with ∞ -norm constrained attacks. These robust accuracies are calculated under only whitebox PGD attacks. sd0 and sd1 indicate 2 different random seeds.

Table content: <table><tr><td>MNIST Model</td><td>Cln Acc</td><td>AvgAcc</td><td>AvgRobAcc</td><td colspan="4">RobAcc under different , whitebox only 0.1 0.2 0.3 0.4</td></tr><tr><td>STD</td><td>99.21</td><td>35.02</td><td>18.97</td><td>73.59</td><td>2.31</td><td>0.00</td><td>0.00</td></tr><tr><td>PGD-0.1</td><td>99.40</td><td>48.91</td><td>36.29</td><td>96.35</td><td>48.71</td><td>0.09</td><td>0.00</td></tr><tr><td>PGD-0.2</td><td>99.22</td><td>57.93</td><td>47.60</td><td>97.44</td><td>92.12</td><td>0.86</td><td>0.00</td></tr><tr><td>PGD-0.3</td><td>98.96</td><td>77.35</td><td>71.95</td><td>97.90</td><td>96.00</td><td>91.86</td><td>2.03</td></tr><tr><td>PGD-0.4</td><td>96.64</td><td>91.51</td><td>90.22</td><td>94.79</td><td>92.27</td><td>88.82</td><td>85.02</td></tr><tr><td>PGD-0.45</td><td>11.35</td><td>11.35</td><td>11.35</td><td>11.35</td><td>11.35</td><td>11.35</td><td>11.35</td></tr><tr><td>PGDLS-0.1</td><td>99.43</td><td>46.94</td><td>33.82</td><td>95.41</td><td>39.85</td><td>0.02</td><td>0.00</td></tr><tr><td>PGDLS-0.2</td><td>99.38</td><td>58.44</td><td>48.20</td><td>97.38</td><td>89.49</td><td>5.95</td><td>0.00</td></tr><tr><td>PGDLS-0.3</td><td>99.10</td><td>76.85</td><td>71.29</td><td>97.98</td><td>95.66</td><td>90.63</td><td>0.90</td></tr><tr><td>PGDLS-0.4</td><td>98.98</td><td>95.49</td><td>94.61</td><td>98.13</td><td>96.42</td><td>94.02</td><td>89.89</td></tr><tr><td>PGDLS-0.45</td><td>98.89</td><td>95.72</td><td>94.92</td><td>97.91</td><td>96.64</td><td>94.54</td><td>90.60</td></tr><tr><td>MMA-0.45-sd0</td><td>98.95</td><td>94.97</td><td>93.97</td><td>97.89</td><td>96.26</td><td>93.57</td><td>88.16</td></tr><tr><td>MMA-0.45-sd1</td><td>98.90</td><td>94.83</td><td>93.81</td><td>97.83</td><td>96.18</td><td>93.34</td><td>87.91</td></tr><tr><td>OMMA-0.45-sd0</td><td/><td>95.06</td><td>94.07</td><td>97.91</td><td>96.22</td><td>93.63</td><td>88.54</td></tr><tr><td>OMMA-0.45-sd1</td><td>99.02</td><td>95.45</td><td>94.55</td><td>97.96</td><td>96.30</td><td>94.16</td><td>89.80</td></tr><tr><td>PGD-ens</td><td>99.28</td><td>58.02</td><td>47.70</td><td>97.31</td><td>90.11</td><td>3.38</td><td>0.00</td></tr><tr><td>PGDLS-ens</td><td>99.34</td><td>59.09</td><td>49.02</td><td>97.50</td><td>90.56</td><td>8.03</td><td>0.00</td></tr><tr><td>PGD-Madry et al.</td><td>98.53</td><td>76.08</td><td>70.47</td><td>97.08</td><td>94.87</td><td>89.79</td><td>0.13</td></tr><tr><td>TRADES</td><td>99.47</td><td>77.95</td><td>72.57</td><td>98.81</td><td>97.27</td><td>94.13</td><td>0.07</td></tr></table>

Accuracies of models trained on CIFAR10 with ∞ -norm constrained attacks. These robust accuracies are calculated under only whitebox PGD attacks. sd0 and sd1 indicate 2 different random seeds.

Table content: <table><tr><td>CIFAR10 Model</td><td>Cln Acc</td><td>AvgAcc</td><td>AvgRobAcc</td><td>4</td><td>8</td><td colspan="4">RobAcc under different , whitebox only 12 16 20 24</td><td>28</td><td>32</td></tr><tr><td>STD</td><td>94.92</td><td>10.55</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td></tr><tr><td>PGD-4</td><td>90.44</td><td>22.97</td><td>14.53</td><td>66.33</td><td>33.51</td><td>12.27</td><td>3.03</td><td>0.77</td><td>0.25</td><td>0.07</td><td>0.02</td></tr><tr><td>PGD-8</td><td>85.14</td><td>27.28</td><td>20.05</td><td>67.73</td><td>46.49</td><td>26.69</td><td>12.37</td><td>4.71</td><td>1.58</td><td>0.62</td><td>0.23</td></tr><tr><td>PGD-12</td><td>77.86</td><td>28.55</td><td>22.39</td><td>63.90</td><td>48.25</td><td>32.19</td><td>18.78</td><td>9.58</td><td>4.12</td><td>1.59</td><td>0.72</td></tr><tr><td>PGD-16</td><td>68.86</td><td>28.42</td><td>23.36</td><td>58.07</td><td>46.17</td><td>33.84</td><td>22.99</td><td>13.65</td><td>7.19</td><td>3.43</td><td>1.57</td></tr><tr><td>PGD-20</td><td>61.06</td><td>27.73</td><td>23.57</td><td>51.75</td><td>43.32</td><td>34.22</td><td>25.19</td><td>16.36</td><td>9.65</td><td>5.33</td><td>2.73</td></tr><tr><td>PGD-24</td><td>10.90</td><td>9.98</td><td>9.86</td><td>10.60</td><td>10.34</td><td>10.11</td><td>10.01</td><td>9.91</td><td>9.74</td><td>9.39</td><td>8.81</td></tr><tr><td>PGD-28</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td></tr><tr><td>PGD-32</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td><td>10.00</td></tr><tr><td>PGD-ens</td><td>87.38</td><td>28.83</td><td>21.51</td><td>64.85</td><td>47.67</td><td>30.37</td><td>16.63</td><td>7.79</td><td>3.01</td><td>1.25</td><td>0.52</td></tr><tr><td>PGDLS-ens</td><td>76.73</td><td>30.60</td><td>24.83</td><td>61.16</td><td>49.46</td><td>36.63</td><td>23.90</td><td>13.92</td><td>7.62</td><td>3.91</td><td>2.05</td></tr><tr><td>PGD-Madry et al.</td><td>87.14</td><td>27.36</td><td>19.89</td><td>68.01</td><td>44.70</td><td>25.15</td><td>12.52</td><td>5.50</td><td>2.25</td><td>0.73</td><td>0.27</td></tr><tr><td>TRADES</td><td>84.92</td><td>30.46</td><td>23.66</td><td>70.96</td><td>52.92</td><td>33.04</td><td>18.26</td><td>8.37</td><td>3.59</td><td>1.42</td><td>0.69</td></tr></table>

Accuracies of models trained on MNIST with 2 -norm constrained attacks. These robust accuracies are calculated under only whitebox PGD attacks. sd0 and sd1 indicate 2 different random seeds.

Table content: <table><tr><td>MNIST Model</td><td>Cln Acc</td><td>AvgAcc</td><td>AvgRobAcc</td><td colspan="4">RobAcc under different , whitebox only 1.0 2.0 3.0 4.0</td></tr><tr><td>STD</td><td>99.21</td><td>41.90</td><td>27.57</td><td>86.61</td><td>23.02</td><td>0.64</td><td>0.00</td></tr></table>

Accuracies of models trained on CIFAR10 with 2 -norm constrained attacks. These robust accuracies are calculated under only whitebox PGD attacks. sd0 and sd1 indicate 2 different random seeds.

Table content: <table><tr><td>CIFAR10 Model</td><td>Cln Acc</td><td>AvgAcc</td><td>AvgRobAcc</td><td colspan="5">RobAcc under different , whitebox only 0.5 1.0 1.5 2.0 2.5</td></tr><tr><td>STD</td><td>94.92</td><td>15.82</td><td>0.00</td><td>0.01</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td></tr></table>

Peer review (iclr2020):
Summary: This paper proposes an adaptive margin-based adversarial training (eg. MMA) approach to train robust DNNs by maximizing the shortest margin of inputs to the decision boundary. Theoretical analyses have been provided to understand the connection between robust optimization and margin maximization. The main difference between the proposed approach to standard adversarial training is the adaptive selection of the perturbation bound epsilon. This makes adversarial training with large perturbation possible, which was previously unachievable by standard adversarial training (Madry et al.) Empirical results match the theoretical analysis. Pros: 1. The margin maximization idea has been well-explained, both intuitively and theoretically. 2. Interesting theoretical analyses and understandings of robust optimization from the margin perspective. 3. Clear advantage of MMA over standard adversarial training under large perturbations. 8. The proposed PGDLS is very interesting, actually quite good and much simpler, without extra computational cost. A similar idea was discussed in paper [3], where they gradually increase the convergence quality of training adversarial examples, and show the convergence guarantee of *dynamic training*. 9. The gradient-free SPSA helps confirm the improvements of MMA under large perturbations are not a side effect of gradient masking. Cons: 1. The idea of *shortest successful perturbation* appears like a type of weak training attack, looking for minimum perturbations to just cross the classification boundary, like deepfool [1] or confidence 0 CW-L2 attack [2]. 2. The margin d_	heta in Equation (1)/(2)/... defined on which norm? L_infty or L2 norm? I assume it*s the infinity norm. In Theorem 2.1, the delta^{*} = argmin ||delta||, is a norm? Looks like a mistake. 3. The minimum margin delta^{*} is a bit confusing, is it used in maximization or just in the outer minimization? The last paragraph of page 3, L(	heta, delta) or L(delta, 	heta), consistency check? 4. Why do we need the *gradients of margins to model parameters* analysis from Proposition 2.1 to remark 2.2? Given the delta^{*} found in the inner maximization (eg. attacking) process (step 1), minimizing the loss over this delta^{*} seems quite a straightforward step 2. Why don*t go directly from Theorem 2.1 to Proposition 2.4, since the extensions from LM loss to SLM and CE loss via Proposition 2.3 -> Proposition 2.4., just proves that the standard classification loss CE can already maximize the margin given delta^{*}? 5. Section 4 Experiments. The experimental settings are not clear, and are not standard. What CIFAR10-ell_{infty} means: is it the CW-L2 attack, used for training, or for testing? How the test attacks were generated, the m and N, are confusing: for each test image, you have 260 samples for CIFAR10 (which means 260*10K in total), or just 260 in total (this is far less than a typical setting causing inaccurate results)? How are the d_max determined, and what are their relationship to standard epsilon? How the m models were trained? 6. Fairness of the comparison. Since MMA changes epsilon, how to fairly compare the robustness to standard epsilon bounded adversarial training is not discussed. Is it fair to compare MMA-3.0 vs PGD-2.5, since they have different epsilon? Why robustness was not tested against strong, unrestricted attacks like CW-L2 [2], and report the average L2 perturbations required to completely break the robustly trained model (and show MMA-trained models enforce large perturbations to succeed)? 7. Significance of the results. Normally, epsilon_{infty} > 16/255 will cause perceptual difference. Under 16/255, PGD-8/16, PGDLS-8/16 are still the best. At this level, it is quite a surprise that MMA does not improve robustness, although it does increase clean accuracy. This means the theoretical analysis only stand under certain circumstances. I don*t think the optimal epsilon < margin can explain this, as it does not make sense to me the margin can be larger than 16/255. On the other hand, I thought the theoretical parts were discussing the ROBUSTNESS, not the CLEAN ACCURACY? But it turns out the MMA benefits a lot the clean accuracy? Why do we need robustness against large infty perturbations, this definitely deserves more discussion, as when perturbation goes large, the L2 attack (eg. CW-L2) makes more sense than PGD-infty. [1] Moosavi-Dezfooli, Seyed-Mohsen, Alhussein Fawzi, and Pascal Frossard. *Deepfool: a simple and accurate method to fool deep neural networks.* Proceedings of the IEEE conference on computer vision and pattern recognition. 2016. [2] Carlini, Nicholas, and David Wagner. *Towards evaluating the robustness of neural networks.* 2017 IEEE Symposium on Security and Privacy (SP). IEEE, 2017. [3] Wang, Yisen, et al. *On the Convergence and Robustness of Adversarial Training.* International Conference on Machine Learning. 2019. ============ My rating stays the same after reading through all the responses. I appreciate the authors* clarification on the notations and experimental settings. My 8/9 are positive points. My major concern is still the effectiveness of the proposed approach, and fairness of the comparison. It seems that MMA only works when the perturbation is large, which often larger than the epsilon used to train baseline adversarial training methods such as Trades. The authors seem have misunderstood my request for CWL2 results, I was just suggesting that the average L2 perturbation of CWL2 attack can be used as a fair test measure for robustness, instead of the AvgRobAcc used in the paper, and the susceptible comparison between MMA-12 vs PGD-8, or MMA-32 vs Trades.