Elamur Research

Towards Evaluating the Robustness of Neural Networks

Paper · 2017 · Nicholas Carlini and David Wagner

Summary

An image classifier can assign a different label after a change so small that the image still looks the same to a person. Such an input is called an adversarial example. Carlini and Wagner study a defense that appeared to make these examples much harder to find. The defense, called defensive distillation, trains one network to reproduce the class probabilities of another. Earlier experiments reported that it brought the success rate of the attacks under study from 95% to 0.5%. The authors ask what that result says about the images near a classifier’s decision boundary and what it says about the tools used to look for them.

The authors develop searches for targeted adversarial examples, where success means getting the classifier to produce a specified wrong label. They measure the size of the change in different ways. L₀ counts how many pixels changed, L₂ measures the combined size of the changes, and L∞ measures the largest individual change. The authors compare alternative ways of expressing the target-label requirement and find that the choice can substantially affect the outcome. A formulation based on the network’s raw class scores gives the search useful information even when the reported probabilities have become extremely concentrated on the original prediction.

The experiments cover handwritten digits in MNIST, small color images in CIFAR-10, and larger ImageNet photographs. The authors report 100% success for each of their methods in the direct tests on defensively distilled MNIST and CIFAR-10 networks. In the average-case MNIST test, where the wrong target is chosen at random, the mean L₂ distortion is 1.76 on the ordinary network and 2.2 on the distilled network. Stronger searches also find smaller changes than earlier methods in many comparisons on ordinary networks. The results give concrete upper bounds on how much change is needed in those tests.

The paper also tests whether an image made adversarial for one classifier can retain its wrong label on another. On MNIST, examples that the source classifier assigns more decisively to the target class transfer more often. Transfer persists when the receiving classifier uses defensive distillation. Together, the experiments show how a defense can defeat a particular measurement procedure while leaving nearby targeted errors accessible to a different one. That distinction matters whenever an empirical robustness claim rests on how frequently a search comes back empty.

Deep dive: Towards Evaluating the Robustness of Neural Networks

Carlini and Wagner test defensive distillation on image classifiers and show why a failed attack can give a misleading picture of robustness. · about 35 minutes to read

The problem and its context

A classification can be right and still be fragile

An image classifier makes a decision by assigning a score to each possible label and picking the label with the highest score. Its ordinary accuracy measures how often that decision agrees with the recorded label on the images used to test it. Robustness asks what happens when the image is changed. A network can recognize a handwritten digit correctly and still assign a different label to an image whose appearance remains essentially the same. Ordinary accuracy records the first decision. An adversarial test investigates how close the second decision is.

The paper traces this observation to work by Szegedy and colleagues. They showed that a small image modification could move a network from one prediction to another. The observation mattered because image recognition was already being considered for systems whose decisions could have safety consequences. Carlini and Wagner also point to classification in security settings, where an input can be deliberately altered by someone who knows the decision they want. The experiments in this paper concern image classifiers, and the authors use those settings to explain why the ability to find a nearby error deserves systematic study.

The paper focuses on targeted errors. Suppose a digit is correctly labeled. An untargeted test asks whether a sufficiently similar image can acquire any wrong label. A targeted test names the destination label in advance and asks whether the classifier can be made to give that answer. The difference matters because some wrong labels may be much easier to reach than others. A result that establishes the existence of a nearby error may leave open how much control someone has over the specific error.

The authors assume white-box access for their direct tests. This means that the network’s architecture and numerical parameters are available to the evaluator, who can inspect internal scores and calculate how they respond to input changes. The paper connects this assumption to prior observations about transferability. An image changed to induce an error in one classifier can sometimes induce an error in another. Earlier work the authors discuss found that this could happen even when the classifiers were trained on different data or used different learning algorithms. A direct white-box test and a transfer test therefore supply different kinds of evidence about the same defense.

What an empirical test can establish

The paper describes two ways to study the size of the smallest change that can alter a prediction. A lower bound establishes a range of changes within which the classifier’s prediction is guaranteed to hold under the stated assumptions. An upper bound comes from a concrete counterexample. Once an evaluator has found a valid image with the desired wrong label, the true minimum change can be at most the distance to that example. It may be smaller, because the search might have missed a closer image.

That asymmetry shapes the interpretation of every experiment in the paper. A successful search provides a witness that can be checked by running the classifier on the resulting image. A failed search leaves two possibilities open. The allowed changes may all preserve the relevant decision, or the search procedure may have missed a change that works. A test whose failures mostly reflect the search itself gives little information about the lower bound. The authors describe proving such bounds as substantially harder in practice and note that the earlier approaches they discuss required approximations.

Defensive distillation made this distinction particularly important. Ordinary distillation had been proposed as a way to pass knowledge from a larger teacher network to a smaller network. The teacher supplies a distribution over labels for each training image. Those distributions can express relationships among labels that a record containing only the correct answer cannot express. A handwritten digit can resemble another digit in some respects while remaining clearly identifiable as its own class. A probability vector has room to represent that secondary resemblance.

The defensive version keeps the teacher and the network trained from it the same size. It also changes the way probabilities are formed during training through a setting called temperature. Training with a higher temperature spreads probability across classes, so the teacher’s outputs can carry more information than a sharply concentrated prediction. Evaluation uses the ordinary temperature. The resulting combinations of training targets and scoring behavior were proposed as a way to make image classifiers harder to fool.

One motivation was that adversarial examples might occupy small regions created by complicated behavior around the training examples. Learning from soft labels could then smooth away some of that behavior. The paper also describes an alternative explanation from earlier work. A network can behave roughly linearly over a local region, so small changes to many input coordinates can accumulate into a substantial change in its scores. Those explanations give different intuitions about whether a change in training will remove nearby errors. The main test in this paper asks directly whether such errors can still be found.

What earlier searches were designed to do

The earlier work used different measures of change and pursued different objectives. The approach introduced by Szegedy and colleagues used L-BFGS, an optimization method, to seek a nearby image with a different label under Euclidean distance. It treated the valid range of pixel values as a constraint. A separate method, fast gradient sign, used the direction of the gradient to make a single simultaneous change across the image. Its purpose was speed. The iterative version discussed in the paper made a sequence of smaller changes, with an overall bound on their size.

The Jacobian-based Saliency Map Attack, abbreviated JSMA, approached the problem from the standpoint of how many pixels had to change. A saliency map estimates which input coordinates have the most favorable effect on the class scores for a particular target. The method selects from candidate pixels according to that estimate and builds a set of changed pixels over the course of the search. Carlini and Wagner distinguish a version that calculates saliency from raw scores, JSMA-Z, from a version that calculates it from the final probabilities, JSMA-F. The distinction becomes important because the assessment of defensive distillation used the latter version.

Deepfool explored a different kind of question. It approximated the classifier locally with a linear decision rule and used that approximation to move towards a boundary. If the approximation did not yet lead to a changed classification, the procedure could repeat from its new position. Its objective was untargeted. It can therefore supply a useful comparison for the distance to some wrong answer, while the difficulty of reaching a specified answer is a separate measurement.

These baselines make clear that a robustness result can depend on what a test was designed to find. Speed, small distortion, choice of target, and access to internal scores are separate properties. A search can be valuable for its original purpose and give an incomplete picture when pressed into service as a general robustness test. The paper compares those properties by keeping the classifiers fixed while examining how different formulations behave.

The method, step by step

Representing the image and the decision

The study treats a grayscale image as an array of intensities and a color image as an array of red, green, and blue values. Each channel value is represented on the scale from 0 to 1. The networks work directly with those values. During the mathematical search, the values can vary continuously. The final example must also be representable as a discrete image, a condition the authors handle separately.

A classifier has internal class scores called logits. The softmax operation turns those scores into probabilities. The operation changes how widely separated the output values appear while keeping their order. The logit with the greatest value corresponds to the greatest softmax probability, so either representation can identify the winning class.

F(x) = softmax(Z(x)) = y

Here x is the image, Z is the function producing its logit vector, and softmax is the operation that converts the vector of logits into a probability vector. F is the full network including softmax, and y is its output vector. The network’s parameters are fixed while an image is being evaluated.

C(x) = arg maxᵢ F(x)ᵢ

Here C is the predicted-label function, x is the input image, and F(x)ᵢ is the probability assigned to class i. The expression arg maxᵢ returns the index i at which the probability reaches its greatest value. The paper writes C∗(x) for the recorded correct label. That recorded label and the network’s prediction play distinct roles when a starting image is already misclassified.

For comparison across image changes, the paper writes the general finite positive-order expression as follows.

‖v‖ₚ = (∑ᵢ₌₁ⁿ |vᵢ|ᵖ)¹⁄ᵖ

Here v is a vector, vᵢ is its coordinate i, n is its number of coordinates, and p is the order of the expression. The summation adds the pth powers of the coordinate magnitudes. The exponent 1/p converts that sum back to the scale of the original coordinates. With p set to 2 and v set to the difference between images, the result is Euclidean distance. It is the square root of the sum of the squared changes.

L₀ uses the number of locations changed. For a color image, the authors generally count a pixel as changed if any of its channels changed. They also consider the channel-based convention when comparing with prior work that uses it. A count can show that changes were concentrated in a few locations, but it says nothing on its own about the magnitude of each change. L₂ reflects both the size and the spread of the differences, so a collection of subtle changes can have a smaller distance than a collection containing conspicuous ones.

‖x − x′‖∞ = maxᵢ |xᵢ − x′ᵢ|

Here x is the original image and x′ is the changed image. The index i runs over their coordinates, xᵢ and x′ᵢ are the values in coordinate i, and the absolute value gives the magnitude of the change. The maximum selects the largest such change. Under L∞, changing many coordinates is compatible with a small distance if each change is small. The resulting number describes the most strongly changed coordinate and leaves the total number of changes unspecified.

Training the ordinary and distilled networks

For MNIST and CIFAR-10, the authors follow the architectures and training settings of the original defensive distillation study. Both networks use convolution with rectified linear activations, as well as pooling, fully connected layers, and a final softmax. In these architectures, convolution processes local image patterns, a rectified linear activation clips negative values to zero, and pooling combines nearby responses. The CIFAR-10 network has wider layers than the MNIST network in the architecture reported by the paper.

Training uses stochastic gradient descent with momentum. Stochastic gradient descent updates the network based on batches of training examples. Momentum carries information from previous updates into the current one. Both networks use a batch size of 128 and train for 50 epochs, with an epoch denoting a pass through the training data. The listed dropout setting is 0.5 for both. Dropout temporarily suppresses some activations during training. The authors follow the earlier setup for CIFAR-10 even though the resulting network fits the training data much better than the validation data. For ImageNet, they use a pretrained Inception v3 classifier.

Defensive distillation adds a temperature to softmax. At a fixed set of logits, a higher temperature makes the class probabilities more even.

softmax(z, T)ᵢ = exp(zᵢ ⁄ T) ⁄ ∑ⱼ exp(zⱼ ⁄ T)

Here z is the vector of logits and zᵢ is the score for class i. T is the positive temperature, exp is the exponential function, and j indexes all classes in the normalizing sum. Dividing by the sum makes the output values add to 1. A larger T reduces the differences among the exponents. When T is set to 1, the formula gives the ordinary softmax used at test time.

The teacher learns from the recorded training labels, with the training temperature applied to its outputs. After training, it supplies an entire probability vector for each training image at that same temperature. The second network has the same architecture as the teacher. It trains on those vectors in place of the original labels, again using the training temperature. When classifying new images, the second network uses temperature 1. The direct comparison in the paper uses a distillation temperature of 100, and a separate experiment varies it.

From defensive training to measured robustness

The steps in order.

From defensive training to measured robustnessStep 1: Train the teacher at the selected temperature1. Train the teacher at the selected temperatureStep 2: Record its probabilities on the training images2. Record its probabilities on the training imagesStep 3: Train the second network on those probabilities3. Train the second network on those probabilitiesStep 4: Set the test temperature to ordinary softmax4. Set the test temperature to ordinary softmaxStep 5: Evaluate with separate measures of image change5. Evaluate with separate measures of image changeStep 6: Check target labels on valid discrete images6. Check target labels on valid discrete imagesStep 7: Compare direct results and cross-network transfer7. Compare direct results and cross-network transfer

Expressing the targeted test as an optimization problem

For a fixed image, the authors ask how little it needs to change to receive a specified label. The image must remain within the range of valid intensities. The original mathematical problem separates the closeness requirement from the requirement that the test succeed.

minimize over δ  D(x, x + δ), subject to C(x + δ) = t and x + δ ∈ [0, 1]ⁿ

Here x is the original image, δ is the vector of changes, and x + δ is the candidate image. D is the selected measure of distance and C returns the classifier’s label. The symbol t denotes the chosen target label. The interval expression [0, 1]ⁿ means every coordinate of the n-coordinate image lies between 0 and 1. The legitimate starting label determines which targets are eligible.

The predicted label changes abruptly when different classes exchange the highest score. That makes the label itself awkward to use as the quantity guiding a numerical search. The authors replace the discrete check during optimization with a numerical term that reflects how far the candidate is from satisfying the target condition. They still verify the final decision using the classifier. The working objective combines that numerical term with the distance to the starting image.

minimize over δ  D(x, x + δ) + c · f(x + δ), subject to x + δ ∈ [0, 1]ⁿ

Here x, δ, D, and n retain their meanings. The function f assesses the candidate’s relation to the target label. The positive constant c weights its contribution, and the centered dot denotes multiplication. If the weight is too small, a candidate can stay close to the original while failing the label condition. If its contribution dominates, the search can reach the target with more distortion than a better-balanced search would require. This is a numerical procedure for obtaining a useful witness to the original problem.

The search tests formulations based on class probabilities, raw logits, and transformations of those quantities. Some compare the target with its strongest competitor. Others use the target probability alone or a loss associated with the target. A target probability above a majority threshold is sufficient to make it the winner, although it can also win with a smaller share when probability is spread among several classes. A direct comparison with the strongest competitor expresses the ranking more closely.

For the formulation adopted in the L₂ method, the difference between the strongest competing logit and the target logit governs the search. A confidence parameter extends the same expression to distinguish candidates just inside the target class from candidates on which the target is well ahead.

f(x′) = max(maxᵢ≠ₜ Z(x′)ᵢ − Z(x′)ₜ, −κ)

Here x′ is the candidate image, Z(x′)ᵢ is its logit for class i, and Z(x′)ₜ is its logit for target class t. The inner maximum considers all classes i other than t. The outer maximum selects the larger of the score difference and the floor −κ, where κ is the chosen confidence margin. For κ set to 0, the term stops decreasing once the target reaches the leading score. A positive κ allows the term to continue decreasing until the target has that much of a lead. Actual success still depends on the predicted label, which also resolves any tie.

The paper compares a hard cutoff for the difference with a smooth expression built from softplus. Softplus changes the shape of the objective around the threshold while preserving the orientation of the comparison. It is defined as follows.

softplus(u) = log(1 + exp(u))

Here u is the input to the function, exp is the exponential function, and log is the natural logarithm. In the paper’s smooth score-difference formulations, subtracting log(2) centers the transformation at the point where the two scores coincide. Whether the score difference comes from probabilities or logits is a separate design choice from smoothing it.

Keeping the search inside the image range

The valid range of every coordinate is a box constraint. The paper compares three ways of enforcing it. Projected descent modifies the candidate and then clips any coordinate that has gone out of range. That can complicate an update that also carries momentum from earlier steps, because the update the optimizer intended and the change that actually occurred may differ. Clipped descent instead evaluates the objective on a clipped version of the candidate. A coordinate that has gone far beyond a boundary can then sit in a region where further movement makes no difference to the clipped value, leaving the gradient with little information about how to bring that coordinate back.

The third approach describes valid image intensities in terms of unconstrained auxiliary variables. The hyperbolic tangent is bounded, so the corresponding candidate image is valid by construction. This allows the authors to use an optimizer without native support for coordinate bounds.

δᵢ = (tanh(wᵢ) + 1) ⁄ 2 − xᵢ

Here δᵢ is the proposed change to coordinate i, xᵢ is that coordinate in the original image, and wᵢ is the auxiliary value optimized for the coordinate. The function tanh is the hyperbolic tangent. Adding 1 and dividing by 2 maps its output into the permitted intensity interval. The paper also notes a small numerical adjustment to the scaling used in handling the transformation.

For L₂, the formulation uses squared Euclidean distortion in the objective. The distance is still reported in the ordinary L₂ units used throughout the comparisons. The authors use Adam, an optimizer that adapts updates using information from earlier gradients. They also try ordinary gradient descent and gradient descent with momentum. Their comparison finds similar final solution quality among these solvers, with Adam reaching that quality sooner.

The paper examines how much the outcome depends on the weight c, and uses a search over weights in the evaluation. The authors also investigate running the optimizer from different nearby starting points. A search guided by local changes in the objective can settle in one region while a different starting point leads to a better candidate. The best example found remains an empirical result even after several starting points have been considered.

L₂ combines the contribution of all the coordinates in one smooth distortion term. The L₀ count changes as soon as a coordinate moves away from its starting value, which makes it poorly suited to the same direct treatment. The authors use their L₂ formulation inside a search over which pixels may change. They start with all pixels eligible and progressively hold more pixels fixed. Each stage tests whether an adversarial example can still be found with the remaining freedom. The final set is one that survived this process of elimination. The method does not enumerate every subset of the same size, so the outcome is evidence of a small feasible set.

L∞ presents a different problem. At a candidate where one coordinate has changed more than all the others, the maximum is sensitive only to that coordinate. The second-largest change can initially grow without affecting the maximum. As their roles swap, the search can alternate between which coordinate is penalized. The paper describes using a threshold-based penalty that takes account of all changes over a current threshold. Tightening the threshold across successive searches puts pressure on several large changes together. As in the L₀ procedure, a solution from one stage can provide a starting point for the next.

The last check concerns the difference between continuous intensities and actual image values. The paper treats the final intensity as an integer on the scale from 0 to 255. A continuous candidate near a boundary can change its label when its coordinates are rounded. The authors check the discrete image and describe a local adjustment in the space of discrete images when rounding degrades the result. They report success for the resulting valid images. This detail matters particularly when the original change is small enough that rounding can remove part of it.

The authors also make the generation and network-training code available with the work. The paper’s performance claims depend on the experimental conditions described below, including how the target is selected and how failures enter the reported means.

Experiments and results

Datasets, starting images, and targets

MNIST is a recognition task for grayscale handwritten digits. CIFAR-10 contains small color images in 10 classes. ImageNet supplies a larger recognition task with 1000 classes. The pretrained Inception v3 network takes inputs of size 299×299×3 and has 96% top-5 accuracy as reported by the paper. Top-5 accuracy asks whether the correct answer is among the five highest scores. It describes a different test from whether the single highest score is correct, which is the condition used to select the ImageNet starting images.

The MNIST classifier achieves 99.5% accuracy in the setup reported by the paper. For CIFAR-10, the authors report 80% accuracy and give a training-to-validation comparison. The final training cross-entropy loss is 0.05 at 98% training accuracy, while the validation loss is 1.2 at 80% validation accuracy. Cross-entropy is a loss on the probability assigned to the recorded label. The training and validation figures show why the experiment is best read as a comparison against the earlier distillation setup. The authors retain its data and architecture choices to keep the case study comparable.

The main MNIST and CIFAR-10 comparisons use the first 1,000 test images. The ImageNet comparison uses 1,000 images that Inception v3 initially classified correctly. That eligibility requirement matters for interpretation. If a starting image already has a wrong prediction, a best-case target can coincide with it. The recorded distortion for that target can then be zero. Selecting initially correct inputs avoids that effect in the ImageNet results.

The ideal best-case and worst-case target tests examine the alternatives for an input and record the easiest and hardest respectively. The average-case test draws a target uniformly from the classes other than the correct class. A low best-case distance therefore says that there is an easy alternative. Low distortion in the average case is evidence about a random alternative. The worst case examines how difficult the hardest considered destination is. For efficiency on ImageNet, the authors describe sampling 100 possible targets for the comparisons that examine target difficulty. They give that sample as 10% of the classes. An extreme over sampled targets can miss the extreme over all targets.

Reading success and distortion together

A targeted test counts as successful if the resulting image receives the intended label. In the main method comparison, that definition does not impose a common distance ceiling. Large changes can therefore count as successes, with their size recorded separately. The mean distortion is conditional on success wherever a method fails on some instances. That means a method with a low success rate can have its mean drawn from an easier subset of cases. The table entry for success and its companion distance should be read together.

For the L₀ comparison, the authors use two versions of the Jacobian-based saliency method. For L∞ they use fast gradient sign and iterative gradient sign. They also compare with Deepfool under L₂ where its untargeted result supplies a point of comparison. They reimplement several baselines and use a modified implementation of JSMA from CleverHans. For the sign-based baselines, the authors search for a small successful change instead of comparing results at just a single predetermined distortion.

Ordinary networks on MNIST and CIFAR-10

The average-case MNIST L₀ results offer a comparison where all methods reach the random target on every tested instance. The proposed method changes fewer pixels on average than either version of JSMA. Since the success probabilities are all 100% in this comparison, the distance means cover the same test population.

Mean L₀ distortion for random targets on the ordinary MNIST network

The authors’ method reaches random target labels with fewer changed pixels on average than either saliency baseline.

Mean L₀ distortion for random targets on the ordinary MNIST networkJSMA-Z: 56JSMA-Z56JSMA-F: 45JSMA-F45Carlini and Wagner L₀ (this paper): 16Carlini and Wagner L₀ (this paper)16
The numbers
System or settingchanged pixels
JSMA-Z56
JSMA-F45
Carlini and Wagner L₀ (this paper)16

The same comparison shows how target choice changes the practical meaning of the distance. On MNIST, the authors’ L₀ method has a best-case mean of 8.5 changed pixels and a worst-case mean of 33. On CIFAR-10, its average-case mean is 13, compared with 58 for JSMA-Z and 110 for JSMA-F. These are means under the counting conventions used in the comparisons. The paper considers counting individual color channels where needed for comparability with the saliency method.

Under L₂, the new method’s mean distortion on ordinary MNIST is 1.36 in the best case, 1.76 with a random wrong target, and 2.60 in the worst case. The corresponding ordinary CIFAR-10 results are 0.17, 0.33, and 0.51. The proposed method has 100% success in those settings. Deepfool has a mean of 2.11 in the MNIST comparison where the destination can be chosen freely and 0.85 in the corresponding CIFAR-10 comparison. The Deepfool result supplies evidence about nearby misclassification without establishing success for a fixed target.

The L∞ results are closer between the proposed method and the iterative baseline. On MNIST with a random wrong target, the proposed method has a mean L∞ distortion of 0.16 and iterative gradient sign has 0.19, each with 100% success. Fast gradient sign reaches the random target on 42% of the MNIST test images in that comparison. Its reported mean distortion of 0.26 is over those successes. On the ordinary CIFAR-10 network, the proposed method’s average-case mean is 0.013 at 100% success, compared with 0.014 at 100% for iterative gradient sign. Fast gradient sign reaches 51% success there, with a mean of 0.029 among successful instances.

There is also a close comparison that favors a baseline on distortion. For the best-case L∞ test on ordinary CIFAR-10, iterative gradient sign reports 0.0078 and the authors’ method reports 0.0092, both at 100% success. The paper’s broad account of its improved distances is most informative when read alongside individual settings like this one. The strongest margins over prior work are in the L₀ and L₂ results. The authors characterize their L∞ distances as comparable to earlier work overall and emphasize the higher success rates in difficult settings.

What changes on ImageNet

The ImageNet experiment shows what happens when an image has many more coordinates and a much larger choice of labels. In the untargeted comparison, both the authors’ L₂ method and Deepfool succeed on 100% of the tested images. The authors’ method finds a smaller mean change. The untargeted column is the appropriate place to compare the two because Deepfool is designed to find an error without requiring a specified alternative.

Mean L₂ distortion in the untargeted ImageNet comparison

The authors’ approach finds a closer error on average among images that Inception initially classified correctly.

Mean L₂ distortion in the untargeted ImageNet comparisonDeepfool: 0.91Deepfool0.91Carlini and Wagner L₂ (this paper): 0.32Carlini and Wagner L₂ (this paper)0.32
The numbers
System or settingL₂ distortion
Deepfool0.91
Carlini and Wagner L₂ (this paper)0.32

With a random target on ImageNet, the proposed L₂ method has a mean distance of 0.96 and 100% success. Its random-target L₀ result is 410 changed pixels on average, also at 100% success. The paper reports both versions of JSMA at 0% in the ImageNet table because the pairwise search was too costly to run at that scale. The authors say that dropping the search over pairs substantially reduced its effectiveness. Those entries describe the feasibility of the comparison as conducted. They give no distortion estimate for JSMA under an unrestricted computation budget.

The targeted L∞ comparison is particularly revealing when read with the success column. For a random ImageNet target, the new method obtains 100% success with mean distortion 0.006. Iterative gradient sign obtains 99% success with mean 0.01. Fast gradient sign obtains 2% success, with mean 0.064 computed on those successes. In the most favorable ImageNet column, the three methods all have mean L∞ distortion 0.004 and 100% success. Those settings show how a benchmark can make methods look interchangeable if it measures only the easiest available error.

The authors describe cases where changing only the lowest-order bit of pixel values is enough to alter the Inception classification. The example illustrates what a very low maximum coordinate change can look like. Across datasets, the absolute distances need their image dimensions and counting conventions for context. Changing more pixels in a larger image can still mean altering a smaller fraction of the image, and raw Euclidean distance is affected by how many coordinates it combines.

Direct evaluation of defensive distillation

The central comparison repeats the tests on MNIST and CIFAR-10 classifiers trained with defensive distillation at temperature 100. The earlier searches the authors try in this setting fail to find adversarial examples, while each of the paper’s new methods attains 100% success under its distance measure. The distortion values show that the examples remain close by the metrics used in the study. The tested defense therefore cannot support a conclusion that nearby targeted errors have mostly disappeared.

Mean L₂ distortion for random MNIST targets before and after defensive distillation

The stronger search reaches every sampled target in both conditions and finds a higher mean distance after distillation.

Mean L₂ distortion for random MNIST targets before and after defensive distillationOrdinary training: 1.76Ordinary training1.76Defensive distillation at temperature 100 (this paper): 2.2Defensive distillation at temperature100 (this paper)2.2
The numbers
System or settingL₂ distortion
Ordinary training1.76
Defensive distillation at temperature 100 (this paper)2.2

The direction marked in this chart is the defense perspective. A larger required change would favor robustness if all else were equal. Both values are distances to examples found by a search. They are upper bounds for the instances evaluated, so the higher value on the distilled network alone cannot establish how much the underlying minimum distances changed.

On MNIST, the L₂ mean after distillation is 1.7 for the best case and 2.9 for the worst case. The average-case L∞ mean is 0.18 on the distilled network and 0.16 on the ordinary one. On CIFAR-10 with a random target, the L₂ mean rises from 0.33 on the ordinary network to 0.60 on the distilled network. In the CIFAR-10 worst case it rises from 0.51 to 0.92. The average-case L∞ comparison for CIFAR-10 gives 0.023 after distillation and 0.013 before it. The size of the gap depends on the distance measure, dataset, and target protocol. Across those settings the stronger searches retain 100% success.

The paper also examines entirely black and entirely white starting images on MNIST. The classifier initially calls the black image a 1 and the white image an 8. That gives a simple example of how a prediction can be recorded even on inputs outside the familiar appearance of handwritten digits. The authors then examine changes associated with the other target labels. They report that the resulting images do not visibly resemble the target digits. The experiment probes the network’s assignments on unusual starting inputs. It addresses a different question from how a human would label a slightly changed, recognizable digit.

What the ablations show

The objective has more influence than the coordinate constraint

The authors cross the candidate objective functions with the methods for keeping pixel values in range. Their reported table is for MNIST and covers 1000 random instances. They say that the relative ordering of the objectives matched what they saw on CIFAR. The measurements include mean distortion, dispersion, and probability of success. Failed runs are excluded from the mean distortion, which makes joint interpretation especially important in this experiment.

With the change-of-variables approach to valid intensities, the positive part of the logit gap yields a mean L₂ distortion of 1.94 and success of 100%. The corresponding hard probability-gap objective has a mean of 4.55 among its successes and succeeds on 80% of the instances. The smoothed probability-gap objective records a mean of 4.54 and success of 77%. The objective that uses the target probability against a majority threshold reaches 86% success and gives a conditional mean of 5.01. These settings all attempt to promote the same desired label, yet they present the search with different numerical information.

The logit-gap objective also has 100% success with clipped and projected descent. Its means in those settings are 2.18 and 1.95 respectively. Closely related logit formulations perform similarly under these choices. The authors thus find a stronger effect from changing what the optimizer sees as progress than from changing the way it stays within the valid intensity range, at least among the better objectives. The comparison of optimizers adds another distinction. Ordinary descent, momentum, and Adam reach results of similar quality in the authors’ tests, while Adam takes less time to converge.

The paper separately studies the tradeoff weight on MNIST. It reports that taking the smallest successful weight typically finds a result close to what it obtains from trying other weights. Applying that rule yields a result within 5% of the best outcome in the weight comparison in 70% of cases and within 30% of the same benchmark in 98% of cases. The benchmark here is the solution found using the best tried weight. The experiment measures how well the selection rule approximates that search, while the globally closest adversarial image remains unknown.

The score scale explains much of the older tests’ behavior

To understand why some objectives struggle, the authors examine score changes along straight paths between original and adversarial images. The interpolation can be written as follows.

y = αx + (1 − α)x′

Here y is an intermediate image, x is the original, x′ is the adversarial image, and α is a mixing coefficient in [0, 1]. The expressions α and 1 − α determine how much of each image contributes to the interpolated point. This y denotes an image along the path, separately from the output probability vector in the earlier notation.

Over the first 1,000 test images considered in this analysis for MNIST and CIFAR, the paper reports Pearson correlation r > .9 for the approximately linear behavior of the relevant logit along the path. Pearson correlation measures linear association. When a target logit changes at a steady rate, its probability can still change extremely slowly at first and much more rapidly near the transition. An optimizer reading the probability can receive almost no initial indication that the target is being approached. A weight large enough to make progress in that region can give too much influence to the target term later.

Defensive distillation intensifies that numerical issue. The paper measures the L₁ norm of the logits, which sums their absolute magnitudes. The reported mean is 5.8 with standard deviation 6.4 for the ordinary network, and 482 with standard deviation 457 after distillation at temperature 100. The standard deviation describes spread across the measured values. The larger logits feed into ordinary softmax at test time, making the probabilities very close to the extremes of the range. Under 32-bit floating-point arithmetic, small probabilities and their gradients can round to zero. An optimizer that relies on the resulting gradient can stop receiving a usable indication of how to change the input.

The authors give several checks on that explanation. L-BFGS can make progress with the more stable objective even when its earlier loss formulation fails. They also describe examining the probabilities after undoing the test-time sharpening for the purpose of the objective. That restores useful gradients in the L-BFGS analysis. The raw-logit version of JSMA encounters a different obstacle. Its rule takes into account changes to classes that are far from winning. An irrelevant class can therefore influence whether a candidate change is acceptable. The authors argue that the enlarged logits make this weakness more consequential. They observe that rescaling alone still leaves fast gradient sign ineffective in the setting they discuss and leave the reason open.

Temperature and confidence test different explanations

The original MNIST temperature comparison reported in the paper gives a JSMA success rate of 91% at temperature 1, 24% at temperature 5, and 0.5% at temperature 100. Carlini and Wagner repeat the temperature experiment and observe the same downward pattern with their implementation of JSMA. They also use their L₂ method to measure mean distortion for random targets as temperature varies from 1 to 100. For that test, the paper reports ρ = −0.05 as the correlation between temperature and mean distance. The comparison shows that the steep decline in the older attack’s success can coexist with little association between temperature and the distances returned by the stronger test.

The transfer experiment changes a different variable. The authors train separate MNIST classifiers on different halves of the training data. They test how often an image with an incorrect prediction on the source classifier also receives an incorrect prediction on the receiving classifier. The distinction between targeted and untargeted transfer is important here. Targeted transfer keeps the intended wrong label. Untargeted transfer counts a wrong prediction even if the receiving network chooses a different wrong label.

Varying the source confidence margin from 0 to 40 gives a way to study what changes when the source’s target score leads by more. For transfer between ordinary classifiers, the authors report success increasing from κ = 0 to κ = 20 and leveling off near 100% around κ ≈ 20. With a distilled receiver trained at temperature 100, the paper reports transfer reaching 100% at κ = 40. A candidate near the boundary of the source’s target class can be sensitive to differences between classifiers. Asking for a more decisive target prediction selects examples that, in these experiments, are more likely to retain the error on another network. Distillation changes the confidence setting at which the reported transfer curve reaches its ceiling, while high-confidence examples continue to transfer.

Limitations

Limits the authors state

The authors explicitly treat the image distances as approximations to human perception. Each measure describes a genuine property of the change, and each leaves out information about its appearance. L₀ omits the magnitude of changes at the pixels it counts. L₂ aggregates changes without regard to whether they fall in different parts of the depicted object. L∞ summarizes only the largest individual difference. The authors use these measures because of their precedent and their role in the case for defensive distillation. They leave the design and evaluation of a better perceptual measure open.

The paper’s illustrative images help explain why these distinctions matter. Some digit changes are visibly apparent, especially in examples that concentrate their distortion. The authors discuss turning a 7 into a classifier prediction of 6 as a visually conspicuous case in their MNIST figures. For the comparable CIFAR-10 examples, the paper describes the changes as visually indistinguishable from their starting images in the L₂ and L∞ illustrations. These judgments concern particular displayed examples. The article’s quantitative evidence is the distortion and classification outcome, rather than a systematic measurement of how people perceive every image.

The authors also state that the search can settle at a local minimum. Running it from several starting positions can improve results, but the examples remain witnesses obtained by optimization. Their L₀ procedure makes this particularly clear. Finding a small set of pixels whose modification reaches a target does not determine whether a different set containing even fewer pixels would work. The same distinction applies when comparing the successful distances of the ordinary and the distilled networks. A change in an upper bound may reflect a change in the underlying distances, a change in search behavior, or a combination of both.

The authors decline to give a precise overall runtime ranking because their implementations differ in how they use parallel computation. The L₂ implementation can run many searches together on a GPU. Their L₀ and L∞ implementations were not parallelized in the same way. Fast gradient sign and JSMA also differ in implementation and computational structure. The paper gives rough comparisons and says that runs on individual instances take at most a few minutes in its tests. Those observations describe the authors’ software and experiments. They do not isolate the cost intrinsic to each mathematical approach.

Finally, the authors leave part of the mechanism unresolved. Their diagnosis of vanishing gradients explains several failures on distilled networks, and their treatment of JSMA-Z identifies a separate problem with that method’s scoring rule. The continued weakness of fast gradient sign after the probability rescaling they discuss remains unexplained. The direct finding that the defense can be defeated at low distortion is supported by actual examples, independently of a complete explanation of every baseline failure.

Limits that follow from the setup

The distillation comparison is drawn from the authors’ implementations on MNIST and CIFAR-10. ImageNet broadens the comparison of search methods on an ordinary network. The paper does not supply the corresponding distilled ImageNet comparison, so conclusions about the defense there remain open. Similarly, security-related examples in the paper explain the motivation for studying robustness. They do not extend the image experiments to a test of other kinds of input or to systems using an image classifier as one component of a larger decision.

The reported 100% figures apply to the images and target protocols the authors evaluated. ImageNet uses a selected set of initially correct images and samples alternative labels for the difficult target comparisons. The MNIST and CIFAR-10 cohorts are the first 1,000 test images, which is a different inclusion rule. The results can be compared directly within a specified experiment. Extending a percentage to images outside those cohorts, or to every ImageNet target for each tested image, would require information beyond the reported denominators.

The definition of success also limits what a percentage means. A method can achieve 100% targeted success under a test that allows the search to choose the distortion. Whether it can achieve the same rate under a particular external distortion budget is a separate question. Means do not describe the full range of distances or guarantee that any one example stays inside a chosen threshold. The best, average, and worst target protocols supply different views of the problem, with each still aggregating examples over an image cohort.

Transferability establishes an additional, narrower result. The source and receiver in the confidence experiment are MNIST classifiers trained on disjoint portions of the data, with defensive distillation applied to the receiver in the relevant comparison. The experiment shows that direct information about the receiving classifier is unnecessary for an error to transfer in that setup. A different architecture, dataset, or defense would pose a fresh empirical question. The confidence margins used here describe the separation of raw scores on the source and carry no universal probability interpretation across classifiers.

A final distinction concerns numerical confidence and security. The large logit magnitudes explain why reported probabilities can become extremely concentrated after distillation. That is a property of how scores are represented and converted to probabilities. A nearby counterexample shows that a confident decision can still be fragile. At the same time, knowing that a particular loss has a vanishing gradient does not on its own establish the existence or location of a counterexample. The paper supplies that evidence through direct examples and through transfer, with different assumptions for each test.

What came after

Training for robustness and certifying it

The later work on adversarially resistant deep learning takes up the training side of the problem posed by Carlini and Wagner. The connection is between the image search used for evaluation and the criterion a learner should satisfy during training. If ordinary accuracy measures performance on the given images, adversarial resistance asks how the trained decision behaves around them. A study devoted to learning with adversarial resistance as an objective addresses that second question from the outset. Its scope is development of resistant networks. Carlini and Wagner’s case study supplies the evaluation problem such work must be able to face. Towards Deep Learning Models Resistant to Adversarial Attacks

Work on certified defenses addresses the guarantee side of the distinction. A certification result seeks evidence that a stated class of changes cannot produce an error under the conditions of the certificate. The outcome has a different logical form from the distance to an example found by an optimizer. If the conditions for a certificate hold on an image, the guarantee covers the allowed changes. A successful search instead identifies a particular change that works. The title identifies certification as the later paper’s contribution. The relevant connection is to the lower-bound route that Carlini and Wagner describe as difficult to establish in practice. Certified Defenses against Adversarial Examples

The study of adversarial robustness and generalization separates two properties that can otherwise be conflated. Generalization is the ability to perform on inputs beyond the examples used for training. Adversarial robustness concerns what happens under a specified kind of change to an input. Carlini and Wagner’s CIFAR-10 setup already makes it possible to ask different questions about fit on the training set, performance on validation data, and the distance to a targeted error. The later study makes the relationship between robustness and generalization its explicit subject. Disentangling Adversarial Robustness and Generalization

Changing what counts as an input change

HotFlip takes the white-box adversarial-example question to text classification. In Carlini and Wagner’s study, the manipulated quantities are image intensities, and the final candidate must be representable as a discrete image. In a text classifier, permissible changes act on discrete text elements from the start. That changes what an evaluator can vary and what it means to keep the candidate close to the original. The connection is the use of white-box access to probe how an input can be changed into a classification error. The later work applies that question to a different input domain. HotFlip

Work on black-box generation of adversarial text changes the access assumption along with the input domain. The direct image experiments in the earlier paper inspect the network’s internal scores. Its transfer study considers what may still happen when the receiving network is left out of the direct search. The later text study names black-box evasion as its object, so the evidence available about the classifier is part of the problem from the beginning. This connection concerns the distinction between direct access and behavior visible from outside. The paper’s title establishes that it studies adversarial text against deep learning classifiers under black-box conditions. Black-box Generation of Adversarial Text Sequences

The later work on automatic speech recognition frames the desired example as imperceptible, robust, and targeted. Targeting carries over the requirement to produce a chosen wrong output. The other conditions broaden the question about how an example is judged. Imperceptibility makes the listener’s ability to detect changes central to the problem. Robustness asks for the effect to endure under the conditions studied, in addition to producing the desired output. The image paper had already distinguished score changes and pixel distances from what a person can see. The speech paper poses the corresponding question in a domain where perception and the target output have different forms. Imperceptible, Robust, and Targeted Adversarial Examples for Automatic Speech Recognition

Confidence and transfer beyond the original benchmark

The later study of high-confidence predictions far from the training data asks where strongly expressed predictions can arise and how to mitigate them. Its subject connects to Carlini and Wagner’s examples starting from entirely black or white images, and to the more general separation between probability concentration and the strength of the evidence behind a decision. The earlier paper uses high confidence as a variable in a transfer experiment. The later paper makes high confidence away from the training data itself the phenomenon to explain. Why ReLU Networks Yield High-Confidence Predictions Far Away From the Training Data

Work on universal and transferable adversarial attacks in aligned language systems returns to transferability in another setting. In the MNIST study, transfer means an adversarial input found using one classifier retains an unwanted effect on another. The later work makes transfer and universality explicit parts of its question in aligned language systems. The title supports that connection in scope. Whether the same measures of confidence or the same relationships between distance and transfer apply across those domains is a separate empirical question. Universal and Transferable Adversarial Attacks on Aligned Language Models

Cite

Cite as Nicholas Carlini and David Wagner. 2017. Towards Evaluating the Robustness of Neural Networks. Proceedings - IEEE Symposium on Security and Privacy/Proceedings of the ... IEEE Symposium on Security and Privacy.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1109/sp.2017.49 · arXiv 1608.04644

@inproceedings{carlini2017evaluating,
  title = {{Towards Evaluating the Robustness of Neural Networks}},
  author = {Nicholas Carlini and David Wagner},
  booktitle = {Proceedings - IEEE Symposium on Security and Privacy/Proceedings of the ... IEEE Symposium on Security and Privacy},
  year = {2017},
  doi = {10.1109/sp.2017.49},
  eprint = {1608.04644},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/sp.2017.49}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/carlini-2017-evaluating-robustness-neural-networks/