Abstract
Deep neural networks (DNNs) have become indispensable in robotics and control, yet they often fail to respect fundamental physical laws or natural constraints. This lack of inherent physical understanding is particularly problematic in safety-critical domains like autonomous driving or medical device control. We present a neurosymbolic framework that ensures guaranteed conformance to established constraints by wrapping DNNs in a symbolic safety layer. Our approach partitions the state space into disjoint regions and uses a reference model to compute valid output bounds. We demonstrate that this method achieves orders-of-magnitude improvements in constraint satisfaction across diverse applications—including autonomous vehicle dynamics, drone stability, and artificial pancreas control—without significant loss in predictive accuracy.
Introduction
In modern control systems, data-driven models are frequently used to approximate complex dynamical systems. While DNNs excel at capturing patterns from high-dimensional data, they are prone to making "unphysical" predictions. For instance, a model trained on vehicle trajectories might predict lateral drift for a car at rest with zero throttle, violating basic Newtonian mechanics.
Existing techniques, such as Physics-Informed Neural Networks (PINNs), attempt to mitigate this by adding penalty terms to the loss function. However, these methods provide soft constraints rather than hard guarantees and often fail to generalize when the system encounters out-of-distribution states. We address this by proposing a neurosymbolic pipeline that provides a symbolic wrapper for guaranteed conformance, even when the underlying physical model is a black-box simulator.
Methodology: The Neurosymbolic Wrapper
Our framework transforms a standard neural network into a constrained dynamics model through a three-step process:
1. State-Space Partitioning
To manage the complexity of the input space, we use a Growing Neural Gas (GNG) algorithm. This unsupervised learning technique distills the training dataset into a set of representative "memories." These memories serve as centroids for a Voronoi tessellation, partitioning the state space into disjoint polyhedral regions.
2. Symbolic Interval Estimation
For each partitioned region, we utilize a reference model $M$—which encodes the natural laws or constraints—to estimate a valid range of outputs. This reference model does not need to be differentiable; it can be a black-box simulator. By sampling $M$ within each polyhedron, we establish symbolic bounds that the neural network's output must respect.
3. The Constraining Operator
Finally, we implement a symbolic wrapper $\Gamma$ around the neural network $f_\theta$. This operator acts as a projection: if the DNN predicts a value outside the pre-calculated valid interval for its current region, the wrapper "clips" the output back to the nearest valid bound. This ensures that the final output is conformant by construction.
Experimental Evaluation
We evaluated our approach on three high-fidelity simulation environments representing distinct safety-critical challenges:
- Autonomous Driving (CARLA): Modeling vehicle dynamics while enforcing "unicycle model" constraints to prevent drift at rest.
- Artificial Pancreas (UVA/Padova): A physiological simulator for Type-1 diabetes where the model must respect "delta-monotonicity" (ensuring insulin delivery correctly correlates with blood glucose reduction).
- Quadrotor Control (PyBullet): Enforcing quadrotor dynamics to maintain stability in hover states.
Key Results and Discussion
Our neurosymbolic models demonstrated a transformative improvement in constraint satisfaction, outperforming vanilla DNNs and standard Augmented Lagrangian methods by three to six orders of magnitude.
In the CARLA vehicle experiments, the importance of hard constraints became clear. While vanilla models predicted significant drift over time when the vehicle was at rest, our constrained model correctly predicted zero movement. Furthermore, the accuracy-conformance trade-off is manageable; we proved theoretically that the approximation error is bounded and can be reduced by increasing the number of state-space partitions (memories).
In the medical application, the constrained model almost perfectly respected the delta-monotonicity property, with a maximum violation of only 0.1775 compared to 3.8356 for the vanilla model. This level of reliability is essential for preventing dangerous insulin dosing recommendations based on erroneous glucose predictions.
Conclusion
By combining the predictive power of deep learning with the rigorous guarantees of symbolic wrappers, we provide a path toward safer autonomous systems. Our framework is data-efficient, compatible with black-box simulators, and provides hard guarantees that are often missing in purely connectionist approaches. Future work will explore adapting these wrappers dynamically during active reinforcement learning to handle evolving environmental constraints.
Summary updated