Next Article in Journal
Enhancing HiL Driving Simulators with Remote Braking Control Through a Novel Automated Programming Method
Previous Article in Journal
Heat Pipe-Assisted Air Cooling for Fuel Cells in Aviation: Heat Transfer Modeling and Design Modifications
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Detection and Classification of Anomalies in Water Distribution Systems †

1
Faculty of Agricultural, Environmental and Food Sciences, Free University of Bozen-Bolzano, 39100 Bolzano, Italy
2
Faculty of Engineering, Free University of Bozen-Bolzano, 39100 Bolzano, Italy
3
Institute for Renewable Energy, Eurac Research, 39100 Bolzano, Italy
*
Author to whom correspondence should be addressed.
Presented at II International Conference on Challenges and Perspectives in Urban Water Management Systems (CSDU-CSSI DAYS 25), Trieste, Italy, 18–19 November 2025.
Eng. Proc. 2026, 135(1), 5; https://doi.org/10.3390/engproc2026135005
Published: 29 April 2026

Abstract

Water distribution systems are critical infrastructures, and are highly susceptible to a wide range of anomalies like leaks and component failures. Hence, timely detection of abnormal system behavior is essential for their safe and efficient operation. To address this challenge, we generated synthetic hydraulic datasets to train a machine learning tool, tailored for anomaly detection and classification tasks. The proposed architecture integrated bidirectional gated recurrent unit layers with time-distributed dense layers employing Rectified Linear Unit activations, enabling the extraction of temporal dependencies alongside spatial feature representations. The strong performance achieved highlights the robustness of the approach in distinguishing between normal operating states and heterogeneous anomaly classes, demonstrating its potential for enhancing system reliability.

1. Introduction

Water distribution systems (WDSs) are critical infrastructures that provide water to communities, industrial facilities and agriculture. Their efficient operation is crucial for safeguarding public health and minimizing operational costs [1]. These systems, however, are inherently complex and prone to leaks and component failures [2]. Timely detection and classification of such anomalies is key to mitigating water loss, preventing system disruptions and ensuring the consistent delivery of safe drinking water [3]. Classification is particularly important since different types of anomalies have distinct operational impacts and require tailored responses. Beyond detection, it enables faster diagnosis, targeted interventions and reduced downtime, thereby transforming alarms into actionable insights [4].
Modern WDSs are increasingly equipped with sensors that record variations in flow, pressure and other key variables [5]. Coupled with advanced data analytics techniques like machine learning (ML) algorithms, these technologies enable quick and accurate anomaly detection [6]. To support these approaches, which typically rely on extensive data that is not readily available in real-world cases, the creation of stochastic pressure and flow datasets is essential. Thus, the effectiveness of such approaches relies heavily on the availability of datasets that capture the stochastic nature of hydraulic systems. Synthetic datasets are especially valuable, as they reflect uncertainties from demand variability and possible system failures, supporting realistic modeling, testing and decision-making [7]. They also provide training scenarios for ML models, improving their ability to recognize complex patterns and perform reliably under real-world conditions [8].
In this work, we produced synthetic hydraulic datasets to train and evaluate a ML-based classifier. The objective was to develop a tool capable of detecting and classifying multiple anomaly types in WDSs using high-quality synthetic data.

2. Materials and Methods

Within this work, particular importance was laid on the stochastic generation of time series of hydraulic data (such as junction pressures and flows along the pipes), resulting from the introduction of random (in terms of number, start time, duration and location) anomalies. Four types of anomalies were considered: burst leakages, disruption of reservoir supply, improper gate/valve closure and pump failure. Water demand modeling was based on a synthetic generation of random patterns of daily water demand following [9], along with a superimposition of daily, weekly and monthly deterministic patterns of water demand combined with a random component of the variation [7]. Hydraulic data simulation relied on distributed fully pressure-driven modeling using the Water Network Tool for Resilience (WNTR) 1.4.0 [10]. The methodology was applied to the Apulian WDS, a case study well known in the literature [11], which was modified to include two reservoirs and two pumps, subtracting water from the groundwater aquifer (simulated as underground reservoirs).
The goal of the hydraulic modeling was to create an extensive dataset of stochastically generated hydraulic data (with and without anomalies), to be used in a data-driven ML approach that detects and classifies anomalies in WDSs. The latter was based on a multi-label classification task to handle overlapping anomalies, based on a wide range of published solutions in closely related domains of sequence labeling and deep learning architectures [12]. The pipeline was modeled via a hybrid architecture combining bidirectional gated recurrent unit (GRU) layers [13] of 64 and 32 units to capture temporal dependencies, followed by two time-distributed fully connected layers of size 16, with Rectified Linear Unit (ReLU) activation functions for consistent feature extraction across time steps. Sigmoid output nodes were employed to independently detect the presence of each anomaly type (Figure 1). For the test set, a fixed threshold of 0.5 converted predicted scores into binary predictions, accommodating concurrent anomaly labelling. The model architecture was intentionally kept compact, based on observations of its successful performance in non-overlapping scenarios, thereby balancing efficiency and accuracy.
The dataset consisted of 245,280 h of training and 70,080 h of testing data, gathered from 11 sensor channels (seven pressure and four flow sensors) selected by a sensitivity and correlation analysis of the network to extract the best points according to [14]. Each class comprised 68,892, 73,046, 73,331, 71,172 and 92,174 h in the training set and 21,604, 22,260, 22,537, 21,436 and 15,040 h in the test set for burst leaks, pump failures, reservoir-supply disruptions, improper gate/valve closures and normal (non-anomalous operation), respectively. The model was implemented in Python 3.12.12 using the Keras deep learning framework. Training was performed for 15 epochs using the AdamW optimizer in TensorFlow 2.20.0.

3. Results and Discussion

The performance of the proposed ML-based tool was primarily quantified by the hamming loss (representing the proportion of incorrectly classified labels), with a resulting value of 0.035, evidencing a high degree of accuracy in multi-label prediction. To complement this assessment, weighted average precision, recall and F1 score [15] were also calculated, resulting in values of 0.96, 0.91, and 0.94, respectively. Results assuming no overlapping of anomalies by solving a multi-class classification problem (not presented here for the sake of brevity) yielded slightly higher metric values (of approximately 0.96). As expected, misclassifications in both modalities involved anomalies originating from sensors outside the selected subset of system elements (junctions and pipes) that were used for model training. These metrics collectively demonstrate the model’s effectiveness in accurately detecting and distinguishing multiple concurrent anomaly types.

4. Conclusions

The two complementary modalities investigated establish a robust and adaptable pipeline, capable of effectively tackling both non-overlapping and overlapping anomaly detection challenges in multichannel water management sensor data. Future work will focus on more advanced hyperparameter tuning, extended training iterations (epochs) expansion of the multi-label training dataset and anomaly localization. In addition, ad-dressing the effects of missing values in the hydraulic time series, as well as the impact of selecting different subsets of nodes and links for model training, remain key challenges for the effective management of WDSs.

Author Contributions

Conceptualization, M.R., A.D., J.G. and A.M.; methodology, M.S. and F.M.; software, M.S. and F.M.; validation, M.S. and F.M.; formal analysis, M.S. and F.M.; investigation, M.S.; resources, M.R., A.D., J.G. and A.M.; data curation, M.S.; writing—original draft preparation, M.S.; writing—review and editing, M.S.; visualization, M.S.; supervision, M.R., A.D. and J.G.; project administration, M.S. and M.R.; funding acquisition, M.R. All authors have read and agreed to the published version of the manuscript.

Funding

This study has been funded by the project DIADEM “Data driven anomaly detection for sustainable water and energy smart grids management” (CUP: I55F21002120005) of the Free University of Bozen-Bolzano.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

Sample datasets of hydraulic simulations and training data are avail-able on Gitlab: https://gitlab.inf.unibz.it/Farshid.Mahmoudabadi/diadem-sample-dataset (accessed on 4 September 2025).

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
WDSsWater distribution systems
MLMachine learning
GRUGated recurrent unit
ReLURectified linear unit

References

  1. Giustolisi, O.; Ciliberti, F.G.; Mazzolani, G.; Laforgia, D. Effectiveness of Water Loss Performance Indicators for Asset Management. Digit. Water 2024, 2, 1–31. [Google Scholar] [CrossRef] [Scilit]
  2. Bello, O.; Abu-Mahfouz, A.M.; Hamam, Y.; Page, P.R.; Adedeji, K.B.; Piller, O. Solving Management Problems in Water Distribution Networks: A Survey of Approaches and Mathematical Models. Water 2019, 11, 562. [Google Scholar] [CrossRef] [Scilit]
  3. Jian, C.; Gao, J.; Xu, Y. Anomaly Detection and Classification in Water Distribution Networks Integrated with Hourly Nodal Water Demand Forecasting Models and Feature Extraction Technique. J. Water Resour. Plan. Manag. 2022, 148, 4022059. [Google Scholar] [CrossRef] [Scilit]
  4. Parajuli, U.; Shin, S. Identifying Failure Types in Cyber-Physical Water Distribution Networks Using Machine Learning Models. AQUA—Water Infrastruct. Ecosyst. Soc. 2024, 73, 504–519. [Google Scholar] [CrossRef] [Scilit]
  5. Yang, G.; Wang, H. Optimal Pressure Sensor Deployment for Leak Identification in Water Distribution Networks. Sensors 2023, 23, 5691. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  6. Mashhadi, N.; Shahrour, I.; Attoue, N.; El Khattabi, J.; Aljer, A. Use of Machine Learning for Leak Detection and Localization in Water Distribution Systems. Smart Cities 2021, 4, 1293–1315. [Google Scholar] [CrossRef] [Scilit]
  7. Menapace, A.; Zanfei, A.; Felicetti, M.; Avesani, D.; Righetti, M.; Gargano, R. Burst Detection in Water Distribution Systems: The Issue of Dataset Collection. Appl. Sci. 2020, 10, 8219. [Google Scholar] [CrossRef] [Scilit]
  8. Truong, H.; Tello, A.; Lazovik, A.; Degeler, V. Graph Neural Networks for Pressure Estimation in Water Distribution Systems. Water Resour. Res. 2024, 60, e2023WR036741. [Google Scholar] [CrossRef] [Scilit]
  9. Menapace, A.; Santopietro, S.; Gargano, R.; Righetti, M. Stochastic Generation of District Heat Load. Energies 2021, 14, 5344. [Google Scholar] [CrossRef] [Scilit]
  10. Klise, K.A.; Bynum, M.; Moriarty, D.; Murray, R. A Software Framework for Assessing the Resilience of Drinking Water Systems to Disasters with an Example Earthquake Case Study. Environ. Model. Softw. 2017, 95, 420–431. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  11. Giustolisi, O.; Savic, D.; Kapelan, Z. Pressure-Driven Demand and Leakage Simulation for Water Distribution Net-works. J. Hydraul. Eng. 2008, 134, 626–635. [Google Scholar] [CrossRef] [Scilit]
  12. He, Z.; Wang, Z.; Wei, W.; Feng, S.; Mao, X.; Jiang, S. A Survey on Recent Advances in Sequence Labeling from Deep Learning Models. arXiv 2020, arXiv:2011.06727. [Google Scholar] [CrossRef] [Scilit]
  13. Cho, K.; van Merriënboer, B.; Gulcehre, C.; Bahdanau, D.; Bougares, F.; Schwenk, H.; Bengio, Y. Learning Phrase Rep-resentations Using RNN Encoder–Decoder for Statistical Machine Translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP); Moschitti, A., Pang, B., Daelemans, W., Eds.; Association for Computational Linguistics: Doha, Qatar, 2014; pp. 1724–1734. [Google Scholar]
  14. Righetti, M.; Bort, C.M.G.; Bottazzi, M.; Menapace, A.; Zanfei, A. Optimal Selection and Monitoring of Nodes Aimed at Supporting Leakages Identification in WDS. Water 2019, 11, 629. [Google Scholar] [CrossRef] [Scilit]
  15. Manning, C.D.; Raghavan, P.; Schütze, H. Introduction to Information Retrieval; Cambridge University Press: Cambridge, UK, 2008; ISBN 9780521865715. [Google Scholar]
Figure 1. Pipeline of ML-based tool for multi-label detection and classification task.
Figure 1. Pipeline of ML-based tool for multi-label detection and classification task.
Engproc 135 00005 g001
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Stergiadi, M.; Mahmoudabadi, F.; Menapace, A.; Dignös, A.; Gamper, J.; Righetti, M. Detection and Classification of Anomalies in Water Distribution Systems. Eng. Proc. 2026, 135, 5. https://doi.org/10.3390/engproc2026135005

AMA Style

Stergiadi M, Mahmoudabadi F, Menapace A, Dignös A, Gamper J, Righetti M. Detection and Classification of Anomalies in Water Distribution Systems. Engineering Proceedings. 2026; 135(1):5. https://doi.org/10.3390/engproc2026135005

Chicago/Turabian Style

Stergiadi, Maria, Farshid Mahmoudabadi, Andrea Menapace, Anton Dignös, Johann Gamper, and Maurizio Righetti. 2026. "Detection and Classification of Anomalies in Water Distribution Systems" Engineering Proceedings 135, no. 1: 5. https://doi.org/10.3390/engproc2026135005

APA Style

Stergiadi, M., Mahmoudabadi, F., Menapace, A., Dignös, A., Gamper, J., & Righetti, M. (2026). Detection and Classification of Anomalies in Water Distribution Systems. Engineering Proceedings, 135(1), 5. https://doi.org/10.3390/engproc2026135005

Article Metrics

Back to TopTop