IDEAS home Printed from https://ideas.repec.org/a/eee/energy/v325y2025ics0360544225017992.html

Corrosion failure prediction in natural gas pipelines using an interpretable XGBoost model: Insights and applications

Author

Listed:
  • Xu, Lei
  • Wen, Shaomu
  • Huang, Hongfa
  • Tang, Yongfan
  • Wang, Yunfu
  • Pan, Chunfeng

Abstract

Accurate prediction of corrosion rates in natural gas pipelines is essential for implementing intelligent corrosion control measures. Such predictions play an important role in optimizing of pipeline material selection, preventive maintenance strategies, and corrosion inhibitor dosing. Traditional machine learning algorithms often fall short in comprehensively addressing the factors influencing corrosion rates, leading to limited prediction accuracy and a lack of model interpretability. To address these challenges, this study proposes an innovative hybrid predictive model that integrates the Stratified Sampling Method (SSM), Improved Particle Swarm Optimization (IPSO), and the Extreme Gradient Boosting (XGBoost) algorithm. The SSM was utilized to minimize sample bias and enhance the objectivity of predictions, while the IPSO addressed the issues of local optimization and early convergence inherent in standard PSO methods. Model performance was assessed using standard metrics, and the Shapley Additive Explanation (SHAP) method was employed to enhance model interpretability. SHAP quantified the contributions of input features to the output predictions, offering valuable insights into the model's decision-making process. The proposed SSM-IPSO-XGBoost model demonstrated superior predictive performance, achieving a Coefficient of Determination (R2) of 0.976 and a Mean Absolute Percentage Error (MAPE) of 6.24 %. SHAP analysis revealed that corrosion inhibitor dosing, H2S percentage, CO2 percentage, pH, liquid flow rate, chloride ion concentration (Cl−), and temperature were the most influential factors affecting the corrosion rate. The SSM-IPSO-XGBoost hybrid model contributes to refining the system of factors influencing pipeline corrosion in gas fields, offering a strong framework for intelligent corrosion control. Furthermore, it serves as a valuable reference for advancing research in explainable artificial intelligence within the oil and gas sector.

Suggested Citation

  • Xu, Lei & Wen, Shaomu & Huang, Hongfa & Tang, Yongfan & Wang, Yunfu & Pan, Chunfeng, 2025. "Corrosion failure prediction in natural gas pipelines using an interpretable XGBoost model: Insights and applications," Energy, Elsevier, vol. 325(C).
  • Handle: RePEc:eee:energy:v:325:y:2025:i:c:s0360544225017992
    DOI: 10.1016/j.energy.2025.136157
    as

    Download full text from publisher

    File URL: http://www.sciencedirect.com/science/article/pii/S0360544225017992
    Download Restriction: Full text for ScienceDirect subscribers only

    File URL: https://libkey.io/10.1016/j.energy.2025.136157?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to

    for a different version of it.

    References listed on IDEAS

    as
    1. Cesar de Lima Nogueira, Silvio & Och, Stephan Hennings & Moura, Luis Mauro & Domingues, Eric & Coelho, Leandro dos Santos & Mariani, Viviana Cocco, 2023. "Prediction of the NOx and CO2 emissions from an experimental dual fuel engine using optimized random forest combined with feature engineering," Energy, Elsevier, vol. 280(C).
    2. Palar, Pramudita Satria & Zuhal, Lavi Rizki & Shimoyama, Koji, 2023. "Enhancing the explainability of regression-based polynomial chaos expansion by Shapley additive explanations," Reliability Engineering and System Safety, Elsevier, vol. 232(C).
    3. Sun, Jing & Fan, Chaoqun & Yan, Huiyi, 2024. "SOH estimation of lithium-ion batteries based on multi-feature deep fusion and XGBoost," Energy, Elsevier, vol. 306(C).
    4. Krishnamoorthi, M. & Malayalamurthi, R., 2018. "Engine characteristics analysis of chaulmoogra oil blends and corrosion analysis of injector nozzle using scanning electron microscopy/energy dispersive spectroscopy," Energy, Elsevier, vol. 165(PB), pages 1292-1319.
    5. Zhang, Chen & Hu, Di & Yang, Tao, 2024. "Research of artificial intelligence operations for wind turbines considering anomaly detection, root cause analysis, and incremental training," Reliability Engineering and System Safety, Elsevier, vol. 241(C).
    6. Xu, Liuyun & Spence, Seymour M.J., 2024. "Collapse reliability of wind-excited reinforced concrete structures by stratified sampling and nonlinear dynamic analysis," Reliability Engineering and System Safety, Elsevier, vol. 250(C).
    7. Qi, Jingwei & Wang, Yijie & Xu, Pengcheng & Hu, Ming & Huhe, Taoli & Ling, Xiang & Yuan, Haoran & Chen, Yong, 2024. "Study on the Co-gasification characteristics of biomass and municipal solid waste based on machine learning," Energy, Elsevier, vol. 290(C).
    8. Li, Xinhong & Jia, Ruichao & Zhang, Renren & Yang, Shangyu & Chen, Guoming, 2022. "A KPCA-BRANN based data-driven approach to model corrosion degradation of subsea oil pipelines," Reliability Engineering and System Safety, Elsevier, vol. 219(C).
    9. Białek, Jakub & Bujalski, Wojciech & Wojdan, Konrad & Guzek, Michał & Kurek, Teresa, 2022. "Dataset level explanation of heat demand forecasting ANN with SHAP," Energy, Elsevier, vol. 261(PA).
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Changhao Wang & Bohong Wang & Ning Jia & Wen Zhao & Ning Xu & Bosen Wang, 2025. "An Analytical Study on the Correlations Between Natural Gas Pipeline Network Scheduling Decisions and External Environmental Factors," Energies, MDPI, vol. 18(13), pages 1-17, June.
    2. Guo, Guisong & Zhu, Chen & Mao, Ruichang & Li, Xiaodong & Wu, Yankun & Chen, Jian, 2025. "Decarbonizing high-speed rail infrastructure in China: An integrated assessment combining machine learning and scenario modeling to 2060," Energy, Elsevier, vol. 341(C).

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Ye, Zhuang & Chang, Jiantao & Yu, Jianbo, 2025. "Prognosability regularized generative adversarial network for battery state of health estimation with limited samples," Energy, Elsevier, vol. 325(C).
    2. Gu, Jie & Wang, Yingyuan & Hu, Jiancun & Zhang, Kun & Shi, Lei & Deng, Kangyao, 2024. "Real-time prediction of fuel consumption and emissions based on deep autoencoding support vector regression for cylinder pressure-based feedback control of marine diesel engines," Energy, Elsevier, vol. 300(C).
    3. Wu, Ji & Wang, Jieming & Lin, Mingqiang & Meng, Jinhao, 2025. "Retired battery capacity screening based on deep learning with embedded feature smoothing under massive imbalanced data," Energy, Elsevier, vol. 318(C).
    4. Zhu, Yunyi & Xie, Bin & Wang, Anqi & Qian, Zheng, 2025. "Wind turbine fault detection and identification via self-attention-based dynamic graph representation learning and variable-level normalizing flow," Reliability Engineering and System Safety, Elsevier, vol. 253(C).
    5. Liu, Yangwei & Wang, Guangyu & Tang, Yumeng, 2025. "Investigation of flow and heat transfer characteristics in a ribbed channel using grid-adaptive simulation method," Energy, Elsevier, vol. 335(C).
    6. Krishnamoorthi, M. & Malayalamurthi, R. & Sakthivel, R., 2019. "Optimization of compression ignition engine fueled with diesel - chaulmoogra oil - diethyl ether blend with engine parameters and exhaust gas recirculation," Renewable Energy, Elsevier, vol. 134(C), pages 579-602.
    7. S. Charan Kumar & Amit Kumar Thakur & J. Ronald Aseer & Sendhil Kumar Natarajan & Rajesh Singh & Neeraj Priyadarshi & Bhekisipho Twala, 2022. "An Experimental Analysis and ANN Based Parameter Optimization of the Influence of Microalgae Spirulina Blends on CI Engine Attributes," Energies, MDPI, vol. 15(17), pages 1-19, August.
    8. Tamura, Yukio & Chen, Bo & Wu, Yue & Su, Ning & Yang, Qingshan, 2024. "Classification of equivalent static wind loads: Comparisons and applications," Reliability Engineering and System Safety, Elsevier, vol. 251(C).
    9. Lv, Chunwang & Wang, Weichao & Ding, Liuyi & Zhou, Weixing & Ma, Zherui & Jia, Jiandong, 2025. "Local data augmentation of biomass gasification performance prediction based on improved generative adversarial network," Energy, Elsevier, vol. 330(C).
    10. Li, Hao & Chen, Chao, 2025. "Lithium-ion battery SOH prediction based on multi-dimensional features and multi-model feature selector," Energy, Elsevier, vol. 331(C).
    11. Zhu, Xian-Kui & Herrington, Joshua, 2026. "Comments on “Failure analysis of corroded hydrogen-blended natural gas pipelines based on finite element analysis and genetic algorithm-back propagation neural network†[262 (2025) 111174]," Reliability Engineering and System Safety, Elsevier, vol. 269(C).
    12. Miranda, Matheus H.R. & Silva, Fabrício L. & Frutuoso, Felipe S. & Eckert, Jony J. & Oliveira, Mona Lisa M. & Silva, Ludmila C.A., 2025. "Novel prediction approach for exhaust gases using Elman neural network combined with particle swarm optimization," Energy, Elsevier, vol. 331(C).
    13. Santhappan, Joseph Sekhar & Boddu, Muralikrishna & Gopinath, Arun S. & Mathimani, Thangavel, 2024. "Analysis of 27 supervised machine learning models for the co-gasification assessment of peanut shell and spent tea residue in an open-core downdraft gasifier," Renewable Energy, Elsevier, vol. 235(C).
    14. Kumar, Rakesh & Mondal, Monoj Kumar, 2025. "Two-step feeding pyro-gasification of coconut husk: effects of Ni-Fe impregnation on products yields and quality," Renewable Energy, Elsevier, vol. 248(C).
    15. Jiang, Fengyuan & Dong, Sheng, 2024. "Probabilistic-based burst failure mechanism analysis and risk assessment of pipelines with random non-uniform corrosion defects, considering the interacting effects," Reliability Engineering and System Safety, Elsevier, vol. 242(C).
    16. Wang, Chang & Zheng, Jianqin & Liang, Yongtu & Wang, Bohong & Klemeš, Jiří Jaromír & Zhu, Zhu & Liao, Qi, 2022. "Deeppipe: An intelligent monitoring framework for operating condition of multi-product pipelines," Energy, Elsevier, vol. 261(PB).
    17. Seo, Younggeon & Kim, Taeyi & Barde, Stephane, 2025. "Enhancing battery SOH prediction with Butler–Volmer informed neural networks in data-scarce environments," Energy, Elsevier, vol. 335(C).
    18. Yin, Zhiqiang & Wang, Jiangjiang & Yuan, Fuchun & Ma, Zherui, 2025. "Collaborative data reconstruction and power prediction of wind turbine clusters," Energy, Elsevier, vol. 326(C).
    19. Srinidhi, Campli & Madhusudhan, A. & Channapattana, S.V. & Gawali, S.V. & Aithal, Kiran, 2021. "RSM based parameter optimization of CI engine fuelled with nickel oxide dosed Azadirachta indica methyl ester," Energy, Elsevier, vol. 234(C).
    20. Amel Ali Alhussan & Marwa Metwally, 2025. "Enhanced CO 2 Emissions Prediction Using Temporal Fusion Transformer Optimized by Football Optimization Algorithm," Mathematics, MDPI, vol. 13(10), pages 1-47, May.

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:eee:energy:v:325:y:2025:i:c:s0360544225017992. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Catherine Liu (email available below). General contact details of provider: http://www.journals.elsevier.com/energy .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.