Learning Neural Control Barrier Functions from Expert Demonstrations using Inverse Constraint Learning

1Department of Computer Science and Engineering, Washington University in St. Louis, MO 63130, USA
Accepted to ICRA 2026
Contact: {y.yuxuan, sibai}@wustl.edu
Paper Code (coming soon)
ICL-CBF training framework
The framework for training an ICL-CBF \(B_\theta\), where solid arrows are expert trajectories and dashed arrows are trajectories from a CBF-QP policy with \(\pi_{\mathit{ref}}\) and \(B_\theta\). \(\mathcal{C}\) is the constraint represented by the learned constraint function \(\hat{c}_\phi\). We train \(B_\theta\) on trajectories sampled with \(\pi_{\mathit{ref}}\) and labeled by \(\hat{c}_\phi\), simulate with the filter, update \(\hat{c}_\phi\) from the difference vs. expert trajectories, retrain, and iterate until convergence.

Abstract

Safety is a fundamental requirement for autonomous systems operating in critical domains. Control barrier functions (CBFs) have been used to design safety filters that minimally alter nominal controls for such systems to maintain their safety. Learning neural CBFs has been proposed as a data-driven alternative for their computationally expensive optimization-based synthesis. However, it is often the case that the failure set of states that should be avoided is non-obvious or hard to specify formally, e.g., tailgating in autonomous driving, while a set of expert demonstrations that achieve the task and avoid the failure set is easier to generate. We use ICL to train a constraint function that classifies the states of the system under consideration to safe, i.e., belong to a controlled forward invariant set that is disjoint from the unspecified failure set, and unsafe ones, i.e., belong to the complement of that set. We then use that function to label a new set of simulated trajectories to train our neural CBF. We empirically evaluate our approach in four different environments, demonstrating that it outperforms existing baselines and achieves comparable performance to a neural CBF trained with the same data but annotated with ground-truth safety labels.

Experimental results

We evaluate ICL-CBF against iDBF, ROCBF, and L-CBF (neural CBF trained with ground-truth safety labels) on four scenarios: single integrator, inverted pendulum, Dubins car, and quadrotor. Metrics are collision rate (CR, %, lower is better) and success rate (SR, %, higher is better). ICL-CBF achieves the best CR/SR among methods that do not use ground-truth labels, and is close to L-CBF.

Single-integrator CBFs and constraint

Learned constraint
(a) Learned constraint
ICL-CBF
(b) ICL-CBF
iDBF
(c) iDBF
ROCBF
(d) ROCBF
L-CBF
(e) L-CBF
Ground truth
(f) Ground truth
Values of the learned constraint and neural CBFs in the single-integrator scenario. Black circles mark the obstacle. In (a), the red curve is \(\{\mathrm{x}\mid\hat{c}_\phi(\mathrm{x})=\delta\}\) and blue points are expert states. In (b)–(f), red contours are zero level sets of each (neural) CBF.

Inverted-pendulum trajectories

ICL-CBF trajectories
(a) ICL-CBF
iDBF trajectories
(b) iDBF
ROCBF trajectories
(c) ROCBF
L-CBF trajectories
(d) L-CBF
Neural CBFs with closed-loop trajectories under CBF-QP policies. Red points are initial states, green points (origin) are goals, and red contours are zero level sets. iDBF and ROCBF can reach the goal while entering the failure set; ICL-CBF and L-CBF intervene successfully.

Closed-loop success and collision rates

Task Metric iDBF ROCBF ICL-CBF (ours) L-CBF
Single integrator CR 99.20 0.00 0.00 0.00
SR 0.80 9.80 80.60 86.20
Inverted pendulum CR 2.80 5.00 0.20 0.60
SR 97.20 95.00 99.80 99.40
Dubins car CR 0.00 69.30 1.80 0.30
SR 75.00 6.40 97.60 99.60
Quadrotor CR 65.70 75.00 17.10 1.50
SR 2.80 0.00 77.20 98.00

Bold highlights the best among iDBF / ROCBF / ICL-CBF. L-CBF uses ground-truth labels (upper bound).

Safety labels for inverted pendulum

ICL labels
(a) ICL-CBF
iDBF labels
(b) iDBF
ROCBF labels
(c) ROCBF
L-CBF labels
(d) L-CBF
Training data annotations for the inverted pendulum: red = unsafe, blue = safe; black margins mark the predefined safe set. ICL labels are closest to L-CBF / ground truth.

Sensitivity to \(\delta\)

Sensitivity to delta
Collision and success rates as \(\delta\) varies in the single-integrator and Dubins car scenarios.

Poster

Conference poster

Citation

@misc{yang2025learningneuralcontrolbarrier,
  title={Learning Neural Control Barrier Functions from Expert Demonstrations using Inverse Constraint Learning},
  author={Yuxuan Yang and Hussein Sibai},
  year={2025},
  eprint={2510.21560},
  archivePrefix={arXiv},
  primaryClass={cs.AI},
  url={https://arxiv.org/abs/2510.21560},
}