wikillm

Paper · 2013-12-21 · cs.CV, cs.LG, cs.NE

Intriguing properties of neural networks

Shows that deep image classifiers have blind spots: a tiny, optimised input change flips the label (adversarial examples), and these also fool other models and models trained on other data. Argues single hidden units are no more meaningful than random directions. ImageNet evidence is mostly qualitative; quantitative tables use small MNIST models. Author-reported.

Adversarial robustnessLipschitz constraintInterpretable machine learningadversarial-examplesinterpretabilitylipschitz-boundstability

arXivPDFMarkdown14 min read

AI-compiled by claude-haiku-5-5 on 2026-10-24, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

Image classifiers built from neural networks can be surprisingly fragile. The authors took pictures the network classified correctly and found a way to change them slightly, in a way that is hard to tell apart by eye, so that the network's answer flips. The change is not random noise. It is found by an optimisation that searches for the smallest change that produces a wrong answer. Changes found for one network also fooled other networks, including networks trained with different settings or on a different part of the data.

The paper also questions a common way of reading a network: looking at one hidden unit at a time to work out what it "means". The authors found that a random mix of units is just as easy to interpret as a single unit. So the meaning may sit in the whole pattern of activations rather than in individual units.

Why it matters: a model can look accurate and still have blind spots that random sampling rarely finds. The pitfalls below list what the paper leaves untested.

TL;DR

Deep networks trained by backpropagation can be pushed to wrong answers by small, optimised input changes, called adversarial examples. The paper reports that such examples were found for every sample tested on MNIST, QuocNet and AlexNet, and that many of them also fool other networks, including ones trained on a disjoint half of the data §4.2. It also argues that a single hidden unit is no more meaningful than a random direction in activation space §3. The ImageNet evidence is qualitative. The quantitative tables cover small MNIST models. All results are author-reported.

Problem

The authors expect a network that generalises well to be stable under small input changes, since a small change should not change the object class [§1, §4]. They argue that for deep networks this smoothness assumption does not hold §4. Second, interpreting a network by inspecting one unit at a time assumes that the units of the last feature layer form a useful basis. The paper challenges that assumption §1, §3. Random sampling around an example rarely finds these blind spots, which motivates a targeted search §4.

Method

The paper has three parts. (a) A unit-analysis procedure that compares natural basis directions with random directions §3. (b) A search for a minimal input change that alters the output, followed by transfer experiments §4.1, §4.2. (c) A layer-wise Lipschitz bound on how far a network can amplify a perturbation §4.3. The authors propose penalising this bound as a regulariser, but they do not test it §4.3.

(a) Unit analysis §3

  1. Take the activations φ(x) of one layer. Use a held-out set I of images that the network was not trained on: the MNIST test set for the MNIST network, the ImageNet validation set for AlexNet §3.
  2. For a unit i, use the natural direction e_i, the basis vector of that unit. Find the image that maximises ⟨φ(x), e_i⟩ over I §3.
  3. For a random direction v, find the image that maximises ⟨φ(x), v⟩ over I. The paper does not state how v is sampled §3.
  4. Inspect the top images visually. The paper reports that images in the natural and random cases both share semantic properties within each row of figs. 1 to 4 §3, fig. 1–4.
Pseudocode
# Visual inspection of one direction in an activation space  [§3]
# Input:  network phi; held-out images (not trained on); direction v
# Output: the held-out images ranked by their score along v

def top_images_for_direction(phi, heldout_images, direction):
    # Score each held-out image by its projection onto the direction  [§3]
    scores = [dot(phi(image), direction) for image in heldout_images]
    # Rank the images so the highest scores can be inspected  [§3]
    return sort_by_score(heldout_images, scores)

(b) Minimal adversarial perturbation §4.1

For a classifier f, an image x in [0, 1]^m and a target label l, the paper defines D(x, l) as the nearest image to x that f labels as l:

\min_{r}\; \|r\|_2 \quad \text{s.t.}\quad f(x+r)=l,\;\; x+r \in [0,1]^m §4.1

Exact minimisation is hard, and the paper notes that the penalty form below is exact only for convex losses, which neural networks are not §4.1. The approximation is a line search for the smallest c > 0 such that the minimiser r of the following problem is labelled l, solved with box-constrained L-BFGS:

\min_{r}\; c\,|r| + \mathrm{loss}_f(x+r, l) \quad \text{s.t.}\quad x+r \in [0,1]^m §4.1

Pseudocode
# Approximate D(x, l): the nearest image to x that f labels as l  [§4.1]
# Input:  image x in [0, 1]^m; target label l; classifier f; loss_f
# Output: x + r, or None if no tried penalty weight works

def minimal_distortion(x, target, f, loss_f):
    # Try c > 0 from smallest up; search rule not stated  [§4.1]
    for penalty in penalty_weights:
        # Box-constrained L-BFGS on penalty * |r| + loss  [§4.1]
        # The box keeps every pixel of x + r inside [0, 1]  [§4.1]
        r = box_constrained_lbfgs(x, target, loss_f, penalty)
        # Accept the first penalty whose minimiser is labelled target  [§4.1]
        if f(x + r) == target:
            return x + r
    return None

(c) Transfer experiments §4.2

  1. Train the MNIST models with weight decay, using L-BFGS "until convergence". The penalty is λ Σ w_i² / k, where k is the number of units in the layer §4.2. The architectures are in tab. 1.
  2. Generate D(x, l) examples on the MNIST training set for each model. Feed them to the other models and record the error rate §4.2, tab. 2.
  3. Split the 60000 MNIST training images into two disjoint sets P1 and P2 of 30000 each. Train FC100-100-10 and FC123-456-10 on P1 and FC100-100-10' on P2 §4.2, tab. 3. Generate examples on the test set with each model and evaluate them on all three §4.2, tab. 4.
  4. To strengthen the perturbation, use x + 0.1 (x' − x) / ‖x' − x‖₂, where x' is the minimal example. The paper says this magnifies the distortion, from stddev 0.06 to 0.1 §4.2, tab. 4. See Pitfalls for the scaling problem.

(d) Adversarial training experiment §4.2

The paper reports a preliminary experiment. A two-layer 100-100-10 non-convolutional network, trained with weight decay and no dropout, mixes a pool of adversarial examples into the training set. The pool is replaced continually. The authors report a test error below 1.2%. Weight decay alone gave 1.6% and dropout about 1.3% §4.2. A "subtle, but essential detail" is that the examples were generated for each layer's output and used to train all the layers above it. The network was trained in alternating fashion §4.2.

(e) Lipschitz bound per layer §4.3

The network's instability is bounded by L = ∏_k L_k, where L_k is an upper Lipschitz constant of layer k §4.3. The rules for each layer type are:

  • Rectified layer, φ_k(x) = max(0, W_k x + b_k): L_k ≤ ‖W_k‖, the operator norm (largest singular value) of the weights §4.3.
  • Max-pooling: contractive, so its bound is 1 §4.3.
  • Contrast normalisation, φ_k(x) = x / (ε + ‖x‖²)^γ: bound ε^(−γ) for γ in [0.5, 1] §4.3.
  • Convolution: the operator norm is a supremum over frequencies of a matrix built from the kernel's 2-D Fourier transform, given by eq. 1 eq. 1.

\|W\| = \sup_{\xi \in [0,\, N\Delta^{-1})^2} \|A(\xi)\| eq. 1

The matrix A(ξ) has one row per output feature d. Its entries are the Fourier transforms of the kernels w_{c,d} at frequencies ξ + l·N·Δ⁻¹, for l in {0, …, Δ−1}², and it has C·Δ² columns §4.3. N is the kernel size and Δ the stride. The paper's stated Fourier formula uses the exponent 2π i (u·ξ) / N² (see Pitfalls).

Pseudocode
# Conservative upper bound on the instability of a network  [§4.3]
# Input:  layers, each with a kind and its parameters
# Output: L, the product of per-layer upper Lipschitz bounds

def network_lipschitz_bound(layers):
    # Start from the neutral factor  [§4.3]
    bound = 1.0
    for layer in layers:
        bound = bound * layer_lipschitz_bound(layer)
    return bound


def layer_lipschitz_bound(layer):
    # Dense or rectified layer: largest singular value of its weights  [§4.3]
    if layer.kind in ("dense", "rectified"):
        return spectral_norm(layer.weights)
    # Convolution: sup over frequencies of the norm of A(xi)  [eq. 1]
    if layer.kind == "convolution":
        return convolution_operator_norm(layer.weights, layer.stride)
    # Max-pooling does not expand gradients, so its bound is 1  [§4.3]
    if layer.kind == "max_pooling":
        return 1.0
    # Contrast normalisation: eps ** (-gamma), gamma in [0.5, 1]  [§4.3]
    return epsilon ** (-gamma)

Hyperparameters

NameValueWhereNotes
Weight decay λ, FC10 models10⁻⁴, 10⁻², 1tab. 1 §4.2quadratic penalty λ Σ w_i² / k, k = units in layer
Weight decay λ, FC100-100-10 and FC200-200-1010⁻⁵, 10⁻⁵, 10⁻⁶tab. 1one value per layer, as listed in the table's description
Weight decay λ, AE400-1010⁻⁶tab. 1softmax classifier on a sparse autoencoder with 400 units
Training optimiser (MNIST models)L-BFGS until convergence§4.2learning rate, iteration count, tolerance: not stated
MNIST layer sizes784 inputs; 100-100-10, 123-456-10, 200-200-10, 400 AE§4.2 tab. 1 tab. 3sigmoid hidden units for the FC networks
Penalty weight c for D(x, l)smallest c > 0 found by line search§4.1start value, step and stop rule: not stated
Optimiser for D(x, l)box-constrained L-BFGS§4.1iterations and tolerance: not stated
Pixel range, MNIST[0, 1]§4.2
Pixel range, ImageNetnot stated§3 §4.1the AlexNet distortion (0.006508) cannot be compared with MNIST values without it
Distortion measure, MNIST√(Σ (x'_i − x_i)² / n), n = 784§4.2root-mean-square per pixel
MNIST splitP1 and P2, 30000 images each§4.2 tab. 3from the 60000 training images
Amplification step0.1 along (x' − x) / ‖x' − x‖₂§4.2see Pitfalls on scaling
Gaussian noise baselinesstddev 0.1 and 0.3 (tab. 2); 0.06 and 0.1 (tab. 4); 1 (fig. 7)tab. 2 tab. 4 fig. 7reference rows for random noise
Held-out set for units, MNISTMNIST test set§3
Held-out set for units, AlexNetImageNet validation set§3
Adversarial training network100-100-10, non-convolutional, weight decay, no dropout§4.2pool size, replacement rate, schedule, λ: not stated
QuocNetabout 1 billion learnable parameters; unsupervised; about 10 million YouTube frames§2
Binary car classifier on QuocNeton last-layer features, no fine-tuningfig. 6

Results

Author-reported. Setup: MNIST fully connected and autoencoder models (tab. 1 to 4), trained with L-BFGS; AlexNet and QuocNet only qualitatively (figs. 5 and 6). Hardware is not stated. Baseline for the adversarial training experiment: weight decay alone and dropout §4.2.

Unit analysis §3

No numbers. Figs. 1 and 2 show MNIST top images for natural and random directions. Figs. 3 and 4 show the same for AlexNet on the ImageNet validation set. The paper reports that the rows share semantic properties in both cases.

Adversarial examples across models §4.2

Qualitative. Figs. 5 (AlexNet) and 6 (QuocNet) show examples. In fig. 5, the distorted images are all classified as "ostrich, Struthio camelus". The average distortion is 0.006508 over 64 examples. In fig. 6, a binary car classifier on the last-layer features recognises the original images, but not the distorted ones.

Table 1: MNIST models tab. 1

ModelArchitecture and weight decayTrain errorTest errorMin. avg. distortion
FC10(10⁻⁴)Softmax with λ = 10⁻⁴6.7%7.4%0.062
FC10(10⁻²)Softmax with λ = 10⁻²10%9.4%0.1
FC10(1)Softmax with λ = 121.2%20%0.14
FC100-100-10Sigmoid network, λ = 10⁻⁵, 10⁻⁵, 10⁻⁶0%1.64%0.058
FC200-200-10Sigmoid network, λ = 10⁻⁵, 10⁻⁵, 10⁻⁶0%1.54%0.065
AE400-10Autoencoder with Softmax, λ = 10⁻⁶0.57%1.9%0.086

The distortion column is the minimum average distortion needed to reach 0% accuracy on the training set §4.2.

Table 2: Cross-model generalisation tab. 2

Rows are the model that generated the examples. Columns are the model that classified them. Each cell is the error rate.

Generated forFC10(10⁻⁴)FC10(10⁻²)FC10(1)FC100-100-10FC200-200-10AE400-10Av. distortion
FC10(10⁻⁴)100%11.7%22.7%2%3.9%2.7%0.062
FC10(10⁻²)87.1%100%35.2%35.9%27.3%9.8%0.1
FC10(1)71.9%76.2%100%48.1%47%34.4%0.14
FC100-100-1028.9%13.7%21.1%100%6.6%2%0.058
FC200-200-1038.2%14%23.8%20.3%100%2.7%0.065
AE400-1023.4%16%24.8%9.4%6.6%100%0.086
Gaussian noise, stddev 0.15.0%10.1%18.3%0%0%0.8%0.1
Gaussian noise, stddev 0.315.6%11.3%22.7%5%4.3%3.1%0.3

The text says the noise at stddev 0.1 is larger than the adversarial noise for all but one of the models §4.2.

Table 3: Models trained on disjoint halves tab. 3

ModelError on P1Error on P2Error on testMin av. distortion
FC100-100-10, trained on P10%2.4%2%0.062
FC123-456-10, trained on P10%2.5%2.1%0.059
FC100-100-10', trained on P22.3%0%2.1%0.058

Table 4: Cross-training-set generalisation tab. 4

Rows are the model that generated the examples. Columns are the model that classified them. Each cell is the error rate.

Generated forFC100-100-10FC123-456-10FC100-100-10'
FC100-100-10 (av. stddev 0.062)100%26.2%5.9%
FC123-456-10 (av. stddev 0.059)6.25%100%5.1%
FC100-100-10' (av. stddev 0.058)8.2%8.2%100%
Gaussian noise, stddev 0.062.2%2.6%2.4%
FC100-100-10, amplified to stddev 0.1100%98%43%
FC123-456-10, amplified to stddev 0.196%100%22%
FC100-100-10', amplified to stddev 0.127%50%100%
Gaussian noise, stddev 0.12.6%2.8%2.7%

The examples in this table are generated on the test set, not the training set §4.2.

Table 5: Upper Lipschitz bounds, ImageNet network tab. 5

The source caption calls these "frame bounds". The text calls them upper Lipschitz bounds, computed with eq. 1 for the network of Krizhevsky et al. §4.3.

LayerSizeStrideUpper bound
Conv. 13 × 11 × 11 × 9642.75
Conv. 296 × 5 × 5 × 256110
Conv. 3256 × 3 × 3 × 38417
Conv. 4384 × 3 × 3 × 38417.5
Conv. 5384 × 3 × 3 × 256111
FC. 19216 × 4096N/A3.12
FC. 24096 × 4096N/A4
FC. 34096 × 1000N/A4

The paper says instability can appear already in the first convolutional layer §4.3. The authors note these are upper bounds. A large bound does not imply that adversarial examples exist, but a small bound guarantees that none do §4.3.

Adversarial training §4.2

Preliminary. The authors report test error below 1.2% for the 100-100-10 network trained with adversarial examples. Weight decay alone gave 1.6% and dropout about 1.3%. The paper gives no variance or repeat runs §4.2.

Paper vs code

No official code.

I searched in three steps. The paper text links no code. The only link in the paper is a short link (goo.gl/huaGPb) that redirects to a Google+ photo album of full-resolution images, which is not code §4.2. No project page is linked. A GitHub repository search for "intriguing properties neural networks" and for "adversarial examples szegedy" returned only third-party reimplementations: Harry24k/IPNN-pytorch, LechengKong/adversarialEval, eryawww/adversarial_attacking_mnist and mingcheung/fooling-examples. None is owned by an author, so none is used here.

Pitfalls

  • Unit analysis is qualitative. No metric compares natural and random directions. The paper states that the analysis "does not explain the behavior on the rest of its domain" §3. The random directions are not sampled in any stated way §3. The MNIST network is not described beyond "a convolutional neural network" §3.
  • The minimal-distortion search is an approximation. The paper states that exact computation is hard, and that the penalty form is exact only for convex losses §4.1. Success is confirmed only by checking that f(x + r) = l §4.1. No failure count is reported. The paper says it "always managed" to generate an example for each sample tested §4.2, but the search range, step and stopping rule are not stated.
  • Norm notation. The formal problem uses ‖r‖₂. The penalty uses |r| without defining the norm §4.1. The MNIST distortion measure in §4.2 is the root-mean-square per pixel, which is ‖r‖₂ / √n. Implement the L2 norm and state which one you use.
  • Amplification step does not match its stated effect. The formula x + 0.1 (x' − x) / ‖x' − x‖₂ has a unit-norm direction scaled to 0.1. Its L2 norm is 0.1, so its RMS per pixel is 0.1 / √784 ≈ 0.0036, not a change of stddev from 0.06 to 0.1 §4.2. The paper also says the effect is a 40% increase, but 0.06 to 0.1 is about 67%. The intended scaling is not stated. Treat the amplified rows of tab. 4 as unreproducible from the formula alone.
  • The Fourier formula looks wrong. The paper writes the exponent as 2πi(u·ξ)/N² for ξ in [0, N/Δ)² §4.3. The usual 2-D DFT uses N, not N², in the denominator. The paper's own code was not found, so the convention cannot be checked. Verify numerically before relying on eq. 1 eq. 1.
  • Bounds are not tested as a regulariser. The authors suggest penalising each upper Lipschitz bound, which "might help improve the generalisation error" §4.3. This paper does not run that experiment.
  • Adversarial training is underspecified. Pool size, replacement rate, alternation schedule, weight decay value and the layers used are not stated §4.2. The gain is reported from one run each, with no variance §4.2. The paper calls it "preliminary" and says a systematic comparison was future work §4.2.
  • Training and test splits differ between tables. tab. 1 and tab. 2 generate examples on the training set. tab. 3 and tab. 4 use the test set §4.2. The name FC100-100-10 appears in tab. 1 and tab. 3 but refers to different trained models.
  • Text typos in the source. §4.2 writes "FC100-100-10 and FC100-100-10" where tab. 4 has FC100-100-10'. Use the table's names.
  • ImageNet results are qualitative. Only the AlexNet and QuocNet examples (figs. 5 and 6) are shown, with one average distortion value over 64 examples fig. 5. The paper says it has no convolutional MNIST results §4.2.
  • Explanation of the blind spots is speculative. The paper suggests that adversarial examples are rare but dense in the input space, and that they are rarely seen in the test set. It states that its understanding of how often they occur is incomplete §5.
  • Version. The raw metadata lists arXiv v4, updated 2014-02-19. This card reads the LaTeX source fetched for that version. Earlier versions may differ.

Lineage

  • Prior unit-visualisation work the paper argues against, which finds the inputs that maximally activate one unit §1, §3: Zeiler and Fergus, arXiv:1311.2901; Girshick et al., arXiv:1311.2524. Neither has a card.
  • Word vectors, cited for the analogous claim that a space rather than single coordinates carries meaning §1: Mikolov et al., arXiv:1301.3781.
  • QuocNet, the unsupervised network used in the experiments §2: Le et al., arXiv:1112.6209.
  • Hard-negative mining, cited as a close analogy for the constructive use of adversarial examples §4: Felzenszwalb et al. (2008), no arXiv id.
  • Superseded by: not recorded in this wiki.

Source and license

Adapted from “Intriguing properties of neural networks” by Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, Rob Fergus (arXiv:1312.6199), used under http://creativecommons.org/licenses/by/3.0/. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors.