--- license: mit library_name: pytorch pipeline_tag: robotics tags: - robotics - safe-rl - control-barrier-functions - conformal-prediction - formal-verification - autonomous-systems - pytorch --- # 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`). - **Interactive Space Demo**: [Certified-Safe Neural Control Space](https://huggingface.co/spaces/codewithyug/certified-safe-neural-control) - **Paper**: *Certified-Safe Neural Control Under Closed-Loop Distribution Shift* (2026) - **License**: MIT --- ## ๐Ÿ“ฆ 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: ```bash 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: ```python 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 $$\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$) $$s_t = \frac{-(\dot{h}_{\text{real}} - \dot{h}_{\text{model}})}{\hat{\sigma}_t}$$ $$\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 \in \mathcal{U}, \delta \ge 0} \frac{1}{2} \|u - u_{\text{nominal}}\|^2 + p_{\text{relax}} \|\delta\|^2$$ $$\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 $$\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$$ $$\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 ```bibtex @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} } ```