- Sun 12 October 2025
- Machine Learning
- #neural-networks, #physics, #pdes
Summary
Physics-informed neural networks (PINNs) are a class of deep learning models that incorporate physical laws—typically expressed as partial differential equations (PDEs)—directly into the training process. Instead of relying solely on data, PINNs leverage automatic differentiation to enforce that the neural network outputs satisfy the governing equations of the system.
General Recipe
Let \(\theta \in \Theta\) denote the parameters of a neural network, and let \(u_\theta : \mathcal{Y} \to \mathbb{R}^d\) be a deep neural network (DNN) that approximates the true physical field \(u : \mathcal{Y} \to \mathbb{R}^d\), which is an (unknown) solution to a PDE defined on the domain \(\mathcal{Y} \subset \mathbb{R}^m\).
We aim to find parameters \(\theta^\ast\) such that \(u_\theta \approx u\). Formally, this can be expressed as
where the error norm is defined as
Since the true solution \(u\) is generally unknown, we cannot compute this loss directly. However, we typically know that \(u\) satisfies a PDE of the form
where \(\mathcal{D}\) is a (possibly nonlinear) differential operator, and \(f : \mathcal{Y} \to \mathbb{R}^d\) is a known source term.
Because \(u_\theta\) is differentiable with respect to its inputs, we can use automatic differentiation (AD) to compute \(\mathcal{D}(u_\theta(y))\). This allows us to define the PDE residual
for all \(y \in \mathcal{Y}\).
To ensure that \(u_\theta\) satisfies the PDE, we minimize the expected residual:
In practice, this integral is approximated by a numerical quadrature over \(N \in \mathbb{N}\) collocation points \(\{y_i\}_{i=1}^N\), yielding
where \(w_i > 0\) are quadrature weights (commonly \(w_i = 1/N\)) and typically \(p=2\) (mean squared error). The network parameters \(\theta\) are then optimized via gradient-based methods such as Adam.
Incorporating Data and Boundary Conditions
In many physical systems, we have initial, boundary, or measurement data that the solution must satisfy. Let:
- \(t \geq 0\) denote time,
- \(x \in \mathcal{X}\) spatial coordinates, and
- \(y \in \mathcal{Y}\) represent parameters or input conditions.
Then the PINN is a function
Initial Conditions
If the true solution satisfies an initial condition
we can enforce this constraint by adding an initial loss term
Boundary Conditions
Boundary conditions specify the behavior of the solution on the spatial boundary \(\partial\mathcal{X}\). They can be enforced by adding a loss term similar to the initial condition loss. For example, if the solution satisfies a boundary condition \(u(x, y) = h(x, y)\) for \((x, y) \in \partial\mathcal{X} \times \mathcal{Y}\), we define
Observational Data
If we have observed data points \({(t_i, x_i, y_i, u_i)}_{i=1}^{N_{\text{data}}}\), we can include a data loss
Full Training Objective
The total PINN loss typically combines the PDE, initial, and data losses:
where the weights \(\lambda_{\text{PDE}}, \lambda_{\text{IC}}, \lambda_{\text{BC}}, \lambda_{\text{data}} > 0\) balance the contributions of each term.
The network parameters are then optimized by minimizing the loss function:
where \(\hat{\theta}\) denotes the parameters obtained by numerical optimization (e.g., using Adam).
Acknowledgment
This post is based on material covered in the AI in the Sciences and Engineering (HS 2025) lecture by Prof. Dr. Siddhartha Mishra, Computational and Applied Mathematics Laboratory (CamLab), Seminar for Applied Mathematics (SAM), D-MATH, ETH AI Center, and Swiss National AI Institute (SNAI), ETH Zürich, Switzerland.