Research on Oil and Gas Pipeline Leakage Detection Based on MSCNN-Transformer
Abstract
1. Introduction
2. Related Work
2.1. Short Time Fourier Transform (STFT)
2.2. Transformer
3. Methodology
3.1. Multi-Scale CNN-Transformer Model
3.2. Multi-Scale CNN Module
3.3. Loss Function
4. Experimental Design and Result Analysis
4.1. Experimental Settings
4.1.1. Data Processing
4.1.2. Evaluating Indicator
4.1.3. Experimental Results Contrasting
4.2. Ablation Experimental Results and Analysis
5. Discussion
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| MSCNN-Transformer | multi-scale convolutional neural network-Transformer |
| SVM | support vector machine |
| CNN | convolutional neural network |
| RNN | recurrent neural network |
| LSTM | long short-term memory network |
| BiLSTM | bidirectional long short-term memory network |
| sVMD | variational mode decomposition |
| SVD | singular value decomposition |
| DAS | distributed acoustic sensing |
| TEM | transient electromagnetic method |
| WMDM | weak magnetic detection method |
| TA-DBF | triple attention dual-branch fusion network |
| GCN | graph convolutional network |
| SE | spectrum enhancement |
| PAA | piecewise aggregate approximation |
| CWT | continuous wavelet transform |
| ABC | artificial bee colony algorithm |
| ReLU | Rectified Linear Unit |
| GELU | Gaussian Error Linear Unit |
References
- Gao, Y.; Wang, B.; Hu, Y.D.; Yu, Z. Review of China’s natural gas development in 2024 and outlook for 2025. Int. Pet. Econ. 2025, 33, 55–67. [Google Scholar]
- Yao, L.; Zhang, Y.; He, T.; Luo, H. Natural gas pipeline leak detection based on acoustic signal analysis and feature reconstruction. Appl. Energy 2023, 352, 121975. [Google Scholar] [CrossRef]
- Wen, J.T.; Fu, L.; Sun, J.D.; Wang, T.; Zhang, G.Y.; Zhang, P.C. Leakage aperture identification of natural gas pipeline based on compressed sensing combined with convolutional network. Vib. Shock 2020, 39, 17–23. [Google Scholar]
- Li, M.; Li, L.; Zuo, Z.; Zhang, L.; Jiang, L.; Su, H. Identification of operating conditions of refined oil pipelines based on machine learning. Chin. J. Saf. Sci. 2024, 34, 127–135. [Google Scholar]
- Li, X.; Zhang, W.; Ding, Q. Understanding and improving deep learning-based rolling bearing fault diagnosis with attention mechanism. Signal Process. 2019, 161, 136–154. [Google Scholar] [CrossRef]
- Zhang, R.C.; Wang, X.Y.; Hu, L.L.; Lin, Z.Y.; Huang, X.A.; Zhao, B. Acoustic emission signal recognition of gas pipeline leakage based on one-dimensional convolutional neural network. China Saf. Prod. Sci. Technol. 2021, 17, 104–109. [Google Scholar]
- Ning, F.L.; Han, P.C.; Duan, S.; Li, H.; Wei, J. Valve leakage ultrasonic signal recognition method based on improved CNN. J. Beijing Univ. Posts Telecommun. 2020, 43, 38–44. [Google Scholar]
- Zhong, M.S.; Li, Z.F.; Xiong, X.Z.; Wang, X.G. A natural gas pipeline leak detection model based on one-dimensional multi-scale deep separable convolution. In Proceedings of the 34th China Process Control Conference, Hangzhou, China, 28–30 July 2015. [Google Scholar]
- Nie, W.; Jiang, Z.; Liu, B.X. One-dimensional convolutional and long short-term memory neural network method for pipeline leak detection. J. China Rural Water Hydropower 2022, 63, 147–152+157. [Google Scholar]
- Nacer, S.M.; Nadia, B.; Abdelghani, R.; Mohamed, B. A novel method for bearing fault diagnosis based on BiLSTM neural networks. Int. J. Adv. Manuf. Technol. 2023, 125, 1477–1492. [Google Scholar] [CrossRef]
- Zheng, S.M.; Yan, J.G.; Guo, P.C.; Xu, Y.; Li, J.; Liu, Z.X. Research on small-scale leakage detection of water supply pipelines based on VMD and deep learning. Hydraul. J. 2024, 55, 999–1008. [Google Scholar]
- Ma, L.; An, P.F.; Liu, W.L.; Li, D.E. Research on small leakage detection technology of water supply pipe based on acoustic signal. J. Electron. Meas. Instrum. 2024, 38, 113–123. [Google Scholar]
- Tang, Y.J.; Liu, D.; Xiao, Z.H.; Hu, X.; Lai, X. Research on fault diagnosis method of hydropower units based on convolutional neural network and singular value decomposition. China Rural Water Conserv. Hydropower 2021, 175–181. [Google Scholar]
- Song, H.Z.; Li, X.J.; Qiu, Z.G.; Xing, Q.Y.; Yang, X.K.; Liu, Y.Y. A fault identification method for axle box bearings of high-speed EMUs based on improved VMD. China Railw. Sci. 2023, 44, 146–154. [Google Scholar]
- Li, L.; Jiang, Z.S.; Hu, Z.C.; Yang, S.; Tang, Y.; Jiang, X.; Sun, M.; Zhang, Z.; Qiu, X.; Wang, S. Leakage signal identification method of DAS pipeline based on CNN-Transformer. Opt. J. 2025, 45, 122–131. [Google Scholar]
- Liang, X.L.; Li, J.G.; Xu, P.P.; Wang, J.; Liu, J.; Chen, T.; Meng, X. Leakage fault diagnosis of heating pipe network based on convolutional neural network and Transformer. Sci. Eng. 2025, 25, 5589–5601. [Google Scholar]
- Meng, H.Y.; Zhang, J.L.; Cai, Z.L.; Li, C. Research on DC microgrid fault diagnosis based on CNN-BiLSTM-Attention. Chin. J. Electr. Eng. 2025, 45, 1369–1381. [Google Scholar]
- Zhu, J.; Cheng, Q.M.; Cheng, Y.M. Fault diagnosis of modular multilevel matrix converter based on CNN-GRU deep learning. China South. Power Grid Technol. 2024, 18, 13–22. [Google Scholar]
- Satterlee, N.; Zuo, X.; Lee, C.W.; Park, C.W.; Kang, J.S. Parallel multi-layer sensor fusion for pipe leak detection using multi-sensors and machine learning. Eng. Appl. Artif. Intell. 2025, 153, 110923. [Google Scholar] [CrossRef]
- Song, F.; Zhao, H.; Miao, X.; Zhao, Y. Identification method of buried pipeline complex conditions based on TA-DBF model and information fusion technique. Measurement 2025, 255, 118085. [Google Scholar] [CrossRef]
- Wu, D.H.; Zhu, Z.C.; Han, X.H. Fault diagnosis of wind turbine bearings based on BO-SDAE multi-source signals. J. Syst. Simul. 2021, 33, 1148–1156. [Google Scholar]
- Mishra, A.; Dhebar, J.; Rai, A. Leak detection in pipelines based on a multilayer network of time–frequency domain cross-visibility graphs and graph convolutional networks. Mech. Syst. Signal Process. 2025, 238, 113250. [Google Scholar] [CrossRef]
- Fangli, N.; Zhanghong, C.; Di, M.; Duan, S.; Wei, J. Enhanced spectrum convolutional neural architecture: An intelligent leak detection method for gas pipeline. Process Saf. Environ. Prot. 2021, 146, 726–735. [Google Scholar]
- Song, L.; Cui, X.; Han, X.; Gao, Y.; Liu, F.; Yu, Y.; Yuan, Y. A Non-Metallic pipeline leak size recognition method based on CWT acoustic image transformation and CNN. Appl. Acoust. 2024, 225, 110180. [Google Scholar] [CrossRef]
- Wang, N.; Du, W.; Liu, H.; Zhang, K.; Li, Y.; He, Y.; Han, Z. Fine-Grained Leakage Detection for Water Supply Pipelines Based on CNN and Selective State-Space Models. Water 2025, 17, 1115. [Google Scholar]
- Luo, Z.Y.; Li, M.Z.; Dong, X. Effective diagnosis of rolling bearing fault diagnosis method of Vision Transformer network. J. Chongqing Univ. Posts Telecommun. (Nat. Sci. Ed.) 2025, 1–9. [Google Scholar]
- Dong, H.L.; Sun, T.; Wang, C.; Yang, F.; Shang, R. A new method for natural gas pipeline leak detection based on gated attention network model. Nat. Gas Ind. 2025, 45, 25–36. [Google Scholar]
- Du, Y.F.; Duan, P.F.; Zhao, B.X.; Hao, J.; Song, K. Leakage diagnosis of heating pipe network based on CABC-BP model. J. Guangxi Univ. (Nat. Sci. Ed.) 2023, 48, 835–846. [Google Scholar]
- Zhang, R.R.; Fu, S.M.; Wei, Y.Y.; Wang, Y.; Chang, Q. Classification and identification of leakage acoustic signals in water supply network. Acoust. Technol. 2025, 44, 629–639. [Google Scholar]
- Valery, N.; Fabien, M.; Pierre, T. Evaluation of the Leak Detection Performance of Distributed Kalman Filter Algorithms in WSN-Based Water Pipeline Monitoring of Plastic Pipes. Computation 2022, 10, 55. [Google Scholar] [CrossRef]
- Debossam, J.G.; de Freitas, M.M.; de Souza, G.; Souto, H.P.A.; Pires, A.P. Numerical Simulation of Non-Darcy Flow in Naturally Fractured Tight Gas Reservoirs for Enhanced Gas Recovery. Gases 2024, 4, 253–272. [Google Scholar] [CrossRef]
- Hamouda, A.A.; Gupta, S.; Bahadori, A. Enhancing Oil Recovery from Chalk Reservoirs by a Low-Salinity Water Flooding Mechanism and Fluid/Rock Interactions. Energies 2017, 10, 576. [Google Scholar] [CrossRef]
- Nithikarnjanatharn, J.; Pimollukanakul, J.; Nutkhum, W.; Rongcha, K.; Arunchai, T.; Satuwong, P. Predicting the mechanical properties of polypropylene and recycled polypropylene by the application of sigmoid and ReLU functions in neural networks. Results Eng. 2026, 29, 108459. [Google Scholar] [CrossRef]
- Li, J.; Yao, L. GPLA-12: An Acoustic Signal Dataset of Gas Pipeline Leakage. arXiv 2021, arXiv:2106.10277. [Google Scholar] [CrossRef]










| Module | Structure | Structural Parameter |
|---|---|---|
| 1DCNN | Convolution kernel 1 | Convolution kernel size = 3 × 1 |
| Convolution kernel 2 | Convolution kernel size = 7 × 1 | |
| Convolution kernel 3 | Convolution kernel size = 15 × 1 | |
| 2DCNN | Convolution kernel 1 | Convolution kernel size = 3 × 3 |
| Convolution kernel 2 | Convolution kernel size = 5 × 5 | |
| Convolution kernel 3 | Convolution kernel size = 7 × 7 | |
| Transformer | Multi-head attention | Head number: 8, input dimension: 192 |
| Feedforward network | Input dimension: 192; hidden layer dimension: 512 activation function: Gaussian Error Linear Unit (GELU) | |
| Classification | Linear layer 1 | Input channel: 832 Output channel: 512 |
| Linear layer 1 | Input channel: 512 Output channel: 256 | |
| Linear layer 1 | Input channel: 256 Output channel: 12 |
| Configuration Item | Taking Values | Training Parameter | Taking Values |
|---|---|---|---|
| Window type | Hanning window | Optimizer | AdamW |
| Window length | 256 sampling points | Initial learning rate | 0.0005 |
| Overlap | 50% (128 sampling points) | Learning rate scheduling strategy | Reduce LR On Plateau |
| FFT size | 256 points | Epochs | 80 |
| Sampling rate assumption | 10 Hz (fixed) | Batch Size | 32 |
| Model | Accuracy | Recall | F1 | Precision |
|---|---|---|---|---|
| SVM | 82.1 | 79.8 | 82.2 | 81.6 |
| Random Forest | 84.7 | 83.2 | 84.9 | 83.6 |
| TCN | 94.71 | 94.7 | 94.7 | 95.2 |
| ResNet18 | 83.03 | 83.0 | 80.6 | 84.9 |
| CNN-BiLSTM | 92.7 | 92.7 | 92.5 | 94.1 |
| CNN-Transformer | 96.02 | 94.8 | 95.6 | 95.7 |
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. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Zhang, Y.; Li, W.; Wu, Y.; Wei, H. Research on Oil and Gas Pipeline Leakage Detection Based on MSCNN-Transformer. Appl. Sci. 2026, 16, 480. https://doi.org/10.3390/app16010480
Zhang Y, Li W, Wu Y, Wei H. Research on Oil and Gas Pipeline Leakage Detection Based on MSCNN-Transformer. Applied Sciences. 2026; 16(1):480. https://doi.org/10.3390/app16010480
Chicago/Turabian StyleZhang, Yingtao, Wenhe Li, Yang Wu, and Huili Wei. 2026. "Research on Oil and Gas Pipeline Leakage Detection Based on MSCNN-Transformer" Applied Sciences 16, no. 1: 480. https://doi.org/10.3390/app16010480
APA StyleZhang, Y., Li, W., Wu, Y., & Wei, H. (2026). Research on Oil and Gas Pipeline Leakage Detection Based on MSCNN-Transformer. Applied Sciences, 16(1), 480. https://doi.org/10.3390/app16010480

