ENFORCE-Nonlinear Constrained Learning with Adaptive-depth Neural Projection

Neural networks are increasingly used as surrogate models and decision-support methods in engineering. However, their predictions often fail to satisfy physical, operational, or safety-related constraints.

In ENFORCE, we develop a hard-constrained neural network architecture that embeds nonlinear equality and inequality constraints directly into the prediction pipeline. The framework combines a neural network backbone with an adaptive-depth neural projection module, AdaNP, which iteratively corrects the network output until the constraint residual falls below a prescribed tolerance. This allows the model to produce predictions that are not only accurate, but also feasible with respect to the underlying domain knowledge.

The method supports two main application regimes:

  • Constrained supervised regression: neural networks are trained as surrogate models for engineering systems while respecting known physical or process constraints.
  • Self-supervised parametric optimization: the model learns to map problem parameters directly to feasible optimal solutions.

ENFORCE handles both nonlinear equality and inequality constraints. Inequality constraints are incorporated through a Fischer–Burmeister reformulation. For affine constraints, feasibility can be recovered exactly in a single projection step, while for nonlinear constraints the adaptive projection recovers feasibility up to a user-defined tolerance.

With ENFORCE, we aim to contribute to hybrid neural network models that do not only fit data, but also respect the structure, constraints, and safety requirements of the systems they are meant to represent.

Software

ENFORCE is available as an open-source Python package, including the implementation, tutorial notebooks, benchmark problems, and examples for constrained regression and parametric optimization.

Key Publication

Lastrucci, G., and Schweidtmann, A. M. ENFORCE: Nonlinear Constrained Learning with Adaptive-depth Neural Projection. arXiv preprint, 2025. Paper