Source-linked AI summary

Residual-based attention in physics-informed neural networks

Sokratis J. Anagnostopoulos, Juan Diego Toscano, Nikolaos Stergiopulos, George Em Karniadakis

arXiv:2307.00379v2cs.LGphysics.comp-ph

TL;DR

PINNs can overlook high-residual collocation regions, weakening spatial or temporal fidelity and complicating convergence. The paper proposes residual-based attention that adaptively weights training points from cumulative residuals, and reports faster convergence with accuracy improvements across forward and inverse problems.

  • Problem

    PINNs may overlook key high-residual regions through mean loss calculation, while stochastic residual evolution and non-convex optimization complicate reliable convergence.

  • Method

    Residual-based attention adaptively weights training points using evolving cumulative loss residuals, forming a gradient-less attention mask for challenging spatial or temporal regions.

  • Results

    The method accelerates convergence across forward and inverse PINN problems, with reported relative L2 errors of 4.57 · 10^-5 for Allen-Cahn, 5.18 · 10^-6 for Helmholtz, and 2.42 · 10^-1 and 2.08 · 10^-1 for inverse velocities u and v.

  • Takeaways & Limitations

    RBA can initiate early convergence for stiff problems and, alongside exact boundary conditions and other reparameterizations, supports accurate PINN solutions across problem types.

Abstract

from arXiv · show

Driven by the need for more efficient and seamless integration of physical models and data, physics-informed neural networks (PINNs) have seen a surge of interest in recent years. However, ensuring the reliability of their convergence and accuracy remains a challenge. In this work, we propose an efficient, gradient-less weighting scheme for PINNs that accelerates the convergence of dynamic or static systems. This simple yet effective attention mechanism is a bounded function of the evolving cumulative residuals and aims to make the optimizer aware of problematic regions at no extra computational cost or adversarial learning. We illustrate that this general method consistently achieves one order of magnitude faster convergence than vanilla PINNs and a minimum relative $L^{2}$ error of $\mathcal{O}(10^{-5})$, on typical benchmarks of the literature. The method is further tested on the inverse solution of the Navier-Stokes within the brain perivascular spaces, where it considerably improves the prediction accuracy. Furthermore, an ablation study is performed for each case to identify the contribution of the components that enhance the vanilla PINN formulation. Evident from the convergence trajectories is the ability of the optimizer to effectively escape from poor local minima or saddle points while focusing on the challenging domain regions, which consistently have a high residual score. We believe that alongside exact boundary conditions and other model reparameterizations, this type of attention mask could be an essential element for fast training of both PINNs and neural operators.

1. Introduction

PINNs balance physical-law, data, and boundary-related losses, but this balance can hinder convergence and accuracy. The paper proposes residual-based attention to adaptively focus training on high-error regions.

  • PINNs approximate PDE solutions by minimizing a composite loss containing physical-law and initial or boundary-condition and data terms.
  • Adaptive weighting strategies modify loss contributions globally or locally, including through resampling or gradient-based multipliers.
  • Residual-based attention computes adaptive training-point weights from loss residuals, directing optimization toward high-error spatial or temporal regions.
  • The method adapts its weighting to neural-network training dynamics while adding no adversarial learning mechanism.

2. Methods

The method formulates PINN losses from initial, boundary, data, and PDE residuals, then adds residual-based local attention whose bounded cumulative updates emphasize difficult collocation points. Weight normalization supplies a complementary reparameterization for faster convergence.

  • PINN objectives combine weighted residual terms for initial conditions, boundary conditions, data, and the governing PDE.
  • Residual-based attention addresses overlooked high-error collocation points that can impair spatial or temporal information propagation and convergence.
  • Residual-based attention (RBA) scheme: RBA updates local multipliers from normalized residuals using a decaying cumulative history, allowing attention to vary across training.
  • Residual-based attention (RBA) scheme: The multipliers are bounded by the decay and weighting parameters, preventing exploding values and requiring no training or gradient calculation.
  • Weight Normalization: Weight normalization decouples each weight vector’s length and direction through separate trainable parameters, accelerating convergence with minimal computational overhead.

3. Results

Across Allen-Cahn, Helmholtz, and brain perivascular-flow experiments, residual-based attention improved PINN convergence and accuracy, with component effects varying by problem. Ablations identify Fourier features, exact boundary treatment, RBA weights, and WN as important contributors.

  • 3.1. Dynamic case: 1D Allen-Cahn equation: 3 · 10^5 iterations with 25,600 collocation points produced the 1D Allen-Cahn prediction, using RBA only for the PDE residual term.The periodic-boundary benchmark used Adam with an exponential learning-rate scheduler and weights wic = 100, wr = 1.
  • 3.1.1. Ablation Study for Allen-Cahn: 4.57 · 10^-5 was the best 1D Allen-Cahn relative L2, achieved by combining RBA, Fourier feature embedding, and a modified MLP.The ablation identifies Fourier features as the most important component; RBA paired with Fourier features or the modified MLP reached relative L2 of 10^-4.
  • 3.1.1. Ablation Study for Allen-Cahn: 5.2 · 10^-3 was the final Allen-Cahn relative L2 using RBA weights alone, with steep convergence beginning at 20,000 iterations.The reported noise for the best-performing methods indicates optimizer movement over local minima rather than entrapment in a sub-optimal solution.
  • 3.3.1. Ablation Study for AIV: 2.42 · 10^-1 and 2.08 · 10^-1 were the full-model relative L2 errors for predicted u and v velocities in the brain perivascular-flow validation dataset.RBA was crucial for low relative L2 error, while WN was essential for accelerating convergence and stabilizing training.
  • 3.4. Comparison of RBA, SA weights and vanilla: One order of magnitude faster convergence was achieved by RBA than vanilla PINNs, while SA was approximately four times faster than vanilla in the reported setup.Even with ten times fewer collocation points, RBA and SA converged to reasonable solutions whereas vanilla failed; higher-attention regions showed relative agreement across benchmarks.

4. Summary

The paper proposes residual-based attention (RBA) as a fast weighting scheme for PINNs, applying it to forward and inverse problems alongside other model enhancements.

  • The method initiates early convergence for the stiff 1D Allen-Cahn equation without empirical loss-term weights.
  • Exact boundary conditions are identified as important for achieving solution accuracy of O(10^-5) when combined with other PINN enhancements.
  • RBA weights are reported as critical for reducing relative L2 error and speeding up convergence in cerebrospinal-fluid-flow modeling.

Appendix A.1. RBA weight evolution

RBA weights remain bounded while dynamically redistributing attention across domain regions during training. In AIV, persistent high weights identify difficult or inconsistent data, whereas declining weights indicate learned regions.

  • Allen–Cahn and Helmholtz: The decay factor bounds Allen–Cahn and Helmholtz RBA maxima at 10 while allowing their distribution to change across training stages.Mean weights stabilize near 20% of the upper bound, preventing exploding values while preserving adaptive allocation.
  • AIV: In AIV, nine RBA sets are summarized by maximum, mean, and minimum values for boundary conditions, PTV data, and Navier–Stokes losses.The grouped statistics simplify visualization of one multiplier set per loss term.
  • AIV: The PTV-data maximum reaches its upper limit and remains constant, potentially reflecting outliers or contradictory real-data information.By contrast, boundary-condition and Navier–Stokes weights peak early and then decrease as difficult regions become learned.

Appendix A.2. Benchmark settings

The appendix specifies initialization, implementation tables, collocation-point construction, and training-group configurations for benchmark and three-dimensional Navier–Stokes cases.

  • Implementation settings: Reported training times are only internal references because the codes were not optimized for speed.This limits direct interpretation of the tabulated computational times as optimized runtime comparisons.
  • Navier–Stokes point generation: Three-dimensional Navier–Stokes collocation points are generated by subdividing angular, axial, radial, and temporal coordinates into structured training groups.The construction uses 25 angular, 15 axial, seven radial, and 20 temporal subdivisions after boundary shrinking and combination.
  • Navier–Stokes point generation: The resulting Navier–Stokes configuration contains approximately 4.98e6 collocation points and 5.34e5 boundary-condition points.These totals approximately match the 5e6 and 5e5 training-point counts used in the previous study.

Appendix A.3.2. Navier-Stokes approximation

The Navier–Stokes model approximates three-dimensional velocity and pressure from space–time inputs, with case-specific global loss weights and additional implementation settings.

  • Field approximation: The network approximates velocity components (u, v, w) and pressure p from time and spatial coordinates (t, x, y, z).The neural outputs are denoted uNN, vNN, wNN, and pNN, with scaling values (us, vs, ws, ps) = (0.1, 1, 0.1, 100).
  • Loss weighting: Specific global multipliers are assigned to each loss term because empirical results showed improved performance with case-specific weighting.The selected AIV multipliers are listed in Table A.12.
  • Loss weighting: Additional AIV outputs are evaluated at different time steps across the cardiac cycle.These results complement the main implementation and training configuration.

Appendix A.3.3. Other implementation details

AIV implementation details include tabulated settings and computational times, while derived vorticity and wall shear stress are evaluated across cardiac-cycle time steps.

  • Tabulated details: AIV implementation details and computational times for ablation-study cases are provided in Tables A.13 and A.14.These tables document the case-specific configuration and runtime information.
  • Derived quantities: After training, automatic differentiation computes vorticity and wall shear stress from the continuous differentiable velocity and pressure fields.The reported results cover five time steps describing the cardiac cycle T.
Loading 2307.00379v2…