Skip to Content
  • Article
  • Open Access

23 February 2026

17 Pages

Multi-Class Leak Detection in Water Pipelines Using a Wavelet-Guided Frequency-Informed Transformer

,
and
Electronic Systems, Sensors and Nanobiotechnologies (E2SN), ENSAM, Mohammed V University in Rabat, Rabat 10100, Morocco
*
Author to whom correspondence should be addressed.
This article belongs to the Section Artificial Intelligence

Abstract

Water utilities continue to lose a lot of Non-Revenue Water (NRW) because of leaks that go undetected. This makes it necessary to find accurate but easy-to-use monitoring solutions. This paper presents FiT-WST+, a wavelet-guided Frequency-Informed Transformer (FiT) designed for the classification of five distinct leak types utilising accelerometer measurements. The proposed architecture combines the spectral modelling ability of a FIT with the stable translation-invariant representation of the Wavelet Scattering Transform (WST). The model uses a guided attention mechanism to combine spectral and scattering cues that work well together to make classes more distinct, especially for fault types that are similar. On the held-out test set, FiT-WST+ achieves 99.6% accuracy, 99.6% balanced accuracy, and a 99.6% macro-averaged F1-score. Comparative benchmarking against recent methods tested on the same dataset shows that this method works at a low sampling rate (1 kHz), which greatly lowers bandwidth needs and allows for scalable deployment on edge devices with limited resources for real-time monitoring of important water infrastructure.

1. Introduction

Communities, both in cities and in the countryside, need water distribution networks (WDNs) as part of their basic infrastructure. But these networks have big problems, especially leaks that cause a lot of water loss, higher costs for running and using energy [1], and negative environmental impacts [2,3]. These losses, which are often called NRW, add up to about 126 billion cubic metres every year, which costs billions of dollars [4] and has severe ecological impacts, such as groundwater depletion and increased energy consumption for water treatment and pumping.
Modern WDNs cover a lot of ground and can handle a wide range of operational needs. Pipelines can be anywhere from less than 100 mm to more than 1200 mm in diameter. The flow rates can be as low as a few centilitres per second in residential areas and as high as several litres per second during industrial pipeline bursts. PVC, steel, and polyethylene are all common materials, but they each have their own problems when it comes to finding leaks. For example, signals can be weakened in non-metallic pipes.
Leaks can be of different sizes. Some are very small (1–2 mm in diameter) and have very low flow rates, while others are much bigger and can lose several litres per minute. These leaks can happen at different times, depending on how much water is needed and how the pressure changes throughout the day. For example, daytime leaks may go unnoticed because of the extra noise in the background. These problems must be solved by strong detection systems that are still cost-effective. Investing in reliable detection systems is worth it because billions are lost every year [1], and early leak detection is good for the environment. For instance, pressure sensors, flowmeters, and ultrasonic water level sensors commonly used in Internet of Things (IoT) systems typically range between 85$ and 115$ per unit [5,6].
Even though things are getting better, there are still some practical problems. First, multi-class classification (e.g., distinguishing various leak types and non-leak conditions) is more challenging than binary detection. Second, labelled datasets are often not very significant and do not cover all the different kinds of situations that happen in the real world. Thirdly, recent reviews [7] have made it clear that the community is still coming up with common benchmarks and experimental protocols, which makes it hard to fairly compare different methods.

1.1. Review of Existing Methods

Data-driven leak detection strategies range from classical Machine Learning (ML) to Deep Learning (DL). These studies primarily focus on optimising signal representation to enhance classification accuracy (ACC). For instance, Nam et al. [8] describe a method that uses convolutional neural networks (CNNs) with real leak sounds and the hold-out technique. Before and after the leak repairs, the data were recorded for both leak sounds and background noise. Recurrence Plots (RPs) were then used to turn the data into two-dimensional representations. This made it possible to tell the difference between the deterministic features of leak sounds and background noise. To speed up the model training, these RPs were changed to be 64 × 64 pixels in size. The study demonstrated that the pipeline materials influence the learning process, and the model showed a detection ACC of over 70% in 19 out of 20 cases, with 15 cases achieving an ACC of more than 80%. Kammoun et al. [9] use the LeakDB dataset [10] to test different ML methods, such as Logistic Regression (LR), Support Vector Machine (SVM), Multilayer Perceptron (MLP), and K-Nearest Neighbours (KNN). The assessment concentrated on leak detection arising from simulated hydraulic fluctuations across various scenarios, differentiating between sudden and nascent leaks. The algorithms do not all work the same way. SVM and MLP have better overall ACC, especially when there are sudden leaks. The outcomes derived from various realistic scenarios indicated an ACC of 98.02% with a False Positive Rate (FPR) of 0.13% for SVM using pressure data in mixed scenarios on the Net-1 network. In scenario 111, MLP, LR, and KNN achieved 100% ACC, a 100% True Positive Rate (TPR), and 0% FPR using flow difference data. Saravanabalaji et al. [11] explore the use of Hybrid Learning (HL) models based on signals collected using a Dytran acceleration sensor and transformed from the time domain to the frequency domain using the Fast Fourier Transform (FFT). To reduce the dimensions of the frequency signals, Principal Component Analysis (PCA) was applied, reducing the dimensions to 17. Several conventional ML models were used, such as LR, AdaBoost, SVM with linear and RBF kernels, Neural Networks (NNs), Extreme Gradient Boosting (XGBoost), and Random Forest (RF). Hybrid models combining these techniques were also developed. The results show that the hybrid model-4 achieved a maximum ACC of 99.3%, a precision of 99.1%, a recall of 99.1%, and an F1-score of 99.1%. Wu et al. [12] investigate the potential of DL techniques utilising data obtained from accelerometers. The authors create a hybrid method that uses both hand-crafted features, including Line Spectrum Pairs (LSPs), and other indicators in the time and frequency domains, with advanced models such as XGBoost and CNN. The study emphasises the importance of handcrafted features, obtained via custom functions, and the MATLAB R2019b Voicebox toolbox, which, when combined with hybrid classifiers, demonstrates improved performance. Nevertheless, a considerable reliance on hand-crafted features may limit the generalisability and accessibility of this methodology, while requiring extensive proficiency in hydraulics and computing.
With the advent of DL and IoT, end-to-end architectures have gained prominence. Tsai et al. [13] employ a hybrid IoT framework that uses CNNs and autoencoders for anomaly detection. The system separates leak signatures from background noise by extracting Mel Frequency Cepstral Coefficients (MFCCs) and finds transients by looking at the autoencoder’s reconstruction error. This method achieved an ACC of over 95% and showed that it was useful by lowering excavation costs by 26%. Choudhary et al. [14] propose an approach for leak detection, localisation, and size estimation in a Smart Water Grid (SWG) using a one-dimensional CNN (1D-CNN) model. The IoT prototype, used for water treatment and distribution, enables monitoring of water quality and measurement of consumption across various distribution lines, utilising Supervisory Control and Data Acquisition and Programmable Logic Controllers. The process parameters (pressure, flow, and water quality, among others) are measured in real time. The data size was increased through the use of a Synthetic Data Vault (SDV). The developed model was compared to other ML techniques, such as LR and SVM. This model outperformed these techniques in terms of ACC, with rates of 94.32% for leak detection, 91.91% for leak size estimation, and 89.85% for leak localisation. Gunatilake et al. [15] adopt a multi-class time–frequency convolutional neural network (M-TFCNN) to classify urban underground water leaks from vibro-acoustic signals (e.g., fire hydrant, service valve, and private leaks). Trained on a large dataset collected over three and a half years in a major Australian city, the model achieved up to 98% ACC. To mitigate road-noise interference, recordings were performed between 2 A.M. and 4 A.M., which may limit the detection of leaks occurring at other times. Their results further confirm that STFT-based CNN models can reliably discriminate leak and non-leak conditions in challenging acoustic environments. Liu et al. [16] utilise an integrated generative model, specifically a Long Short-Term Memory–Generative Adversarial Network (LSTM-GAN), to generate synthetic leak signals and address data scarcity. Their experiments showed that adding the right number of synthetic samples (2500) raised the testing ACC to 94.02%, which is much better than traditional methods. They did this by using t-Distributed Stochastic Neighbour Embedding (t-SNE) to check the data distribution. However, sensitivity analysis indicated that performance gains were not linear, emphasising the need to tune the volume of augmented data. Additionally, Reshadi et al. [17] introduce an anomaly detection approach for time series by combining a deep 1D-CNN model with a one-class anomaly detector in a hybrid meta-classification architecture. SMOTE is also employed to address the imbalance in the training data. The data used in the study were obtained from a laboratory-scale pipeline loop, simulating both normal and leak behaviours in an underground pipeline. Sixteen features were recorded, including pressure, dielectric permittivity, flow rate, temperature, and vibrations. The experimental results using the Isolation Forest and One-Class SVM models show that ACC and TPR values are well above 0.99.
Finally, other works have explored advanced sensing and district-level monitoring. Rajasekaran et al. [18] present a customised one-dimensional DenseNet model, combining the advantages of 1D-CNN and DenseNet, utilising an acousto-optic sensor. The controlled experiment was conducted on a galvanised iron pipeline. The acousto-optic sensing fibre played an important role in capturing the negative vibrations caused by leaks. Data were collected for seven different sets, with pressures of 2 bar and 3 bar, and at varying distances ranging from 0.7 to 29 m from the leak point. The model evaluation achieved an average ACC of 99.08% compared with various architectures, including DenseNet-121, 1D-CNN, and ensemble 1D-CNN-SVM models. Glomb et al. [19] test six ML-based anomaly detectors on District Metered Areas (DMAs), utilising a Leave-One-Scenario-Out technique for parameter optimisation on hourly hydraulic data (flow, pressure, and calculated losses). Their comparative analysis reveals that these models significantly outperform traditional Minimum Night Flow (MNF) analysis, reducing detection time from days to as little as 1–2 h post-incident. Despite these gains, the authors highlight that the high variability of DMA data and the scarcity of labelled incident records make model parametrisation and generalisation challenging. Gemeinhardt et al. [20] evaluate the use of Distributed Acoustic Sensing (DAS) and Distributed Temperature Sensing (DTS) technologies for the automatic detection and localisation of small leaks, ranging from 0.04 to 0.30 L/s, in an outdoor experimental pipeline. The authors examined the efficacy of each technology individually and in conjunction, utilising a singular lead cable comprising both single-mode and multi-mode fibres. The tests were done on a flow loop made of stainless steel that was 6.1 m long [21]. A difference in hydrostatic pressure induced the leaks. The average localisation error along the optical cable was about 2.98 m across all bands. When DAS and DTS data were combined, performance improved a lot compared to when each technology was used on its own. F1-scores exceeded 0.9, particularly in the 1000–1500 Hz frequency band.

1.2. State of the Art on the Target Benchmark

Recently, the dataset proposed in [22] has become a standard for testing leak diagnosis models, especially because it has a lot of different classes and background conditions. Regarding DL approaches, the FiT was proposed in [23], which is one of the most recent works that uses this dataset. Their model gets 98.7% of the leak type classification correct by only using spectral amplitudes from the FFT. Mahdi et al. [24] focus on water leak detection and localisation using feature analysis and an ANN. The Autocorrelation Coefficient (Au-C) feature demonstrates high sensitivity to repetitive patterns, measuring the similarity of signals over time, while Signal Energy (Sig-E) quantifies the total energy of the signal, thereby facilitating leak localisation. An ANN model is designed with optimal parameters, featuring two hidden layers with four neurones each and utilising the SGD solver for 100 iterations. In the branched topology, combining pressure and vibration data yielded an ACC of 86.5% and an F1-score of 86.2%. For the looped topology, the model achieved an ACC of 82.1% and an F1-score of 82.0%.
In the domain of sensor fusion, the study by [25] investigates water leakage classification using acceleration, dynamic pressure, and hydrophone data extracted from the [22] benchmark. The authors propose the WST as a unified feature extraction method for the three sensing modalities and train unimodal SVMs for each sensor, as well as late fusion (LF) models that combine their predictions. Their results show that WST features computed from accelerometer signals and classified with an SVM yielded the best single-modality performance, with an ACC of 89.58% for the looped topology and 96.67% for the branched topology, while late fusion of the three modalities achieved ACCs of 93.33% and 95.83% for looped and branched topologies, respectively. Leonzio et al. [26] propose a multi-sensor fusion framework employing a complex-valued CNN. By leveraging both magnitude and phase information from the STFT, they achieved a balanced ACC of 99% for both leak detection and classification on the Aghashahi dataset [22]. However, their highest performance relied on the fusion of hydrophone and accelerometer data. Their study highlighted that, for accelerometer-only scenarios, neglecting phase information (magnitude-only) significantly dropped the detection ACC to 87%, whereas incorporating complex features restored it to 95%. This emphasises the imperative for sophisticated feature extraction methodologies that can identify transient and phase-related structures in vibration signals under a single sensor type.
Finally, concerning classical ML, Sabbatini et al. [27] present a comprehensive comparison of signal pre-processing pipelines and ML models for both leak detection and classification. By excluding transient signals to focus on stable states, the authors extract 30 time and frequency-domain features from pressure and accelerometer signals over different window sizes. They address class imbalance with SMOTE for the binary task and evaluate 35 classifiers. Their results show that accelerometer data outperformed pressure data for multi-class classification: the best configuration, an Ensemble Bagged Trees model trained on accelerometer features with 5 s windows, achieved 91.7% ACC, whereas longitudinal cracks (LCs) remained the most challenging class. Al Ghasheem et al. [28] propose an approach that relies exclusively on accelerometer measurements, from which five core time-domain features (mean, standard deviation, skewness, kurtosis, and RMS) were extracted to characterise five leak types. An RF classifier was then trained on these statistical descriptors, achieving a cross-validated multi-class ACC of 97.3%, while feature importance analysis highlighted RMS, kurtosis, and variance as the most discriminative attributes for leak identification. Leonzio et al. [29] address both water leak detection and multi-class leak type classification using multiple sensing modalities (accelerometers, dynamic pressure sensors, and hydrophones). They designed a classical feature extraction pipeline based on time- and frequency-domain descriptors (e.g., RMS, zero-crossing rate, spectral centroid, and MFCCs) computed over 0.5 s windows, performed Sequential Feature Selection (SFS), and trained conventional classifiers such as RF, Gradient Boosting, and SVMs. Their results demonstrate that while all sensors achieved a balanced ACC above 0.90 for binary detection, the accelerometer proved to be the most reliable modality for five-class classification, reaching 0.984 balanced ACC in the branched topology and 0.934 in the looped topology, significantly outperforming pressure and hydrophone data. Furthermore, the authors showed that performance remained robust (above 0.85) even with aggressive downsampling, supporting feasibility for low-power IoT hardware. Jweri et al. [30] propose an edge-intelligent framework utilising CatBoost, concentrating on vibration signals. They got a classification ACC of 98.1% by taking out statistical time-domain and frequency-domain features (like RMS and spectral entropy). Their work shows that lightweight models could be useful for real-time monitoring, but they depend on manual feature engineering, which may not be able to capture complex, non-stationary leak patterns as well as deep representation learning. Recent research employing this benchmark indicates a trade-off between (i) the high ACC attained by more complex multi-sensor or phase-aware systems and (ii) the deployability of lightweight single-sensor methods that frequently depend on manually designed features. Specifically, nuanced class ambiguities (e.g., GL vs. LC) and resilience under low-bandwidth limitations are inadequately addressed in compact accelerometer-exclusive models. A detailed quantitative comparison of these state-of-the-art methods, including their sensor configurations and reported accuracies, is provided in Section 3.3.

1.3. Contribution and Novelty

Despite these advancements, a critical gap remains in developing lightweight, single-sensor architectures capable of distinguishing subtle multi-class leak signatures under realistic bandwidth constraints. In addition, the literature review by [7] shows that the lack of labelled data and the imbalance between classes are two of the biggest problems for AI in WDNs. To address these constraints, they propose three strategies: data generation, reduction in data requirements via integrated modelling, and knowledge transfer. In this framework, our research concentrates on data augmentation and integrated modelling. We propose a new hybrid architecture called the WST-guided FiT, a method designed for robust multi-class leak classification using only low-frequency (1 kHz) accelerometer data. Our method uses the WST to get invariant physical descriptors and has been tested on the multi-class benchmark of [22]. These descriptors direct the focus of a FiT through a cross-attention mechanism. Our method shows that combining strong physical features is a better way to classify leaks in a low-data environment than making synthetic data.

2. Materials and Methods

2.1. Data Description

The signal chain illustrated in Figure 1 consists predominantly of components developed by the authors, with the exception of the benchmark dataset, which was specifically designed for leak detection and localisation in water distribution systems (WDSs) and obtained from a public database [22]. All subsequent phases, including data pre-processing, the development of the architecture, and hybrid algorithms for classification, were entirely conceived and implemented by the authors. The data were collected from a laboratory-scale experiment, integrating various network topologies and multiple types of leaks under different background conditions (noise and water demand). The experimental pipelines were made with PVC pipes that were 152.4 mm in diameter. This is a common material used in modern water networks, so the dataset accurately represents real-world conditions. In our research, we concentrate on the accelerometer sensor recordings (Table 1).
Figure 1. Architecture of the WST-guided FiT. The model processes the windowed signal through two parallel streams: a physical branch extracting invariant scattering coefficients and a learnable frequency branch using a transformer encoder. The core novelty lies in the guided cross-attention mechanism, where WST features serve as queries to attend to the most relevant spectral keys/values, effectively grounding the DL representation in physical invariants before classification.
Table 1. Summary of the dataset characteristics for the accelerometer.
  • Topologies: The data features looped and branched network configurations (Figure 2), emulating actual urban and rural water distribution scenarios.
  • Leak types: There are 80 recordings in total, coming from accelerometers A1 and A2. These recordings were first saved as (.csv) files and are now shown as time-series data. Of the total series, 64 are leak events and 16 are no-leak (NL) conditions. There are four different types of leak events: circumferential cracks (CCs), gasket leaks (GLs), orifice leaks (OLs), and longitudinal cracks (LCs).
  • Background conditions: The experiments varied the type of background flow (0, 0.18, 0.47 L/s, and transient conditions) [22] to simulate different operational environments.
  • Instrumentation: As summarised in Table 1, each measurement was conducted over a duration of 30 s with a sampling frequency of 51.2 kHz.
Figure 2. A schematic showing the experimental water network topologies. (a) The looped topology and (b) the branched topology. A1 and A2 are where the accelerometers are. M1 and M2 are the flow meters.

2.2. System Model

The system shown in Figure 1 is meant to classify leak types by using the fact that spectral and physical features work well together. The pipeline processes vibration signals through a dual-branch architecture before combining them using an attention mechanism. There are four main steps in the framework:
  • Input Processing: Raw vibration signals collected from accelerometers are pre-processed and segmented into overlapping windows.
  • Dual Feature Extraction: The system diverges into two parallel pathways to extract distinct feature sets:
    –
    Spectral Branch: An FFT is used to produce a high-resolution spectral amplitude vector, which is the tokenised input for the transformer.
    –
    Physical Branch: A WST is applied to extract translation-invariant and stable physical descriptors, capturing multi-scale transient characteristics of the leak.
  • FiT: A transformer processes the spectral tokens that come from the FFT module. This backbone uses self-attention processes to describe global dependencies and complex patterns in the frequency domain, creating a rich latent representation (key/value).
  • Guided Fusion Mechanism: A “guided cross-attention” layer is used to combine the two representations. This module employs the stable WST features as a “query” to steer the attention mechanism across the learnt spectral features, which is different from regular concatenation. This mixed method makes sure that the model looks at the most physically relevant spectral components before putting them into five groups (NL, OL, GL, LC, and CC).

2.3. Pre-Processing and Feature Extraction

As the energy of leak signals in water distribution pipes is predominantly concentrated at low frequencies [20,24,26,29], the raw accelerometer signals are first resampled to a common target frequency f s = 1 kHz. This corresponds to a Nyquist frequency of 500 Hz , which is sufficient to preserve the main frequency components typically associated with leak-induced vibrations and their propagation along the pipe, while discarding high-frequency content that is more affected by attenuation and measurement noise. To capture leak signatures and increase the statistical robustness of the dataset, continuous recordings are segmented into overlapping windows of duration T win = 3 s (Table 2).
Table 2. Hyperparameters and configuration settings for the FiT-WST+ framework.
Following established methodologies [16,29], we employ a sliding-window segmentation strategy. We selected a window size of 3 s with 90% overlap as the optimal configuration. This process acts as a deterministic data augmentation technique, effectively transforming the initial set of 80 raw recordings into a comprehensive dataset of 8911 discrete analysis windows. To ensure comparability with recent state-of-the-art benchmarks [23,25,30], we adopted a stratified sampling strategy at the window level. Specifically, 60% were allocated to training, 20% were allocated to validation, and 20% were reserved for the held-out test set. Consequently, the training set consists of 5346 windows, while the test set contains 1783 windows. Signals from accelerometers A1 and A2 were handled as distinct instances concerning the sensor channels. This method efficiently enhances the variability of the training data. From each window, two complementary feature sets are extracted.

2.3.1. Fourier Representation

We compute the magnitude of the FFT and apply a logarithmic dynamic range compression to the amplitudes. We retain the positive-frequency bins up to the Nyquist frequency, yielding a high-dimensional spectral vector:
x FFT ∈ R F .

2.3.2. Wavelet Scattering Representation

In parallel, a WST is applied to each window. Unlike standard wavelet transforms, the WST introduces a non-linear modulus operator and averaging, yielding a representation that is translation-invariant and stable to local deformations. By averaging the zero-, first-, and second-order scattering coefficients over the temporal window, we extract a robust, multi-scale physical descriptor:
x WST ∈ R W .

2.3.3. Implementation Details

The WST is computed using the Kymatio library [31], which provides a GPU-accelerated and differentiable implementation in Python 3.12.12 (PyTorch). We utilise the Morlet wavelet as the mother wavelet due to its superior time-frequency localisation properties for vibro-acoustic signals. Following the theoretical foundation established by [32], the scattering coefficients are calculated up to the second order ( m = 2 ) to recover information lost during the modulus operation of the first layer.
Figure 3 shows an example of the three representations (time-domain, FFT, and WST) for two different operating conditions. To begin with, the raw time-domain accelerometer signals (a) have a lot of noise and overlap, which makes it hard to tell them apart. The frequency spectra (b) show that the leak adds different energy concentrations in the low-frequency band (<200 Hz). Lastly, the wavelet scattering coefficients (c) give each class a stable, unique texture descriptor. This makes them a good choice for use as a guidance signal in the proposed architecture. Both feature vectors are standardised using z-score normalisation based on training set statistics. The specific feature dimensions F and W resulting from this process are detailed in Table 2.
Figure 3. Comparative visualisation of a leak type (longitudinal crack—LC) versus the no-leak condition (NL).

2.4. FiT–WST+ Architecture

The proposed architecture integrates these features through a guided attention mechanism. It consists of three main blocks.

2.4.1. Spectral Transformer Backbone

The normalised spectral vector x FFT is treated as a sequence of scalar tokens. These tokens are projected into a latent dimension d model and processed by a stack of transformer encoder layers. This allows the model to learn global dependencies and complex patterns across the frequency spectrum.

2.4.2. WST Guidance Projection

The wavelet scattering vector x WST is projected into the same latent dimension d model . Unlike the spectral features, which evolve through the transformer layers, the WST embedding serves as a stable, physics-informed reference.

2.4.3. Guided Fusion Head

To fuse the two branches, we employ a guided cross-attention mechanism based on the standard multi-head attention architecture introduced by [33]. In our implementation, the wavelet scattering features ( x WST ) are projected to form the query matrix, serving as the structural guide. The keys and values are given by the learned spectral token embeddings produced by the FiT backbone from the FFT tokens. This configuration forces the network to use the translation-invariant scattering details to query the spectral context, effectively fusing the two representations based on their relevance to the leak signature before the final classification via an MLP.
Mathematically, let Q ∈ R 1 × d be the query vector derived from the WST projection and K , V ∈ R N × d be the key and value matrices derived from the spectral tokens. The guided attention output is computed as follows:
Attention ( Q , K , V ) = softmax Q K T d V
This mechanism ensures that the invariant scattering features ( Q ) assign higher weights to the most relevant spectral components ( V ) for the specific leak type.

2.5. Optimisation Setup

The model is trained to minimise a class-weighted cross-entropy loss to handle class imbalance. The optimisation is performed using the AdamW optimiser coupled with a cosine annealing learning rate schedule. Training runs for up to 80 epochs with early stopping based on the validation macro-F1-score. A summary of the hyperparameters used in this study is provided in Table 2.

3. Results and Discussion

3.1. Experimental Setup

The dataset was split into training, validation, and test sets. We monitored training using the validation set and reported the final performance on the held-out test set, which remained unseen during training.

3.2. Classification Performance Analysis

The evolution of loss, ACC, balanced ACC, and F1-score over epochs, illustrated in Figure 4, demonstrates fast convergence and stable generalisation, validating the effectiveness of the FiT-WST+ architecture. Consequently, the framework demonstrated exceptional performance on the held-out test set, achieving an overall ACC of 99.6%, a balanced ACC of 99.6%, and a macro-averaged F1-score of 99.6%. These results indicate that our model can reliably disentangle subtle multi-class leak signatures using accelerometer measurements only (A1/A2).
Figure 4. Training and validation learning curves for the FiT-WST+ model.

3.2.1. Class-Wise Performance

To comprehensively evaluate the classification performance and feature separability, we employ confusion matrices and t-SNE visualisations, following the validation framework adopted in recent leak detection studies [34]. The confusion matrix in Figure 5a is strongly diagonally dominant, indicating that misclassifications are rare across the five target classes. In total, 1775 out of 1783 test windows are correctly classified, confirming robust multi-class discrimination at the window level.
Figure 5. Performance evaluation of the proposed model: (a) confusion matrix and (b) t-SNE plot for leak classification.
  • Near-perfect separation of normal operation: NL is almost perfectly recovered (Figure 5a), with only one window confused with GL, showing that normal operation remains clearly separable from leak-related signatures.
  • Residual ambiguity between similar leak types: The remaining errors include limited confusion between GL and LC (two GL→LC and one LC→GL), suggesting partially overlapping patterns for a small fraction of windows.
  • Minor confusions involving OL and CC: Only isolated errors are observed (one OL→CC and two CC misclassified as OL/GL), while both classes remain recognised with near-perfect performance.

3.2.2. Physical Interpretation

The differentiation between LC and GL is particularly difficult from a physical standpoint, as both produce broadband noise primarily characterised by low-frequency structural resonance. Nonetheless, their fluid-dynamic mechanisms diverge: LC generally generates intense turbulence owing to uneven fracture edges, resulting in high-order transients. Conversely, GL typically arises from seal failure, resulting in smoother, flow-modulated vibrations. Although the FFT magnitude spectra of these events show limited discriminative contrast, the second-order WST coefficients effectively encapsulate the transient features of the LC turbulence, enabling the guided attention mechanism to clarify this ambiguity.

3.3. Benchmarking Against the State of the Art

To contextualise our contribution, we compared our results with a selection of notable recent studies that utilised the same dataset (Table 3). We selected works representing a diverse range of methodologies, from classical ML to advanced DL and sensor fusion.
Table 3. Comparative analysis of the proposed FiT-WST+ against recent state-of-the-art methods on the Aghashahi dataset.

3.4. Ablation Study and Architectural Analysis

To ensure a fair assessment, all architectural variants were trained and evaluated using the exact same protocol as the proposed model (identical data splits, normalisation, and hyperparameter optimisation).
  • Baseline A (WST + MLP): ACC reached 96.8% (Table 4). While the WST provides robust multi-scale texture representations, its static classifier remains less effective at separating the most ambiguous leak categories, particularly those with overlapping feature distributions in the latent space (Figure 6).
  • Baseline B (FiT): The FiT-only baseline achieved 86.8% ACC under our experimental protocol and utilised the same backbone architecture and training hyperparameters as the proposed method. While FiT is highly effective in high-frequency settings, as reported by [23], its performance decreases under the 1 kHz sampling rate constraint imposed by our IoT-oriented framework. This suggests that transformer attention over FFT representations is sensitive to the loss of high-frequency spectral content (Figure 7).
  • Proposed (Guided Attention): The complete FiT-WST+ model, employing the guided cross-attention mechanism, obtained 99.6% ACC (Figure 5a). By using WST features to explicitly guide the transformer’s attention over FFT tokens, the model better disambiguates the most challenging leak categories (e.g., LC vs. GL), which remain difficult to separate when relying on spectral or textural information in isolation.
Table 4. Ablation study on the test set: comparison of different architectural configurations.
Figure 6. Performance evaluation of the Baseline A model: (a) confusion matrix and (b) t-SNE plot for leak classification.
Figure 7. Performance evaluation of the Baseline B model: (a) confusion matrix and (b) t-SNE plot for leak classification.

3.5. Sensitivity Analysis of Hyperparameters

To evaluate the robustness of the proposed model framework and justify the selection of key hyperparameters, we conducted a comprehensive sensitivity analysis. We assessed the model’s performance stability against variations in two critical areas: wavelet scattering parameters (scattering scale J and resolution Q) and data segmentation settings (window size and overlap ratio).
First, regarding the wavelet scattering parameters, Figure 8a illustrates the macro-F1-scores across various ( J , Q ) configurations. The framework demonstrates high stability, consistently maintaining a score above 95.4% across the grid. As observed, increasing the spectral resolution Q generally enhances performance, confirming that finer spectral discrimination is essential for capturing subtle vibro-acoustic leak patterns. Consequently, the configuration ( J = 8 , Q = 8 ) , which yields a competitive performance, was retained for the final model.
Figure 8. Sensitivity analysis of FiT-WST+: (a) ( J , Q ) wavelet scattering configuration and (b) window size/overlap ratio effect.
Second, we analysed the impact of the sliding window size (ranging from 1.0 s to 4.0 s) and overlap ratio (50% to 90%), as shown in Figure 8b. The heatmap reveals that the model is remarkably resilient to variations in temporal segmentation, with macro-F1-scores remaining consistently high (≥95.5%) even under minimal overlap conditions. Performance peaks with higher overlap ratios (85–90%), achieving optimal results of 99.8% macro-F1 with a 3.0 s window. This confirms that larger overlaps provide better temporal continuity for the transformer, although the model remains effective even with shorter windows.

3.6. Discussion

The research conducted by Leonzio et al. [26] set an exemplary standard (99.0%) by skilfully integrating data from hydrophones and accelerometers through the use of complex-valued CNNs. However, their performance with just one sensor on accelerometer data was 90.0%. In contrast, using only accelerometer data, our FiT-WST+ attained 99.6%. This means that the WST’s rich feature representation makes up for the lack of acoustic sensors, allowing for a more cost-effective deployment strategy that does not lower reliability.
The FiT model by Liu et al. [16] reported 98.7% ACC for classification. However, this study relied on signals sampled at 25.6   k Hz . In contrast, our method attained superior performance with accelerometer signals downsampled to only 1 k Hz . This indicates that the discriminative information necessary for multi-class leak identification is predominantly concentrated in the low-frequency region and that WST-guided features offer a supplementary, deformation-stable characterisation. This preserves class separability despite drastic signal decimation, aligning perfectly with the strict bandwidth constraints of edge AI deployment.
Earlier work by Martinez-Rios et al. [25] explored wavelet scattering features on this benchmark using SVM classifiers with a coarse scattering resolution ( Q = 1 ), reporting ACCs of 93.33% (looped topology) and up to 96.67% (branched topology). In our case, we adopted a higher scattering resolution ( Q = 8 ) and coupled the WST representation with a guided attention-based fusion, which substantially improves multi-class separability.
Similarly, robust non-DL pipelines such as those of Sabbatini et al. [27] and Jweri et al. [30] reported strong results (91.7–98.1% in their respective evaluation protocols). Our results indicate that combining a physics-informed WST descriptor with transformer-based representation learning significantly reduces the remaining confusions between closely related leak classes.
Regarding computational efficiency, the proposed FiT-WST+ offers a distinct architectural advantage over the DL baselines listed in Table 3. Unlike pure DL approaches such as [23] or complex-valued neural networks [26] that rely on deep stacks of learnable layers to extract physical invariants, our method leverages the WST as a fixed-weight feature extractor. This strategy significantly reduces the burden on the trainable backend, resulting in a lightweight model with approximately 2.95 million trainable parameters. Experimentally, the inference time averages 1.9 ms per window on a standard GPU, effectively supporting real-time monitoring capabilities. Furthermore, while the reported results correspond to the best-performing model, repeated training runs ( N = 5 ) showed a standard deviation of approximately 0.39% in ACC, confirming the statistical stability of the convergence.

3.7. Limitations and Future Work

Even though the proposed FiT-WST+ demonstrates strong performance on the tested dataset, it is acknowledged that a pipeline’s vibration response is affected by physical factors (such as the material, diameter, and wall thickness of the pipe), sensor placement (distance from the leak source), and environmental noise. For instance, proximity to pumping stations or high-traffic areas may introduce high-amplitude mechanical transients that could partially mask leak signatures in the measured vibration signals. The WST theoretically ensures stability against minor signal deformations (Lipschitz continuity), and the attention mechanism is designed to mitigate extraneous background noise. However, the model’s applicability to markedly different hydraulic networks has yet to be empirically assessed.
Future research will concentrate on validating the framework using heterogeneous benchmarks that incorporate diverse pipe materials and fluctuating flow regimes to further evaluate the risk of false alarms in dynamic industrial settings. To accomplish this, we will look into transfer learning and online learning methods. These methods let models keep adapting as new labelled or weakly labelled data becomes available without needing to be retrained from scratch. Lastly, adding this model to an end-to-end pipeline on edge devices with limited resources will be an important step towards making leakage monitoring reliable and scalable for real-time applications.

4. Conclusions

This study introduced an innovative DL framework, FiT-WST+, aimed at tackling the difficulties of reliable leak classification in WDNs utilising vibration data. Our method gets around the problems with classic statistical feature engineering and typical frequency-domain models by combining the spectral selectivity of a FiT with the stable, texture-invariant representation of the WST.
The experimental results on the benchmark Aghashahi dataset demonstrate that FiT-WST+ achieves a state-of-the-art ACC of 99.6%, surpassing recent multi-sensor fusion and high-frequency approaches. A critical finding of this work is the model’s exceptional data efficiency: we established that highly reliable diagnosis is achievable at a sampling rate of only 1 k Hz , reducing data bandwidth requirements. This proves that the guided attention mechanism effectively compensates for the reduced spectral resolution during downsampling, making the solution particularly viable for resource-constrained edge AI/IoT devices.

Author Contributions

Conceptualisation, J.E.M. and A.J.; Methodology, J.E.M. and A.J.; Software, M.E.; Validation, J.E.M. and A.J.; Formal Analysis, M.E.; Investigation, M.E.; Resources, M.E.; Data Curation, M.E.; Writing—Original Draft Preparation, M.E.; Writing—Review and Editing, J.E.M. and A.J.; Visualisation, M.E.; Supervision, J.E.M. and A.J.; Project Administration, J.E.M. and A.J. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original data presented in the study are openly available at https://doi.org/10.1016/j.dib.2023.109148 (accessed on 12 February 2026).

Acknowledgments

We wish to recognise the authors [22] of the benchmarking dataset for leak detection and localisation in WDS, which was publicly supplied. This dataset’s availability has been crucial in validating our techniques. We really value their endeavour in providing thorough data to the research community, therefore promoting breakthroughs in leak detection.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Talpur, B.D.; Ullah, A.; Ahmed, S. Water Consumption Pattern and Conservation Measures in Academic Building: A Case Study of Jamshoro Pakistan. SN Appl. Sci. 2020, 2, 1781. [Google Scholar] [CrossRef] [Scilit]
  2. Vörösmarty, C.J.; Green, P.; Salisbury, J.; Lammers, R.B. Global Water Resources: Vulnerability from Climate Change and Population Growth. Science 2000, 289, 284–288. [Google Scholar] [CrossRef] [Scilit]
  3. Puust, R.; Kapelan, Z.; Savic, D.A.; Koppel, T. A Review of Methods for Leakage Management in Pipe Networks. Urban Water J. 2010, 7, 25–45. [Google Scholar] [CrossRef] [Scilit]
  4. Liemberger, R.; Wyatt, A. Quantifying the Global Non-Revenue Water Problem. Water Suppl. 2018, 19, 831–837. [Google Scholar] [CrossRef] [Scilit]
  5. Maroli, A.A.; Narwane, V.S.; Raut, R.D.; Narkhede, B.E. Framework for the Implementation of an Internet of Things (IoT)-Based Water Distribution and Management System. Clean Technol. Environ. Policy 2021, 23, 271–283. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  6. Essouabni, M.; El Mhamdi, J.; Jilbab, A. Advanced IoT Techniques for Detecting Water Leaks in Supply Networks with LoRaWAN. Int. J. Adv. Comput. Sci. Appl. IJACSA 2024, 15, 107. [Google Scholar] [CrossRef] [Scilit]
  7. Wu, Y.; Liu, S.; Kapelan, Z. Addressing Data Limitations in Leakage Detection of Water Distribution Systems: Data Creation, Data Requirement Reduction, and Knowledge Transfer. Water Res. 2024, 267, 122471. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  8. Nam, Y.W.; Arai, Y.; Kunizane, T.; Koizumi, A. Water Leak Detection Based on Convolutional Neural Network (CNN) Using Actual Leak Sounds and the Hold-out Method. Water Suppl. 2021, 21, 3477–3485. [Google Scholar] [CrossRef] [Scilit]
  9. Kammoun, M.; Kammoun, A.; Abid, M. Experiments Based Comparative Evaluations of Machine Learning Techniques for Leak Detection in Water Distribution Systems. Water Suppl. 2022, 22, 628–642. [Google Scholar] [CrossRef] [Scilit]
  10. Vrachimis, S.G.; Kyriakou, M.; Eliades, D.; Polycarpou, M. LeakDB: A Benchmark Dataset for Leakage Diagnosis in Water Distribution Networks. In Proceedings of the WDSA/CCWI Joint Conference Proceedings, Kingston, ON, Canada, 23–25 July 2018; Volume 1. [Google Scholar]
  11. Saravanabalaji, M.; Sivakumaran, N.; Ranganthan, S.; Athappan, V. Acoustic Signal Based Water Leakage Detection System Using Hybrid Machine Learning Model. Urban Water J. 2023, 20, 1123–1139. [Google Scholar] [CrossRef] [Scilit]
  12. Wu, Y.P.; Ma, X.K.; Guo, G.C.; Huang, Y.J.; Liu, M.Y.; Liu, S.M.; Zhang, J.; Fan, J.J. Hybrid Method for Enhancing Acoustic Leak Detection in Water Distribution Systems: Integration of Handcrafted Features and Deep Learning Approaches. Process Saf. Environ. Prot. 2023, 177, 1366–1376. [Google Scholar] [CrossRef] [Scilit]
  13. Tsai, Y.L.; Chang, H.C.; Lin, S.N.; Chiou, A.H.; Lee, T.L. Using Convolutional Neural Networks in the Development of a Water Pipe Leakage and Location Identification System. Appl. Sci. 2022, 12, 8034. [Google Scholar] [CrossRef] [Scilit]
  14. Choudhary, P.; Botre, B.A.; Akbar, S.A. 1-D Convolution Neural Network Based Leak Detection, Location and Size Estimation in Smart Water Grid. Urban Water J. 2023, 20, 341–351. [Google Scholar] [CrossRef] [Scilit]
  15. Gunatilake, A.; Miro, J.V. Multimodel Neural Network for Live Classification of Water Pipe Leaks From Vibro-Acoustic Signals. IEEE Sens. J. 2024, 24, 14825–14832. [Google Scholar] [CrossRef] [Scilit]
  16. Liu, R.S.; Zayed, T.; Xiao, R. Advanced Acoustic Leak Detection in Water Distribution Networks Using Integrated Generative Model. Water Res. 2024, 254, 121434. [Google Scholar] [CrossRef] [Scilit]
  17. Reshadi, M.; Li, W.; Xu, W.J.; Omashor, P.; Dinh, A.; Dick, S.; She, Y.T.; Lipsett, M. Deep-Shallow Metaclassifier with Synthetic Minority Oversampling for Anomaly Detection in a Time Series. Algorithms 2024, 17, 114. [Google Scholar] [CrossRef] [Scilit]
  18. Rajasekaran, U.; Kothandaraman, M. A Novel Custom One-Dimensional Time-Series DenseNet for Water Pipeline Leak Detection and Localization Using Acousto-Optic Sensor. IEEE Access 2024, 12, 7966–7973. [Google Scholar] [CrossRef] [Scilit]
  19. Glomb, P.; Cholewa, M.; Koral, W.; Madej, A.; Romaszewski, M. Detection of Emergent Leaks Using Machine Learning Approaches. Water Suppl. 2023, 23, 2370–2386. [Google Scholar] [CrossRef] [Scilit]
  20. Gemeinhardt, H.; Sharma, J. Machine-Learning-Assisted Leak Detection Using Distributed Temperature and Acoustic Sensors. IEEE Sens. J. 2024, 24, 1520–1531. [Google Scholar] [CrossRef] [Scilit]
  21. Tabjula, J.; Sharma, J. Comparison of DAS and FBG Sensitivity for Detecting and Quantifying Small Pipeline Leaks. In Proceedings of the Optical Waveguide and Laser Sensors II; Sanders, G.A., Lieberman, R.A., Udd Scheel, I., Eds.; SPIE: Orlando, FL, USA, 2023; p. 20. [Google Scholar] [CrossRef] [Scilit]
  22. Aghashahi, M.; Sela, L.; Banks, M.K. Benchmarking Dataset for Leak Detection and Localization in Water Distribution Systems. Data Brief 2023, 48, 109148. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  23. Liu, F.; Wang, D.; Tang, J.; Wang, L. Frequency-Informed Transformer for Real-Time Water Pipeline Leak Detection. Auton. Intell. Syst. 2025, 5, 11. [Google Scholar] [CrossRef] [Scilit]
  24. Mahdi, N.M.; Jassim, A.H.; Abulqasim, S.A.; Basem, A.; Ogaili, A.A.F.; Al-Haddad, L.A. Leak Detection and Localization in Water Distribution Systems Using Advanced Feature Analysis and an Artificial Neural Network. Desalin. Water Treat. 2024, 320, 100685. [Google Scholar] [CrossRef] [Scilit]
  25. Martinez-Ríos, E.A.; Barrientos, D.; Bustamante, R. Water Leakage Classification With Acceleration, Pressure, and Acoustic Data: Leveraging the Wavelet Scattering Transform, Unimodal Classifiers, and Late Fusion. IEEE Access 2024, 12, 84923–84951. [Google Scholar] [CrossRef] [Scilit]
  26. Leonzio, D.U.; Mandelli, S.; Bestagini, P.; Marcon, M.; Tubaro, S. Water Leak Detection and Classification With Complex-Valued Neural Networks and Sensor Fusion. IEEE Access 2025, 13, 115669–115685. [Google Scholar] [CrossRef] [Scilit]
  27. Sabbatini, L.; Esposito, M.; Belli, A.; Pierleoni, P. Comparison of Signal Pre-processing and Machine Learning Modelling for Water-leak Detection Using Vibration and Pressure Data. In Proceedings of the 2024 International Conference on Software, Telecommunications and Computer Networks (SoftCOM), Split, Croatia, 26–28 September 2024; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
  28. Ghasheem, H.W.A.A. Comprehensive Framework for Leak Detection in Water Distribution Systems: A Vibration Signal Processing and Machine Learning Approach. Al-Iraqia J. Sci. Eng. Res. 2025, 4, 1–12. [Google Scholar] [CrossRef] [Scilit]
  29. Leonzio, D.U.; Bestagini, P.; Marcon, M.; Quarta, G.P.; Tubaro, S. Water Leak Detection and Classification Using Multiple Sensors. In Proceedings of the 2024 IFIP Networking Conference (IFIP Networking), Thessaloniki, Greece, 3–6 June 2024; pp. 690–695. [Google Scholar] [CrossRef] [Scilit]
  30. Jweri, A.R.K.; Al-Haddad, L.A.; Ogaili, A.A.F.; Jaber, A.A.; Al-Karkhi, M.I. Edge-Intelligent Leak Detection in Water Distribution Systems Using CatBoost: A Sustainable Solution for Reducing Infrastructure Losses. Clean Energy Sci. Technol. 2025, 3, 398. [Google Scholar] [CrossRef] [Scilit]
  31. Andreux, M.; Angles, T.; Exarchakis, G.; Leonarduzzi, R.; Rochette, G.; Thiry, L.; Zarka, J.; Mallat, S.; Andén, J.; Belilovsky, E.; et al. Kymatio: Scattering Transforms in Python. J. Mach. Learn. Res. 2020, 21, 1–6. [Google Scholar]
  32. Mallat, S. Group Invariant Scattering. Commun. Pure Appl. Math. 2012, 65, 1331–1398. [Google Scholar] [CrossRef] [Scilit]
  33. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention Is All You Need. In Proceedings of the 31st Conference on Neural Information Processing System, Long Beach, CA, USA, 4–9 December 2017; Curran Associates, Inc.: Red Hook, NY, USA, 2017; Volume 30. [Google Scholar]
  34. Ullah, S.; Ullah, N.; Siddique, M.F.; Ahmad, Z.; Kim, J.M. Spatio-Temporal Feature Extraction for Pipeline Leak Detection in Smart Cities Using Acoustic Emission Signals: A One-Dimensional Hybrid Convolutional Neural Network–Long Short-Term Memory Approach. Appl. Sci. 2024, 14, 10339. [Google Scholar] [CrossRef] [Scilit]
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.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.