﻿ 基于WOA-BP算法的海底管道腐蚀速率预测
 海洋科学  2022, Vol. 46 Issue (6): 116-123 PDF
http://dx.doi.org/10.11759/hykx20210823003

文章信息

XIAO Rong-ge, JIN Shuai-shuai. 2022.

Prediction of the submarine pipeline corrosion rate based on the whale optimization algorithm and back propagation (WOA-BP) algorithm

Marina Sciences, 46(6): 116-123.
http://dx.doi.org/10.11759/hykx20210823003

文章历史

Prediction of the submarine pipeline corrosion rate based on the whale optimization algorithm and back propagation (WOA-BP) algorithm
XIAO Rong-ge, JIN Shuai-shuai
Shaanxi Key Laboratory of Advanced Stimulation Technology for Oil & Gas Reservoirs, College of Petroleum Engineering, Xi'an Shiyou University, Xi'an 710065, China
Abstract: Many factors affect the pipeline corrosion rate, constituting a highly complex corrosion system; thus, accurately predicting the pipeline corrosion rate is difficult. A single back propagation (BP) model can easily fall into the local optimum due to an improper selection of the initial weight and threshold value. To address this problem, the whale optimization algorithm (WOA) algorithm is introduced for BP neural network optimization to predict the corrosion rate of a submarine pipeline. Then, it is compared with the GA and PSO algorithms to optimize the BP prediction model to verify the prediction effect and feasibility of the WOA-BP model. The results show that the average absolute percentage and root mean square errors of the WOA-BP model are 3.689% and 0.1537, respectively, considerably lower than those of the single BP, PSO-BP, and GA-BP models. It has high prediction accuracy and stability and can provide decision support for corrosion protection in the submarine pipeline and flow guarantee of the oil and gas pipeline.
Key words: corrosion rate    WOA algorithm    BP model    GA algorithm    PSO algorithm

1 BP神经网络及各优化算法原理 1.1 BP神经网络

BP神经网络[10-11]是一类多层的前馈神经网络, 其原理是: 通过大量的网络训练, 利用误差的反向传播, 不断调整网络的权值和阈值, 减小误差, 实现复杂变量的非线性映射和数据联想功能。BP神经网络一般采用三层网络拓扑结构即输入层、隐含层和输出层, 如图 1所示。输入层和输出层的节点数由输入数据和输出数据的类型确定, 隐含层的节点数由式(1)确定。当样本数据输入之后, 神经元被激活, 沿输入层→隐含层→输出层路径传播计算, 而输出误差沿相反路径反馈到输入层, 此时变量正传播与误差逆传播交替进行。如果预测不合理, 通过对隐含层的权值和阈值进行修正, 不断迭代, 直至预测结果满足要求。

 $m = \sqrt {n + 1} + \alpha ,$ (1)
 图 1 BP神经网络结构 Fig. 1 Structure of the back propagation neural network

1.2 WOA算法

WOA算法通过模拟座头鲸的觅食行为, 构建出随机搜索捕食、包围捕食和气泡网捕食等理论模型, 以实现对目标问题的优化求解, 具有稳定性强、调节参数少等优点[12-13]

 $X(t+1)=\left\{ \begin{array}{l}{X}^{*}(t)-AD& p＜0.5\\ {D}^{\prime }{e}^{bl}\mathrm{cos}(2\pi t)+{X}^{*}(t)& p\ge 0.5\end{array} \right.$ (2)

1.3 GA算法

1.4 PSO算法

2 管道腐蚀速率预测模型构建 2.1 模型搭建

 图 2 各预测模型流程图 Fig. 2 Flow chart of each prediction model
2.2 模型评价指标

 ${\rm{MAPE}}{{ = }}\frac{{\text{1}}}{N}\sum\limits_{i = 1}^N {\left| {\frac{{{y_i} - {{\widehat y}_i}}}{{{y_i}}}} \right|} \times 100\% ,$ (3)
 ${\rm{RMSE}} = \sqrt {\frac{{\text{1}}}{N}\sum\limits_{i = 1}^N {{{\left( {{y_i} - {{\widehat y}_i}} \right)}^2}} } ,$ (4)

3 实例计算 3.1 样本数据的收集与处理

 编号 x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 1 2.838 5 65.9 2.27 0.031 7 5.1 0.64 7 560 26.8 58.5 141 2 2.621 8 69.4 2.09 0.032 0 4.3 0.69 8 000 23.4 60.3 134 3 2.718 6 67.9 2.11 0.032 5 5.0 0.557 7 260 23.1 57.8 149 4 2.692 4 64.0 2.65 0.031 7 6.1 0.365 6 480 23.2 60.1 141 5 2.953 3 68.0 1.78 0.032 4 4.2 0.524 4 800 25.9 61.5 148 6 2.955 5 64.3 2.22 0.031 2 6.2 0.491 5 620 29.7 54.2 136 7 2.717 5 64.9 2.23 0.032 6 5.2 0.406 7 120 24.5 50.9 150 8 2.621 5 65.3 2.35 0.030 5 4.6 0.547 7 680 20.3 57.5 129 9 2.599 7 67.7 2.41 0.032 6 4.5 0.628 8 020 19.8 62.3 150 10 2.606 3 66.4 2.31 0.031 7 4.2 0.511 8 280 20.6 59.8 141 注: x0为腐蚀速率(mm·a–1), x1为温度(℃), x2为系统压力(MPa), x3为CO2分压(MPa), x4为pH值, x5为介质流速(m·s–1), x6为Cl–浓度(mg·L–1), x7为CO2浓度(mg·L–1), x8为含水率(%), x9为HCO3–浓度(mg·L–1)。
3.2 灰色关联分析

 影响因素 x1 x2 x3 x4 x5 x6 x7 x8 x9 关联度 0.762 3 0.723 7 0.734 0.641 5 0.667 2 0.637 6 0.709 6 0.695 2 0.755 4

3.3 模型参数设置 3.3.1 BP神经网络设置

 图 3 m取不同值的训练均方误差 Fig. 3 Training mean square error of the different values of m

3.3.2 模型初始化设置

 参数 数值 初始种群规模 30 最大进化代数 50 交叉概率 0.8 变异概率 0.2 训练目标最小误差 0.000 01

 参数 数值 初始种群规模 10 最大进化代数 50 个体加速常数C1 2 社会加速常数C2 2 惯性权重 0.9 训练目标最小误差 0.000 01

 参数 数值 初始种群规模 30 最大进化代数 50 训练目标最小误差 0.000 01

WOA除了设置表 5中参数, 还需要对位置向量和领导者得分进行初始化操作。

3.4 预测结果与误差检验

 样本编号 实验值 BP PSO-BP GA-BP WOA-BP 预测值/(mm·a–1) 相对误差/% 预测值/(mm·a–1) 相对误差/% 预测值/(mm·a–1) 相对误差/% 预测值/(mm·a–1) 相对误差/% 1 2.953 3 2.552 5 13.57 2.622 3 11.21 2.611 5 11.57 2.947 4 0.20 2 3.105 4 2.788 0 10.22 3.068 3 1.19 3.179 5 2.39 2.723 3 12.30 3 2.664 7 2.780 3 4.34 2.854 5 7.12 2.839 6 6.56 2.724 4 2.24 4 2.532 3 2.470 8 2.43 2.403 4 5.09 2.809 6 10.95 2.604 1 2.84 5 3.081 3 2.456 1 20.29 3.252 6 5.56 2.902 2 5.81 3.017 9 2.06 6 2.695 6 2.798 0 3.80 2.619 8 2.81 2.809 7 4.23 2.635 4 2.23 7 2.607 2 2.610 9 0.14 2.675 7 2.63 2.622 8 0.60 2.608 1 0.03 8 2.629 1 2.603 4 0.98 2.665 5 1.38 2.843 5 8.15 2.703 7 2.84 9 2.357 4 2.716 4 15.23 2.816 0 19.45 2.611 6 10.78 2.617 2 11.02 10 2.618 3 2.891 0 10.42 2.677 0 2.24 2.608 9 0.36 2.588 6 1.13

 图 4 各模型预测结果对比图 Fig. 4 Comparison of the prediction results of each model

 图 5 各模型相对误差对比 Fig. 5 Comparison of the relative errors of various models

 图 6 各模型MAPE与RMSE Fig. 6 MAPE and RMSE of each model

3.5 WOA-BP模型的适用范围

4 结论

1) 基于灰色理论, 对影响海底管道腐蚀速率的9个影响变量进行灰色关联分析, 得到各影响变量对腐蚀速率的关联度从大到小依次为: 温度 > HCO3 > CO2分压 > 系统压力 > CO2浓度 > 含水率 > 介质流速 > pH > Cl浓度。结果表明: 各影响因素与腐蚀速率的相关性都很大, 可以作为预测模型的输入参数。

2) 分别采用单一BP模型、PSO-BP模型、GA-BP模型以及WOA-BP模型对海底管道腐蚀速率进行训练和仿真。WOA-BP模型的平均绝对百分误差和均方根误差分别为3.689%和0.153 7, 远低于单一BP、PSO-BP、GA-BP模型, 验证了WOA-BP模型的预测精度和稳定性。说明WOA-BP模型可为海底管道内腐蚀防护和油气管道流动保障提供决策支持。

3) 由于影响管道腐蚀的因素众多且相互作用, 工程上很难得到完整的实验数据, 后续研究可在数据中添加随机变量进行深入研究。

 [1] 崔铭伟. 多相流海管CO2内腐蚀及剩余强度研究[D]. 青岛: 中国石油大学(华东), 2014. Cui Mingwei. Study on CO2 internal corrosion and residual strength of multiphase offshore pipeline[D]. Qingdao: China University of Petroleum, 2014. [2] 喻西崇, 赵金洲, 邬亚玲, 等. 利用灰色理论预测注水管道腐蚀速率的变化趋势[J]. 腐蚀与防护, 2003, 24(2): 51-54, 69. Yu Xichong, Zhao Jinzhou, Wu Yaling, et al. Using gray model to predict corrosion rate variation with time in injecting pipeline[J]. Corrosion & Protection, 2003, 24(2): 51-54, 69. DOI:10.3969/j.issn.1005-748X.2003.02.002 [3] 范峥, 付文耀, 赵笑男, 等. 基于小波神经网络预测多相动态管道腐蚀速率[J]. 化工进展, 2018, 37(8): 2904-2911. Fan Zheng, Fu Wenyao, Zhao Xiaonan, et al. Prediction of tubular corrosion rate under multiphase dynamics condition based on wavelet neural network[J]. Chemical Industry and Engineering Progress, 2018, 37(8): 2904-2911. [4] 章玉婷, 杨剑锋. 基于BP神经网络的管道腐蚀速率预测[J]. 全面腐蚀控制, 2013, 27(9): 67-71. Zhang Yuting, Yang Jianfeng. Corrosion rate prediction of based on artificial neural network[J]. Total Corrosion Control, 2013, 27(9): 67-71. DOI:10.3969/j.issn.1008-7818.2013.09.023 [5] 周慧, 王晓光, 张有君. 输气管道腐蚀速率的BP神经网络组合预测方法[J]. 腐蚀科学与防护技术, 2010, 22(3): 162-165. Zhou Hui, Wang Xiaoguang, Zhang Youjun. BP neural networks combinatorial forecasting method for gas pipeline's corrosion rate[J]. Corrosion Science and Protection Technology, 2010, 22(3): 162-165. [6] 万里平, 徐友红, 冯兆阳, 等. 基于遗传算法优化BP神经网络预测CO2/H2S环境中套管钢的腐蚀速率[J]. 腐蚀与防护, 2017, 38(9): 727-731, 736. Wan Liping, Xu Youhong, Feng Zhaoyang, et al. Application of genetic algorithms BP neural networks to predicting corrosion rate of carbon steel in CO2/H2S environment[J]. Corrosion & Protection, 2017, 38(9): 727-731, 736. [7] 凌晓, 徐鲁帅, 梁瑞, 等. 基于改进PSO-BPNN的输油管道内腐蚀速率研究[J]. 中国安全生产科学技术, 2019, 15(10): 63-68. Ling Xiao, Xu Lushuai, Liang Rui, et al. Study on internal corrosion rate of oil pipeline based on improved PSO-BPNN[J]. Journal of Safety Science and Technology, 2019, 15(10): 63-68. [8] Mirjalili s, Lewis A, et al. The whale optimization algorithm[J]. Advances in Engineering Software, 2016, 95: 51-67. DOI:10.1016/j.advengsoft.2016.01.008 [9] 王镱嬴. 基于改进鲸鱼算法的神经网络预测模型的研究[D]. 鞍山: 辽宁科技大学, 2020. Wang Yiying. Research of neural network orediction model based on modified whale optimization algorithm[D]. Anshan: University of Science and Technology Liaoning, 2020. [10] 李海涛, 袁森. 基于遗传算法和BP神经网络的海洋工程材料腐蚀预测研究[J]. 海洋科学, 2020, 44(10): 33-38. Li Haitao, Yuan Sen. Corrosion prediction of marine engineering materials based on genetic algorithm and BP neural network[J]. Marine Sciences, 2020, 44(10): 33-38. [11] 凌晓, 徐鲁帅, 余建平, 等. 基于改进的BP神经网络的输油管道内腐蚀速率预测[J]. 传感器与微系统, 2021, 40(2): 124-127. Ling Xiao, Xu Lushuai, Yu Jianping, et al. Prediction of corrosion rate in oil pipeline based on improved BP neural network[J]. Transducer and Microsystem Technologies, 2021, 40(2): 124-127. [12] 骆正山, 秦越, 张新生, 等. 基于LASSO-WOA- LSSVM的海洋管线外腐蚀速率预测[J]. 表面技术, 2021, 50(5): 245-252. Luo Zhengshan, Qin Yue, Zhang Xinsheng, et al. Prediction of external corrosion rate of marine pipelines based on LASSO-WOA-LSSVM[J]. Surface Technology, 2021, 50(5): 245-252. [13] 巩世兵, 沈海斌. 仿生策略优化的鲸鱼算法研究[J]. 传感器与微系统, 2017, 36(12): 10-12. Gong Shibing, Shen Haibin. Study of whale algorithm for biomimetic strategy optimization[J]. Transducer and Microsystem Technologies, 2017, 36(12): 10-12. [14] 李志鹏, 陈堂贤. 基于变分模态分解和改进鲸鱼算法优化的神经网络风速预测模型[J]. 电器与能效管理技术, 2019(11): 24-31. Li Zhipeng, Chen Tangxian. Optimized fuzzy neural network wind speed prediction model based on VMD and improved whale algorithm[J]. Electrical & Energy Management Technology, 2019(11): 24-31. [15] Holland J H. Genetic algorithms[J]. Scientific american, 1992, 267(1): 66-73. DOI:10.1038/scientificamerican0792-66 [16] 向乃瑞, 闫海, 王炜, 等. GA-BP神经网络预测金属腐蚀速率[J]. 电力学报, 2018, 33(1): 48-54. Xiang Nairui, Yan Hai, Wang Wei, et al. Prediction of metal corrosion rate based on GA-BP neural network[J]. Journal of Electric Power, 2018, 33(1): 48-54. [17] 商杰, 朱战立. 基于遗传算法的神经网络在预测油管钢腐蚀速率中的应用[J]. 腐蚀科学与防护技术, 2007, 19(3): 225-228. Shang Jie, Zhu Zhanli. Application of genetic algorithms neural networks in prediction corrosion rate of carbon steel[J]. Corrosion Science and Protection Technology, 2007, 19(3): 225-228. DOI:10.3969/j.issn.1002-6495.2007.03.020 [18] Kennedy J, Eberhart R. Particle swarm optimization[C]// Icnn95-international Conference on Neural Networks. IEEE, 2002. [19] 张新生, 张玥. 基于Lasso-PSO-BP神经网络的腐蚀管道失效压力的预测[J]. 材料保护, 2020, 53(4): 46-52. Zhang Xinsheng, Zhang Yue. Prediction of failure pressure of corroded pipeline based on Lasso-PSO-BP neural network[J]. Materials Protection, 2020, 53(4): 46-52. [20] 黄宝洲, 杨俊华, 卢思灵, 等. 基于改进粒子群优化神经网络算法的波浪捕获功率预测[J]. 太阳能学报, 2021, 42(2): 302-308. Huang Baozhou, Yang Junhua, Lu Siling, et al. Wave capture power forecasting based on improved particle swarm optimization neural network algorithm[J]. Acta Energiae Solaris Sinica, 2021, 42(2): 302-308. [21] 张玥. 基于有限元和PSO-BP的多点腐蚀缺陷管道剩余强度研究[D]. 西安: 西安建筑科技大学, 2020. Zhang Yue. Residual strength of multi-point corroded pipeline based on finite element and PSO-BP[D]. Xi'an: Xi'an University of Architecture and Technology, 2020. [22] 纪广月. 基于因子分析和WOA-Elman的肇庆API预测研究[J]. 数学的实践与认识, 2021, 51(11): 265-276. Ji Guangyue. Prediction of Zhaoqing API based on factor analysis and WOA Elman neural network[J]. Mathematics in Practice and Theory, 2021, 51(11): 265-276. [23] 宋莹莹. 在役海底油气管道内腐蚀速率预测研究[D]. 西安: 西安建筑科技大学, 2020. Song Yingying. Research for internal corrosion rate prediction of submarine oil and gas pipelines in service[D]. Xi'an: Xi'an University of Architecture and Technology, 2020. [24] 邓聚龙. 灰色系统论文集[M]. 武汉: 华中理工大学出版社, 1989. Deng Julong. Collection of grey system essays[M]. Wuhan: Huazhong University of Science and Technology Press, 1989.