Corrosion failure prediction in natural gas pipelines using an interpretable XGBoost model: Insights and applications
Lei Xu,
Shaomu Wen,
Hongfa Huang,
Yongfan Tang,
Yunfu Wang and
Chunfeng Pan
Energy, 2025, vol. 325, issue C
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.
Keywords: Corrosion rate; Natural gas pipeline; Machine learning; Shapley additive explanation; Explainable artificial intelligence (search for similar items in EconPapers)
Date: 2025
References: Add references at CitEc
Citations:
Downloads: (external link)
http://www.sciencedirect.com/science/article/pii/S0360544225017992
Full text for ScienceDirect subscribers only
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:eee:energy:v:325:y:2025:i:c:s0360544225017992
DOI: 10.1016/j.energy.2025.136157
Access Statistics for this article
Energy is currently edited by Henrik Lund and Mark J. Kaiser
More articles in Energy from Elsevier
Bibliographic data for series maintained by Catherine Liu ().