Online Verification of Deep Neural Networks under Domain or Weight Shift

Tianhao Wei, Changliu LiuarXiv 2021

Abstract

Although neural networks are widely used, it remains challenging to formally verify the safety and robustness of neural networks in real-world applications. Existing methods are designed to verify the network before deployment, which are limited to relatively simple specifications and fixed networks. These methods are not ready to be applied to real-world problems with complex and/or dynamically changing specifications and networks. To effectively handle such problems, verification needs to be performed online when these changes take place. However, it is still challenging to run existing verification algorithms online. Our key insight is that we can leverage the temporal dependencies of these changes to accelerate the verification process. This paper establishes a novel framework for scalable online verification to solve real-world verification problems with dynamically changing specifications and/or networks. We propose three types of acceleration algorithms: Branch Management to reduce repetitive computation, Perturbation Tolerance to tolerate changes, and Incremental Computation to reuse previous results. Experiment results show that our algorithms achieve up to $100\times$ acceleration, and thus show a promising way to extend neural network verification to real-world applications.

Introduction

Formal verification is the gold standard for ensuring neural networks behave safely in critical applications like autonomous driving or medical robotics. Traditionally, this is an offline process conducted before deployment. However, the real world is dynamic, presenting two major challenges to static verification:

  1. Domain Shift: Environmental changes (e.g., lighting conditions) create data domains not covered during initial verification.
  2. Network Updates: Online learning or fine-tuning means the verified model is no longer the one in operation.

Verifying these changes from scratch every few milliseconds is computationally impossible with current tools. This paper addresses the challenge of making verification fast enough to keep up with a running system by exploiting temporal dependencies—the fact that changes between consecutive time steps are usually small.

Methodology

The framework builds upon reachability-based verification, which calculates the set of all possible outputs for a given set of inputs. To enable online operation, three acceleration principles are proposed:

Branch Management (BMI/BMW)

Verification often involves "branching"—splitting the input space into smaller chunks to reduce mathematical over-approximation. Instead of re-calculating these splits every time, the authors reuse the branching structure from the previous time step.

The base algorithm uses branching to reduce over-approximation, making verification more precise.

Perturbation Tolerance (RSR/LB/INN)

If a change in input or weights is small enough, the previous verification result might still be valid.

  • Reachable Set Relaxation (RSR): Verifies a slightly larger "relaxed" input set so that future, similar inputs are already covered.
  • Lipschitz Bound (LB): Uses the network's mathematical properties to prove that small input changes won't push the output into an unsafe zone.
  • Interval Neural Networks (INN): Represents weights as ranges (intervals), allowing the network to absorb small updates without full re-verification.

Incremental Computation (IC)

Specifically for fine-tuning where only the last layer changes, the algorithm reuses the reachability results from all previous, unchanged layers.

Experimental Evaluation

The framework was evaluated on two distinct tasks:

  1. Robotics Task: A human motion prediction scenario where a 4-layer network predicts velocity vectors. This involved time-varying input constraints and online fine-tuning.
  2. Computer Vision (CV) Task: An MNIST image classification task where input images gradually dim over time, testing high-dimensional input handling.

Key Insights and Results

The core innovation is leveraging temporal correlation: because states at time $t$ and $t+1$ are highly correlated, verification can be treated as an incremental update rather than a new problem.

Different strategies for handling domain shift: BMI reuses branches, RSR relaxes the input set, and LB uses Lipschitz constants.

Performance gains were substantial across the board:

  • Domain Shift: Combining Branch Management (BMI) and Lipschitz Bounds (LB) reduced verification time by roughly 10x in the robotics task without losing accuracy.
  • Network Updates: Using Interval Neural Networks (INN) provided a 25x speedup.
  • Fine-tuning: Incremental Computation (IC) combined with other methods reached a staggering 100x speedup, reducing processing time from ~11 seconds to ~0.1 seconds.

Conclusion

While this framework significantly advances real-time safety verification, limitations remain. Future work will explore automated model repair upon safety violation detection, heuristic selection for algorithm optimization, and scaling to larger architectures like Transformers.

Summary updated

BibTeX
@misc{wei2021online,
  author = {Tianhao Wei and Changliu Liu},
  title = {{Online Verification of Deep Neural Networks under Domain or Weight Shift}},
  year = {2021},
  eprint = {2106.12732},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2106.12732},
}
Figure