Skip to content

Safety verification of deep neural networksSafety Verification of Deep Neural Networks

arXiv· arXiv:1610.06940· CAV· Xiaowei Huang, Marta Kwiatkowska, Sen Wang, Min WuDepartment of Computer Science, University of OxfordIndexed by this site · 27 days ago· Originally publishedSelected DefensesSelectedAttention41

Quick read

Analysis and theory

Based on the paper PDF (AI-generated); refer to the original

The authors propose an SMT-based neural network safety verification framework, DLV, and compare it with FGSM and JSMA on MNIST; at dimsl=450 the adversarial example discovery rate is 98%.

Questions
Deep neural networks are unstable to adversarial perturbations, and existing methods for finding adversarial examples cannot guarantee finding one when it exists. The authors focus on whether a single classification decision is safe under a given region and family of manipulations, which matters for safety-critical applications such as autonomous driving.
Methods
The authors propose an SMT-based verification framework, DLV: safety is defined as the classification remaining unchanged within a region; discretization turns the region search into a finite ladder-tree exhaustive search; regions and manipulations are propagated layer by layer; feature decomposition reduces dimensionality; and Z3 is used for solving.
Experiments and results
Experiments were conducted on two-dimensional point classification, MNIST, CIFAR10, GTSRB, and ImageNet (VGG16) networks. In the MNIST comparison experiment (500 test images), DLV dimsl=450 had a discovery rate of 98%, JSMA θ=0.4 was 99%, and FGSM ε=0.4 was 97.2%; at high discovery rates, JSMA had the smallest average distance.
Limitations and future work
The authors note that the verification process grows exponentially with the number of features and is too complex for large images, and believe parallelization can improve performance and scalability. Experiments were conducted on a MacBook Pro laptop, the MNIST comparison test set is 500 images, and the paper does not report repeated experiments.
Experimental setupTwo-dimensional point classification network、MNIST network et al. · MNIST、CIFAR10 et al. · 平均 L1 距离、平均 L2 距离 et al.
Evaluated models
Two-dimensional point classification networkMNIST networkCIFAR-10 networkGTSRB networkVGG16
Benchmarks
MNISTCIFAR10GTSRBImageNet (ILSVRC)
Metrics
平均 L1 距离平均 L2 距离对抗样本发现成功率
AI summaryand selection rationaleResearchers at the University of Oxford proposed an SMT-based safety verification framework for feedforward neural networks, which checks whether image classification decisions maintain their original classification under perturbations such as scratches, viewpoint or lighting changes that humans would not consider to change the class. The framework exhaustively searches high-dimensional regions through discretization and analyzes them by layer-by-layer propagation, acting directly on the network code. Unlike existing methods, the framework guarantees finding an adversarial example (if one exists) within a given region and operation family, or otherwise can determine that the decision is safe; the found examples can be used to fine-tune the network or handed over for manual testing. The authors implemented the tool DLV based on Z3 and evaluated it on VGG16 with MNIST, CIFAR10, GTSRB and ImageNet; for most MNIST samples, class flips occurred within changes to 100 dimensions in the first hidden layer, and on GTSRB a stop sign was changed to a 30 mph speed limit sign at an L1 distance of 0.045; compared with FGSM and JSMA on MNIST, at similar success rates JSMA had the smallest average perturbation distance, and DLV was smaller than FGSM.

Researchers at the University of Oxford proposed an SMT-based safety verification framework for feedforward neural networks, which checks whether image classification decisions maintain their original classification under perturbations such as scratches, viewpoint or lighting changes that humans would not consider to change the class. The framework exhaustively searches high-dimensional regions through discretization and analyzes them by layer-by-layer propagation, acting directly on the network code. Unlike existing methods, the framework guarantees finding an adversarial example (if one exists) within a given region and operation family, or otherwise can determine that the decision is safe; the found examples can be used to fine-tune the network or handed over for manual testing. The authors implemented the tool DLV based on Z3 and evaluated it on VGG16 with MNIST, CIFAR10, GTSRB and ImageNet; for most MNIST samples, class flips occurred within changes to 100 dimensions in the first hidden layer, and on GTSRB a stop sign was changed to a 30 mph speed limit sign at an L1 distance of 0.045; compared with FGSM and JSMA on MNIST, at similar success rates JSMA had the smallest average perturbation distance, and DLV was smaller than FGSM.

Why it was selectedThe paper proposes an SMT-based layer-by-layer safety verification method that, unlike heuristic searches such as FGSM and JSMA, guarantees finding an adversarial example within a given region, or otherwise can determine that the decision is safe.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    How to automatically verify the safety of a single neural network classification decision under a given region and family of manipulations, and guarantee that an adversarial example is found when one exists.

    Core question: how to automatically verify the safety of a single classification decision of a feedforward neural network—whether the classification remains unchanged under a given region and family of manipulations, and guaranteeing that an adversarial example is found when one exists.

    • Problem setting: deep neural networks perform well on image classification but are unstable to adversarial perturbations; the authors consider this a hidden risk for safety-critical applications such as autonomous-driving perception modules and end-to-end controllers.
    • Shortcomings of existing methods: the authors state that methods based on optimization or heuristic search, such as FGSM and JSMA, do not guarantee finding a misclassification when one exists in the region; measures based on risk or statistical robustness average over the input distribution rather than addressing a single decision.
    • Core observation: digital images are inherently discrete pixels (e.g., 8-bit RGB), so discretization can turn the search over a high-dimensional continuous region into finite exhaustive search; the authors also propagate the analysis layer by layer based on the view that networks compute stronger invariants with depth.
    • What the paper proposes: an SMT-based automatic verification framework, implemented as the tool DLV, using Z3 for solving; it serves both verification (no misclassification found at any layer) and falsification (finding an adversarial example, which can be used to fine-tune the network or shown to human testers).
    • Object of the safety definition: for a single input point x, a user-specified region η (which can be given by diameter or salient features), and a family of manipulations ∆ (e.g., camera error, angle changes, feature replacement), the classification is required to remain unchanged after manipulation; the paper does not adopt the attacker-knowledge (white-box/black-box) framing, and the method directly reads the network code and trained weights.
  2. What related research exists?

    Related work falls into three categories: constraint-solving verification of neural networks, adversarial example search methods, and robustness metrics; the authors position their own work in terms of layer-by-layer analysis and completeness guarantees.

    Neural network verification based on constraint solving

    • Pulina and Tacchella (CAV 2010) — encode the entire network as constraints and solve with SAT; the paper notes that it can only handle 6 neurons (3 hidden neurons), whereas this paper analyzes layer by layer to obtain better scalability. Scheibler et al. (MBMV 2015) take a similar approach.
    • Katz et al.'s Reluplex (CAV 2017) — a constraint method that extends Simplex to handle ReLU; the paper notes that it can only handle ReLU activations, is demonstrated on 300 ReLU nodes, and because it encodes the entire network, whether it can scale to practical deep networks (e.g., the MNIST network in this paper has 630,016 ReLU nodes) is unclear.

    Adversarial example search

    • Szegedy et al. (ICLR 2014) and Biggio et al. (ECML/PKDD 2013) — the earliest use of (box-constrained) optimization to find misclassifications; Goodfellow et al. (2014) proposed the faster FGSM; Kurakin et al. (2016) used a compromise iterative method; Nguyen et al. (CVPR 2015) used evolutionary algorithms. The paper notes that these methods explore branchless lasso-type ladder trees, do not satisfy covering, and cannot guarantee finding a misclassification that exists.
    • Zheng et al. (CVPR 2016) — test robustness with distortions such as JPEG compression, scaling, and cropping; the paper states that these distortions can be understood as manipulation in the sense of this paper.

    Robustness measures

    • Fawzi et al. (2015) — robustness averaged over the input distribution; the paper notes that in high dimensions the distribution is difficult to estimate accurately, and its optimization has no convergence guarantee.
    • Bastani et al. (NIPS 2016) — pointwise robustness, corresponding to general safety in this paper; the paper notes that it reduces the constraint system to a convex LP and only verifies approximate properties, whereas this paper performs exhaustive search directly on activation values.

    Baselines and benchmarks: the comparison baselines are FGSM and JSMA, comparing search strategies and statistical robustness estimates on MNIST (Table 1). The authors position this paper as: unlike existing methods, it guarantees finding an adversarial example when one exists, and it propagates layer by layer and can operate on hidden layers.

  3. How does the paper address this problem?

    Safety is defined as the classification remaining unchanged within a region, using discretized ladder-tree exhaustive search, layer-by-layer refinement propagation, feature decomposition for dimensionality reduction, and then SMT solving.

    Overall idea: reduce the safety problem of "classification at point x is invariant in region η under manipulation family ∆" to a finite exhaustive search for adversarial misclassification within the discretized region, propagate the analysis layer by layer to deeper layers, and implement it with an SMT solver. The framework is implemented as the tool DLV.

    Formalization of safety and manipulations

    • General safety (Definition 1): For the region ηk(αx,k) of activation αx,k in layer Lk, if all activations in the region have the same class as x at the output layer, then N, ηk |= x.
    • Manipulation: Users apply perturbation operators defined by the application (e.g., scratches, angle, lighting), represented by a hyperrectangle rec; a valid manipulation requires αx,k to be an interior point of rec(V(αx,k), αx,k); a minimal manipulation guarantees that class changes need only be checked at the endpoints.
    • ladder and 0-variation (Definitions 4, 5): A ladder is a finite sequence of activations in the region starting from αx,k, connected successively by valid manipulations, and eventually leaving the region; when the total variation of the region over all ladders is 0 and the ladder set is complete and covering, the network is said to be safe with respect to ∆k.
    • Theorems in two directions: Theorem 1 gives that N, ηk |= x implies N, ηk, ∆k |= x; Theorem 2 gives the reverse direction when manipulations are minimal, so that exhaustively searching a complete and covering ladder tree can find an adversarial example (if one exists).

    Layer-by-layer propagation and refinement

    • Inter-layer mapping (Definition 6): Besides the activation function φk, a reverse mapping ψk (which may be the inverse of φk) is required, and ηk−1(αx,k−1) ⊆ ψk(ηk(αx,k)) is required, so that mapping a deep region back to a shallow layer covers the shallow region.
    • refinement by layer (Definitions 7, Theorem 3): If every manipulation of Lk−1 can be realized by a sequence of manipulations of Lk, then deep-layer safety implies shallow-layer safety; in the discrete setting, this refinement process has a unit step size as its lower bound.
    • Weakening with precision ε (Definition 9): Exact refinement is computationally expensive, so the authors instead use approximate refinement with precision ε, allowing the target activation to fall within the final hyperrectangle at a distance no greater than ε.

    Verification algorithm and SMT encoding

    • Algorithm 1: Recursion starting from some layer l: determine the region ηk (satisfying Definition 6) → determine the manipulation set ∆k (satisfying refinement by layer) → verify N, ηk, ∆k |= x; if safe, report and proceed to the next layer, otherwise report an adversarial example.
    • SMT encoding: Checking refinement by layer uses the theory of linear real arithmetic with existential and universal quantifiers, and the intra-layer 0-variation check uses the same theory without universal quantifiers; the solver is Z3.
    • Mapping back to the input layer: After a misclassification is found in a hidden layer, points in Pre0(αy,k) are obtained by layer-by-layer inversion using ψk…ψ1 to obtain the input image; the inverse of maxpooling is computed together with the next layer; points for which no corresponding input is found are discarded.

    Feature decomposition and automatic selection of regions and manipulations

    • Feature decomposition: Assuming features are mutually independent, the region ηk is partitioned into low-dimensional features, reducing the O(2^{d1+…+dm}) problem to m small problems of O(2^{di}); the class of the midpoint of acts(x, k) (one point per feature) and the 0-variation of each feature are checked.
    • Search method: Features can be checked one by one in a preset order (single-path), or multiple paths can be explored nondeterministically using MCTS (multi-path).
    • Automatic selection: For the first layer, the dimsk dimensions whose activation values deviate most from the layer mean are selected to form the region (Equation 4), and manipulations add or subtract the step size sp to dimensions according to the direction function d (Equation 5); deep-layer region dimensions are determined by propagating shallow-layer dimensions through φk according to Equation 6, the region size is iteratively expanded according to the satisfiability of Equation 7, and the manipulation set is determined by Equation 8 (with parameters h, ε).
  4. What experiments did the paper conduct?

    DLV was validated on two-dimensional points, MNIST, CIFAR10, GTSRB, and ImageNet networks, and on 500 MNIST images its detection rate and perturbation distance were compared with FGSM and JSMA.

    Experimental setup

    • Networks under test: a two-dimensional point classification network (3 ReLU fully connected hidden layers of 20 neurons each, trained on 5,000 points, accuracy over 99%); an MNIST network (12 layers, 600,810 parameters, accuracy over 99%); a CIFAR10 network (1,250,858 parameters); a GTSRB network (43 classes, images scaled to 32×32); ImageNet's VGG16 (138,357,544 parameters).
    • Tool and implementation: DLV (Python), the SMT solver Z3, networks built with Keras + Theano; experiments were run on a MacBook Pro (2.7 GHz Intel Core i5, 8 GB memory).
    • Key parameters (Appendix A): MNIST starts from layer l=1, dimsl=150, sp=mp=1.0, ε=1.0, dimsk,f=5 per feature; CIFAR10 dimsl=500; GTSRB dimsl=1000; ImageNet l=2, dimsl=20,000.
    • Search mode and norms: the first three experiments use single-path search and the L2 norm; GTSRB uses multi-path search and the L1 and L2 norms.
    • Comparison experiment (Section 6): baselines are FGSM (ε ∈ {0.1, 0.2, 0.4}) and JSMA (θ ∈ {0.1, 0.4}, ε=1.0); DLV uses single-path, the first hidden layer, dimsl ∈ {75, 150, 450}; the test set is 500 randomly selected MNIST images.
    • Metrics: average L1 and L2 distances on adversarial examples, and the success rate in finding adversarial examples (defined by the two formulas in Section 6).

    Main results

    Table 1 (MNIST, 500 test images; DLV is first hidden layer single-path):

    Swipe horizontally to read the table

    Method (parameter)Average L2Average L1Success rate
    FGSM (ε=0.1)0.080.0617.5%
    FGSM (ε=0.2)0.150.1270.9%
    FGSM (ε=0.4)0.320.2597.2%
    DLV (dimsl=75)0.190.0452.3%
    DLV (dimsl=150)0.220.0679%
    DLV (dimsl=450)0.270.0998%
    JSMA (θ=0.1)0.110.0292%
    JSMA (θ=0.4)0.110.0299%
    • Authors' interpretation: among the settings with high success rates (FGSM ε=0.4, DLV dimsl=450, JSMA θ=0.4), JSMA has the smallest average distance, followed by DLV, and FGSM the largest.
    • Runtime: DLV takes 1–2 minutes per MNIST image; JSMA takes about 10 minutes per image but targets 10 classes, and the authors state its runtime is comparable to DLV; FGSM processes in batches and is fastest per image.
    • Authors' caveat: the authors cite others' work stating that misclassifications with smaller distances may have lower transferability.

    Verification and falsification on each dataset

    • Two-dimensional point network: within the input-layer region [2.59, 4.59] × [0.11, 2.11], the manipulation set ∆0 detects no class change (N, η0, ∆0 |= x); after selecting dimensions p1,17 and p1,19 in the first hidden layer, a class change is detected (N, η1, ∆1 not satisfied), demonstrating the effect of layer-by-layer refinement (Figure 6, 7).
    • MNIST: the authors report that for most samples a class change can be found within 100 dimensions of variation in the first hidden layer, and for some within fewer than 30; for samples with at most 40 dimensions of variation, the tool checks through to the output layer and judges all k ≥ 1 layers safe; finding one adversarial example takes at most a few minutes (Figure 8).
    • CIFAR10: Figure 9 shows 8 images mapped back to the input layer for dimsl from 25 to 145; the first 7 satisfy N, η1, ∆1 |= x, and the last one (145 dimensions) is misclassified as truck; at dimsl=500, finding an adversarial example per image takes from a few seconds to 20 minutes (Appendix Figure 13 gives 16 example pairs).

    GTSRB and ImageNet

    • GTSRB (multi-path, Figure 11): a stop sign (confidence 1.0) was changed to speed limit 30, with L1 distance 0.045, L2 distance 0.19, misclassification confidence 0.79, taking about 20 minutes; speed limit 80 (confidence 0.999964) was changed to speed limit 30, with L1 distance 0.004, L2 distance 0.06, misclassification confidence 0.99, taking a few seconds; "go right" can also be changed to "go straight".
    • ImageNet (VGG16, Figure 10): the left road sign image was judged unsafe at 6,346 dimensions of variation in the second layer (0.2% of that layer's 3,211,264 dimensions) (class changed to bird house); for the right image, no adversarial example was found within 20,000 dimensions of variation, and it was reported safe.

    Other ablations and analyses

    • Single-path vs multi-path (Experiment 1, Figure 12): for the same MNIST image (7), JSMA (ε=0.1, θ=1.0) produced a misclassification with L2=0.17, L1=0.03 (classified as 3); DLV, using the same single-pixel manipulation at the input layer (sp·mp=1.0) with MCTS multi-path, found a sample also classified as 3 but with L2=0.14, L1=0.02; the authors state that DLV may be slower than JSMA because it searches multiple paths.
    • FGSM single-image demonstration: a misclassification (classified as 9) appeared only when ε was gradually increased from 0.05 to 0.4; the authors state that FGSM requires a relatively large perturbation.
    • Effect of the number of dimensions: on CIFAR10, as dimsl increased from 25 to 145, the first 7 settings were safe, and a misclassification appeared at 145 dimensions (Figure 9).
  5. What are some points that can be further explored?

    The authors note that verification complexity grows exponentially with the number of features and that parallelization can improve it; experiments were run on a laptop, and the comparison test set is 500 MNIST images.

    Limitations and future directions noted by the authors

    • Complexity: The verification process grows exponentially with the number of features, and the complexity for large images is prohibitive (Conclusions).
    • Parallelization: The authors state that parallelization can improve the method's performance and scalability (Conclusions).
    • Symbolization and abstraction refinement: The authors propose exploring whether the regularity concept of [24] allows symbolic methods, and whether an abstraction refinement framework can be established to improve scalability and computational performance (Conclusions).
    • Minimal manipulations are undecidable: The authors state that network scale makes determining whether a manipulation set is minimal computationally infeasible, so one can only refine layer by layer, with a unit step size as the lower bound in the discrete setting (Section 4.1).
    • Exact refinement is costly: The authors state that exact refinement-by-layer computation easily yields too small a step size sp, leading to unacceptable verification computation, so they instead use approximate refinement with precision ε (Section 4.4).

    Scope of experimental coverage

    • Networks tested: 5 networks in total—two-dimensional point classification, MNIST, CIFAR10, GTSRB, and ImageNet (VGG16)—all Keras/Theano networks trained by the authors themselves or a downloaded VGG16 (Section 5).
    • Quantitative comparison: Compared with FGSM and JSMA only on MNIST, with a test set of 500 randomly selected images, and metrics of average L1/L2 distance and success rate (Table 1).
    • Search method: single-path for two-dimensional points, MNIST, and CIFAR10; multi-path (MCTS) for GTSRB and supplementary MNIST experiments (Section 5, Appendices B, C).
    • Runtime environment: All experiments were conducted on a MacBook Pro laptop (2.7 GHz i5, 8 GB memory) (Section 5).
    • Not reported in the paper: The number of repetitions and variance of the comparison experiments; the number of images used in experiments on CIFAR10, GTSRB, and ImageNet; the specific number of images for which adversarial examples were found for each network.
  6. Summarize the main content of the paper

    The SMT-based layer-by-layer safety verification framework DLV guarantees that adversarial examples in discrete regions can be found if they exist, and was validated and compared on 5 networks.

    This is a neural network verification paper: the authors propose an SMT-based automatic verification framework, DLV, which checks the safety of a single classification decision of a feedforward network under a user-given region and family of manipulations.

    • Problem to solve: existing adversarial example search methods (FGSM, JSMA, etc.) do not guarantee finding a misclassification that exists, and statistical robustness measures do not target a single decision; what the authors verify is point-level safety.
    • Method highlights: safety is defined as the classification remaining unchanged within a region; the discreteness of image pixels is used to turn the region search into a complete and covering ladder-tree exhaustive search (Theorem 2 guarantees completeness when the manipulation is minimal); regions and manipulations are refined and propagated layer by layer toward deeper layers; feature decomposition reduces the high-dimensional problem to low dimensions; Z3 is used for solving, and misclassifications found in hidden layers can be mapped back to the input layer.
    • Main results: in the MNIST comparison experiment (500 random test images, Table 1), DLV (first hidden layer single-path, dimsl=450) had a success rate of 98%, JSMA (θ=0.4) 99%, and FGSM (ε=0.4) 97.2%; under the high-success-rate settings, the average perturbation distance was smallest for JSMA, second for DLV, and largest for FGSM.
    • Other results: for most MNIST samples, a class change was found within 100 dimensions of variation in the first hidden layer; on GTSRB, a stop sign was changed to a speed limit 30 (L1=0.045, L2=0.19); on VGG16, a road sign image was judged unsafe at 6,346 dimensions of variation in the second layer (0.2% of that layer's dimensions).
    • Authors' conclusion: the authors call the results encouraging, with adversarial examples found within seconds when few dimensions are involved, but verification grows exponentially with the number of features and is too costly for large images with high complexity; parallelization and abstraction refinement are directions for improvement.
Read originalCAV