Abstract:
Objective To address the difficulty of dynamically assessing the complex corrosion conditions of buried oil and gas pipelines using existing models, this study proposes a high-accuracy corrosion rate prediction method. Methods A model based on Random Forest (RF), Improved Goat Optimization Algorithm (IGOA), and Improved Transformer (ITransformer) is established. The RF is used to select key variables affecting corrosion, while IGOA optimizes model parameters and the segmentation modeling strategy. The ITransformer model, driven by a segmentation mechanism, is applied to separately predict the corrosion rates of gradual and abrupt segments. Results Using 100 sets of buried pipeline corrosion experimental data as an example, the average absolute error (MAE), mean squared error (MSE), root mean squared error (RMSE), and mean absolute percentage error (MAPE) of the RF-IGOA-ITransformer model were 0.8021, 1.0146, 1.0073, and 21.28%, respectively. The coefficient of determination (R²) was 0.8569. Compared to the traditional Transformer model, MAE decreased by 50.38%, MSE by 84.65%, RMSE by 60.82%, MAPE by 35.47%, and R² increased by 789.2%. Conclusion The RF-IGOA-ITransformer model significantly improves the prediction accuracy and robustness of corrosion rates, providing an efficient solution for the dynamic prediction of corrosion rates in buried oil and gas pipelines.