Safeguarding Gas Pipeline Sustainability: Deep Learning for Precision Identification of Gas Leakage Characteristics
Abstract
1. Introduction
2. Methodology
2.1. Long Short-Term Memory (LSTM)
2.2. Transformer
2.3. Transformer–LSTM Cascaded Network (TLCN)
2.4. Transformer–LSTM Parallel Network (TLPN)
3. Case Studies
3.1. Data Sources and Features
3.2. Data Preprocessing
4. Model Validation and Result Analysis
4.1. Evaluation Indicators
4.1.1. Confusion Matrix
4.1.2. Accuracy
4.1.3. Precision
4.1.4. Recall
4.1.5. F1 Score
4.1.6. ROC Curve
4.1.7. AUC
4.1.8. t-SNE Visualization
4.2. Result Analysis
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
| TLPN | Transformer–LSTM Parallel Network |
| TLCN | Transformer–LSTM Cascaded Network |
| LSTM | Long Short-Term Memory |
| BPNN | Back-propagation neural networks |
| SVM | Support vector machine |
| RNN-LSTM | Recurrent Neural Network-Long Short-Term Memory |
| OPELM | Optimally Pruned Extreme Learning Machine |
| BiLSTM | Bidirectional Long Short-Term Memory |
| AE | Acoustic Emission |
| CWT | Continuous Wavelet Transform |
| GA | Genetic Algorithm |
| TP | True Positives |
| FP | False Positives |
| TN | True Negatives |
| FN | False Negatives |
| ROC | The Receiver Operating Characteristic |
| TPR | True Positive Rate |
| FPR | False Positive Rate |
| AUC | The Area Under the ROC Curve |
| t-SNE | t-Distributed Stochastic Neighbor Embedding |
References
- Meng, L.; Liu, Y.; Wang, W.; Fu, J. Experimental study on leak detection and location for gas pipeline based on acoustic method. J. Loss Prev. Process. Ind. 2012, 25, 90–102. [Google Scholar] [CrossRef]
- Liu, C.; Cui, Z.; Fang, L.; Li, Y.; Xu, M. Leak localization approaches for gas pipelines using time and velocity differences of acoustic waves. Eng. Fail. Anal. 2019, 103, 1–8. [Google Scholar] [CrossRef]
- Jin, H.; Zhang, L.; Liang, W.; Ding, Q. Integrated leakage detection and localization model for gas pipelines based on the acoustic wave method. J. Loss Prev. Process Ind. 2014, 27, 15. [Google Scholar] [CrossRef]
- Liu, C.; Li, Y.; Yan, Y.; Fu, J. A new leak location method based on leakage acoustic waves for oil and gas pipelines. J. Loss Prev. Process Ind. 2015, 35, 236–246. [Google Scholar] [CrossRef]
- Mahmutoglu, Y.; Turk, K. A Passive Acoustic Based System to Locate Leak Hole in Underwater Natural Gas Pipelines. Digit. Signal Process. 2018, 76, 59–65. [Google Scholar] [CrossRef]
- Adegboye, M.A.; Fung, W.K.; Karnik, A. Recent Advances in Pipeline Monitoring and Oil Leakage Detection Technologies: Principles and Approaches. Sensors 2019, 19, 2548. [Google Scholar] [CrossRef] [PubMed]
- Santos, R.B.; Rupp, M.; Bonzi, S.J.; Fileti, A.M. Comparison between multilayer feedforward neural networks and a radial basis function network to detect and locate leaks in pipelines transporting gas. Chem. Eng. Trans. 2013, 32, 1375–1380. [Google Scholar] [CrossRef]
- Chen, H.; Ye, H.; Chen, L.V.; Su, L.Y. Application of support vector machine learning to leak detection and location in pipelines. In Proceedings of the 21st IEEE Instrumentation and Measurement Technology Conference, Como, Italy, 18–20 May 2004. [Google Scholar] [CrossRef]
- Fernandes, L.B.; da Silva, F.V.; Fileti, A.M.F. Diagnosis of Gas Leaks by Acoustic Method and Signal Processing. In Computer Aided Chemical Engineering; Elsevier: Amsterdam, The Netherlands, 2018. [Google Scholar] [CrossRef]
- El-Zahab, S.; Abdelkader, E.M.; Zayed, T. An accelerometer-based leak detection system. Mech. Syst. Signal Process. 2018, 108, 276–291. [Google Scholar] [CrossRef]
- Xu, Q.; Zhang, L.; Liang, W. Acoustic detection technology for gas pipeline leakage. Process Saf. Environ. Prot. 2013, 91, 253–261. [Google Scholar] [CrossRef]
- Wang, F.; Lin, W.; Liu, Z.; Wu, S.C.; Qiu, S.B. Pipeline Leak Detection by Using Time-Domain Statistical Features. IEEE Sens. J. 2017, 17, 6431–6442. [Google Scholar] [CrossRef]
- Lay-Ekuakille, A.; Pariset, C.; Trotta, A. Leak detection of complex pipelines based on the filter diagonalization method: Robust technique for eigenvalue assessment. Meas. Sci. Technol. 2010, 21, 115403. [Google Scholar] [CrossRef]
- Lee, C.W.; Yoo, D.G. Development of Leakage Detection Model and Its Application for Water Distribution Networks Using RNN-LSTM. Sustainability 2021, 13, 9262. [Google Scholar] [CrossRef]
- Yang, L.; Zhao, Q. A novel PPA method for fluid pipeline leak detection based on OPELM and bidirectional LSTM. IEEE Access 2020, 8, 107185–107199. [Google Scholar] [CrossRef]
- Vynnykov, Y.; Kharchenko, M.; Manhura, S.; Aniskin, A.; Manhura, A. Neural network analysis of safe life of the oil and gas industrial structures. Min. Miner. Depos. 2024, 18, 37–44. [Google Scholar] [CrossRef]
- Colorado-Garrido, D.; Ortega-Toledo, D.M.; Hernández, J.A.; González-Rodríguez, J.G.; Uruchurtu, J. Neural networks for Nyquist plots prediction during corrosion inhibition of a pipeline steel. J. Solid State Electrochem. 2009, 13, 1715–1722. [Google Scholar] [CrossRef]
- Liao, K.; Yao, Q.; Wu, X.; Jia, W.L. A Numerical Corrosion Rate Prediction Method for Direct Assessment of Wet Gas Gathering Pipelines Internal Corrosion. Energies 2012, 5, 3892–3907. [Google Scholar] [CrossRef]
- Hochreiter, S.; Schmidhuber, J. Long Short-Term Memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
- Gers, F.A.; Schmidhuber, J.; Cummins, F. Learning to Forget: Continual Prediction with LSTM. Neural Comput. 2000, 12, 2451–2471. [Google Scholar] [CrossRef]
- Sak, H.; Senior, A.; Beaufays, F. Long Short-Term Memory Based Recurrent Neural Network Architectures for Large Vocabulary Speech Recognition. arXiv 2014, arXiv:1402.1128. [Google Scholar] [CrossRef]
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention Is All You Need. arXiv 2017. [Google Scholar] [CrossRef]
- Katharopoulos, A.; Vyas, A.; Pappas, N.; Fleuret, F. Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention. arXiv 2020, arXiv:2006.16236. [Google Scholar] [CrossRef]
- Zerveas, G.; Jayaraman, S.; Patel, D.; Bhamidipaty, A.; Eickhof, C. A Transformer-based Framework for Multivariate Time Series Representation Learning. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, Singapore, 14–18 August 2021; ACM: New York, NY, USA, 2021. [Google Scholar]
- Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.H.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv 2020, arXiv:2010.11929. [Google Scholar] [CrossRef]
- Lim, B.; Ark, S.; Loeff, N.; Pfister, T. Temporal Fusion Transformers for interpretable multi-horizon time series forecasting. Int. J. Forecast. 2021, 37, 1748–1764. [Google Scholar] [CrossRef]
- Zhou, H.; Zhang, S.; Peng, J.; Zhang, S.; Li, J.X.; Xiong, H.; Zhang, W.C. Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting. arXiv 2020, arXiv:2012.07436. [Google Scholar] [CrossRef]
- Tay, Y.; Dehghani, M.; Bahri, D.; Metzler, D. Efficient Transformers: A Survey. ACM Comput. Surv. 2023, 55, 28. [Google Scholar] [CrossRef]
- Karim, F.; Majumdar, S.; Darabi, H.; Chen, S. LSTM Fully Convolutional Networks for Time Series Classification. IEEE Access 2018, 6, 1662–1669. [Google Scholar] [CrossRef]
- Guen, V.L.; Thome, N. Shape and Time Distortion Loss for Training Deep Time Series Forecasting Models. In Proceedings of the Advances in Neural Information Processing Systems 32, Volume 6 of 20: 32nd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, BC, Canada, 8–14 December 2019. [Google Scholar]
- Li, S.; Jin, X.; Xuan, Y.; Zhou, X.; Chen, W.; Wang, Y.X.; Yan, X. Enhancing the Locality and Breaking the Memory Bottleneck of Transformer on Time Series Forecasting. In Proceedings of the Advances in Neural Information Processing Systems 32, Volume 7 of 20: 32nd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, BC, Canada, 8–14 December 2019. [Google Scholar]
- Franceschi, J.Y.; Dieuleveut, A.; Jaggi, M. Unsupervised Scalable Representation Learning for Multivariate Time Series. In Proceedings of the Advances in Neural Information Processing Systems 32, Volume 6 of 20: 32nd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, BC, Canada, 8–14 December 2019. [Google Scholar]
- Luo, C.; Meng, S.; Hu, X.; Wang, X.; Zhong, Y. Cropnet: Deep Spatial-Temporal-Spectral Feature Learning Network for Crop Classification from Time-Series Multi-Spectral Images. In Proceedings of the 2020 IEEE International Geoscience and Remote Sensing Symposium, Waikoloa, HI, USA, 26 September–2 October 2020. [Google Scholar] [CrossRef]
- Kingphai, K.; Moshfeghi, Y. On Time Series Cross-Validation for Deep Learning Classification Model of Mental Workload Levels Based on EEG Signals; Springer: Berlin/Heidelberg, Germany, 2022. [Google Scholar] [CrossRef]
- Foumani, N.M.; Miller, L.; Tan, C.W.; Webb, G.; Forestier, G.; Salehi, M. Deep Learning for Time Series Classification and Extrinsic Regression: A Current Survey. ACM Comput. Surv. 2024, 56, 45. [Google Scholar] [CrossRef]
- Hespeler, S.C.; Nemati, H.; Masurkar, H.D.N.E. Deep Learning-Based Time-Series Classification for Robotic Inspection of Pipe Condition Using Non-Contact Ultrasonic Testing. J. Nondestruct. Eval. Diagn. Progn. Eng. Syst. 2024, 7, 11002. [Google Scholar] [CrossRef]
- Kam, H.J.; Kim, H.Y. Learning representations for the early detection of sepsis with deep neural networks. Comput. Biol. Med. 2017, 89, 248–255. [Google Scholar] [CrossRef] [PubMed]
- Yasaka, K.; Akai, H.; Kunimatsu, A.; Obe, O.; Kiryu, S. Deep learning for staging liver fibrosis on CT: A pilot study. Eur. Radiol. 2018, 28, 4578–4585. [Google Scholar] [CrossRef] [PubMed]
- Choo, H.; Lee, K.H.; Hong, S.; Lee, K.B.; Chang, Y.L. Beyond the ROC Curve: Activity Monitoring to Evaluate Deep Learning Models in Clinical Settings. Appl. Med. Inform. 2024, 46, S9–S12. [Google Scholar]
- Li, A.; Feng, C.; Xu, S.; Cheng, Y. Graph t-SNE multi-view autoencoder for joint clustering and completion of incomplete multi-view data. Knowl.-Based Syst. 2024, 284, 111324. [Google Scholar] [CrossRef]
- Hussain, S.; Ali, M.; Naseem, U.; Bosques Palomo, B.A.; Monsivais Molina, M.A.; Garza Abdala, J.A.; Avendano Avalos, D.B.; Cardona-Huerta, S.; Aaron Gulliver, T.; Tamez Pena, J.G. Performance Evaluation of Deep Learning and Transformer Models Using Multimodal Data for Breast Cancer Classification. In MICCAI Workshop on Cancer Prevention Through Early Detection; Springer: Cham, Switzerland, 2025. [Google Scholar] [CrossRef]
- Shi, H.; Xu, M.; Li, R. Deep Learning for Household Load Forecasting—A Novel Pooling Deep RNN. IEEE Trans. Smart Grid 2017, 9, 5271–5280. [Google Scholar] [CrossRef]
- Wang, Y.; Huang, N.; Li, T.; Yan, Y.; Zhang, X. Medformer: A Multi-Granularity Patching Transformer for Medical Time-Series Classification. Adv. Neural Inf. Process. Syst. 2024, 37, 36314–36341. [Google Scholar]
- Lyu, C.; Li, L.; Zhang, Z.; Wang, T.; Li, P. FBG Tactile Sensing System Based on SVP-Transformer for Material Classification. IEEE Sens. J. 2025, 25, 5370–5379. [Google Scholar] [CrossRef]
- Wu, W.; Qiu, F.; Wang, L.; Liu, Y. Multiscale spatial-temporal transformer with consistency representation learning for multivariate time series classification. Concurr. Pract. Exp. 2024, 36, e8234. [Google Scholar] [CrossRef]
- Ma, Q.; Meng, R.; Li, R.; Dai, L.; Shen, F.; Yuan, J.; Sun, D.; Li, M.; Fu, C.; Li, R.; et al. Multitask deep learning model based on multimodal data for predicting prognosis of rectal cancer: A multicenter retrospective study. BMC Med. Inform. Decis. Mak. 2025, 25, 209. [Google Scholar] [CrossRef]
- Perdomo, O.; Rios, H.; Rodríguez, F.J.; Otálora, S.; Meriaudeau, F.; Müller, H.; González, F.A. Classification of diabetes-related retinal diseases using a deep learning approach in optical coherence tomography. Comput. Methods Programs Biomed. 2019, 178, 181–189. [Google Scholar] [CrossRef]
- Chang, J.; Xu, Z.; Wang, C.; Guo, J. Leak Prediction Method for Gas Pipelines Based on an Improved Transformer. In Proceedings of the 2024 6th International Conference on Video, Signal and Image Processing, Ningbo, China, 22–24 November 2024; pp. 129–135. [Google Scholar] [CrossRef]
- Li, W.; Li, S.; Hou, J.; Wang, J.; Zhao, M. Intelligent identification of internal leakage in natural gas pipeline control valves based on Mamba-ARN. Process Saf. Environ. Prot. 2025, 198, 107113. [Google Scholar] [CrossRef]
- Xu, W.; Huang, J.; Sun, L.; Yao, Y.; Zhu, F.; Xie, F.; Zhang, M. An Improved Convolutional Neural Network for Pipe Leakage Identification Based on Acoustic Emission. J. Mar. Sci. Eng. 2024, 12, 1720. [Google Scholar] [CrossRef]
- Ma, Y.; Shang, Z.; Zheng, J.; Zhang, Y.; Weng, G.; Zhao, S.; Bi, C. Research on Leak Detection and Localization Algorithm for Oil and Gas Pipelines Using Wavelet Denoising Integrated with Long Short-Term Memory (LSTM)–Transformer Models. Sensors 2025, 25, 2411. [Google Scholar] [CrossRef] [PubMed]
- Lu, J.; Chen, J.; Yang, D.; Hu, Z.; Wang, P.; Wang, D. Two-dimensional small leak detection of pipeline based on time sequence coding. Flow Meas. Instrum. 2024, 97, 102572. [Google Scholar] [CrossRef]
- Du, Y.; Chu, S.; Wang, J.; Shi, M.; Huang, D.; Song, W. MD-Former: Multiscale Dual Branch Transformer for Multivariate Time Series Classification. Sensors 2025, 25, 1487. [Google Scholar] [CrossRef] [PubMed]
- Tang, Y.; Wei, Y.; Li, T.; Zheng, X.; Ji, C. A hierarchical transformer-based network for multivariate time series classification. Inf. Syst. 2025, 132, 102536. [Google Scholar] [CrossRef]
- Snider, E.J.; Hernandez-Torres, S.I.; Boice, E.N. An image classification deep-learning algorithm for shrapnel detection from ultrasound images. Sci. Rep. 2022, 12, 8427. [Google Scholar] [CrossRef] [PubMed]
- Liao, A.H.; Chen, J.R.; Liu, S.H.; LU, C.; Lin, C.; Shieh, J.; Weng, W.; Tsui, P. Deep Learning of Ultrasound Imaging for Evaluating Ambulatory Function of Individuals with Duchenne Muscular Dystrophy. Diagnostics 2021, 11, 963. [Google Scholar] [CrossRef]
- Zou, Y.; Zhang, Y.; Zhao, X. Self-Supervised Time Series Classification Based on LSTM and Contrastive Transformer. Wuhan Univ. J. Nat. Sci. 2022, 27, 521–530. [Google Scholar] [CrossRef]










| Model | ACC | PRE | REC | F1 |
|---|---|---|---|---|
| TLPN | 91.10% | 89.86% | 83.11% | 86.35% |
| TLCN | 99.50% | 91.84% | 80.43% | 85.76% |
| Transformer | 85.50% | 80.19% | 75.96% | 78.02% |
| LSTM | 77.02% | 65.00% | 69.71% | 67.27% |
| RNN | 76.42% | 65.74% | 63.45% | 64.57% |
| Metric | TLPN | Transformer | Relative Δ (%) |
|---|---|---|---|
| AUC | 0.952 | 0.906 | +5.08 |
| ACC | 0.91099 | 0.85498 | +6.55 |
| PRE | 0.89855 | 0.80189 | +12.05 |
| REC | 0.83110 | 0.75961 | +9.41 |
| F1 | 0.86351 | 0.78017 | +10.68 |
| Metric | TLPN | LSTM | Relative Δ (%) |
|---|---|---|---|
| AUC | 0.952 | 0.848 | +12.26 |
| ACC | 0.91099 | 0.77021 | +18.28 |
| PRE | 0.89855 | 0.65000 | +38.24 |
| REC | 0.83110 | 0.69705 | +19.23 |
| F1 | 0.86351 | 0.67270 | +28.37 |
| Metric | TLCN | Transformer | Relative Δ (%) |
|---|---|---|---|
| AUC | 0.939 | 0.906 | +3.64 |
| ACC | 0.90948 | 0.85498 | +6.37 |
| PRE | 0.91837 | 0.80189 | +14.52 |
| REC | 0.80429 | 0.75961 | +5.88 |
| F1 | 0.85755 | 0.78017 | +9.92 |
| Metric | TLCN | LSTM | Relative Δ (%) |
|---|---|---|---|
| AUC | 0.939 | 0.848 | +10.73 |
| ACC | 0.90948 | 0.77021 | +18.08 |
| PRE | 0.91837 | 0.65000 | +41.29 |
| REC | 0.80429 | 0.69705 | +15.39 |
| F1 | 0.85755 | 0.67270 | +27.48 |
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. |
© 2025 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zeng, Y.; Shen, K.; Weng, W. Safeguarding Gas Pipeline Sustainability: Deep Learning for Precision Identification of Gas Leakage Characteristics. Sustainability 2025, 17, 10323. https://doi.org/10.3390/su172210323
Zeng Y, Shen K, Weng W. Safeguarding Gas Pipeline Sustainability: Deep Learning for Precision Identification of Gas Leakage Characteristics. Sustainability. 2025; 17(22):10323. https://doi.org/10.3390/su172210323
Chicago/Turabian StyleZeng, Yuqian, Kaixin Shen, and Wenguo Weng. 2025. "Safeguarding Gas Pipeline Sustainability: Deep Learning for Precision Identification of Gas Leakage Characteristics" Sustainability 17, no. 22: 10323. https://doi.org/10.3390/su172210323
APA StyleZeng, Y., Shen, K., & Weng, W. (2025). Safeguarding Gas Pipeline Sustainability: Deep Learning for Precision Identification of Gas Leakage Characteristics. Sustainability, 17(22), 10323. https://doi.org/10.3390/su172210323
