Enforcing nonlinear inequality constraints in neural networks remains challenging, especially when the output is subject to many coupled constraints. Existing hard constraint methods often impose structural restrictions on the constraint set or introduce substantial computational overhead for large-scale nonlinear problems. Here, we propose DiffSlack, a differentiable projection layer for nonlinear inequality-constrained neural prediction. DiffSlack reformulates inequalities as equalities with learnable slack variables, which are predicted as part of the augmented network output and provide a data-driven warm start for damped Gauss-Newton projection. The projection layer maps raw predictions onto the augmented feasible manifold while preserving end-to-end differentiability. A two-stage curriculum further stabilizes training and improves constraint satisfaction. We evaluate DiffSlack on vehicle path planning with 200 nonlinear inequality constraints from collision avoidance, curvature limits, and waypoint spacing. Compared with existing learning-based baselines, DiffSlack achieves a higher planning success rate and stronger geometric constraint satisfaction under a comparable inference budget. Ablation studies further show that the hard projection layer reduces sensitivity to supervision quality. Closed-loop tracking in CARLA and real-world vehicle experiments confirms the executability of the generated trajectories. These results demonstrate that DiffSlack provides a practical and scalable approach to embedding hard inequality constraints into neural networks for engineering applications.
翻译:在神经网络中强制执行非线性不等式约束仍具挑战性,尤其是当输出受限于大量耦合约束时。现有的硬约束方法通常对约束集施加结构限制,或为大规模非线性问题引入显著计算开销。本文提出DiffSlack——一种面向非线性不等式约束神经预测的可微分投影层。DiffSlack通过可学习松弛变量将不等式转化为等式,该松弛变量作为增广网络输出的一部分进行预测,为阻尼高斯-牛顿投影提供数据驱动的热启动。该投影层在保持端到端可微性的同时,将原始预测映射至增广可行流形。两阶段课程学习进一步稳定训练过程并提升约束满足度。我们在包含避碰、曲率限制与航路点间距的200个非线性不等式约束的车辆路径规划任务中评估DiffSlack。与现有基于学习的基线方法相比,DiffSlack在可比推理预算下实现了更高的规划成功率和更强的几何约束满足度。消融实验表明,硬投影层降低了对监督质量的敏感性。CARLA闭环跟踪与真实车辆实验证实了生成轨迹的可执行性。这些结果表明,DiffSlack为工程应用中向神经网络嵌入硬不等式约束提供了实用且可扩展的方案。