Elamur Research

Enabling certification of verification-agnostic networks via memory-efficient semidefinite programming

Paper · 2020 · Sumanth Dathathri, Krishnamurthy Dvijotham, Alexey Kurakin et al.

Summary

Testing a neural network on altered inputs can reveal a failure, but a successful test leaves open what would happen on the inputs the test missed. Verification asks a stronger question. Given a set of allowed changes and a condition the network should satisfy, can we establish that the condition holds throughout the set? The paper studies this question for networks whose training was independent of the verifier. These include image classifiers trained to withstand adversarial perturbations and a variational autoencoder whose decoder is checked for reconstruction stability. The challenge is to retain a sufficiently tight mathematical bound while making it affordable to compute.

The authors develop SDP-FO, a first-order solver for a semidefinite programming relaxation of the verification problem. The relaxation bounds the worst possible violation from above. Its dual, an optimization problem over coefficients attached to the constraints, can supply a certificate as soon as the bound is tight enough. The authors express that bound in terms of an extreme eigenvalue and use an iterative procedure that needs only the action of a matrix on vectors. Automatic differentiation computes those products through operations already used by the network. With a fixed budget for the eigenvalue iteration, the optimization uses memory linear in the number of activations and costs a fixed number of forward and backward passes per step. The reported certificates use a separate, more expensive eigenvalue calculation.

For the adversarially trained CNN-A-Adv on MNIST, at a maximum pixel-coordinate perturbation of 0.1, the verified test accuracy rises from 0.4% with linear programming to 87.8% with SDP-FO. On CIFAR-10, CNN-A-Mix goes from 5.8% to 39.6% at an evaluation radius of 2/255. The decoder experiment tests a different property, expressed as a quadratic reconstruction error. On MNIST, interval bound propagation verifies that property for 50% of the evaluated examples at approximately 0.01, while SDP-FO reaches the same verified fraction at roughly 0.5 on the latent perturbation scale.

The experiments extend semidefinite verification to convolutional networks beyond the reach of the interior-point comparison. They also show that a solver can fit in memory while its certificates are still too loose to settle many cases. The larger classifiers leave wider gaps between the verified bounds and the best violations found by search. The paper therefore establishes a larger practical range for this relaxation and identifies bound tightness and the cost of the final spectral calculation as obstacles to further scaling.

Deep dive: Enabling certification of verification-agnostic networks via memory-efficient semidefinite programming

A memory-efficient semidefinite solver certifies the robustness of trained neural networks to image and latent-space perturbations. · about 37 minutes to read

The problem and its context

From testing inputs to proving a property

A trained network can be checked against a requirement expressed as a relationship between its input and its output. The paper gives examples from control, physical dynamics, and stability under input changes. A controller might need to avoid a region of unsafe states. A learned description of physical dynamics might be expected to obey a conservation law. A predictor might need to respond consistently across a family of inputs that differ in a prescribed way. Each problem needs a specification precise enough that a violation can be identified from the quantities the network computes.

For an image classifier, one such specification compares the score of the true class with the score of a competing class. Start with a test image and allow each pixel coordinate to vary within a given distance of its original value. To verify the image, the verifier has to establish that no allowed input can push a competing score above the true score. Even a small range at each pixel leaves a high-dimensional set of possible images. The condition quantifies over that whole set.

A search for an adversarial example tries to find an input that violates the condition. Finding one settles the question for that image and radius. When the search returns without a violation, the examples it tried establish how bad the network can be at least, while the worst case may lie elsewhere. The paper notes that stronger searches exposed weaknesses in earlier claims of adversarial robustness. The broader problem of unexpected sensitivity in neural networks was discussed in Intriguing properties of neural networks.

A verifier works from the other direction. It computes a quantity guaranteed to be at least as large as the worst specification violation. When this upper bound lies on the safe side of the threshold, so does every admissible input. For difficult instances, a sound verifier can leave the question open. A bound that still allows a violation gives no basis for a certificate, even if the network actually satisfies the property. The search result and the upper bound can therefore be used together. They enclose the true worst-case value and show how much room is left for uncertainty.

Why the training procedure matters

A verification-agnostic network is one whose training does not use a particular verifier or include a term designed to make certification easier. It can still be trained for robustness. Adversarial training, for instance, exposes the network to difficult perturbed inputs during training. That can improve empirical resistance while leaving a verifier with a complicated optimization problem to bound. The training approach used for the adversarially trained networks comes from Towards Deep Learning Models Resistant to Adversarial Attacks.

The distinction matters when a network has already been trained or its training pipeline is difficult to change. The authors give production pipelines as an example. There is also a reason to consider verification-agnostic networks even when the prediction system could be retrained. The specification itself can involve a second network. One way to represent changes in an image, such as a lighting change, is to describe variation in the latent coordinates of a generative network. In that setting, a verifier may have to reason through the generative network as part of defining the allowed changes. Training the classifier for easy certification solves only its part of that problem.

Verification-aware training has a different advantage. Training can incorporate a bound that the verifier will later use, encouraging the network to work well under that bound. The paper places methods that combine convex relaxation with dedicated training in this line of work. Interval propagation is one way of obtaining bounds cheap enough for that role. The authors cite On the Effectiveness of Interval Bound Propagation for Training Verifiably Robust Models.

The available choices before SDP-FO

Complete verification methods seek to resolve the underlying decision problem by searching through the possible network behaviors. The paper discusses satisfiability modulo theories and mixed-integer programming as the dominant examples. Both can prune portions of the search space by showing that those portions cannot contain counterexamples. In the worst case, the remaining work can grow exponentially with network size. The paper also identifies a practical disadvantage for the comparison it is interested in. These methods typically cannot use the hardware accelerators on which network training and inference already run.

Convex relaxation changes the optimization problem so that it is easier to bound. One way to see the change is to imagine the collection of all vectors of layer activations that can arise from valid inputs. The verifier allows an enlarged collection that contains those vectors. Maximizing over the larger set can give a larger value than the actual worst case, which is exactly the direction needed for a sound upper bound. An enlarged set that allows widely unrealistic combinations of activations can give a poor certificate.

Linear programming, or LP, uses linear objectives and constraints. The paper describes these relaxations as efficient and notes that several bound propagation methods can be understood within the LP family. It also discusses prior evidence of a barrier to the tightness of these methods. Solving an LP more accurately addresses the error in the numerical optimization. If the LP itself permits unrealistic behaviors with high scores, the solution to the LP can still be too high to verify the property. Training for the verifier can make such a relaxation effective by changing the network to which it is applied.

Randomized smoothing takes a different route by building a predictor around noisy inputs or predictions. In the setting of this paper, introducing smoothing changes which predictor is being certified. The authors take the existing network and the specified input set as the objects of verification. They focus their comparisons on relaxation methods and complete solvers that address that setting.

A semidefinite program, or SDP, can represent relationships among activations through a matrix whose entries stand for individual values and pairwise products. It constrains that matrix to be positive semidefinite, which means its eigenvalues are non-negative. This carries information that separate intervals or a conventional LP may lose. Earlier work by Raghunathan and colleagues used an SDP for adversarial robustness. Other work extended quadratic representations to more general architectures and activation functions. The obstacle emphasized here is the cost of solving the relaxation. For the interior-point approach discussed by the authors, runtime grows as the sixth power of the number of neurons and memory as the fourth power.

The optimization literature already offered first-order ways to solve SDPs. The paper describes methods that smooth difficult objectives, bundle spectral information, update low-rank representations, or exploit the structure of the dual problem. Verification makes it possible to choose among these ideas with a narrower goal in mind. The verifier needs a trustworthy upper bound of a useful size. A dual solution that gives such a bound is sufficient to stop, even if a general-purpose solver would keep working to recover a more accurate optimum. The paper takes that observation into the implementation by organizing the calculation around the network’s own operations.

The method, step by step

Turn the specification into an optimization problem

Start with a fixed feedforward network, bounds on its input, and a function that measures a violation. Collect the input and all subsequent layer values into one vector. The specification can use values from this vector, including the final scores or the reconstruction produced by a decoder. The verifier asks how large the specification function can become when the input obeys its bounds and every layer follows its prescribed calculation.

How SDP-FO checks a trained network

The steps in order.

How SDP-FO checks a trained networkStep 1: Define the input region and violation score1. Define the input region and violation scoreStep 2: Propagate bounds through the network2. Propagate bounds through the networkStep 3: Encode the layer constraints in a quadratic Lagrangian3. Encode the layer constraints in a quadratic LagrangianStep 4: Represent the dual matrix as a vector operation4. Represent the dual matrix as a vector operationStep 5: Estimate the extreme eigenvector with Lanczos5. Estimate the extreme eigenvector with LanczosStep 6: Update and project the dual variables6. Update and project the dual variablesStep 7: Recompute the eigenvalue for the final certificate7. Recompute the eigenvalue for the final certificate

The paper writes the forward relation as an affine map followed by an elementwise activation.

xᵢ₊₁ = σᵢ(Lᵢ(xᵢ))

The index i identifies a layer transition. The vector xᵢ collects the values at layer i, with x₀ the input. The affine map Lᵢ represents a step such as a linear layer, convolution, or average pooling. The function σᵢ applies the activation rule coordinate by coordinate. The notation xᵢ₊₁ refers to the resulting vector at the next layer.

opt = maxₓ { φ(x) : xᵢ₊₁ = σᵢ(Lᵢ(xᵢ)) for every i, 0 ≤ x₀ ≤ u₀ }

The variable x concatenates the layer vectors from input to output. The function φ gives a violation score and opt denotes the largest score that can occur. The layer equations make the values correspond to a real forward pass. The vectors 0 and u₀ are the lower and upper input limits in the form used to introduce the problem, and ≤ acts coordinatewise on those vectors. The general construction uses lower and upper limits for the coordinates. If opt is at most zero, the specification as written holds. The experiments with classifiers use a strict test to certify that every competing class score stays below the true score.

In the classification experiment, the perturbation region is an ℓ∞ ball. Its radius limits the absolute change in every input coordinate. The optimization can therefore range over a box, with one interval for each coordinate of the input. Each competing class gives rise to a separate specification.

φ(x) = (xᴸ)ᵧ′ − (xᴸ)ᵧ

Here xᴸ denotes the final vector of class scores, or logits, with L the final layer index. The subscript y selects the true class and y′ selects a competing class. The difference is the gain of that competitor over the true class. The largest of the competitor-specific upper bounds determines whether the image can be certified.

The classifier objective is linear, which fits within the paper’s quadratic formulation. The decoder uses a genuinely quadratic objective. In both cases the authors seek to express the objective and relevant constraints through polynomials of degree at most two. This yields a quadratically constrained quadratic program, or QCQP. The paper presents ℓ∞ boxes for the input and states that the relaxation also accommodates quadratic input constraints.

Write the activation rules as inequalities

Before optimizing the verification bound, the authors obtain lower and upper limits for the coordinates of the intermediate layers. Write these as ℓᵢ and uᵢ for layer i. A bound propagation method starts from the input region and supplies such limits, which every admissible forward pass must respect. The verifier can use conservative limits and still be sound. Tighter limits can strengthen the subsequent relaxation by ruling out larger regions of activation space.

For a ReLU, the output at each coordinate is the larger of zero and the corresponding affine input. The authors keep two linear inequalities and add a quadratic relation.

xᵢ₊₁ ≥ 0,   xᵢ₊₁ ≥ Lᵢ(xᵢ),   xᵢ₊₁ ⊙ (xᵢ₊₁ − Lᵢ(xᵢ)) ≤ 0

The symbol ⊙ means elementwise multiplication, and the inequalities hold in every coordinate. The vector 0 has the same size as xᵢ₊₁. The factors in the product are both non-negative under the linear inequalities. Their product must therefore be zero at each coordinate. A zero first factor gives a ReLU on its zero branch, and a zero second factor gives an output equal to the affine input. The linear inequalities ensure the branch selected in each case produces the larger value. This encoding is exact for ReLU before the optimization is relaxed.

The bounds from propagation also have a quadratic form.

xᵢ ⊙ xᵢ − (ℓᵢ + uᵢ) ⊙ xᵢ + ℓᵢ ⊙ uᵢ ≤ 0

Here ℓᵢ and uᵢ are the coordinatewise lower and upper bounds. The left side is the product of the differences between xᵢ and the two endpoints, coordinate by coordinate. It is nonpositive when the coordinate lies between those endpoints. This representation lets the interval information enter the same quadratic expression as the ReLU relation. The method retains explicit bounds on the activation coordinates as well, which will provide the diagonal restrictions used in the SDP.

Build a quadratic upper bound

The Lagrangian is the specification score plus weighted versions of the constraint expressions. Write each added expression so that it is at most zero at valid activations. In this convention the weights must be non-negative for a maximization problem. The contribution of a feasible activation vector to the proof can be seen as follows. Its weighted constraint terms are nonpositive when written in inequality form. To penalize violation in an upper-bounding Lagrangian, one can subtract those weighted terms, or equivalently use the opposite sign convention for the residuals and their weights. The certificate requires that the resulting Lagrangian dominate the specification on feasible activations.

For the ReLU part of the paper’s construction, the constraint expressions are collected into four terms. The two linear constraints provide the expressions involving a negative output and the affine input minus the output. The ReLU product is zero on valid activations. The interval term comes from the quadratic expression for the endpoints. Once the signs have been chosen consistently for the bound, the terms are assembled from adjacent layer vectors, elementwise operations, and affine layer calculations. The solver uses the resulting quadratic through its coefficients.

ℒ(x, λ) = c(λ) + xᵀg(λ) + ½ xᵀH(λ)x

The function ℒ is the quadratic Lagrangian. The vector λ collects the dual multipliers associated with the constraints. The scalar c(λ) is the part independent of x, the vector g(λ) contains the linear coefficients, and the symmetric matrix H(λ) is the Hessian with respect to the activation coordinates. The superscript ᵀ denotes transpose. The factor ½ gives the Hessian the usual normalization for a quadratic. The scalar, vector, and matrix are each affine functions of λ. The paper’s method obtains them through differentiation of the Lagrangian, so a separate hand-derived matrix is unnecessary for each architecture.

opt ≤ min₍λ≥0₎ max₍ℓ≤x≤u₎ ℒ(x, λ)

The vectors ℓ and u concatenate the lower and upper bounds at the layers, and λ ≥ 0 denotes the admissible non-negative multipliers in the upper-bound convention. The inner maximum permits activation vectors throughout the box. A valid choice of dual variables yields an upper bound after this maximization. The outer minimum asks how tightly such choices can bound opt. The property of providing a bound at a feasible point is central to the method, because the optimization can stop once that bound resolves the verification question.

The coefficient form also identifies which computations come from the network and which come from the solver. To evaluate the Lagrangian, the algorithm applies the affine map at each layer to the corresponding part of x, then combines the results with the constraint weights. The actual forward pass is imposed through the constraints. A candidate x used by the bound calculation can have adjacent layers that disagree with a real forward pass. Processing x still uses the same layer operations, so the verifier can exploit the computational structure of convolution and other affine maps.

Lift the problem into a semidefinite relaxation

The inner maximization of a quadratic over an activation box is itself difficult. The relaxation first expresses the quadratic as a linear function of a matrix containing the activations and their products. To see the diagonal bounds clearly, the paper centers and rescales activation coordinates so that their intervals run from −1 to 1. This is a change of coordinates using the precomputed bounds. The quadratic keeps its form, with coefficients expressed in the new coordinates. Any coordinate fixed by its interval carries a fixed value.

X̃ = [ 1  xᵀ ; x  xxᵀ ]

The symbol X̃ denotes the matrix formed from a particular normalized activation vector x. The bracket notation gives the top row of blocks, then the bottom row after the separator. The leading entry is 1, the off-diagonal blocks store x and its transpose, and the lower-right block is the outer product xxᵀ. Since X̃ is the outer product of the augmented vector with itself, it is positive semidefinite. Its diagonal is at most 1 under the normalized bounds.

M(λ) = [ 0  g(λ)ᵀ ; g(λ)  H(λ) ]

The matrix M(λ) packages the coefficients of the linear and quadratic terms. Its leading entry is the scalar zero, its off-diagonal blocks hold the coefficient vector g(λ) and its transpose, and its lower-right block holds the Hessian H(λ). The constant term c(λ) stays outside this matrix. The two copies of the linear coefficients give the correct contribution when the matrix inner product is multiplied by ½.

optₛᵈᵖ = min₍λ≥0₎ max₍X⪰0, diag(X)≤𝟙₎ { c(λ) + ½ ⟨M(λ), X⟩ }

The scalar optₛᵈᵖ is the value of the semidefinite relaxation. The variable X can range over positive semidefinite matrices, indicated by X ⪰ 0, with diagonal entries bounded above by the all-ones vector 𝟙. The operator diag extracts the diagonal when its argument is a matrix. The brackets ⟨M(λ), X⟩ denote the sum of the products of corresponding entries. Every matrix X̃ from a normalized activation vector is allowed. The enlarged set also permits matrices whose entries do not come from a single such vector. This is where the lifting can loosen the bound.

The paper shows how this formulation relates to the earlier SDP for ReLU networks. In block form, the leading matrix entry can be set to one at the optimum. The objective uses only the first-column activation block and the block representing products. Increasing the leading entry to one preserves positive semidefiniteness and leaves those objective terms untouched. With the leading entry fixed, the remaining blocks play the same roles as the variables in the earlier SDP. When the same quadratic constraints are used, the two relaxations have the same optimal value. This matters when comparing solvers. A difference at a finite iteration budget can be studied separately from the tightness of the relaxation both solvers are targeting.

Replace the semidefinite constraint with an eigenvalue correction

The lifted problem still appears to require a large matrix. The authors turn to its dual. They attach a non-negative vector κ to the diagonal constraints. The inner maximization over positive semidefinite matrices can then be removed in closed form. The resulting dual minimizes a linear expression in κ together with the constant term of the Lagrangian.

optₛᵈᵖ = min₍λ≥0, κ≥0₎ { c(λ) + ½ κᵀ𝟙 : diag(κ) − M(λ) ⪰ 0 }

The vector κ has one entry for the leading coordinate and one for every normalized activation coordinate represented in x. With a vector argument, diag(κ) means the matrix with that vector on the diagonal and zeros elsewhere. The expression κᵀ𝟙 sums its entries. If diag(κ) − M(λ) has a negative eigenvalue, the inner maximization over positive semidefinite matrices can grow without bound along the corresponding direction. When the difference is positive semidefinite, the best value of that inner matrix-dependent term is zero. This yields the stated constraint.

Enforcing that matrix constraint directly at every update would be expensive. The solver instead starts with any non-negative κ and λ and works out how much to increase each diagonal entry to make the constraint hold. The smallest eigenvalue of the current matrix determines the required uniform increase.

κ̂ = κ − min{λₘᵢₙ(diag(κ) − M(λ)), 0} 𝟙

The vector κ̂ is the corrected choice of diagonal multipliers. The function λₘᵢₙ returns the smallest eigenvalue of its matrix argument. Despite the similar notation, this function is distinct from the vector λ of constraint multipliers. The minimum with zero selects the negative part of the eigenvalue. Subtracting that quantity adds the same non-negative amount to every coordinate of κ. This shifts all eigenvalues of the matrix difference upward by that amount. The corrected matrix is positive semidefinite, and a feasible pair is already left at its current value.

f(λ, κ) = c(λ) + ½ [κ − min{λₘᵢₙ(diag(κ) − M(λ)), 0} 𝟙]ᵀ𝟙

The function f is the objective after accounting for the correction. Its two arguments need only be non-negative. The corrected vector inside the brackets supplies the feasible dual objective, so the evaluated f gives an upper bound. Because the correction preserves every pair already feasible for the semidefinite constraint, minimizing f over non-negative arguments has the same optimal value as the SDP. This is the reformulation that makes projected first-order optimization practical. The projection used after a parameter update is coordinatewise clipping at zero.

The correction has a useful interpretation. The matrix difference represents the amount of curvature the diagonal terms can dominate. A negative direction calls for an increase in the diagonal. The associated cost raises the upper bound, since the current parameters need extra slack to give a valid certificate. Minimizing the objective amounts to finding constraint weights and diagonal terms for which the repaired feasible objective is as small as possible.

Compute matrix actions through the layers

The key numerical operation is to find the smallest eigenvalue and an associated unit eigenvector of the difference matrix. A unit vector in the most negative direction minimizes the quadratic expression formed from this matrix. When the smallest eigenvalue is negative, that expression can be differentiated with the eigenvector held fixed to obtain a subgradient of f. A subgradient plays the role of a gradient for a convex objective that may have a corner, for instance when several directions share the smallest eigenvalue.

v★ ∈ arg min₍‖v‖₂=1₎ vᵀ[diag(κ) − M(λ)]v

The variable v ranges over vectors of Euclidean norm one, denoted by ‖v‖₂ = 1. The symbol v★ denotes a minimizing vector. The expression vᵀ[diag(κ) − M(λ)]v is a Rayleigh quotient on unit vectors. Its minimum is the smallest eigenvalue. When the correction is active, the authors use Danskin’s theorem to justify differentiating the objective with a maximizing direction for the correction held fixed. Any unit vector in the minimizing eigenspace can supply that direction. When the smallest eigenvalue is positive, the correction is zero and the derivative comes from the remaining terms. At zero, the active branches meet.

Lanczos estimates the needed eigenpair using repeated matrix-vector products. The method builds a smaller spectral problem from directions generated by applying the original matrix to vectors. The verifier needs a function that produces those products. Automatic differentiation supplies the relevant pieces from the original Lagrangian.

g(λ) = ∇ₓℒ(0, λ)

The operator ∇ₓ denotes the gradient with respect to x. The zero vector is the origin of the activation coordinates in the quadratic representation. Evaluating the gradient there isolates the linear coefficient vector g(λ). The same evaluation of the Lagrangian itself gives the constant term c(λ).

H(λ)w = ∇ₓ[wᵀ∇ₓℒ(x, λ)] evaluated at x = 0

The vector w is an arbitrary direction with the same shape as x. The inner gradient is differentiated after taking its inner product with w. The result is the Hessian applied to w. The Hessian is constant with respect to x because ℒ is quadratic, so evaluation at the origin suffices. The resulting computation uses differentiation through the affine layer maps and the elementwise operations. It avoids building the array of all second derivatives.

A[v] = κ ⊙ v − [g(λ)ᵀv₁:ₙ ; g(λ)v₀ + H(λ)v₁:ₙ]

The linear operator A is the action of diag(κ) − M(λ). The coordinate v₀ is the leading scalar in v, and v₁:ₙ collects its remaining n coordinates, one for each coordinate of x. The bracket stacks the scalar and vector results. Its first part is an inner product with the linear coefficients. The second scales the linear coefficients by v₀ and adds a Hessian-vector product. The term κ ⊙ v is the elementwise action of the diagonal matrix.

The gradient of the Lagrangian calls for forward and backward computations through the layers. A Hessian-vector product takes roughly double the work of an ordinary forward-backward pass in the authors’ account, with memory overhead linear in the activation count. Holding the estimated eigenvector fixed also keeps the dual update from differentiating through the Lanczos iterations. The work per outer update is proportional to a fixed number of such passes when the inner iteration budget is fixed. With N the activation count and k the number of Lanczos iterations, the paper gives the memory bound in its more explicit form.

O(Nk)

The notation O indicates asymptotic growth. With k held fixed, the term grows linearly with N. The authors report that the number of Lanczos iterations sufficient in their experiments was much smaller than the activation count. This formulation lets the main optimization use accelerator-friendly layer operations. The core implementation is in JAX and the authors made it available as part of jax_verify.

Initialize the solver and choose when to certify

The solver begins with λ set to zero. When the remaining objective is linear in the activation vector, the Hessian vanishes and the choice of diagonal variables that minimizes the bound at this starting point is available in closed form.

κ₀ = ∑ᵢ₌₁ⁿ |g(λ)ᵢ|,   κ₁:ₙ = |g(λ)|

The first entry κ₀ is the scalar diagonal weight for the leading coordinate. The vector κ₁:ₙ contains the activation-coordinate weights. The index i ranges over the n entries of g(λ), and absolute value on a vector is taken elementwise. This initialization follows from balancing the diagonal weights against the off-diagonal linear coefficients when the Hessian block is zero. The condition on the Hessian is important. Setting all constraint multipliers to zero still leaves the curvature of a quadratic specification in the Lagrangian.

The paper also studies a formulation that retains the interval information in the Lagrangian and drops the explicit box from its inner maximization. In the corresponding dual the only explicit diagonal multiplier is the leading scalar. Its semidefinite condition is written as follows.

[ κ₀  −g(λ)ᵀ ; −g(λ)  −H(λ) ] ⪰ 0

The bracket denotes a symmetric block matrix. The scalar κ₀ occupies the upper-left entry, the signs of the linear coefficient blocks are reversed, and the lower-right block is the negative Hessian. The relation ⪰ 0 requires positive semidefiniteness. Under that condition the alternative objective is c(λ) plus half of κ₀. A feasible point of this alternate dual can be represented in the bound-constrained formulation with the remaining coordinates of κ set to zero. The paper uses this relationship to motivate shrinking those coordinates or fixing them to zero partway through optimization. Allowing them to vary early can make the spectral objective easier to optimize by reducing negative eigenvalues.

At each outer iteration SDP-FO estimates the eigenvector, evaluates the surrogate objective, takes a subgradient-based step, and clips the dual variables to their non-negative region. The authors use adaptive optimizers because the objective responds differently to multipliers on linear constraints and multipliers on quadratic ones. For the fully connected experiments they use the Adam update rule. The convolutional experiments and the decoder use RMSProp. They sometimes adjust the learning rates for particular groups of variables, including those tied to the quadratic ReLU constraint. The paper’s implementation of the fully connected updates follows Adam: A Method for Stochastic Optimization.

A numerical distinction separates this loop from certification. The Rayleigh quotient of an approximate eigenvector can be higher than the true smallest eigenvalue. When the true eigenvalue is negative, using that quotient can make the diagonal correction too small. A low surrogate value is useful for seeking better dual variables, while the certificate needs a reliably evaluated correction. The authors compute the reported bounds with a direct eigendecomposition, using the eigh routine in SciPy 1.0.

Define the decoder specification

The second experiment uses a variational autoencoder trained on MNIST. Its encoder assigns a Gaussian distribution over latent coordinates to an input image. Its decoder gives a Gaussian over images for a latent input. The authors verify a property of the decoder mean, which serves as the reconstruction. The statistical setup follows Auto-Encoding Variational Bayes.

qᴱ(z | s) = 𝒩(μᴱ(z; s), σᴱ(z; s))

The expression qᴱ(z | s) denotes the encoder distribution of the latent variable z conditioned on the image s. The symbol 𝒩 denotes a Gaussian. The quantity μᴱ(z; s) is the encoder mean in latent space, and σᴱ(z; s) denotes the encoder scale used to define the perturbations. The superscript E identifies encoder quantities. The semicolon inside the argument list separates the variable whose distribution is represented from the conditioning input.

qᴰ(s | z) = 𝒩(μᴰ(s; z), I)

Here qᴰ(s | z) is the decoder distribution over images at latent vector z. The quantity μᴰ(s; z) is its mean image, and I is the identity covariance matrix. The superscript D identifies decoder quantities. Given a test image, the verifier fixes the encoder’s latent mean and scale for that image. It then considers a box around the mean, whose coordinate widths are determined by the encoder scales and the chosen perturbation radius.

‖s − μᴰ(s; z′)‖₂² ≤ τ  for every z′ with |z′ − μᴱ(z; s)| ≤ α σᴱ(z; s)

The vector z′ is an allowed latent input and α is the radius in units of the encoder scales. The absolute-value inequality is coordinatewise, which expresses the scaled ℓ∞ region. The notation ‖·‖₂² is squared Euclidean norm, so the left side adds the squared errors across the reconstructed image coordinates. The scalar τ is the reconstruction threshold. The specification function for SDP-FO is this squared error with τ subtracted. Changing α changes the box supplied to the verifier, while the reconstruction target remains the original image s.

The same sequence of operations now applies as for classification. Bound propagation gives intervals inside the decoder, the Lagrangian includes the specification and network constraints, and SDP-FO bounds the worst violation. What changes is the expression in the objective. The verifier has to account for the contributions of many image coordinates to a squared distance. Linear programming or conventional mixed-integer verification would need an extra relaxation to treat this quadratic objective as a linear one.

Experiments and results

How the classifier experiments are measured

The paper evaluates image classifiers on MNIST and CIFAR-10. It follows trained fully connected networks from prior work and uses convolutional architectures called CNN-A and CNN-B. CNN-A has roughly 200K parameters and 10K activations. CNN-B has approximately 2M parameters and 20K activations. The fully connected networks used for comparisons have approximately 1K activations. The parameter count describes the stored weights, while the activation count controls the dimension of the verification problem. The experiments with interior-point SDP solvers are confined to the smaller fully connected networks.

The CNNs use convolutional layers followed by fully connected layers, with ReLU after each layer except the last. The training conditions are encoded in names such as Nor, Adv, and Mix. Nor uses nominal training on unperturbed examples with cross-entropy loss. Adv uses adversarial training. Mix gives equal weight to the ordinary loss and the adversarial loss. The suffix -4 marks a training perturbation radius of 4.4/255. Appendix training details give 2.2/255 as the usual CIFAR-10 training radius for the other adversarially trained classifiers at the smaller setting. The principal CIFAR-10 evaluation in the results table uses 2/255. Keeping training and evaluation radii distinct is important when interpreting a guarantee.

The classification table has three kinds of accuracy. Nominal accuracy measures success on unchanged test inputs. PGD accuracy measures the fraction that survives the paper’s projected gradient search for a perturbation. For each competing label, that search tries to increase the competitor’s score relative to the true class while staying within the perturbation box. Any score achieved by a valid perturbed input is a lower bound on the worst-case score. Aggregated across images, the accuracy remaining after this search is an upper bound on the truly robust fraction. Search can miss failures, so that fraction can include images that are vulnerable.

Verified accuracy is the lower bound on that fraction from the opposite direction. For each image the verifier bounds the maximum score difference for each competitor and takes the largest such upper bound. The image counts as verified when this bound is strictly below zero. This creates a distinction between the score and the accuracy derived from it. A smaller upper bound on violation is better. A larger verified accuracy is better. The two quantities can behave differently because the accuracy changes only when an image crosses the certification threshold.

The paper compares SDP-FO with an LP relaxation, with the CROWN bound propagation method in its scatter plots, and with an interior-point SDP solver, termed SDP-IP, where the matrix sizes permit it. It also presents earlier mixed-integer results where available. The interior-point comparison uses MOSEK. The main classification table uses the same 500 test examples where the authors compute the results and identifies values taken from earlier work. The separate comparison of per-image bounds uses 100 random examples on MNIST and CIFAR-10.

What changes for the convolutional classifiers

The main MNIST example is CNN-A-Adv at a perturbation radius of 0.1. It has nominal accuracy of 99.1% and PGD accuracy of 95.2%. The LP verifier certifies 0.4%, as reported in the paper’s discussion, and SDP-FO certifies 87.8%. This is a fixed-network comparison. The shift in verified accuracy comes from using a different bound on the worst-case score. The PGD result supplies a ceiling for what could be certified on the evaluated examples under that search outcome.

Verified accuracy for CNN-A-Adv on the MNIST test set at radius 0.1

The semidefinite relaxation certifies many more test examples at the same radius.

Verified accuracy for CNN-A-Adv on the MNIST test set at radius 0.1LP: 0.4LP0.4SDP-FO (this paper): 87.8SDP-FO (this paper)87.8
The numbers
System or settingverified accuracy %
LP0.4
SDP-FO (this paper)87.8

For CNN-A-Mix on CIFAR-10 at an evaluation radius of 2/255, the nominal test accuracy in the main table is 74.2% and the PGD accuracy is 53.0%. The LP certificate reaches 5.8% and the SDP-FO certificate reaches 39.6%. At the same evaluation radius, CNN-B-Adv has nominal accuracy of 80.3% and PGD accuracy of 64.0%. Its verified accuracy is 2.2% with LP and 32.8% with SDP-FO. These rows show why the nominal, empirical, and verified results each need their own column. The larger architecture has stronger nominal and PGD accuracy in this comparison, while the smaller architecture has the stronger guarantee from SDP-FO. The training modes differ as well, which matters when interpreting the role of architecture size.

Verified accuracy for CNN-A-Mix on the CIFAR-10 test set at radius 2/255

SDP-FO raises the certified fraction for the fixed classifier and perturbation set.

Verified accuracy for CNN-A-Mix on the CIFAR-10 test set at radius 2/255LP: 5.8LP5.8SDP-FO (this paper): 39.6SDP-FO (this paper)39.6
The numbers
System or settingverified accuracy %
LP5.8
SDP-FO (this paper)39.6

The explicitly larger training perturbation gives two more comparisons at the smaller CIFAR-10 evaluation radius. CNN-A-Mix-4 has 67.8% nominal accuracy and 55.6% PGD accuracy, with 26.8% verified by LP and 47.8% verified by SDP-FO. CNN-B-Adv-4 has 72.0% nominal accuracy and 62.0% PGD accuracy, with verified accuracy of 20.4% under LP and 46.0% under SDP-FO. Each row measures how well different verifiers certify the same network. Comparisons across these rows also reflect the choice of training radius and loss.

The smaller fully connected networks show how much the result can depend on the training and the original relaxation. At the MNIST test radius of 0.1, MLP-SDP has verified accuracies of 39.5% for LP, 80% for the reported SDP-IP result, and 85.2% for SDP-FO. MLP-LP has 79.4% for LP, 80% for the reported SDP-IP result, and 80.2% for SDP-FO. For MLP-Adv, the main table lists 26.6% for LP, 82% for the reported SDP-IP result, and 91.0% for SDP-FO. The historical entries serve as practical points of comparison. The paper runs a separate matched experiment to determine how closely the first-order solver approaches the interior-point answer when both use the same relaxation on the same instances.

The scatter plots give a view below the level of aggregate accuracy. For each image the horizontal coordinate is the worst score found across targets by PGD. The vertical coordinate is the worst verified upper bound across targets. Closeness to the diagonal means that search and verification have located the worst value within a narrow range. The authors report that the SDP-FO points lie near the diagonal, while LP leaves much larger gaps. Many CROWN bounds exceed the vertical range of the plots. CROWN can still supply useful layer bounds for SDP-FO. A loose bound on the final specification and useful restrictions on intermediate activations are compatible outcomes.

Broader settings and computational cost

Additional tests in the paper vary the evaluation and training radii. For MNIST at an evaluation radius of 0.3, CNN-A-Adv has nominal accuracy of 98.6% and PGD accuracy of 80.0%. The table reports 43.4% verified accuracy for SDP-FO and 0.2% for LP. At a CIFAR-10 evaluation radius of 8/255, the row for CNN-A-Adv trained at 8.8/255 gives 46.9% nominal accuracy, 30.6% PGD accuracy, 18.0% SDP-FO verified accuracy, and 3.8% LP verified accuracy. The corresponding CNN-A-Mix row gives 56.7% nominal accuracy, 26.4% PGD accuracy, 9.0% SDP-FO verified accuracy, and 0.1% LP verified accuracy. The table uses the first 100 test examples for SDP-FO and the first 1000 for LP. Its comparisons therefore show the pattern across the reported settings with different sample counts, while the headline table generally uses the same examples.

The search for a certificate has a substantial runtime even once the memory problem is addressed. The paper budgets 15K optimization steps for the fully connected experiments, 60K for MNIST convolutional networks, and 150K for CIFAR-10 convolutional networks. On a P100 GPU, the resulting maximum runtimes are approximately 15 minutes per fully connected verification instance and 3 hours per convolutional instance. The authors say that most instances verifying successfully finish sooner. The cited interior-point time is 25 minutes on a 4-core CPU for a fully connected instance. The authors estimate that interior-point memory for a network with 10K activations would be about 10 petabytes. The runtimes identify practical workloads on the respective hardware, and the memory estimate explains why a corresponding CNN comparison is unavailable.

What the decoder experiment verifies

The second experiment trains a variational autoencoder on MNIST and verifies a convolutional decoder with about 10K activations. The encoder uses fully connected layers. The decoder begins with a fully connected layer and uses transposed convolutions to construct the output image. For each evaluated image, the perturbation region is centered at its encoded latent mean. The measurement is the fraction of test images for which every latent point in that region produces a reconstruction within the squared-error threshold.

The threshold is 40.97. To choose it, the authors take the median across MNIST of the squared Euclidean distance from an image to its nearest image with a different label. They use that distance statistic to put the tolerance on an image-space scale. A separate illustration shows examples corrupted by Gaussian noise with a squared norm equal to the chosen threshold. The certification itself evaluates the decoder across the prescribed latent box and measures the reconstructed image’s distance from the input. The threshold is held fixed across the tested radii.

On 100 MNIST samples the authors compare the SDP-FO certificate with an interval bound propagation certificate and a PGD upper bound on the fraction satisfying the property. Interval bound propagation, or IBP, also supplies the intermediate bounds used by SDP-FO. To certify reconstruction with IBP alone, the verifier obtains a lower and upper value for each output coordinate. It chooses the endpoint farthest from the original pixel value for each coordinate, squares that distance, and sums the resulting upper bounds. In a real decoder the latent vector controls all of the output coordinates jointly. The interval calculation can overestimate the squared error when the individual extremes cannot occur at a common latent input.

Uᴵᴮᴾ = ‖max{|ub − s|, |s − lb|}‖₂²

The scalar Uᴵᴮᴾ is the interval-based upper bound on squared reconstruction error. The vectors lb and ub give decoder output limits and s is the original image. The maximum and absolute values are taken coordinatewise. The squared Euclidean norm then sums the squared entries of that vector. SDP-FO uses the output of the bound propagation pass as constraints within a relaxation of the joint quadratic problem.

In the plot, the SDP-FO lower bound closely follows the PGD upper bound up to perturbations of 0.1 σz, with σz denoting the scale of the latent perturbations in the figure. The IBP lower bound begins to separate from the PGD curve at smaller radii. At a verified fraction of 50%, the paper gives approximate radii of 0.01 for IBP and 0.5 for SDP-FO, expressed on the plot’s scale of latent standard deviations. The authors describe this as roughly 50x the radius at that coverage. Each decoder verification instance takes under 7 hours on a P100 GPU in the reported setup. The experiment demonstrates that the same optimization machinery can give a useful certificate when the output quantity is a squared distance instead of a class score difference.

What the ablations show

Solving the same relaxation with different algorithms

A comparison of verified accuracy can mix together the choice of relaxation, the activation bounds supplied to it, and how far the numerical solver gets. To isolate the last of these, the authors run SDP-FO and SDP-IP on equivalent relaxations for MLP-Adv. They use 10 randomly selected MNIST examples and one competing class per example. The chosen class is the one with the highest loss under PGD. That design holds the network, the target-specific verification problem, and the relaxation fixed.

The interior-point solver can approach the SDP optimum on these small instances. Its result gives the experiment an estimate of how much improvement remains available to a better optimizer for the same relaxation. The gap between SDP-IP and the PGD value also contains any failure of the search to reach the true worst case. The distinction matters because a verified upper bound and an achieved attack value come from different problems. A large separation could reflect the relaxation, the attack search, or both.

The reported mean magnitude of the difference between the SDP-FO and SDP-IP bounds is 0.10, with a standard deviation of 0.07, across the 10 examples. The mean gap from SDP-IP to the PGD lower bound is 0.80, with a standard deviation of 0.22, on the same examples. These quantities are measured in the score objective. The scatter plot shows several instances where the two solver bounds nearly overlap. For this small-network comparison, switching to the expensive optimizer would change the upper bound by relatively little compared with the distance between that bound and the search result.

Improving the inputs to the relaxation

The next comparison keeps SDP-FO and MLP-Adv fixed and changes how the layer bounds are computed. One configuration uses interval arithmetic and the other uses CROWN. Simple interval calculations can widen as they pass through layers because each coordinate is given an independent range. CROWN supplies tighter restrictions for the SDP in the authors’ experiment. Those restrictions change the feasible values in the relaxed problem and can bring its optimum closer to the value for the actual network.

On the MLP-Adv comparison, verified accuracy on MNIST is 83.0% with interval arithmetic bounds and 91.2% with CROWN bounds. The PGD upper bound on accuracy is 93.4%. This comparison measures a change in the relaxation supplied to the solver. Its figures belong to the specific experiment on activation bounds. The 91.0% for MLP-Adv belongs to the main classification table.

Verified accuracy of SDP-FO for MLP-Adv on MNIST with different layer bounds

Tighter CROWN activation bounds increase the fraction the solver certifies.

Verified accuracy of SDP-FO for MLP-Adv on MNIST with different layer boundsInterval arithmetic: 83.0Interval arithmetic83.0CROWN (this paper): 91.2CROWN (this paper)91.2
The numbers
System or settingverified accuracy %
Interval arithmetic83.0
CROWN (this paper)91.2

The comparison also clarifies the role of preprocessing in the larger experiments. A propagated bound can be valuable as a constraint even when propagation alone gives a weak certificate. The SDP can combine the interval information with quadratic relationships between layers. The MLP-Adv experiment shows that supplying tighter intervals can improve this combined calculation further. Together with the matched SDP-IP result, it supports the authors’ emphasis on stronger relaxations for this network. Merely driving the numerical objective closer to its existing optimum has less scope for improvement on the matched instances.

Approximating the eigenvalue during optimization

The authors compare the objective values obtained with Lanczos against those from a direct eigendecomposition. For CNN-A-Mix, the mean gap between the two dual-bound evaluations is 0.14 and the standard deviation is 0.07. The overall gap from the verified upper bound to the adversarial lower bound has a mean of 0.60 and a standard deviation of 0.22 in that comparison. The eigenvalue surrogate error is therefore visible in the score objective, even where it is small relative to the total gap under study.

The timing comparison explains the division of labor. In the CNN example the appendix reports approximately 0.1 seconds with 200 Lanczos iterations and 5 minutes for the direct eigendecomposition. In the decoder example the comparison is roughly 0.2 seconds for Lanczos and 2 hours for the direct calculation. The authors observe reliable surrogate behavior across the tested networks. These measurements support its use inside the optimization loop, where repeated exact decompositions would dominate the run. The use of a direct decomposition for the final bound is what lets that reported certificate rely on the spectral correction rather than on the observed quality of the surrogate.

Training choices and optimizer behavior

The paper also examines how ordinary training choices interact with certification. The appendix reports that mixing clean and adversarial losses improves test accuracy while producing less verifiable networks than adversarial training alone in the settings discussed. It reports a different tradeoff for training with a larger perturbation radius. At the smaller evaluation radius those networks can be easier to verify, while the clean accuracy declines. The comparison between CNN-A-Mix and CNN-A-Mix-4 illustrates that pattern with the training objective and architecture named explicitly. Verified performance depends on how the network behaves across the whole perturbation region, so a training change that improves accuracy at its center can have a different effect on certifiability.

The optimizer settings are supported by observations of run behavior. During the fully connected experiments, the authors see sharp curvature with respect to the multipliers on the quadratic ReLU constraint. They reduce the step size for those variables by a factor of 10 and report more stable optimization. The convolutional experiments work without that particular adjustment. The authors also report occasional benefits from shrinking the activation-coordinate diagonal weights or clipping them to zero partway through a run. Those observations explain choices in the implementation. The matched solver, layer-bound, and eigenvalue comparisons give more direct measurements of the contributions those experiments were designed to isolate.

Limitations

Limits identified by the authors

The authors distinguish the scaling of the solver from the scaling of the guarantee. The iterative optimization can fit networks with substantially more activations into memory. For larger networks, it can also produce bounds that leave more of the true worst-case value unresolved. The paper points to the gap between PGD and SDP-FO on the CNN-B networks relative to CNN-A. Preliminary experiments reported by the authors show the gap increasing further with network size. They conclude that further changes to the relaxation or the optimization procedure are necessary for meaningful guarantees on larger networks.

The eigendecomposition at certification time is a separate scaling limit. The iterative optimization gets its memory advantage by treating the matrix as an operator. The direct calculation used for the reported final bounds is considerably more expensive and may become infeasible even when the optimization itself succeeds. The authors mention high-confidence approximation bounds for eigenvalues and eigenvectors as a possible route in that situation. The reported certificates establish the behavior of the workflow with the direct calculation.

The broader-impact discussion places the method in the setting of post-training checks on networks such as learned controllers. A verifier can establish a precisely chosen input-output property for a particular network. Its conclusion remains tied to that specification and to the assumptions that define the admissible inputs. The authors acknowledge that the procedure leaves questions about biases in the underlying training data outside the verification task. Certifying a property of a network constrains its behavior under that property’s assumptions.

Limits visible in the experimental setup

The accuracy claims concern test examples, the specified perturbation sets, and the networks in the experiment. A certificate for an individual test image covers every allowed perturbation of that image. The percentage of test images certified is an aggregate over those verification instances. The study therefore supports both a strong statement within each certified region and a sample-based statement about how often certification succeeds. Changing the data distribution or the definition of allowed perturbations changes the problem to which either statement applies.

The classifier and decoder specifications cover particular notions of stability. For a classifier the condition concerns a score ordering under bounded pixel-coordinate changes. In the decoder experiment the score is squared distance from the original image to the decoder mean under bounded latent changes. The value 40.97 is motivated by an MNIST distance statistic. The resulting guarantee is stated in units of image reconstruction error. Different criteria, such as a guarantee about the class assigned to a reconstruction, would need their own specification and evaluation.

The PGD comparisons bound what one can infer about relaxation tightness. A small gap to a feasible value constrains how far the certificate can be from the true worst case. A large gap is less diagnostic, because the unobserved optimum could be anywhere between the bounds. When the paper uses SDP-IP on the same relaxation, it can also study the part attributable to finite-budget optimization. The small MLP-Adv comparison isolates that part in the tested cases. The convolutional results lack the same reference optimum because of the interior-point memory cost. Their gaps may reflect the relaxation, optimization, or the search result.

The larger and smaller convolutional configurations also differ in training and may have different underlying robustness. Their certified percentages illustrate the kinds of gaps the authors encountered as they moved to larger networks. The comparisons do not give a controlled scaling law for certificate tightness as a function of activation count. The time figures similarly describe the reported budgets and hardware. Per-step complexity comparable to a fixed number of network passes leaves open the number of steps needed on a different architecture or specification.

Finally, the algebraic scope and the experimental scope have different meanings. The quadratic formulation provides a route to verifying problems expressible by quadratic objectives and suitable quadratic constraints. The experiments establish what that route achieves for the image classifiers and the MNIST decoder under the given setups. Each new verification problem still depends on the quality of its constraint representation, the starting activation bounds, and the numerical work required to reach a useful certificate.

What came after

No later study is identified that traces a use or extension of SDP-FO. The paper itself leaves two directions open. One is to tighten the relaxation or improve the first-order optimization as network size increases. The other is to certify the spectral correction from an iterative eigenvalue calculation when a direct decomposition is too expensive. Both arise from the reported experiments and remain prospective in the paper.

Cite

Cite as Sumanth Dathathri, Krishnamurthy Dvijotham, Alexey Kurakin, Aditi Raghunathan, Jonathan Uesato, Rudy Bunel, Shreya Shankar, Jacob Steinhardt, Ian Goodfellow, Percy Liang and Pushmeet Kohli. 2020. Enabling certification of verification-agnostic networks via memory-efficient semidefinite programming. arXiv:2010.11645.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2010.11645 · arXiv 2010.11645

@misc{dathathri2020enabling,
  title = {{Enabling certification of verification-agnostic networks via memory-efficient semidefinite programming}},
  author = {Sumanth Dathathri, Krishnamurthy Dvijotham, Alexey Kurakin, Aditi Raghunathan, Jonathan Uesato, Rudy Bunel, Shreya Shankar, Jacob Steinhardt, Ian Goodfellow, Percy Liang and Pushmeet Kohli},
  year = {2020},
  doi = {10.48550/arxiv.2010.11645},
  eprint = {2010.11645},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2010.11645}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/dathathri-2020-enabling-certification-verification-agnostic-networks/