Prediction of effluent COD based on quantum weighted minimal gated unit network
-
摘要:
出水化学需氧量(COD)的快速准确测量对于污水处理过程水质的动态调控至关重要。针对出水COD难以实时检测的问题,提出一种基于量子加权最小门限单元(QWMGU)神经网络的出水COD预测方法。先通过多维单步(滑动窗口)预测技术构建时间序列;然后在最小门限单元(MGU)遗忘门、候选状态与输出环节设计量子计算机制,通过更新量子相移门矩阵替代MGU权值矩阵的更新,赋予网络神经元量子特性,并给出QWMGU模型设计的具体规则与构建流程。应用该方法对德州市污水处理厂2020年出水COD进行预测,并与5种流行预测模型进行对比,以检验模型优越性。结果表明:QWMGU网络的相对预测误差优于其他方法,且稳定性较高,其均方根误差、确定系数、平均绝对误差分别为0.073、1、0.047。该模型有助于实现污水处理厂COD的高效在线检测。
Abstract:Rapid and accurate measurement of effluent chemical oxygen demand (COD) was essential for the dynamic regulation of water quality in wastewater treatment processes. In order to solve the problem of real-time detection of COD in the effluent, a COD prediction method based on quantum weighted minimal gate unit (QWMGU) neural network was proposed. The time series was first constructed through a multi-dimensional single-step (sliding window) prediction technique; then quantum computing mechanism was designed in the links of forgetting gate, candidate state and output of the minimal gated unit (MGU). The network neurons were endowed with quantum characteristics by updating the quantum phase shift gate matrix instead of the MGU weight matrix, and the specific rules and construction process of the QWMGU model design were given. The method was applied to the prediction of effluent COD of the wastewater treatment plant in Dezhou City in 2020 and compared with five usual prediction models to test the model's superiority. The results showed that the relative prediction error of the QWMGU network was better than other methods and more stable, with the root mean square error, coefficient of determination and mean absolute error of 0.073, 1 and 0.047, respectively. The model helped to achieve efficient online detection of COD in wastewater treatment plants.
-
表 1 出水COD预测模型相关变量
Table 1. Relevant variables of COD concentration prediction model for effluent water
采集时间
(2020-01-01)COD/
(mg/L)NH3-N浓
度/(mg/L)WD/m3 TP浓度/
(mg/L)TN浓度/
(mg/L)pH 00:00
01:00
02:0021.6
20.1
20.15.29
4.87
4.872632
2636
26280.26
0.26
0.2616.7
16.7
16.68.44
8.44
8.44表 2 5种时间步数预测结果对比
Table 2. Comparison of prediction results of five timesteps
时间步数 RMSE MAE R2 训练时间/s 3
6
9
12
240.073
0.069
0.110
0.145
0.0550.047
0.041
0.089
0.111
0.0331.000
1.000
0.999
0.999
1.000171.77
235.14
289.78
346.54
572.59注:加粗字体表示最优结果。下同。 表 3 7种优化器预测结果对比
Table 3. Comparison of prediction results of seven optimizers
优化器 RMSE MAE R2 MSE min_E max_E 训练时间/s Adam
Sgd
Agd
Mon
Fo
Rms
Pgd0.073
0.530
0.152
0.408
—
0.509
0.3670.047
0.415
0.295
0.292
—
0.345
0.2831.000
0.981
0.998
0.988
—
0.982
0.9910.007
0.281
0.017
0.295
—
0.259
0.1350.000 1
0.085 0
0.000 1
0.002 1
—
0.000 2
0.000 21.174
2.824
1.167
1.899
—
4.445
2.484171.77
154.39
191.48
157.88
105.59
164.37
151.85注:—为未收敛。min_E和max_E分别为样本实际值与预测值绝对误差的最小值和最大值。 表 4 6种模型量化预测结果对比
Table 4. Comparison of quantitative prediction results of six models
预测模型 RMSE MAE R2 MSE min_E max_E 训练时间/s LSTM
GRU
MGU
QWLSTM
QWGRU
QWMGU0.132
0.143
0.153
0.119
0.121
0.0730.081
0.082
0.089
0.078
0.078
0.0470.998
0.998
0.998
0.999
0.999
1.0000.027
0.020
0.032
0.016
0.019
0.0072.84×10−5
3.99×10−5
3.02×10−5
2.93×10−5
2.72×10−5
1.13×10-51.889
2.216
2.177
1.148
1.490
1.174215.97
190.36
169.48
217.83
198.24
171.77 -
[1] ZOU Q H, XIONG Q Y, LI Q D, et al. A water quality prediction method based on the multi-time scale bidirectional long short-term memory network[J]. Environmental Science and Pollution Research,2020,27(14):16853-16864. doi: 10.1007/s11356-020-08087-7 [2] 王龙洋, 蒙西, 乔俊飞.基于改进集合经验模态分解和深度信念网络的出水总磷预测[J]. 化工学报,2021,72(5):2745-2753.WANG L Y, MENG X, QIAO J F. Prediction of effluent total phosphorus based on modified ensemble empirical mode decomposition and deep belief network[J]. CIESC Journal,2021,72(5):2745-2753. [3] 张梦迪, 徐庆, 刘振鸿, 等.基于动态滑动窗口BP神经网络的水质时间序列预测[J]. 环境工程技术学报,2022,12(3):809-815.ZHANG M D, XU Q, LIU Z H, et al. Prediction of water quality time series based on the dynamic sliding window BP neural network model[J]. Journal of Environmental Engineering Technology,2022,12(3):809-815. [4] 杨壮, 武利, 乔俊飞.基于GM-RBF神经网络的污水环境预测[J]. 控制工程,2019,26(9):1728-1732.YANG Z, WU L, QIAO J F. Prediction of sewage environment based on GM-RBF[J]. Control Engineering of China,2019,26(9):1728-1732. [5] 左朝晖, 李绍康, 杨津津, 等.基于GA-BP神经网络的页岩气开发区域水资源承载力研究[J]. 环境工程技术学报,2021,11(1):194-201. doi: 10.12153/j.issn.1674-991X.20200081ZUO Z H, LI S K, YANG J J, 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 [6] 吴永强, 李明凯, 唐中楠, 等.基于灰色动态模型群的衡水市居民年用水量预测[J]. 环境工程技术学报,2022,12(1):267-274. doi: 10.12153/j.issn.1674-991X.20210233WU Y Q, LI M K, TANG Z N, et al. Projection of residential annual water consumption in Hengshui City based on dynamic gray model groups[J]. Journal of Environmental Engineering Technology,2022,12(1):267-274. doi: 10.12153/j.issn.1674-991X.20210233 [7] 邓淏丹, 叶露锋, 刘丽香, 等.城市生态安全研究进展[J]. 环境工程技术学报,2022,12(1):248-259. doi: 10.12153/j.issn.1674-991X.20210179DENG H D, YE L F, LIU L X, et al. Review of urban ecological security research[J]. Journal of Environmental Engineering Technology,2022,12(1):248-259. doi: 10.12153/j.issn.1674-991X.20210179 [8] 李春华, 胡文, 叶春, 等.基于BP神经网络预测地表水净化装置总氮的去除效果[J]. 环境工程技术学报,2018,8(6):651-655.LI C H, HU W, YE C, et al. Study on prediction of total nitrogen removal effect of a surface water purification device based on BP neural network[J]. Journal of Environmental Engineering Technology,2018,8(6):651-655. [9] YANG Y K, KIM K R, KOU R R, et al. Prediction of effluent quality in a wastewater treatment plant by dynamic neural network modeling[J]. Process Safety and Environmental Protection,2022,158:515-524. doi: 10.1016/j.psep.2021.12.034 [10] 林佳敏, 陈金良, 林晶晶, 等.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 [11] 乔俊飞, 孙玉庆, 韩红桂.改进K-means算法优化RBF神经网络的出水氨氮预测[J]. 控制工程,2018,25(3):375-379.QIAO J F, SUN Y Q, HAN H G. Prediction of effluent ammonia nitrogen based on improved K-means algorithm optimizing RBF neural network[J]. Control Engineering of China,2018,25(3):375-379. [12] FANG H Y, GAN S W, XUE C Y. Evaluation of regional water resources carrying capacity based on binaryindex method and reduction index method[J]. Water Science and Engineering,2019,12(4):263-273. doi: 10.1016/j.wse.2019.12.008 [13] 贾丽杰, 李文静, 乔俊飞.基于神经元特性的径向基函数神经网络自组织设计方法[J]. 控制理论与应用,2020,37(12):2618-2626.JIA L J, LI W J, QIAO J F. Self-organizing design of radial basis function neural network based on neuron characteristics[J]. Control Theory & Applications,2020,37(12):2618-2626. [14] 乔俊飞, 周红标.基于自组织模糊神经网络的出水总磷预测[J]. 控制理论与应用,2017,34(2):224-232. doi: 10.7641/CTA.2017.60309QIAO J F, ZHOU H B. Prediction of effluent total phosphorus based on self-organizing fuzzy neural network[J]. Control Theory & Applications,2017,34(2):224-232. doi: 10.7641/CTA.2017.60309 [15] 李文静, 李萌, 乔俊飞.基于互信息和自组织RBF神经网络的出水BOD软测量方法[J]. 化工学报,2019,70(2):687-695. doi: 10.11949/j.issn.0438-1157.20181362LI W J, LI M, QIAO J F. Effluent BOD soft measurement based on mutual information and self-organizing RBF neural network[J]. CIESC Journal,2019,70(2):687-695. doi: 10.11949/j.issn.0438-1157.20181362 [16] 廉小亲, 王俐伟, 安飒, 等.基于SOM-RBF神经网络的COD软测量方法[J]. 化工学报,2019,70(9):3465-3472.LIAN X Q, WANG L W, AN S, et al. On soft sensor of chemical oxygen demand by SOM-RBF neural network[J]. CIESC Journal,2019,70(9):3465-3472. [17] 穆瑞, 乐高杨, 杨慧中.基于O3/UV法在线COD检测的气体溶解量估计方法[J]. 化工学报,2019,70(2):730-735.MU R, LE G Y, YANG H Z. Estimation method of dissolved gas quantity in COD determination based on O3/UV[J]. CIESC Journal,2019,70(2):730-735. [18] 陈中林, 杨翠丽, 乔俊飞.基于TG-LSTM神经网络的非完整时间序列预测[J]. 控制理论与应用,2022,39(5):867-878.CHEN Z L, YANG C L, QIAO J F. The prediction of incomplete time series via TG-LSTM neural network[J]. Control Theory & Applications,2022,39(5):867-878. [19] 乔俊飞, 丁海旭, 李文静.基于WTFMC算法的递归模糊神经网络结构设计[J]. 自动化学报,2020,46(11):2367-2378.QIAO J F, DING H X, LI W J. Structure design for recurrent fuzzy neural network based on wavelet transform fuzzy Markov chain[J]. Acta Automatica Sinica,2020,46(11):2367-2378. [20] 高德欣, 刘欣, 杨清.基于卷积神经网络与双向长短时融合的锂离子电池剩余使用寿命预测[J]. 信息与控制,2022,51(3):318-329. doi: 10.13976/j.cnki.xk.2022.1205GAO D X, LIU X, YANG Q. Remaining useful life prediction of lithium-ion battery based on CNN and BiLSTM fusion[J]. Information and Control,2022,51(3):318-329. doi: 10.13976/j.cnki.xk.2022.1205 [21] MIAO S, ZHOU C L, ALQAHTANI S A, et al. Applying machine learning in intelligent sewage treatment: a case study of chemical plant in sustainable cities[J]. Sustainable Cities and Society,2021,72:103009. doi: 10.1016/j.scs.2021.103009 [22] JIANG Y Q, LI C L, SUN L, et al. A deep learning algorithm for multi-source data fusion to predict water quality of urban sewer networks[J]. Journal of Cleaner Production,2021,318:128533. doi: 10.1016/j.jclepro.2021.128533 [23] ZHOU G B, WU J X, ZHANG C L, et al. Minimal gated unit for recurrent neural networks[J]. International Journal of Automation and Computing,2016,13(3):226-234. doi: 10.1007/s11633-016-1006-2 [24] OREKHOV G, LUQUE J, LERNER Z F. Closing the loop on exoskeleton motor controllers: benefits of regression-based open-loop control[J]. IEEE Robotics and Automation Letters,2020,5(4):6025-6032. doi: 10.1109/LRA.2020.3011370 [25] LI F, XIANG W, WANG J X, et al. Quantum weighted long short-term memory neural network and its application in state degradation trend prediction of rotating machinery[J]. Neural Networks,2018,106:237-248. doi: 10.1016/j.neunet.2018.07.004 [26] 李锋, 向往, 王家序, 等.基于量子加权门限重复单元神经网络的性态退化趋势预测[J]. 振动与冲击,2019,38(1):123-129.LI F, XIANG W, WANG J X, et al. Performance degradation trend prediction method for rotating machinery based on QWGRUNN[J]. Journal of Vibration and Shock,2019,38(1):123-129. [27] 李锋, 陈勇, 向往, 等.基于量子加权长短时记忆神经网络的状态退化趋势预测[J]. 仪器仪表学报,2018,39(7):217-225.LI F, CHEN Y, XIANG W, et al. State degradation trend prediction based on quantum weighted long short-term memory neural network[J]. Chinese Journal of Scientific Instrument,2018,39(7):217-225. [28] 程阳洋, 李锋, 汤宝平, 等.量子基因链编码双向神经网络用于旋转机械剩余使用寿命预测[J]. 仪器仪表学报,2020,41(7):164-174.CHENG Y Y, LI F, TANG B P, et al. Quantum gene chain coding bidirectional neural network for residual useful life prediction of rotating machinery[J]. Chinese Journal of Scientific Instrument,2020,41(7):164-174. ⊗