Verification-Aided Learning of Neural Network Barrier Functions with Termination Guarantees

Shaoru Chen, Lekan P. Molu, Mahyar Fazlyab

Introduction

In the deployment of autonomous systems, such as unmanned aerial vehicles (UAVs) and self-driving cars, ensuring safety is a non-negotiable requirement. Formal verification provides a rigorous framework for these guarantees, often relying on Barrier Functions (BFs). A Barrier Function acts as a mathematical certificate: if such a function can be found for a given system, it proves that the system's trajectories will never enter a predefined "unsafe" region.

While Neural Networks (NNs) have emerged as powerful candidates for representing these functions due to their expressive capacity, training them to satisfy formal safety conditions remains a significant challenge. This paper introduces a novel fine-tuning approach that combines deep learning with convex optimization to provide the first finite-step termination guarantee for learning neural network barrier functions.

The Problem: The "Train-then-Verify" Loop

The standard approach to synthesizing NN-based barrier functions typically follows an iterative "train-then-verify" loop:

  1. Training: An NN is trained to satisfy the barrier function properties using gradient-based optimization.
  2. Verification: A formal verifier checks if the NN satisfies the safety conditions across the entire state space.
  3. Refinement: If the verifier finds a counterexample (a point where safety is violated), that point is added to the training set, and the model is retrained.

This loop suffers from a fundamental flaw: it lacks convergence guarantees. The retraining process may fix one violation while introducing others, leading to infinite oscillations or failure to find a valid certificate even when one exists within the function class. There is no mathematical assurance that this process will ever terminate.

Proposed Method: Convex Fine-Tuning

To address these limitations, the authors propose a hybrid framework that bridges the gap between the flexibility of deep learning and the reliability of convex optimization. The core of their approach lies in transforming the search for a barrier function into a convex feasibility problem.

1. Vector Barrier Functions

Instead of a standard scalar function, the method utilizes vector-valued barrier functions. This formulation provides increased flexibility for complex dynamical systems while maintaining a structure conducive to convex optimization.

2. The "Last Layer" Trick

The authors observe that if the hidden layers of a pre-trained NN are treated as a fixed set of "basis functions," the problem of finding valid weights for the final linear layer becomes convex. By freezing the feature-extracting layers and only optimizing the output layer's weights and biases, the search space becomes a convex set.

3. Analytic Center Cutting-Plane Method (ACCPM)

With the problem reformulated as a convex feasibility task, the authors employ the Analytic Center Cutting-Plane Method (ACCPM). When a verifier identifies a counterexample, ACCPM uses it to generate a "cut" in the search space of the last layer's weights. Because the search space is convex, ACCPM is guaranteed to either:

  • Find a valid set of weights that satisfy the barrier conditions.
  • Prove that no such weights exist within the current function class.

This provides the critical finite-step termination guarantee that standard gradient descent lacks.

4. Verification-Aided Learning Framework

The method integrates these components into a robust pipeline using state-of-the-art verifiers, such as $\alpha, \beta$-CROWN and Mixed-Integer Programming (MIP) solvers. The process often begins with a "warm-start" phase using standard gradient descent to get the NN close to a solution, followed by the ACCPM-based fine-tuning to achieve formal validity.

Experimental Evaluation

The authors evaluated their method on several simulated dynamical systems, including a Double Integrator (a 2D control problem) and a 6D Quadrotor model. The training data consisted of points sampled from initial state sets ($\mathcal{X}_0$), unsafe sets ($\mathcal{X}_u$), and the general workspace ($\mathcal{X}$).

Key Results

The proposed fine-tuning method demonstrated a significant improvement over the standard retraining baseline:

  • Success Rates: On the 6D Quadrotor system, the success rate in finding a valid barrier function increased from 12.5% to 75%.
  • Efficiency: The fine-tuning approach often found valid certificates in a fraction of the time required by standard loops, many of which timed out after two hours.
  • Robustness: The method showed much lower variance in runtime and success across different random seeds, indicating it is a more reliable tool for safety-critical engineering.

Discussion and Limitations

While the termination guarantee is a major theoretical and practical contribution, it is dependent on the quality of the "basis functions" provided by the hidden layers. If the pre-trained hidden layers cannot represent a valid barrier function, the fine-tuning will terminate with a failure. Additionally, the method remains dependent on the computational efficiency of the underlying formal verifiers, which can become a bottleneck as system dimensionality increases.

Conclusion

By leveraging the properties of convex optimization within a deep learning framework, this work provides a rigorous path forward for the formal verification of autonomous systems. The transition from heuristic-based retraining to a guaranteed termination process marks a significant step toward making neural network safety certificates a practical reality. Future work aims to extend this framework to Control Barrier Functions (CBFs), enabling the simultaneous synthesis of safe controllers and their corresponding certificates.

Summary updated

BibTeX
@inproceedings{chen2024verification,
  author = {Shaoru Chen and Lekan P. Molu and Mahyar Fazlyab},
  title = {{Verification-Aided Learning of Neural Network Barrier Functions with Termination Guarantees}},
  booktitle = {ACC},
  year = {2024},
  doi = {10.23919/acc60939.2024.10645043},
}
Figure