IDEAS home Printed from https://ideas.repec.org/a/eee/energy/v325y2025ics0360544225017992.html
   My bibliography  Save this article

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. 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).
    3. 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).
    4. 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).
    5. 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).
    6. 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).
    7. 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).
    8. 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).
    9. 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.
    Full references (including those not matched with items on IDEAS)

    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. 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).
    2. 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).
    3. 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).
    4. Ingryd Mayer Krinski & Vinícius Reisdorfer Leite & Luis Mauro Moura & Viviana Cocco Mariani, 2025. "Critical Extraction Parameters for Maximizing Oil Yield from Spent Coffee Grounds," Energies, MDPI, vol. 18(6), pages 1-17, March.
    5. Cao, Bohan & Yin, Qishuai & Guo, Yingying & Yang, Jin & Zhang, Laibin & Wang, Zhenquan & Tyagi, Mayank & Sun, Ting & Zhou, Xu, 2023. "Field data analysis and risk assessment of shallow gas hazards based on neural networks during industrial deep-water drilling," Reliability Engineering and System Safety, Elsevier, vol. 232(C).
    6. Qu, Pengfei & Zhang, Limao, 2025. "Uncertainty-based multi-objective optimization in twin tunnel design considering fluid-solid coupling," Reliability Engineering and System Safety, Elsevier, vol. 253(C).
    7. Sadeghpour, Farshad, 2025. "Storage efficiency prediction for feasibility assessment of underground CO2 storage: Novel machine learning approaches," Energy, Elsevier, vol. 324(C).
    8. Zhang, Ruixing & An, Liqiang & He, Lun & Yang, Xinmeng & Huang, Zenghao, 2024. "Reliability analysis and inverse optimization method for floating wind turbines driven by dual meta-models combining transient-steady responses," Reliability Engineering and System Safety, Elsevier, vol. 244(C).
    9. Yinchen Lin & Chuanxu Wang, 2025. "Prediction of Ship CO 2 Emissions and Fuel Consumption Using Voting-BRL Model," Sustainability, MDPI, vol. 17(4), pages 1-14, February.
    10. Wan, Liangqi & Wei, Yumeng & Zhang, Qiaoke & Liu, Lei & Chen, Yuejian, 2025. "A new multiple stochastic Kriging model for active learning surrogate-assisted reliability analysis," Reliability Engineering and System Safety, Elsevier, vol. 260(C).
    11. Ye, Lin & Wang, Chengyou & Zhou, Xiao & Jiang, Baocheng & Yu, Changsong & Qin, Zhiliang, 2025. "Natural gas pipeline weak leakage detection based on negative pressure wave decomposition and feature enhancement," Reliability Engineering and System Safety, Elsevier, vol. 257(PB).
    12. Lei, Yang & Chen, Yuming & Chen, Jinghai & Liu, Xinyan & Wu, Xiaoqin & Chen, Yuqiu, 2023. "A novel modeling strategy for the prediction on the concentration of H2 and CH4 in raw coke oven gas," Energy, Elsevier, vol. 273(C).
    13. Panjapornpon, Chanin & Bardeeniz, Santi & Hussain, Mohamed Azlan, 2023. "Deep learning approach for energy efficiency prediction with signal monitoring reliability for a vinyl chloride monomer process," Reliability Engineering and System Safety, Elsevier, vol. 231(C).
    14. van Zyl, Corne & Ye, Xianming & Naidoo, Raj, 2024. "Harnessing eXplainable artificial intelligence for feature selection in time series energy forecasting: A comparative analysis of Grad-CAM and SHAP," Applied Energy, Elsevier, vol. 353(PA).
    15. Gong, Jianqiang & Qu, Zhiguo & Zhu, Zhenle & Xu, Hongtao & Yang, Qiguo, 2025. "Ensemble models of TCN-LSTM-LightGBM based on ensemble learning methods for short-term electrical load forecasting," Energy, Elsevier, vol. 318(C).
    16. Jiang, Fengyuan & Dong, Sheng, 2025. "Development of a CNN-based integrated surrogate model in evaluating the damage of buried pipeline under impact loads, considering the soil spatial variability," Reliability Engineering and System Safety, Elsevier, vol. 257(PA).
    17. Wei, Daining & Zhang, Zhichao & Wang, Yilin & Zhu, Zhaoyang & Wu, Lining & Wang, Tao & Sun, Baomin, 2024. "Numerical simulation of hydrogen co-firing distribution on combustion characteristics and NOx release in a 660 MW power plant boiler," Energy, Elsevier, vol. 305(C).
    18. Chen, Zhanfeng & Li, Xuyao & Wang, Wen & Li, Yan & Shi, Lei & Li, Yuxing, 2023. "Residual strength prediction of corroded pipelines using multilayer perceptron and modified feedforward neural network," Reliability Engineering and System Safety, Elsevier, vol. 231(C).
    19. Liang, Zhendong & Xie, Fangxi & Li, Qian & Su, Yan & Wang, Zhongshu & Dou, Huili & Li, Xiaoping, 2024. "Co-optimization and prediction of high-efficiency combustion and zero-carbon emission at part load in the hydrogen direct injection engine based on VVT, split injection and ANN," Energy, Elsevier, vol. 308(C).
    20. Sun, Jing & Wang, Haitao, 2025. "State of health estimation for lithium-ion batteries based on optimal feature subset algorithm," Energy, Elsevier, vol. 322(C).

    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.