research28 min studyLesson 931 in Engineering

State exactly which perturbations count

Specify attacker access, coordinate units, feasible inputs, and success before interpreting any robustness score.

On this page

What you’ll understand

  • Define a norm-bounded feasible set in the attacked coordinates.
  • Distinguish attack survival from true worst-case accuracy.
  • Calculate how preprocessing changes a perturbation budget.

A vision model survives an attack described only as small noise. That result is impossible to interpret until small has a coordinate system, a norm, and a budget. A change of eight intensity levels on an integer image is different from eight units after normalizing pixels to [0,1]. An attacker who sees gradients has different information from one who receives only a label. Define those choices, the complete prediction pipeline, and the required failure event before running an experiment. The result will then describe a precise test rather than an unbounded claim that a model is robust.

Define the feasible input set

Let the original input lie in an explicitly declared domain, such as a real-valued image box. Intersect the perturbation ball with that domain, and say whether submitted inputs must also survive rounding, encoding, or another validity constraint. A continuous [0,1] threat does not automatically describe perturbations of integer image bytes. Preserve the original input used to compute the distance; projecting each step around the latest iterate would let an attack drift beyond its total budget.

Coordinatewise normalization changes geometry. If channel c is divided by standard deviation s_c, then a raw perturbation δ_c becomes δ_c/s_c in normalized coordinates. A uniform raw infinity-norm budget therefore becomes channel-dependent after normalization unless the scales coincide. Put preprocessing inside the model wrapper and measure the threat in its intended external coordinates. Otherwise two evaluators can use the same epsilon string while attacking substantially different sets of inputs.

Sp(x,ε)={x+δ∈X:∥δ∥p≤ε}\mathcal S_p(x,\varepsilon)=\{x+\delta\in\mathcal X:\lVert\delta\rVert_p\leq\varepsilon\}
x∈X is the clean input, ε≥0 has the same coordinate units as x, and p specifies the norm. Any discrete encoding or semantic validity restriction must be included separately in X or in an additional feasibility condition.↔ Scroll wide equations horizontally.

Separate capabilities from the failure objective

A white-box evaluation may expose weights, preprocessing, and derivatives. A score-based interface exposes numeric outputs, while a label-only interface reveals less. State query limits, attacker knowledge of randomness, and whether repeated requests share state. Untargeted failure means an incorrect output; targeted failure requires a particular specified wrong output. Rejection may count as safe abstention, denial of service, or failure depending on the application. These are distinct success predicates and need separate denominators.

For ordinary deterministic classification, a sample is truly robust only if every allowed input preserves its correct label. Clean errors already fail this definition because the unperturbed input is feasible. An attack suite examines only some feasible candidates. The fraction surviving those candidates is therefore an upper bound on exact finite-test-set robust accuracy, provided success and feasibility are checked correctly. A failed search cannot supply a lower bound or a certificate of the universal property.

Arobust=1N∑i1{∀z∈Sp(xi,ε):F(z)=yi} ≤ AsurviveA_{\rm robust}=\frac1N\sum_i\mathbf1\{\forall z\in\mathcal S_p(x_i,\varepsilon):F(z)=y_i\}\ \leq\ A_{\rm survive}
N>0 is a fixed labeled test-set size. F is the deterministic complete pipeline. Survive includes clean correctness and correctness on every tested feasible candidate; the inequality is pointwise for this finite set, not a population confidence interval.↔ Scroll wide equations horizontally.

Publish the scope with the number

Record dataset version, selected examples, label policy, norm, epsilon, input scaling, model artifact, preprocessing, output rule, attack access, and compute budget. If the classifier is stochastic, define whether success means a single draw, a threshold misclassification probability, or a failure of an aggregated decision. Fixing one convenient random seed changes the attacked object unless the actual service uses that same deterministic decision rule. Test the object named in the report.

Norm relationships help diagnose budget mistakes but do not make threat models interchangeable. In d dimensions, a bounded infinity norm implies a Euclidean bound that grows with the square root of d; the converse gives a different set inclusion. Neither norm establishes perceptual equivalence or label preservation. A tiny change can matter for a task built around a small critical feature, while a large brightness shift may preserve another task’s label. Report the mathematical scope and semantic assumptions separately.

The same perturbation under three geometries

A four-coordinate input in [0,1] receives perturbation δ=(0.03,−0.04,0,0), and remains inside the input box. Compute its infinity, Euclidean, and one norms. Then normalize the first two coordinates by scales 0.5 and 0.25 and compute the transformed infinity norm.

  1. The largest absolute coordinate is 0.04, so the infinity norm is 0.04. The sum of absolute coordinates is 0.03+0.04=0.07, giving its one norm.

  2. The Euclidean norm is √(0.03²+0.04²)=√0.0025=0.05. Thus the perturbation satisfies an infinity budget 0.04 but violates a Euclidean budget 0.04.

  3. After the stated normalization, the nonzero coordinates become 0.03/0.5=0.06 and −0.04/0.25=−0.16. Their infinity norm is 0.16, so copying the raw epsilon unchanged into normalized coordinates would change the feasible set.

The result

A budget is meaningful only with its norm, coordinate system, and domain. These calculations check feasibility; they do not establish that the true label was preserved or that the model failed.

Explore the model

Interactive lab

Interactive lab · vectors

Compare Euclidean length with coordinate displacement

Reset, set Angle to 0° and Magnitude to 0.5. Predict components (0.5,0) and Euclidean length 0.5 before Step. Reset, explicitly set Angle to 45° and Magnitude to 0.5, then Step: predict both components approximately 0.354 while Euclidean length stays 0.5. The largest coordinate changes with direction. This displays one 2D vector, not an image attack or a robustness certificate.

Compare Euclidean length with coordinate displacementPlayback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Current readings: x component: 1.393; y component: 0.975; Magnitude: 1.7. All parameters are adjustable with the labeled controls below.−7.46−3.7303.737.46−3.5−1.7501.753.5xyvvₓ = 1.39
Vectorx / y projectionsTrace marker
x component
1.393
y component
0.975
Magnitude
1.7
t = 0 s

Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forEqual Euclidean lengths can correspond to different coordinatewise budgets.

Check your understanding

What follows when a valid finite attack suite finds no failure for a clean-correct example?

Try it yourself

For d=100, an infinity-norm budget is ε=0.01. What Euclidean upper bound follows for every permitted perturbation? Does a Euclidean budget of 0.1 permit exactly the same set?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Use the largest possible contribution from each of the 100 coordinates, then compare set inclusion with equality.

Compare with the solution

The Euclidean norm is at most √100×0.01=0.1. The sets are not equal: a vector with one coordinate 0.1 and the rest zero satisfies the Euclidean budget but violates the infinity budget. A norm conversion gives an inclusion relation, not identical threats.

Take it with you

  • Specify feasible inputs, attacker knowledge, and the exact failure event.
  • Measure epsilon in the coordinates actually named by the threat.
  • Empirical attack survival upper-bounds finite-set worst-case accuracy.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.