Patching Approximately Safe Value Functions Leveraging Local Hamilton-Jacobi Reachability Analysis

Sander Tonkens, Alex Toofanian, Zhizhen Qin, Sicun Gao, Sylvia L. Herbert

TL;DR

This paper introduces HJ-PATCH, an algorithm that refines "approximately safe" value functions (like those learned by neural networks) to provide formal safety guarantees. By locally updating only the critical regions near the safety boundary, HJ-PATCH significantly speeds up the process of obtaining provably safe control policies, bridging the gap between data-driven function approximation and rigorous formal methods.

What Problem Does This Paper Address?

Ensuring the safety of autonomous systems, especially in safety-critical domains like self-driving cars, is paramount. Control barrier functions (CBFs) and related "safe value functions" are powerful tools for this, defining a safe set of states and enabling safety filters to correct unsafe actions. While neural networks and other function approximators can learn these value functions efficiently, they often lack formal guarantees, meaning they might incorrectly classify unsafe states as safe. This can lead to catastrophic failures. Traditional formal methods like Hamilton-Jacobi (HJ) reachability can provide these guarantees but scale poorly with system dimensionality. The challenge is to leverage the efficiency of learned value functions while retaining the rigor of formal methods.

Methods

The core contribution is the HJ-PATCH algorithm. It takes an existing, potentially "approximately safe" value function (which might have some formal guarantees but not full ones) and refines it to achieve formal safety. The key idea is to perform local dynamic programming (DP) updates, guided by HJ reachability principles, but only in specific regions of the state space.

Here's how it works:

  1. Identify "Active" States: The algorithm starts by identifying states that are near the boundary of the current "safe" set (defined by the value function) and are potentially unsafe. This set is called the "active set."
  2. Local DP Updates: For states within the active set, HJ-PATCH iteratively updates the value function using a discrete-time HJ update formula. This process is similar to standard HJ reachability but is confined to the active states.
  3. Iterative Refinement: After updating the value function at the active states, the algorithm identifies new states where the value function has decreased (indicating a potential safety violation) and adds their neighbors to the active set for the next iteration.
  4. Convergence: This iterative process continues until the active set becomes empty, signifying that the value function has been refined to satisfy formal safety conditions.

This local approach significantly reduces computational complexity compared to global HJ reachability methods, which would update the entire state space. The algorithm is designed to converge to the largest control-invariant subset of the initial value function's safe set, which is also known as the viability kernel.

Datasets

Not discussed in the paper. The paper focuses on synthetic and learned examples for evaluation rather than specific datasets.

Key Insights and Ideas

  • Local Refinement is Key: The most significant insight is that formal safety guarantees can be achieved by locally patching approximately safe value functions, rather than recomputing them globally. This drastically improves scalability.
  • Bridging the Gap: HJ-PATCH effectively bridges the gap between efficient but unverified function approximation methods (like neural networks) and computationally expensive but rigorous formal methods (like HJ reachability).
  • Perils of Naive Use: The paper strongly demonstrates that using approximately safe value functions directly as safety filters can be dangerous, leading to a significant percentage of failures, especially with adversarial nominal controllers.
  • Viability Kernel Guarantee: The algorithm is theoretically guaranteed to converge to the viability kernel of the initial safe set, which represents the largest possible control-invariant set that can be derived from the initial function.

Key Results

  • Computational Speedup: HJ-PATCH achieves a significant reduction in computational complexity, reducing it by 2 orders of magnitude compared to standard global HJ reachability methods. This is demonstrated on both analytic and learned examples.
  • Improved Safety: In simulations, HJ-PATCH drastically reduces the rate of unsafe trajectories compared to using learned approximately safe value functions directly. For example, in one quadcopter experiment, unsafe trajectories dropped from 52.7% to 4.2% with a 14x computational cost reduction compared to global HJ reachability.
  • Matching Global Solutions: For fine grids, the value function obtained by HJ-PATCH closely matches the global HJ reachability solution, especially near the safety boundary.
  • Effectiveness on Learned Functions: The method is shown to be effective in patching learned barrier functions for quadcopter models, significantly improving their safety performance.

Limitations and Future Work

  • Discretized State Space: The theoretical guarantees are proven for a discretized state space. While empirical results show effectiveness in continuous domains, ensuring strict safety in continuous space might require careful grid selection or additional techniques.
  • Convergence: While convergence is theoretically guaranteed in infinite time, practical implementation relies on numerical approximations and convergence criteria.
  • Future Work: The authors suggest exploring further speedups through more informed updating strategies, adaptive grids, and extending the guarantees to coarser grids. They also plan to investigate extending the algorithm to find the smallest invariant superset.

Summary updated

BibTeX
@inproceedings{tonkens2024patching,
  author = {Sander Tonkens and Alex Toofanian and Zhizhen Qin and Sicun Gao and Sylvia L. Herbert},
  title = {{Patching Approximately Safe Value Functions Leveraging Local Hamilton-Jacobi Reachability Analysis}},
  booktitle = {CDC},
  year = {2024},
  doi = {10.1109/cdc56724.2024.10885790},
}
Figure