基于KAN-Transformer-BiLSTM模型的天然气管道腐蚀速率预测

Corrosion rate prediction of natural gas pipelines based on the KAN-Transformer-BiLSTM model

  • 摘要:
    目的 天然气集输管道内腐蚀受温度、压力、介质流速、H2S含量、CO2含量、持液率、盐含量及pH值多因素共同作用,并具有明显的时变性、滞后性、局部突变特征,亟需解决现有研究偏重单一模型精度、对变量局部非线性以及跨时刻依赖协同刻画不足的问题。
    方法 构建KAN-Transformer-BiLSTM(Kolmogorov-Arnold Networks- Transformer-Bidirectional Long Short-Term Memory)管道腐蚀速率预测模型,以某L360N无缝钢天然气管道90天连续监测数据为例,将目标日前连续7天的温度、压力、介质流速等8项环境变量作为输入,预测下一时刻腐蚀速率。先按时间顺序将90天数据划分为训练集、验证集、独立测试集,并利用训练段统计量对8项变量进行Z-score标准化;再采用可学习三次B样条增强各时间步变量的局部非线性,利用Transformer编码器提取历史窗口内的跨时间步依赖,并用BiLSTM模型提取局部动态特征;最后,采用Adam优化算法训练模型,并依据验证集RMSE(Root Mean Square Error)实施早停机制,选取双向LSTM(Long Short-Term Memory)、自注意力双向LSTM、随机森林及梯度提升树4种传统模型作为互补基线,并通过滚动起点、时滞置换检验模型的稳定性与贡献。
    结果 将KAN-Transformer-BiLSTM预测模型应用于中国南海某天然气集输管道,新建模型的RMSE、MAPE(Mean Absolute Percentage Error)、决定系数R2分别为0.082 1 mm/a、10.12%、0.979 8;与4种传统模型相比,新建模型的RMSE分别降低81.9%、82.0%、78.6%、54.8%,R2分别提高0.596 1、0.603 7、0.422 0、0.078 5。新建模型能够较好跟踪测试集峰值及峰后回落,滚动验证表明不同起点下误差分布较集中,最大迭代次数达到40次后验证集RMSE基本稳定;时滞置换结果显示,第6天输入贡献最高,第3天、第5天次之,第7天仍具有一定贡献。
    结论 新建模型能够联合提取管道环境变量局部非线性、历史窗口跨时刻依赖、腐蚀速率动态变化信息,在严格时间顺序与无泄漏测试条件下具有较高预测精度、稳定性,可为天然气集输管道在线预警提供方法参考。

     

    Abstract:
    Objective Internal corrosion in natural gas gathering pipelines is governed by multiple interacting factors, including temperature, pressure, flow velocity, H2S concentration, CO2 concentration, liquid holdup, salinity, and pH. It exhibits pronounced time-varying behavior, hysteresis, and localized abrupt changes. Nevertheless, most existing studies concentrate excessively on single-model accuracy. They cannot jointly characterize the local nonlinearity of variables and cross-time-step dependencies, leaving a research gap.
    Methods A Kolmogorov-Arnold Networks-Transformer-Bidirectional Long Short-Term Memory (KAN-Transformer-BiLSTM) model is developed for internal corrosion rate prediction. This study adopts 90-day continuous monitoring data from an L360N seamless steel natural gas gathering pipeline. Eight variables, including temperature, pressure and medium flow velocity, from the preceding seven consecutive days are used as inputs to predict the corrosion rate at the next time step. The 90-day dataset is split chronologically into training, validation, and independent test sets, with Z-score standardization applied to all eight variables using training-set statistics. Within the model, learnable cubic B-splines capture the local nonlinearity of variables at each time step. A Transformer encoder extracts cross-time-step dependencies across the lookback window, and a BiLSTM layer models local temporal dynamics. The model is trained using the Adam optimizer, with early stopping triggered by the Root Mean Square Error (RMSE) on the validation set. Four baselines—BiLSTM, self-attentive BiLSTM, Random Forest, and Gradient Boosting Decision Tree—are included for comparison. Model stability and variable importance are evaluated using rolling starting points and the time-lag permutation test.
    Results The proposed KAN-Transformer-BiLSTM model is applied to a natural gas gathering pipeline in the South China Sea. It achieves an RMSE of 0.082 1 mm/a, a mean absolute percentage error (MAPE) of 10.12%, and a coefficient of determination R2 of 0.9798. Compared with the four baseline models, it reduces RMSE by 81.9%, 82.0%, 78.6%, and 54.8%, while improving R2 by 0.5961, 0.6037, 0.4220, and 0.0785, respectively. The proposed model accurately captures both peak values and post-peak declines in the test set. Rolling-origin validation demonstrates tightly concentrated error distributions across varying starting points, with validation RMSE stabilizing once the maximum iteration count reaches 40. Time-lag permutation test reveals that inputs from day 6 contribute most markedly to model predictions, followed by days 3 and 5. Inputs from day 7 still exert a measurable impact.
    Conclusion The proposed model jointly captures the local nonlinearity of pipeline environmental variables, cross-time-step dependencies within the lookback window, and dynamic corrosion rate variations. Under a strict chronological and leakage-free evaluation protocol, it achieves high prediction accuracy and stability, offering a methodological reference for online early warning of natural gas gathering pipelines.

     

/

返回文章
返回