Original Research
Frontiers in Acoustics ·
Volume 4 - 2026 | https://doi.org/10.3389/facou.2026.1840924
Research on leakage detection and location method of natural gas pipeline under strong noise condition
- Yifei Gao1*corresponding author
- Huiying Zhang1
- School of Oil and Gas Engineering, Southwest Petroleum University, Chengdu, China
Abstract
Under strong-noise conditions, accurate leak localization in natural gas pipelines remains a considerable challenge. Conventional methods commonly suffer from insufficient feature extraction capability, weak noise resistance, and unstable localization performance. To address these issues, this study focuses on precise localization after leakage occurrence. Instead of conducting a separate binary leakage/no-leakage detection task, the research objective is defined as leak interval classification and continuous leak location regression.In this study, an experimental platform integrating leakage signal acquisition, storage, and processing was established, and a pipeline leakage signal dataset under strong-noise conditions was constructed. For the leak interval classification task, a Multi-Channel Hybrid Self-Attention Convolutional Neural Network (MCSA) was proposed. The model consists of a feature extraction module, an adaptive feature selection module, a multi-path mechanism, and a Softmax classifier. By integrating multi-channel feature extraction with a channel-spatial attention mechanism, the model adaptively enhances informative leakage features while suppressing noise interference. For the continuous leak location regression task, a convolutional neural network incorporating a Multi-level Cascaded Residual Mixed Attention mechanism (MCR-MA) was further proposed to enhance the representation of complex leakage features and improve model robustness and generalization capability.The experimental results show that, under strong-noise conditions, the MCSA model achieves an average classification accuracy of 99.2%, demonstrating strong leak interval identification capability and good noise robustness. The MCR-MA model achieves an average localization accuracy of 98.75% in the continuous leak location regression task, with an average bias of 0.0051 and an R 2 value close to 1, indicating a high degree of agreement between the predicted and actual leak locations.The proposed MCSA and MCR-MA models can achieve stable and accurate natural gas pipeline leak localization in complex strong-noise environments. The proposed method effectively improves leakage signal feature extraction capability and noise robustness, providing a technically promising solution for intelligent monitoring and safety warning of natural gas transmission pipelines.
Keywords
1 Introduction
Pipeline leak detection has long been a prominent topic of concern in both academia and industry. Many researchers have been engaged in this area over extended periods, aiming to improve the accuracy of leak detection. Through extensive, multifaceted studies, researchers have proposed a range of innovative models and methods; these efforts have substantially enriched the technical framework for pipeline leak detection and yielded notable research (Luong and Kim, 2020; Quy and Kim, 2021; Rai and Kim, 2021; Wang et al., 2017). Currently, existing pipeline leak detection approaches can be broadly classified into two categories: hardware-based physical detection methods, which use physical devices to directly detect and localize leaks; and software-based algorithmic detection methods, which leverage computational algorithms to analyze monitoring data and thus indirectly infer and pinpoint leak locations (Korlapati et al., 2022). Hardware-dependent detection methods primarily rely on various physical devices and sensors to identify leaks; these include techniques such as magnetic flux leakage detection (Hao et al., 2025), periodic inspections (Aromoye et al., 2025), cable testing (Fu et al., 2025), tracer application (Li et al., 2023) and ground-penetrating radar scanning (Ge et al., 2021). By contrast, software-dependent detection methods mainly utilize data analysis and algorithms, typically leveraging already installed sensors and data acquisition systems; examples include transient dynamic analysis (Yuan et al., 2025), neural network approaches (Sim et al., 2020), negative pressure fluctuation analysis (Han et al., 2023), and distributed optical fiber sensing (Duan et al., 2023). By comparison, software-dependent methods have become the focus of recent research in the field of leak detection due to their continuous monitoring capabilities, real-time data processing, and greater adaptability. Rail (Rai and Kim, 2021) proposed a pipeline leak detection method based on multiscale analysis, the Kolmogorov–Smirnov (K–S) test, and Gaussian mixture models (GMM). The approach trains a GMM using features extracted from acoustic emission signals and adopts the log of the model likelihood as the monitoring metric. Experimental results indicate that it surpasses methods such as SVM in both sensitivity for detecting leak aperture and real-time performance.
Deep convolutional neural networks (DCNNs) are neural network models widely applied in the field of deep learning. Through multiple layers of convolution and pooling operations, they can effectively extract features from data and possess strong representational and generalization capabilities. In recent years, numerous DCNN architectures have been proposed. For example, Zhou et al. (2021) proposed an approach that ensembles one-dimensional convolutional neural networks as base learners and performs ensemble optimization on the learned results to achieve pipeline leak detection and localization. Lee, (2022) analyzed the performance of SVM and other methods in the context of pipeline leak detection, demonstrating the effectiveness of CNN-based classifiers. However, such methods typically require complex models to improve accuracy. Lightweight networks can partially address this issue; the mainstream strategies fall into two categories: model-compression-based techniques and inherently lightweight network designs. The former compresses model structures using methods such as knowledge distillation (Kim et al., 2016), channel pruning (He et al., 2017), model quantization (Schieber et al., 2017), and low-rank decomposition (Peng et al., 2011), but it is difficult to trade off accuracy and efficiency. In contrast, lightweight architectures such as SqueezeNet (Iandola et al., 2016), MobileNetV3 (Howard et al., 2019), and ShuffleNetV2 (Zhang et al., 2018) substantially reduce parameter count and computational cost, thereby mitigating the aforementioned problems to some extent.
Currently, intelligent pipeline leak detection techniques grounded in deep learning theory have achieved notable progress. In 2018, Bae et al. (2018) used time-series acoustic data collected from microphone sensor nodes to extract trajectory-based image features. By representing leak-signal characteristics in both the time and frequency domains, they generated root-mean-square (RMS) pattern and frequency-pattern images and employed state-of-the-art residual networks for ensemble learning. In 2019, Yeo et al. (2019) proposed a pipeline leak detection technique based on deep autoencoders. By training deep autoencoders to learn representative features of the no-leak (normal) state, the method constructs a pipeline leak detection model in an unsupervised learning manner. In the same year, Zhou et al. (2019) proposed a leak-detection image-recognition method based on convolutional neural networks (CNNs), which effectively addresses the challenge of similar features across different leak locations. Images generated from reconstructed signals were used as inputs to an AlexNet model, enabling adaptive extraction of leak-signal characteristics. In 2021, Ning et al. (2021) combined spectral enhancement with convolutional neural networks to propose an improved CNN architecture (SE-CNN) for natural gas pipeline leak detection. The approach amplifies leak-related spectral components and suppresses background noise, automatically extracting leak features to enable reliable detection. In the same year, Zheng et al. (2021) presented a generative adversarial network (GAN) framework for leak detection and localization; composed of a generator and a discriminator, the framework was experimentally shown to be effective for estimating leak position, leak coefficient, and initiation time. In 2022, Spandonidis et al. (2022) employed an intelligent sensor system to implement two leak-detection approaches—one based on a two-dimensional convolutional neural network (2D-CNN) and the other on a long short-term memory (LSTM) autoencoder—providing supervised and unsupervised solutions for leak detection. Ahmad et al. (2022) applied continuous wavelet transform to time-series acoustic emission signals to generate acoustic images, which were then fed into a convolutional autoencoder and a CNN to extract discriminative features associated with leaks. Sun et al. (2023) proposed a hybrid deep-learning framework based on a parameter-optimized recurrent attention network to enhance the accuracy of natural gas pipeline leak detection. Attallah, (2023) presented a deep-learning pipeline that integrates multimodal data from infrared thermography and an array of seven metal-oxide semiconductor sensors. The pipeline employs three CNN models for feature extraction and incorporates a bidirectional long short-term memory (BiLSTM) model for gas detection. Two multi-channel data-fusion strategies were evaluated experimentally—intermediate fusion and multi-task fusion. In the intermediate fusion scheme, the spatial features extracted by each CNN are combined via discrete wavelet transform to yield a spectral–temporal representation. Karimanzira, (2023) proposed a hybrid autoencoder neural network that addresses data imbalance through unsupervised learning. The model incorporates spatial and temporal attention mechanisms to enhance leak localization. The approach first learns the expected behavior of the system and then detects leaks by identifying deviations from that expected behavior.
Although significant progress has been made in pipeline leak detection methods, many challenges remain in environments with strong noise interference. Many traditional hardware-based methods, such as magnetic flux leakage detection and ground-penetrating radar, perform well in controlled environments but often struggle to effectively differentiate between leak signals and background noise in industrial or urban settings with high levels of noise (Luong and Kim, 2020; Quy and Kim, 2021). Software-based algorithmic methods, such as neural networks and spectral analysis, have demonstrated some effectiveness in specific scenarios; however, noise interference still leads to false positives or missed detections (Rai and Kim, 2021; Wang et al., 2017). Moreover, existing methods often encounter issues related to signal fragmentation and distortion during feature extraction, which significantly increases the difficulty of leak localization (Korlapati et al., 2022). This problem is particularly pronounced in complex environments with overlapping signals, where leak signals are mixed with other operational noises or pressure fluctuations, making it difficult for current technologies to accurately separate and extract key features, thus affecting the accuracy of detection (Spandonidis et al., 2022). While deep convolutional neural networks (DCNNs) and other deep learning models possess strong feature extraction capabilities, they also require substantial computational resources, especially in high-noise environments, where the balance between real-time processing and accuracy remains a critical challenge (Zheng et al., 2021). Therefore, the limitations of current methods in high-noise environments urgently need to be addressed to improve the accuracy and reliability of leak detection.
Here, we develop a leak localization framework centered on a Multi-Channel Hybrid Self-Attention Convolutional Neural Network, specifically engineered to overcome the limitations of standard CNNs—including fragmented feature representation, suboptimal classification precision, and noise vulnerability—in high-interference scenarios. Our approach leverages multibranch feature fusion for enhanced signal characterization and incorporates a Channel-Spatial Attention (CSA) module to dynamically prioritize discriminative patterns while suppressing acoustic disturbances. Validated through controlled laboratory experiments involving rigorous noise injection, the proposed model achieved a classification accuracy of 99.2%, demonstrating a clear improvement over the benchmark models. This architecture provides a promising approach for robust leak localization in acoustically challenging environments.
2 Materials and methods
2.1 Experimental setup and data acquisition
2.1.1 Experimental setup for pipeline leakage under strong-noise conditions
In this study, the HD-II oil and gas pipeline experimental platform was used to acquire acoustic leakage signals. The system components included an air circuit control assembly, an outlet pressure sensor, an air compressor, an air storage tank, a control console, a water pump, a water circuit control assembly, a water storage tank, a microcomputer station, a pipeline, an inlet pressure sensor, a leakage valve, and a monitoring console. The total length of the pipeline network is 160 m, constructed with 304 stainless steel and a wall thickness of 4 mm and an outer diameter of 50 mm, ensuring the pipeline’s strength and corrosion resistance (Figure 1).

To effectively reduce the influence of vibration interference on the experimental results, vibration isolation treatment was applied to the connections between pipelines and between the pipelines and the ground, thereby minimizing the interference of external mechanical vibrations during the acquisition of leakage acoustic signals. In the experimental system, air regulated by an air compressor was used as the working medium inside the pipeline, and the internal pressure of the pipeline loop was maintained steadily at 0.5 MPa. The leakage orifice diameter was set to 0.5 mm to simulate small-orifice leakage conditions. The experimental data acquisition system consisted of both hardware and software components. The hardware mainly included piezoelectric sensors installed near the leakage valve and a data acquisition card, while the software system was developed based on the LabVIEW programming platform, enabling real-time acquisition, monitoring, and storage of leakage signals.
The experimental platform in this study was primarily designed to investigate the generation, propagation, and attenuation characteristics of acoustic leakage signals in gas pipelines under controllable conditions, rather than to fully reproduce all engineering boundary conditions of full-scale natural gas transmission pipelines. To improve the similarity between the experimental system and actual natural gas pipelines, this study mainly considered two aspects: the internal flow state of the pipeline and the formation mechanism of the leakage acoustic source. Accordingly, parameters such as the Mach number, Reynolds number, leakage pressure difference, and leakage orifice diameter were selected as similarity reference indicators. The measured Mach number in the experimental pipeline was approximately 0.04, and the Reynolds number was 1.32 × 105. In actual natural gas transmission pipelines, the Mach number is generally lower than 0.1, while the Reynolds number is commonly on the order of 105. Both conditions indicate turbulent flow. Therefore, from the perspective of internal flow characteristics, the experimental system can, to a certain extent, reflect the gas flow characteristics of actual natural gas transmission pipelines.
Meanwhile, according to the specifications of the laboratory air compressor and gas storage tank, the maximum operating pressure of the experimental system was 0.8 MPa. In this study, all pipeline leakage tests were conducted at an internal pressure of 0.5 MPa, which was not only within the safe and stable operating range of the experimental equipment but also sufficient for acoustic leakage signal testing in gas pipelines. In addition, the main strong noise sources during the experiments included vibration generated by the air compressor and noise from other related equipment. Such noise is characterized by large amplitude and a broad frequency range, and can, to some extent, simulate background noise interference in actual gas transmission pipeline operating environments. This provides an experimental basis for validating leakage signal identification methods under strong-noise conditions.
It should be noted that air was used as the working medium in this study mainly for reasons of experimental safety, operability, and repeatability. Compared with natural gas or methane-based gas mixtures, air differs in terms of sound speed, density, viscosity, and flow-induced noise characteristics, which may affect the propagation velocity, frequency distribution, and attenuation characteristics of leakage acoustic signals. Moreover, actual natural gas pipelines involve more complex factors, such as variations in gas composition, pipeline diameter, buried or above-ground boundary conditions, valve and support-structure noise, and compressor unit noise. Therefore, the experimental results of this study mainly reflect the fundamental variation characteristics of acoustic leakage signals in gas pipelines under idealized and controllable experimental conditions. For engineering applications, further correction and validation should be conducted by considering actual pipeline operating pressure, gas composition, and field boundary conditions. Future work may further carry out supplementary validation under different pressure levels, leakage orifice diameters, working media, and experimental platforms that more closely resemble field boundary conditions, so as to improve the engineering applicability of the conclusions.
2.1.2 Leakage signal acquisition under strong-noise conditions
In the laboratory, the piezoelectric acoustic sensor model LIT-PZT was used to capture the acoustic signals generated by pipeline leakage. This sensor model possesses the following characteristics, making it suitable for the experimental requirements. It has a sensitivity of 150 mV/Pa, a wide dynamic range of up to 108 dB (under pressures below 500 Pa), and a bandwidth ranging from 0.5 Hz to 300 Hz, with a measurable frequency range of 0.1 Hz–2 kHz. Additionally, the sensor can withstand a maximum static pressure of 2 MPa and a maximum pressurization rate of 0.1 MPa/s. Regarding operating voltage, the sensor requires a 12 V power supply and produces a signal amplitude of ±10 V. It is applicable in environments with gas and non-corrosive liquid media. Using this sensor, acoustic signals generated by the interaction between gas pressure fluctuations within the pipeline and the pipe wall can be effectively captured, as well as noise from the operation of the air compressor and surrounding environmental interference. These features make the LIT-PZT piezoelectric acoustic sensor an ideal choice for laboratory research on pipeline leakage detection (Figure 2).

The detection principle is as follows: when a pipeline leak occurs, there is a drop in internal pipeline pressure, generating an initial leakage signal at the leak point (Figure 3). These signals propagate as waves both upstream and downstream along the pipeline. By installing piezoelectric acoustic sensors upstream and downstream of the pipeline, signals from different leakage locations can be detected and captured. Due to the varying distances of the upstream and downstream sensors from the leak, there exists a difference in wave travel paths. Signal processing and analysis can be performed using classical algorithms and deep learning methods to accurately locate the leakage point. The experimental pipeline leakage device utilizes both water and air as media; in the experiment, air is used in the pipeline loop to simulate real gas transmission pipeline leaks. A piezoelectric acoustic sensor is installed at each end station of the pipeline to collect the original leakage signals. The two sensors are spaced 100 m apart, with a leakage point set every 10 m, resulting in data from ten distinct leakage locations.

2.2 Data preprocessing
In the experiment, the internal pipeline pressure was maintained at 0.5 MPa during each leakage event, and the leakage orifice diameter was fixed at 0.5 mm. The compressor was adjusted before each acquisition to ensure consistent leakage conditions for different tests. Under the same leakage point, the original strong-noise pipeline signals collected by the head-end and tail-end sensors under no-leakage and leakage states are shown in Figure 4. Owing to environmental interference and vibration induced by compressor operation, the acquired leakage signals contained considerable background noise. As a result, the effective leakage-related acoustic components were partially masked, which increased the difficulty of pipeline leakage detection and localization.

To quantitatively characterize the strong-noise condition, the raw signal-to-noise ratio (SNR) was calculated using the no-leakage signal as the background noise reference. The noise power was estimated from the signal collected under the no-leakage condition, while the leakage-related signal power was estimated from the difference between the leakage-state signal power and the background noise power. The raw SNR was calculated as follows (Equation 1):where P leak denotes the average power of the signal collected under the leakage condition, and P noise denotes the average power of the background noise collected under the no-leakage condition. This definition was used to quantitatively describe the strong-noise condition in the experiment.
SNR raw = 10 log 10 P leak − P noise P noise (1)
The acquired pipeline leakage signals were segmented into fixed-length samples before being fed into the model. Each sample consisted of 2000 consecutive sampling points extracted from the raw acoustic signal. The sample length was selected to preserve sufficient temporal information of the leakage acoustic signal while ensuring a uniform input size for the deep learning model.
To avoid ambiguity in the definition of the learning tasks, the learning tasks in this study are clarified as follows. Strictly speaking, leakage detection usually refers to a binary classification task that determines whether leakage exists. However, this study does not perform a separate binary leakage/no-leakage detection task. Although no-leakage and leakage signals are compared in Figure 4 to illustrate the signal differences under strong-noise conditions, the main focus of this study is leakage localization after leakage occurrence. Therefore, the leakage localization problem is further formulated as two related tasks: interval-based leakage location classification and continuous leakage location regression.
For the interval-based leakage location classification task, only leakage samples are used. The input is a 2000-point acoustic signal segment collected under leakage conditions, and the label is the leakage-location category corresponding to the leakage interval along the pipeline. In this study, the pipeline is divided into 10 leakage intervals, with one leakage point arranged every 10 m. Therefore, the classification task contains 10 leakage-location categories. This task is evaluated using classification metrics such as accuracy and the confusion matrix.
For the continuous leakage location regression task, the input is also the acoustic signal segment collected under leakage conditions, while the label is the actual leakage position or its normalized value along the pipeline. This task aims to estimate the leakage position as a continuous variable rather than assigning it only to a predefined interval. The regression performance is evaluated using metrics such as Bias and the coefficient of determination (R 2).
To avoid possible information leakage between the training, validation, and test sets, the raw continuous signals were first grouped according to the leakage location and acquisition run. Dataset partitioning was then performed at the recording/run level rather than by randomly assigning individual 2000-point segments. Therefore, samples extracted from the same continuous recording were assigned to only one subset and were not simultaneously included in the training, validation, and test sets. In addition, no overlapping signal segments were shared across different subsets. This strategy reduces the possibility that the model learns the background noise, compressor vibration, or sensor-specific patterns of a particular experimental run, thereby providing a more reliable evaluation of its generalization ability.
Z-score normalization was applied to the acoustic signal amplitudes to reduce the influence of amplitude-scale differences and improve the stability of model training. For a signal sample X, the normalized signal Xz is calculated as follows (Equation 2):where X is the original signal sample, μ is the mean value, and σ is the standard deviation. In this study, Z-score normalization was applied to the signal amplitude rather than to the leakage position label. The leakage position label was encoded separately according to the spatial interval of the leakage point along the pipeline.
X Z = X − μ σ (2)
The experimental setup included 10 leakage locations, with one leakage point arranged every 10 m along the pipeline. Each leakage location was treated as an independent localization category. For example, the [0–10] m interval represents the localization category corresponding to the first 10 m section of the pipeline, while the (Ge et al., 2021; YUAN et al.; Sim et al., 2020; Han et al., 2023; Duan et al., 2023; Zhou et al., 2021; Lee, 2022; Kim et al., 2016; He et al., 2017; Schieber et al., 2017; Peng et al., 2011) m interval represents the next 10 m section. The leakage position labels were represented using normalized location intervals from 0 to 1. These intervals were used only for leakage-location label encoding and should not be interpreted as Z-score-normalized signal values.
All samples were collected under the same nominal leakage condition, namely, an internal pipeline pressure of 0.5 MPa and a leakage orifice diameter of 0.5 mm. This setting ensured consistency in leakage flow conditions and allowed the model to focus on the propagation characteristics of leakage acoustic signals at different locations. The dataset was divided into training and validation sets at a ratio of 4:1. The detailed information of the training and validation samples is shown in Table 1. The independent test samples used for final performance evaluation were obtained from separate acquisition runs and were not involved in model training or hyperparameter adjustment.
TABLE 1. Experimental data.
| Leakage position | Normalized leakage-location label | Sample length | Number of training samples | Number of validation samples |
|---|---|---|---|---|
| [0–10]m | [0–0.1] | 2000 | 80 | 20 |
| [10–20]m | [0.1–0.2] | 2000 | 80 | 20 |
| [20–30]m | [0.2–0.3] | 2000 | 80 | 20 |
| — | — | — | — | — |
| [90–100]m | [0.9–1] | 2000 | 80 | 20 |
The role of the preprocessing strategy is reflected in the following two aspects:
- Reducing amplitude-scale differences: The acoustic signals collected from different leakage positions may be affected by propagation attenuation, sensor sensitivity, environmental interference, and local pipeline conditions, resulting in differences in their amplitude distributions. Therefore, Z-score normalization was applied to the signal amplitudes to transform each sample into a standardized form with zero mean and unit variance. This reduces the influence of amplitude-scale differences during model training and prevents the model from relying excessively on absolute amplitude variations.
- Clarifying leakage-location representation: The normalized intervals listed in Table 1, such as [0–0.1] and [0.1–0.2], are used only to represent the leakage-location labels along the pipeline. They are not the results of Z-score normalization. This label representation provides a unified description of different leakage sections and ensures that each leakage location can be clearly distinguished during model training and evaluation.
Unlike traditional signal denoising methods, no additional denoising operation was applied to the strong-noise signals before model input. The preprocessed dataset was directly fed into the deep learning model. Due to the different distances between the leakage point and the sensors installed at both ends of the pipeline, the same leakage signal arrives at the two sensors with a certain time delay. Meanwhile, the leakage acoustic signal undergoes energy attenuation during propagation, as illustrated in Figure 5.

These time-delay and attenuation characteristics provide important information for pipeline leakage localization and prediction. The proposed model extracts effective leakage-related features from strong-noise signals through its attention-based feature extraction and selection modules.
Since the primary sources of strong noise in the experiment were compressor-induced vibration and environmental noise, Gaussian white noise with signal-to-noise ratios of 4 dB, 8 dB, and 12 dB was added to the leakage signals recorded under strong-noise conditions to further evaluate the robustness of the proposed models under controlled broadband random disturbances. It should be noted that Gaussian white noise is an idealized noise form and cannot fully represent the complex non-Gaussian, transient, and frequency-dependent noise characteristics in practical industrial pipeline environments. Therefore, robustness tests under non-Gaussian impulsive noise, valve-operation noise, compressor transient noise, and field-measured industrial noise will be further conducted in future work.
2.3 Proposed method
2.3.1 Convolutional neural network
Convolutional Neural Networks (CNNs) are vital for processing sequential data like sensor signals, audio, and natural language. One-dimensional CNNs (1D-CNNs) are particularly effective in extracting local features from sequential data, such as pipeline leakage signals. The core components of CNNs include convolutional layers, activation layers, pooling layers, and fully connected layers, each crucial for feature extraction and classification tasks. The structure of the one-dimensional convolutional network is shown in Figure 6.

2.3.1.1 Convolutional layer
The convolutional layer is the core of the CNN and performs the majority of the computational tasks. It applies filters (kernels) to the input feature map, generating output feature maps and capturing local patterns within the data. The mathematical operation can be expressed as (Equation 3):Where: i , j denote the indices of the input and output feature maps, k is the index for the depth of the feature map, m , n represent the spatial indices of the filter, Filter is the kernel used for the convolution, Bias is the Bias term added after convolution.
Output i , j , k = ∑ m , n I nput i + m , j + n , k × Filter m , n + Bias (3)
The convolutional layer is responsible for capturing local patterns in the signal. In the presence of strong noise, it performs convolution operations with filters designed to extract leak-related features while suppressing high-frequency noise. This layer helps to maintain signal integrity, even when noise significantly distorts the original leakage signal.
2.3.1.2 Activation function
Activation functions introduce nonlinearity to the network. Common activation functions include:
ReLU, which is particularly effective in noisy environments (such as pipeline leakage detection) as it avoids the vanishing gradient problem.
The ReLU function is defined as (Equation 4):Where x is the input value.
ReLU x = max 0 , x (4)
2.3.1.3 Pooling layer
The pooling layer reduces the size of feature maps through downsampling, decreasing computational complexity and mitigating the risk of overfitting. Common pooling methods include max pooling (Figure 7a), which selects the maximum value within a sliding window, and average pooling (Figure 7b), which calculates the mean value within the window. By adjusting the stride, these operations effectively filter noise and redundant information from pipeline leakage signals, enhancing computational efficiency while preserving critical features.

The pooling layer reduces the size of feature maps by downsampling, which decreases computational complexity and helps avoid overfitting. The two common pooling operations are:
Max Pooling (Equation 5): Selects the maximum value in a sliding window.
Average Pooling (Equation 6): Computes the mean value within the window.
Mathematical definitions: Where N is the size of the pooling window.
Max Pooling : Max Pool i , j = max Input i , j , Input i + 1 , j , … (5)
Average Pooling : Avg Pool i , j = 1 N ∑ Input i , j (6)
2.3.1.4 Fully connected layer
The fully connected layer connects every neuron to all inputs from the previous layer. This allows the network to integrate global features and is crucial for tasks like classification. The output is typically passed through the softmax function for multi-class classification.
2.3.1.5 Softmax function (for multi-class classification)
The Softmax function transforms the raw output into a probability distribution, ensuring that all class probabilities sum to 1. It is defined as (Equation 7):Where: z i is the output for class i, The sum in the denominator runs over all classes j.
Softmax z i = e z i ∑ j e z j (7)
This architecture enables CNNs to effectively perform tasks like pipeline leakage detection by balancing feature extraction, noise suppression, and classification.
2.3.2 MCSA architecture
Traditional convolutional neural networks (CNNs) are susceptible to strong noise, which limits their ability to extract discriminative leakage features and reduces detection accuracy. To overcome this limitation, an MCSA-based pipeline leakage detection model is developed. As illustrated in Figure 8, the model comprises a multi-branch convolutional feature extraction module, a channel-spatial attention (CSA)-based adaptive feature selection module, and a classifier. Through the integration of multi-channel fusion, hybrid attention, and residual connections, the proposed model enhances critical leakage features and suppresses noise interference, thereby achieving robust and accurate leak detection under noisy conditions.

2.3.2.1 Feature extraction module
The feature extraction module consists of three consecutive convolutional layers and ReLU activation functions, responsible for extracting features from noisy signals and performing dimensionality reduction. This module emphasizes critical information while suppressing redundant data, thereby enhancing the model’s generalization capability and reducing the risk of overfitting, laying a solid foundation for subsequent feature processing.
2.3.2.2 Adaptive feature selection module
The adaptive feature selection module introduces CSA structure (Figure 9), combining SENet’s channel attention mechanism with spatial attention to enhance noise robustness and computational efficiency. SENet employs a squeeze-and-excitation operation to weight the importance of feature channels, strengthening leak-related features while attenuating noise interference; spatial attention evaluates the significance of spatial locations through convolution operations and a Sigmoid activation function. The CSA module integrates the outputs of both attention mechanisms to further optimize feature representation.

2.3.2.3 Multi-channel mechanism
The multi-channel mechanism (Figure 10) enhances the detection capability and robustness of key leakage features through three parallel pathways. The first pathway omits pooling operations to preserve detailed signal information; the second employs global average pooling (GAP) to capture global contextual features and improve noise resistance; the third utilizes global max pooling (GMP) to emphasize dominant features. After integrating with the CSA module, these three pathways aggregate features to form a comprehensive and robust feature set.

2.3.2.4 Softmax classifier
The classifier consists of pooling layers, fully connected layers, and a Softmax layer, used to output predictions of leakage locations. The model transforms the leak localization problem into a 10-class signal recognition task, optimizing performance via a cross-entropy loss function and backpropagation algorithm, and achieving precise localization under noisy conditions through probabilistic mapping. Through the aforementioned design, the MCSA model demonstrates excellent feature extraction capabilities and detection accuracy in noisy environments, providing effective technical support for pipeline leakage diagnosis.
2.3.3 MCR-MA model structure
Although the MCSA model achieves high detection accuracy, it still has room for improvement in localization stability. Therefore, this study further proposes the MCR-MA model to enhance localization performance under strong-noise conditions.
Figure 11 presents the overall architecture of the proposed multi-level cascaded residual mixed attention model. The model is composed of three main components, namely, a feature extraction module, a multi-level residual enhancement module, and a regressor. Specifically, the raw acoustic signals of pipeline leakage are first passed through the feature extraction module to achieve effective feature learning and dimensionality reduction. The resulting features are subsequently fed into a multi-level cascaded CSA module that incorporates both spatial and channel attention mechanisms, enabling fine-grained modulation and enhancement of leakage-related features and thereby strengthening the model’s representation capability for complex leakage patterns. Finally, the processed features are delivered to a regressor consisting of a global average pooling layer and a fully connected layer to generate the pipeline leakage detection results.

In traditional leak detection, the time difference between signals received by each sensor is used to estimate the location of the leak. This method primarily relies on the geometric layout of the sensor network and the differences in signal arrival times. To integrate this information, the MCR-MA model includes specialized layers designed to process time delay information and sensor location data.
The input of the MCR-MA model consists of two-channel acoustic signal segments collected by the upstream and downstream sensors. The model learns time-delay-related and attenuation-related features from the two-channel acoustic signals without using the true leakage location as an input. This positional information, along with the time delay values (calculated from the differences in signal arrival times at each sensor), is fed into the network. These data are then processed through a multi-branch network, allowing the model to simultaneously capture both spatial and temporal features of the leak signal, thereby optimizing localization accuracy.
2.3.4 Multi-scale residual module
Residual Network (ResNet) is a classical architecture designed to alleviate the problems of gradient vanishing and network degradation encountered in the training of deep neural networks. By introducing residual connections, ResNet establishes cross-layer information transmission pathways that facilitate efficient propagation of both features and gradients, thereby improving the trainability and performance of the model. The basic unit of ResNet is the Residual Block, as shown in Figure 12, which typically consists of multiple convolutional layers and an identity mapping branch. After undergoing nonlinear transformations, the input features are added element-wise to the output of the identity mapping branch to learn residual mappings, enabling deep networks to maintain strong optimization capability as network depth increases. On this basis, a multi-level residual block was further designed in this study, as illustrated in Figure 13, to enhance the stability and generalization capability of the model.


As shown in Figure 13, two major improvements were made to the original ResNet architecture in this study. First, three residual blocks were cascaded to construct a multilevel residual network, enabling progressive feature extraction and enhancing the representation capability and generalization performance of the model. Second, a CSA-based hybrid attention mechanism was incorporated into each basic residual block to adaptively model the importance of both channel-wise and spatial features, thereby emphasizing critical leakage-related information while suppressing noise interference.
The entire multi-level residual module performs feature extraction and fusion through four residual connections. Specifically, the input data X are first processed by the CSA module for feature extraction and then added to the original input. This procedure is subsequently repeated to accomplish multi-level residual propagation. Finally, the output of the third residual stage is fused with the initial input to generate the final output of the module. Owing to this design, the proposed model maintains strong pipeline leak detection performance even under strong-noise and complex operating conditions.
The multi-scale residual module is designed to address the varying characteristics of noise at different frequency levels. By capturing features across multiple scales, this module enhances the model’s ability to identify leak signals in both high and low-frequency noise environments. The residual connections ensure that critical information is preserved, even when noise distorts the signal at specific scales.
2.3.5 Regression layer
Linear regression is a classical and effective method for continuous variable prediction. In the pipeline leak detection task, the strong-noise leakage signals collected at different locations were first normalized, with the leakage position defined as the continuous prediction target and the sensor signal features used as the model input. On this basis, a linear regressor was constructed to achieve regression-based prediction of leakage at arbitrary positions along the pipeline, and the model performance was further evaluated using relevant regression metrics. The structure of the linear regressor adopted in the MCR-MA model is shown in Figure 14.

The pipeline signal features extracted by the multi-level residual module are first subjected to global average pooling for dimensionality reduction, so as to preserve critical information while compressing the feature representation. The resulting features are then flattened and fed into a fully connected layer. This fully connected layer consists of 64 neurons and employs the ReLU activation function to enhance high-level feature representation. Considering the strong linear relationship between the leakage location and the time difference of the received signals, a linear activation function is adopted in the output layer to perform regression-based prediction of the pipeline leakage results.
Although convolutional neural networks (CNNs), attention mechanisms, and residual structures have been widely used in related fields, the MCSA and MCR-MA methods proposed in this paper combine these three techniques in an organic way and are optimized for specific tasks. The MCSA method introduces adaptive convolution operations, enabling the network to automatically adjust the shape and size of convolution kernels based on the characteristics of the input data, thereby effectively capturing multi-scale information. Compared to the static convolution kernels in traditional CNN architectures, this method offers greater flexibility and adaptability, especially when handling multi-channel data. The MCR-MA method combines residual connections with attention mechanisms, and by introducing a dynamic attention module, it further optimizes feature selection and weight allocation, facilitating the flow of information and enhancing the ability to extract deep features. This not only improves the network’s performance in deep learning tasks but also provides stronger feature modeling capabilities compared to traditional residual networks or single attention mechanisms.
2.4 Evaluation metrics
2.4.1 Evaluation metrics for the MCSA model
MCSA and MCR-MA modules correspond to different leakage localization tasks. The MCSA module is designed for interval-based leakage location classification. Its output is a probability distribution over the predefined leakage-location categories, and the predicted category corresponds to the leakage interval along the pipeline. In this study, 10 leakage-location categories are defined according to the 10 leakage intervals listed in Table 1. In contrast, the MCR-MA module is designed for continuous leakage location regression, and its evaluation is based on regression metrics rather than classification accuracy alone. By distinguishing these two tasks, the proposed method can evaluate leakage localization from both coarse-grained interval classification and fine-grained continuous position estimation perspectives.
To comprehensively evaluate the interval-based leakage location classification performance of the MCSA model, this study employs multiple classification metrics, including Accuracy, Precision, Recall, and F1 score. Unlike binary leakage/no-leakage detection, the classification task in this study aims to identify the leakage-location category corresponding to each acoustic signal sample. Therefore, a correctly classified sample means that the predicted leakage-location category is consistent with the true leakage-location category.
Accuracy refers to the proportion of correctly classified samples among all tested samples. A high accuracy indicates that the MCSA model can effectively identify the leakage interval along the pipeline under strong-noise conditions. Precision measures the proportion of correctly classified samples among all samples predicted as a specific leakage-location category. A high precision indicates that the samples predicted as a certain leakage interval are generally reliable. Recall measures the proportion of correctly classified samples among all samples that actually belong to a specific leakage-location category. A high recall indicates that the model can effectively identify samples from that leakage interval with few missed classifications. The F1 score is the harmonic mean of Precision and Recall, which provides a balanced evaluation of classification reliability and completeness. The closer the F1 score is to 1, the better the classification performance of the model.
For the multi-class leakage-location classification task, the evaluation metrics are calculated as follows (Equations 8–10): where, TP denotes true positives, where instances are actually positive and correctly predicted as positive. TN represents true negatives, where instances are actually negative and correctly predicted as negative. FP indicates false positives, where instances are actually negative but incorrectly predicted as positive. FN refers to false negatives, where instances are actually positive but incorrectly predicted as negative.
A c c = T P + T N T P + F P + T N + F N × 100 % (8)
p = T P T P + F P × 100 % (9)
F 1 = 2 PR P + R × 100 % (10)
2.4.2 Evaluation metrics for the MCR-MA model
To comprehensively evaluate the predictive performance of the proposed multi-level cascaded residual pipeline continuous leakage location regression model, multiple regression evaluation metrics were employed for quantitative analysis in terms of both accuracy and robustness. The main metrics include: Where m denotes the number of samples, y i represents the predicted value of the i -th sample, y ^ i denotes the corresponding true value.
- Mean Squared Error (MSE), which is used to characterize the average squared difference between the predicted values and the true values. Its formulation is given as shown in Equation 11.
MSE = 1 m ∑ i = 1 m y i − y ^ i 2 (11)
- Root Mean Square Error (RMSE) is used to measure the overall magnitude of the error between the predicted values and the true values, and is defined as the square root of the mean of the squared errors. Since RMSE is more sensitive to large errors, it can effectively reflect the overall predictive performance of the model. Its formulation is given as shown in Equation 12.
RMSE = 1 m ∑ i = 1 m y i − y ^ i 2 (12)
- Mean Absolute Error (MAE) represents the average magnitude of the absolute error between the predicted values and the true values, and can be used to measure the overall prediction deviation of the model. Since it is relatively insensitive to outliers, MAE can provide a more robust characterization of the predictive performance of the model. Its formulation is given in Equation 13.
MAE = 1 m ∑ i = 1 m y i − y ^ i (13)
- R-squared (R 2) is used to measure the extent to which a regression model explains the variation in the dependent variable, and is an important indicator for evaluating model fitting performance. In general, the closer the R 2 value is to 1, the better the fitting performance and the stronger the explanatory power of the model; conversely, a value closer to 0 indicates that the model has limited ability to capture variations in the data. Its formulation is given as shown in Equation 14.
R 2 = 1 − ∑ i y ^ i − y i 2 ∑ i y ¯ i − y i 2 (14)
- Bias is used to characterize the degree of systematic deviation of the model predic-tions relative to the true values. A Bias value of 0 indicates that the model is free of systematic prediction error overall; a positive Bias indicates a tendency toward overestimation, whereas a negative Bias suggests a tendency toward underestimation.
3 Results and discussion
3.1 Validation of the MCSA model
The pipeline leakage detection process of the MCSA model encompasses three main stages: data processing, model training, and leakage-location category identification. The model is implemented using the Keras deep learning framework in Python, running on hardware equipped with an Intel(R) Core(TM) i5-8250U CPU @ 1.6 GHz. The specific steps are as follows:
- Preprocessing of Strong Noise Pipeline Leak Signals: The collected strong noise pipeline leak signals are sliced to ensure that each leak sample has a consistent length, containing 2000 data points. This process ensures the uniformity of the dataset and provides a standardized input format for subsequent model training. The input data from this step is passed through the input layer to the network, ensuring that each sample can be effectively processed by the following convolutional layers.
- Dataset Splitting and Labeling: The sliced data samples are divided into training and validation sets in a 4:1 ratio, with each sample labeled according to the leak point location. The labels are one-hot encoded to be used as target outputs for the model’s classification task. During training, the network evaluates the error between the output and the target through the loss function and adjusts based on this error, thus helping the model effectively learn the relationship between input features and labels.
- Inputting Data to the MCSA Model and Parameter Initialization: The prepared dataset is input into the MCSA model, where the model parameters, including the convolutional kernel size, pooling layers, loss function, learning rate, and batch size, are initialized. This step ensures that the model can begin learning effectively. The data is passed through the input layer to the convolutional layers, where convolutional kernels extract local features (such as amplitude changes and waveform) from the input signal. The feature maps are then passed to the pooling layers. The pooling layer performs max pooling to retain important features and reduce computational complexity.
- Forward and Backward Propagation Training: The MCSA model is trained using the training set. The samples are passed through the network via forward propagation to compute the model’s output, and weights and biases are updated via backward propagation to optimize the loss function and gradually reduce prediction errors.
Convolutional Layer: The convolutional layers extract local features from the input signal, identifying key information. Through multiple convolutional layers, the model progressively extracts higher-level features, enabling it to recognize complex leak patterns.
Pooling Layer: The pooling layers perform downsampling on the output from the convolutional layers, using max pooling to retain significant features, enhancing the model’s robustness, and reducing its sensitivity to minor positional variations and noise.
Fully Connected Layer: The flattened feature maps are passed to the fully connected layer, which integrates local features into global features through weighted summation, leading to the final classification decision.
- Training Termination and Optimal Model Saving: If the predefined training termination conditions (such as the specified number of iterations or required accuracy) are met, training is concluded and the optimal model parameters are saved. Otherwise, Step (3) is repeated to continue training until the conditions are met. This process ensures that the model converges and performs well on the validation set. During training, the cross-entropy loss function is used to assess the error between the model’s output and the actual labels, guiding the model’s parameter updates. The backpropagation algorithm computes the gradient of the loss function with respect to each layer’s parameters, and optimization algorithms (such as the Adam optimizer) adjust the model parameters accordingly.
- Pipeline Fault Detection and Model Diagnosis: The trained MCSA model was used to identify leakage-location categories on the validation/test set. The classifier outputs the predicted leakage-location category for each input sample, which is then used for performance evaluation. The model outputs diagnostic results via the classifier, which are then used for further analysis and evaluation, ultimately generating the leak location and classification information. After training, the model can perform forward propagation on input data to output diagnostic results for pipeline leaks.
3.2 Analysis of pipeline leakage detection based on the MCSA model
3.2.1 Training results of the MCSA model
During training, hyperparameters were continuously optimized until the model performance metrics reached their best values. The ReLU activation function was used in both the convolutional and fully connected layers throughout the training process, effectively mitigating the vanishing gradient problem and accelerating model convergence. The Adam optimizer was chosen along with a fixed decaying learning rate, offering good performance and convergence speed, enabling faster attainment of a local optimum. Key parameters at optimal training performance were (Equations 15–18):
r e d u c t i o n _ r a t i o = 16 (15)
e p o c h s = 200 (16)
b a t c h _ s i z e = 64 (17)
l e a r n i n g _ r a t e = 0.02 (18)
The model was trained for 200 epochs, with the accuracy and loss curves for the training and validation sets shown in Figure 15. The figure demonstrates that the proposed model converges rapidly without evident overfitting during training. At 33 epochs, both the training and validation accuracies reached 99%, while the loss function steadily decreased as training progressed. By 125 epochs, the model stabilized, and the training loss across the dataset became nearly smooth, approaching zero. The MCSA model attains a mean classification accuracy of 99.2% on the validation set. Experimental results indicate that the model can effectively identify leakage-location categories under strong-noise conditions.

3.2.2 Comparison of anti-noise performance
The proposed MCSA model was compared with commonly used benchmark models, including 1D-CNN, LSTM-CNN, and ResNet, in terms of interval-based pipeline leakage location classification performance. In the experiments, all models were evaluated using the same strong-noise pipeline leakage dataset, and the classification performance was assessed using Accuracy, Precision, Recall, and F1-score. The strong noise in the leakage signals mainly originated from compressor operation, environmental interference, and pipeline vibration during data acquisition.
To further evaluate the robustness of different models under additional noise interference, Gaussian white noise with signal-to-noise ratios of 12 dB, 8 dB, and 4 dB was added to the leakage signals collected under the original strong-noise condition. A lower SNR indicates stronger noise interference. To reduce the uncertainty caused by a single training run, each model was independently trained five times with different random seeds under the same dataset partitioning strategy and training parameters. The final results are reported as the mean ± standard deviation over five independent runs, as shown in Table 2.
TABLE 2. Performance comparison between MCSA and benchmark models under different noise conditions over five independent runs.
| Model | SNR condition | Accuracy | Precision | Recall | F1-score |
|---|---|---|---|---|---|
| 1D-CNN | Original | 0.855 ± 0.009 | 0.874 ± 0.010 | 0.855 ± 0.009 | 0.857 ± 0.009 |
| 12 | 0.725 ± 0.011 | 0.767 ± 0.012 | 0.725 ± 0.011 | 0.699 ± 0.013 | |
| 8 | 0.715 ± 0.012 | 0.732 ± 0.014 | 0.715 ± 0.012 | 0.699 ± 0.014 | |
| 4 | 0.605 ± 0.015 | 0.609 ± 0.016 | 0.605 ± 0.015 | 0.588 ± 0.017 | |
| LSTM-CNN | Original | 0.915 ± 0.007 | 0.953 ± 0.006 | 0.915 ± 0.007 | 0.889 ± 0.008 |
| 12 | 0.895 ± 0.008 | 0.899 ± 0.009 | 0.895 ± 0.008 | 0.894 ± 0.008 | |
| 8 | 0.760 ± 0.011 | 0.703 ± 0.013 | 0.760 ± 0.011 | 0.714 ± 0.012 | |
| 4 | 0.725 ± 0.013 | 0.646 ± 0.015 | 0.725 ± 0.013 | 0.664 ± 0.014 | |
| ResNet | Original | 0.875 ± 0.007 | 0.881 ± 0.008 | 0.875 ± 0.007 | 0.875 ± 0.007 |
| 12 | 0.835 ± 0.008 | 0.836 ± 0.009 | 0.835 ± 0.008 | 0.830 ± 0.009 | |
| 8 | 0.825 ± 0.009 | 0.829 ± 0.010 | 0.825 ± 0.009 | 0.821 ± 0.010 | |
| 4 | 0.745 ± 0.012 | 0.774 ± 0.012 | 0.745 ± 0.012 | 0.737 ± 0.013 | |
| MCSA | Original | 0.992 ± 0.002 | 0.994 ± 0.002 | 0.992 ± 0.002 | 0.992 ± 0.002 |
| 12 | 0.975 ± 0.003 | 0.978 ± 0.003 | 0.975 ± 0.003 | 0.975 ± 0.003 | |
| 8 | 0.965 ± 0.005 | 0.967 ± 0.004 | 0.965 ± 0.005 | 0.965 ± 0.005 | |
| 4 | 0.950 ± 0.008 | 0.952 ± 0.007 | 0.950 ± 0.008 | 0.944 ± 0.008 |
As shown in Table 2, under the original strong-noise condition without additional Gaussian white noise, the classification accuracies of 1D-CNN, LSTM-CNN, and ResNet were 85.5%, 91.5%, and 87.5%, respectively, whereas the proposed MCSA, model achieved the highest accuracy of 99.2%. In addition, the Precision, Recall, and F1-score of the MCSA, model all exceeded 99%, indicating that the proposed model can effectively identify leakage-location categories under strong-noise conditions.
To more intuitively compare the noise robustness of different models, the classification metrics of each model under the original strong-noise condition and additional Gaussian white-noise conditions are illustrated in Figure 16. The four subfigures correspond to the original strong-noise data, SNR = 12 dB, SNR = 8 dB, and SNR = 4 dB, respectively. A lower SNR indicates stronger additional noise interference. The standard deviations over five independent runs are reported in Table 2.

As shown in Figure 16, under the original strong-noise condition, the MCSA model achieved the best classification performance among all compared models. Its Accuracy, Precision, Recall, and F1-score were all close to or higher than 0.99, indicating that the proposed model can effectively identify different leakage-location categories under strong-noise conditions.
After additional Gaussian white noise was introduced, the performance of the benchmark models showed obvious degradation or fluctuation under different SNR levels. In particular, 1D-CNN and LSTM-CNN were more sensitive to noise interference, and their classification metrics decreased noticeably under stronger noise conditions. ResNet showed better robustness than 1D-CNN and LSTM-CNN, but its overall performance was still lower than that of the proposed MCSA model.
In contrast, the MCSA model maintained relatively high Accuracy, Precision, Recall, and F1-score under all additional noise conditions. Even under the low-SNR condition of 4 dB, the performance indicators of MCSA remained at a high level, demonstrating its stronger robustness against broadband random noise interference. This improvement can be attributed to the multi-channel feature extraction structure and the channel-spatial attention mechanism, which enhance leakage-related features while suppressing noise and redundant information.
Overall, Figure 16 further confirms that the proposed MCSA model has better stability and noise robustness than the benchmark models in the interval-based pipeline leakage location classification task under strong-noise conditions.
To further analyze the classification performance of the MCSA model at different leakage-location intervals, a normalized confusion matrix was added, as shown in Figure 17. The confusion matrix provides a more detailed visualization of the classification results for each leakage-location category.

As shown in Figure 17, most samples were correctly classified into their corresponding leakage-location intervals. The few misclassified samples were mainly concentrated in adjacent leakage intervals, which may be attributed to the similarity of acoustic features between neighboring leakage positions under strong-noise conditions rather than random misclassification across distant locations. This indicates that the model is more likely to confuse neighboring leakage-location categories, especially when their acoustic features become similar under strong-noise conditions.
Overall, the results in Table 2 and Figures 16, 17 demonstrate that the proposed MCSA model achieves high classification accuracy, stable repeated-training performance, strong noise robustness, and good interpretability for interval-based pipeline leakage location classification under strong-noise conditions.
3.2.3 Ablation study of module design
The MCSA model consists of three main modules: the feature extraction module I (FE) composed of multiple one-dimensional convolutional layers, the adaptive feature selection module II (ASF), and the classifier module III. The ASF module is further composed of the multi-path mechanism and the CSA attention mechanism, which are designed to enhance multi-scale feature representation and suppress noise interference. To further investigate the contribution of each key component in the MCSA model to the interval-based pipeline leakage location classification task, a more complete ablation study was conducted. Four model variants were compared, including FE + Classifier, FE + CSA + Classifier, FE + Multi-path + Classifier, and FE + ASF + Classifier. The ablation results are presented in Table 3.
TABLE 3. Ablation results of different modules in the MCSA model.
| Index | FE + Classifier | FE + CSA + Classifier | FE + Multi-path + Classifier | FE + ASF + Classifier |
|---|---|---|---|---|
| Accuracy | 0.855 | 0.931 | 0.918 | 0.992 |
| Precision | 0.874 | 0.942 | 0.929 | 0.994 |
| Recall | 0.855 | 0.931 | 0.918 | 0.992 |
| F1-score | 0.857 | 0.933 | 0.920 | 0.992 |
As shown in Table 3, when only the FE module and the classifier were used, the Accuracy, Precision, Recall, and F1-score were 85.5%, 87.4%, 85.5%, and 85.7%, respectively. After introducing the CSA attention mechanism alone, the four metrics increased to 93.1%, 94.2%, 93.1%, and 93.3%, respectively. This indicates that the CSA attention mechanism can effectively enhance leakage-related features and suppress irrelevant noise components. When the multi-path mechanism was introduced independently, the Accuracy, Precision, Recall, and F1-score increased to 91.8%, 92.9%, 91.8%, and 92.0%, respectively, demonstrating that the multi-path structure is beneficial for extracting leakage features at different receptive fields and feature scales.
When both the CSA attention mechanism and the multi-path mechanism were incorporated into the ASF module, the complete FE + ASF + Classifier model achieved the best performance, with Accuracy, Precision, Recall, and F1-score reaching 99.2%, 99.4%, 99.2%, and 99.2%, respectively. Compared with the baseline FE + Classifier model, these metrics increased by 13.7, 12.0, 13.7, and 13.5 percentage points, respectively. The results demonstrate that both the CSA attention mechanism and the multi-path mechanism contribute positively to the classification performance, and their combination in the ASF module provides complementary advantages for improving leakage location classification accuracy and noise robustness under strong-noise conditions.
3.3 Leakage localization performance of the MCR-MA model
3.3.1 Leakage localization results of the MCR-MA model
The detailed network layers and main attributes of the model are listed in Table 4. When the Adam learning rate was set to 0.002, the batch size to 32, and the reduction ratio to 16, the model achieved its optimal performance. The accuracy and loss curves of the training and validation sets are shown in Figure 18. As the number of training epochs increased, the model accuracy gradually improved while the loss continuously decreased, indicating a fast convergence rate without obvious overfitting. After approximately 65 epochs, the model essentially converged, with the validation accuracy remaining stable above 98% and the loss approaching a steady state close to 0. The average accuracy reached 98.75%.
TABLE 4. Network layers and main attributes of the model.
| Layer | Type | OutputShape | Parameters | Description |
|---|---|---|---|---|
| InputLayer | Input layer | (None, 1900, 2) | 0 | Input data |
| Conv1D | Convolution | (None, 1900, 16) | 112 | Feature extraction |
| GlobalAveragePooling1D | Pooling | (None, 16) | 0 | Global average pooling |
| Dense | Fully connected | (None, 1) | 16 | Linear transformation |
| Conv1D_1 | Convolution | (None, 1900, 1) | 16 | Further feature extraction |
| Multiply | Multiplication | (None, 1900, 16) | 0 | Feature fusion |
| Add | Addition | (None, 1900, 16) | 0 | Connecting convolution and multiplication layers |
| Dense_6 | Fully connected | (None, 64) | 1,088 | Enhance model expressiveness |
| Dense_7 | Output layer | (None, 1) | 64 | Final prediction |

Figure 19 presents the variation in the deviation between the predicted values and the ground truth for both the training and validation sets. It can be observed that the deviation on the training set was approximately 0, whereas the deviation on the validation set remained below 0.005 with only slight fluctuations. The average deviation was 0.0051. These results demonstrate that the proposed model exhibits high predictive accuracy, favorable convergence characteristics, and strong robustness.

3.3.2 Comparative analysis of the MCR-MA model
To further evaluate the performance and stability of the proposed MCR-MA model, a comparative analysis was conducted against 1D-CNN, LSTM, ResNet, L-ResNet, and the MCSA model. To reduce the uncertainty caused by a single training run, each model was independently trained five times with different random seeds under the same dataset partitioning strategy and training parameters. The final results are reported as the mean ± standard deviation over five independent runs, as shown in Table 5.
TABLE 5. Comparison of performance metrics across different models over five independent runs.
| Model | Accuracy | MSE | RMSE | MAE | R 2 | Bias |
|---|---|---|---|---|---|---|
| 1D-CNN | 0.8552 ± 0.0091 | 0.2736 ± 0.0158 | 0.5231 ± 0.0152 | 0.4293 ± 0.0127 | 0.9677 ± 0.0022 | 0.2598 ± 0.0114 |
| LSTM | 0.8956 ± 0.0078 | 0.2629 ± 0.0136 | 0.5127 ± 0.0134 | 0.4268 ± 0.0119 | 0.9691 ± 0.0019 | 0.1933 ± 0.0096 |
| ResNet | 0.8755 ± 0.0069 | 0.0397 ± 0.0031 | 0.1992 ± 0.0076 | 0.1744 ± 0.0063 | 0.9945 ± 0.0005 | 0.1636 ± 0.0058 |
| L-ResNet | 0.9502 ± 0.0048 | 0.0037 ± 0.0005 | 0.0609 ± 0.0039 | 0.0481 ± 0.0032 | 0.9995 ± 0.0001 | 0.0319 ± 0.0022 |
| MCSA | 0.9920 ± 0.0024 | 0.0016 ± 0.0002 | 0.0402 ± 0.0026 | 0.0322 ± 0.0021 | 0.9997 ± 0.0001 | 0.0088 ± 0.0009 |
| MCR-MA | 0.9875 ± 0.0021 | 0.0004 ± 0.0001 | 0.0207 ± 0.0019 | 0.0165 ± 0.0014 | 0.9999 ± 0.0001 | 0.0051 ± 0.0006 |
For comparison with regression-based models, the predicted leakage interval of the MCSA model was converted into the corresponding normalized leakage-location value.
As shown in Table 5, the MCR-MA model achieved an average localization accuracy of 98.75% ± 0.21%. Compared with 1D-CNN, LSTM, ResNet, and L-ResNet, the localization accuracy increased by 13.23, 9.19, 11.20, and 3.73 percentage points, respectively. Although the average accuracy of MCR-MA was slightly lower than that of MCSA by 0.45 percentage points, MCR-MA achieved better performance in terms of regression-related error metrics, indicating stronger continuous leakage location estimation ability.
For the error metrics, the MCR-MA model achieved the lowest MSE, RMSE, and MAE values among all compared models. Specifically, the MSE, RMSE, and MAE of MCR-MA were 0.0004 ± 0.0001, 0.0207 ± 0.0019, and 0.0165 ± 0.0014, respectively. These results indicate that the multilevel cascaded residual mixed-attention mechanism can effectively improve the fitting accuracy of leakage location regression and reduce prediction errors. In addition, the R 2 value of MCR-MA reached 0.9999 ± 0.0001, which was the closest to one among all compared models, demonstrating its superior fitting performance and generalization ability for pipeline leakage localization data.
The MCR-MA model also achieved the lowest mean Bias, with a value of 0.0051 ± 0.0006. For a 160 m pipeline, this corresponds to an average localization offset of approximately 0.816 ± 0.096 m. Compared with the other baseline models, the normalized Bias of MCR-MA was lower by 0.2547, 0.1882, 0.1585, and 0.0268 than those of 1D-CNN, LSTM, ResNet, and L-ResNet, respectively. This result further indicates that the MCR-MA model has stronger error suppression ability and better localization stability.
To further evaluate the engineering interpretability of the regression results, the absolute localization error was calculated as follows:where y ^ i and y i denote the predicted and true normalized leakage locations, respectively, and L denotes the total pipeline length. In this study, L was 160 m.
e i = y ^ i − y i × L (20)
To further analyze the error distribution of the MCR-MA model at different leakage positions, the absolute localization errors were visualized using a boxplot, as shown in Figure 20. The horizontal axis represents different leakage positions, and the vertical axis represents the absolute localization error in meters. Compared with only reporting the average error, the boxplot provides a more intuitive description of the error dispersion and position-dependent localization stability.

As shown in Figure 20, the median localization errors at most leakage positions are relatively small, and the interquartile ranges are narrow, indicating that the MCR-MA model maintains stable localization performance across different leakage positions. The localization errors are mainly concentrated within approximately 0.5–1.2 m, and no large-scale error fluctuation is observed. This result further supports the reliability of the proposed model for continuous leakage location regression.
It can also be observed that the errors at P7 and P9 are slightly larger than those at other leakage positions. This may be related to signal propagation attenuation, stronger background noise interference, and the similarity of leakage acoustic features between neighboring positions. Nevertheless, the overall error distribution remains within a relatively small range, demonstrating that the MCR-MA model has good localization stability and engineering applicability under strong-noise conditions.
Overall, although the MCR-MA model was slightly lower than the MCSA model in terms of average localization accuracy, it demonstrated more pronounced advantages in error suppression, regression fitting, and localization stability. The repeated experimental results and error distribution analysis further verify that the proposed MCR-MA model has strong robustness and practical potential for continuous pipeline leakage localization under strong-noise conditions.
4 Conclusion
This study systematically investigated gas pipeline leak localization under strong-noise conditions through experimental platform development, dataset construction, and model design. The main conclusions are as follows:
- For interval-based leak location classification, an MCSA model was proposed to improve classification accuracy and noise robustness under strong-noise conditions. By integrating multi-branch feature extraction, a channel-spatial attention mechanism, and an adaptive feature selection structure, the model enhanced leakage-related features while suppressing noise interference. Experimental results showed that the MCSA model achieved high classification accuracy under the original strong-noise condition and maintained stable performance under additional Gaussian white-noise disturbances, demonstrating strong robustness for leakage-location interval classification.
- For continuous leak location regression, an MCR-MA model was proposed to improve localization accuracy and stability. By combining a mixed attention mechanism with a multi-level cascaded residual structure, the model strengthened the extraction of complex leakage features and improved regression fitting performance. Experimental results showed that the MCR-MA model achieved a high localization accuracy, a low Bias of 0.0051 ± 0.0006, and an R 2 value of 0.9999 ± 0.0001. For a 160 m pipeline, the corresponding average localization offset was approximately 0.816 ± 0.096 m, indicating good localization stability and engineering applicability under strong-noise conditions.
5 Limitations and future work
Although the proposed models achieved good performance on the controlled laboratory platform, several limitations remain.
First, the current experimental platform cannot fully reproduce the gas composition, pressure range, pipe diameter scale, boundary conditions, and complex operational noise of field natural gas pipelines. Future work will further validate the proposed methods using field-measured data and more realistic experimental platforms.
Second, although the raw SNR was introduced to quantitatively characterize the strong-noise condition, detailed spectral and time-frequency analyses of the original industrial noise were not conducted in this study due to the current limitations of the experimental dataset and testing conditions. Future work will further analyze the spectral and time-frequency characteristics of field-measured industrial noise to provide a more comprehensive description of practical noise environments.
Third, Gaussian white noise was used in this study to evaluate model robustness under controlled broadband random disturbances. However, Gaussian white noise cannot fully represent non-Gaussian, transient, and frequency-dependent industrial noise. In addition, robustness tests under T-type impulsive noise were not further conducted in this study due to the current limitations of the testing conditions. Future work will further evaluate the proposed methods under T-type impulsive noise, non-Gaussian impulsive noise, valve-operation noise, compressor transient noise, and field-measured industrial noise conditions.
Fourth, the current models were validated mainly under fixed pressure and leakage orifice conditions. Future studies will consider different operating pressures, leakage orifice diameters, working media, and lightweight model deployment for real-time edge applications.
Generative AI statement
The author(s) declared that generative AI was not used in the creation of this manuscript.
Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.
Publisher’s note
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.
Footnotes
Edited by: Sebastian Oberst, University of Technology Sydney, Australia
Reviewed by: Faisal Saleem, University of Ulsan, Republic of Korea
Shuo Wang, Tianjin University of Technology, China
Statements
- Conflict of interest
The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
- Funding
The author(s) declared that financial support was not received for this work and/or its publication.
- Data availability
The original contributions presented in the study are included in the article/supplementary material, further inquiries can be directed to the corresponding author.
- Author contributions
YG: Conceptualization, Investigation, Software, Writing – original draft, Writing – review and editing. HZ: Data curation, Formal Analysis, Methodology, Validation, Writing – original draft, Writing – review and editing.
References
- Ahmad S., Ahmad Z., Kim C.-H., Kim J.-M. (2022). A method for pipeline leak detection based on Acoustic imaging and deep learning. Sensors 22, 1562. doi:10.3390/s22041562
- Aromoye I. A., Lo H. H., Sebastian P., Abro G. E. M., Ayinla S. L. (2025). Significant advancements in UAV technology for reliable oil and gas pipeline monitoring. Comput. Model. Eng. Sci. 142 (2), 1155. doi:10.32604/cmes.2025.058598
- Attallah O. (2023). Multitask deep learning-based pipeline for gas leakage detection via E-Nose and thermal imaging multi-modal fusion. Chemosensors 11, 364. doi:10.3390/chemosensors11070364
- Bae J.-H., Yeo D., Yoon D.-B., Oh S. W., Kim G. J., Kim N.-S. (2018). “ Deep-learning-based pipe leak detection using image-based leak features,” in Proceedings of the 2018 25th IEEE International Conference on Image Processing, ICIP, 2361 – 2365.
- Duan Y., Liang L., Tong X., Luo B., Cheng B. (2023). Application of pipeline leakage detection based on distributed optical fiber acoustic sensor system and convolutional neural network. J. Phys. D. Appl. Phys. 57, 105102. doi:10.1088/1361-6463/ad1144
- Fu S., Zhang D., Luo Q., Shi B., Liao H., Yimit H. (2025). Gas pipeline leakage identification and location using microporous structure optical sensing cable. Appl. Acoust. 231, 110524. doi:10.1016/j.apacoust.2024.110524
- Ge L., Zhang C., Tian G., Xiao X., Ahmed J., Wei G. (2021). Current trends and perspectives of detection and location for buried non-metallic pipelines. Chin. J. Mech. Eng. 34, 97. doi:10.1186/s10033-021-00613-z
- Han Y., Feng X., Todd M. D. (2023). A novel methodology for quantitative identification of pipeline leakage and negative pressure wave velocity. Struct. Health Monit. 22, 2267 – 2279. doi:10.1177/14759217221123403
- Hao G., Hao X., Guoqing W. (2025). Study on the Defect Location Method of Inner and Outer Wall of Pipeline During High-Speed Magnetic Flux Leakage Testing.
- He Y., Zhang X., Sun J. (2017). Channel pruning for accelerating very deep neural networks. Proceedings of the IEEE International Conference on Computer Vision. 1389 – 1397.
- Howard A., Sandler M., Chen B., Wang W., Chen L.-C., Tan M. (2019). “ Searching for MobileNetV3,” in Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision (ICCV) (Seoul, Korea (South): IEEE), 1314 – 1324.
- Iandola F. N., Han S., Moskewicz M. W., Ashraf K., Dally W. J., Keutzer K. (2016). SqueezeNet: AlexNet-Level accuracy with 50x fewer parameters and <0. 5MB model size. arXiv preprint arXiv:1602.07360.
- Karimanzira D. (2023). Simultaneous pipe leak detection and localization using attention-based deep learning autoencoder. Electronics 12, 4665. doi:10.3390/electronics12224665
- Kim Y., Rush A. M. (2016). “ Sequence-level knowledge distillation,” in Proceedings of the Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing. Association for Computational lin-guistics. Editors Su J., Duh K., Carreras X. (Austin, Texas), 1317 – 1327.
- Korlapati N. V. S., Khan F., Noor Q., Mirza S., Vaddiraju S. (2022). Review and analysis of pipeline leak detection methods. J. Pipeline Sci. Eng. 2, 100074. doi:10.1016/j.jpse.2022.100074
- Lee J.-H. (2022). Diagnosis of valve internal leakage for ship piping system using acoustic emission signal-based machine learning approach. J. Korean Soc. Mar. Environ. and Saf. 28, 184 – 192. doi:10.7837/kosomes.2022.28.1.184
- Li M., Liu B., Chen T., Liu R., Guo Y., Hou K. (2023). On-Site leakage locating of underground natural gas pipeline based on Ne tracer by miniature time-of-flight mass spectrometry. Talanta 254, 124170. doi:10.1016/j.talanta.2022.124170
- Luong T. T. N., Kim J.-M. (2020). The enhancement of leak detection performance for water pipelines through the renovation of training data. Sensors 20, 2542. doi:10.3390/s20092542
- Ning F., Cheng Z., Meng D., Duan S., Wei J. (2021). Enhanced spectrum convolutional neural architecture: an intelligent leak detection method for gas pipeline. Process Saf. Environ. Prot. 146, 726 – 735. doi:10.1016/j.psep.2020.12.011
- Peng Y., Ganesh A., Wright J., Xu W., Ma Y.RASL (2011). Robust Alignment by Sparse and Low-Rank Decomposition for Linearly Correlated Images.
- Quy T. B., Kim J.-M. (2021). Real-time leak detection for a gas pipeline using a k-NN classifier and hybrid AE features. Sensors 21, 367. doi:10.3390/s21020367
- Rai A., Kim J.-M. (2021). A novel pipeline leak detection approach independent of prior failure information. Measurement 167, 108284. doi:10.1016/j.measurement.2020.108284
- Schieber T. A., Carpi L., Díaz-Guilera A., Pardalos P. M., Masoller C., Ravetti M. G. (2017). Quantification of network structural dissimilarities. Nat. Commun. 8, 13928. doi:10.1038/ncomms13928
- Sim H. Y., Ramli R., Saifizul A., Soong M. F. (2020). Detection and estimation of valve leakage losses in reciprocating com-pressor using acoustic emission technique. Measurement 152, 107315. doi:10.1016/j.measurement.2019.107315
- Spandonidis C., Theodoropoulos P., Giannopoulos F. (2022). A combined semi-supervised deep learning method for oil leak detection in pipelines using IIoT at the edge. Sensors 22, 4105. doi:10.3390/s22114105
- Sun T., Wang C., Dong H., Zhou Y., Guan C. (2023). A novel parameter-optimized recurrent attention network for pipeline leakage detection. IEEE/CAA J. Automatica Sinica 10, 1064 – 1076. doi:10.1109/JAS.2023.123180
- Wang L., Narasimman S. C., Reddy Ravula S., Ukil A. (2017). Water ingress detection in low-pressure gas pipelines using distributed temperature sensing system. IEEE Sensors J. 17, 3165 – 3173. doi:10.1109/JSEN.2017.2686982
- Yeo D., Bae J.-H., Lee J.-C. (2019). Unsupervised learning-based pipe leak detection using deep auto-encoder. J. Korea Soc. Comput. Inf. 24, 21 – 27.
- Yuan M., Hongyu G., Jingyi L., Dandi Y., Yixuan H. (2025). Overview of Leakage Detection Technology for Oil and Gas Pipelines.
- Zhang X., Zhou X., Lin M., Sun J. (2018). “ ShuffleNet: an extremely efficient convolutional neural network for Mobile devices,” in Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition (Salt Lake City, UT: IEEE), 6848 – 6856.
- Zheng J., Liang Y., Xu N., Wang B., Zheng T., Li Z. (2021). Deeppipe: a customized generative model for estimations of liquid pipeline leakage parameters. Comput. and Chem. Eng. 149, 107290. doi:10.1016/j.compchemeng.2021.107290
- Zhou M., Pan Z., Liu Y., Zhang Q., Cai Y., Pan H. (2019). Leak detection and location based on ISLMD and CNN in a pipeline. IEEE Access 7, 30457 – 30464. doi:10.1109/ACCESS.2019.2902711
- Zhou M., Yang Y., Xu Y., Hu Y., Cai Y., Lin J. (2021). A pipeline leak detection and localization approach based on ensemble TL1DCNN. IEEE Access 9, 47565 – 47578. doi:10.1109/ACCESS.2021.3068292
Citation
Gao, Y. & Zhang, H. (2026). Research on leakage detection and location method of natural gas pipeline under strong noise condition. Frontiers in Acoustics, Volume 4. https://doi.org/
- Received
- Accepted
- Published
- Volume
- 4 - 2026
Copyright
Copyright © 2026 Gao and Zhang.
License: https://creativecommons.org/licenses/by/4.0/
*Correspondence: Yifei Gao
Article metrics
- Views
- 0
- Downloads
- 0
- Citations
- 0
- Shares
- 0
