Back to Main

PINN

Physics-Informed Neural Network

Inverse Modeling Neural Network with Physics-Informed Loss

This approach combines data-driven learning with physics-based modeling to infer key physical parameters from observed data. The goal is to develop a neural network–physics hybrid model that enables inverse modeling of dynamic systems, using simulation constraints to ensure physically meaningful predictions. This framework is especially relevant for applications such as reduced-order modeling (ROM) in biomedical systems, e.g., predicting the progression of arterial occlusion from noninvasive measurements like tissue oxygenation.

Purpose

The primary objective is to infer hidden physical parameters—such as diffusivity and source strength in a heat conduction model—by comparing simulated outputs driven by learned parameters to noisy observed data. Unlike traditional forward models, which predict system behavior from known parameters, inverse modeling solves the harder problem of recovering the parameters themselves.

Advantages

  • End-to-End Differentiability: The entire model, including the physics solver, is differentiable, enabling gradient-based training.
  • Physical Interpretability: The learned features correspond to meaningful physical quantities.
  • Simulation-Consistent Learning: The model respects the underlying physics throughout the learning process.
  • Efficiency: The model learns a reduced representation of a full simulation, offering potential speed-ups during deployment.

Feasibility and Precedents

This methodology is well-supported by existing literature in scientific machine learning. Similar hybrid and physics-informed frameworks have been applied successfully in fields like aerospace, fluid mechanics, and structural dynamics (e.g., Journal of Fluids and Structures, 2017; ERCOFTAC workshops, 2025). These precedents validate both the theoretical soundness and practical relevance of embedding physical constraints into learning pipelines, especially when data are limited and interpretability is critical.

Case 1 — Inverse modeling a 1D heat conduction system with fixed parameters

Code implementation 1

  • Heat Equation: \( \frac{\partial u}{\partial t} = \alpha \frac{\partial^2 u}{\partial x^2} + \beta \sin(\pi x) \)
  • Analytical Solution: \[ u(x, t) = \sin(\pi x) \left[ e^{-\pi^2 \alpha t} + \frac{\beta}{\pi^2 \alpha}(1 - e^{-\pi^2 \alpha t}) \right] \]
  • Numerical Solver: Crank–Nicolson scheme is used for time-stepping the PDE numerically in a differentiable manner.
  • Neural Network: Maps noisy field \(u(x, t)\) to \((\alpha, \beta) \in (0, 1)^2\) using a two-layer MLP.
  • Loss: \(\mathcal{L} = \| u_{\text{pred}} - u_{\text{true}} \|^2\), ensuring that learned parameters replicate the observed dynamics.
Training convergence plot

Case 2 — Inverse modeling a 1D advection–diffusion system with fixed parameters

Code implementation 2

  • Advection–Diffusion Equation: \( \frac{\partial u}{\partial t} + v \frac{\partial u}{\partial x} = \alpha \frac{\partial^2 u}{\partial x^2} \)
  • Analytical Solution: \[ u(x,t) = \frac{1}{\sqrt{4\pi \alpha t}} \exp\left(-\frac{(x - vt - 0.5)^2}{4\alpha t}\right) \]
  • Numerical Solver: Implicit finite difference scheme handling both advection and diffusion; inlet conditions are defined by the analytical solution.
  • Neural Network: Learns to predict \((\alpha, v) \in (0,1)^2\) from noisy snapshots of \(u(x,t)\).
  • Loss: \(\mathcal{L} = \| u_{\text{pred}} - u_{\text{true}} \|^2\), ensuring physics-consistent parameter recovery.
Advection-Diffusion training convergence plot

Case 3 — Inverse modeling a 1D advection–diffusion–reaction system with fixed parameters

Code implementation 3

  • Advection–Diffusion–Reaction Equation: \( \frac{\partial u}{\partial t} + v \frac{\partial u}{\partial x} = \alpha \frac{\partial^2 u}{\partial x^2} + R(u) \), where \( R(u) \) models spatially heterogeneous reaction terms.
  • Synthesized Data Samples: Noisy measurements of \( u(x,t) \) are generated by simulating the forward PDE solver with known parameters \((\alpha, v, r_0, r_1)\) at random time points. Gaussian noise is added to simulate observation uncertainty.
  • Numerical Solver: Implicit finite difference scheme that handles all three processes—advection, diffusion, and spatially varying reactions—implemented as a differentiable module for backpropagation.
  • Neural Network: Maps input pairs of noisy solution fields and time into predicted parameters \((\alpha, v, r_0, r_1)\), using a two-layer MLP with bounded sigmoid output scaled to physical ranges.
  • Loss: \(\mathcal{L} = \| u_{\text{pred}} - u_{\text{true}} \|^2\), comparing simulated outputs under predicted parameters to noisy observations, enabling inverse inference.
Advection-Diffusion-Reaction training convergence plot

Case 4 — Inverse modeling a 1D hemodynamic system

The governing equations are based on conservation of mass and momentum, expressed in terms of flow rate Q(x,t) and cross‑sectional area A(x,t):

  • Conservation of Mass:
  • $$\frac{\partial A}{\partial t} + \frac{\partial Q}{\partial x} = 0$$

  • Conservation of Momentum:
  • $$ \frac{\partial Q}{\partial t} + \frac{\partial}{\partial x}\left(\alpha \frac{Q^2}{A}\right) + \frac{A}{\rho}\,\frac{\partial P}{\partial x} = -\,K_R \frac{Q}{A} + \nu\,\frac{\partial^2 Q}{\partial x^2} $$

    The pressure \(P\) is still given by:

    $$ P = P_0 + \beta\left(\sqrt{A} - \sqrt{A_0}\right) $$

    To numerically solve these PDEs, boundary conditions are required:

  • Inlet Boundary Conditions
    • Prescribe both Q(t) and P(t) (or equivalently A(t)) at the inlet to uniquely define inflow and pressure dynamics.
  • Outlet Boundary Conditions
  • Only P(t) is prescribed; Q(t) is inferred using one of four common models:

    1. Dirichlet (Prescribed Pressure): directly specify P(t).
    2. Resistance: P(t) = R Q(t).
    3. RCR (Windkessel): three-element model relating P and Q via resistance and compliance.
    4. Impedance/Structured Tree: uses impedance or structured tree model—Q(t) is computed via convolution with the inverse FT of admittance.

    In all cases, the user prescribes P(t) (or its defining parameters), and the solver infers Q(t) based on the chosen outlet model.

    Numerical Algorithm

    Unknown fields: \(P_{i,j}, Q_{i,j}, A_{i,j}\) over \(i=0,\dots,N_x-1\); \(j=0,\dots,N_t-1\). Total unknowns: 3·Nx·Nt.

    Constraints:

    • Initialization (\(j=0\)): \(P_{i,0}, Q_{i,0}, A_{i,0}\) are prescribed.
    • Periodicity (\(j=N_t-1\)): \(P_{i,N_t-1}=P_{i,0}\), \(Q_{i,N_t-1}=Q_{i,0}\), \(A_{i,N_t-1}=A_{i,0}\).
    • Boundary Conditions:
      • Inlet (\(i=0\)): both \(Q_{0,j}\) and \(P_{0,j}\) provided.
      • Outlet (\(i=N_x-1\)): \(P_{N_x-1,j}\) prescribed; \(Q_{N_x-1,j}\) inferred using SimVascular models (Resistance, RCR/Windkessel, Impedance/Structured-tree).
    • PDE equations (interior nodes \(0Mass: \(\frac{A_{j+1,i}-A_{j,i}}{\Delta t} + \frac{Q_{j,i+1}-Q_{j,i-1}}{2\Delta x} = 0\)

      Momentum: \(\frac{Q_{j+1,i}-Q_{j,i}}{\Delta t} + \frac{\partial}{\partial x}(\alpha \frac{Q^2}{A}) + \frac{A}{\rho}\frac{\partial P}{\partial x} + K_R \frac{Q}{A} = 0\)

      Constitutive: \(P_{j,i} - [P_0 + \beta (\sqrt{A_{j,i}} - \sqrt{A_0})] = 0\)

    Altogether, these give \(3(N_t-2)(N_x-2)\) equations matching the interior unknowns.

    Solver outline:

    1. Assemble residual vector \(\mathbf{R}(U)\) across all unknowns \(U = \mathrm{vec}(P,Q,A)\).
    2. Solve nonlinear system \(\mathbf{R}(U)=0\) using Newton–Krylov:
      • Approximate Jacobian–vector product via finite differences.
      • Solve correction \(\Delta U\) using GMRES + ILU preconditioner (avoiding direct factorization errors).
    3. Iterate until convergence \(\|\mathbf{R}\| < tol\).

    This fully couples the 1D system in space and time, enforcing periodic behavior and solving for the complete space-time field in a single unified step.

    Case 5 — Dual Pipeline Framework for Wearable Physiological Modeling

    Executive Summary

    I propose a bi-directional modeling architecture that combines (1) a forward, physiology-constrained generative pipeline (Pipeline A), and (2) a reverse measurement-to-event inference pipeline (Pipeline B). Pipeline A provides physiologically structured signal representations, while Pipeline B performs event detection using those structured outputs as engineered features.

    Pipeline A – Forward (Mechanistic Generative Model)

    Purpose: Generate realistic wearable biosignals (e.g., heart rate, HRV, accelerometry) from latent physiological and contextual states.

    Structure
    • Input Layer – Exogenous Drivers
      Sleep/wake timing, activity context, stressor indicators, circadian phase.
    • Hidden Layer – Latent Physiological Dynamics
      Autonomic balance, fatigue/recovery state, respiratory modulation.
    • Interpretable Output Parameters
      Heart rate set-points, responsiveness gains, baroreflex sensitivity proxies.
    • Physics Measurement Layer
      Differentiable physiological signal model translating latent state to HR/HRV and accelerometry streams under realistic noise and artifact models.
    Deliverables
    • A differentiable generative simulator capable of producing wearable biosignals consistent with underlying states, used for:
      • Synthetic data generation
      • Personalized calibration
      • Counterfactual exploration (what-if stress/cognitive load scenarios)

    This pipeline leverages mechanistic models and neural ODE–style physics layers (PINNs) to build physiologically grounded generative modules.

    Pipeline B – Inference (Measurement-to-Event, Reverse Information Flow)

    Purpose: Infer user states (stress, cognitive load, sleep disruption) directly from wearable measurements by reversing the information flow of Pipeline A.

    Pipeline B does not reconstruct full physiological mechanisms. Instead, it operates in measurement space. It treats the outputs of Pipeline A’s Physics Measurement Layer as structured inputs and maps them directly to event probabilities.

    In this architecture, Pipeline A functions as advanced feature engineering. It transforms raw wearable signals into physiologically meaningful representations, reducing noise sensitivity and improving interpretability. Pipeline B then performs robust event inference using these structured features.

    Core Components

    • 1. Structured Feature Extraction (from Pipeline A)
      Rather than relying solely on raw HR or accelerometry, Pipeline B consumes:
      • Derived HRV indices (time-domain and frequency-domain)
      • Autonomic balance indicators inferred by Pipeline A
      • Regime classification (rest vs. movement)
      • Signal quality scores
      • Temporal stability metrics
      These features are physiologically grounded outputs generated by Pipeline A.
    • 2. Multi-Scale Temporal Aggregation
      Features are computed across multiple time windows (e.g., 30s, 5min, 60min) to capture both transient responses and sustained deviations.
    • 3. Event Inference Model
      A supervised or semi-supervised model maps structured features to event probabilities:
      • Logistic regression or gradient boosting for interpretable baselines
      • Lightweight neural network for nonlinear interactions
      • Optional anomaly detection for emerging events
      The model outputs calibrated probabilities and confidence scores.
    • 4. Uncertainty & Robustness Handling
      Pipeline B explicitly accounts for:
      • Motion-induced artifacts
      • Circadian baseline shifts
      • Device-specific noise patterns
      This improves generalization in uncontrolled real-world environments.

    Relationship Between Pipeline A and Pipeline B

    Pipeline B can operate independently using raw features. However, without Pipeline A, inference relies purely on statistical correlations and may be vulnerable to confounding and overfitting.

    By introducing Pipeline A:

    • Signal representations become physiologically interpretable.
    • Feature space becomes structured and lower-noise.
    • Generalization improves across subjects and devices.
    • Event inference becomes explainable rather than purely correlational.

    Therefore, Pipeline A provides structured physiological feature engineering, while Pipeline B provides operational event detection. Together they form a coherent forward–reverse modeling system.

    Conceptual Comparison – Ordinary ML vs Mechanistic-Informed ML

    Ordinary ML Pipeline
    1. Raw Signals
      HR, PPG, ACC, etc.
    2. Basic Preprocessing
      Filtering, normalization
    3. Generic Feature Extraction
      Statistical descriptors (mean, variance, FFT, etc.)
    4. Black-Box ML Model
      Learns correlations directly from features
    5. Predicted State
      Stress / Sleep / Cognitive Load

    Characteristics: Correlation-driven, limited interpretability, sensitive to noise and distribution shifts.

    Mechanistic Model + ML (Proposed)
    1. Raw Signals
      HR, PPG, ACC, etc.
    2. Physiological Signal Quality & Structuring
      Artifact-aware filtering, regime detection
    3. Mechanistic Feature Synthesis
      Autonomic balance proxies, recovery dynamics, response gains
    4. ML with Physiological Priors
      Structured inference constrained by mechanistic meaning
    5. Predicted State + Interpretation
      Event probability with physiological explanation

    Characteristics: Physiology-grounded features, improved robustness, enhanced interpretability, better cross-subject generalization.

    In the proposed framework, the mechanistic model does not replace machine learning. Instead, it structures the feature space before learning occurs. This reduces the hypothesis space the ML model must explore, embeds domain knowledge into the pipeline, and transforms event detection from pure correlation to physiology-informed inference.