Scalable and Robust Physics-Informed Graph Neural Networks for Water Distribution Systems

Inaam Ashraf, André Artelt, Barbara Hammer

Introduction

Managing Water Distribution Systems (WDS) is a critical component of urban sustainability and public health. To ensure reliable water delivery, engineers rely on hydraulic simulators to determine the "state" of a network—specifically the water pressure (head) at nodes and the flow rates through pipes. The industry standard, EPANET, solves complex non-linear equations to provide these values. However, while accurate, EPANET is computationally expensive, making it difficult to use for tasks requiring millions of iterations, such as real-time leak detection or long-term urban planning.

In recent years, Deep Learning (DL) has been proposed as a "surrogate" to replace traditional simulators with faster, data-driven models. However, previous attempts have struggled with scalability to large networks, the inability to model real-world components like pumps and valves, and poor generalization when faced with data outside the training set. This paper introduces SPI-GNN (Scalable Physics-Informed Graph Neural Network), a robust framework designed to overcome these hurdles while maintaining high accuracy and significant speedups.

The SPI-GNN Framework

SPI-GNN bridges the gap between traditional hydraulics and modern machine learning through several key architectural and procedural innovations.

Hybrid Architecture and Two-Phase Training

The model utilizes a dual-component architecture. The first component, $f_1$, is a local learnable GNN that predicts initial flow patterns. The second, $f_2$, is a global physics-informed algorithm that enforces the conservation of mass and energy across the entire network.

To ensure stability, the authors implemented a two-phase training scheme. Physics-informed models often suffer from "exploding gradients" when constraints are introduced too early. By first training the GNN to recognize local patterns and then introducing physics-informed constraints to fine-tune the global state, the researchers achieved a more stable and accurate convergence.

Physics-Preserving Normalization

Standard machine learning normalization techniques, such as Z-score normalization, often destroy the delicate mathematical relationships between pressure, flow, and demand. SPI-GNN introduces a unique physics-preserving normalization method. By scaling inputs (like water demand) by their sum and mathematically adjusting reservoir heads and pump attributes proportionally, the model ensures that the underlying hydraulic equations remain valid even in a normalized space. This allows the model to handle "out-of-distribution" (OOD) scenarios—such as a sudden 10x spike in demand—without a significant loss in accuracy.

Modeling Real-World Complexity

Unlike many academic models that simplify networks to basic pipes and nodes, SPI-GNN explicitly incorporates the non-linear physics of pumps and pressure-reducing valves (PRVs) into its message-passing layers. This inclusion moves the model away from theoretical abstraction and toward a practical tool for civil engineers managing complex city grids.

Experimental Evaluation

The researchers evaluated SPI-GNN against eleven different WDS benchmarks, ranging from small networks like Anytown (19 nodes) to large-scale realistic systems like L-Town (782 nodes) and KL (935 nodes). To compensate for the scarcity of real-world data, 6,000 samples were generated for each network by varying demands and pipe diameters, ensuring the model was tested against a wide variety of operating conditions.

Key Results and Insights

Accuracy and Speed

SPI-GNN consistently outperformed previous state-of-the-art physics-informed models (such as PI-GNN), particularly in estimating pressure heads in larger networks. The most striking result was the computational efficiency: in the Pescara network, SPI-GNN achieved a 213x speedup (21,335%) compared to the EPANET hydraulic simulator. Interestingly, the efficiency gains over EPANET increased as the network complexity grew, making SPI-GNN particularly well-suited for large metropolitan systems.

Robustness to Noise

The model demonstrated remarkable robustness to "out-of-distribution" data. Even when noise in pipe diameters was increased by a factor of ten—simulating significant uncertainty in infrastructure data—the Mean Absolute Error (MAE) remained consistently low (below 0.05). This suggests the model is learning the underlying physics of water flow rather than simply memorizing the training data.

Limitations and Future Directions

While SPI-GNN represents a significant leap forward, the authors identify several areas for future development:

  • Temporal Dynamics: The current model provides a "snapshot" of the system state. Future iterations will need to account for how water levels in tanks change over time (extended period simulation).
  • Sparse Sensing: The model currently assumes demand is known at every node. In practice, utilities only have data from a limited number of sensors. Adapting SPI-GNN to estimate the full state from sparse readings is a high-priority goal.
  • Inverse Problems: Because the model is differentiable, it is a prime candidate for optimization tasks, such as automatically determining the most cost-effective pipe diameters for new neighborhood expansions.

By combining the speed of Graph Neural Networks with the rigor of hydraulic physics, SPI-GNN provides a scalable, robust path toward the next generation of smart water management tools.

Summary updated

BibTeX
@inproceedings{ashraf2025scalable,
  author = {Inaam Ashraf and André Artelt and Barbara Hammer},
  title = {{Scalable and Robust Physics-Informed Graph Neural Networks for Water Distribution Systems}},
  booktitle = {IJCNN},
  year = {2025},
  doi = {10.1109/ijcnn64981.2025.11229349},
}
Figure