As the number of autonomous robots continues to grow, safety becomes increasingly important. Control barrier functions (CBFs) provide a theoretically grounded framework for ensuring safety, but existing design methods often face limitations in effectiveness, scalability, or interpretability, and may result in overly conservative safe sets. In this paper, we propose VertexCBF, a framework for learning neural CBFs in a scalable, systematic, and explainable way. We approximate the stationary Hamilton–Jacobi value function using a neural network trained via a combination of physics-informed and sparsely supervised learning. By exploiting control-affine dynamics and a convex polytope control set, under which the Hamiltonian is maximized at the control vertices, we efficiently generate supervision points via GPU-parallel vertex-restricted tree search, while a residual architecture guarantees that the learned CBF is never larger than the specified constraint function. We evaluate the method on 15 systems and compare it against relevant baselines, showing that it reliably recovers large safe sets where the baselines are conservative or fail completely. In addition, we perform a hardware experiment in which a mobile robot safely avoids pedestrians using a neural CBF trained with our method.
Introduction
In recent years, robotics applications have expanded rapidly across many areas of society. Many of these advances are driven by learning-based algorithms and involve direct interaction between autonomous robots and their environments. However, ensuring safe and reliable operation in a systematic and explainable manner remains a key challenge in robot deployment.
One well-established approach is safety filtering, where the nominal control input is modified at runtime to preserve safety [1]. In particular, control barrier functions (CBFs) provide a theoretically grounded and explainable way to design safety filters, and are especially efficient for control-affine systems [2, 3]. Nevertheless, designing CBFs for systems with state and input constraints is notoriously difficult and often results in a compromise between performance and safety [4].
In this paper, we propose VertexCBF, a learning-based framework for constructing neural CBFs that approximate the optimal safe set characterized by Hamilton–Jacobi (HJ) reachability. Specifically, we use a neural approximation of the stationary HJ safety value function as a CBF and train it using a combination of physics-informed and sparsely supervised losses. Following a residual parametrization, the learned function is constrained to be no larger than the specified constraint function, ensuring that learning cannot enlarge the safe set beyond the original state constraint. The key idea is to exploit the standard structure used by CBF-QP filters, namely control-affine dynamics and a convex polytope control set. Under these assumptions, the continuous-time Hamiltonian is maximized at a control vertex. We therefore generate supervision labels by solving finite-horizon optimization problems restricted to control vertices, enabling efficient GPU-parallel tree search while avoiding numerical PDE solvers and sampling-based trajectory optimization.
The main contributions of this paper are summarized as follows:
We introduce a systematic method for learning neural CBFs that approximate the optimal safe set. It is grounded in HJ reachability, combines physics-informed and supervised learning, and exploits control-affine dynamics with polytope input constraints to generate supervision points through highly parallel vertex-restricted optimization.
We evaluate the proposed method on 15 dynamical systems and against relevant baselines. The results show that our approach consistently recovers large and reliable safe sets where the baselines are conservative or fail completely. We further demonstrate the method in a hardware experiment, where a mobile robot safely navigates among pedestrians.
Related Work
Learning-based approaches to safe robot control have attracted considerable attention due to their flexibility and scalability [4, 5]. Particularly relevant are methods that combine machine learning with CBFs and HJ reachability. Early work on learning CBFs used support vector machines [6] and neural networks [7], while more recent approaches employ expressive representations such as Gaussian splats to construct distance-based CBFs [8]. However, these methods often struggle with higher-order systems and limited actuation, where distance-based formulations become inadequate [1]. Extensions that account for control limits [9, 10] improve feasibility but typically yield conservative or suboptimal safe sets.
The maximal safe set can be characterized through HJ reachability, but solving the corresponding PDEs is generally intractable for real-time applications. Methods in [11, 12, 13] learn approximations of the HJ value function but rely on numerically generated training data, which limits scalability. DeepReach [14] improves scalability through self-supervised learning, with further refinements addressing boundary conditions and uncertainty [15, 16]. Nevertheless, these methods rely on carefully designed curriculum training procedures that can be difficult to tune and may exhibit instability.
The method in [17] trains neural CBFs by minimizing a loss derived from the stationary HJB variational inequality (HJB-VI). However, this objective alone admits multiple trivial or suboptimal solutions, leading to poor results for many relevant systems in practice, as we also demonstrate experimentally. This motivates augmenting physics-informed learning with additional supervision to guide optimization toward meaningful solutions.
Our approach combines physics-informed learning with efficiently generated, high-quality supervision by exploiting control-affine dynamics and convex control constraints. The closest work, [18], similarly combines PDE-based and data-driven losses, but targets the general time-dependent HJ reachability problem and relies on full-control sampling-based MPC for supervision, together with pretraining, curriculum training, and iterative refinement. In contrast, we solve the infinite-horizon stationary HJB-VI, eliminating the time variable and the need for curriculum learning, and assume control-affine dynamics with a convex polytope control set. These assumptions replace full-control trajectory optimization with a vertex-restricted tree search, while the residual parameterization makes pretraining unnecessary.
Preliminaries and Problem Formulation
We consider control-affine system dynamics
x˙=ϕ(x,u)=f(x)+g(x)u,(1)
where x∈X⊆Rnx is the system state and u∈U⊂Rnu is the control input. We assume that U is a compact convex polytope, with the set of control vertices denoted by V=vert(U). The system is required to remain within the constraint set C={x:c(x)≥0}, where c:X→R is a continuous constraint function.
Given the initial time t=0, the infinite-horizon safety value function V:X→R is defined as
V(x)=u(⋅)∈Usupt≥0infc(x(t)),(2)
where x(0)=x and x(t) evolves according to (30). The value V(x) is the largest worst-case constraint value that can be maintained from x, and the set S={x:V(x)≥0} is the maximal controlled invariant subset of C, termed the maximal safe set1[19, 20]. We assume throughout the paper that the supremum in (2) is finite for every x∈X, so that V is well defined. This holds in all our experiments, since U is compact and c is bounded on X.
A common approach to enforcing safety is through CBFs. A continuously differentiable function h:X→R is a CBF if there exists an extended class-K function α such that, for all x∈X,
u∈Usup∇h(x)Tϕ(x,u)+α(h(x))≥0.(3)
For an arbitrary nominal control unom, the safe control u∗ is obtained by solving the following quadratic program (QP):
where Lf and Lg are the Lie derivatives of h with respect to f and g, respectively [2]. If the QP is feasible, by Nagumo’s theorem [21] this CBF-QP safety filter renders the set Sh={x:h(x)≥0} forward invariant. The central problem of this paper is to establish a systematic method for designing a CBF h such that Sh≈S. In the next section, we describe the proposed method.
Methodology
VertexCBF aims to design a CBF whose resulting safe set coincides with the maximal safe set S. Similar to [11, 12, 13], we use a neural approximation VΘ of the safety value function (2) as a CBF, i.e., h=VΘ. The model parameters Θ are trained by combining a PDE-based loss with sparse supervision, as in [18]. In contrast to that work, our approach exploits the assumptions on the system dynamics and control set to obtain more effective supervision.
The safety value function (2) is a solution of the stationary HJB-VI [17] and necessarily satisfies
min{c(x)−V(x),H(x,∇V(x))}=0,(5)
where the Hamiltonian is
H(x,p)=u∈UmaxpTϕ(x,u)=pTf(x)+u∈UmaxpTg(x)u.(6)
Since the second term is linear in u and U is a compact convex polytope, the maximum is attained at a vertex v∈V. Therefore, we can rewrite the stationary HJB-VI as
min{c(x)−V(x),u∈Vmax∇V(x)Tϕ(x,u)}=0.(7)
This variational inequality could be used as a PDE loss and optimized as a single self-supervised objective when training a neural approximation VΘ(x), similar to [17]. However, (7) generally does not have a unique solution. In fact, any constant value function V(x)=a such that a≤c(x) for all x∈X satisfies the stationary HJB-VI. Moreover, gradient-based optimization of the model parameters is prone to local optima, further undermining training performance. An effective alternative is to generate a (potentially sparse) dataset of state-value pairs and add a supervised loss term that guides training toward the true optimal solution. Nevertheless, generating such a dataset with existing methods is often ineffective without a strong nominal policy.
Time Discretization of the Vertex-Restricted Problem
The restriction to control vertices is already made in continuous time in (7), and we now discretize that problem in time. For a time step Δt>0, we define the forward-Euler dynamics map
xk+1=F(xk,uk)=xk+Δtϕ(xk,uk).(8)
Applying this map to the vertex-restricted problem, we define the discrete-time safety value function VΔt:X→R as
VΔt(x)={ui}i=0∞∈Vsupk≥0infc(xk),(9)
where x0=x. This is the infinite-horizon safety value function of the Euler-discretized system with input sequences restricted to the control vertices. It satisfies the Bellman equation
VΔt(x)=min{c(x),u∈VmaxVΔt(F(x,u))}.(10)
The order of these two steps is important. We do not restrict a full-control discrete-time Bellman operator to V, which would not be exact, because u↦VΔt(F(x,u)) is nonlinear in u. We instead restrict the continuous-time Hamiltonian, where the maximization is linear in the control, and only then apply the forward-Euler map. Therefore, VΔt approximates the vertex-restricted continuous-time problem, not the full-control discrete-time value function. Wherever V is differentiable, an optimal control can be chosen from V, and such value functions are differentiable almost everywhere. (10) is exact for Euler-discretized vertex-restricted system, but it is not the Bellman equation of the full-control discrete-time system and only approximates the original continuous-time problem.
The discrete-time solution is not guaranteed to be obtained from (10) by standard value iteration, because the Bellman operator is not a contraction and the usual contraction-based convergence guarantees therefore do not apply. [22, 23] One possible remedy is to introduce a discounted value function, as in [24, 22], and gradually increase the discount factor to recover the optimal solution. Restricting the inner maximization to control vertices is an additional constraint and may yield a suboptimal solution for the discretized system. Our primary objective, however, is to approximate the safety values of the continuous-time system, and we reformulate (10) as
where the second term is a finite-difference approximation of the Hamiltonian in (5). In Appendix A, we show that the vertex-restricted Euler Bellman operator (10) is a first-order consistent local approximation of the continuous-time HJB-VI.
Finite-Horizon Search over Vertex-Restricted Controls
Obtaining the infinite-horizon vertex-restricted value VΔt may still be impractical for many systems of interest. Moreover, we compute each label independently over a sparsely sampled set of states, so that it does not depend on values at other states, unlike grid-based numerical methods. We therefore consider the finite-horizon approximation
VΔtK(x)=u0,…,uK−1∈Vmax0≤k≤Kminc(xk),(12)
where x0=x and K is the horizon length. Since inputs are restricted to control vertices, the search space is reduced to a typically small set of control vectors. Instead of gradient-based or sampling-based optimization, we can therefore perform a tree search over the finite-horizon trajectories. If M=∣V∣ denotes the number of control vertices, the branching factor is M and the tree depth is K, resulting in MK possible trajectories. For low-dimensional systems, a full tree search finds the optimal solution exactly. However, when M or K is large, we use approximate tree-search variants such as beam search, stochastic beam search, or branch-and-bound, summarized in Appendix B.
A non-complete search introduces an additional approximation by evaluating only a subset of the full tree. Let VΔtK,B(x) denote the value returned by a tree-search method with beam width B, as described in Appendix B. Since beam search optimizes over a subset of all vertex-control sequences,
VΔtK,B(x)≤VΔtK(x),(13)
with equality if the retained beam contains an optimal sequence. Width-limited labels are therefore lower bounds on the full vertex-restricted search. This is the conservative direction, because a lower label can only shrink the safe set. The influence of beam-search hyperparameters is analyzed in Appendix C. The total discrepancy between the generated label and the continuous infinite-horizon safety value can therefore be decomposed conceptually as
The first term collects the error of the forward-Euler discretization and the error of holding one vertex control over each interval of length Δt, and a smaller Δt reduces both (Appendix D). The second term is caused by truncating the horizon after K steps. It vanishes under the assumption that an optimal sequence of Eq. (12) can be extended by further vertex controls that keep c(xk)≥VΔtK(x) for all k>K, so that the safety level attained within the horizon is maintained forever. Such a continuation gives VΔt(x)≥VΔtK(x), while the opposite inequality always holds. The assumption is plausible when the horizon is long enough to reach a region where the attained safety level can be maintained. It fails for a short horizon, where the label overestimates the true value. The third term vanishes under a complete tree search, and in practice we reduce it with stochastic beam search or branch-and-bound.
Scope of the vertex restriction. Restricting the search to vertices does not by itself improve the finite-horizon optimum, since Eq. (12) is a constrained version of the same problem over the full control set. The benefit is effectiveness under a finite computational budget. An optimal continuous-time control can be chosen from V at almost every state, so the tree search operates on a small set that already contains these controls. A sampling-based method such as MPPI instead allocates much of its budget to interior controls that are rarely optimal. This relies on control-affine dynamics, a polytope control set, and a sufficiently small Δt. The approximation can become conservative or suboptimal for a large Δt, for a short horizon K, or for a small beam width B when M or K is large. We therefore do not claim that vertex-restricted search always outperforms full-control optimization.
Model Architecture and Training Procedure
Following [[17], [11], [13]], we do not approximate the value function directly, but instead approximate its non-negative residual rΘ with respect to the constraint function:
VΘ(x)=c(x)−rΘ(x),rΘ(x)≥0,∀x∈X.(15)
Since VΘ(x)≤c(x), the learned safe set S^={x:VΘ(x)≥0} is always contained in the constraint set C. Moreover, this parametrization makes trivial constant solutions less natural, because a constant VΘ(x)=a would require rΘ(x)=c(x)−a rather than a constant network output.
References
[1]K.-C. Hsu, H. Hu, and J. F. Fisac. The Safety Filter: A Unified View of Safety-Critical Control in Autonomous Systems. Annual Review of Control, Robotics, and Autonomous Systems, 7 (Volume 7, 2024):47–72, 2024. doi:10.1146/annurev-control-071723-102940.DOI
[2]A. D. Ames, J. W. Grizzle, and P. Tabuada. Control barrier function based quadratic programs with application to adaptive cruise control. In IEEE Conference on Decision and Control (CDC), pages 6271–6278, 2014. doi:10.1109/CDC.2014.7040372.DOI
[3]A. D. Ames, S. Coogan, M. Egerstedt, G. Notomista, K. Sreenath, and P. Tabuada. Control Barrier Functions: Theory and Applications. In European Control Conference (ECC), pages 3420–3431, 2019. doi:10.23919/ECC.2019.8796030.DOI
[4]K. P. Wabersich, A. J. Taylor, J. J. Choi, K. Sreenath, C. J. Tomlin, A. D. Ames, and M. N. Zeilinger. Data-Driven Safety Filters: Hamilton-Jacobi Reachability, Control Barrier Functions, and Predictive Methods for Uncertain Systems. IEEE Control Systems, 43(5):137–177, 2023. doi:10.1109/MCS.2023.3291885.DOI
[5]C. Dawson, S. Gao, and C. Fan. Safe Control With Learned Certificates: A Survey of Neural Lyapunov, Barrier, and Contraction Methods for Robotics and Control. IEEE Transactions on Robotics, 39(3):1749–1767, 2023. doi:10.1109/TRO.2022.3232542.DOI
[6]M. Srinivasan, A. Dabholkar, S. Coogan, and P. A. Vela. Synthesis of Control Barrier Functions Using a Supervised Machine Learning Approach. In 2020 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 7139–7145. IEEE, 2020. doi:10.1109/IROS45743.2020.9341190.DOI
[7]K. Long, C. Qian, J. Cortés, and N. Atanasov. Learning Barrier Functions With Memory for Robust Safe Navigation. IEEE Robotics and Automation Letters, 6(3):4931–4938, 2021. doi:10.1109/LRA.2021.3070250.DOI
[8]T. Chen, A. Swann, J. Yu, O. Shorinwa, R. Murai, M. Kennedy, and M. Schwager. A Control Barrier Function for Safe Navigation with Online Gaussian Splatting Maps. In IEEE International Conference on Robotics and Automation (ICRA), pages 11758–11765, 2025. doi:10.1109/ICRA55743.2025.11128723.DOI
[9]S. Liu, C. Liu, and J. Dolan. Safe Control Under Input Limits with Neural Control Barrier Functions. In Conference on Robot Learning (CoRL), 2022.arxiv.org/abs/2211.11056
[10]W. Xiao, T.-H. Wang, R. Hasani, M. Chahine, A. Amini, X. Li, and D. Rus. BarrierNet: Differentiable Control Barrier Functions for Learning of Safe Robot Control. IEEE Transactions on Robotics, 39(3):2289–2307, 2023. doi:10.1109/TRO.2023.3249564.DOI
[11]B. Derajić, S. Bernhard, and W. Hönig. ORN-CBF: Learning Observation-conditioned Residual Neural Control Barrier Functions via Hypernetworks, 2025. arXiv:2509.16614 [cs].arxiv.org/abs/2509.16614
[12]A. Lin, S. Peng, and S. Bansal. One Filter to Deploy Them All: Robust Safety for Quadrupedal Navigation in Unknown Environments. IEEE Transactions on Robotics, 42:545–560, 2026. doi:10.1109/TRO.2025.3644957.DOI
[13]B. Derajić, S. Bernhard, and W. Hönig. CN-CBF: Composite Neural Control Barrier Function for Safe Robot Navigation in Dynamic Environments, 2026. arXiv:2603.06921 [cs].arxiv.org/abs/2603.06921
[14]S. Bansal and C. J. Tomlin. DeepReach: A Deep Learning Approach to High-Dimensional Reachability. In IEEE International Conference on Robotics and Automation (ICRA), pages 1817–1824, 2021. doi:10.1109/ICRA48506.2021.9561949.DOI
[15]A. Singh, Z. Feng, and S. Bansal. Exact Imposition of Safety Boundary Conditions in Neural Reachable Tubes. In 2025 IEEE International Conference on Robotics and Automation (ICRA), pages 5489–5495, 2025. doi:10.1109/ICRA55743.2025.11127972.DOI
[16]A. Lin and S. Bansal. Verification of neural reachable tubes via scenario optimization and conformal prediction. In Proceedings of the 6th Annual Learning for Dynamics & Control Conference, pages 719–731. PMLR, 2024.arxiv.org/abs/2312.08604
[17]L. Manda, S. Chen, and M. Fazlyab. Learning Performance-oriented Control Barrier Functions Under Complex Safety Constraints and Limited Actuation. In Proceedings of The 8th Conference on Robot Learning, pages 4793–4804. PMLR, 2025.
[18]Z. Feng, L. Qiu, and S. Bansal. Bridging Model Predictive Control and Deep Learning for Scalable Reachability Analysis. In Proceedings of Robotics: Science and Systems, volume 21, 2025. ISBN 979-8-9902848-1-4.
[19]S. Bansal, M. Chen, S. Herbert, and C. J. Tomlin. Hamilton-Jacobi reachability: A brief overview and recent advances. In IEEE Conference on Decision and Control (CDC), pages 2242–2253, 2017. doi:10.1109/CDC.2017.8263977.DOI
[20]K.-C. Hsu, V. Rubies-Royo, C. Tomlin, and J. Fisac. Safety and Liveness Guarantees through Reach-Avoid Reinforcement Learning. In Robotics: Science and Systems XVII. Robotics: Science and Systems Foundation, 2021. ISBN 978-0-9923747-7-8. doi:10.15607/RSS.2021.XVII.077.DOI
[21]M. Nagumo. Über die Lage der Integralkurven gewöhnlicher Differentialgleichungen. Proceedings of the Physico-Mathematical Society of Japan. 3rd Series, 24:551–559, 1942. doi:10.11429/ppmsj1919.24.0_551.DOI
[22]J. F. Fisac, N. F. Lugovoy, V. Rubies-Royo, S. Ghosh, and C. J. Tomlin. Bridging Hamilton-Jacobi Safety Analysis and Reinforcement Learning. In 2019 International Conference on Robotics and Automation (ICRA), pages 8550–8556, 2019. doi:10.1109/ICRA.2019.8794107.DOI
[23]O. So, Z. Serlin, M. Mann, J. Gonzales, K. Rutledge, N. Roy, and C. Fan. How to Train Your Neural Control Barrier Function: Learning Safety Filters for Complex Input-Constrained Systems. In IEEE International Conference on Robotics and Automation (ICRA), pages 11532–11539, 2024. doi:10.1109/ICRA57147.2024.10610418.DOI
[24]A. K. Akametal, S. Ghosh, J. F. Fisac, V. Rubies-Royo, and C. J. Tomlin. A Minimum Discounted Reward Hamilton–Jacobi Formulation for Computing Reachable Sets. IEEE Transactions on Automatic Control, 69(2):1097–1103, 2024. doi:10.1109/TAC.2023.3327159.
[25]V. Sitzmann, J. Martel, A. Bergman, D. Lindell, and G. Wetzstein. Implicit Neural Representations with Periodic Activation Functions. In Advances in Neural Information Processing Systems, volume 33, pages 7462–7473. Curran Associates, Inc., 2020.arxiv.org/abs/2006.09661
[26]S. J. Russell and P. Norvig. Artificial Intelligence: A Modern Approach. Prentice Hall Series in Artificial Intelligence. Pearson, 3rd edition, 2016. ISBN 978-0-13-604259-4.
[27]W. Kool, H. V. Hoof, and M. Welling. Stochastic Beams and Where To Find Them: The Gumbel-Top-k Trick for Sampling Sequences Without Replacement. In Proceedings of the 36th International Conference on Machine Learning (ICML), pages 3499–3508. PMLR, 2019.arxiv.org/abs/1903.06059
[28]A. H. Land and A. G. Doig. An Automatic Method of Solving Discrete Programming Problems. Econometrica, 28(3):497, 1960. doi:10.2307/1910129.DOI