Abstract
As neural networks (NNs) become integral to safety-critical control systems, providing formal guarantees of their behavior is paramount. ReachNN is a novel framework designed for the reachability analysis of Neural-Network Controlled Systems (NNCS). By approximating neural network controllers with Bernstein polynomials and deriving rigorous error bounds, ReachNN supports a wide array of activation functions—such as Sigmoid, Tanh, and heterogeneous architectures—that challenge existing verification tools. Our evaluation across multiple nonlinear benchmarks demonstrates that ReachNN produces significantly tighter reachable set approximations than traditional interval-based methods, enabling formal safety verification for complex, smooth-activation controllers.
Introduction
The deployment of neural networks in autonomous vehicles, medical devices, and robotics necessitates rigorous safety verification. Reachability analysis aims to compute the set of all possible states a system can reach over a given time horizon to ensure it remains within safe operating bounds. However, the non-linear, "black-box" nature of NNs makes this computationally difficult. While existing tools often focus on piecewise-linear ReLU activations, many practical systems utilize smooth functions like Sigmoid or Tanh. ReachNN addresses this gap by providing a general framework for verifying systems with diverse activation functions.
Methodology
ReachNN transforms the verification problem by approximating the neural network's input-output mapping with a more analytically tractable form.
Bernstein Polynomial Approximation
Unlike Taylor models, which require high-order differentiability, Bernstein polynomials only require the target function to be continuous. This allows ReachNN to handle a broader class of activation functions, including those that are continuous but not everywhere differentiable (like ReLU).
Dual Error Estimation
To maintain soundness, the approximation error between the actual NN and the polynomial model must be bounded. ReachNN employs two strategies:
- Theoretical (T-error): An a priori bound derived from the network's Lipschitz constant.
- Sampling-based (S-error): A tighter, adaptive bound computed through systematic sampling of the input space.
Flowpipe Integration
The resulting polynomial model, combined with its error bounds, is integrated into Flow*, a tool for computing reachable sets (flowpipes) of nonlinear ordinary differential equations (ODEs). This allows the analysis to track the system's evolution across discrete control steps and continuous plant dynamics.
Experimental Evaluation
The framework was tested on six benchmarks involving nonlinear dynamical systems, such as inverted pendulums and quadrotor models. The controllers featured various architectures, including ReLU, Sigmoid, Tanh, and heterogeneous (mixed) layers.
Comparative Performance
ReachNN was compared against state-of-the-art tools like Sherlock and Verisig. A key finding was ReachNN's ability to verify heterogeneous networks that other tools could not process. Furthermore, ReachNN mitigates the "wrapping effect"—where over-approximations accumulate and lead to state-space "explosions."
Key Insights
- Activation Agnosticism: By relying on Lipschitz continuity, ReachNN is largely agnostic to specific activation types, making it highly versatile.
- Verifiability through Retraining: The analysis reveals that networks with high Lipschitz constants are harder to verify. Retraining controllers with a Lipschitz regularizer can improve verifiability without compromising control performance.
- Higher-Order Dependencies: Using polynomials instead of simple boxes (intervals) captures dependencies between state variables more effectively, resulting in tighter bounds over long time horizons.
Conclusion and Future Work
ReachNN provides a robust path forward for verifying smooth-activation neural controllers. While currently limited by the exponential growth of Bernstein polynomial terms in high-dimensional spaces and the computational cost of sampling, future work will focus on parallelization and more efficient error-bounding techniques to scale the framework to larger systems.
Summary updated