Certified-Safe Neural Control Under Closed-Loop Distribution Shift

Official model weights and certification framework for Certified-Safe Neural Control Under Closed-Loop Distribution Shift, coupling formally verified Neural Control Barrier Functions (Neural CBFs) with online non-exchangeable adaptive conformal calibration (AdaptNC).


πŸ“¦ Checkpoints Included

Checkpoint File Physical Embodiment State Dim Control Dim Network Architecture Max Frequency Safety Verification
checkpoints/cbf_dubins.pt 4D Mobile Ground Robot (AMR) ℝ⁴ ℝ² MLP [64, 64] Tanh 884 Hz Formally Verified (BaB)
checkpoints/cbf_dubins_production.pt 4D High-Capacity AMR ℝ⁴ ℝ² MLP [128, 128, 64] Tanh 850 Hz Formally Verified (BaB)
checkpoints/cbf_quadrotor.pt 12D SE(3) Quadrotor Drone ℝ¹² ℝ⁴ MLP [64, 64] Tanh 820 Hz Formally Verified (BaB)

πŸš€ Quickstart: 5-Line Usage Snippet

Install dependencies:

pip install torch cvxpy osqp numpy
git clone https://huggingface.co/codewithyug/certified-safe-neural-control
cd certified-safe-neural-control

Run real-time certified safety filtering:

import numpy as np
from src.pipeline import CertifiedSafetyPipeline

# 1. Load pretrained Certified Safety Pipeline
pipeline = CertifiedSafetyPipeline.from_pretrained(
    checkpoint_path="checkpoints/cbf_dubins.pt",
    system_type="dubins",
)

# 2. Filter unsafe nominal control action in real-time (< 2ms)
state = np.array([1.5, 0.0, 0.0, 1.5], dtype=np.float32)   # Heading directly into hazard
u_nominal = np.array([0.0, 1.5], dtype=np.float32)         # Unsafe: zero steering, full throttle

u_safe, info = pipeline.filter_action(state=state, u_nominal=u_nominal)

print("Nominal command:     ", u_nominal)
print("Certified safe action:", u_safe)  # Active avoidance: steers +1.50 rad/s, brakes -2.00 m/s^2
print("Solve time:          ", f"{info['solve_time_ms']:.2f} ms")

πŸ“Š Benchmark Results

Evaluated across non-stationary closed-loop distribution shifts up to $\kappa = 2.0$ (lateral wind gusts, surface friction degradation, unmodeled payload mass shifts):

Method Safety Violation Rate (%) Empirical Safety Coverage (%) Mean Solve Rate (Hz) Min Clearance $h_{\min}$ (m)
Nominal (Unfiltered Policy) 41.82% 58.18% N/A -0.284 (Collision)
Standard CBF-QP (Non-Adaptive) 10.36% 89.64% 892 Hz -0.071 (Collision)
Worst-Case Conservative CBF 0.00% 100.0% 874 Hz +0.412 (Over-conservative)
Proposed Adaptive Conformal CBF 0.00% 99.55% 884 Hz +0.148 (Certified Optimal)

πŸ”¬ Mathematical Formulation

Control-Affine Dynamics

xΛ™=f(x)+g(x)u+w(t)\dot{x} = f(x) + g(x)u + w(t) where $w(t)$ is the unmodeled non-stationary closed-loop distribution shift.

Online Adaptive Conformal Margin ($\gamma_t$)

st=βˆ’(hΛ™realβˆ’hΛ™model)Οƒ^ts_t = \frac{-(\dot{h}_{\text{real}} - \dot{h}_{\text{model}})}{\hat{\sigma}_t} Ξ³t+1=clip⁑(Ξ³t+Ξ·(Ξ±riskβˆ’1{st≀γt}),0,Ξ³max⁑)\gamma_{t+1} = \operatorname{clip}\left(\gamma_t + \eta \left( \alpha_{\text{risk}} - \mathbf{1}_{\{s_t \le \gamma_t\}} \right), 0, \gamma_{\max}\right)

Real-Time Convex Quadratic Program (OSQP)

min⁑u∈U,Ξ΄β‰₯012βˆ₯uβˆ’unominalβˆ₯2+prelaxβˆ₯Ξ΄βˆ₯2\min_{u \in \mathcal{U}, \delta \ge 0} \frac{1}{2} \|u - u_{\text{nominal}}\|^2 + p_{\text{relax}} \|\delta\|^2 s.t.LfhΞΈ(x)+LghΞΈ(x)uβ‰₯βˆ’Ξ±cbf(hΞΈ(x)βˆ’Ξ³t)βˆ’Ξ΄\text{s.t.} \quad L_f h_\theta(x) + L_g h_\theta(x) u \ge -\alpha_{\text{cbf}} (h_\theta(x) - \gamma_t) - \delta

Whole-Body Multi-Link Manipulator Barrier Formulation

βˆ€link k∈{1,2,…,N},hk(q)=min⁑λ∈[0,1]βˆ₯(1βˆ’Ξ»)pA(q)+Ξ»pB(q)βˆ’pobsβˆ₯βˆ’Rsafeβ‰₯0\forall \text{link } k \in \{1, 2, \dots, N\}, \quad h_k(q) = \min_{\lambda \in [0, 1]} \|(1 - \lambda)p_A(q) + \lambda p_B(q) - p_{\text{obs}}\| - R_{\text{safe}} \ge 0 βˆ‡qhk(q)=(pclosest,kβˆ’pobs)Tdk((1βˆ’Ξ»βˆ—)JA(q)+Ξ»βˆ—JB(q))\nabla_q h_k(q) = \frac{(p_{\text{closest}, k} - p_{\text{obs}})^T}{d_k} \left((1 - \lambda^*) J_A(q) + \lambda^* J_B(q)\right) Enforcing link barriers simultaneously guarantees zero physical collisions across the entire rigid body geometry of the robot manipulator under unmodeled load shifts and non-stationary disturbances.


πŸ“œ Citation

@article{certified_safe_neural_control_2026,
  title={Certified-Safe Neural Control Under Closed-Loop Distribution Shift},
  author={Certified Safe AI & Robotics Research Team},
  journal={arXiv preprint},
  year={2026}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Video Preview
loading