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

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 (R 2 ) of 0.976 and a Mean Absolute Percentage Error (MAPE) of 6.24 %. SHAP analysis revealed that corrosion inhibitor dosing, H 2 S percentage, CO 2 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. • Hybrid XGBoost model is proposed for corrosion failure prediction. • The SHAP method was employed to enhance model interpretability. • The proposed SSM-IPSO-XGBoost model demonstrated superior predictive performance. • The proposed model offering a strong framework for intelligent corrosion control.

Authors

Institutions

Publication Details

Journal
Energy
Published
2025-04-14
DOI
https://doi.org/10.1016/j.energy.2025.136157
Citations
34
Primary Topic
Non-Destructive Testing Techniques
Type
article
Field-Weighted Citation Impact
24.26
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Yunfu Wang, Cuizhen Pan, Hongfa Huang, Yongfan Tang et al.
34 citations
Energy
Non-Destructive Testing Techniques
24.26
article

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

Yunfu Wang, Cuizhen Pan, Hongfa Huang, Yongfan Tang, Lei Xu, Shaomu Wen
article en
34 citations

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 (R 2 ) of 0.976 and a Mean Absolute Percentage Error (MAPE) of 6.24 %. SHAP analysis revealed that corrosion inhibitor dosing, H 2 S percentage, CO 2 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. • Hybrid XGBoost model is proposed for corrosion failure prediction. • The SHAP method was employed to enhance model interpretability. • The proposed SSM-IPSO-XGBoost model demonstrated superior predictive performance. • The proposed model offering a strong framework for intelligent corrosion control.

EnergyVol. 325
Southwest Petroleum University (CN), State Key Laboratory of Oil and Gas Reservoir Geology and Exploitation (CN), Gas Technology Institute (US)
Openalex Percentile: Top 0%
Non-Destructive Testing Techniques
24.26
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.