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
- Yunfu Wang (ORCID: https://orcid.org/0000-0002-5794-9634)
- Cuizhen Pan (ORCID: https://orcid.org/0000-0001-7697-9970)
- Hongfa Huang
- Yongfan Tang
- Lei Xu (ORCID: https://orcid.org/0000-0003-1529-7225)
- Shaomu Wen
Institutions
- Southwest Petroleum University (CN)
- State Key Laboratory of Oil and Gas Reservoir Geology and Exploitation (CN)
- Gas Technology Institute (US)
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