Prediction of water quality time series based on the dynamic sliding window BP neural network model
-
摘要:
为提高BP神经网络(BPNN)模型对具有时间序列特征水质的预测精准度,采用主成分分析法对原始样本数据进行特征提取和降维,选取溶解性有机碳(DOC)浓度、总氮(TN)浓度和浊度作为水质预测指标,构建了具有3层网络结构的BPNN模型进行预测,并分析其预测性能。结果表明:DOC浓度、TN浓度和浊度的最佳训练集尺寸分别为60、60和90 d,最佳BPNN拓扑结构分别为9-12-1、8-6-1和7-13-1,经优化后的BPNN模型对DOC浓度、TN浓度和浊度的变化趋势整体预测效果较好;相比之下,BPNN模型对水中DOC浓度的预测效果显著优于TN浓度和浊度,其均方根误差(RMSE)、平均绝对百分比误差(MAPE)和相关系数(R)分别为0.040、0.66%和0.867。该模型对具有非线性特征的地表水水质预测具有较好的适用性,预测精度较高。
Abstract:In order to improve the prediction precision of water quality having time series properties by BP neural network (BPNN), principal component analysis (PCA) was used for characteristic extraction and dimension reduction of the original data. Concentrations of dissolved organic compound (DOC) and total nitrogen (TN), and turbidity were selected as the water quality prediction indices, a three-layer BPNN model was established for prediction, and the prediction performance was analyzed. The results showed that the optimal training-set sizes of concentrations of DOC and TN, and turbidity were 60, 60, and 90 days, while the best BPNN topological structures were 9-12-1, 8-6-1 and 7-13-1, respectively. The optimized BPNN model exhibited favorable prediction performance on the variation trends of concentrations of DOC and TN, and turbidity. In contrast, the prediction performance of DOC by BPNN model was significantly better than that of TN and turbidity, with RMSE, MAPE, and R values of 0.040, 0.66% and 0.867, respectively. This model had a good applicability and precision for prediction of surface water qualities having non-linear characteristics.
-
表 1 主成分分析结果
Table 1. Results of principal component analysis
成分 特征值 贡献率/% 1 2.924 26.6 2 2.419 48.6 3 2.094 67.6 4 0.884 75.7 5 0.728 82.3 表 2 主成分系数矩阵
Table 2. Coefficient matrix of the principal components
主成分 1 2 3 4 5 pH −0.626 0.171 −0.253 0.212 0.245 浊度 −0.392 0.813 0.207 −0.010 0.017 DO 0.441 0.463 −0.682 0.001 −0.066 水温 −0.766 −0.321 0.470 0.146 0.068 电导率 0.573 0.209 0.082 0.657 0.262 TN浓度 0.809 −0.098 0.252 0.180 −0.097 NH3-N浓度 0.573 −0.039 0.535 −0.129 −0.338 TP浓度 0.077 0.613 0.552 −0.293 0.143 水中油浓度 0.421 −0.367 −0.339 −0.481 0.516 DOC浓度 0.146 0.890 0.119 −0.089 0.128 ORP −0.286 0.230 −0.714 −0.104 −0.405 表 4 DOC浓度、TN浓度和浊度的最优模型参数
Table 4. Optimized model parameters of DOC concentration, TN concentration, and turbidity
水质
指标训练集
尺寸/d滑动窗
口大小隐含层
单元数模型评价指标 RMSE R MAPE/% DOC浓度 60 9 12 0.051 0.876 0.68 TN浓度 60 8 6 0.591 0.858 10.45 浊度 90 7 13 14.737 0.749 23.60 -
[1] 史斌, 姜继平, 王鹏.基于高频在线水质数据异常的突发污染预警[J]. 中国环境科学,2017,37(11):4394-4400. doi: 10.3969/j.issn.1000-6923.2017.11.046SHI B, JIANG J P, WANG P. Early warning of water pollution incidents based on abnormal change of water quality data from high frequency online monitoring[J]. China Environmental Science,2017,37(11):4394-4400. doi: 10.3969/j.issn.1000-6923.2017.11.046 [2] MAHAJAN A U, CHALAPATIRAO C V, GADKARI S K. Mathematical modeling: a tool for coastal water quality management[J]. Water Science and Technology,1999,40(2):151-157. doi: 10.2166/wst.1999.0110 [3] Fang X B, Zhang J Y, Chen Y X. QUAL2K model used in the water quality assessment of Qiantang River, China[J]. Water Environment Research,2008,80(11):2125-2133. doi: 10.2175/106143008X304794 [4] 沈煜恒, 戴小鹏, 湛誉, 等.基于灰色模型的水质监测预警系统设计[J]. 农业工程,2019,9(8):31-34. doi: 10.3969/j.issn.2095-1795.2019.08.011SHEN Y H, DAI X P, ZHAN Y, et al. Design of water quality monitoring and early warning system based on grey model[J]. Agricultural Engineering,2019,9(8):31-34. doi: 10.3969/j.issn.2095-1795.2019.08.011 [5] 李如忠.水质预测理论模式研究进展与趋势分析[J]. 合肥工业大学学报(自然科学版),2006,29(1):26-30. [6] 黄俊, 周申范, 唐婉莹.TNT生化降解时间序列的人工神经网络预报模型[J]. 环境科学研究,2000,13(2):3-5. doi: 10.3321/j.issn:1001-6929.2000.02.002HUANG J, ZHOU S F, TANG W Y. Artificial neutral network predicting model of TNT biodegradation time series[J]. Research of Environmental Sciences,2000,13(2):3-5. doi: 10.3321/j.issn:1001-6929.2000.02.002 [7] 李春华, 胡文, 叶春, 等.基于BP神经网络预测地表水净化装置总氮的去除效果[J]. 环境工程技术学报,2018,8(6):651-655. doi: 10.3969/j.issn.1674-991X.2018.06.086LI C H, HU W, YE C. Study on prediction of total nitrogen removal of a surface water purification device based on BP neural network[J]. Journal of Environmental Engineering Technology,2018,8(6):651-655. doi: 10.3969/j.issn.1674-991X.2018.06.086 [8] 林佳敏, 陈金良, 林晶晶, 等.BP神经网络和ARIMA模型对污水处理厂出水总氮浓度的模拟预测[J]. 环境工程技术学报,2019,9(5):573-578. doi: 10.12153/j.issn.1674-991X.2019.03.261LIN J M, CHEN J L, LIN J J, et al. The simulation and prediction of TN in wastewater treatment effluent using BP neural network and ARIMA model[J]. Journal of Environmental Engineering Technology,2019,9(5):573-578. doi: 10.12153/j.issn.1674-991X.2019.03.261 [9] 左朝晖, 李绍康, 杨津津, 等.基于GA-BP神经网络的页岩气开发区域水资源承载力研究[J]. 环境工程技术学报,2021,11(1):194-201. doi: 10.12153/j.issn.1674-991X.20200081ZUO Z H, LI S K, YANG J L, et al. Research on water resources carrying capacity of shale gas development area based on GA-BP neural network[J]. Journal of Environmental Engineering Technology,2021,11(1):194-201. doi: 10.12153/j.issn.1674-991X.20200081 [10] 刘宇同. 一种基于人工神经网络的地表水质预测方法[D]. 哈尔滨: 哈尔滨工程大学, 2017. [11] 赵文喜, 周滨, 刘红磊, 等.基于BP神经网络的海河干流叶绿素浓度短时预测研究[J]. 水利水电技术,2017,48(11):134-140. [12] 张青, 王学雷, 张婷, 等.基于BP神经网络的洪湖水质指标预测研究[J]. 湿地科学,2016,14(2):212-218.ZHANG Q, WANG X L, ZHANG T, et al. Prediction of water quality index of Honghu Lake based on back propagation neural network model[J]. Wetland Science,2016,14(2):212-218. [13] 赵林, 戴天骄, 陈亮, 等.基于BP神经网络的桃林口水库水质预测[J]. 安徽农业科学,2019,47(24):73-77. doi: 10.3969/j.issn.0517-6611.2019.24.024ZHAO L, DAI T J, CHEN L, et al. Prediction of water quality in Taolinkou Reservoir based on BP neural network model[J]. Journal of Anhui Agricultural Sciences,2019,47(24):73-77. doi: 10.3969/j.issn.0517-6611.2019.24.024 [14] 刘双印. 基于计算智能的水产养殖水质预测预警方法研究[D]. 北京: 中国农业大学, 2014. [15] 袁红春, 赵彦涛, 刘金生.基于PCA-NARX神经网络的氨氮预测[J]. 大连海洋大学学报,2018,33(6):808-813.YUAN H C, ZHAO Y T, LIU J S. Ammonia nitrogen level forecasting based on PCA-NARX neural network[J]. Journal of Dalian Ocean University,2018,33(6):808-813. [16] 袁红春, 黄俊豪, 赵彦涛.基于PCA-NARX神经网络的溶解氧预测[J]. 山东农业大学学报(自然科学版),2019,50(5):902-907. [17] MULIA I E, TAY H, ROOPSEKHAR K, et al. Hybrid ANN-GA model for predicting turbidity and chlorophyll-a concentrations[J]. Journal of Hydro-Environment Research,2013,7(4):279-299. doi: 10.1016/j.jher.2013.04.003 [18] 王佳楠. 基于BP神经网络的高锰酸盐指数预测研究 : 以渭南潼关吊桥段为例[D]. 西安: 长安大学, 2017. [19] 肖金球, 周翔, 潘杨, 等.GA-BP优化TS模糊神经网络水质监测与评价系统预测模型的应用: 以太湖为例[J]. 西南大学学报(自然科学版),2019,41(12):110-119. [20] LACHENBRUCH P A, COHEN J. Statistical power analysis for the behavioral sciences[J]. Journal of the American Statistical Association,1989,84(408):1096. [21] 查木哈, 卢志宏, 翟继武, 等.双隐含层BP神经网络模型在老哈河水质预测中的应用[J]. 水资源与水工程学报,2018,29(2):56-61. ⊕ doi: 10.11705/j.issn.1672-643X.2018.02.10