Skip to main content
QUICK REVIEW

[Paper Review] QNNVerifier: A Tool for Verifying Neural Networks using SMT-Based Model Checking

Xidan Song, Edoardo Manino|arXiv (Cornell University)|Nov 24, 2021
Adversarial Robustness in Machine LearningComputer Science22 references5 citations
TL;DR

QNNVerifier is the first open-source tool for formally verifying quantized neural networks using SMT-based model checking, supporting fixed- and floating-point arithmetic, arbitrary activation functions via lookup tables, and user-defined safety properties in C code. It achieves state-of-the-art verification performance by combining interval analysis, invariant inference, and integration with ESBMC, outperforming existing tools on benchmarks like AcasXu while accounting for finite word-length effects.

ABSTRACT

QNNVerifier is the first open-source tool for verifying implementations of neural networks that takes into account the finite word-length (i.e. quantization) of their operands. The novel support for quantization is achieved by employing state-of-the-art software model checking (SMC) techniques. It translates the implementation of neural networks to a decidable fragment of first-order logic based on satisfiability modulo theories (SMT). The effects of fixed- and floating-point operations are represented through direct implementations given a hardware-determined precision. Furthermore, QNNVerifier allows to specify bespoke safety properties and verify the resulting model with different verification strategies (incremental and k-induction) and SMT solvers. Finally, QNNVerifier is the first tool that combines invariant inference via interval analysis and discretization of non-linear activation functions to speed up the verification of neural networks by orders of magnitude. A video presentation of QNNVerifier is available at https://youtu.be/7jMgOL41zTY

Motivation & Objective

  • To address the lack of open-source tools for formally verifying quantized neural networks that account for finite word-length effects in fixed- and floating-point arithmetic.
  • To enable formal verification of actual ANN implementations rather than abstract mathematical models, ensuring correctness in deployed systems.
  • To support a wide range of neural network formats (ONNX, Keras, TensorFlow, C) and arbitrary non-linear activation functions through lookup tables.
  • To provide users with full expressivity in specifying safety properties using plain C code with assume and assert statements.
  • To accelerate verification via invariant inference using interval analysis and discretization of non-linear functions, significantly improving performance.

Proposed method

  • Translates neural network implementations into a decidable fragment of first-order logic using SMT, representing fixed- and floating-point operations with hardware-determined precision.
  • Supports multiple input formats including ONNX, NNET, Keras, TensorFlow, and native C code, enabling direct verification of source code.
  • Replaces non-linear activation functions (e.g., sigmoid, tanh, ReLU) with pre-computed lookup tables to enable efficient SMT encoding with bounded error (ε ≤ 0.002).
  • Employs Frama-C to infer interval invariants for each neuron, which are then encoded as assume statements to constrain the search space.
  • Uses ESBMC as the backend SMT-based model checker, enabling integration with state-of-the-art SMT solvers (Bitwuzla, Boolector, Yices, Z3) and incremental verification strategies.
  • Supports both k-induction and incremental verification strategies, allowing scalable and efficient analysis of quantized networks.

Experimental results

Research questions

  • RQ1Can a formal verification tool efficiently handle the finite word-length effects of quantized neural networks in both fixed- and floating-point representations?
  • RQ2How does the integration of interval analysis and lookup-table-based activation functions improve verification performance compared to direct SMT encoding?
  • RQ3To what extent does quantization level (e.g., 8-, 16-, 32-bit) affect verification time, and is there a measurable performance trade-off?
  • RQ4Can a tool that verifies actual C code implementations of ANNs achieve performance comparable to tools that verify abstract mathematical models?
  • RQ5How does QNNVerifier’s support for arbitrary activation functions and user-defined safety properties impact its applicability across diverse neural network architectures?

Key findings

  • QNNVerifier outperforms the SMT-based tool Marabou and matches the performance of the reachability-based tool Neurify on the AcasXu benchmark, despite considering quantization effects.
  • Bitwuzla and Boolector show nearly identical verification times, while Yices is significantly faster across all benchmarks, and Z3 fails to complete most verification tasks.
  • The correlation between word length and verification time holds only for word lengths below 16 bits and specific safety properties, with no significant variation in safety outcomes across different quantization formats.
  • The use of lookup tables for activation functions with ε ≤ 0.002 enables accurate yet efficient SMT encoding, reducing verification time by orders of magnitude.
  • Invariant inference via interval analysis in Frama-C reduces the search space and accelerates verification, especially in deep networks with ReLU and sigmoid activations.
  • QNNVerifier is the first open-source tool to support full verification of quantized ANNs across multiple formats (ONNX, Keras, TensorFlow, C) with user-defined safety properties and both fixed- and floating-point arithmetic.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.