# Enforcing Ellipsoidal Constraints in Neural Networks with a Polynomial Safety Layer

arXiv: https://arxiv.org/abs/2611.19366 · HTML: https://mlsanity.com/paper/2611.19366/

## Key facts

- No citing papers in the map yet (data through 24 Nov 2026).
- Builds on 14 of its 26 references that are in the map.
- Submitted 14 Nov 2026.

## Builds on (most cited first, 14 of 14)

- [Differentiable Convex Optimization Layers](https://mlsanity.com/paper/1910.12430/) (2019)
- [Learning by Cheating](https://mlsanity.com/paper/1912.12294/) (2019)
- [Safe Exploration in Continuous Action Spaces](https://mlsanity.com/paper/1801.08757/) (2018)
- [DC3: A learning method for optimization with hard constraints](https://mlsanity.com/paper/2104.12225/) (2021)
- [The Safety Filter: A Unified View of Safety-Critical Control in Autonomous Systems](https://mlsanity.com/paper/2309.05837/) (2023)
- [acados: a modular open-source framework for fast embedded optimal control](https://mlsanity.com/paper/1910.13753/) (2019)
- [From Perception to Decision: A Data-driven Approach to End-to-end Motion Planning for Autonomous Ground Robots](https://mlsanity.com/paper/1609.07910/) (2016)
- [RAYEN: Imposition of Hard Convex Constraints on Neural Networks](https://mlsanity.com/paper/2307.08336/) (2023)
- [Escaping from Zero Gradient: Revisiting Action-Constrained Reinforcement Learning via Frank-Wolfe Policy Optimization](https://mlsanity.com/paper/2102.11055/) (2021)
- [TinyMPC: Model-Predictive Control on Resource-Constrained Microcontrollers](https://mlsanity.com/paper/2310.16985/) (2023)
- [Safe Physics-Informed Machine Learning for Dynamics and Control](https://mlsanity.com/paper/2504.12952/) (2025)
- [Safe Hierarchical Model Predictive Control and Planning for Autonomous Systems](https://mlsanity.com/paper/2203.14269/) (2022)
- [Logic Design of Neural Networks for High-Throughput and Low-Power Applications](https://mlsanity.com/paper/2309.10510/) (2023)
- [A polynomial-based QCQP solver for encrypted optimization](https://mlsanity.com/paper/2510.17294/) (2025)

## Abstract (arXiv)

Often the output of a learned mapping must satisfy prescribed constraints. In the control of autonomous systems, for example, the chosen action must keep the system within a collision-free region. We consider the case in which a proposed output is corrected by projection onto a safety ellipsoid. Computing this projection amounts to solving a quadratically constrained quadratic program (QCQP). We construct a neural-network safety layer by unrolling a feasibility-preserving polynomial penalty iteration. The unrolled structure allows the loss gradient to propagate from the feasible output through the safety layer to the network parameters during training. We show how to choose the layer parameters so that every iterate is feasible and give a computable bound on its distance to the exact projection at any prescribed depth. We illustrate the method by training a LiDAR-based policy to control an unmanned aerial vehicle. A privileged model predictive control expert uses the map and the measured vehicle state to generate the training data. In the simulated narrow mazes, the filtered policy avoided wall contact at every tested stage of training, including at initialization, when every unfiltered flight hit a wall. A representative build of the learned policy and its safety layer for an Arm Cortex-M4F microcontroller occupies about 36 KiB of flash, with a RAM budget below 5 KiB.
