Conference on Robot Learning (CoRL) 2026

VertexCBF: Improving Neural Control Barrier Functions via Vertex-Restricted Control Search

1Technical University of Berlin    2Technical University of Applied Sciences Augsburg    3Robotics Institute Germany

Learned neural CBFs for the inverted pendulum under three supervision schemes
Neural CBFs for the inverted pendulum. PDE-only training collapses to a trivial constant with an empty safe set; supervision from full-control MPPI (FCD) is overly conservative; vertex-restricted data (VRCD, ours) recovers the maximal safe set almost exactly.

Abstract

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.

Method

We consider control-affine dynamics \(\dot x = f(x) + g(x)u\) with a compact convex polytope control set \(\mathcal U\) and a constraint set \(\mathcal C = \{x : c(x) \ge 0\}\). The Hamilton–Jacobi safety value function

\[ V(x) = \sup_{u(\cdot)\,\in\,\mathcal U}\ \inf_{t\,\ge\,0}\ c\bigl(x(t)\bigr) \]

characterises the maximal safe set \(\mathcal S = \{x : V(x) \ge 0\}\), the largest controlled invariant subset of \(\mathcal C\). We learn a neural approximation \(V_\Theta\) and use it directly as a CBF in a QP safety filter, so that the certified set \(\mathcal S_h\) is as close as possible to \(\mathcal S\).

Key idea: the Hamiltonian is maximised at a control vertex

The Hamiltonian is linear in the control. Over a convex polytope the maximum is therefore attained at a vertex:

\[ H(x,p) = p^\top\! f(x) + \max_{u\,\in\,\mathcal V} p^\top\! g(x)\,u, \qquad \mathcal V = \operatorname{vert}(\mathcal U) \]

So the search for optimal controls can be restricted to the finite set \(\mathcal V\), instead of optimising over all of \(\mathcal U\).

A linear objective over a polytope is maximised at a vertex
The maximiser of a linear objective over the polytope \(\mathcal U\) always lies at a vertex.
Vertex-restricted beam search over the control tree
Supervision labels come from a GPU-parallel beam search over the tree of vertex control sequences.

A CBF that cannot exceed the constraint set

We train \(V_\Theta\) on the stationary HJB variational inequality, evaluating the maximisation exactly over the finite vertex set,

\[ \min\Bigl\{\, c(x) - V(x),\ \ \max_{u\,\in\,\mathcal V} \nabla V(x)^\top\!\phi(x,u) \,\Bigr\} = 0, \]

and parametrise the network as a non-negative residual of the constraint function, \(V_\Theta(x) = c(x) - r_\Theta(x)\) with \(r_\Theta \ge 0\). The learned safe set is therefore contained in \(\mathcal C\) by construction, and the constant solutions that make the PDE objective degenerate become unnatural for the network to express — which is why no pretraining and no curriculum schedule are needed.

Supervision from a vertex-restricted tree search

Labels are the value of a finite-horizon search over vertex control sequences,

\[ V^{K}_{\Delta t}(x) = \max_{u_0,\dots,u_{K-1}\,\in\,\mathcal V}\ \ \min_{0\,\le\,k\,\le\,K}\ c(x_k), \]

where the states follow the forward-Euler map \(x_{k+1} = x_k + \Delta t\,\phi(x_k, u_k)\).

  • The tree has branching factor \(M = |\mathcal V|\) and depth \(K\). Beam search, stochastic beam search and branch & bound keep the best \(B\) partial trajectories, scored by the running minimum of \(c\).
  • Everything is batched on the GPU across initial states, beam entries and vertices — cost \(\mathcal O(NKBM)\), with no PDE solver and no sampling-based trajectory optimisation.
  • A width-limited search returns a lower bound on the full vertex-restricted value, so the label error is in the conservative direction.

Training objective

\[ \mathcal L(\Theta) = \lambda\,\mathcal L_{\mathrm{PDE}}(\Theta) + (1-\lambda)\,\mathcal L_{\mathrm{data}}(\Theta) \]

\(\mathcal L_{\mathrm{PDE}}\) penalises pointwise violations of the HJB-VI on densely sampled unlabelled collocation states, while \(\mathcal L_{\mathrm{data}}\) regresses onto the search labels at a sparse set of states, steering the optimisation away from the spurious minima that the physics-informed objective admits on its own. The residual \(r_\Theta\) is a sinusoidal-activation MLP with a softplus output; periodic states enter as \((\cos\theta, \sin\theta)\).

Results

Where the supervision comes from

Finite-horizon trajectories from full-control MPPI and vertex-restricted beam search
Finite-horizon trajectories for the inverted pendulum from the same 160 random initial states, coloured by the worst constraint value reached along the trajectory. Full-control MPPI spends most of its budget on interior controls that are rarely optimal and keeps the system safe from only a few states; vertex-restricted beam search succeeds from every sampled state of the true safe set.

Validation protocol

Because there are no formal convergence guarantees, every learned CBF is validated by large-scale closed-loop rollouts from stratified initial states, under the Hamiltonian-maximising policy. We report three complementary metrics:

  • \(\rho_{\mathrm{FS}}\) — false-safe rate: the fraction of states in the predicted safe set whose rollout leaves \(\mathcal C\). Is the certificate trustworthy?
  • \(\rho_{\mathrm{FU}}\) — false-unsafe rate: the fraction of states outside the predicted safe set whose rollout stays safe. How conservative is it?
  • \(\eta_{\mathrm{eff}} = \frac{\mathrm{vol}(\hat{\mathcal S})}{\mathrm{vol}(\mathcal X)} (1-\rho_{\mathrm{FS}})\) — effective safe volume: the share of the state space that is both predicted and validated safe.

A good method has small \(\rho_{\mathrm{FS}}\) and large \(\eta_{\mathrm{eff}}\). We compare three supervision schemes that share the same architecture, hyperparameters and validation protocol, and differ only in the training labels: ND (no data, PDE loss only), FCD (full-control data from MPPI) and VRCD (vertex-restricted control data, ours).

System (nx, nu) ρFS (%) ↓ρFU (%) ↓ηeff ↑
NDFCDVRCDNDFCDVRCDNDFCDVRCD
Inverted Pendulum (2, 1)100.000.00±0.000.00±0.000.00±0.0015.96±0.531.11±0.300.00±0.000.08±0.000.22±0.00
1D Double Integrator (2, 1)0.00±0.000.00±0.000.00±0.000.95±0.564.01±0.421.18±0.310.41±0.000.39±0.000.41±0.00
2D Vertical Drone (2, 1)36.80±5.39—0.00±0.004.73±6.814.72±6.811.88±0.460.35±0.200.00±0.000.58±0.01
Dubins Car (3, 1)0.06±0.040.01±0.010.04±0.014.75±1.284.33±0.312.25±0.280.92±0.000.92±0.000.93±0.00
2D Double Integrator (4, 2)0.03±0.010.00±0.000.03±0.014.68±0.256.84±0.303.42±0.220.93±0.000.92±0.000.93±0.00
Kinematic Bicycle (4, 2)4.68±0.910.52±0.381.16±0.5115.49±1.073.16±0.245.03±0.150.86±0.010.91±0.000.91±0.00
Cart-Pole (4, 1)88.14±8.15—0.16±0.190.65±0.484.06±2.462.64±0.340.06±0.040.00±0.000.32±0.00
Dynamic Unicycle (5, 2)4.17±0.890.09±0.090.23±0.262.93±0.385.50±0.426.49±0.440.90±0.010.93±0.000.93±0.00
Relative Unicycle (5, 2)6.06±0.100.26±0.510.16±0.024.49±0.3337.07±3.492.35±0.130.87±0.000.87±0.010.93±0.00
3D Double Integrator (6, 3)0.01±0.000.00±0.000.00±0.009.12±0.3711.20±0.4310.60±0.270.97±0.000.97±0.000.97±0.00
3-DOF Manipulator (6, 3)13.52±12.090.55±0.360.43±0.493.69±0.786.74±0.165.68±0.120.58±0.080.65±0.000.66±0.00
Landing Rocket (7, 2)76.45±14.6856.41±13.541.17±0.780.13±0.072.95±0.915.95±0.200.09±0.060.02±0.010.24±0.00
Quadruped Trunk (9, 4)99.98±0.05—0.07±0.090.00±0.000.00±0.003.14±0.110.00±0.000.00±0.000.07±0.00
6-DoF Underw. Vehicle (12, 6)22.24±0.930.61±0.071.00±0.250.80±0.145.15±0.062.27±0.090.33±0.000.34±0.000.36±0.00
Quadrotor (13, 4)5.75±0.201.21±0.081.07±0.1211.18±0.359.50±0.4210.10±0.420.88±0.000.91±0.000.91±0.00

CBF validation results, mean ± standard deviation over five seeds. ND = PDE loss only, FCD = full-control (MPPI) supervision, VRCD = vertex-restricted supervision (ours). Best value per metric in bold. A dash marks systems whose predicted safe set is empty for every seed; a missing standard deviation means ρFS is defined for a single seed only.

Comparison with the ground truth

For the seven systems with at most four states, a reference value function can be computed on a state-space grid. VertexCBF reaches the highest intersection over union on five of them and stays within 0.3 percentage points of the best value on the other two.

SystemNDFCDVRCD (ours)
Inverted Pendulum1.54±3.0733.53±0.6196.39±1.16
1D Double Integrator98.37±0.7294.02±0.4398.10±0.35
2D Vertical Drone64.09±32.050.00±0.0098.48±0.20
Dubins Car99.56±0.1599.66±0.0499.80±0.03
2D Double Integrator99.52±0.0399.39±0.0299.64±0.02
Kinematic Bicycle97.71±0.2499.65±0.0099.59±0.00
Cart-Pole65.07±0.220.00±0.0093.38±0.35

Intersection over union (%) between the predicted and the ground-truth safe set, on the reference grid of every system for which one is available. Mean ± standard deviation over five seeds.

All fifteen systems

Two-dimensional slices of the learned neural CBF for all fifteen systems
Two-dimensional slices of the neural CBFs learned with VertexCBF, from a 2-state inverted pendulum to a 13-state quadrotor. Dashed blue is the predicted safe set, dash-dotted green the set validated by closed-loop rollouts, and yellow the ground truth where a grid solution is available.

Hardware experiment

A mobile delivery robot navigates from a start to a goal position while pedestrians deliberately intercept its path. An MPC planner provides the nominal control, and a CBF-QP filter — using the learned relative-unicycle CBF together with live pedestrian tracks — modifies it to stay safe. All perception, localisation and optimisation run on the onboard computer. The robot avoided a collision in all 10 trials.

Robot and tracked pedestrians, CBF value and control signals
A representative trial: the robot's path and the tracked pedestrians (left), and the CBF value together with nominal and filtered controls (right). The CBF constraint is relaxed by a slack variable, so the QP stays feasible; the brief small negative values come from the mismatch between the ideal unicycle used for training and the real skid-steer platform, and are absorbed by the inflated radii used during training.
Screenshot from the robot's onboard computer
The robot's onboard view: front camera, a 2-D slice of the neural CBF in positional coordinates, and the perception module's tracks.

Poster

VertexCBF conference poster

The CoRL 2026 poster, in A0 landscape.

Code

The reference implementation ships the library, YAML configs for all 15 systems of the paper, training and evaluation scripts, and two tutorial notebooks. The full-control sampling-based baselines (MPPI, CEM, iCEM, random shooting) are included for comparison. A CUDA GPU is strongly recommended for training.

git clone https://github.com/bojan-derajic/vertexcbf.git
cd vertexcbf
pip install -e .

# generate labels, train and validate a CBF for one system
python scripts/train.py --config configs/inverted_pendulum.yaml

# plot a 2-D slice of the learned CBF
python scripts/evaluate.py --config configs/inverted_pendulum.yaml \
    --checkpoint checkpoints/VRC_DATA/inverted_pendulum/final.pt

Supervision labels are selected in the data section of the config: beam_search, stochastic_beam_search and branch_and_bound search the control vertices, while mppi, cem, icem and random_shooting reproduce the full-control baselines. Copy configs/template.yaml to add your own system.

Citation

@inproceedings{derajic2026vertexcbf,
  title     = {{VertexCBF}: Improving Neural Control Barrier Functions
               via Vertex-Restricted Control Search},
  author    = {Deraji{\'c}, Bojan and Bernhard, Sebastian and H{\"o}nig, Wolfgang},
  booktitle = {Conference on Robot Learning (CoRL)},
  year      = {2026}
}

Questions and issues are welcome at github.com/bojan-derajic/vertexcbf/issues, or by email to bojan.derajic@campus.tu-berlin.de.