This work outlines the performance of three variants of deep neural networks for leak detection in water distribution networks, namely – autoencoders (AEs), variational autoencoders (VAEs), and long short-term memory autoencoders (LSTM-AEs). The multivariate pressure signals reconstructed from these models are analysed for leakage identification. The leak onset time is estimated using a fast approximation sliding window technique, which computes statistical discrepancies in prediction errors. The performance of all three variants is validated using the widely studied L-Town benchmark network. Furthermore, their feasibility for real-world application is studied by applying them to a real-world case study representing the data availability and network design often found in smaller- and medium-sized utilities in Norway. The results for the benchmark network showed that AE and LSTM-AE showed comparable detection performance for abrupt leaks with VAE performing the least. For incipient leaks, the LSTM-AE showed better detection performance with few false-positives. For the real-world dataset, the performance was significantly lower due to the quantity and quality of data available, and the contradiction of inherent requirements of data-driven models. In addition, the analysis revealed that the positioning of pressure sensors in the network is critical for the leak detection performance of these models.

  • Three variants of encoder–decoder neural networks are modelled for data-driven leak detection.

  • The models were validated on a benchmark dataset and applied to a real-world WDN in Norway.

  • The sequence learning capability of the long short-term memory autoencoder (LSTM-AE) showed better detection performance.

  • The lower performance in real-world applications revealed limitations due to the positioning of sensors and data availability.

AE

autoencoder

ANN

artificial neural network

CNN

convolutional neural network

CUMSUM

cumulative sum

KL

Kullback–Leibler

LILA

Leak Identification and Localisation Algorithm

LSTM-AE

long short-term memory autoencoder

MAE

mean absolute error

MAPE

mean absolute percentage error

MSE

mean squared error

PMA

pressure measurement area

RNN

recurrent neural network

SPC

statistical process control

SWM

smart water meter

VAE

variational autoencoder

WDN

water distribution network

WNTR

Water Network Tool for Resilience

Detection and localisation of leaks in water distribution networks (WDNs) remain one of the main challenges for many water utilities across the world. Globally, around 126 billion m3 of potable water is lost during supply (Liemberger & Wyatt 2019) with a leakage rate of, on average, about 30% in Norway (Statistics Norway 2021). As WDNs are complex networked pipeline systems spanning several hundred kilometres in a wide geographical area, fast detection, localisation, and isolation of leaks becomes a complex task. Furthermore, due to the rapid urbanisation and deterioration due to aging of WDNs, continuous monitoring for rapid leak detection and isolation becomes even more challenging owing to changes in network structure and parameters. In addition to the increasing water stress, estimation of leakage levels and associated costs are also not trivial (Molinos-Senante et al. 2016). Apart from the loss of precious water and revenue, leaks also cause significant pressure drops in the network thereby causing a high potential for pathogen intrusion and associated health risks (Odhiambo et al. 2023). From a utilisation perspective, there have been several changes and stringent requirements made by governments for reducing water leakage in recent years. In consequence, leak detection and localisation have been an active area of research for several decades due to these factors. Most of the methods available in the literature (Hu et al. 2021; Wan et al. 2022) can be broadly classified into three categories – model-based methods, hybrid methods that combine process knowledge from both first principles and measurement data and the recently evolving data-driven methods (Romero-Ben et al. 2023).

Model-based methods aim to detect and localise leaks based on the underlying hydraulic estimates. These models can be either a transient based model or a steady state model based on extended period analysis. The transient model determines the magnitude and location of leaks by observing changes in the pressure and flow signals due to the presence of leaks in the network (Colombo et al. 2009; Che et al. 2022). Transient models, while predicting the location and magnitude of leaks with high accuracy, are often constrained to smaller networks due to modelling complexities and scalabilities. Steady state approaches, on the other hand, are based on inverse transient analysis for determining leak magnitude and location (Pudar & Liggett 1992; Kapelan et al. 2003). Though these classes of model-based methods were able to detect leaks accurately, even for larger networks, they require complete information on the network hydraulics and continuous calibration which is seldom available for smaller utilities.

In recent years, due to the advancements in measuring systems and increasing computational power, many water utilities are moving towards digital solutions for real-time monitoring and control of WDNs (Cominola et al. 2015; Mounce 2021), monitoring pressures, flows and the performance and settings of pumps and valves. The often-observed decision of utilities to focus on pressure sensors is mostly based on the fact that they are more cost efficient and easier to install compared to flow meters which are usually expensive and require intensive installation procedures.

With the emergence of digitalisation of the water sector, there has been a widespread interest in developing purely data-driven models for leak detection and localisation in recent years to avoid the need for a fully calibrated model and the costs associated. Some researchers have reviewed broad classes of data-driven models that are applied for leak detection tasks (Wu & Liu 2017; Hu et al. 2021; Wan et al. 2022).

Statistical Process Control (SPC) Methods have been widely used for process monitoring applications. They are based on the setting of control limits for the measured variables and the detection of unusual patterns when those control limits are exceeded. Limits can be, for example, computed based on the cumulative sum of total flow rate in a network (Misiunas et al. 2006), or based on principle components (Gertler et al. 2010). Although these methods are highly efficient, they are, however, based on the assumptions that the errors are not correlated and that they are Gaussian and stationary variables.

Classification-based approaches were also widely used for leakage detection in the last decade (Cody et al. 2017; Soldevila et al. 2017; Romero et al. 2021, 2022). These methods are based on Support Vector Machines (e.g., Cody et al. 2017), Bayesian classification (e.g., Soldevila et al. 2017), K-Nearest Neighbour clustering (e.g., Soldevila et al. 2016) and many other similar strategies. These methods assume that correctly labelled leak events are available during the model training process. However, in practice, it is difficult to obtain such labelled data for all types of possible leak events in WDNs. Hence, the predictive performance for these models is limited to leak events that are similar to labelled historical events.

The third sub-class of data-driven methods, namely, prediction methods is the most widely used for leakage detection. A prediction model is trained based on no-leak data to predict the expected values for no-leak scenarios. If a leak event occurs, there will be deviations between model predictions and the measured values. The prediction errors are then attributed to leak events or sensor faults based on the obtained residuals. The residual error analysis is then carried out based on different evaluation metrics such as mean squared error (MSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) for determining the model performance and onset of leak events (Wan et al. 2022). Prediction-based artificial neural network (ANN) models have been used widely for leak detection in WDNs (Mounce et al. 2010, 2014; Cody et al. 2020; Spandonidis et al. 2022; Tornyeviadzi & Seidu 2023). Since these models do not have a composite classification approach for determining thresholds on residuals to flag leak onset, the final task of anomaly detection is done by additional algorithms (e.g., CUMSUM, residual error analysis, Hotelling's T2, etc.).

In this study, we focus on pressure measurement-based encoder–decoder models and evaluate their leak detection performance. For the data-driven methods using pressure measurements, the following assumptions must be (implicitly) met for implementation:

  • There are a sufficient number of pressure sensors available in the network and they are placed at different (if possible optimal or nearly optimal) locations for efficient leak detection.

  • Measurements are available for nominal system states that represent no-leak scenarios over a sufficient period of time. If they are not available, pressure estimates at the corresponding sensor locations are available from a calibrated hydraulic model.

  • Data quality for the measurements is high enough to allow for training and application of the algorithms, or at least for adequate data preprocessing.

The main objective of the study is to evaluate the applicability of data-driven methods under these widely used assumptions on a real-world case study network in Norway. We highlight that the number and location of the pressure sensors and data quality play an important role in realising these methods in everyday scenarios.

In this study, three data-driven prediction models are trained using only pressure signals, and their leak detection performance is compared using a widely studied leak detection benchmark, which fulfils the aforementioned assumptions. The three deep neural network models – autoencoders (AEs), variational autoencoders (VAEs), and long short-term memory autoencoders (LSTM-AEs) – are trained in semi-supervised fashion using only pressure measurements. To explore their applicability in practice, the models were also trained and evaluated using measurements from a representative real-world WDN in Norway. First, a brief background on the deep learning models and methods for data preprocessing used is reported in the methodology section. The results and discussion on the detection performance of the three models used and practical limitations are then provided. Finally, the conclusions and future directions of the study are presented.

The methodology in this study comprises three stages. In stage 1, the training data are obtained from pressure measurements during nominal system states representing (assumed) no-leak scenarios or from estimates using a hydraulic model calibrated for nominal operations. The training data are then pre-processed for subsequent neural network training and evaluation. As the availability of historical leak events for a given WDN is rarely available, semi-supervised learning based deep neural networks are used for leakage detection in this study. In this regard, in stage 2, three classes of encoder–decoder deep neural networks (AE, VAE, and LSTM-AE) are trained in a semi-supervised fashion. The encoder–decoder models are selected in an increasing level of model complexity and their performance for different types of leaks is compared. Subsequently, in stage 3, the predictions and real measurements are used for detecting the time of leak using statistical moving window techniques. Figure 1 illustrates the proposed methodology.
Figure 1

Flow chart of proposed methodology.

Figure 1

Flow chart of proposed methodology.

Close modal
Figure 2 shows the difference in architecture for the three types of models described in this section. In summary, the three encoder–decoder models offer unique capabilities for processing and analysing data in WDNs. While traditional AE is suitable for dimensionality reduction and anomaly detection, LSTM-AE excels in timeseries forecasting and anomaly detection in temporal data. On the other hand, VAE provides probabilistic representations, enabling data augmentation and uncertainty estimation, making them valuable for various applications in WDNs.
Figure 2

Three class of encoder–decoder model used for leak detection: (a) AE, (b) LSTM-AE, and (c) VAE.

Figure 2

Three class of encoder–decoder model used for leak detection: (a) AE, (b) LSTM-AE, and (c) VAE.

Close modal

 Autoencoder

AEs are a kind of unsupervised neural network that is used for efficient learning of higher dimensional features without the need for explicit data labelling (Baldi 2012). A typical AE architecture consists of two parts: an encoder (E) and a decoder (D), each containing one or more hidden layers of neurons, as shown in Figure 2(a). The encoding network (E) takes in the input xRm and transforms it into a lower-dimensional space zRn, where n<m through linear combinations of non-linear activations at hidden layers. The compressed data at latent layer z capture the most relevant features of the original data. The decoding network (D) then takes the compressed data z as input and transforms it back to the original space Rm, by increasing the dimensionality at each of the hidden layers. The output of AE can be represented as where .

During training, AEs aim to minimise the difference between the input data (x) and the reconstructed data . MSE as a loss function, is used to train the AE model. By minimising this error, the AE learns a compressed representation that captures the most salient features of the input data. Hence, any considerable deviations in the reconstruction errors can be attributed to the onset of anomalous events.

AEs have been widely used in classification and regression tasks across several domains. For example, AEs have been used for monitoring pipeline leakage (Wang et al. 2020) and for monitoring spacecraft sensor data (Sakurada & Yairi 2014). In this study, a simple AE is trained in semi-supervised fashion for the leak detection task.

Long short-term memory autoencoder

LSTM are a type of recurrent neural networks (RNNs) that are used for learning patterns in the data. LSTMs have been widely popular and are building blocks of advanced sequence learning architectures. They are widely used for language translation, timeseries forecasting and many for many other sequential data. LSTM units are composed of four sub-units namely, a cell state, an input gate, an output gate and forget gate. While the cell state recalls values at arbitrary time intervals, the other three gates selectively enable or disable the flow of information through the LSTM unit. This results in effectively learning the underlying patterns for the given sequence of input data. Readers are referred to (Hochreiter & Schmidhuber 1997) for further information on the workings of LSTM units. LSTM-AE are a class of composite encoder–decoder models, wherein, the LSTM units are coupled in a conventional AE fashion. Hence, LSTM-AE captures not only the higher dimensional features but also the underlying temporal patterns in the given input timeseries.

The encoder LSTM layers transform the input sequence into a lower-dimensional representation in the latent space. The decoder in an LSTM-AEr reconstructs the sequential data from the compressed representation. Figure 2(b) shows an illustrative LSTM-AE architecture. It uses LSTM layers that process the latent representation in reverse order, effectively generating a sequence of outputs. Similar to traditional AEs, LSTM-AEs aim to minimise the difference between the input sequence and the reconstructed sequence. The training process involves propagating the reconstruction error backwards through the LSTM layers and adjusting the model's weights to improve the reconstruction accuracy.

Like AE, LSTM-AE were also widely popular across multiple domains. They were initially illustrated for video representation learning (Srivastava et al. 2015), and air quality monitoring (Wei et al. 2022) and found applications in oil and gas pipeline leakage monitoring (Spandonidis et al. 2022).

Variational autoencoder

VAEs introduce probabilistic modelling into the AE framework, enabling the generation of new data samples based on learned probability distributions. VAE replace reconstruction errors with reconstruction probability through Bayesian inference during the training process (Kingma & Welling 2014). Like AE, VAE constitutes encoder (E) and decoder (D) but varies by inferential learning at the latent space z. Specifically, the latent vector learns two lower-dimensional vectors: mean (μ) and variance (σ) vectors that parameterise a multivariate normal distribution (refer Figure 2(c)). These are used for inferential learning of the encoder and decoder parameters. The model prediction is done through a reparameterisation trick, where the compressed information at latent space z is sampled via inferential learning and fed to the decoder. The decoder then reconstructs the sampled information at latent space to the original dimension of input data x. VAEs aim to minimise the reconstruction error, similar to other AEs. Additionally, they also optimise the Kullback–Leibler (KL) divergence between the learned distribution and the standard normal distribution (prior), ensuring that the latent space distribution remains close to a unit Gaussian.

With the inferential learning abilities, VAEs can also be used as a generative model. For example, to generate synthetic data that resembles real sensor measurements, which is beneficial for enhancing the generalisation capabilities of predictive models in WDNs. VAEs have also been used for anomaly detection for different applications (Yao et al. 2019; Huang et al. 2022). One of the earliest application of leakage detection with VAEs on acoustic spectrograms were reported by (Cody et al. 2020). In this study, VAE will be trained on timeseries measurements for detecting leaks.

The three models are implemented using standard Python packages for data processing and Pytorch (Paszke et al. 2017) for neural network implementation. For AE and VAE, the MSE between the input data (x) and predictions is used as an objective function for training the models. For VAE, the loss function is a combination of MSE loss and KL divergence loss as described above. The architecture used for each of the three models can be referred to in Supplementary material, Appendix 1.

Change point analysis for leak detection

After training the encoder–decoder models, the reconstruction error of the predictions is given by the error timeseries . In a no-leak scenario, is centred around zero with minor variations due to prediction error and sensor noise. Hence, any change in the error timeseries can be attributed to the onset of the leak. Therefore, the problem of detecting a leak can be tackled as the problem of identifying change points in the error analysis.

To determine the onset of the leak, a sliding window technique based on tracking the statistical discrepancy between two sub-sequences of the error timeseries is utilised (Truong et al. 2020). The sliding window change point detection method is an alternative and approximation to optimal change point methods such as the Pruned Exact Linear Time (PELT) method discussed in Killick et al. (2012). The advantage of the approximate method over the optimal method is that the computation time is of the order of sampling points O(nw) where n is the number of samples and w is the number of search windows. Hence, it is considerably faster than other optimal methods at the cost of accuracy.

Given an error series and window length spanning from time instant a to b (where a and b < total time length T), the discrepancy measure M is calculated for two adjacent windows using some arbitrary cost function (for e.g., two-sampled test). If there is a discrepancy between windows, then M reaches large values. This process is repeated until M is calculated for the whole time period [1, T]. The peak values are then determined by their indices and are attributed as change points.

Case study 1: L-Town Benchmark

In this paper, the encoder–decoder models are first applied to the widely studied L-Town benchmark network developed by Vrachimis et al. (2020), shown in Figure 3. The network has recently been studied by several researchers for several modelling studies (e.g., Blocher et al. 2020; Daniel et al. 2022; Tornyeviadzi & Seidu 2023), and has been the core benchmark for leakage detection and isolation methods (BattLeDIM) competition in 2020. The network has three zones, 905 pipes, and 782 nodes, supplied from two reservoirs and a tank. The model consists of different leaks occurring at different time instants in the years 2018 and 2019. Measurements from 33 pressure sensors, 10 flow meters and 84 smart water meters are available. For the reported study, only pressure measurements (see Figure 3) located at different parts of the network are used for the current analysis.
Figure 3

L-Town BattleDIM network showing the locations of pressure sensors and leaks.

Figure 3

L-Town BattleDIM network showing the locations of pressure sensors and leaks.

Close modal

Dataset generation

As described earlier, the study builds on semi-supervised learning wherein, measurements from leak-free scenarios are used for identifying new leaks without explicitly using historical leaks as labels for training encoder–decoder models. In the first step, the nominal hydraulic model without leaks is simulated using the Water Network Tool for Resilience (WNTR) Python toolkit (Klise et al. 2017), and the pressures at all junctions with sensors is stored for the years 2018 and 2019. The pressure measurements are then split into train-validation datasets in an 80–20 ratio. The training and validation data are z-standardised for zero mean and unit variance to enable efficient model training. The dataset is also divided into sample sequences, with a sequence length set to 144 measurements. This corresponds to 12 h of measurement data for each sequence.

The models are then evaluated for two different types of leak scenarios – abrupt bursts and incipient leaks that emulate slow-increasing and background leaks. As test scenarios, 33 different datasets are generated for each different single leak scenario. The leak locations, their magnitudes, start times and end times are, however, the same as in the original BattLeDIM competition. To emulate a leak in a pipe, the leak is assumed to occur in the centre of the pipe, following the approach of Basnet et al. (2023), and modelled as an additional demand using the morph package of WNTR toolkit in Python. Hence, for evaluation, 33 different pressure measurements, each spanning two years 2018 and 2019 are simulated and stored.

Case study 2: a real-world Norwegian WDN

The analysis is also performed on a medium-sized real-world WDN in Norway. It consists of 4,458 junctions, and 4,856 pipes supplied from a single reservoir with pressures regulated through 56 pumps and nine pressure reducing valves. There are 27 pressure sensors in total installed across 30 Pressure Measurement Areas (PMA). The main objective of this study is to evaluate the applicability of encoder–decoder models for a real-world system representing the limitations faced in a realistic scenario. An overview of the network showing different pressure zones, reported leaks and available pressure measurements is shown in Figure 4.
Figure 4

Overview of the different pressure zones, pumping stations, measurement and control devices in a real-world WDN in Norway with highlighted zones of interest.

Figure 4

Overview of the different pressure zones, pumping stations, measurement and control devices in a real-world WDN in Norway with highlighted zones of interest.

Close modal

Description of real-world dataset

Although 27 pressure transmitters were installed and distributed over the network with close to real-time data transmission, the quality was very varying. Of the data that were made available by the utility, starting from roughly August 2021 to the end of 2022, only the data transmitted between March 2022 and September 2022 were devoid of large proportions of spurious data and missing values. Hence, the total usable dataset was reduced to less than a 6-month timespan. Figure 5 illustrates the quality of the raw dataset provided and the dataset used for analysis after preprocessing. The raw dataset obtained had very high data frequency with several chunks of missing values as shown in Figure 5 (left). The pre-processed dataset obtained after correcting timestamps and resampling at 5-min intervals is shown in Figure 5 (right).
Figure 5

Raw (left panel) and pre-processed (right panel) data from the real-world WDN.

Figure 5

Raw (left panel) and pre-processed (right panel) data from the real-world WDN.

Close modal

In addition to the pressure measurements, the water utility also provided leak timestamps, repair dates and their approximate locations. However, the real-world dataset is not devoid of missing network information, history leaks that are either missing or lacking true start and end times, typographical errors in database management (for e.g., spurious leak events, errors in timestamps, sensor-model object mismatch), as well as missing sensor measurements and can therefore not be trusted completely. Therefore, within the available period between March 2022 and September 2022, only a week from 23rd to 30th March 2022 could identified to be devoid of leaks and, therefore, chosen for model training purposes. In contrast to the artificial benchmark, this scenario is in stark contrast with respect to the amount of available data for training the models without making additional extensive assumptions on the leaks and data quality. In addition, as the dataset also contained noise and missing values, data imputation and filtering were carried out using linear interpolations followed by Savtizky-Golay filtering (Schafer 2011) process. The filtering is achieved as a result of convolution between a subset of sequence with a lower degree polynomial using the least squares method. The convolution method to obtain a smoothed signal is popularly used in several digital filtering applications because of its simplicity.

This was done in a bid to reduce the effect of missing values and measurement noise in the signals. Following the data cleansing and preprocessing steps, the encoder–decoder models were trained in the same way the analysis was carried out for the L-Town network. The architecture of the encoder–decoder models used for evaluation is described in Supplementary material, Appendix 1.

Case 1: L-Town WDN

Ideally, when there is no leak, the reconstruction error timeseries should be zero except for noise in measurements and due to model prediction error. When a leak occurs, the reconstruction error increases above the noise threshold, thereby indicating the onset of the leak. Hence, the pressure sensor closest to the leak position will have the highest reconstruction error. As an illustration, the error series for an abrupt leak (p142) and an incipient leak (p653) are shown in Figure 6.
Figure 6

Sudden and gradual changes in reconstruction errors for abrupt leak p142 (Top) and incipient leak p653 (bottom) for L-Town.

Figure 6

Sudden and gradual changes in reconstruction errors for abrupt leak p142 (Top) and incipient leak p653 (bottom) for L-Town.

Close modal
From the change point analysis, it was observed that for abrupt leaks, the change in mean and variance was sudden and the sliding window method was able to identify the breakpoints (black dashed lines) quickly and close to the true onset of the leak (red line). However, for incipient leaks, the sliding window took several hours to flag the breakpoints, at which point the leak was saturated. The detection times were compared to the state-of-the-art model-based methods namely Leak Identification and Localisation (LILA) proposed by Daniel et al. (2022) and 1D-convolutional neural networks (1D-CNNs) proposed by Tornyeviadzi & Seidu (2023). These studies were chosen, as they are explicitly data-driven approaches, tailored for the leak detection problem. The detection performance of all abrupt leaks is shown in Figure 7. It can be seen that one of the three AE models is always able to detect leaks in a comparable time to the literature. The VAE for p331, p514, p523, p680 and p827, AE for p331, p426, p514, p523 and p680, LSTM-AE for p142 perform exactly as the LILA and 1D-CNN. For p280 AE and LTSM-AE perform similarly to LILA but worse than the 1D-CNN while for p710 the VAE performs best but worse than the literature benchmarks. It is worth noting though that the proposed encoder–decoder models did not have any false-positives, like the LILA method (Daniel et al. 2022), while the state-of-the-art 1D-CNN method had reported five false-positives. Lowering the occurrence of false-positives is a big advantage when trying to avoid superfluous leak search and repair actions.
Figure 7

Detection times for abrupt leaks in L-Town WDN (see Figure 3). Labelled numbers represent detection times less than 50 h.

Figure 7

Detection times for abrupt leaks in L-Town WDN (see Figure 3). Labelled numbers represent detection times less than 50 h.

Close modal
The detection performance of the encoder–decoder models for the incipient leaks is shown in Figure 8. It is worth noting that, though the detection time necessary for the proposed encoder–decoder models was sometimes longer than the state-of-the-art methods in some cases (p123, p193 p277, p762), there were still no false-negatives. Also, all the leaks were detected (p586, p653, p721). In addition, a better detection time would be achieved if all three models are combined and the first model to detect is used. For example, the detection time of LSTM-AE is better than other models for leaks p455 and p653 while comparable for other leaks (p277, p586 and p800). Another possible improvement could be the usage of a different anomaly detection algorithm.
Figure 8

Detection times for incipient leaks in L-Town WDN (see Figure 3).

Figure 8

Detection times for incipient leaks in L-Town WDN (see Figure 3).

Close modal

Case 2: a real-world WDN

Despite the low quality of available measurement data and other systematic errors that may have occurred during manual data logging, the encoder–decoder models were able to generate sharp changes in reconstruction errors of different sensors, signalling either the onset of leak or sensor faults as shown in Figure 9. The red dashed lines represent manually denoted leak onset times, and the black line represents the first predicted change point.
Figure 9

Reconstruction error expressed as difference between measurement and predictions for pressure sensors in zones z27 (top), zone 30 (bottom left), and zone 2 (bottom right) in the real-world WDN shown in Figure 4.

Figure 9

Reconstruction error expressed as difference between measurement and predictions for pressure sensors in zones z27 (top), zone 30 (bottom left), and zone 2 (bottom right) in the real-world WDN shown in Figure 4.

Close modal

For sensor 669, the detected change point was approximately the same for all three models. Only the reconstruction error from VAE showed a change point for sensor 42,191. For sensor 11,079, AE detected a change point close to a true leak event. VAE had false-positives and LSTM-AE detected a change point after one week. It should also be noted that during this period between the true leak event on 2 May 2022 and the detected change points around 9 May 2022, no other leaks were reported by the utility. For sensor 43,045, only VAE was able to show deviations in reconstructions with respect to other sensors.

While the true leak is in the proximity of sensor 669 (approximately 197 m) in zone z27 (refer to Figure 4), another faulty sensor in the same zone 42,191 exhibited spurious noise during the leak event that was not observed. Additionally, a sharp increase in the reconstruction errors of sensors 11,079 and 43,045 situated in zones Z26 and Z01 away from the leak location was observed. Therefore, for the same leak event, multiple sensors in different pressure zones signalled leak alarms, contributing to difficulties in identifying the leak locations. On further analysis, we observed that many sensors are placed in pumping stations for safe monitoring and operations. Moreover, in this scenario, the pumping operation in zone z26 was governed by the pressure signal 11,079 and the level in the storage basin close to sensor 669 in zone z27. This highlights that unless the pumping operations and their correlation with respect to corresponding pressure signals are considered, leak detection is not likely to be accurate in such systems.

In addition to the difficulty in identifying whether there exists a single leak or multiple leaks from the signal as explained above, it was also unclear whether these are sensor faults or abnormal consumption behaviour (unless known a priori with certainty) in the system. This limitation highlights that leak detection algorithms relying on pressure signals are unlikely to provide useful results unless the pumping schedules are accounted for and included in the models or with the placement of pressure sensors conforming to observable conditions (Tornyeviadzi & Seidu 2023). Furthermore, since the water may also be supplied in bulk across different zones, pressures across the network are also likely to be affected due to pump operations compensating for the pressure lost due to leaks. This was observed in the sensor errors in 43,045 in zone z1 far away (approximately 3.3 km) from the true leak zone z27.

As a brief overview, the proposed method together with a selection of different data-driven techniques used for leak detection in WDNs using a variety of sensors and methods is shown in Table 1.

Table 1

Different data-driven techniques for leak detection in WDNs

ReferenceNetwork typeDataModelLeak type
Mounce et al. (2010)  Real-world data Flow ANN Burst/Leaks 
Soldevila et al. (2019)  Real-world and Simulated data Pressure Spatial interpolation Burst/Leaks 
Cody et al. (2020)  Laboratory test bed Acoustic VAE Burst 
Romero et al. (2021)  Real-world data Pressures and topology Graph interpolation Burst/Leaks 
Spandonidis et al. (2022)  Water pipeline Vibration CNN and LSTM-AE Burst 
Kammoun et al. (2022)  Simulated data Flow and Pressure LSTM-AE Burst/Leaks 
Weyns et al. (2023)  Real-world data Pressure Graph Convolution Network Burst/Leaks 
Tornyeviadzi & Seidu (2023)  Simulated data Pressure 1D-CNN Burst/Leaks 
Proposed method Simulated data and real-world data Pressure AE, VAE, LSTM-AE Burst/Leaks 
ReferenceNetwork typeDataModelLeak type
Mounce et al. (2010)  Real-world data Flow ANN Burst/Leaks 
Soldevila et al. (2019)  Real-world and Simulated data Pressure Spatial interpolation Burst/Leaks 
Cody et al. (2020)  Laboratory test bed Acoustic VAE Burst 
Romero et al. (2021)  Real-world data Pressures and topology Graph interpolation Burst/Leaks 
Spandonidis et al. (2022)  Water pipeline Vibration CNN and LSTM-AE Burst 
Kammoun et al. (2022)  Simulated data Flow and Pressure LSTM-AE Burst/Leaks 
Weyns et al. (2023)  Real-world data Pressure Graph Convolution Network Burst/Leaks 
Tornyeviadzi & Seidu (2023)  Simulated data Pressure 1D-CNN Burst/Leaks 
Proposed method Simulated data and real-world data Pressure AE, VAE, LSTM-AE Burst/Leaks 

In this paper, we presented three classes of encoder–decoder neural network models of different complexity for the leak detection task. A simple AE model, a composite LSTM-AE for learning underlying patterns and a VAE that learns the underlying data distribution by inferential learning were chosen. The reconstruction errors were then subsequently fed to a change point detection algorithm to predict the time of leak onset. For the best-case scenario, where there is availability of sufficient data quality (i.e., L-Town), the proposed models performed on par with the existing methods reported in the literature. They were able to detect abrupt leaks almost instantaneously for the artificial network and incipient leaks took several hours before they were detected at the cost of minimising the false-positive rates. The models were also evaluated for a real-world system in Norway for their real-time applicability. It was determined that the performance of the models was significantly impacted by two main factors. First, the data availability and quality of data need to be checked. Data management is still in its infancy for many WDNs due to financial and operating challenges. This limits the analysis and real-time implementation of data-driven leak detection algorithms that are aimed at fast and efficient leak detection capabilities in comparison to the ‘best-case’ data quality as assumed in the L-Town benchmark network. This has also been highlighted in other studies (Hu et al. 2021; Wan et al. 2022). Secondly, the placement of sensors impacts the performance of data-driven models. Upon further investigations, we observed that many sensors were placed close to pumping stations. Hence, composite models that include pumping information during the training phase similar to those (Sousa et al. 2023) could be developed in the future.

Ensuring the availability of quality data and composite modelling strategies could therefore facilitate real-time applications. Furthermore, the encoder–decoder modelling approach using pressure measurements could also be extended to Smart Water Meters (SWMs) at household levels that measure nodal flows and pressures. As many water utilities are transitioning towards digital water services, SWMs will play a crucial role in assisting water audits, demand forecasting and billing. Hence, the data quality is likely to be of high quality in comparison to district meters.

We thank Jon Røstum from Volue for providing the real-world data and the support. This work has been funded by the European Union's Horizon 2020, under grant agreement No. 869171 (B-WaterSmart).

Data cannot be made publicly available; readers should contact the corresponding author for details.

The authors declare there is no conflict.

Baldi
P.
2012
Autoencoders, unsupervised learning, and deep architectures
. In:
Proceedings of ICML Workshop on Unsupervised and Transfer Learning. JMLR Workshop and Conference Proceedings
, pp.
37
49
.
Available from: https://proceedings.mlr.press/v27/baldi12a.html (accessed 1 December 2023)
.
Basnet
L.
,
Brill
D.
,
Ranjithan
R.
&
Mahinthakumar
K.
2023
Supervised machine learning approaches for leak localization in water distribution systems: Impact of complexities of leak characteristics
.
Journal of Water Resources Planning and Management
149
(
8
),
04023032
.
doi:10.1061/JWRMD5.WRENG-6047
.
Blocher
C.
,
Pecci
F.
&
Stoianov
I.
2020
Localizing leakage hotspots in water distribution networks via the regularization of an inverse problem
.
Journal of Hydraulic Engineering
146
(
4
),
04020025
.
doi:10.1061/(asce)hy.1943-7900.0001721
.
Che
T.
,
Wang
X.
&
Ghidaoui
M. S.
2022
Leak localization in looped pipe networks based on a factorized transient wave model: Theoretical framework
.
Water Resources Research
58
(
4
),
e2021WR031364
.
doi:10.1029/2021WR031364
.
Cody
R.
,
Narasimhan
S.
&
Tolson
B.
2017
One-class SVM – Leak detection in water distribution systems
. In:
CCWI 2017 - 15th International Conference on Computing and Control for the Water Industry
,
(September)
.
Cody
R. A.
,
Tolson
B. A.
&
Orchard
J.
2020
Detecting leaks in water distribution pipes using a deep autoencoder and hydroacoustic spectrograms
.
Journal of Computing in Civil Engineering
34
(
2
),
04020001
.
doi:10.1061/(asce)cp.1943-5487.0000881
.
Colombo
A. F.
,
Lee
P.
&
Karney
B. W.
2009
A selective literature review of transient-based leak detection methods
.
Journal of Hydro-Environment Research
2
(
4
),
212
227
.
doi:10.1016/j.jher.2009.02.003
.
Cominola
A.
,
Giuliani
M.
,
Piga
D.
,
Castelletti
A.
&
Rizzoli
A. E.
2015
Benefits and challenges of using smart meters for advancing residential water demand modeling and management: A review
.
Environmental Modelling & Software
72
,
198
214
.
doi:10.1016/J.ENVSOFT.2015.07.012
.
Daniel
I.
,
Pesantez
J.
,
Letzgus
S.
,
KhaksarFasaee
M. A.
,
Alghamdi
F.
,
Berglund
E.
,
Mahinthakumar
G.
&
Cominola
A.
2022
A sequential pressure-based algorithm for data-driven leakage identification and model-based localization in water distribution networks
.
Journal of Water Resources Planning and Management
148
(
6
),
04022025
.
doi:10.1061/(ASCE)WR.1943-5452.0001535
.
Gertler
J.
,
Romera
J.
,
Puig
V.
&
Quevedo
J.
2010
Leak detection and isolation in water distribution networks using principal component analysis and structured residuals
. In:
2010 Conference on Control and Fault-Tolerant Systems (SysTol)
, pp.
191
196
.
Hochreiter
S.
&
Schmidhuber
J.
1997
Long short-term memory
.
Neural Computation
9
(
8
),
1735
1780
.
doi:10.1162/neco.1997.9.8.1735
.
Hu
Z.
,
Chen
B.
,
Chen
W.
,
Tan
D.
&
Shen
D.
2021
Review of model-based and data-driven approaches for leak detection and location in water distribution systems
.
Water Supply
21
(
7
),
3282
3306
.
doi:10.2166/ws.2021.101
.
Huang
T.
,
Chen
P.
&
Li
R.
2022
A semi-supervised VAE based active anomaly detection framework in multivariate time series for online systems
. In
Proceedings of the ACM Web Conference 2022. WWW ‘22
.
Association for Computing Machinery
,
New York, NY, USA
, pp.
1797
1806
.
https://dl.acm.org/doi/10.1145/3485447.3511984 (accessed 16 November 2023)
.
Kammoun
M.
,
Kammoun
A.
&
Abid
M.
2022
Leak detection methods in water distribution networks: A comparative survey on artificial intelligence applications
.
Journal of Pipeline Systems Engineering and Practice
13
(
3
),
04022024
.
doi:10.1061/(ASCE)PS.1949-1204.0000646
.
Kapelan
Z. S.
,
Savic
D. A.
&
Walters
G. A.
2003
A hybrid inverse transient model for leakage detection and roughness calibration in pipe networks
.
Journal of Hydraulic Research
41
(
5
),
481
492
.
doi:10.1080/00221680309499993
.
Killick
R.
,
Fearnhead
P.
&
Eckley
I. A.
2012
Optimal detection of changepoints with a linear computational cost
.
Journal of the American Statistical Association
107
(
500
),
1590
1598
.
doi:10.1080/01621459.2012.737745
.
Kingma
D. P.
&
Welling
M.
2014
Auto-encoding variational bayes
. In:
2nd International Conference on Learning Representations, ICLR 2014 - Conference Track Proceedings
.
Klise
K. A.
,
Hart
D.
,
Moriarty
D. M.
,
Bynum
M. L.
,
Murray
R.
,
Burkhardt
J.
&
Haxton
T.
2017
Water network tool for resilience (WNTR) User Manual
.
Sandia National Lab.(SNL-NM)
,
Albuquerque, NM, USA
.
Liemberger
R.
&
Wyatt
A.
2019
Quantifying the global non-revenue water problem
.
Water Supply
19
(
3
),
831
837
.
doi:10.2166/ws.2018.129
.
Misiunas
D.
,
Vítkovský
J.
,
Olsson
G.
,
Lambert
M.
&
Simpson
A.
2006
Failure monitoring in water distribution networks
.
Water Science and Technology
53
(
4–5
),
503
511
.
doi:10.2166/wst.2006.154
.
Molinos-Senante
M.
,
Mocholí-Arce
M.
&
Sala-Garrido
R.
2016
Estimating the environmental and resource costs of leakage in water distribution systems: A shadow price approach
.
Science of The Total Environment
568
,
180
188
.
doi:10.1016/j.scitotenv.2016.06.020
.
Mounce
S. R.
,
2021
Data science trends and opportunities for smart water utilities
. In:
ICT for Smart Water Systems: Measurements and Data Science. The Handbook of Environmental Chemistry
(
Scozzari
A.
,
Mounce
S.
,
Han
D.
,
Soldovieri
F.
&
Solomatine
D.
, eds).
Springer International Publishing
,
Cham
, Switzerland, pp.
1
26
.
Available from
:
https://doi.org/10.1007/698_2020_482 (accessed 17 February 2023)
.
Mounce
S. R.
,
Boxall
J. B.
&
Machell
J.
2010
Development and verification of an online artificial intelligence system for detection of bursts and other abnormal flows
.
Journal of Water Resources Planning and Management
136
(
3
),
309
318
.
doi:10.1061/(ASCE)WR.1943-5452.0000030
.
Mounce
S. R.
,
Mounce
R. B.
,
Jackson
T.
,
Austin
J.
&
Boxall
J. B.
2014
Pattern matching and associative artificial neural networks for water distribution system time series data analysis
.
Journal of Hydroinformatics
16
(
3
),
617
632
.
doi:10.2166/hydro.2013.057
.
Odhiambo
M.
,
Viñas
V.
,
Sokolova
E.
&
Pettersson
T. J. R.
2023
Health risks due to intrusion into the drinking water distribution network: Hydraulic modelling and quantitative microbial risk assessment
.
Environmental Science: Water Research & Technology
9
(
6
),
1701
1716
.
doi:10.1039/D2EW00720G
.
Paszke
A.
,
Gross
S.
,
Chintala
S.
,
Chanan
G.
,
Yang
E.
,
DeVito
Z.
,
Lin
Z.
,
Desmaison
A.
,
Antiga
L.
&
Lerer
A.
2017
Automatic Differentiation in PyTorch
.
Available from: https://openreview.net/forum?id=BJJsrmfCZ (accessed 17 November 2023)
.
Pudar
R. S.
&
Liggett
J. A.
1992
Leaks in pipe networks
.
Journal of Hydraulic Engineering
118
(
7
),
1031
1046
.
doi:10.1061/(asce)0733-9429(1992)118:7(1031)
.
Romero
L.
,
Puig
V.
,
Cembrano
G.
,
Blesa
J.
&
Meseguer
J.
2021
A fully data-driven approach for leak localization in water distribution networks
. In
2021 European Control Conference (ECC)
, pp.
1851
1856
.
doi:10.23919/ECC54610.2021.9654928
.
Romero
L.
,
Blesa
J.
,
Puig
V.
&
Cembrano
G.
2022
Clustering-learning approach to the localization of leaks in water distribution networks
.
Journal of Water Resources Planning and Management
148
(
4
),
04022003
.
doi:10.1061/(asce)wr.1943-5452.0001527
.
Romero-Ben
L.
,
Alves
D.
,
Blesa
J.
,
Cembrano
G.
,
Puig
V.
&
Duviella
E.
2023
Leak detection and localization in water distribution networks: Review and perspective
.
Annual Reviews in Control
55
,
392
419
.
doi:10.1016/j.arcontrol.2023.03.012
.
Sakurada
M.
&
Yairi
T.
2014
Anomaly detection using autoencoders with nonlinear dimensionality reduction
. In
Proceedings of the MLSDA 2014 2nd Workshop on Machine Learning for Sensory Data Analysis
.
ACM, Gold Coast, QLD, Australia
, pp.
4
11
.
Available from
:
https://dl.acm.org/doi/10.1145/2689746.2689747 (accessed 17 November 2023)
.
Schafer
R.
2011
What is a savitzky-golay filter? [Lecture notes]
.
IEEE Signal Processing Magazine
28
(
4
),
111
117
.
doi:10.1109/MSP.2011.941097
.
Soldevila
A.
,
Blesa
J.
,
Tornil-Sin
S.
,
Duviella
E.
,
Fernandez-Canti
R. M.
&
Puig
V.
2016
Leak localization in water distribution networks using a mixed model-based/data-driven approach
.
Control Engineering Practice
55
, 162–173.
doi:10.1016/j.conengprac.2016.07.006
.
Soldevila
A.
,
Fernandez-Canti
R. M.
,
Blesa
J.
,
Tornil-Sin
S.
&
Puig
V.
2017
Leak localization in water distribution networks using Bayesian classifiers
.
Journal of Process Control
55
,
1
9
.
doi:10.1016/j.jprocont.2017.03.015
.
Soldevila
A.
,
Blesa
J.
,
Fernandez-Canti
R. M.
,
Tornil-Sin
S.
&
Puig
V.
2019
Data-driven approach for leak localization in water distribution networks using pressure sensors and spatial interpolation
.
Water
11
(
7
),
1500
.
doi:10.3390/w11071500
.
Sousa
D. P.
,
Du
R.
,
Mairton Barros Da Silva
J.
Jr.
,
Cavalcante
C. C.
&
Fischione
C.
2023
Leakage detection in water distribution networks using machine-learning strategies
.
Water Supply
23
(
3
),
1115
1126
.
doi:10.2166/ws.2023.054
.
Spandonidis
C.
,
Theodoropoulos
P.
,
Giannopoulos
F.
,
Galiatsatos
N.
&
Petsa
A.
2022
Evaluation of deep learning approaches for oil & gas pipeline leak detection using wireless sensor networks
.
Engineering Applications of Artificial Intelligence
113
,
104890
.
doi:10.1016/j.engappai.2022.104890
.
Srivastava
N.
,
Mansimov
E.
&
Salakhudinov
R.
2015
Unsupervised learning of video representations using LSTMs
. In:
Proceedings of the 32nd International Conference on Machine Learning. PMLR
, pp.
843
852
.
Available from: https://proceedings.mlr.press/v37/srivastava15.html (accessed 15 March 2023)
.
Tornyeviadzi
H. M.
&
Seidu
R.
2023
Leakage detection in water distribution networks via 1D CNN deep autoencoder for multivariate SCADA data
.
Engineering Applications of Artificial Intelligence
122
,
106062
.
doi:10.1016/j.engappai.2023.106062
.
Truong
C.
,
Oudre
L.
&
Vayatis
N.
2020
Selective review of offline change point detection methods
.
Signal Processing
167
,
107299
.
doi:10.1016/j.sigpro.2019.107299
.
Vrachimis
S. G.
,
Eliades
D. G.
,
Taormina
R.
,
Ostfeld
A.
,
Kapelan
Z.
,
Liu
S.
,
Kyriakou
M. S.
,
Pavlou
P.
,
Qiu
M.
&
Polycarpou
M.
2020
Dataset of BattLeDIM: Battle of the Leakage Detection and Isolation Methods
.
Available from: https://zenodo.org/record/4017659 (accessed 15 March 2023)
.
Wan
X.
,
Kuhanestani
P. K.
,
Farmani
R.
&
Keedwell
E.
2022
Literature review of data analytics for leak detection in water distribution networks: A focus on pressure and flow smart sensors
.
Journal of Water Resources Planning and Management
148
(
10
),
03122002
.
doi:10.1061/(ASCE)WR.1943-5452.0001597
.
Wang
C.
,
Han
F.
,
Zhang
Y.
&
Lu
J.
2020
An SAE-based resampling SVM ensemble learning paradigm for pipeline leakage detection
.
Neurocomputing
403
,
237
246
.
doi:10.1016/j.neucom.2020.04.105
.
Wei
Y.
,
Jang-Jaccard
J.
,
Xu
W.
,
Sabrina
F.
,
Camtepe
S.
&
Boulic
M.
2022
LSTM-Autoencoder Based Anomaly Detection for Indoor Air Quality Time Series Data
.
Available from: https://arxiv.org/abs/2204.06701v1 (accessed 17 November 2023)
.
Weyns
M.
,
Mazaev
G.
,
Vaes
G.
,
Vancoillie
F.
,
Turck
F. D.
,
Hoecke
S. V.
&
Ongenae
F.
2023
Leak localization in water distribution networks using GIS-Enhanced autoencoders
.
Urban Water Journal
.
Available from
:
https://www.tandfonline.com/doi/abs/10.1080/1573062X.2023.2216191 (accessed 12 June 2024)
.
Wu
Y.
&
Liu
S.
2017
A review of data-driven approaches for burst detection in water distribution systems
.
Urban Water Journal
14
(
9
),
972
983
.
doi:10.1080/1573062x.2017.1279191
.
Yao
R.
,
Liu
C.
,
Zhang
L.
&
Peng
P.
2019
Unsupervised anomaly detection using variational auto-encoder based feature extraction
. In
2019 IEEE International Conference on Prognostics and Health Management (ICPHM)
, pp.
1
7
.
Available from: https://ieeexplore.ieee.org/abstract/document/8819434 (accessed 17 November 2023)
.
This is an Open Access article distributed under the terms of the Creative Commons Attribution Licence (CC BY 4.0), which permits copying, adaptation and redistribution, provided the original work is properly cited (http://creativecommons.org/licenses/by/4.0/).

Supplementary data