---
title: 'DUALFloodGNN: Physically-Informed Flood Modeling'
url: https://www.emergentmind.com/topics/dualfloodgnn
type: topic
---

# DUALFloodGNN: Physically-Informed Flood Modeling

DUALFloodGNN is a physics-informed graph neural network architecture designed to enable rapid and physically consistent operational flood modeling on unstructured spatial domains. It extends standard Encode–Process–Decode GNN frameworks with explicit representations of hydrodynamic quantities and conservation laws, achieving improved predictive accuracy and computational efficiency compared to previous flood modeling approaches that leverage deep learning on spatial graphs [2512.23964].

## 1. Model Architecture

DUALFloodGNN represents the computational domain as a directed graph $\mathcal{G}=(V,E)$, where each node $i\in V$ corresponds to a cell centroid in a 2D unstructured mesh, and each directed edge $(i\to j)\in E$ represents adjacency between cells. Node features $X\in \mathbb{R}^{|V|\times f_v}$ combine static attributes (cell area, elevation) and dynamic variables (water volume $V^t$, rainfall $R$, upstream inflow $Q_\text{in}$, downstream outflow $Q_\text{out}$) concatenated over $p$ previous time steps. Edge features $E\in \mathbb{R}^{|E|\times f_e}$ encode static properties (channel width, slope) and dynamic flow $Q^t$.

The model does not directly forecast future states $V^{t+1}$ and $Q^{t+1}$ but predicts their residual increments $\Delta V$ and $\Delta Q$, which are added to the latest state, improving stability in multi-step inference.

**Input Construction**:
\[
\mathbf{X}^t = [X_S \,\Vert\, X_D^{t-p}\, \Vert\, \cdots \,\Vert\, X_D^t],\qquad 
\mathbf{E}^t = [E_S \,\Vert\, E_D^{t-p}\, \Vert\, \cdots \,\Vert\, E_D^t]
\]

**Encoder Mapping**:
\[
H^{(0)} = \text{MLP}_\text{node}(X^t), \quad \varepsilon^{(0)} = \text{MLP}_\text{edge}(E^t)
\]

**Message Passing**: For each layer $\ell=0,\ldots,L-1$, node and edge embeddings are jointly updated using messages:
\[
m_{ji}^{(\ell)} = \text{MLP}_\text{msg}\left( [h_i^{(\ell)}\,\Vert\,h_j^{(\ell)}\,\Vert\, e_{ij}^{(\ell)} ] \right), \quad j\in \mathcal{N}(i)
\]
\[
h_i^{(\ell+1)} = \text{MLP}_\text{update}\left( \sum_{j\in \mathcal{N}(i)} m_{ji}^{(\ell)} \right)
\]
\[
e_{ij}^{(\ell+1)} = m_{ji}^{(\ell)}
\]
A ReLU activation is applied at intermediate layers (except final), and biases are omitted in all MLPs to prevent spurious isolated-node volumes.

**Decoding**:
After $L$ process layers,
\[
\Delta V^{t+1} = \text{MLP}_\text{dec,node}(H^L), \qquad
\Delta Q^{t+1} = \text{MLP}_\text{dec,edge}(\varepsilon^L)
\]

## 2. Physics-Informed Loss Formulations

Training is governed by a composite loss function incorporating both standard prediction errors and physics-informed penalties that enforce mass conservation.

**Prediction Loss (Node and Edge MSE)**:
\[
\mathcal{L}_\text{node} = \frac{1}{|V|}\sum_{i\in V}\left( \overline{\Delta V_i} - \Delta V_i \right)^2,\quad
\mathcal{L}_\text{edge} = \frac{1}{|E|}\sum_{k\in E}\left( \overline{\Delta Q_k} - \Delta Q_k\right)^2
\]
\[
\mathcal{L}_\text{pred} = \lambda_1\,\mathcal{L}_\text{node} + \lambda_2\,\mathcal{L}_\text{edge}
\]

**Global Mass Conservation**:
\[
\sum_{i} \Delta V_i^t  = (Q_\text{in}^t - Q_\text{out}^t)\Delta t + \sum_{i} R_i^t
\]
\[
\mathcal{L}_\text{global} = \left\lvert \sum_{i}\Delta V_i^t - \left[(Q_\text{in}^t - Q_\text{out}^t)\Delta t + \sum_i R_i^t\right] \right\rvert
\]

**Local Mass Conservation (Nodewise)**:
Construct weighted adjacency $I_w$,
\[
I_w = I_\text{undir} \odot [\text{ReLU}(Q) \,\Vert\, -\text{ReLU}(-Q)]
\]
Inflow and outflow per node $i$:
\[
Q_{i+} = \sum_{j\in\mathcal{N}_\text{in}(i)} I_{w_{j,i}},\quad
Q_{i-} = \sum_{j\in\mathcal{N}_\text{out}(i)} I_{w_{i,j}}
\]
Local physical relation:
\[
\Delta V_i^t = (Q_{i+}^t - Q_{i-}^t)\Delta t + R_i^t
\]
Corresponding loss:
\[
\mathcal{L}_\text{local} = \sum_{i\in V} \left\lvert \Delta V_i^t - \left[(Q_{i+}^t - Q_{i-}^t)\Delta t + R_i^t \right] \right\rvert
\]

**Total Physics-Informed Loss**:
\[
\mathcal{L}_\text{physics} = \lambda_3\,\mathcal{L}_\text{global} + \lambda_4\,\mathcal{L}_\text{local}
\]

**Single-Step Loss**:
\[
\mathcal{L} = \mathcal{L}_\text{pred} + \mathcal{L}_\text{physics}
\]

## 3. Joint Prediction of Volume and Flow

DUALFloodGNN employs a unified message-passing mechanism whereby the shared messages $m_{ji}$ update both node and edge latent states, thus enforcing intrinsic coupling between water volume (scalar-like) and flow (vector-like) variables. Overwriting of edge embeddings with the same message that updates node states enables information about transport and accumulation to coexist within a single latent space. Distinct decoders for $\Delta V$ and $\Delta Q$ yield the final predictions for nodes and edges, respectively. This methodology obviates the computational expense of line-graph constructions and produces physically consistent multi-output inference in a single forward pass.

## 4. Multi-Step Training and Dynamic Curriculum

The model is optimized not only for single-step predictions but also for accurate multi-step autoregressive rollout. During training, for batch time-steps $o=1,\dots,O$, the model is unrolled into $O$-step sequences, using its own predicted increments at each step for input construction. The rollout loss is the mean over the temporal sequence:
\[
\mathcal{L}_\text{rollout} = \frac{1}{O} \sum_{o=1}^{O} \mathcal{L}(\Delta V^o, \Delta Q^o)
\]

Dynamic curriculum learning is employed: training starts with $O=1$, and only after convergence at each rollout horizon is the sequence length incremented by $C$ (typically $C=1$), at which point the learning rate decays by a factor $\gamma$. This staged progression stabilizes learning and mitigates error amplification in long-horizon autoregressive simulations.

## 5. Empirical Performance and Evaluation

On a Wollombi River test set comprising 1129 nodes, 2743 edges, 56 events, and using 14-fold cross-validation, DUALFloodGNN exhibits substantial quantitative improvements over alternative GNN architectures:

| Metric                        | DUALFloodGNN     | Best Comparator        | Relative Improvement |
|-------------------------------|------------------|-----------------------|---------------------|
| Node-volume RMSE              | $\approx 2.2\times10^3$ m³ | GINE $\approx 3.4\times10^3$ m³ | $-35\%$     |
| Edge-flow RMSE                | $25.9$ m³/s      | GraphSAGE edge: $44.0$ m³/s | $-41\%$         |
| Water-depth RMSE              | $0.21$ m         | HydroGraphNet: $0.76$ m     | $-72\%$         |
| Flood CSI (0.05 m depth)      | $0.90$           | HydroGraphNet: $0.69$; SWE-GNN: $0.47$ |             |
| Inference time, 576 steps     | $\sim 4.1$ s     | HydroGraphNet: $\sim 3.3$ s | Orders faster than full numerical solvers |

Temporal RMSE plots confirm the persistence of low error across rollout, whereas competitors demonstrate more rapid error growth. Visual inundation maps show that DUALFloodGNN more closely tracks the ground truth, especially in the resolution of microscale lateral flows.

## 6. Implementation Details and Computational Scaling

The model is implemented in PyTorch and PyTorch-Geometric, with computation on NVIDIA V100 GPUs. Typical training uses $L=4$ GNN layers, MLPs with width 128, and dropout rate 0.1. Loss weights $(\lambda_1,\lambda_2,\lambda_3,\lambda_4)$ are optimized by grid search; for example $(1.0,1.0,0.5,1.0)$. The curriculum step $C=1$ and learning rate decay $\gamma=0.8$ are standard.

Training time is approximately 2 hours per cross-validation fold, with memory usage around 4 GB per V100 GPU. The method scales linearly with mesh size $|V|+|E|$ and is demonstrated to handle up to $10^5$ cells in multi-GPU environments.

## 7. Limitations and Prospective Extensions

Although validated on flow-dominated events in a single catchment, DUALFloodGNN's generalization to rainfall-dominated floods, urban drainage systems, or coastal flooding scenarios—including significant wave effects—remains to be established. The use of absolute-value physics losses produces sub-gradients only at zero; investigation of alternative (e.g., Huber-type) residual penalties is warranted. Representation of complex, time-dependent boundary conditions such as moving stage hydrographs is not yet incorporated, and would require further architectural developments. Integration with uncertainty quantification frameworks, for example Bayesian GNNs or model ensembles, is necessary for operational deployment with reliable confidence intervals.

The principal contribution of DUALFloodGNN lies in its joint encoding of hydrodynamic volume and flow variables, its explicit enforcement of global and local conservation laws through loss function design, and its robust training strategy for multi-step inference. Open-source code and data-processing resources are provided to support reproduction and adaptation [2512.23964].

Source: https://www.emergentmind.com/topics/dualfloodgnn