Introduction
Equation learning with neural networks
Biological dynamics are often modelled with differential equations whose functional forms are only partially known from theory. Equation learning (EQL) seeks to infer such governing equations directly from data [1 ] . Prominent EQL approaches include symbolic-regression methods that search over analytic expressions to fit the data [2 , 3 , 4 ] , sparse-regression frameworks such as Sparse Identification of Nonlinear Dynamics (SINDy) and its partial differential equation (PDE) extensions that select active terms from a candidate library [5 , 6 ] , and physics-informed neural networks (PINNs) [7 ] . In their inverse form, PINNs represent the solution of a differential equation with a neural network and infer the equation’s unknown parameters or terms directly from data. Building on the PINN approach, biologically-informed neural networks (BINNs) learn the unknown coefficient functions of the right-hand side (RHS) terms of a differential equation while retaining its known operator template [8 ] . This combination of known structure and learned coefficient functions makes BINNs well suited to mechanistic learning in biology: the structure anchors the model when data are sparse, noisy, and only partially observed, while the networks supply the coefficient functions that theory leaves unspecified [9 ] .
BINNs were introduced by Lagergren et al. [8 ] to model cell migration as a 1D+t t t reaction–diffusion process. We state the governing equation here in the general d d d -dimensional form,
∂ u ( x , t ) ∂ t = ∇ ⋅ [ D ( u ( x , t ) ) ∇ u ( x , t ) ] + G ( u ( x , t ) ) u ( x , t ) , x ∈ Ω ⊂ R d , t ∈ [ 0 , t f ] , (1) \frac{\partial u(\mathbf{x},t)}{\partial t} = \nabla\cdot[D(u(\mathbf{x},t))\nabla u(\mathbf{x},t)] + G(u(\mathbf{x},t))u(\mathbf{x},t), \quad\mathbf{x} \in\Omega\subset\mathbb{R}^{d}, \quad t \in[0,t_{\mathrm{f}}], \tag*{(1)} ∂ t ∂ u ( x , t ) = ∇ ⋅ [ D ( u ( x , t )) ∇ u ( x , t )] + G ( u ( x , t )) u ( x , t ) , x ∈ Ω ⊂ R d , t ∈ [ 0 , t f ] , (1)
where u ( x , t ) u(\mathbf{x},t) u ( x , t ) is the density at position x \mathbf{x} x and time t t t , Ω \Omega Ω is a bounded spatial domain of dimension d d d , and t f t_{\mathrm{f}} t f is the final time. The EQL problem then becomes learning the density u ( x , t ) u(\mathbf{x},t) u ( x , t ) on the left-hand side of Eq. (1) with a state network, and the diffusion and growth coefficient functions D ( u ( x , t ) ) D(u(\mathbf{x},t)) D ( u ( x , t )) and G ( u ( x , t ) ) G(u(\mathbf{x},t)) G ( u ( x , t )) with separate RHS networks. All networks are fully connected feedforward neural networks, also known as multilayer perceptrons (MLPs), interconnected within the BINN. Since their introduction, BINNs have been extended, for example to jointly learn observation noise [10 ] and to 2D+t t t systems with symbolic-regression equation discovery [11 ] , and applied to tasks such as forecasting stochastic agent-based model data [12 ] .
Hyperparameter selection
Hyperparameter selection is a challenge faced by every practitioner of neural-network-based EQL, and the settings chosen strongly affect both the accuracy of the recovered functions and the cost of training. State networks in PINNs are notoriously sensitive to architectural and training choices, motivating a body of work on principled hyperparameter and architecture selection that ranges from tuning dominant hyperparameters individually [13 ] , to joint Bayesian optimisation [14 ] , to gradient-based and evolutionary architecture-search methods [15 , 16 , 17 ] , and to multi-objective treatments of the data–physics loss balance [18 ] . The networks for the unknown RHS terms, in contrast, have received less systematic study. Nonetheless, they are usually kept small, as they typically represent low-complexity functions [19 , 20 , 21 , 22 , 23 ] . Reflecting both the difficulty and importance of these choices, systematic hyperparameter-selection procedures have begun to emerge for particular subclasses of PINNs [24 , 25 , 26 ] .
Compared to standard PINNs, BINNs face an additional challenge: because the state and RHS coefficient functions are learned simultaneously, their hyperparameters interact and cannot necessarily be tuned in isolation. Moreover, the coefficient functions being learned are never observed, so selection cannot fall back on held-out accuracy against a ground truth. On top of this, hyperparameter selection for BINNs remains largely understudied and underreported, which raises the barrier to using them and limits the reproducibility of results.
To address this, we present a practical, ground-truth-free workflow for hyperparameter selection in BINNs. The workflow focuses on selecting the capacities (primarily width and depth) of the state and RHS MLPs and the early-stopping patience, which controls how long training continues without sufficient improvement in the validation loss. We:
Present a diagnostic workflow for BINN hyperparameter selection that requires no ground truth and fixes the hyperparameters in an order dictated by the architecture.
Evaluate the workflow on a suite of synthetic systems with known ground truth, spanning a range of diffusion and growth terms and extending to noisy, 2 D + t 2\mathrm{D}+t 2 D + t data.
Distil transferable rules of thumb for hyperparameter selection: first, use narrow MLPs for the RHS terms, with their sizes chosen according to the expected complexity of each term, and employ a substantially wider state MLP. Second, set the early-stopping patience from the validation loss and the consistency of the learned functions.
The BINN pipeline implementation for hyperparameter selection is available in an open-access GitHub repository. The repository also includes user-friendly interactive notebooks for loading trained BINN models and reproducing all plots in this article. The pipeline can be readily adapted to new hyperparameters and other PDE-governed systems.
Background
The biologically-informed neural network architecture
The BINN architecture [8 ] is illustrated in Figure 1 . It comprises a state MLP N N u \mathrm{NN}_u NN u and one or two RHS MLPs (N N D \mathrm{NN}_D NN D for diffusion and N N G \mathrm{NN}_G NN G for growth). The networks output learned surrogate functions u ^ \hat{u} u ^ , D ^ \hat{D} D ^ , and G ^ \hat{G} G ^ for u ( ⋅ ) u(\cdot) u ( ⋅ ) , D ( ⋅ ) D(\cdot) D ( ⋅ ) , and G ( ⋅ ) G(\cdot) G ( ⋅ ) in Eq. (1) , respectively. Without loss of generality, the state u ( x , t ) u(\boldsymbol{x},t) u ( x , t ) can be considered a density evolving in space and time. During training, this density is evaluated on a gridded domain G \mathcal{G} G using bin-averaged values at grid points ( x , t ) (\boldsymbol{x},t) ( x , t ) . In the full three-dimensional case (d = 3 d=3 d = 3 ), the domain is discretised as
Figure 1. Overview of the biologically-informed neural network (BINN) architecture. Schematic overviews of the network flow (left ) and the corresponding network architectures (right ) are shown for the diffusion equation and the reaction–diffusion equation. The ground truth is the diffusion function D D D for the former, and the diffusion function D D D together with the growth function G G G for the latter. Discretised state data u d a t a u_{\mathrm{data}} u data and their spatiotemporal coordinates ( x , t ) (x,t) ( x , t ) are input to the state multilayer perceptron (MLP) N N u \mathrm{NN}_{u} NN u , which outputs the predicted state u ^ \hat{u} u ^ (blue). The right-hand side MLPs are trained jointly to recover the underlying biological mechanisms: the diffusion MLP (N N D \mathrm{NN}_{D} NN D , orange) learns the diffusion function D ^ \hat{D} D ^ and the growth MLP (N N G \mathrm{NN}_{G} NN G , green) learns the growth function G ^ \hat{G} G ^ . Training minimises a total loss comprising a data fitting term L 1 ( u ^ ) \mathcal{L}_{1}(\hat{u}) L 1 ( u ^ ) and a physics-informed term L 2 ( u ^ , D ^ , G ^ ) \mathcal{L}_{2}(\hat{u},\hat{D},\hat{G}) L 2 ( u ^ , D ^ , G ^ ) , the latter enforcing the governing partial differential equation and optionally incorporating user-specified biological constraints.
( x 1 , i , x 2 , j , x 3 , k , t s ) ∈ G , ( i , j , k , s ) ∈ { 1 , … , n x 1 } × { 1 , … , n x 2 } × { 1 , … , n x 3 } × { 1 , … , n t } , (x_{1,i},x_{2,j},x_{3,k},t_s)\in\mathcal{G},\qquad(i,j,k,s)\in\{1,\ldots,n_{x_1}\}\times\{1,\ldots,n_{x_2}\}\times\{1,\ldots,n_{x_3}\}\times\{1,\ldots,n_t\}, ( x 1 , i , x 2 , j , x 3 , k , t s ) ∈ G , ( i , j , k , s ) ∈ { 1 , … , n x 1 } × { 1 , … , n x 2 } × { 1 , … , n x 3 } × { 1 , … , n t } ,
where n x 1 n_{x_1} n x 1 , n x 2 n_{x_2} n x 2 , n x 3 n_{x_3} n x 3 denote the fixed numbers of bins in each spatial direction, and n t n_t n t the number of observed time points. This yields discretised density data arranged as a tensor
u d a t a ∈ R n x 1 × n x 2 × n x 3 × n t , u_{\mathrm{data}}\in\mathbb{R}^{n_{x_1}\times n_{x_2}\times n_{x_3}\times n_t}, u data ∈ R n x 1 × n x 2 × n x 3 × n t ,
which is then randomly split into a training set and a validation set. Subsequently, these two sets are used to train and validate the density MLP N N u ( ⋅ ; θ u ) : R d + 1 → R \mathrm{NN}_u(\cdot;\theta_u):\mathbb{R}^{d+1}\to\mathbb{R} NN u ( ⋅ ; θ u ) : R d + 1 → R , with trainable parameters θ u \theta_u θ u , which maps spatiotemporal coordinates ( x , t ) (\boldsymbol{x},t) ( x , t ) to the predicted density surrogate u ^ ( x , t ) : = N N u ( x , t ; θ u ) \hat{u}(\boldsymbol{x},t):=\mathrm{NN}_u(\boldsymbol{x},t;\theta_u) u ^ ( x , t ) := NN u ( x , t ; θ u ) for x ∈ R d \boldsymbol{x}\in\mathbb{R}^d x ∈ R d , t ∈ R t\in\mathbb{R} t ∈ R . The surrogate u ^ \hat{u} u ^ is in turn passed into N N D ( ⋅ ; θ D ) : R → R \mathrm{NN}_D(\cdot;\theta_D):\mathbb{R}\to\mathbb{R} NN D ( ⋅ ; θ D ) : R → R and N N G ( ⋅ ; θ G ) : R → R \mathrm{NN}_G(\cdot;\theta_G):\mathbb{R}\to\mathbb{R} NN G ( ⋅ ; θ G ) : R → R , mapping a density u ∈ R u\in\mathbb{R} u ∈ R to the learned diffusion D ^ ( u ) : = N N D ( u ; θ D ) \hat{D}(u):=\mathrm{NN}_D(u;\theta_D) D ^ ( u ) := NN D ( u ; θ D ) and growth G ^ ( u ) : = N N G ( u ; θ G ) \hat{G}(u):=\mathrm{NN}_G(u;\theta_G) G ^ ( u ) := NN G ( u ; θ G ) coefficient functions. All trainable MLP parameters θ u \theta_u θ u , θ D \theta_D θ D , and θ G \theta_G θ G are jointly trained on the data while enforcing that the predictions adhere to the governing PDE and any user-defined biological constraints via corresponding loss terms.
Biologically-informed learning
To infer D ( ⋅ ) D(\cdot) D ( ⋅ ) and G ( ⋅ ) G(\cdot) G ( ⋅ ) in Eq. (1) , the BINN’s MLPs are jointly trained by minimising the total objective function
L T o t a l ( u ^ , D ^ , G ^ ) = λ d a t a L d a t a ( u ^ ) ⏟ L 1 + λ P D E L P D E ( u ^ , D ^ , G ^ ) + λ b i o L b i o ( D ^ , G ^ ) ⏟ L 2 , (2) \mathcal{L}_{\mathrm{Total}}(\hat{u},\hat{D},\hat{G}) = \underbrace{\lambda_{\mathrm{data}}\mathcal{L}_{\mathrm{data}}(\hat{u})}_{\mathcal{L}_1} + \underbrace{\lambda_{\mathrm{PDE}}\mathcal{L}_{\mathrm{PDE}}(\hat{u},\hat{D},\hat{G}) + \lambda_{\mathrm{bio}}\mathcal{L}_{\mathrm{bio}}(\hat{D},\hat{G})}_{\mathcal{L}_2}, \tag*{(2)} L Total ( u ^ , D ^ , G ^ ) = L 1 λ data L data ( u ^ ) + L 2 λ PDE L PDE ( u ^ , D ^ , G ^ ) + λ bio L bio ( D ^ , G ^ ) , (2)
with λ d a t a , λ P D E , λ b i o ≥ 0 \lambda_{\mathrm{data}},\lambda_{\mathrm{PDE}},\lambda_{\mathrm{bio}} \ge0 λ data , λ PDE , λ bio ≥ 0 denoting the weights applied to the least-squares data loss, the PDE loss, and the biological constraint loss, respectively. This is schematically shown in Figure 1 with L 1 ( u ^ ) = λ d a t a L d a t a ( u ^ ) \mathcal{L}_1(\hat{u}) = \lambda_{\mathrm{data}}\mathcal{L}_{\mathrm{data}}(\hat{u}) L 1 ( u ^ ) = λ data L data ( u ^ ) and L 2 ( u ^ , D ^ , G ^ ) = λ P D E L P D E ( u ^ , D ^ , G ^ ) + λ b i o L b i o ( D ^ , G ^ ) \mathcal{L}_2(\hat{u},\hat{D},\hat{G}) = \lambda_{\mathrm{PDE}}\mathcal{L}_{\mathrm{PDE}}(\hat{u},\hat{D},\hat{G}) + \lambda_{\mathrm{bio}}\mathcal{L}_{\mathrm{bio}}(\hat{D},\hat{G}) L 2 ( u ^ , D ^ , G ^ ) = λ PDE L PDE ( u ^ , D ^ , G ^ ) + λ bio L bio ( D ^ , G ^ ) . For compactness, each loss is written in terms of the surrogate predictions u ^ \hat{u} u ^ , D ^ \hat{D} D ^ , and G ^ \hat{G} G ^ alone; the observed data u d a t a u_{\mathrm{data}} u data , the loss weights, and the biological bounds enter as fixed inputs. Optimisation is performed over the network parameters θ u \theta_u θ u , θ D \theta_D θ D , and θ G \theta_G θ G that generate these surrogates. Weights λ d a t a = λ P D E = 1 \lambda_{\mathrm{data}} = \lambda_{\mathrm{PDE}} = 1 λ data = λ PDE = 1 follow Lagergren et al. [8 ] , and we set λ b i o = 1 \lambda_{\mathrm{bio}} = 1 λ bio = 1 , as discussed in Supplementary Material SM1.1–SM1.2. The three loss terms in Eq. (2) are detailed below for the 2 D + t 2\mathrm{D}+t 2 D + t case (d = 2 d = 2 d = 2 ); their non-dimensionalised forms used in the implementation are derived in Supplementary Material SM3.4.
Data loss. The data loss enforces agreement between the density predictions and the observed data. Observations are assumed to be corrupted by additive Gaussian noise with non-constant variance, consistent with statistical error models used in related studies [8 , 27 , 28 ] . Specifically,
u d a t a i , j , s = u ( x 1 , i , x 2 , j , t s ) + ω i , j , s u γ ( x 1 , i , x 2 , j , t s ) ϵ i , j , s , (3) u_{\mathrm{data}}^{i,j,s} = u(x_{1,i},x_{2,j},t_s) + \omega_{i,j,s}u^\gamma(x_{1,i},x_{2,j},t_s)\epsilon_{i,j,s}, \tag*{(3)} u data i , j , s = u ( x 1 , i , x 2 , j , t s ) + ω i , j , s u γ ( x 1 , i , x 2 , j , t s ) ϵ i , j , s , (3)
where u ( ⋅ ) u(\cdot) u ( ⋅ ) denotes the unknown PDE solution for the density, ϵ i , j , s ∼ i i d N ( 0 , 1 ) \epsilon_{i,j,s} \mathrel{\overset{\mathrm{iid}}{\sim}} \mathcal{N}(0,1) ϵ i , j , s ∼ iid N ( 0 , 1 ) , γ ∈ R + \gamma\in\mathbb{R}^{+} γ ∈ R + controls how the noise magnitude scales with density, and ω i , j , s ∈ R + \omega_{i,j,s} \in\mathbb{R}^{+} ω i , j , s ∈ R + are additional variance scaling coefficients.
Under this model, the negative log-likelihood weights each squared data residual ( u d a t a − u ^ ) 2 (u_{\mathrm{data}}-\hat{u})^2 ( u data − u ^ ) 2 by the inverse of its variance, leading to a generalised least-squares (GLS) formulation in which these discrepancies are divided by u ^ γ \hat{u}^{\gamma} u ^ γ (see Supplementary Material SM3.4 for more information). Intuitively, this down-weights residuals in high-density regions and up-weights those in low-density regions. However, biological datasets frequently contain extended regions of very low population density, for which u ^ ≈ 0 \hat{u} \approx0 u ^ ≈ 0 . To ensure robust optimisation, we therefore drop the density-dependent weighting, which corresponds to setting γ = 0 \gamma= 0 γ = 0 in the loss, yielding a standard least-squares objective,
L d a t a ( u ^ ) = 1 n x 1 n x 2 n t ∑ i = 1 n x 1 ∑ j = 1 n x 2 ∑ s = 1 n t ( u d a t a i , j , s − u ^ ( x 1 , i , x 2 , j , t s ) ) 2 . (4) \mathcal{L}_{\mathrm{data}}(\hat{u}) = \frac{1}{n_{x_1}n_{x_2}n_t}\sum_{i=1}^{n_{x_1}}\sum_{j=1}^{n_{x_2}}\sum_{s=1}^{n_t}\left(u_{\mathrm{data}}^{i,j,s}-\hat{u}(x_{1,i},x_{2,j},t_s)\right)^2. \tag*{(4)} L data ( u ^ ) = n x 1 n x 2 n t 1 i = 1 ∑ n x 1 j = 1 ∑ n x 2 s = 1 ∑ n t ( u data i , j , s − u ^ ( x 1 , i , x 2 , j , t s ) ) 2 . (4)
In Supplementary Material SM2, the loss function in Eq. (4) is shown to outperform the GLS loss used in Lagergren et al. [8 ] , even when the ground-truth noise scaling parameter γ = 1 \gamma= 1 γ = 1 is used.
PDE loss. The PDE objective function penalises deviations of the learned solution from the governing equation at a set of n c n_c n c randomised collocation points { ( x 1 , k ( c ) , x 2 , k ( c ) , t k ( c ) ) } k = 1 n c \{(x_{1,k}^{(c)},x_{2,k}^{(c)},t_k^{(c)})\}_{k=1}^{n_c} {( x 1 , k ( c ) , x 2 , k ( c ) , t k ( c ) ) } k = 1 n c . During learning, these points are repeatedly and independently sampled from the uniform distribution defined by the coordinate-wise minima and maxima of the observed data. The PDE loss is defined as the mean-squared residual evaluated at the collocation points,
L P D E ( u ^ , D ^ , G ^ ) = 1 n c ∑ k = 1 n c [ ∂ u ^ ∂ t ∣ k − ∇ ⋅ ( D ^ ( u ^ ) ∇ u ^ ∣ k ) − G ^ k u ^ k ] 2 , (5) \mathcal{L}_{\mathrm{PDE}}(\hat{u},\hat{D},\hat{G}) = \frac{1}{n_c}\sum_{k=1}^{n_c}\left[\left.\frac{\partial\hat{u}}{\partial t}\right|_k - \nabla\cdot\left(\left.\hat{D}(\hat{u})\nabla\hat{u}\right|_k\right) - \left.\hat{G}_k\hat{u}_k\right.\right]^2, \tag*{(5)} L PDE ( u ^ , D ^ , G ^ ) = n c 1 k = 1 ∑ n c [ ∂ t ∂ u ^ k − ∇ ⋅ ( D ^ ( u ^ ) ∇ u ^ k ) − G ^ k u ^ k ] 2 , (5)
where u ^ k = u ^ ( x 1 , k ( c ) , x 2 , k ( c ) , t k ( c ) ) \hat{u}_k=\hat{u}(x_{1,k}^{(c)},x_{2,k}^{(c)},t_k^{(c)}) u ^ k = u ^ ( x 1 , k ( c ) , x 2 , k ( c ) , t k ( c ) ) , D ^ k = D ^ ( u ^ k ) \hat{D}_k=\hat{D}(\hat{u}_k) D ^ k = D ^ ( u ^ k ) , and G ^ k = G ^ ( u ^ k ) \hat{G}_k=\hat{G}(\hat{u}_k) G ^ k = G ^ ( u ^ k ) . The notation f ∣ k f|_k f ∣ k denotes evaluation of a function f f f and its derivatives at the k k k -th collocation point. The distinction between data points and collocation points is illustrated in Figure 2 for a 1D+t t t case.
Figure 2. Data points versus collocation points in 1D+t t t . Left: data grid for u d a t a u_{\mathrm{data}} u data , comprising 38 × 5 38 \times5 38 × 5 points. Right: collocation points sampled over 1 and 10 training minibatches, coloured by minibatch. For 1 minibatch, a single set C 1 = { ( x k ( c ) , t k ( c ) ) } k = 1 n c C_1=\{(x_k^{(c)},t_k^{(c)})\}_{k=1}^{n_c} C 1 = {( x k ( c ) , t k ( c ) ) } k = 1 n c is sampled; for 10 minibatches, the sets C 1 , … , C 10 C_1,\ldots,C_{10} C 1 , … , C 10 illustrate how repeated resampling of random collocation points progressively fills the spatiotemporal domain.
Biological constraint loss. Biological plausibility is enforced through an additional loss term imposing explicit constraints on diffusion and population growth. For example, in many cell-based experiments, the diffusion function D ( ⋅ ) D(\cdot) D ( ⋅ ) is assumed to be non-decreasing with respect to density and bounded as 0 ≤ d min ≤ D ( ⋅ ) ≤ d max 0 \le d_{\min} \le D(\cdot) \le d_{\max} 0 ≤ d m i n ≤ D ( ⋅ ) ≤ d m a x , while the per-capita growth rate G ( ⋅ ) G(\cdot) G ( ⋅ ) is assumed to be non-increasing with respect to density and bounded as g min ≤ G ( ⋅ ) ≤ g max g_{\min} \le G(\cdot) \le g_{\max} g m i n ≤ G ( ⋅ ) ≤ g m a x . In this setting, the biologically motivated penalty is imposed on a fixed, equally spaced grid of n b i o n_{\mathrm{bio}} n bio density values u q ∈ [ u min , u max ] u_q \in[u_{\min},u_{\max}] u q ∈ [ u m i n , u m a x ] , q = 1 , … , n b i o q=1,\ldots,n_{\mathrm{bio}} q = 1 , … , n bio , where u min u_{\min} u m i n and u max u_{\max} u m a x denote the minimum and maximum density values observed in the data, producing the biological loss
L b i o ( D ^ , G ^ ) = ∑ q = 1 n b i o [ λ D l i m ( I { D ^ q < d min } ( D ^ q − d min ) 2 + I { D ^ q > d max } ( D ^ q − d max ) 2 ) + λ G l i m ( I { G ^ q < g min } ( G ^ q − g min ) 2 + I { G ^ q > g max } ( G ^ q − g max ) 2 ) + λ ∂ D I { ∂ D ^ ∂ u ∣ u q < 0 } ( ∂ D ^ ∂ u ∣ u q ) 2 + λ ∂ G I { ∂ G ^ ∂ u ∣ u q > 0 } ( ∂ G ^ ∂ u ∣ u q ) 2 ] , (6) \begin{aligned}
\mathcal{L}_{\mathrm{bio}}(\hat{D},\hat{G})={}&\sum_{q=1}^{n_{\mathrm{bio}}}\Biggl[\lambda_{D_{\mathrm{lim}}}\left(\mathbb{I}_{\{\hat{D}_q<d_{\min}\}}(\hat{D}_q-d_{\min})^2+\mathbb{I}_{\{\hat{D}_q>d_{\max}\}}(\hat{D}_q-d_{\max})^2\right)\\
&+\lambda_{G_{\mathrm{lim}}}\left(\mathbb{I}_{\{\hat{G}_q<g_{\min}\}}(\hat{G}_q-g_{\min})^2+\mathbb{I}_{\{\hat{G}_q>g_{\max}\}}(\hat{G}_q-g_{\max})^2\right)\\
&+\lambda_{\partial D}\mathbb{I}_{\left\{\left.\frac{\partial\hat{D}}{\partial u}\right|_{u_q}<0\right\}}\left(\left.\frac{\partial\hat{D}}{\partial u}\right|_{u_q}\right)^2+\lambda_{\partial G}\mathbb{I}_{\left\{\left.\frac{\partial\hat{G}}{\partial u}\right|_{u_q}>0\right\}}\left(\left.\frac{\partial\hat{G}}{\partial u}\right|_{u_q}\right)^2\Biggr], \tag*{(6)}
\end{aligned} L bio ( D ^ , G ^ ) = q = 1 ∑ n bio [ λ D lim ( I { D ^ q < d m i n } ( D ^ q − d m i n ) 2 + I { D ^ q > d m a x } ( D ^ q − d m a x ) 2 ) + λ G lim ( I { G ^ q < g m i n } ( G ^ q − g m i n ) 2 + I { G ^ q > g m a x } ( G ^ q − g m a x ) 2 ) + λ ∂ D I { ∂ u ∂ D ^ u q < 0 } ∂ u ∂ D ^ u q 2 + λ ∂ G I { ∂ u ∂ G ^ u q > 0 } ∂ u ∂ G ^ u q 2 ] , (6)
where the indicator function I { c o n d i t i o n } \mathbb{I}_{\{\mathrm{condition}\}} I { condition } equals 1 if the condition holds and 0 otherwise. The coefficients λ D l i m \lambda_{D_{\mathrm{lim}}} λ D lim and λ G l i m \lambda_{G_{\mathrm{lim}}} λ G lim weight the penalties enforcing the prescribed bounds on D ^ \hat{D} D ^ and G ^ \hat{G} G ^ , respectively, while λ ∂ D \lambda_{\partial D} λ ∂ D and λ ∂ G \lambda_{\partial G} λ ∂ G weight the corresponding derivative-constraint penalties.
Training–validation split
In BINNs, state data are randomly partitioned into training and validation sets by assigning grid points independently of space and time, with the point selection varying across random seeds [8 ] . The training set is used to fit the BINN parameters, while the validation set is used to monitor overfitting via early stopping (Supplementary Material SM3.6); throughout, we use an 80/20 training–validation (TV) split. Predictions of the state and RHS MLPs are then performed on the combined training and validation data. This reflects our aim to learn accurate RHS terms over the observed range of the state quantity, rather than extrapolating to unseen state-quantity regimes.
Partitioning at the level of individual grid points, rather than whole trajectories or repeats, is particularly suited to the sparse-data settings that motivate BINNs [8 ] . In many biological experiments only a handful of repeats are available, and in fields such as ecology the observed dynamics may correspond to a real-world process that unfolds only once, so that training on one complete run and validating on others is not possible. Randomly holding out individual grid points allows a TV split to be formed even from a single realisation. Illustrations of TV splits, and how the contents of the training and validation sets depend on the random seed, are shown in Figure 3 .
Figure 3. Training and validation sets under different training–validation (TV) splits and initial conditions. Panels are generated using 1D+t t t data sampled at 38 spatial and 5 temporal points with an 80/20 TV split. Top row shows spatial density profiles at 3 time points. Bottom row shows the corresponding training and validation distributions over density. The two boxed panels use a cosine initial condition and differ only in the random seed defining the TV split, while the stand-alone panel uses an inverted cosine initial condition with the same seed as TV split 1.
Methods: hyperparameter-selection workflow
Hyperparameters in BINNs
We categorise BINN hyperparameters into three groups based on how practitioners set them. The first group comprises generic neural-network settings that practitioners typically leave at standard defaults rather than tune: the optimiser, the batch size, the TV split, and the early-stopping threshold (the relative improvement in validation loss that counts as sufficient, and so resets the early-stopping patience). The second group comprises BINN-specific settings that practitioners typically set from domain knowledge and practical considerations rather than tune: the loss weights, the number of collocation points, and the activation functions. The third group comprises the BINN hyperparameters that must be tuned for each new combination of data and RHS structure: the MLP capacities (width and depth) and the early-stopping patience.
In this work we present a workflow for selecting the third group, controlling capacity primarily through width. For completeness, we also demonstrate how to evaluate the second group’s choices in Supplementary Material SM1. The first group we set once and leave untouched, though one could readily carry out checks analogous to those for the second group.
Diagnostic hyperparameter-selection workflow
In a BINN, the MLP capacities and early-stopping patience are interdependent: their effects on accuracy and cost interact. Therefore, tuning each hyperparameter in isolation risks a selection that is optimal only for the particular settings of the others, while a full joint sweep over all hyperparameters is usually infeasible. As a practical middle ground, we design a semi-sequential workflow whose order is dictated by the BINN architecture, so that it follows the network’s data flow: the density predicted by the state network is the input to the RHS networks, and the coefficient functions can only be recovered once the density is adequately represented. Accordingly, we fix the state network capacity first, then the RHS capacities, and finally the early-stopping patience. Each choice is then confirmed to hold as the downstream hyperparameters are selected. To mitigate the stochasticity introduced by the TV split, every configuration is run across several random seeds (here, 3), and each diagnostic is read from the resulting spread rather than from a single training run. The workflow is illustrated in Figure 4 and reads its decisions from three ground-truth-free diagnostics:
Figure 4. The hyperparameter-selection workflow. A semi-sequential procedure: the hyperparameters are decided in an order determined by the biologically-informed neural network architecture. The capacity—network width and/or depth—of the state multilayer perceptron (MLP), which must learn the data, is proposed first, and is confirmed and selected once it is robust to the downstream MLP capacities and early stopping, and otherwise re-proposed (dashed loop). The capacities of the RHS MLPs are then selected, followed by the early-stopping patience; if the RHS capacities prove not robust to that patience they are reselected (second dashed loop).
Cost-performance trade-off charts show the final validation loss and runtime, with a subset of the hyperparameters varied and the rest held fixed. Reading across a swept hyperparameter, a saturation point marks where further increases cease to be worth their cost.
Training dynamics trace plots show the validation loss over epochs. These reveal whether performance differences between hyperparameter configurations are systematic rather than artefacts of where training stopped, and whether further training is expected to reduce the loss.
Consistency plots show the learned RHS coefficient functions over the data-supported range of the density u u u , overlaid across hyperparameter configurations. The hyperparameter value beyond which these functions stop changing signals convergence.
Runtimes are measured on an Apple M3 Pro (CPU-only) up to the saved model (e.g., Algorithm 1, Supplementary Material SM3.6). Because machine load varies, runtimes should be compared only within individual case studies.
Synthetic data generation
To ensure suitability for biological applications, we evaluate the BINN architecture on biologically relevant simulation data generated from known ground-truth functions so that the learned functions can be assessed against a known reference. The ground-truth coefficient functions are restricted to a biologically admissible space, with bounds ( d min , d max ) = ( 0 , 0.1 ) (d_{\min}, d_{\max}) = (0, 0.1) ( d m i n , d m a x ) = ( 0 , 0.1 ) mm2 ^{2} 2 days− 1 ^{-1} − 1 for diffusion and ( g min , g max ) = ( − 0.48 , 2.4 ) (g_{\min}, g_{\max}) = (-0.48, 2.4) ( g m i n , g m a x ) = ( − 0.48 , 2.4 ) days− 1 ^{-1} − 1 for growth. These values are set from observations in scratch-assay experiments [29 ] with some additional flexibility following Lagergren et al. [8 ] , yielding a suite of physically plausible diffusion and reaction–diffusion equations that are summarised in Table 1 and visualised in Fig. A.1 of Appendix § 8 .
Table 1. Ground-truth diffusion and growth functions used to generate the simulated data. Functions are defined on the dimensionless density u ~ = u / K \tilde{u} = u/K u ~ = u / K ; K = 1700 K = 1700 K = 1700 cells m m − 2 \mathrm{mm}^{-2} mm − 2 .
All simulations are performed subject to no-flux boundary conditions at the domain boundaries. The governing equations are first solved on a fine spatiotemporal grid. To match realistic experimental resolution, spatial data are then obtained by binning and averaging the solution, and temporal data are sampled at discrete time points. The space and time resolutions are chosen to reflect previous BINN studies with microscopy data in 1D+t t t [8 ] and 2D+t t t [11 ] settings. Initial conditions resemble a smooth scratch in the 1D+t t t case and a low-amplitude cosine-squared profile matching a localised seeding of cells on a plate in the 2D+t t t case. The data-generating settings are summarised in Table 2 . Biological constraint weights are set to λ D l i m = λ G l i m = 0 \lambda_{D\mathrm{lim}} = \lambda_{G\mathrm{lim}} = 0 λ D lim = λ G lim = 0 and λ ∂ D = λ ∂ G = 10 \lambda_{\partial D} = \lambda_{\partial G} = 10 λ ∂ D = λ ∂ G = 10 , with n b i o = 100 n_{\mathrm{bio}} = 100 n bio = 100 in Eq. (6) . The biological constraint weights are selected to enforce the constraints without impeding training during early epochs, as shown in Supplementary Material SM1.2. For enforcing the PDE constraint, we use n c = 1000 n_c = 1000 n c = 1000 collocation points in 1D+t t t and n c = 100 n_c = 100 n c = 100 in 2D+t t t (Eq. (5) ). The value of n c n_c n c is chosen to balance the increased runtime associated with larger n c n_c n c against the greater stochasticity arising from evaluating the PDE at fewer points when n c n_c n c is smaller, as demonstrated in Supplementary Material SM1.3.
Table 2. Data-generation settings. Normalised spatial coordinates are defined as ξ = ( x − x min ) / L \xi=(x-x_{\min})/L ξ = ( x − x m i n ) / L in 1D+t t t and ξ i = ( x i − x i , min ) / L i \xi_i=(x_i-x_{i,\min})/L_i ξ i = ( x i − x i , m i n ) / L i in 2D+t t t . MPE denotes mean percentage error.
Results
We apply the workflow to four cases of increasing complexity, each highlighting a different aspect of hyperparameter selection. We first demonstrate the full workflow on a system with a single RHS term: a constant diffusion coefficient function (§ 4.1 ). Subsequent cases then isolate harder sub-problems: a non-trivial diffusion coefficient function that may require increased MLP capacity (§ 4.2 ); two coupled RHS MLPs—diffusion and growth—requiring joint selection (§ 4.3 ); and noisy 2D+t t t data that tests the workflow’s robustness to measurement noise in a second spatial dimension (§ 4.4 ).
Case I: demonstrating the full workflow (constant diffusion in 1D+t t t )
We first consider a system with constant diffusion D 1 D_1 D 1 and no growth (Table 1 ), and use it to demonstrate the full hyperparameter-selection workflow, following the steps of Figure 4 . Here, the state (density) capacity is controlled through W u W_u W u , and the RHS (diffusion) capacity through W D W_D W D . To streamline the workflow, we hold the MLP depths—the numbers of hidden layers L u L_u L u , L D L_D L D and L G L_G L G —fixed at three, a decision justified in the note on MLP depth.
Step 1: propose W u W_u W u . We first fix the diffusion network at a deliberately small width, W D = 2 W_D=2 W D = 2 , to limit its flexibility and ensure that the learning is driven primarily by the density network width, W u W_u W u . We then sweep W u ∈ { 8 , 16 , 32 , 64 , 128 } W_u\in\{8,16,32,64,128\} W u ∈ { 8 , 16 , 32 , 64 , 128 } across early-stopping patiences E S ∈ { 1000 , 2000 , 3000 } ES\in\{1000,2000,3000\} E S ∈ { 1000 , 2000 , 3000 } and visualise the cost-performance trade-off (Figure 5 a). Here, across E S ES E S values, the validation loss improves consistently with W u W_u W u , and the runtime per unit of validation loss continues to favour wider networks. However, by W u = 128 W_u=128 W u = 128 the absolute cost becomes excessive, with a single run at E S = 2000 ES=2000 E S = 2000 taking roughly 2 × 10 3 2\times10^3 2 × 1 0 3 s. We propose W u = 64 W_u=64 W u = 64 , the largest tested width whose runtime remains reasonable while the validation loss still improves appreciably.
Figure 5. Diagnostics of the hyperparameter-selection workflow. Exemplified on data generated from a simple PDE with one term—constant diffusion—on the RHS. (a) Trade-off between validation loss and runtime across varying widths (W u W_u W u ) of the state network and the early-stopping patience (E S ES E S ), with the RHS network width fixed (here at W D = 2 W_D = 2 W D = 2 ). Bars and whiskers respectively show mean values and min–max ranges across 3 repeats with different training–validation (TV) splits. (b) Validation-loss trajectories over training epochs, with the stopping points for the investigated early-stopping values marked. (c) The same trade-off as in (a) across varying values for W u W_u W u and W D W_D W D , with early stopping fixed (here at E S = 2000 ES = 2000 E S = 2000 ). (d) The learned function D ^ ( u ) \hat{D}(u) D ^ ( u ) at successive early-stopping values (for W D = 2 W_D = 2 W D = 2 , W u = 64 W_u = 64 W u = 64 ). Regions outside the central 90% of the density support are shown in grey. The dashed ground-truth line and ± 0.5 % \pm0.5\% ± 0.5% bands play no role in the selection workflow and are shown only for reference. In (b) and (d) filled bands show min–max ranges across 3 repeats with different TV splits.
Step 2: confirm and select W u W_u W u . Using two separate plots, we investigate whether the proposed W u W_u W u is robust to different choices of E S ES E S and W D W_D W D . For inspecting the effect of early stopping, we trace the validation-loss trajectories over epochs (Figure 5 b). Here, the curves stay separated by W u W_u W u throughout training for every tested E S ∈ { 1000 , 2000 , 3000 } ES\in\{1000,2000,3000\} E S ∈ { 1000 , 2000 , 3000 } , confirming that the ranking reflects W u W_u W u itself, not when training happened to stop. For W D W_D W D -inspection, we plot the cost-performance trade-off across W D ∈ { 1 , 2 , 4 } W_D\in\{1,2,4\} W D ∈ { 1 , 2 , 4 } (Figure 5 c), i.e., the W D W_D W D -based counterpart of the early-stopping-focused sweep in Step 1. The trade-off shows that W u = 64 W_u=64 W u = 64 performs well across the tested W D W_D W D . On both counts, the W u = 64 W_u=64 W u = 64 proposed in Step 1 therefore stands. Had a different W u W_u W u been preferable at some W D W_D W D , we would loop back to Step 1 (dashed loop in Figure 4 ) and re-plot the cost-performance trade-off over W u W_u W u at that W D W_D W D .
Step 3: select W D W_D W D . With W u = 64 W_u = 64 W u = 64 now locked in, we select the diffusion width W D W_D W D . Here, since Step 2 already varied W D W_D W D , we can reuse those cost-performance plots (Figure 5 c). Varying W D W_D W D between 1 and 4 has little impact on either validation loss or computational cost. Since the choice is therefore largely inconsequential, we select W D = 2 W_D = 2 W D = 2 as a low-cost safeguard, retaining slightly more flexibility than W D = 1 W_D = 1 W D = 1 affords.
Step 4: select early stopping. Finally, we select the early-stopping patience by reading the validation loss and the consistency of the learned functions together. The validation loss (Figure 5 a) continues to drop reasonably systematically with increasing early-stopping patience, so on its own it gives no clear stopping point. We therefore turn to the consistency of the diffusion predictions (Figure 5 d): the learned diffusion function D ^ ( u ) \hat{D}(u) D ^ ( u ) varies only mildly across E S ES E S ; beyond E S = 1000 ES = 1000 E S = 1000 the continuing fall in validation loss no longer changes the learned diffusion appreciably. We select E S = 2000 ES = 2000 E S = 2000 , a conservative choice that captures the gains that matter for function recovery at modest extra training time.
A note on MLP depth. The depth of each network is set empirically, but the choices are consistent with a simple expectation. The RHS coefficient functions, such as the diffusion D ( u ) D(u) D ( u ) , are low-dimensional and smooth, so we expect them to require little depth: universal-approximation results guarantee that even a single hidden layer suffices in principle [30 , 31 ] , and the targets lack the complex, compositional structure for which added depth is known to give substantial gains [32 , 33 ] . The same approximation guarantees apply to N N u \mathrm{NN}_u NN u , but its target is the richer density field, so whether depth helps there is a genuinely empirical question. We resolve both by sweeping depth and width. Figure 6 compares validation loss and runtime across widths and depths for N N u \mathrm{NN}_u NN u (panel a) and N N D \mathrm{NN}_D NN D (panel b), and shows the consistency of the recovered diffusion function across depths of both networks (panels c,d). Two observations stand out: (i) for the density network (Figure 6 a), validation loss drops markedly from depth two to three but plateaus from three to four for widths W u = 64 , 128 W_u = 64, 128 W u = 64 , 128 ; and (ii) validation loss is largely insensitive to the depth of the diffusion network, as depth two already suffices for the simple constant-diffusion ground truth. Balancing runtime against performance, and retaining headroom for harder RHS forms, we use depth 3 for both.
Figure 6. Impact of MLP depth on the fit and the recovered function. Exemplified on the Case I problem, with data generated from a simple PDE with one term—constant diffusion—on the right-hand side (RHS). E S = 2000 ES = 2000 E S = 2000 is fixed. (a) Trade-off between validation loss and runtime across the width and depth of the state network N N u \mathrm{NN}_u NN u . (b) The same as (a) for the diffusion network N N D \mathrm{NN}_D NN D . (c) Consistency of the learned diffusion function D ^ ( u ) \hat{D}(u) D ^ ( u ) across the depth of N N u \mathrm{NN}_u NN u with width W u = 64 W_u = 64 W u = 64 . N N D \mathrm{NN}_D NN D (W D = 2 W_D = 2 W D = 2 , L D = 3 L_D = 3 L D = 3 ) is fixed. (d) The same as (c) across the depth of N N D \mathrm{NN}_D NN D with width W D = 2 W_D = 2 W D = 2 . N N u \mathrm{NN}_u NN u (W u = 64 W_u = 64 W u = 64 , L u = 3 L_u = 3 L u = 3 ) is fixed. The dashed ground-truth line and ± 0.5 % \pm0.5\% ± 0.5% bands play no role in the selection workflow and are shown only for reference.
Verification. Because the data are synthetic, we can verify the ground-truth-free selections resulting from the workflow against the known diffusion function. Revisiting the W u W_u W u sweep, we see that the diffusion-function mean-squared error (MSE) saturates with W u W_u W u in the same way as the validation loss, and that its trajectory over epochs mirrors that of the validation loss (Figure 7 a,Figure 7 b). From this we gather that the validation loss, which needs no ground truth, serves as an observable proxy for the otherwise-unobservable MSE. The W D W_D W D sweep shows the same agreement. Notably, for all W u ∈ { 32 , 64 , 128 } W_u \in\{32, 64, 128\} W u ∈ { 32 , 64 , 128 } and W D ∈ { 1 , 2 , 4 } W_D \in\{1, 2, 4\} W D ∈ { 1 , 2 , 4 } , the diffusion-function MSE stays below the level that a uniform 1% error in the learned function would produce (Figure 7 b,Figure 7 c); this is the sense in which all mean percentage error (MPE) reference lines in this work are defined (Supplementary Material SM3.2). This illustrates that a small diffusion network recovers the true function; taken together with the runtimes in Figure 5 c, it further shows that larger W D W_D W D carries little additional cost.
Figure 7. Ground-truth verification of the learned function in the synthetic Case I study. Data generated from a simple PDE with one term—constant diffusion—on the right-hand side (RHS). Mean-squared error (MSE) of the learned diffusion coefficient function D ^ ( u ) \hat{D}(u) D ^ ( u ) against the ground-truth D 1 D_1 D 1 . (a) MSE over training epochs, for different W u W_u W u and early-stopping patiences E S ES E S with W D = 2 W_D = 2 W D = 2 . Filled bands show min–max ranges across 3 repeats with different training–validation (TV) splits. (b) MSE across varying widths (W u W_u W u ) of the state network and the early-stopping patience (E S ES E S ), with the RHS network width fixed (here at W D = 2 W_D = 2 W D = 2 ). (c) The same MSE across varying values for W u W_u W u and W D W_D W D , with fixed E S = 2000 ES = 2000 E S = 2000 . In (b) and (c), the bars and whiskers respectively show mean values and min–max ranges across the different TV splits, and mean percentage error (MPE) levels of 0.25%, 0.5%, and 1% are indicated by horizontal lines.
Case II: selecting W D W_D W D by consistency (non-constant diffusion in 1D+t t t )
We now apply the hyperparameter-selection workflow to diffusion functions that are more complicated than constant, and thus may require more capacity in the diffusion MLP. Specifically, we consider linear (D 2 D_2 D 2 ), quadratic (D 3 D_3 D 3 ), and exponential (D 4 D_4 D 4 ) diffusion (Table 1 ). The state network, however, fits data of comparable complexity to Case I, so the same W u W_u W u remains appropriate. We can therefore reuse W u = 64 W_u = 64 W u = 64 and enter the pipeline directly at Step 3, producing cost-performance plots at fixed W u W_u W u over varying W D W_D W D and E S ES E S , whose smallest values are those selected in Case I. Here we test W D ∈ { 2 , 4 , 8 } W_D \in\{2, 4, 8\} W D ∈ { 2 , 4 , 8 } and E S ∈ { 2000 , 3000 , 5000 } ES \in\{2000, 3000, 5000\} E S ∈ { 2000 , 3000 , 5000 } . Doing so, we find that the cost-performance trade-off charts alone do not pin down a preferred W D W_D W D for any of the three diffusion functions (Figure 8 a). Across the tested widths, neither the validation loss nor the runtime changes systematically with W D W_D W D : for each diffusion function, the differences between widths are small relative to the spread across TV splits, and the wider networks W D ∈ { 4 , 8 } W_D \in\{4, 8\} W D ∈ { 4 , 8 } do not improve on W D = 2 W_D = 2 W D = 2 . Both metrics instead depend mainly on the early-stopping patience, with the validation loss decreasing and the runtime increasing as E S ES E S grows. Since the charts show no clear saturation point in W D W_D W D , we must also inspect the consistency of the learned diffusion function across configurations of W D W_D W D and early-stopping patiences (Figure 8 b).
Figure 8. Selecting W D W_D W D for non-constant diffusion. Data are generated from three diffusion functions of increasing complexity: linear, quadratic, and exponential. (a) Trade-off between validation loss and runtime across varying widths (W D W_D W D ) of the diffusion network and the early-stopping patience (E S ES E S ), with the state network width fixed (here at W u = 64 W_u = 64 W u = 64 ). Bars and whiskers respectively show mean values and min–max ranges across 3 repeats with different training–validation (TV) splits. (b) The learned diffusion function D ^ ( u ) \hat{D}(u) D ^ ( u ) across these widths, shown at E S = 2000 ES = 2000 E S = 2000 , 3000 and 5000. Filled bands show min–max ranges across the 3 TV splits. Regions outside the central 90% of the density support are shown in grey. The dashed ground-truth line and ± 5 % \pm5\% ± 5% bands play no role in the selection workflow and are shown only for reference.
Here, the consistency plots show that the predictions for the different widths agree closely, with the degree of agreement across E S ES E S depending on the form of the true diffusion function. For linear diffusion, W D = 2 W_D = 2 W D = 2 and W D = 8 W_D = 8 W D = 8 result in near-identical predictions that are stable across E S ES E S . The W D = 4 W_D = 4 W D = 4 predictions initially deviate from the W D = 2 W_D = 2 W D = 2 and 8 predictions outside the central 90% density support but become consistent at E S = 5000 ES = 5000 E S = 5000 . Hence, W D = 2 W_D = 2 W D = 2 and E S = 2000 ES = 2000 E S = 2000 are favoured.
For quadratic diffusion, the predictions are predominantly stable across all tested (W D W_D W D , E S ES E S ) configurations, so the cheapest setting, W D = 2 W_D = 2 W D = 2 at E S = 2000 ES = 2000 E S = 2000 , is preferred. For exponential diffusion, the predictions stabilise across W D W_D W D values for E S ≥ 3000 ES \ge3000 E S ≥ 3000 . Taken together, consistency selects (W D = 2 W_D = 2 W D = 2 , E S = 3000 ES = 3000 E S = 3000 ) as the smallest configuration at which the learned functions have converged across all three diffusion forms. Although the validation loss keeps falling at larger settings, the recovered function no longer changes significantly, while the runtime continues to rise. Furthermore, the ground truth confirms that this consistency-based selection is accurate: the recovered functions match the true diffusion within 5% MPE across all three forms (Fig. A.2, Appendix § 9 .§ 1 ).
Case III: selecting early stopping for coupled functions (diffusion and growth in 1D+t)
We next apply the workflow to a PDE with two RHS terms, diffusion and growth, so that hyperparameter selection must account for learning both functions at once. Specifically, we consider constant diffusion (D 1 D_1 D 1 ) coupled with one of constant (G 1 G_1 G 1 ), linear (G 2 G_2 G 2 ), quadratic (G 3 G_3 G 3 ), or exponential (G 4 G_4 G 4 ) growth (Table 1 ). The data are of comparable complexity to Cases I and II, so the same W u = 64 W_u = 64 W u = 64 remains appropriate. The growth functions are no more complex than the diffusion functions of Case II, so the RHS widths carry over as well, giving W D = W G = 2 W_D = W_G = 2 W D = W G = 2 . In Appendix § 9 .§ 2 (Fig. A.3a,b), we show that increasing W D = W G W_D = W_G W D = W G beyond 2 does not consistently improve performance across growth functions. We can therefore enter the pipeline directly at Step 4 to select early stopping. As in Case II, the smallest tested value is the one selected in Case I, giving E S ∈ { 2000 , 3000 , 5000 } ES \in\{2000, 3000, 5000\} E S ∈ { 2000 , 3000 , 5000 } .
Also, as in Case II, the cost-performance trade-off alone does not pin down a preferred E S ES E S (Fig. A.4, Appendix B.2), so we turn to the consistency plots (Figure 9 ). With two coupled functions to recover, neither can be judged alone because an E S ES E S at which one function appears converged may still leave the other changing. Consistency must therefore be read on D ( u ) D(u) D ( u ) and G ( u ) G(u) G ( u ) simultaneously. Read jointly (Figure 9 ), these RHS functions are generally consistent across all four combinations and all E S ES E S . By E S = 2000 ES = 2000 E S = 2000 , the learned RHS functions have largely stabilised, except for quadratic growth, where the diffusion prediction only becomes consistent from E S = 3000 ES = 3000 E S = 3000 onwards. We therefore adopt the more conservative E S = 3000 ES = 3000 E S = 3000 : the larger patience guards against premature stopping, at little additional cost for the constant, linear and exponential growth functions, where it is not needed. This selection is supported by comparing the learned diffusion and growth functions against the ground truth, as shown visually in Figure 9 and quantitatively in Appendix B.2.
Figure 9. Selecting hyperparameters under coupled diffusion and growth. Data are generated from constant diffusion (D 1 D_1 D 1 ) paired with four growth forms—constant (G 1 G_1 G 1 ), linear (G 2 G_2 G 2 ), quadratic (G 3 G_3 G 3 ), and exponential (G 4 G_4 G 4 ). Consistency of the learned diffusion and growth functions across early-stopping patiences E S ∈ { 2000 , 3000 , 5000 } ES \in\{2000, 3000, 5000\} E S ∈ { 2000 , 3000 , 5000 } with fixed W u = 64 W_u = 64 W u = 64 and W D = W G = 2 W_D = W_G = 2 W D = W G = 2 is shown. Filled bands show min–max ranges across 3 repeats with different training–validation splits. Regions outside the central 90% of the density support are shown in grey. The dashed ground-truth line and ± 5 % \pm5\% ± 5% bands play no role in the selection workflow and are shown only for reference.
Case IV: selecting ES on noisy data (diffusion and growth in 2D+t)
Finally, we ask whether the workflow holds up under noisy and higher-dimensional data. To this end, we apply it to 2D+t t t data generated with constant diffusion (D 1 D_1 D 1 ) and linear growth (G 2 G_2 G 2 ), corrupted by 5% MPE noise with γ = 1 \gamma= 1 γ = 1 . Moving to 2D+t t t , we carry the density MLP width forward at W u = 64 W_u = 64 W u = 64 and re-run the pipeline over the RHS widths only, testing W D = W G ∈ { 2 , 4 , 8 , 16 } W_D = W_G \in\{2, 4, 8, 16\} W D = W G ∈ { 2 , 4 , 8 , 16 } . We select W D = W G = 4 W_D = W_G = 4 W D = W G = 4 as the smallest width whose learned D ^ ( u ) \hat{D}(u) D ^ ( u ) and G ^ ( u ) \hat{G}(u) G ^ ( u ) agree with those of the next width tested, W D = W G = 8 W_D = W_G = 8 W D = W G = 8 , while W D = W G = 2 W_D = W_G = 2 W D = W G = 2 and 16 each deviate significantly (Fig. A.5, Appendix § 9 .§ 3 ). We enter the pipeline at Step 4 to select E S ES E S from { 500 , 1000 , 2000 , 3000 } \{500, 1000, 2000, 3000\} { 500 , 1000 , 2000 , 3000 } . Here, the smallest tested E S ES E S value is lower than in the previous cases. This is because we expect noise to make the validation loss plateau earlier. The PDE regularisation discourages the network from fitting the noise, so it recovers only a smoothed density fit, and once that fit is reached, which happens sooner at higher noise levels, the validation loss stops improving.
In two spatial dimensions we use a coarse spatial grid to keep training computationally tractable. Even so, compared with the equivalent 1D+t problem in Case III, the data volume grows by a factor of 5.7 (Table 2 ), making this a data-richer but noisy regime. Despite the added noise, the cost-performance trade-off alone can motivate the choice of E S ES E S . The validation loss drops between E S = 500 ES = 500 E S = 500 and 1000 and then plateaus (Figure 10 a), motivating E S = 1000 ES = 1000 E S = 1000 . This plateau is also reflected in the learned diffusion and growth functions (Figure 10 b), confirming the choice. Furthermore, MSE plots against the ground-truth functions D 1 ( u ) D_1(u) D 1 ( u ) and G 2 ( u ) G_2(u) G 2 ( u ) support this selection and, by extension, the workflow’s applicability in noisy 2D+t settings (Fig. A.6, Appendix § 9 .§ 3 ).
Figure 10. Selecting the early-stopping patience on noisy 2D+t data. Data generated from constant diffusion (D 1 D_1 D 1 ) and linear growth (G 2 G_2 G 2 ), with 5% MPE noise added, at fixed widths (W u = 64 W_u = 64 W u = 64 , W D = W G = 4 W_D = W_G = 4 W D = W G = 4 ). (a) Cost-performance trade-off between validation loss and runtime across the early-stopping patience (E S ES E S ). Bars and whiskers respectively show mean values and min–max ranges across 3 repeats with different training–validation (TV) splits. (b) Consistency of the learned diffusion and growth functions, D ^ ( u ) \hat{D}(u) D ^ ( u ) and G ^ ( u ) \hat{G}(u) G ^ ( u ) , across varying E S ES E S . Regions outside the central 90% of the density support are shown in grey. The dashed ground-truth line and ± 5 % \pm5\% ± 5% bands play no role in the selection workflow and are shown only for reference.
Discussion
We have presented a diagnostic workflow that selects BINN hyperparameters from training-time signals alone, with no access to the ground truth. We applied the workflow to four synthetic systems of increasing complexity. In the noise-free cases, the validation loss and the consistency of the learned functions selected hyperparameters whose recovered diffusion and growth functions came within 5% of the ground truth, at reasonable training cost. Because these tests are carried out in a controlled setting where the truth is known, they lend credence not only to the workflow but to BINNs themselves.
The workflow yields four transferable rules of thumb, each grounded in the case studies. First, the state (density) MLP should be made substantially wider than the RHS MLPs, since the density MLP must capture the full spatiotemporal dynamics of the data, whereas the RHS MLPs need only represent the comparatively simple coefficient functions considered here. Second, keep the RHS MLPs narrow and scale their widths with the expected complexity of each term: W D = 2 W_D = 2 W D = 2 was sufficient from non-constant diffusion through coupled diffusion and growth (Cases II–III, Figure 8 –Figure 9 ), increasing only modestly to W D = W G = 4 W_D = W_G = 4 W D = W G = 4 in the higher-dimensional 2D+t setting (Case IV, Figure 10 ). Third, capacity is better spent on width than on depth: three hidden layers sufficed for all networks, with the validation loss and recovered functions largely insensitive to further depth, consistent with the simple targets of the RHS (Case I, Figure 6 ). Fourth, the early-stopping patience should be selected using both the validation-loss curve and the consistency of the learned terms, judging all coupled terms simultaneously (Cases III and IV, Figure 9 and Figure 10 ). Underpinning all four rules of thumb, the trend in the validation loss, which needs no ground truth, tracks the otherwise-unobservable joint error in the recovered functions (Case I, Figure 5 and Figure 7 ), and this is what makes these ground-truth-free selections trustworthy.
Recent work by Crossley et al. [34 ] studies how architecture and optimisation choices affect BINN performance on 1 D + t 1\mathrm{D}+t 1 D + t advection–diffusion–reaction models, finding that moderately expressive architectures, intermediate learning rates, and balanced data and PDE losses are key to reliable recovery of the RHS functions. Whereas their study surveys the influence of individual optimisation hyperparameters, our contribution is an architecture-ordered workflow for jointly selecting network capacity and early-stopping patience, extended here to noisy two-dimensional data. The two studies’ conclusions agree in the areas where they overlap, namely network capacity and loss weighting (the latter considered in our Supplementary Material SM1.1–SM1.2).
We anticipate that a range of researchers looking to apply BINNs will find this work useful. Recall from § 3.1 that hyperparameters are grouped by how they are set: group 1 consists of generic neural-network settings typically set at standard defaults, group 2 consists of BINN-specific settings typically set from domain knowledge and practical considerations, and group 3 consists of the problem-specific hyperparameters (network capacities and early-stopping patience) that the workflow in Figure 4 tunes. How the hyperparameters from this work can be reused depends on how closely the considered problem resembles the reaction–diffusion setting studied here: (i) researchers with a closely related problem (reaction–diffusion dynamics on 1 D + t 1\mathrm{D}+t 1 D + t or 2 D + t 2\mathrm{D}+t 2 D + t data) can adopt the values reported here directly; (ii) those with an in-between problem (a PDE whose RHS terms are of comparable functional complexity to those studied here) re-derive the group 3 hyperparameters on their own data while reusing those from group 2; and (iii) researchers tackling a new problem (a PDE that differs substantially from the setting studied here) re-derive both group 2 and group 3 hyperparameters via an analogous study. Figure 11 summarises these recommendations and lists the hyperparameter values.
Figure 11. A user guide to hyperparameter selection. Top. Which hyperparameters a researcher is recommended to reuse from the table below, and how the remaining ones are obtained, depend on how closely their problem matches the reaction–diffusion setting. Bottom. Hyperparameters categorised by groups and problem; grey cells mark hyperparameters that must be re-derived on the user’s own data.
Our workflow is deliberately geared towards practical use on real problems, and this pragmatic focus comes with limitations. Because a full sweep over all hyperparameters would be computationally infeasible, the workflow adopts a semi-sequential approach: it selects the state MLP width, then the RHS MLP widths, then the early-stopping patience, following the network’s data flow and focusing on widths rather than examining the MLP depths in comparable detail. Although earlier selections are re-checked as the downstream hyperparameters are chosen, this semi-sequential approach may miss well-performing hyperparameter configurations that a full joint optimisation would uncover. A further practical aspect is that some practitioner judgement is inevitable in evaluating workflow outputs. No fixed quantitative thresholds would transfer across application problems, and the diagnostics are therefore read qualitatively, by identifying where a cost-performance curve saturates or where the learned functions stop changing.
A limitation of the study itself is that we validate the workflow against synthetic ground truth rather than experimental data, and at only modest noise levels (up to 5%). This lets us assess the recovered functions against a known reference, but it leaves open how the procedure behaves under the additional confounders of real measurements, including higher noise levels and model misspecification. However, to demonstrate applicability, we apply the workflow to real 2 D + t 2\mathrm{D}+t 2 D + t microscopy data in a concurrent study [11 ] . Future work could investigate the workflow’s robustness to extensions of the BINN setting, including PDEs with additional or different RHS terms (for example, advection), and RHS terms that depend not only on density but also on covariates such as space, time, or background environmental factors.
The work presented in this study lowers the barrier to BINN-based equation learning by making hyperparameter selection for BINNs systematic, documented, and ground-truth-free, with its choices verified against synthetic ground truth. It thereby supports wider and more reproducible use of BINNs across biological modelling problems.
Code
Full code is available on GitHub:
https://github.com/williamlavery/binn-hyperparam-selection
Acknowledgements
JAC and SH were supported by the Kjell och Märta Beijer Foundation. SH was supported by the Swedish Research Council (project 2024-05621).
Synthetic data scenarios and BINN architecture overview
Figure A.1. Schematic overview of diffusion and reaction–diffusion models for synthetic dataset generation. Top. The diffusion-only BINN architecture handles Case I (constant diffusion) and Case II (linear, quadratic, and exponential diffusion). Bottom. The reaction–diffusion BINN architecture handles Cases III and IV (1D+t t t and 2D+t t t , respectively). Cases I–III are 1D+t t t and use a cosine initial condition with noise-free cell-density data. Case IV is 2D+t t t and uses a cosine-squared initial condition with 5% additive Gaussian noise (γ = 1 \gamma= 1 γ = 1 ), illustrated by a representative constant-x 2 x_2 x 2 cross-section.
Ground-truth verification of the learned functions
Comparisons between the predicted and true data-generating functions for case studies II–IV are provided below.
Case II: non-constant diffusion (1D+t)
Figure A.2. Ground-truth verification for Case II. Mean-squared error (MSE) of the learned diffusion function D ^ ( u ) \hat{D}(u) D ^ ( u ) with respect to the known forms, across the diffusion-network width (W D W_D W D ) and the early-stopping patience (E S ES E S ), one panel per form: (a) linear (D 2 D_2 D 2 ), (b) quadratic (D 3 D_3 D 3 ), (c) exponential (D 4 D_4 D 4 ).
Case III: coupled diffusion and growth (1D+t)
Figure A.3. Cost-performance and function-error diagnostics for Case III across right-hand side (RHS) network widths. Constant diffusion (D 1 D_1 D 1 ) paired with four growth forms—constant (G 1 G_1 G 1 ), linear (G 2 G_2 G 2 ), quadratic (G 3 G_3 G 3 ), and exponential (G 4 G_4 G 4 ). Diffusion and growth network widths are always equal (W D = W G W_D = W_G W D = W G ). Early-stopping patience is fixed at 3000 epochs. Panel (a) shows the validation loss across the four ground-truth growth functions and the RHS network widths, (b) the corresponding runtimes, (c) the diffusion-function error, and (d) the growth-function error.
Figure A.4. Cost-performance and function-error diagnostics for Case III across early-stopping patiences. Constant diffusion (D 1 D_1 D 1 ) paired with four growth forms—constant (G 1 G_1 G 1 ), linear (G 2 G_2 G 2 ), quadratic (G 3 G_3 G 3 ), and exponential (G 4 G_4 G 4 ). Early-stopping patience across E S ∈ { 2000 , 3000 , 5000 } ES \in\{2000, 3000, 5000\} E S ∈ { 2000 , 3000 , 5000 } , and right-hand side network widths W D = W G = 2 W_D = W_G = 2 W D = W G = 2 . (a) shows the validation loss across the four ground-truth growth functions and early-stopping patience, (b) the corresponding runtimes, (c) the diffusion-function error, and (d) the growth-function error.
Case IV: coupled diffusion and growth with noisy data (2D+t)
Figure A.5. Performance for Case IV across right-hand side (RHS) widths. Constant diffusion (D 1 D_1 D 1 ) paired with linear growth (G 2 G_2 G 2 ). Panel (a) shows the validation loss across four joint RHS MLP widths W D = W G ∈ { 2 , 4 , 8 , 16 } W_D = W_G \in\{2, 4, 8, 16\} W D = W G ∈ { 2 , 4 , 8 , 16 } and four early-stopping patience values E S ∈ { 500 , 1000 , 2000 , 3000 } ES \in\{500, 1000, 2000, 3000\} E S ∈ { 500 , 1000 , 2000 , 3000 } . Panel (b) shows the corresponding diffusion and growth predictions for E S = 3000 ES = 3000 E S = 3000 .
Figure A.6. Ground-truth verification for Case IV with W D = W G = 4 W_D = W_G = 4 W D = W G = 4 . Mean-squared error (MSE) of learned functions against the known D 1 ( u ) D_1(u) D 1 ( u ) and G 2 ( u ) G_2(u) G 2 ( u ) , across the early-stopping patiences (ES), for the noisy 2 D + t 2D+t 2 D + t data. (a) Diffusion-function error. (b) Growth-function error.
Supplementary Material
In § 11 we motivate our choices for the group 2 hyperparameters, and in § 12 we motivate our choice of the data-loss objective. All selections can be made using the ground-truth-free hyperparameter-selection strategy. However, to provide insight into why specific hyperparameters exert their observed effects, we present errors with respect to the ground-truth diffusion and growth functions side by side with the metrics available in experimental settings.
To ensure transparency and reproducibility of the BINN architecture used, we provide a detailed description of the noise implementation, the ground-truth error metrics, data preprocessing, loss function definitions, MLP design, and early-stopping implementation in § 13 .
Group 2 hyperparameters
PDE and data loss weights
Here we motivate why we set λ P D E = λ d a t a = 1 \lambda_{\mathrm{PDE}} = \lambda_{\mathrm{data}} = 1 λ PDE = λ data = 1 . To do this we use synthetic Case I with the addition of noise (γ = 1 \gamma= 1 γ = 1 ). The noise level is set to 1% MPE. We use W u = 64 W_u = 64 W u = 64 , W D = 2 W_D = 2 W D = 2 , and early-stopping patiences E S ∈ { 1000 , 2000 } ES \in\{1000, 2000\} E S ∈ { 1000 , 2000 } . We investigate λ P D E ∈ { 1 , 2 , 10 , 100 } \lambda_{\mathrm{PDE}} \in\{1, 2, 10, 100\} λ PDE ∈ { 1 , 2 , 10 , 100 } , with λ d a t a = 1 \lambda_{\mathrm{data}} = 1 λ data = 1 fixed in Eq. (2) . The motivation for increasing λ P D E \lambda_{\mathrm{PDE}} λ PDE is to examine whether bringing the smaller PDE loss closer to the data loss in magnitude at the start of training improves performance. We set λ b i o = 1 \lambda_{\mathrm{bio}} = 1 λ bio = 1 , with λ D l i m = 0 \lambda_{D_{\mathrm{lim}}} = 0 λ D lim = 0 and λ ∂ D = 10 \lambda_{\partial D} = 10 λ ∂ D = 10 ; see Section SM1.2 for the rationale behind these values.
Figure S.1a–b shows that increasing λ P D E \lambda_{\mathrm{PDE}} λ PDE does not qualitatively alter the running-minimum validation-loss or diffusion-function MSE profiles, although both are systematically shifted upward in value. The increase in validation loss is expected, since a larger λ P D E \lambda_{\mathrm{PDE}} λ PDE directly increases the weighted contribution of the PDE residual to the total loss. By contrast, the associated slowdown in diffusion-function recovery is more subtle and is difficult to diagnose from the total validation loss alone. To remove the dependence on the loss weights and aid comparison of the training dynamics, we therefore plot the data and PDE loss components normalised by λ d a t a \lambda_{\mathrm{data}} λ data and λ P D E \lambda_{\mathrm{PDE}} λ PDE , respectively (Fig. S.1c,d). We also examine the difference between the data and density predictions for a given TV split as a function of density to provide further information (Fig. S.1e).
Figure S.1c shows that during the early stages of training, larger values of λ P D E \lambda_{\mathrm{PDE}} λ PDE impede recovery of the density, as evidenced by the substantially higher data loss. This delayed density recovery is accompanied by slower diffusion-function recovery. Beyond approximately 500 epochs, however, the data loss curves for λ P D E ≤ 10 \lambda_{\mathrm{PDE}} \le10 λ PDE ≤ 10 become very similar. Although the normalised PDE loss is substantially lower for λ P D E = 10 \lambda_{\mathrm{PDE}} = 10 λ PDE = 10 than for λ P D E = 1 , 2 \lambda_{\mathrm{PDE}} = 1, 2 λ PDE = 1 , 2 , the corresponding diffusion predictions (Fig. S.1f–i) show that this reduction does not materially improve recovery by the end of training. This suggests that accurate density matching is the main bottleneck limiting diffusion-function recovery.
For λ P D E = 100 \lambda_{\mathrm{PDE}} = 100 λ PDE = 100 , more than 1000 epochs are required before the data loss becomes comparable to that obtained with smaller PDE weights, and a similar delay is consequently observed in the diffusion-function recovery. Moreover, Fig. S.1i shows that approximately 4000 additional epochs are required before the diffusion predictions begin to stabilise, relative to the runs with small λ P D E \lambda_{\mathrm{PDE}} λ PDE . Despite the data and PDE losses eventually reaching values comparable to those obtained for smaller λ P D E \lambda_{\mathrm{PDE}} λ PDE , Fig. S.1f–j show that λ P D E = 100 \lambda_{\mathrm{PDE}} = 100 λ PDE = 100 nevertheless produces the poorest final recovery of the diffusion function. To more carefully diagnose this discrepancy, we examine the difference between the observed and learned density profiles. This reveals a substantially larger error in the low-density regime for λ P D E = 100 \lambda_{\mathrm{PDE}} = 100 λ PDE = 100 (Fig. S.1e). Since the initial condition is a cosine profile (see Table 2 ), these low densities correspond to the troughs of the early-time profiles, where the density is overestimated. This systematic density overestimation is associated with underestimation of the inferred diffusion function in the same density regime. In practice, pronounced and persistent discrepancies concentrated around particular density values may therefore provide a useful diagnostic warning sign, especially when those discrepancies can be linked to a specific feature of the underlying dynamics.
Overall, increasing the constant λ P D E \lambda_{\mathrm{PDE}} λ PDE does not systematically improve diffusion-function recovery; instead, it can both slow optimisation and impair accurate recovery. Intuitively, strong enforcement of the PDE constraint is most beneficial only after the data have been fitted sufficiently well. Placing too much emphasis on the PDE term early in training can therefore hinder the data fitting needed for accurate subsequent recovery of the diffusion function.
The data and PDE terms compete along a Pareto front whose shape is skewed by how the system parameters scale the residual [18 ] . Among fixed weights, Fig. S.1 suggests that the naive choice of equal weights λ d a t a = λ P D E = 1 \lambda_{\mathrm{data}} = \lambda_{\mathrm{PDE}} = 1 λ data = λ PDE = 1 is a reasonable default. Dynamic weighting strategies instead balance the terms adaptively, which can be more effective, but can incur additional computational cost and typically require tuning. We retain fixed weights here, leaving more effective balancing, for instance via constrained-optimisation schemes such as PINNverse [35 ] , to future work.
Figure S.1. Performance across PDE-loss weights λ P D E \lambda_{\mathrm{PDE}} λ PDE for synthetic Case I with 1% mean percentage error noise. Ground truth: D 1 ( u ) D_1(u) D 1 ( u ) . Hyperparameters: λ d a t a = 1 \lambda_{\mathrm{data}} = 1 λ data = 1 , W u = 64 W_u = 64 W u = 64 , W D = 2 W_D = 2 W D = 2 , early-stopping patiences E S ∈ { 1000 , 2000 } ES \in\{1000, 2000\} E S ∈ { 1000 , 2000 } , and λ P D E ∈ { 1 , 2 , 10 , 100 } \lambda_{\mathrm{PDE}} \in\{1, 2, 10, 100\} λ PDE ∈ { 1 , 2 , 10 , 100 } . (a), (b) consist of 3 training–validation (TV) splits: markers show the minimum for each E S ES E S , and shading shows the corresponding min–max range. (c)–(i) consist of the first TV split at E S = 2000 ES = 2000 E S = 2000 . (a) running minimum validation loss. (b) running minimum diffusion-function mean-squared error (MSE). (c) running normalised mean validation data loss smoothed over the preceding 25 epochs. (d) running normalised mean validation PDE loss smoothed over the preceding 25 epochs. (e) mean difference between the density network and the data as a function of density (bin size of 100 cells mm− 2 ^{-2} − 2 ). Blocks (f)–(i) show diffusion predictions sampled every 100 epochs with light-to-dark shading corresponding to increasing epochs, with the final best model indicated by a solid black line. The ± 5 % \pm5\% ± 5% mean percentage error (MPE) bands are shown for reference.
Weights in biological loss
Here we motivate the choice of the biological weights in Eq. (6) : λ D l i m = λ G l i m = 0 \lambda_{D_{\mathrm{lim}}} = \lambda_{G_{\mathrm{lim}}} = 0 λ D lim = λ G lim = 0 and λ ∂ D = λ ∂ G = 10 \lambda_{\partial D} = \lambda_{\partial G} = 10 λ ∂ D = λ ∂ G = 10 . To do this we use synthetic Case I. We use W u ∈ { 16 , 64 } W_u \in\{16, 64\} W u ∈ { 16 , 64 } , W D = 2 W_D = 2 W D = 2 , and early-stopping patience E S = 1000 ES = 1000 E S = 1000 . Since we enforce constraints on the normalised diffusion and growth predictions equally, we couple the corresponding weights such that λ D l i m = λ G l i m \lambda_{D_{\mathrm{lim}}} = \lambda_{G_{\mathrm{lim}}} λ D lim = λ G lim and λ ∂ D = λ ∂ G \lambda_{\partial D} = \lambda_{\partial G} λ ∂ D = λ ∂ G throughout.
To enforce constraints strictly, we initially set λ D l i m = λ ∂ D = 10 4 \lambda_{D_{\mathrm{lim}}} = \lambda_{\partial D} = 10^4 λ D lim = λ ∂ D = 1 0 4 . However, this produces a persistent plateau in minimum validation loss (Fig. S.2a), indicating that the density network fails to learn the data while diffusion predictions remain fixed near d max = 0.10 m m 2 d a y s − 1 d_{\max} = 0.10\ \mathrm{mm}^2\ \mathrm{days}^{-1} d m a x = 0.10 mm 2 days − 1 throughout training (Fig. S.2b,c). This suggests excessively large penalty weights overly restrict optimisation, preventing the density network from accurately representing the data and consequently inhibiting diffusion learning.
Subsequently setting λ D l i m = λ ∂ D = 0 \lambda_{D_{\mathrm{lim}}} = \lambda_{\partial D} = 0 λ D lim = λ ∂ D = 0 allows validation loss profiles to decrease rapidly across several orders of magnitude without pronounced plateaus (Fig. S.2d). This improvement is reflected in rescaled diffusion predictions, which quickly drop from initialised values near 0.10 m m 2 d a y s − 1 0.10\ \mathrm{mm}^2\ \mathrm{days}^{-1} 0.10 mm 2 days − 1 to approximately 0.04 m m 2 d a y s − 1 0.04\ \mathrm{mm}^2\ \mathrm{days}^{-1} 0.04 mm 2 days − 1 (Fig. S.2e,f) before converging. Visualising predictions across epochs suggests the bounding constraint is contextually redundant: because network outputs are initialised near one while the true normalised diffusion coefficient is substantially smaller, the network naturally moves below the upper bound without explicit enforcement. However, unlike the bounding constraint, the monotonicity constraint cannot simply be removed without undesirable consequences (evidenced in Fig. S.2e for W u = 16 W_u = 16 W u = 16 ).
Figure S.2. Performance when using large weights in the biological loss for synthetic Case I. Ground truth: D 1 ( u ) D_1(u) D 1 ( u ) . Hyperparameters: W u ∈ { 16 , 64 } W_u \in\{16,64\} W u ∈ { 16 , 64 } , W D = 2 W_D = 2 W D = 2 , and early-stopping patience E S = 1000 ES = 1000 E S = 1000 . (a) Running minimum validation loss across 3 training–validation (TV) splits: markers show the minimum for E S = 1000 ES = 1000 E S = 1000 , and shading shows the corresponding min–max range. (b) Diffusion predictions for W u = 16 W_u = 16 W u = 16 sampled every 100 epochs for the first TV split. Light-to-dark shading corresponds to increasing epochs, with the best model indicated by a solid black line. The ±5% mean percentage error (MPE) bands are shown for reference. (c) Same as (b) for W u = 64 W_u = 64 W u = 64 . (d)–(f) as in (a)–(c) for λ D l i m = λ ∂ D = 0 \lambda_{D_{\mathrm{lim}}} = \lambda_{\partial D} = 0 λ D lim = λ ∂ D = 0 .
Since the bounding constraint is essentially redundant here, we set λ D lim = 0 \lambda_{D\lim} = 0 λ D l i m = 0 and look only at the effect of λ ∂ D ∈ { 10 , 10 3 , 10 4 , 10 6 } \lambda_{\partial D} \in\{10, 10^{3}, 10^{4}, 10^{6}\} λ ∂ D ∈ { 10 , 1 0 3 , 1 0 4 , 1 0 6 } . In Fig. S.3a–b, smaller weights (λ ∂ D = 10 \lambda_{\partial D} = 10 λ ∂ D = 10 and 10 3 10^{3} 1 0 3 ) keep the healthy validation-loss profiles seen when L b i o = 0 \mathcal{L}_{\mathrm{bio}} = 0 L bio = 0 . In contrast, larger weights introduce a validation-loss plateau (Fig. S.3c–d), leading to slower convergence in the diffusion predictions (Fig. S.4). Even so, all λ ∂ D \lambda_{\partial D} λ ∂ D give similar final diffusion predictions, especially for W u = 64 W_u = 64 W u = 64 .
Figure S.3. Performance across monotonicity weights λ ∂ D \lambda_{\partial D} λ ∂ D for synthetic Case I. Ground truth: D 1 ( u ) D_1(u) D 1 ( u ) . Hyperparameters: W u ∈ { 16 , 64 } W_u \in\{16, 64\} W u ∈ { 16 , 64 } , W D = 2 W_D = 2 W D = 2 , and early-stopping patience E S = 1000 ES = 1000 E S = 1000 . All plots consist of 3 training–validation splits: markers show the minimum for E S = 1000 ES = 1000 E S = 1000 , and shading shows the corresponding min–max range. Within each block (a)–(d), from left to right: running minimum validation loss, running minimum diffusion-function mean-squared error (MSE), and running mean monotonicity loss.
Across all six cases (three TV splits across W u ∈ { 16 , 64 } W_u \in\{16,64\} W u ∈ { 16 , 64 } ), the network satisfies the monotonicity constraint to machine precision at the best model—the saved checkpoint at epoch e s a v e_{\mathrm{sav}} e sav (Algorithm 1), which is the model carried forward (Fig. S.3). However, for W u = 16 W_u = 16 W u = 16 , the diffusion function is non-monotonic at numerous points during training and for λ ∂ D = 10 3 , 10 4 \lambda_{\partial D} = 10^3, 10^4 λ ∂ D = 1 0 3 , 1 0 4 this can occur near the end of training (Fig. S.3). Increasing the weight to λ ∂ D = 10 6 \lambda_{\partial D} = 10^6 λ ∂ D = 1 0 6 fixes this issue. The weight is now large enough that every network quickly reaches and keeps monotonicity. Furthermore, this setting yields the best learned diffusion functions for both widths, but reintroduces the validation-loss plateau observed in Fig. S.2a.
The user therefore has three options: (i) strongly enforce the constraint and offset optimiser stiffness with a higher E S ES E S , at the cost of longer runtimes; (ii) use a smaller weight that promotes constraint satisfaction without hindering optimisation, while verifying that the constraint is met; or (iii) schedule the weight to combine both approaches, at the cost of an additional scenario-dependent hyperparameter. We adopt (ii), setting λ D l i m = λ G l i m = 0 \lambda_{D_{\mathrm{lim}}} = \lambda_{G_{\mathrm{lim}}} = 0 λ D lim = λ G lim = 0 and λ ∂ D = λ ∂ G = 10 \lambda_{\partial D} = \lambda_{\partial G} = 10 λ ∂ D = λ ∂ G = 10 .
Figure S.4. Diffusion predictions across monotonicity weights λ ∂ D \lambda_{\partial D} λ ∂ D for synthetic Case I. Ground truth: D 1 ( u ) D_1(u) D 1 ( u ) . Hyperparameters: W u ∈ { 16 , 64 } W_u \in\{16,64\} W u ∈ { 16 , 64 } , W D = 2 W_D = 2 W D = 2 , and early-stopping patience E S = 1000 ES = 1000 E S = 1000 . All plots correspond to the first of the 3 training–validation splits. Blocks (a)–(d): columns show predictions for W u = 16 W_u = 16 W u = 16 and 64. Light-to-dark shading corresponds to increasing epochs, with the final best model indicated by a solid black line. The ± 5 % \pm5\% ± 5% mean percentage error (MPE) bands are shown for reference.
Number of collocation points
Here we examine the effect of the number of PDE collocation points n c n_c n c per minibatch. To do this, we use the ( D 1 , G 2 ) (D_1, G_2) ( D 1 , G 2 ) pairing from synthetic Case III with W u = 64 W_u = 64 W u = 64 , W D = W G = 4 W_D = W_G = 4 W D = W G = 4 , and early-stopping patiences E S ∈ { 1000 , 3000 } ES \in\{1000, 3000\} E S ∈ { 1000 , 3000 } . The collocation points set the quality of the PDE loss gradient at the cost of additional runtime; we investigate n c ∈ { 10 , 100 , 1000 } n_c \in\{10, 100, 1000\} n c ∈ { 10 , 100 , 1000 } .
The PDE loss L P D E \mathcal{L}_{\mathrm{PDE}} L PDE in Eq. (5) is a Monte Carlo estimate of the squared PDE residual integrated over the space–time domain (evaluated on n c n_c n c points drawn each minibatch). At low n c n_c n c , this estimate becomes sparse and noisy, providing the optimiser with a weak, unrepresentative signal of the global residual. While increasing n c n_c n c stabilises optimisation, it increases per-epoch runtime—leading to saturating returns once n c n_c n c is large enough to cover the domain sufficiently densely. Figure S.5a shows this saturation effect: the n c = 10 n_c = 10 n c = 10 runs reach the main loss drop markedly later than n c = 100 n_c = 100 n c = 100 and n c = 1000 n_c = 1000 n c = 1000 , while the latter two are nearly coincident, and reaching that drop earlier costs little. Runtimes for n c = 10 n_c = 10 n c = 10 and n c = 100 n_c = 100 n c = 100 are similar (Fig. S.5b), and only rise sharply at n c = 1000 n_c = 1000 n c = 1000 . The consequence of using too few collocation points is seen in the component losses (Fig. S.5c): the larger validation loss at n c = 10 n_c = 10 n c = 10 is driven by the data term, while its PDE component is, in fact, lower than at n c = 1000 n_c = 1000 n c = 1000 . This is an under-sampling artefact. With only 10 points the BINN can drive the empirical residual small at those locations without necessarily satisfying the PDE elsewhere.
Function recovery shows the same saturation as the validation loss (Fig. S.5d,e): the diffusion- and growth-function MSE profiles are nearly indistinguishable for n c = 100 n_c = 100 n c = 100 and n c = 1000 n_c = 1000 n c = 1000 . Turning to the diffusion and growth predictions at E S = 3000 ES = 3000 E S = 3000 , the n c = 10 n_c = 10 n c = 10 best model provides the most accurate recovery of the ground-truth diffusion and growth functions (Fig. S.5f), even though its data loss remains higher (Fig. S.5c), whereas the n c = 100 n_c = 100 n c = 100 (Fig. S.5g) and n c = 1000 n_c = 1000 n c = 1000 (Fig. S.5h) predictions are highly consistent across epochs. The n c = 10 n_c = 10 n c = 10 result is an identifiability issue: the BINN can recover diffusion and growth functions close to the ground truth while still carrying a larger systematic error in the density fit. We therefore do not select n c = 10 n_c = 10 n c = 10 , since its accurate recovery is incidental rather than systematic and could not be identified as such without the ground truth.
The dominant effect of increasing n c n_c n c appears to be the reliability of the PDE training signal and not necessarily a consistent improvement in the recovered functions. Moving from n c = 10 n_c = 10 n c = 10 to 100 100 100 materially changes the optimisation trajectory, whereas 100 100 100 to 1000 1000 1000 yields diminishing returns. In this regime (n c ≥ 100 n_c \ge100 n c ≥ 100 ), prediction quality appears to be limited primarily by optimisation dynamics and model–data properties rather than collocation error. Therefore, we use n c = 100 n_c = 100 n c = 100 for the more computationally demanding 2D+t case, while the lower computational cost of 1D+t allows us to conservatively use n c = 1000 n_c = 1000 n c = 1000 .
Figure S.5. Performance across collocation points n c n_c n c for synthetic Case III. Ground truth: D 1 ( u ) D_1(u) D 1 ( u ) and G 2 ( u ) G_2(u) G 2 ( u ) . Hyperparameters: W u = 64 W_u = 64 W u = 64 , W D = W G = 4 W_D = W_G = 4 W D = W G = 4 , early-stopping patiences E S ∈ { 1000 , 3000 } ES \in\{1000, 3000\} E S ∈ { 1000 , 3000 } and n c ∈ { 10 , 100 , 1000 } n_c \in\{10, 100, 1000\} n c ∈ { 10 , 100 , 1000 } . (a)–(e) consist of 3 training–validation (TV) splits: markers show the minimum for each E S ES E S , and shading in (a), (d) and (e) shows the corresponding min–max range. (a) running minimum validation loss. (b) runtimes. (c) running minimum PDE and data loss components. (d) and (e) running minimum mean-squared error (MSE) for diffusion and growth predictions. Blocks (f)–(h) show n c = 10 n_c = 10 n c = 10 , 100 and 1000 for E S = 3000 ES = 3000 E S = 3000 , where predictions correspond to the second TV split. Within each block, from left to right: diffusion predictions over a wide interval, diffusion predictions on a narrow interval, and growth predictions over a wide interval. Light-to-dark shading corresponds to increasing epochs, with the final best model indicated by a solid black line. The ± 5 % \pm5\% ± 5% mean percentage error (MPE) bands are shown for reference.
Activation functions
Here we examine how the choice of hidden-layer activation function (AF) affects performance, an effect that can be substantial for PINNs [36 ] . To do this, we use synthetic Case I. We use W u ∈ { 8 , 16 , 32 , 64 , 128 } W_u \in\{8, 16, 32, 64, 128\} W u ∈ { 8 , 16 , 32 , 64 , 128 } , W D = 2 W_D = 2 W D = 2 , and early-stopping patiences E S ∈ { 1000 , 2000 , 3000 } ES \in\{1000, 2000, 3000\} E S ∈ { 1000 , 2000 , 3000 } .
We evaluate three smooth activation functions commonly used in PINN applications [13 ] : (i) sigmoid: σ ( x ) = 1 1 + e − x \sigma(x) = \frac{1}{1+e^{-x}} σ ( x ) = 1 + e − x 1 ; (ii) hyperbolic tangent (tanh): tanh ( x ) = e x − e − x e x + e − x \tanh(x) = \frac{e^x-e^{-x}}{e^x+e^{-x}} tanh ( x ) = e x + e − x e x − e − x ; (iii) SiLU (Sigmoid Linear Unit), also known as Swish [37 , 38 ] : SiLU ( x ) = x σ ( x ) = x 1 + e − x \operatorname{SiLU}(x) = x\sigma(x) = \frac{x}{1+e^{-x}} SiLU ( x ) = x σ ( x ) = 1 + e − x x . Note that tanh and sigmoid are related by tanh ( x ) = 2 σ ( 2 x ) − 1 \tanh(x) = 2\sigma(2x) - 1 tanh ( x ) = 2 σ ( 2 x ) − 1 , so they span similar function classes; SiLU differs qualitatively in being unbounded above and non-monotone, decreasing for x < x ∗ x < x^* x < x ∗ to a global minimum SiLU ( x ∗ ) ≈ − 0.278 \operatorname{SiLU}(x^*) \approx-0.278 SiLU ( x ∗ ) ≈ − 0.278 at x ∗ ≈ − 1.278 x^* \approx-1.278 x ∗ ≈ − 1.278 , which can aid gradient flow during training [38 ] . Since the PDE residual involves second spatial derivatives of the density network, and both the residual and the monotonicity penalties involve first derivatives of the diffusion and growth networks, the AFs must be at least twice continuously differentiable in N N u \mathrm{NN}_u NN u and continuously differentiable in N N D \mathrm{NN}_D NN D and N N G \mathrm{NN}_G NN G . Thus, piecewise-linear functions such as ReLU are excluded. In our setting, the primary bottleneck in the downstream recovery of the diffusion and growth terms is the quality of the density network’s approximation of the density field: a poorly resolved density network propagates errors into the diffusion and growth networks regardless of their capacity. Because the density network is the limiting factor, we select the AF on it and share the choice across all three as a single hyperparameter.
As shown in Fig. S.6a,b, SiLU and tanh achieve similar final validation losses and exhibit comparable loss trajectories for widths up to W u = 32 W_u = 32 W u = 32 . Beyond this point, the mean validation loss for tanh plateaus and the min–max spread across TV splits increases, whereas the validation loss for SiLU continues to decrease. In contrast, sigmoid performs substantially worse (Fig. S.6c), with validation losses significantly larger and markedly greater variability across W u W_u W u . Furthermore, its performance does not improve for W u > 32 W_u > 32 W u > 32 . The diffusion predictions across epochs for W u = 64 W_u = 64 W u = 64 , E S = 2000 ES = 2000 E S = 2000 are generally consistent with the validation losses. SiLU reaches its best model fastest and recovers a near-constant diffusion in close agreement with what tanh attains, though tanh requires nearly twice as many epochs (Fig. S.6a,b). sigmoid is both the slowest and the least well-behaved: although close to constant through the central density range, its prediction turns sharply upward at high densities (Fig. S.6c). This discrepancy in the diffusion predictions aligns with the poorer validation loss achieved compared to the other AFs.
Turning to the diffusion MSE profiles, we see that SiLU exhibits a steady reduction in error with both epoch and W u W_u W u (Fig. S.6a). tanh attains comparably accurate diffusion estimates only at the largest widths, while its MSE trajectory is markedly non-monotonic: following an initial sharp decrease, the error rises again for narrower networks (Fig. S.6b). This behaviour is not apparent from the validation-loss profiles alone, but can be deduced by examining the consistency of the diffusion predictions across epochs and relative to the final SiLU predictions (Fig. S.6a,b). By comparison, sigmoid converges substantially more slowly, with the diffusion MSE remaining near O ( 10 − 4 ) O(10^{-4}) O ( 1 0 − 4 ) for many epochs and training generally terminating only after considerably more epochs (Fig. S.6c). This poorer convergence is consistent with the higher validation losses obtained with sigmoid relative to tanh and SiLU.
Taken together, SiLU yields competitive final validation losses, consistent loss profiles across epochs, relatively fast convergence, and superior diffusion-function recovery for W u ≥ 64 W_u \ge64 W u ≥ 64 . While tanh achieves competitive final validation losses, its diffusion-function recovery improves only at larger widths and comes at the expense of heightened sensitivity to E S ES E S , whereas sigmoid is consistently the weakest AF across both validation loss and function recovery metrics. Consequently, we adopt SiLU as the default AF across all three networks.
Figure S.6. Performance across activation functions SiLU, tanh and sigmoid for synthetic Case I. Hyperparameters: W u ∈ { 8 , 16 , 32 , 64 , 128 } W_u \in\{8, 16, 32, 64, 128\} W u ∈ { 8 , 16 , 32 , 64 , 128 } , W D = 2 W_D = 2 W D = 2 , early-stopping patiences E S ∈ { 1000 , 2000 , 3000 } ES \in\{1000, 2000, 3000\} E S ∈ { 1000 , 2000 , 3000 } and activation functions { S i L U , tanh , s i g m o i d } \{\mathrm{SiLU}, \tanh, \mathrm{sigmoid}\} { SiLU , tanh , sigmoid } . For all running-minimum plots across training–validation (TV) splits: markers show the minimum for each E S ES E S , and shading shows the corresponding min–max range. For each of (a)–(c) top to bottom: validation loss, running minimum validation loss, running minimum diffusion mean-squared error (MSE), and diffusion predictions across epochs for the first TV split of W u = 64 W_u = 64 W u = 64 , W D = 2 W_D = 2 W D = 2 . Light-to-dark shading corresponds to increasing epochs, with the final best model indicated by a solid black line. The ± 5 % \pm5\% ± 5% mean percentage error (MPE) bands are shown for reference.
Least-squares versus generalised least-squares data losses
Here we compare the generalised least-squares (GLS) objective of Lagergren et al. [8 ] to the standard least-squares (LS) loss. To do this we use synthetic Case I with the addition of noise (γ = 1 \gamma= 1 γ = 1 ). The noise level is set to 1% MPE. We use W u = 64 W_u = 64 W u = 64 , W D = 2 W_D = 2 W D = 2 , and early-stopping patiences E S ∈ { 500 , 2000 } ES \in\{500, 2000\} E S ∈ { 500 , 2000 } .
From a statistical perspective, the GLS loss is the natural choice under the noise model in Eq. (3) , assuming that the variance-scaling coefficients ω i , j , s \omega_{i,j,s} ω i , j , s are uniform; see § 13.5.1 for details. Nevertheless, in practice we find that the standard LS loss often yields better performance. To understand why this is the case, we compare how each objective weights individual data points and how these weights can affect optimisation.
The density data lie on the grid (written for d = 2 d = 2 d = 2 as in the main text; Case I here has d = 1 d = 1 d = 1 )
( x 1 , i , x 2 , j , t s ) ∈ G , ( i , j , s ) ∈ { 1 , … , n x 1 } × { 1 , … , n x 2 } × { 1 , … , n t } , (x_{1,i}, x_{2,j}, t_s) \in\mathcal{G}, \qquad(i,j,s) \in\{1,\ldots,n_{x_1}\} \times\{1,\ldots,n_{x_2}\} \times\{1,\ldots,n_t\}, ( x 1 , i , x 2 , j , t s ) ∈ G , ( i , j , s ) ∈ { 1 , … , n x 1 } × { 1 , … , n x 2 } × { 1 , … , n t } ,
with N = n x 1 n x 2 n t N = n_{x_1}n_{x_2}n_t N = n x 1 n x 2 n t data points in total. As defined in Eq. (4) , the LS data loss for 2D+t t t is
L d a t a ( u ^ ) = 1 N ∑ i = 1 n x 1 ∑ j = 1 n x 2 ∑ s = 1 n t ( u d a t a i , j , s − u ^ ( x 1 , i , x 2 , j , t s ) ) 2 , \mathcal{L}_{\mathrm{data}}(\hat{u}) = \frac{1}{N} \sum_{i=1}^{n_{x_1}} \sum_{j=1}^{n_{x_2}} \sum_{s=1}^{n_t} \left(u_{\mathrm{data}}^{i,j,s} - \hat{u}(x_{1,i},x_{2,j},t_s)\right)^2, L data ( u ^ ) = N 1 i = 1 ∑ n x 1 j = 1 ∑ n x 2 s = 1 ∑ n t ( u data i , j , s − u ^ ( x 1 , i , x 2 , j , t s ) ) 2 ,
and the GLS loss is
L G L S ( u ^ ) = 1 N ∑ i = 1 n x 1 ∑ j = 1 n x 2 ∑ s = 1 n t ( u d a t a i , j , s − u ^ ( x 1 , i , x 2 , j , t s ) u ^ ( x 1 , i , x 2 , j , t s ) γ ) 2 . \mathcal{L}_{\mathrm{GLS}}(\hat{u}) = \frac{1}{N} \sum_{i=1}^{n_{x_1}} \sum_{j=1}^{n_{x_2}} \sum_{s=1}^{n_t} \left(\frac{u_{\mathrm{data}}^{i,j,s} - \hat{u}(x_{1,i},x_{2,j},t_s)}{\hat{u}(x_{1,i},x_{2,j},t_s)^\gamma}\right)^2. L GLS ( u ^ ) = N 1 i = 1 ∑ n x 1 j = 1 ∑ n x 2 s = 1 ∑ n t ( u ^ ( x 1 , i , x 2 , j , t s ) γ u data i , j , s − u ^ ( x 1 , i , x 2 , j , t s ) ) 2 .
In practice, clipping is required to ensure that u ^ γ ≠ 0 \hat{u}^\gamma\ne0 u ^ γ = 0 at all sampled points, and γ \gamma γ must typically be estimated from data. To isolate the effect of the loss itself, we instead consider the idealised setting in which γ \gamma γ is known a priori , and compare training under L d a t a \mathcal{L}_{\mathrm{data}} L data and L G L S \mathcal{L}_{\mathrm{GLS}} L GLS . To interpret the difference between these objectives, we flatten the grid coordinates ( x 1 , i , x 2 , j , t s ) ∈ G (x_{1,i},x_{2,j},t_s) \in\mathcal{G} ( x 1 , i , x 2 , j , t s ) ∈ G into a single row-major index k = ( i − 1 ) n x 2 n t + ( j − 1 ) n t + s k = (i - 1)n_{x_2}n_t + (j - 1)n_t + s k = ( i − 1 ) n x 2 n t + ( j − 1 ) n t + s , defining u ^ k = u ^ ( x 1 , i , x 2 , j , t s ) \hat{u}_k = \hat{u}(x_{1,i},x_{2,j},t_s) u ^ k = u ^ ( x 1 , i , x 2 , j , t s ) and u d a t a k = u d a t a i , j , s u_{\mathrm{data}}^k = u_{\mathrm{data}}^{i,j,s} u data k = u data i , j , s . The GLS loss for a single point k k k can then be written as
( u d a t a k − u ^ k u ^ k γ ) 2 = w k ( u d a t a k − u ^ k ) 2 , w k = u ^ k − 2 γ . \left(\frac{u_{\mathrm{data}}^k - \hat{u}_k}{\hat{u}_k^\gamma}\right)^2 = w_k\left(u_{\mathrm{data}}^k - \hat{u}_k\right)^2, \qquad w_k = \hat{u}_k^{-2\gamma}. ( u ^ k γ u data k − u ^ k ) 2 = w k ( u data k − u ^ k ) 2 , w k = u ^ k − 2 γ .
Thus, GLS induces prediction-dependent weights: each pointwise error’s contribution to the total objective depends on the current prediction u ^ k \hat{u}_k u ^ k , with smaller predictions receiving greater weight.
We use three diagnostics based on these weights. First, the ratio L G L S / L d a t a \mathcal{L}_{\mathrm{GLS}}/\mathcal{L}_{\mathrm{data}} L GLS / L data measures the relative scale of the weighted and unweighted data losses. Second, the effective sample fraction N e f f / N N_{\mathrm{eff}}/N N eff / N quantifies how broadly a set of weights is distributed across the dataset. To compare the LS- and GLS-trained models on an equal footing, we evaluate it for both models using the data-generating exponent γ = 1 \gamma= 1 γ = 1 , i.e. with weights
w k L S = ( u ^ k L S ) − 2 , w k G L S = ( u ^ k G L S ) − 2 , w_k^{\mathrm{LS}} = \left(\hat{u}_k^{\mathrm{LS}}\right)^{-2}, \qquad w_k^{\mathrm{GLS}} = \left(\hat{u}_k^{\mathrm{GLS}}\right)^{-2}, w k LS = ( u ^ k LS ) − 2 , w k GLS = ( u ^ k GLS ) − 2 ,
where u ^ k L S \hat{u}_k^{\mathrm{LS}} u ^ k LS and u ^ k G L S \hat{u}_k^{\mathrm{GLS}} u ^ k GLS are the density predictions of the models trained with L d a t a \mathcal{L}_{\mathrm{data}} L data and L G L S \mathcal{L}_{\mathrm{GLS}} L GLS , respectively. For either set of weights { w k } k = 1 N \{w_k\}_{k=1}^N { w k } k = 1 N , the effective sample size is defined by
N e f f = ( ∑ k = 1 N w k ) 2 ∑ k = 1 N w k 2 = 1 ∑ k = 1 N w ˉ k 2 , w ˉ k = w k ∑ k ′ = 1 N w k ′ . N_{\mathrm{eff}} = \frac{\left(\sum_{k=1}^{N} w_k\right)^2}{\sum_{k=1}^{N} w_k^2} = \frac{1}{\sum_{k=1}^{N} \bar{w}_k^2}, \qquad\bar{w}_k = \frac{w_k}{\sum_{k'=1}^{N} w_{k'}}. N eff = ∑ k = 1 N w k 2 ( ∑ k = 1 N w k ) 2 = ∑ k = 1 N w ˉ k 2 1 , w ˉ k = ∑ k ′ = 1 N w k ′ w k .
Accordingly, N e f f = N N_{\mathrm{eff}} = N N eff = N when all points are weighted equally, whereas N e f f ≈ 1 N_{\mathrm{eff}} \approx1 N eff ≈ 1 when nearly all weight is concentrated on a single point, so that N e f f / N N_{\mathrm{eff}}/N N eff / N measures how much of the dataset is effectively contributing. Third, we compute the fraction of each data loss contributed by its largest 1% of pointwise contributions.
Figure S.7a shows that the choice of data loss substantially affects the absolute scale of the total validation loss, and Fig. S.7b shows that this difference is driven by the data loss component. Because we train on normalised densities for Case I, the density predictions predominantly satisfy u ^ k ≤ 1 \hat{u}_k \leq1 u ^ k ≤ 1 ; consequently, the GLS weights satisfy w k G L S ≥ 1 w_k^{\mathrm{GLS}} \geq1 w k GLS ≥ 1 and inflate the weighted data term relative to the PDE component. Furthermore, the min–max shading across TV splits in Fig. S.7a reveals a clear difference between the loss functions: under GLS, one model maintains a markedly higher validation loss and terminates prematurely, indicating greater sensitivity to the specific split.
The running-minimum diffusion-function MSE in Fig. S.7c mirrors the overall behaviour of the validation loss. For both early-stopping patience values, L d a t a \mathcal{L}_{\mathrm{data}} L data yields better diffusion-function predictions than L G L S \mathcal{L}_{\mathrm{GLS}} L GLS . In both the GLS and LS cases, the learned diffusion initially passes through the correct scale of the true constant diffusion D 1 D_1 D 1 , producing a transiently small MSE. Subsequently, however, the diffusion predictions become meaningful only as the density fit stabilises. The divergence in the diffusion-function MSE during these later stages of training highlights the impact of the chosen data loss on the learned diffusion.
Figure S.7d shows that the ratio L G L S / L d a t a \mathcal{L}_{\mathrm{GLS}}/\mathcal{L}_{\mathrm{data}} L GLS / L data is initially of order one but grows to values in the tens around 200 epochs, indicating that the GLS loss becomes substantially larger than the unweighted LS term. In Fig. S.7e, N e f f / N N_{\mathrm{eff}}/N N eff / N decreases for both models as the density fit resolves the low-density regions, but beyond approximately 100 epochs it falls further for the GLS-trained model, coinciding with the jump in the loss ratio. Hence, the GLS-trained model produces predictions whose weights are more unequally distributed, with a small number of low-density points carrying most of the weight. Figure S.7f confirms this concentration of the loss on a few data points, with the largest 1% of pointwise GLS contributions accounting for a large proportion of the total loss. Figure S.7g,h illustrates the effect on the diffusion predictions: under L G L S \mathcal{L}_{\mathrm{GLS}} L GLS , the predictions change more rapidly across epochs and settle further from the ground truth, whereas L d a t a \mathcal{L}_{\mathrm{data}} L data yields more accurate final diffusion-function predictions.
Taken together, these results suggest that, relative to the LS loss, GLS changes the optimisation geometry in a significant way. Rather than simply accounting for heteroscedastic noise, the prediction-weighted GLS increasingly concentrates the data-fitting signal on low-density regions where u ^ \hat{u} u ^ is small and w k w_k w k is therefore large. In the coupled BINN setting, this concentration appears to be detrimental: the density network must provide a globally good approximation of u ( x , t ) u(x,t) u ( x , t ) to support both the PDE residual and accurate learning of the diffusion (and growth) terms, whereas an overly concentrated data loss can distort that global fit. By contrast, LS distributes the data-fitting pressure more uniformly across the density surface, and this more even conditioning appears to yield a more favourable optimisation in practice.
Figure S.7. Performance of generalised least squares (GLS) loss versus least squares (LS) loss for synthetic Case I with 1% mean percentage error noise. Ground truth: D 1 ( u ) D_1(u) D 1 ( u ) . Hyperparameters: W u = 64 W_u = 64 W u = 64 , W D = 2 W_D = 2 W D = 2 , early-stopping patiences E S ∈ { 500 , 2000 } ES \in\{500, 2000\} E S ∈ { 500 , 2000 } . LS and GLS correspond to L d a t a \mathcal{L}_{\mathrm{data}} L data and L G L S \mathcal{L}_{\mathrm{GLS}} L GLS objectives, respectively. (a)–(f) consist of 3 training–validation (TV) splits: markers show the minimum for each E S ES E S , and shading shows the corresponding min–max range. (a) running minimum validation loss. (b) running minimum validation data and PDE loss components. (c) running minimum diffusion-function MSE. (d) ratio L G L S / L d a t a \mathcal{L}_{\mathrm{GLS}}/\mathcal{L}_{\mathrm{data}} L GLS / L data across epochs. (e) effective sample size N e f f N_{\mathrm{eff}} N eff as a fraction of total sample size N N N , computed from the weights w k L S = ( u ^ k L S ) − 2 w_k^{\mathrm{LS}} = (\hat{u}_k^{\mathrm{LS}})^{-2} w k LS = ( u ^ k LS ) − 2 and w k G L S = ( u ^ k G L S ) − 2 w_k^{\mathrm{GLS}} = (\hat{u}_k^{\mathrm{GLS}})^{-2} w k GLS = ( u ^ k GLS ) − 2 (data-generating γ = 1 \gamma= 1 γ = 1 ) for the LS- and GLS-trained models, respectively. (f) fraction of the total data objective formed by the largest 1% of pointwise contributions. Blocks (g)–(h) show, for the first TV split, diffusion predictions sampled every 100 epochs with light-to-dark shading corresponding to increasing epochs, with the final best model indicated by a solid black line. The ± 5 % \pm5\% ± 5% mean percentage error (MPE) bands are shown for reference.
Implementation details
Noise implementation
All synthetic noise is implemented according to the following procedure, stated here for the 2D+t t t case; the 1D+t t t case follows analogously. The noisy observations are generated according to
u d a t a i , j , s = max ( u ( x 1 , i , x 2 , j , t s ) + ω u γ ( x 1 , i , x 2 , j , t s ) ε i , j , s , 0 ) , u_{\mathrm{data}}^{i,j,s}=\max\left(u(x_{1,i},x_{2,j},t_s)+\omega u^\gamma(x_{1,i},x_{2,j},t_s)\varepsilon_{i,j,s},0\right), u data i , j , s = max ( u ( x 1 , i , x 2 , j , t s ) + ω u γ ( x 1 , i , x 2 , j , t s ) ε i , j , s , 0 ) ,
following the error model of Eq. (3) , with the truncation at zero enforcing nonnegativity of the density and the variance-scaling coefficient taken to be constant across all observations, i.e., ω i , j , s ≡ ω \omega_{i,j,s}\equiv\omega ω i , j , s ≡ ω .
Noise mean percentage error. To avoid division by (near-)zero densities at the domain boundary, the relative error is evaluated only over the index set
M = { ( i , j , s ) : u ( x 1 , i , x 2 , j , t s ) ≥ u f l o o r } , u f l o o r = 10 − 3 , \mathcal{M}=\left\{(i,j,s):u(x_{1,i},x_{2,j},t_s)\ge u_{\mathrm{floor}}\right\},\qquad u_{\mathrm{floor}}=10^{-3}, M = { ( i , j , s ) : u ( x 1 , i , x 2 , j , t s ) ≥ u floor } , u floor = 1 0 − 3 ,
with M = ∣ M ∣ M=|\mathcal{M}| M = ∣ M ∣ the number of retained observations. For a prescribed noise level τ \tau τ in 2D+t t t , expressed as an (absolute) mean percentage error (MPE), the scalar ω \omega ω is obtained numerically, for each realisation of the noise, such that the achieved MPE lies within a tolerance δ \delta δ of the target, ∣ M P E − τ ∣ ≤ δ |\mathrm{MPE}-\tau|\le\delta ∣ MPE − τ ∣ ≤ δ , where
M P E = 100 M ∑ ( i , j , s ) ∈ M ∣ u ( x 1 , i , x 2 , j , t s ) − u d a t a i , j , s u ( x 1 , i , x 2 , j , t s ) ∣ = 100 M ∑ ( i , j , s ) ∈ M ∣ u ( x 1 , i , x 2 , j , t s ) − max ( u ( x 1 , i , x 2 , j , t s ) + ω u γ ( x 1 , i , x 2 , j , t s ) ε i , j , s , 0 ) u ( x 1 , i , x 2 , j , t s ) ∣ , \begin{aligned}
\mathrm{MPE}&=\frac{100}{M}\sum_{(i,j,s)\in\mathcal{M}}\left|\frac{u(x_{1,i},x_{2,j},t_s)-u_{\mathrm{data}}^{i,j,s}}{u(x_{1,i},x_{2,j},t_s)}\right|\\
&=\frac{100}{M}\sum_{(i,j,s)\in\mathcal{M}}\left|\frac{u(x_{1,i},x_{2,j},t_s)-\max\left(u(x_{1,i},x_{2,j},t_s)+\omega u^\gamma(x_{1,i},x_{2,j},t_s)\varepsilon_{i,j,s},0\right)}{u(x_{1,i},x_{2,j},t_s)}\right|,
\end{aligned} MPE = M 100 ( i , j , s ) ∈ M ∑ u ( x 1 , i , x 2 , j , t s ) u ( x 1 , i , x 2 , j , t s ) − u data i , j , s = M 100 ( i , j , s ) ∈ M ∑ u ( x 1 , i , x 2 , j , t s ) u ( x 1 , i , x 2 , j , t s ) − max ( u ( x 1 , i , x 2 , j , t s ) + ω u γ ( x 1 , i , x 2 , j , t s ) ε i , j , s , 0 ) ,
and δ = 10 − 4 \delta=10^{-4} δ = 1 0 − 4 .
Ground-truth error metrics
Because the synthetic data are generated from known coefficient functions, the learned functions can be compared directly against them. The metrics defined here quantify that comparison. They require the ground truth, are therefore unavailable in an experimental setting, and play no part in the selection workflow of § 3 ; they are reported alongside the ground-truth-free diagnostics only to verify the selections that workflow makes.
Let f f f denote a ground-truth coefficient function (D D D or G G G ) and f ^ \hat{f} f ^ its learned surrogate, which corresponds to the network output. Both are evaluated on a fixed, equally spaced grid of n M S E n_{\mathrm{MSE}} n MSE scaled density values
{ u ~ q } q = 1 n M S E ⊆ [ u ~ min , u ~ max ] , \{\tilde{u}_q\}_{q=1}^{n_{\mathrm{MSE}}}\subseteq[\tilde{u}_{\min},\tilde{u}_{\max}], { u ~ q } q = 1 n MSE ⊆ [ u ~ m i n , u ~ m a x ] ,
where n M S E = 20 n_{\mathrm{MSE}}=20 n MSE = 20 , and u ~ min \tilde{u}_{\min} u ~ m i n and u ~ max \tilde{u}_{\max} u ~ m a x are the minimum and maximum of the normalised densities, so that the comparison is restricted to the density range the data support. Note that the growth terms G 1 G_1 G 1 and G 3 G_3 G 3 drive the density to u ~ max ≈ 2.9 \tilde{u}_{\max}\approx2.9 u ~ m a x ≈ 2.9 and 2.5 2.5 2.5 , respectively, whereas in all other cases u ~ max ≤ 1 \tilde{u}_{\max}\le1 u ~ m a x ≤ 1 . The mean-squared error is
M S E ( f ^ ) = 1 n M S E ∑ q = 1 n M S E ( f s c a l e f ^ ( u ~ q ) − f ( u ~ q ) ) 2 (7) \mathrm{MSE}(\hat{f})=\frac{1}{n_{\mathrm{MSE}}}\sum_{q=1}^{n_{\mathrm{MSE}}}\left(f_{\mathrm{scale}}\hat{f}(\tilde{u}_q)-f(\tilde{u}_q)\right)^2 \tag*{(7)} MSE ( f ^ ) = n MSE 1 q = 1 ∑ n MSE ( f scale f ^ ( u ~ q ) − f ( u ~ q ) ) 2 (7)
where f s c a l e f_{\mathrm{scale}} f scale is the respective scaling factor (d s c a l e d_{\mathrm{scale}} d scale or g s c a l e g_{\mathrm{scale}} g scale ; see § 13.3 ). Therefore, the MSE carries the squared units of f s c a l e f_{\mathrm{scale}} f scale (m m 4 d a y s − 2 \mathrm{mm}^4\,\mathrm{days}^{-2} mm 4 days − 2 for diffusion, d a y s − 2 \mathrm{days}^{-2} days − 2 for growth). No weighting or restriction by density occupancy is applied: every grid point contributes equally, and the 5th and 95th density percentiles marked in the profile figures are indicative only. Since the units of Eq. (S.1) differ between the two functions and the ground-truth magnitudes vary across the forms in Table 1 , MSE values are not directly comparable. For context, we use the uniformly rescaled function f p = ( 1 + p / 100 ) f f_p=(1+p/100)f f p = ( 1 + p /100 ) f , whose mean percentage error is
MPE ( f p ) = 100 n Q ∑ q ∈ Q ∣ f p ( u ~ q ) − f ( u ~ q ) f ( u ~ q ) ∣ = 100 n Q ( ∣ p ∣ 100 n Q ) = p , \operatorname{MPE}(f_p)=\frac{100}{n_Q}\sum_{q\in Q}\left\lvert\frac{f_p(\tilde{u}_q)-f(\tilde{u}_q)}{f(\tilde{u}_q)}\right\rvert=\frac{100}{n_Q}\left(\frac{\lvert p\rvert}{100}n_Q\right)=p, MPE ( f p ) = n Q 100 q ∈ Q ∑ f ( u ~ q ) f p ( u ~ q ) − f ( u ~ q ) = n Q 100 ( 100 ∣ p ∣ n Q ) = p ,
where Q = { q : f ( u ~ q ) ≠ 0 } Q=\{q:f(\tilde{u}_q)\ne0\} Q = { q : f ( u ~ q ) = 0 } , of size n Q n_Q n Q , since terms with f ( u ~ q ) = 0 f(\tilde{u}_q)=0 f ( u ~ q ) = 0 are dropped from the summation. The mean-squared error is given by
MSE ( f p ) = 1 n M S E ∑ q = 1 n M S E ( f p ( u ~ q ) − f ( u ~ q ) ) 2 = ( p 100 ) 2 1 n M S E ∑ q = 1 n M S E f 2 ( u ~ q ) . (8) \operatorname{MSE}(f_p)=\frac{1}{n_{\mathrm{MSE}}}\sum_{q=1}^{n_{\mathrm{MSE}}}\left(f_p(\tilde{u}_q)-f(\tilde{u}_q)\right)^2=\left(\frac{p}{100}\right)^2\frac{1}{n_{\mathrm{MSE}}}\sum_{q=1}^{n_{\mathrm{MSE}}}f^2(\tilde{u}_q). \tag*{(8)} MSE ( f p ) = n MSE 1 q = 1 ∑ n MSE ( f p ( u ~ q ) − f ( u ~ q ) ) 2 = ( 100 p ) 2 n MSE 1 q = 1 ∑ n MSE f 2 ( u ~ q ) . (8)
In MSE plots, a line labelled p % p\% p % marks MSE ( f p ) \operatorname{MSE}(f_p) MSE ( f p ) from Eq. (S.2). In plots of the learned function against u u u , the ± p % \pm p\% ± p % band is given by ( 1 ± p / 100 ) f ( u ) (1\pm p/100)f(u) ( 1 ± p /100 ) f ( u ) .
Data preprocessing
One should non-dimensionalise three components relevant to BINN training: (i) the inputs, (ii) the loss functions, and (iii) the outputs. The input scaling fixes the characteristic constants used throughout the non-dimensionalisation, and the loss functions must then be formulated consistently with this scaling. The outputs require no separate treatment: they are non-dimensional by construction once (i) and (ii) are applied, and are rescaled to physical units after training via the characteristic scales (e.g. d s c a l e D ^ d_{\mathrm{scale}}\hat{D} d scale D ^ and g s c a l e G ^ g_{\mathrm{scale}}\hat{G} g scale G ^ ). Accordingly, we address item (i) below and item (ii) in Section SM3.4.
Let L m L_m L m denote characteristic length scales in each spatial direction x m x_m x m , m = 1 , … , d m=1,\ldots,d m = 1 , … , d . Let T T T be a representative time scale, U U U a characteristic magnitude of the cell density u ( x , t ) u(x,t) u ( x , t ) , and let d s c a l e d_{\mathrm{scale}} d scale and g s c a l e g_{\mathrm{scale}} g scale denote characteristic values of the diffusion and growth functions D ( ⋅ ) D(\cdot) D ( ⋅ ) and G ( ⋅ ) G(\cdot) G ( ⋅ ) , respectively. In general, U U U is chosen as a characteristic density of the observed data; for the scratch-assay setting considered here the natural choice is the biological density scale U = K = 1700 U=K=1700 U = K = 1700 cells m m − 2 \mathrm{mm}^{-2} mm − 2 [29 ] used to define the ground-truth functions in Table 1 . Under these assumptions, the physical variables satisfy
x m = O ( L m ) , m = 1 , … , d , t = O ( T ) , u d a t a = O ( U ) , D ( ⋅ ) = O ( d s c a l e ) , G ( ⋅ ) = O ( g s c a l e ) . \begin{aligned}
x_m&=\mathcal{O}(L_m),\quad m=1,\ldots,d,\qquad t=\mathcal{O}(T),\\
u_{\mathrm{data}}&=\mathcal{O}(U),\qquad D(\cdot)=\mathcal{O}(d_{\mathrm{scale}}),\qquad G(\cdot)=\mathcal{O}(g_{\mathrm{scale}}).
\end{aligned} x m u data = O ( L m ) , m = 1 , … , d , t = O ( T ) , = O ( U ) , D ( ⋅ ) = O ( d scale ) , G ( ⋅ ) = O ( g scale ) .
We introduce dimensionless variables (denoted by tildes) via
x ~ m = x m L m , t ~ = t T , u ~ d a t a = u d a t a U , u ~ ( x ~ , t ~ ) = u ( x , t ) U , (9) \tilde{x}_m=\frac{x_m}{L_m},\qquad\tilde{t}=\frac{t}{T},\qquad\tilde{u}_{\mathrm{data}}=\frac{u_{\mathrm{data}}}{U},\qquad\tilde{u}(\tilde{x},\tilde{t})=\frac{u(x,t)}{U}, \tag*{(9)} x ~ m = L m x m , t ~ = T t , u ~ data = U u data , u ~ ( x ~ , t ~ ) = U u ( x , t ) , (9)
where x = ( x 1 , … , x d ) \mathbf{x}=(x_1,\ldots,x_d) x = ( x 1 , … , x d ) , L − 1 = ( L 1 − 1 , … , L d − 1 ) \mathbf{L}^{-1}=(L_1^{-1},\ldots,L_d^{-1}) L − 1 = ( L 1 − 1 , … , L d − 1 ) , or, in vector form, x ~ = L − 1 ∘ x \tilde{\mathbf{x}}=\mathbf{L}^{-1}\circ\mathbf{x} x ~ = L − 1 ∘ x , for the Hadamard (componentwise) product ∘ \circ ∘ . We assume the measurement noise is sufficiently small that the true density u ( ⋅ ) u(\cdot) u ( ⋅ ) is of the same order as the observed data u d a t a u_{\mathrm{data}} u data .
We further define the rescaled diffusion and growth functions
D ~ ( u ~ ) = D ( u ) d s c a l e , G ~ ( u ~ ) = G ( u ) g s c a l e , \widetilde{D}(\widetilde{u}) = \frac{D(u)}{d_{\mathrm{scale}}}, \qquad\widetilde{G}(\widetilde{u}) = \frac{G(u)}{g_{\mathrm{scale}}}, D ( u ) = d scale D ( u ) , G ( u ) = g scale G ( u ) ,
which ensures all quantities are O ( 1 ) \mathcal{O}(1) O ( 1 ) . The derivative operators transform according to
∂ ∂ t = 1 T ∂ ∂ t ~ , \frac{\partial}{\partial t} = \frac{1}{T}\frac{\partial}{\partial\widetilde{t}}, ∂ t ∂ = T 1 ∂ t ∂ ,
∇ = ( ∂ ∂ x 1 , … , ∂ ∂ x d ) = L − 1 ∘ ∇ ~ , ∇ ~ = ( ∂ ∂ x ~ 1 , … , ∂ ∂ x ~ d ) . (10) \nabla= \left(\frac{\partial}{\partial x_1},\ldots,\frac{\partial}{\partial x_d}\right) = \mathbf{L}^{-1}\circ\widetilde{\nabla}, \qquad\widetilde{\nabla} = \left(\frac{\partial}{\partial\widetilde{x}_1},\ldots,\frac{\partial}{\partial\widetilde{x}_d}\right). \tag*{(10)} ∇ = ( ∂ x 1 ∂ , … , ∂ x d ∂ ) = L − 1 ∘ ∇ , ∇ = ( ∂ x 1 ∂ , … , ∂ x d ∂ ) . (10)
Substituting Eq. (S.3)–Eq. (S.4) into the dimensional Eq. (1) yields the non-dimensional form
∂ u ~ ∂ t ~ = d s c a l e T ( L − 2 ∘ ∇ ~ ) ⋅ ( D ~ ( u ~ ) ∇ ~ u ~ ) + T g s c a l e G ~ ( u ~ ) u ~ . \frac{\partial\widetilde{u}}{\partial\widetilde{t}} = d_{\mathrm{scale}}T\left(\mathbf{L}^{-2}\circ\widetilde{\nabla}\right)\cdot\left(\widetilde{D}(\widetilde{u})\widetilde{\nabla}\widetilde{u}\right)+Tg_{\mathrm{scale}}\widetilde{G}(\widetilde{u})\widetilde{u}. ∂ t ∂ u = d scale T ( L − 2 ∘ ∇ ) ⋅ ( D ( u ) ∇ u ) + T g scale G ( u ) u .
If all spatial lengths are equal L 1 , … , L d = L L_1,\ldots,L_d=L L 1 , … , L d = L then we can instead use
∂ u ~ ∂ t ~ = d s c a l e T L 2 ∇ ~ ⋅ ( D ~ ( u ~ ) ∇ ~ u ~ ) + T g s c a l e G ~ ( u ~ ) u ~ . (11) \frac{\partial\widetilde{u}}{\partial\widetilde{t}} = d_{\mathrm{scale}}\frac{T}{L^2}\widetilde{\nabla}\cdot\left(\widetilde{D}(\widetilde{u})\widetilde{\nabla}\widetilde{u}\right)+Tg_{\mathrm{scale}}\widetilde{G}(\widetilde{u})\widetilde{u}. \tag*{(11)} ∂ t ∂ u = d scale L 2 T ∇ ⋅ ( D ( u ) ∇ u ) + T g scale G ( u ) u . (11)
We approximate u ~ ( x ~ , t ~ ) \widetilde{u}(\widetilde{\mathbf{x}},\widetilde{t}) u ( x , t ) , D ~ ( u ~ ) \widetilde{D}(\widetilde{u}) D ( u ) , and G ~ ( u ~ ) \widetilde{G}(\widetilde{u}) G ( u ) by the MLP surrogates u ^ ( x ~ , t ~ ) \widehat{u}(\widetilde{\mathbf{x}},\widetilde{t}) u ( x , t ) , D ^ ( u ~ ) \widehat{D}(\widetilde{u}) D ( u ) , and G ^ ( u ~ ) \widehat{G}(\widetilde{u}) G ( u ) .
Partial preprocessing
If L 1 , … , L d , T = O ( 1 ) L_1,\ldots,L_d,T=\mathcal{O}(1) L 1 , … , L d , T = O ( 1 ) we can incorporate these scales back into the derivative operators and proceed with the original x 1 , x 2 , … , x d x_1,x_2,\ldots,x_d x 1 , x 2 , … , x d , and t t t in Eq. (S.5) without introducing training inefficiency. This leads to
∂ u ~ ∂ t = d s c a l e ∇ ⋅ ( D ~ ( u ~ ) ∇ u ~ ) + g s c a l e G ~ ( u ~ ) u ~ , \frac{\partial\widetilde{u}}{\partial t}=d_{\mathrm{scale}}\nabla\cdot\left(\widetilde{D}(\widetilde{u})\nabla\widetilde{u}\right)+g_{\mathrm{scale}}\widetilde{G}(\widetilde{u})\widetilde{u}, ∂ t ∂ u = d scale ∇ ⋅ ( D ( u ) ∇ u ) + g scale G ( u ) u ,
where we now approximate u ~ ( x , t ) \widetilde{u}(\mathbf{x},t) u ( x , t ) , D ~ ( u ~ ) \widetilde{D}(\widetilde{u}) D ( u ) , and G ~ ( u ~ ) \widetilde{G}(\widetilde{u}) G ( u ) by the MLP surrogates u ^ ( x , t ) \widehat{u}(\mathbf{x},t) u ( x , t ) , D ^ ( u ~ ) \widehat{D}(\widetilde{u}) D ( u ) , and G ^ ( u ~ ) \widehat{G}(\widetilde{u}) G ( u ) , respectively. Moreover, in our simulated experiments we generate the data directly in the model’s dimensionless density u ~ = u / K = O ( 1 ) \widetilde{u}=u/K=\mathcal{O}(1) u = u / K = O ( 1 ) , where K K K is the biological density scale introduced above (Table 1 ). The data passed to the pipeline are therefore already O ( 1 ) \mathcal{O}(1) O ( 1 ) , so we take the pipeline’s characteristic density to be U = 1 U=1 U = 1 and apply no further rescaling (i.e., u ~ d a t a = u d a t a \widetilde{u}_{\mathrm{data}}=u_{\mathrm{data}} u data = u data ). The training variable then coincides with the model’s dimensionless density. Equivalently, the 1 / K 1/K 1/ K normalisation is absorbed at data-generation time, and U = 1 U=1 U = 1 is simply the special case of the general choice U = K U=K U = K that would be made for un-normalised (e.g. experimental) data. Since both diffusion and growth depend only on u ~ = u / U \widetilde{u}=u/U u = u / U , the factor U U U cancels from the governing equation and does not affect the recovered diffusion and growth functions; we may therefore rescale to physical units via u = u ~ ⋅ K u=\widetilde{u}\cdot K u = u ⋅ K purely to dimensionalise the density axis post hoc.
Loss definitions
To make the loss functions directly comparable with the main text, we set d = 2 d=2 d = 2 . However, extending this to d = 1 d=1 d = 1 or d = 3 d=3 d = 3 is straightforward. In this subsection, we write the general forms in the non-dimensionalised coordinates of § 13.3 , but in the implementation, all losses are evaluated in the original quantities x 1 x_1 x 1 , x 2 x_2 x 2 , t t t , and u u u , which is possible without rescaling because L L L , T T T , and U U U are O ( 1 ) \mathcal{O}(1) O ( 1 ) .
Data loss
Data locations. As outlined in § 2 , observed density measurements are available at discrete spatiotemporal locations
G = { ( x 1 , i , x 2 , j , t s ) } i = 1 , … , n x 1 ; j = 1 , … , n x 2 ; s = 1 , … , n t \mathcal{G} = \{(x_{1,i}, x_{2,j}, t_s)\}_{i=1,\ldots,n_{x_1};\,j=1,\ldots,n_{x_2};\,s=1,\ldots,n_t} G = {( x 1 , i , x 2 , j , t s ) } i = 1 , … , n x 1 ; j = 1 , … , n x 2 ; s = 1 , … , n t
with corresponding observations u d a t a i , j , s u_{\mathrm{data}}^{i,j,s} u data i , j , s . These points are fixed by the experimental design and form the points where the data loss is enforced.
Loss function. Under the noise model in Eq. (3) , the negative log-likelihood (NLL) leads to a GLS objective. For a 2D spatial domain, define the residual
r i , j , s = u d a t a i , j , s − u ( x 1 , i , x 2 , j , t s ) . r_{i,j,s} = u_{\mathrm{data}}^{i,j,s} - u(x_{1,i}, x_{2,j}, t_s). r i , j , s = u data i , j , s − u ( x 1 , i , x 2 , j , t s ) .
By Eq. (3) , r i , j , s = ω i , j , s u γ ( x 1 , i , x 2 , j , t s ) ϵ i , j , s r_{i,j,s} = \omega_{i,j,s} u^\gamma(x_{1,i}, x_{2,j}, t_s) \epsilon_{i,j,s} r i , j , s = ω i , j , s u γ ( x 1 , i , x 2 , j , t s ) ϵ i , j , s with ϵ i , j , s ∼ i i d N ( 0 , 1 ) \epsilon_{i,j,s} \overset{\mathrm{iid}}{\sim} \mathcal{N}(0,1) ϵ i , j , s ∼ iid N ( 0 , 1 ) , so the residuals are independent, zero-mean Gaussian variables with variance
Var ( r i , j , s ) = ( ω i , j , s u γ ( x 1 , i , x 2 , j , t s ) ) 2 . \operatorname{Var}(r_{i,j,s}) = \left(\omega_{i,j,s} u^\gamma(x_{1,i}, x_{2,j}, t_s)\right)^2. Var ( r i , j , s ) = ( ω i , j , s u γ ( x 1 , i , x 2 , j , t s ) ) 2 .
The NLL of the observations is therefore
1 2 ∑ i = 1 n x 1 ∑ j = 1 n x 2 ∑ s = 1 n t [ r i , j , s 2 Var ( r i , j , s ) + log Var ( r i , j , s ) ] + n x 1 n x 2 n t 2 log ( 2 π ) . \frac{1}{2}\sum_{i=1}^{n_{x_1}}\sum_{j=1}^{n_{x_2}}\sum_{s=1}^{n_t}\left[\frac{r_{i,j,s}^2}{\operatorname{Var}(r_{i,j,s})}+\log\operatorname{Var}(r_{i,j,s})\right]+\frac{n_{x_1}n_{x_2}n_t}{2}\log(2\pi). 2 1 i = 1 ∑ n x 1 j = 1 ∑ n x 2 s = 1 ∑ n t [ Var ( r i , j , s ) r i , j , s 2 + log Var ( r i , j , s ) ] + 2 n x 1 n x 2 n t log ( 2 π ) .
Following Lagergren et al. [8 ] , we retain only the inverse-variance-weighted residual term and drop the log-variance and constant contributions, giving the weighted least-squares objective
∑ i = 1 n x 1 ∑ j = 1 n x 2 ∑ s = 1 n t r i , j , s 2 Var ( r i , j , s ) . \sum_{i=1}^{n_{x_1}}\sum_{j=1}^{n_{x_2}}\sum_{s=1}^{n_t}\frac{r_{i,j,s}^2}{\operatorname{Var}(r_{i,j,s})}. i = 1 ∑ n x 1 j = 1 ∑ n x 2 s = 1 ∑ n t Var ( r i , j , s ) r i , j , s 2 .
Here, we approximate u u u with u ^ \hat{u} u ^ . Furthermore, the coefficients ω i , j , s \omega_{i,j,s} ω i , j , s are often assumed to be constant (or slowly varying), and we adopt this constant-ω \omega ω assumption here, so that they reduce to a uniform multiplicative factor, which we absorb into λ d a t a \lambda_{\mathrm{data}} λ data . Therefore, we approximate the noise scaling using only the density-dependent factor u ^ γ \hat{u}^{\gamma} u ^ γ and normalise by the number of data points. This yields the GLS-inspired loss of Lagergren et al. [8 ] ,
L G L S ( u ^ ) = 1 n x 1 n x 2 n t ∑ i = 1 n x 1 ∑ j = 1 n x 2 ∑ s = 1 n t ( u ~ d a t a i , j , s − u ^ ( x ~ 1 , i , x ~ 2 , j , t ~ s ) u ^ γ ( x ~ 1 , i , x ~ 2 , j , t ~ s ) ) 2 . \mathcal{L}_{\mathrm{GLS}}(\hat{u}) = \frac{1}{n_{x_1}n_{x_2}n_t}\sum_{i=1}^{n_{x_1}}\sum_{j=1}^{n_{x_2}}\sum_{s=1}^{n_t}\left(\frac{\tilde{u}_{\mathrm{data}}^{i,j,s}-\hat{u}(\tilde{x}_{1,i},\tilde{x}_{2,j},\tilde{t}_s)}{\hat{u}^{\gamma}(\tilde{x}_{1,i},\tilde{x}_{2,j},\tilde{t}_s)}\right)^2. L GLS ( u ^ ) = n x 1 n x 2 n t 1 i = 1 ∑ n x 1 j = 1 ∑ n x 2 s = 1 ∑ n t ( u ^ γ ( x ~ 1 , i , x ~ 2 , j , t ~ s ) u ~ data i , j , s − u ^ ( x ~ 1 , i , x ~ 2 , j , t ~ s ) ) 2 .
where the density measurements are normalised as u ~ d a t a i , j , s = U − 1 u d a t a i , j , s \tilde{u}_{\mathrm{data}}^{i,j,s}=U^{-1}u_{\mathrm{data}}^{i,j,s} u ~ data i , j , s = U − 1 u data i , j , s . We nevertheless adopt a standard LS loss, i.e. L G L S \mathcal{L}_{\mathrm{GLS}} L GLS with γ = 0 \gamma=0 γ = 0 , since each ingredient of the GLS weighting is problematic here. Regions of very low density are common in biological data, so the weights u ^ − 2 γ \hat{u}^{-2\gamma} u ^ − 2 γ can become arbitrarily large in practice and require clipping; γ \gamma γ is difficult to estimate; and since the weights depend on u ^ \hat{u} u ^ , dropping the log-variance term allows the objective to be reduced by inflating u ^ \hat{u} u ^ instead of fitting the data. The non-dimensionalised LS (or MSE) data loss that we use is
L d a t a ( u ^ ) = 1 n x 1 n x 2 n t ∑ i = 1 n x 1 ∑ j = 1 n x 2 ∑ s = 1 n t ( u ~ d a t a i , j , s − u ^ ( x ~ 1 , i , x ~ 2 , j , t ~ s ) ) 2 . \mathcal{L}_{\mathrm{data}}(\hat{u}) = \frac{1}{n_{x_1}n_{x_2}n_t}\sum_{i=1}^{n_{x_1}}\sum_{j=1}^{n_{x_2}}\sum_{s=1}^{n_t}\left(\tilde{u}_{\mathrm{data}}^{i,j,s}-\hat{u}(\tilde{x}_{1,i},\tilde{x}_{2,j},\tilde{t}_s)\right)^2. L data ( u ^ ) = n x 1 n x 2 n t 1 i = 1 ∑ n x 1 j = 1 ∑ n x 2 s = 1 ∑ n t ( u ~ data i , j , s − u ^ ( x ~ 1 , i , x ~ 2 , j , t ~ s ) ) 2 .
See § 12 for an empirical comparison of L G L S \mathcal{L}_{\mathrm{GLS}} L GLS and L d a t a \mathcal{L}_{\mathrm{data}} L data .
PDE loss
Collocation points. The PDE residual loss is enforced at n c n_c n c collocation points obtained by sampling uniformly over the spatiotemporal domain delimited by the coordinate-wise extrema of the data. Carrying out this sampling in the dimensional coordinates yields
C = { ( x 1 , k ( c ) , x 2 , k ( c ) , t k ( c ) ) } k = 1 n c . \mathcal{C} = \left\{(x_{1,k}^{(c)}, x_{2,k}^{(c)}, t_k^{(c)})\right\}_{k=1}^{n_c}. C = { ( x 1 , k ( c ) , x 2 , k ( c ) , t k ( c ) ) } k = 1 n c .
The same procedure applied to the non-dimensionalised domain [ x ~ 1 , min , x ~ 1 , max ] × [ x ~ 2 , min , x ~ 2 , max ] × [ t ~ min , t ~ max ] [\tilde{x}_{1,\min},\tilde{x}_{1,\max}] \times[\tilde{x}_{2,\min},\tilde{x}_{2,\max}] \times[\tilde{t}_{\min},\tilde{t}_{\max}] [ x ~ 1 , m i n , x ~ 1 , m a x ] × [ x ~ 2 , m i n , x ~ 2 , m a x ] × [ t ~ m i n , t ~ m a x ] yields
C ~ = { ( x ~ 1 , k ( c ) , x ~ 2 , k ( c ) , t ~ k ( c ) ) } k = 1 n c . \widetilde{\mathcal{C}} = \left\{(\tilde{x}_{1,k}^{(c)}, \tilde{x}_{2,k}^{(c)}, \tilde{t}_k^{(c)})\right\}_{k=1}^{n_c}. C = { ( x ~ 1 , k ( c ) , x ~ 2 , k ( c ) , t ~ k ( c ) ) } k = 1 n c .
Loss function. The PDE loss is defined as the mean-squared residual evaluated at collocation points C ~ \widetilde{\mathcal{C}} C ,
L P D E ( u ^ , D ^ , G ^ ) = 1 n c ∑ k = 1 n c [ ∂ u ^ ∂ t ~ ∣ k − ( α P D E , 1 ∘ ∇ ~ ) ⋅ ( D ^ ( u ^ ) ∇ ~ u ^ ) ∣ k − α P D E , 2 G ^ k u ^ k ∣ k ] 2 , \mathcal{L}_{\mathrm{PDE}}(\hat{u},\hat{D},\hat{G}) = \frac{1}{n_c}\sum_{k=1}^{n_c}\left[\left.\frac{\partial\hat{u}}{\partial\tilde{t}}\right|_k - \left(\alpha_{\mathrm{PDE},1}\circ\widetilde{\nabla}\right)\cdot\left.\left(\hat{D}(\hat{u})\widetilde{\nabla}\hat{u}\right)\right|_k - \alpha_{\mathrm{PDE},2}\left.\hat{G}_k\hat{u}_k\right|_k\right]^2, L PDE ( u ^ , D ^ , G ^ ) = n c 1 k = 1 ∑ n c [ ∂ t ~ ∂ u ^ k − ( α PDE , 1 ∘ ∇ ) ⋅ ( D ^ ( u ^ ) ∇ u ^ ) k − α PDE , 2 G ^ k u ^ k k ] 2 ,
where u ^ k = u ^ ( x ~ 1 , k ( c ) , x ~ 2 , k ( c ) , t ~ k ( c ) ) \hat{u}_k = \hat{u}(\tilde{x}_{1,k}^{(c)},\tilde{x}_{2,k}^{(c)},\tilde{t}_k^{(c)}) u ^ k = u ^ ( x ~ 1 , k ( c ) , x ~ 2 , k ( c ) , t ~ k ( c ) ) , D ^ k = D ^ ( u ^ k ) \hat{D}_k = \hat{D}(\hat{u}_k) D ^ k = D ^ ( u ^ k ) , and G ^ k = G ^ ( u ^ k ) \hat{G}_k = \hat{G}(\hat{u}_k) G ^ k = G ^ ( u ^ k ) . The notation f ∣ k f|_k f ∣ k denotes evaluation of a function f f f and its derivatives at the k k k -th collocation point. The coefficients restore the physical magnitudes of the non-dimensional diffusion and growth surrogates and are given by
α P D E , 1 = d s c a l e T L − 2 , α P D E , 2 = T g s c a l e . \alpha_{\mathrm{PDE},1} = d_{\mathrm{scale}}T L^{-2}, \qquad\alpha_{\mathrm{PDE},2} = T g_{\mathrm{scale}}. α PDE , 1 = d scale T L − 2 , α PDE , 2 = T g scale .
When the characteristic length scales are equal, L 1 , … , L d = L L_1,\ldots,L_d = L L 1 , … , L d = L , this reduces to the scalar coefficient α P D E , 1 = d s c a l e T / L 2 \alpha_{\mathrm{PDE},1} = d_{\mathrm{scale}}T/L^2 α PDE , 1 = d scale T / L 2 .
In our setting, we take L , T = O ( 1 ) L,T = O(1) L , T = O ( 1 ) , which absorbs these scales into the derivative operators and allows us to evaluate the residual in the original coordinates with α P D E , 1 = d s c a l e \alpha_{\mathrm{PDE},1} = d_{\mathrm{scale}} α PDE , 1 = d scale and α P D E , 2 = g s c a l e \alpha_{\mathrm{PDE},2} = g_{\mathrm{scale}} α PDE , 2 = g scale . Explicitly, evaluating the residual at collocation points C \mathcal{C} C , we use
L P D E ( u ^ , D ^ , G ^ ) = 1 n c ∑ k = 1 n c [ ∂ u ^ ∂ t ∣ k − d s c a l e ∇ ⋅ ( D ^ ( u ^ ) ∇ u ^ ) ∣ k − g s c a l e G ^ k u ^ k ] 2 , \mathcal{L}_{\mathrm{PDE}}(\hat{u},\hat{D},\hat{G}) = \frac{1}{n_c}\sum_{k=1}^{n_c}\left[\left.\frac{\partial\hat{u}}{\partial t}\right|_k - d_{\mathrm{scale}}\left.\nabla\cdot\left(\hat{D}(\hat{u})\nabla\hat{u}\right)\right|_k - g_{\mathrm{scale}}\hat{G}_k\hat{u}_k\right]^2, L PDE ( u ^ , D ^ , G ^ ) = n c 1 k = 1 ∑ n c [ ∂ t ∂ u ^ k − d scale ∇ ⋅ ( D ^ ( u ^ ) ∇ u ^ ) k − g scale G ^ k u ^ k ] 2 ,
where u ^ k = u ^ ( x 1 , k ( c ) , x 2 , k ( c ) , t k ( c ) ) \hat{u}_k = \hat{u}(x_{1,k}^{(c)},x_{2,k}^{(c)},t_k^{(c)}) u ^ k = u ^ ( x 1 , k ( c ) , x 2 , k ( c ) , t k ( c ) ) . In the implementation we have d s c a l e ≡ d max d_{\mathrm{scale}} \equiv d_{\max} d scale ≡ d m a x and g s c a l e ≡ g max g_{\mathrm{scale}} \equiv g_{\max} g scale ≡ g m a x .
Biological loss
Biological constraint points. The biologically motivated penalty is imposed on a fixed equally spaced grid of non-dimensionalised density values u ~ q ∈ [ u ~ min , u ~ max ] \tilde{u}_q \in[\tilde{u}_{\min}, \tilde{u}_{\max}] u ~ q ∈ [ u ~ m i n , u ~ m a x ] , q = 1 , … , n b i o q = 1,\ldots,n_{\mathrm{bio}} q = 1 , … , n bio , where u ~ min = min i , j , s { u d a t a i , j , s / U } \tilde{u}_{\min} = \min_{i,j,s}\{u_{\mathrm{data}}^{i,j,s}/U\} u ~ m i n = min i , j , s { u data i , j , s / U } and u ~ max = max i , j , s { u d a t a i , j , s / U } \tilde{u}_{\max} = \max_{i,j,s}\{u_{\mathrm{data}}^{i,j,s}/U\} u ~ m a x = max i , j , s { u data i , j , s / U } denote the minimum and maximum (non-dimensional) density values observed in the data.
Loss function. To penalise violations of the prescribed bounds, of monotone increase of D ^ \hat{D} D ^ , and of monotone decrease of G ^ \hat{G} G ^ , the biological loss is given by
L b i o ( D ^ , G ^ ) = ∑ q = 1 n b i o [ λ D l i m ( I { D ^ q < d ~ min } ( D ^ q − d ~ min ) 2 + I { D ^ q > d ~ max } ( D ^ q − d ~ max ) 2 ) + λ G l i m ( I { G ^ q < g ~ min } ( G ^ q − g ~ min ) 2 + I { G ^ q > g ~ max } ( G ^ q − g ~ max ) 2 ) + λ ∂ D I { ∂ D ^ ∂ u ~ ∣ u ~ q < 0 } ( ∂ D ^ ∂ u ~ ∣ u ~ q ) 2 + λ ∂ G I { ∂ G ^ ∂ u ~ ∣ u ~ q > 0 } ( ∂ G ^ ∂ u ~ ∣ u ~ q ) 2 ] . \mathcal{L}_{\mathrm{bio}}(\hat{D},\hat{G})=\sum_{q=1}^{n_{\mathrm{bio}}}\left[\lambda_{D\mathrm{lim}}\left(\mathbb{I}_{\{\hat{D}_q<\tilde{d}_{\min}\}}(\hat{D}_q-\tilde{d}_{\min})^2+\mathbb{I}_{\{\hat{D}_q>\tilde{d}_{\max}\}}(\hat{D}_q-\tilde{d}_{\max})^2\right)+\lambda_{G\mathrm{lim}}\left(\mathbb{I}_{\{\hat{G}_q<\tilde{g}_{\min}\}}(\hat{G}_q-\tilde{g}_{\min})^2+\mathbb{I}_{\{\hat{G}_q>\tilde{g}_{\max}\}}(\hat{G}_q-\tilde{g}_{\max})^2\right)+\lambda_{\partial D}\mathbb{I}_{\left\{\left.\frac{\partial\hat{D}}{\partial\tilde{u}}\right|_{\tilde{u}_q}<0\right\}}\left(\left.\frac{\partial\hat{D}}{\partial\tilde{u}}\right|_{\tilde{u}_q}\right)^2+\lambda_{\partial G}\mathbb{I}_{\left\{\left.\frac{\partial\hat{G}}{\partial\tilde{u}}\right|_{\tilde{u}_q}>0\right\}}\left(\left.\frac{\partial\hat{G}}{\partial\tilde{u}}\right|_{\tilde{u}_q}\right)^2\right]. L bio ( D ^ , G ^ ) = q = 1 ∑ n bio λ D lim ( I { D ^ q < d ~ m i n } ( D ^ q − d ~ m i n ) 2 + I { D ^ q > d ~ m a x } ( D ^ q − d ~ m a x ) 2 ) + λ G lim ( I { G ^ q < g ~ m i n } ( G ^ q − g ~ m i n ) 2 + I { G ^ q > g ~ m a x } ( G ^ q − g ~ m a x ) 2 ) + λ ∂ D I { ∂ u ~ ∂ D ^ u ~ q < 0 } ∂ u ~ ∂ D ^ u ~ q 2 + λ ∂ G I { ∂ u ~ ∂ G ^ u ~ q > 0 } ∂ u ~ ∂ G ^ u ~ q 2 .
where D ^ q = D ^ ( u ~ q ) \hat{D}_q=\hat{D}(\tilde{u}_q) D ^ q = D ^ ( u ~ q ) , G ^ q = G ^ ( u ~ q ) \hat{G}_q=\hat{G}(\tilde{u}_q) G ^ q = G ^ ( u ~ q ) , the indicator function I { c o n d i t i o n } \mathbb{I}_{\{\mathrm{condition}\}} I { condition } equals 1 if the condition holds and 0 otherwise, and the non-dimensionalised bounds are d ~ min = d min / d s c a l e \tilde{d}_{\min}=d_{\min}/d_{\mathrm{scale}} d ~ m i n = d m i n / d scale , d ~ max = d max / d s c a l e \tilde{d}_{\max}=d_{\max}/d_{\mathrm{scale}} d ~ m a x = d m a x / d scale , g ~ min = g min / g s c a l e \tilde{g}_{\min}=g_{\min}/g_{\mathrm{scale}} g ~ m i n = g m i n / g scale , and g ~ max = g max / g s c a l e \tilde{g}_{\max}=g_{\max}/g_{\mathrm{scale}} g ~ m a x = g m a x / g scale . The coefficients λ D l i m \lambda_{D\mathrm{lim}} λ D lim and λ G l i m \lambda_{G\mathrm{lim}} λ G lim weight the penalties enforcing the prescribed bounds on D ^ \hat{D} D ^ and G ^ \hat{G} G ^ , respectively, while λ ∂ D \lambda_{\partial D} λ ∂ D and λ ∂ G \lambda_{\partial G} λ ∂ G weight the corresponding derivative-constraint penalties.
Network design
To describe the multilayer perceptrons (MLPs) used here in an accessible manner, we first present a generic ℓ \ell ℓ -layer architecture consisting of ℓ − 1 \ell-1 ℓ − 1 hidden layers followed by a single output layer.
Generic MLP
Assume the network processes a minibatch of inputs X ∈ R n b × n ( 0 ) \mathbf{X}\in\mathbb{R}^{n_b\times n^{(0)}} X ∈ R n b × n ( 0 ) , where n b n_b n b is the batch size and n ( 0 ) n^{(0)} n ( 0 ) the input dimension. Take the widths of the hidden layers to be n ( 1 ) , … , n ( ℓ − 1 ) n^{(1)},\ldots,n^{(\ell-1)} n ( 1 ) , … , n ( ℓ − 1 ) and the output width as n ( ℓ ) n^{(\ell)} n ( ℓ ) . Each layer l = 1 , … , ℓ l=1,\ldots,\ell l = 1 , … , ℓ is characterised by a weight matrix Φ ( l ) ∈ R n ( l − 1 ) × n ( l ) \boldsymbol{\Phi}^{(l)}\in\mathbb{R}^{n^{(l-1)}\times n^{(l)}} Φ ( l ) ∈ R n ( l − 1 ) × n ( l ) and a bias vector b ( l ) ∈ R n ( l ) \mathbf{b}^{(l)}\in\mathbb{R}^{n^{(l)}} b ( l ) ∈ R n ( l ) . Setting H ( 0 ) = X \mathbf{H}^{(0)}=\mathbf{X} H ( 0 ) = X , the pre-activations and activations are computed recursively as
Z ( l ) = H ( l − 1 ) Φ ( l ) + 1 n b b ( l ) T , l = 1 , … , ℓ , \mathbf{Z}^{(l)}=\mathbf{H}^{(l-1)}\boldsymbol{\Phi}^{(l)}+\mathbf{1}_{n_b}\mathbf{b}^{(l)\mathsf{T}},\qquad l=1,\ldots,\ell, Z ( l ) = H ( l − 1 ) Φ ( l ) + 1 n b b ( l ) T , l = 1 , … , ℓ ,
H ( l ) = { σ ( l ) ( Z ( l ) ) , l = 1 , … , ℓ − 1 , κ σ ( ℓ ) ( Z ( ℓ ) ) , l = ℓ , \mathbf{H}^{(l)}=
\begin{cases}
\sigma^{(l)}\left(\mathbf{Z}^{(l)}\right), & l=1,\ldots,\ell-1,\\
\kappa\sigma^{(\ell)}\left(\mathbf{Z}^{(\ell)}\right), & l=\ell,
\end{cases} H ( l ) = { σ ( l ) ( Z ( l ) ) , κ σ ( ℓ ) ( Z ( ℓ ) ) , l = 1 , … , ℓ − 1 , l = ℓ ,
where σ ( l ) \sigma^{(l)} σ ( l ) is the element-wise activation function at layer l l l , 1 n b \mathbf{1}_{n_b} 1 n b is the column vector of ones of length n b n_b n b , and κ > 0 \kappa>0 κ > 0 is a scalar that rescales the network’s final output. Throughout we set κ = 1 \kappa=1 κ = 1 , so no output rescaling is applied within the networks. If σ ( ℓ ) \sigma^{(\ell)} σ ( ℓ ) is chosen as the identity, H ( ℓ ) = κ Z ( ℓ ) \mathbf{H}^{(\ell)}=\kappa\mathbf{Z}^{(\ell)} H ( ℓ ) = κ Z ( ℓ ) . In the expanded forms below we abbreviate 1 n b b ( l ) T \mathbf{1}_{n_b}\mathbf{b}^{(l)\mathsf{T}} 1 n b b ( l ) T to b ( l ) \mathbf{b}^{(l)} b ( l ) for ease of notation; in each case the bias vector is understood to be broadcast over the n b n_b n b rows of the preceding matrix product.
Density MLP
The cell density field is represented by an MLP N N u \mathrm{NN}_u NN u , consisting of three hidden layers and one output layer (ℓ = 4 \ell=4 ℓ = 4 ). Furthermore, each hidden layer within a given MLP contains the same number of neurons denoted by W u W_u W u , while the output layer consists of a single neuron.
N N u ( X ) = σ s o f t ( σ h i d d e n ( σ h i d d e n ( σ h i d d e n ( X Φ u ( 1 ) + b u ( 1 ) ) Φ u ( 2 ) + b u ( 2 ) ) Φ u ( 3 ) + b u ( 3 ) ) Φ u ( 4 ) + b u ( 4 ) ) , \mathrm{NN}_u(\mathbf{X})=\sigma_{\mathrm{soft}}\left(\sigma_{\mathrm{hidden}}\left(\sigma_{\mathrm{hidden}}\left(\sigma_{\mathrm{hidden}}\left(\mathbf{X}\boldsymbol{\Phi}^{(1)}_u+\mathbf{b}^{(1)}_u\right)\boldsymbol{\Phi}^{(2)}_u+\mathbf{b}^{(2)}_u\right)\boldsymbol{\Phi}^{(3)}_u+\mathbf{b}^{(3)}_u\right)\boldsymbol{\Phi}^{(4)}_u+\mathbf{b}^{(4)}_u\right), NN u ( X ) = σ soft ( σ hidden ( σ hidden ( σ hidden ( X Φ u ( 1 ) + b u ( 1 ) ) Φ u ( 2 ) + b u ( 2 ) ) Φ u ( 3 ) + b u ( 3 ) ) Φ u ( 4 ) + b u ( 4 ) ) ,
Φ u ( 1 ) ∈ R ( d + 1 ) × W u , Φ u ( 2 ) , Φ u ( 3 ) ∈ R W u × W u , Φ u ( 4 ) ∈ R W u × 1 ; b u ( l ) ∈ R W u , l = 1 , 2 , 3 , b u ( 4 ) ∈ R 1 . \boldsymbol{\Phi}^{(1)}_u\in\mathbb{R}^{(d+1)\times W_u},\qquad\boldsymbol{\Phi}^{(2)}_u,\boldsymbol{\Phi}^{(3)}_u\in\mathbb{R}^{W_u\times W_u},\qquad\boldsymbol{\Phi}^{(4)}_u\in\mathbb{R}^{W_u\times1};\qquad\mathbf{b}^{(l)}_u\in\mathbb{R}^{W_u},\ l=1,2,3,\ \mathbf{b}^{(4)}_u\in\mathbb{R}^{1}. Φ u ( 1 ) ∈ R ( d + 1 ) × W u , Φ u ( 2 ) , Φ u ( 3 ) ∈ R W u × W u , Φ u ( 4 ) ∈ R W u × 1 ; b u ( l ) ∈ R W u , l = 1 , 2 , 3 , b u ( 4 ) ∈ R 1 .
The expanded form is written here for the three hidden layers (L u = 3 L_u = 3 L u = 3 ), but it extends straightforwardly to any number of hidden layers by inserting additional σ h i d d e n ( ⋅ Φ u ( l ) + b u ( l ) ) \sigma_{\mathrm{hidden}}(\cdot\boldsymbol{\Phi}_u^{(l)} + \mathbf{b}_u^{(l)}) σ hidden ( ⋅ Φ u ( l ) + b u ( l ) ) compositions. The input comprises the d d d spatial coordinates and time, X ∈ R n b × ( d + 1 ) \mathbf{X} \in\mathbb{R}^{n_b \times(d+1)} X ∈ R n b × ( d + 1 ) . All hidden layers share a common hidden activation σ h i d d e n \sigma_{\mathrm{hidden}} σ hidden (default σ h i d d e n = S i L U = x 1 + e − x \sigma_{\mathrm{hidden}} = \mathrm{SiLU} = \frac{x}{1+e^{-x}} σ hidden = SiLU = 1 + e − x x ), while the output layer uses the softplus activation σ s o f t ( x ) = ln ( 1 + e x ) \sigma_{\mathrm{soft}}(x) = \ln(1+e^x) σ soft ( x ) = ln ( 1 + e x ) to ensure non-negative cell density predictions.
Diffusion and growth MLPs
The diffusion and growth coefficient functions are also represented by MLPs, N N D \mathrm{NN}_D NN D and N N G \mathrm{NN}_G NN G , which take N N u ( X ) \mathrm{NN}_u(\mathbf{X}) NN u ( X ) as their input and each return a scalar output. As for N N u \mathrm{NN}_u NN u , each hidden layer within a given network has identical width, denoted by W D W_D W D and W G W_G W G , respectively. Each output layer consists of a single neuron.
Diffusion network
N N D ( N N u ( X ) ) = σ s o f t ( σ h i d d e n ( σ h i d d e n ( σ h i d d e n ( N N u ( X ) Φ D ( 1 ) + b D ( 1 ) ) Φ D ( 2 ) + b D ( 2 ) ) Φ D ( 3 ) + b D ( 3 ) ) Φ D ( 4 ) + b D ( 4 ) ) \mathrm{NN}_D(\mathrm{NN}_u(\mathbf{X})) = \sigma_{\mathrm{soft}}\left(\sigma_{\mathrm{hidden}}\left(\sigma_{\mathrm{hidden}}\left(\sigma_{\mathrm{hidden}}\left(\mathrm{NN}_u(\mathbf{X})\boldsymbol{\Phi}_D^{(1)} + \mathbf{b}_D^{(1)}\right)\boldsymbol{\Phi}_D^{(2)} + \mathbf{b}_D^{(2)}\right)\boldsymbol{\Phi}_D^{(3)} + \mathbf{b}_D^{(3)}\right)\boldsymbol{\Phi}_D^{(4)} + \mathbf{b}_D^{(4)}\right) NN D ( NN u ( X )) = σ soft ( σ hidden ( σ hidden ( σ hidden ( NN u ( X ) Φ D ( 1 ) + b D ( 1 ) ) Φ D ( 2 ) + b D ( 2 ) ) Φ D ( 3 ) + b D ( 3 ) ) Φ D ( 4 ) + b D ( 4 ) )
Φ D ( 1 ) ∈ R 1 × W D , Φ D ( 2 ) , Φ D ( 3 ) ∈ R W D × W D , Φ D ( 4 ) ∈ R W D × 1 ; b D ( l ) ∈ R W D , l = 1 , 2 , 3 , b D ( 4 ) ∈ R 1 . \boldsymbol{\Phi}_D^{(1)} \in\mathbb{R}^{1 \times W_D},\quad\boldsymbol{\Phi}_D^{(2)},\boldsymbol{\Phi}_D^{(3)} \in\mathbb{R}^{W_D \times W_D},\quad\boldsymbol{\Phi}_D^{(4)} \in\mathbb{R}^{W_D \times1};\quad\mathbf{b}_D^{(l)} \in\mathbb{R}^{W_D},\ l=1,2,3,\ \mathbf{b}_D^{(4)} \in\mathbb{R}^{1}. Φ D ( 1 ) ∈ R 1 × W D , Φ D ( 2 ) , Φ D ( 3 ) ∈ R W D × W D , Φ D ( 4 ) ∈ R W D × 1 ; b D ( l ) ∈ R W D , l = 1 , 2 , 3 , b D ( 4 ) ∈ R 1 .
The softplus activation in the output layer enforces non-negative diffusivity. The expanded form is written here for the three hidden layers (L D = 3 L_D = 3 L D = 3 ), but it extends straightforwardly to any number of hidden layers by inserting additional σ h i d d e n ( ⋅ Φ D ( l ) + b D ( l ) ) \sigma_{\mathrm{hidden}}(\cdot\boldsymbol{\Phi}_D^{(l)} + \mathbf{b}_D^{(l)}) σ hidden ( ⋅ Φ D ( l ) + b D ( l ) ) compositions.
Growth network
N N G ( N N u ( X ) ) = σ h i d d e n ( σ h i d d e n ( σ h i d d e n ( N N u ( X ) Φ G ( 1 ) + b G ( 1 ) ) Φ G ( 2 ) + b G ( 2 ) ) Φ G ( 3 ) + b G ( 3 ) ) Φ G ( 4 ) + b G ( 4 ) . \mathrm{NN}_G(\mathrm{NN}_u(\mathbf{X})) = \sigma_{\mathrm{hidden}}\left(\sigma_{\mathrm{hidden}}\left(\sigma_{\mathrm{hidden}}\left(\mathrm{NN}_u(\mathbf{X})\boldsymbol{\Phi}_G^{(1)} + \mathbf{b}_G^{(1)}\right)\boldsymbol{\Phi}_G^{(2)} + \mathbf{b}_G^{(2)}\right)\boldsymbol{\Phi}_G^{(3)} + \mathbf{b}_G^{(3)}\right)\boldsymbol{\Phi}_G^{(4)} + \mathbf{b}_G^{(4)}. NN G ( NN u ( X )) = σ hidden ( σ hidden ( σ hidden ( NN u ( X ) Φ G ( 1 ) + b G ( 1 ) ) Φ G ( 2 ) + b G ( 2 ) ) Φ G ( 3 ) + b G ( 3 ) ) Φ G ( 4 ) + b G ( 4 ) .
Φ G ( 1 ) ∈ R 1 × W G , Φ G ( 2 ) , Φ G ( 3 ) ∈ R W G × W G , Φ G ( 4 ) ∈ R W G × 1 ; b G ( l ) ∈ R W G , l = 1 , 2 , 3 , b G ( 4 ) ∈ R 1 . \boldsymbol{\Phi}_G^{(1)} \in\mathbb{R}^{1 \times W_G},\quad\boldsymbol{\Phi}_G^{(2)},\boldsymbol{\Phi}_G^{(3)} \in\mathbb{R}^{W_G \times W_G},\quad\boldsymbol{\Phi}_G^{(4)} \in\mathbb{R}^{W_G \times1};\quad\mathbf{b}_G^{(l)} \in\mathbb{R}^{W_G},\ l=1,2,3,\ \mathbf{b}_G^{(4)} \in\mathbb{R}^{1}. Φ G ( 1 ) ∈ R 1 × W G , Φ G ( 2 ) , Φ G ( 3 ) ∈ R W G × W G , Φ G ( 4 ) ∈ R W G × 1 ; b G ( l ) ∈ R W G , l = 1 , 2 , 3 , b G ( 4 ) ∈ R 1 .
No non-negativity constraint is imposed on the growth term, and the output layer therefore uses the identity activation. The expanded form is written here for three hidden layers (L G = 3 L_G = 3 L G = 3 ), but it extends straightforwardly to any number of hidden layers by inserting additional σ h i d d e n ( ⋅ Φ G ( l ) + b G ( l ) ) \sigma_{\mathrm{hidden}}(\cdot\boldsymbol{\Phi}_G^{(l)} + \mathbf{b}_G^{(l)}) σ hidden ( ⋅ Φ G ( l ) + b G ( l ) ) compositions.
Early-stopping algorithm
Here, the primary hyperparameters are the early-stopping patience (E S ES E S ) and the widths of the density, diffusion, and growth MLPs, denoted by W u W_u W u , W D W_D W D , and W G W_G W G , respectively. Without loss of generality, we define the BINN configuration with respect to these parameters A = ( W u , W D , W G , E S ) \mathcal{A} = (W_u, W_D, W_G, ES) A = ( W u , W D , W G , E S ) . The complete early-stopping procedure is given in Algorithm 1.
Algorithm 1: Validation-loss-based early stopping for experimental and simulated data, with optional recording of diffusion and growth MSEs
Input: BINN configuration A = ( W u , W D , W G , E S ) \mathcal{A}=(W_u,W_D,W_G,ES) A = ( W u , W D , W G , E S ) ; training data T \mathcal{T} T and validation data V \mathcal{V} V ; minibatch size n b n_b n b ; density grid { u ~ q } q = 1 n M S E ⊆ [ u ~ min , u ~ max ] \{\tilde{u}_q\}_{q=1}^{n_{\mathrm{MSE}}}\subseteq[\tilde{u}_{\min},\tilde{u}_{\max}] { u ~ q } q = 1 n MSE ⊆ [ u ~ m i n , u ~ m a x ] ; characteristic diffusion and growth scales d s c a l e d_{\mathrm{scale}} d scale and g s c a l e g_{\mathrm{scale}} g scale ; large maximum epoch cap e max e_{\max} e m a x ; mode ∈ { s i m u l a t e d , e x p e r i m e n t a l } \in\{\mathrm{simulated},\mathrm{experimental}\} ∈ { simulated , experimental } ; relative update threshold δ u p d \delta_{\mathrm{upd}} δ upd (default 0.05); validation frequency ν \nu ν (default 1); and, for simulated data only, ground-truth diffusion D t r u e D_{\mathrm{true}} D true , ground-truth growth G t r u e G_{\mathrm{true}} G true , MSE sampling interval ρ = 10 \rho=10 ρ = 10 , and number of MSE points n M S E = 20 n_{\mathrm{MSE}}=20 n MSE = 20 .
Initialisation: L v a l ⋆ ← + ∞ \mathcal{L}_{\mathrm{val}}^\star\leftarrow+\infty L val ⋆ ← + ∞ // Best validation loss for updates
e ⋆ ← 0 e^\star\leftarrow0 e ⋆ ← 0 // Epoch of most recent qualifying update
e s a v ← 0 e_{\mathrm{sav}}\leftarrow0 e sav ← 0 // Epoch of most recently saved checkpoint
L ← ∅ L\leftarrow\varnothing L ← ∅ // Validation-loss history
D ← ∅ D\leftarrow\varnothing D ← ∅ // Diffusion-MSE history
G ← ∅ G\leftarrow\varnothing G ← ∅ // Growth-MSE history
for e ← 0 e\leftarrow0 e ← 0 to e max − 1 e_{\max}-1 e m a x − 1 do
Shuffle T \mathcal{T} T and divide it into N t r , b a t c h = ⌈ ∣ T ∣ n b ⌉ N_{\mathrm{tr,batch}}=\left\lceil\frac{|\mathcal{T}|}{n_b}\right\rceil N tr , batch = ⌈ n b ∣ T ∣ ⌉ training minibatches, each containing at most n b n_b n b observations;
foreach training minibatch B t r ⊆ T \mathcal{B}_{\mathrm{tr}}\subseteq\mathcal{T} B tr ⊆ T do
Compute the total training loss on B t r \mathcal{B}_{\mathrm{tr}} B tr ;
Backpropagate the total loss and update the model parameters using the optimiser;
if e m o d ν = 0 e\bmod\nu=0 e mod ν = 0 then
Divide V \mathcal{V} V into N v a l , b a t c h = ⌈ ∣ V ∣ n b ⌉ N_{\mathrm{val,batch}}=\left\lceil\frac{|\mathcal{V}|}{n_b}\right\rceil N val , batch = ⌈ n b ∣ V ∣ ⌉ validation minibatches, each containing at most n b n_b n b observations;
foreach validation minibatch B v a l ⊆ V \mathcal{B}_{\mathrm{val}}\subseteq\mathcal{V} B val ⊆ V do
Compute the validation loss L v a l ( B v a l ; e ) \mathcal{L}_{\mathrm{val}}(\mathcal{B}_{\mathrm{val}};e) L val ( B val ; e ) ;
Average the validation-minibatch losses: L v a l [ e ] ← 1 N v a l , b a t c h ∑ B v a l L v a l ( B v a l ; e ) \mathcal{L}_{\mathrm{val}}[e]\leftarrow\frac{1}{N_{\mathrm{val,batch}}}\sum_{\mathcal{B}_{\mathrm{val}}}\mathcal{L}_{\mathrm{val}}(\mathcal{B}_{\mathrm{val}};e) L val [ e ] ← N val , batch 1 ∑ B val L val ( B val ; e ) ;
Append L v a l [ e ] \mathcal{L}_{\mathrm{val}}[e] L val [ e ] to L L L ;
L b e s t , p r e v ⋆ ← L v a l ⋆ \mathcal{L}_{\mathrm{best,prev}}^\star\leftarrow\mathcal{L}_{\mathrm{val}}^\star L best , prev ⋆ ← L val ⋆ ;
if L v a l [ e ] < L b e s t , p r e v ⋆ ( 1 − δ u p d ) \mathcal{L}_{\mathrm{val}}[e]<\mathcal{L}_{\mathrm{best,prev}}^\star(1-\delta_{\mathrm{upd}}) L val [ e ] < L best , prev ⋆ ( 1 − δ upd ) then
L v a l ⋆ ← L v a l [ e ] \mathcal{L}_{\mathrm{val}}^\star\leftarrow\mathcal{L}_{\mathrm{val}}[e] L val ⋆ ← L val [ e ] ;
e ⋆ ← e e^\star\leftarrow e e ⋆ ← e ;
Save the trained model as configuration_best;
e s a v ← e e_{\mathrm{sav}}\leftarrow e e sav ← e ;
if mode = simulated and e m o d ρ = 0 e\bmod\rho=0 e mod ρ = 0 then
Compute MSE ( D ^ ; e ) = 1 n M S E ∑ q = 1 n M S E ( d s c a l e D ^ ( u ~ q ) − D t r u e ( u ~ q ) ) 2 \operatorname{MSE}(\hat{D};e)=\frac{1}{n_{\mathrm{MSE}}}\sum_{q=1}^{n_{\mathrm{MSE}}}\left(d_{\mathrm{scale}}\hat{D}(\tilde{u}_q)-D_{\mathrm{true}}(\tilde{u}_q)\right)^2 MSE ( D ^ ; e ) = n MSE 1 ∑ q = 1 n MSE ( d scale D ^ ( u ~ q ) − D true ( u ~ q ) ) 2 ;
Compute MSE ( G ^ ; e ) = 1 n M S E ∑ q = 1 n M S E ( g s c a l e G ^ ( u ~ q ) − G t r u e ( u ~ q ) ) 2 \operatorname{MSE}(\hat{G};e)=\frac{1}{n_{\mathrm{MSE}}}\sum_{q=1}^{n_{\mathrm{MSE}}}\left(g_{\mathrm{scale}}\hat{G}(\tilde{u}_q)-G_{\mathrm{true}}(\tilde{u}_q)\right)^2 MSE ( G ^ ; e ) = n MSE 1 ∑ q = 1 n MSE ( g scale G ^ ( u ~ q ) − G true ( u ~ q ) ) 2 ;
Append MSE ( D ^ ; e ) \operatorname{MSE}(\hat{D};e) MSE ( D ^ ; e ) to D D D ;
Append MSE ( G ^ ; e ) \operatorname{MSE}(\hat{G};e) MSE ( G ^ ; e ) to G G G ;
if e − e ⋆ ≥ E S e-e^\star\ge ES e − e ⋆ ≥ E S then
break;
Output: saved model configuration_best (referred to as the best model) and its epoch e s a v e_{\mathrm{sav}} e sav ; best update epoch e ⋆ e^\star e ⋆ ; validation-loss history L L L ; and, for simulated data only, diffusion- and growth-MSE histories D D D and G G G .