Guaranteeing Conservation of Integrals with Projection in Physics-Informed Neural Networks
Anthony Baez, Wang Zhang, Ziwen Ma, Lam Nguyen, Subhro Das, Luca Daniel · 2025
Read Guaranteeing Conservation of Integrals with Projection in Physics-Informed Neural Networks by Anthony Baez, Wang Zhang, Ziwen Ma, Lam Nguyen, Subhro Das, Luca Daniel (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2511-09048.txt.
Introduction
Anthony Baez and five co-authors bolt a hard guarantee onto physics-informed neural networks, the models that learn solutions of differential equations by penalizing law-breaking softly. Soft penalties bend during training, so a trained network can quietly violate conservation laws even while fitting the equation well.
A projection step, derived by solving constrained nonlinear optimization problems, forces the network's solution to conserve linear and quadratic integral quantities exactly, separately or jointly. The projected network cuts conservation error by three to four orders of magnitude compared with the soft constraint and slightly improves the solution error itself. Evidence suggests the projection also smooths the loss landscape, helping training converge. The authors frame the method as a general recipe for guaranteeing any conserved integral in these networks whenever a tractable projection exists.
Catalog record
| CREATOR | Anthony Baez, Wang Zhang, Ziwen Ma, Lam Nguyen, Subhro Das, Luca Daniel |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 44 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2511-09048
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Guaranteeing Conservation of Integrals with Projection in Physics-Informed Neural Networks Anthony Baez, Wang Zhang, Ziwen Ma, Lam Nguyen, Subhro Das, Luca Daniel Abstract We propose a novel projection method that guarantees the conservation of integral quantities in Physics-Informed Neural Networks (PINNs) 11 . While the soft constraint that PINNs use to enforce the structure of partial differential equations (PDEs) enables necessary flexibility during training, it also permits the discovered solution to violate physical laws. To address this, we introduce a projection method that guarantees the conservation of the linear and quadratic integrals, both separately and jointly. We derived the projection formulae by solving constrained non-linear optimization problems and found that our PINN modified with the projection, which we call PINN-Proj, reduced the error in the conservation of these quantities by three to four orders of magnitude compared to the soft constraint and marginally reduced the PDE solution error. We also found evidence that the projection improved convergence through improving the conditioning of the loss landscape. Our method holds promise as a general framework to guarantee the conservation of any integral quantity in a PINN if a tractable solution exists. 1 1 1 Code can be found at: github.com/antbaez9/pinn-proj 1 Introduction Recently, neural network-based approaches have emerged as powerful methods to solve and model PDEs. Among these are Physics-Informed Neural Networks (PINNs) 11 , which can parameterize the solution of a partial differential equation (PDE) with little to no training data and without requiring a mesh. The loss function of the PINN is used to enforce the structure of the PDE and the initial and boundary conditions. This creates a soft constraint on the physics equation, where the PINN is penalized for predictions that deviate from it. The soft constraint allows flexibility during training so that the PINN learns a solution that fits both the training data and the governing PDE. This soft constraint, however, permits the solution learned by the PINN to violate conservation laws, which are fundamental principles of physics. If PINNs learned solutions that exactly obeyed conservation laws, they would be more physically accurate and more trustworthy when applied to model real-world physical systems. We cannot, however, exactly enforce conservation laws using another soft constraint, as it could still be violated in a valid solution. Instead, we must impose a hard constraint that ensures that the PINN always obeys the laws of conservation regardless of the nature of the data. The conservation laws that we focus on are in the form of integral quantities that must remain constant or evolve according to changes in the solution domain. In this work, we propose a novel framework that can guarantee the conservation of some integral quantity by projecting the solution prediction of the PINN into a functional space where conservation is not violated. The projection can be found by solving a constrained non-linear optimization problem where we minimize the distance between the solution and the hyperplane where the integral is conserved. We use Lagrange multipliers to find the unique solution to this problem. Given that a projection that is differentiable and tractable in training is found, it will ensure conservation exactly. We demonstrate that this projection method guarantees global conservation of the linear and quadratic integral, both separately and at the same time and on both conserved and non-conserved systems and both one-dimensional and two-dimensional systems. We define guarantee as ensuring that the only sources of error are from the data and machine precision and not from the method. We refer to our PINN model modified with the projection method as PINN-Proj. We compare its performance to an unmodified PINN and a PINN model modified with a soft constraint on the conservation of the same quantity or quantities, referred to as PINN-SC. The models were trained on small subsets of PDE solutions and evaluated on the error of their PDE solution predictions u and the conservation of the chosen integral quantity. We refer to these integral quantities as conserved quantities c . Our main contributions in this paper are as follows: • We propose a novel projection method and show that it guarantees the conservation of the linear integral, quadratic integral, and both simultaneously • We derive the projections for our conserved quantities by solving non-linear constrained optimization problems • We show that PINN-Proj successfully guarantees the conservation of the integral quantities while marginally improving the accuracy of the PDE solution • We analyze the convergence and loss landscape of PINN and PINN-Proj using spectral analysis of the Hessian of the loss 2 Related Work Soft Constraints on PINNs A soft constraint can be used to enforce the conservation law in a PINN by adding a loss term that penalizes the difference between the conserved quantity in the current prediction and the ground truth. Training can either be done entirely with this modified loss function 4 , or in two stages where the modified loss function is used in a second stage of training 7 . Creating soft constraints in this way can also be used to enforce conservation of flux between two neighboring discrete subdomains 6 . Hard Constraints on PINNs Hard constraints have been used in PINNs to strictly enforce initial and boundary conditions 14 . This was done by modifying the PINN solution with a distance function that vanishes at the boundaries and a specific solution that automatically satisfies the boundary and initial conditions. KKT-hPINN uses KKT conditions, which describe optimality conditions in constrained optimization, to create an untrainable projection on the output of a PINN that conserves a desired quantity, but is limited to linear constraints due to relying on the closed-form analytical solution of a linear system to create the projection 2 . Projection on the output of a PINN has also been used to guarantee conservation by applying multiple Newton iterations after each training step to move the solution back into the conservation manifold 1 . This projection method, however, relies on making iterative soft updates on the PINN output and does not incorporate the conservation constraint directly as a differentiable layer into the PINN. Numerical error values are also not reported, so it is difficult to quantify the performance of this hard constraint. Exactly Learning Conservation Laws Conservation laws can be directly incorporated into the structure of neural networks to create hard constraints as well. The Hamiltonian 5 or Lagrangian 3 , which describe how total energy is conserved in a system, can be parametrized by a neural network so that its quantities are always conserved in any solution it learns. Similarly, hard constraints can also be created by construction in a neural network on conservation laws by parameterizing a divergence-free vector field that corresponds to the continuity equation 13 . Due to the divergence-free assumption, however, these neural conservation laws are limited to forms of conserved systems, whereas PINNs can solve and model non-conservative systems that have sources, sinks, or boundary flux. PINNs are also not limited to PDEs that are forms of the continuity equation. Enforcing conservation using the continuity equation modeled as a divergence-free field has also been applied to neural operators, which instead learn the governing PDE directly from solution data 8 . A differential projection layer can also