Water quality monitoring and grade judgment system based on IGWOPSO-SVM algorithm
-
摘要:目的
水污染监测是流域水污染防治工作的前提。为实现高精度的地表水水质监测及水体等级评定,本研究设计基于IGWOPSO-SVM(Improved grey wolf optimizer particle swarm optimization-support vector machine)模型的水质监测及等级评定系统。
方法选用传感器组、STM32F103单片机、ESP8266WIFI无线通信模块搭建水质监测系统数据处理模块,利用WIFI无线通信将数据处理模块采集到的水质数据传输至服务器,设计水质监测系统服务器交互端,同时开发水质监测小程序对水质等级进行实时监测。基于改进粒子群算法(Improved particle swarm optimization,IPSO)及灰狼算法(Grey wolf optimizer,GWO)提出了IGWOPSO算法,对SVM进行优化,据此提出了IGWOPSO-SVM水质等级评定算法。基于南京市玄武湖、金川河、江浦水源地135组水质数据对本系统水质等级评定效果进行试验验证。
结果相比于SVM,IGWOPSO-SVM水质等级评定算法的总样本分类准确率由86.67%上升至100.00%,上升了13.33个百分点;相比于粒子群算法(Particle swarm optimization,PSO),IGWOPSO算法的最佳适应度由86.80上升至99.20,提高了14.29%。
结论本研究解决了传统水体等级评定方法效率低、准确率低的问题,为地表水水质的精确监测提供了方法借鉴。
Abstract:ObjectiveWater pollution monitoring is a prerequisite for water pollution prevention and control in watersheds. In order to achieve high accuracy of surface water quality monitoring and water body rating judgement, we designed a water quality monitoring and rating system based on IGWOPSO-SVM (Improved grey wolf optimizer particle swarm optimization-support vector machine) model.
MethodWe selected sensor group, STM32F103 microcontroller, ESP8266WIFI wireless communication module to build a water quality monitoring system data processing module. The WIFI wireless communication transmitted the water quality data collected by data processing module to the server. We designed water quality monitoring system server interactive end, while developing water quality monitoring applet for real-time monitoring of water quality grade. Based on the improved particle swarm optimization (IPSO) and grey wolf optimizer (GWO), the IGWOPSO algorithm was proposed to optimize SVM algorithm, according to which the IGWOPSO-SVM water quality rating algorithm was proposed. The water quality rating effect of this system was verified by experiment based on 135 groups water quality data of Nanjing Xuanwu Lake, Jinchuan River and Jiangpu water source.
ResultCompared with SVM, the total sample classification accuracy of IGWOPSO-SVM water quality rating algorithm increased from 86.67% to 100.00%, with an increase of 13.33 percent. Compared with particle swarm optimization (PSO), the best adaptation degree of IGWOPSO algorithm increased from 86.80 to 99.20, with an increase of 14.29%.
ConclusionThis study solves the problems of low efficiency and low accuracy of traditional water body rating methods, and provides a method reference for accurate monitoring of surface water quality.
-
-
表 1 地表水各指标不同等级的标准质量浓度
Table 1 Standard mass concentrations of different grades for each index in surface water
ρ/(mg·L−1) 等级
Grade溶解氧
Dissolved oxygen化学需氧量
Chemical oxygen demand氨氮
NH3-N总磷
Total phosphorus总氮
Total nitrogen硫化物
SulfideⅠ ≥7.5 ≤15 ≤0.15 ≤0.02 ≤0.2 ≤0.05 Ⅱ ≥6.0 ≤15 ≤0.50 ≤0.10 ≤0.5 ≤0.10 Ⅲ ≥5.0 ≤20 ≤1.00 ≤0.20 ≤1.0 ≤0.20 Ⅳ ≥3.0 ≤30 ≤1.50 ≤0.30 ≤1.5 ≤0.50 Ⅴ ≥2.0 ≤40 ≤2.00 ≤0.40 ≤2.0 ≤1.00 表 2 训练样本生成规则
Table 2 Generation rules of training samples
pH ρ/(mg·L−1) 样本数
Number of
sample期望输出
Expected
output等级
Grade溶解氧
Dissolved
oxygen化学需氧量
Chemical
oxygen demand氨氮
NH3-N总磷
Total
phosphorus总氮
Total
nitrogen硫化物
Sulfide6~9 ≥7.5 ≤15 ≤0.15 ≤0.02 ≤0.2 ≤0.05 50 1 Ⅰ 6.0~7.5 ≤15 0.15~0.50 0.02~0.10 0.2~0.5 0.05~0.10 50 2 Ⅱ 5.0~6.0 15~20 0.50~1.00 0.10~0.20 0.5~1.0 0.10~0.20 50 3 Ⅲ 3.0~5.0 20~30 1.00~1.50 0.20~0.30 1.0~1.5 0.20~0.50 50 4 Ⅳ 2.0~3.0 30~40 1.50~2.00 0.30~0.40 1.5~2.0 0.50~1.00 50 5 Ⅴ 表 4 不同优化算法的最优解
Table 4 Optimal solutions of different optimized algorithms
优化算法
Optimized
algorithm核函数参数(c)
Kernel function
parameter惩罚因子(g)
Penalty
factorPSO 9.783 4 5.023 7 GWO 42.362 5 3.816 4 IPSO 82.436 5 0.659 1 GWOPSO 65.899 2 0.010 0 IGWOPSO 97.234 2 0.010 0 表 3 不同算法的分类准确率及性能
Table 3 Classification accuracy and performance of different algorithms
算法
Algorithm样本准确率/%
Sample accuracy性能 Performance S1 S2 S3 均值
Mean绝对误差
Abosolute
error均方根误差
Root mean
square error纳什效率系数
Nash-Sutcliffe
efficiencySVM 100.00 75.56 84.44 86.67 23 0.49 0.63 PSO-SVM 100.00 86.67 86.67 91.11 15 0.39 0.77 GWO-SVM 100.00 88.89 88.89 92.59 10 0.27 0.89 IPSO-SVM 91.11 100.00 95.56 95.56 6 0.21 0.93 GWOPSO-SVM 100.00 100.00 93.33 97.78 3 0.15 0.97 IGWOPSO-SVM 100.00 100.00 100.00 100.00 0 0 1.00 -
[1] YAROSHENKO I, KIRSANOV D, MARJANOVIC M, et al. Real-time water quality monitoring with chemical sensors[J]. Sensors, 2020, 20(12): 3432. doi: 10.3390/s20123432.
[2] IMRAN L B, LATIF R M A, FARHAN M, et al. Smart city based autonomous water quality monitoring system using WSN[J]. Wireless Personal Communications, 2020, 115(2): 1805-1820. doi: 10.1007/s11277-020-07655-x
[3] AMOATEY P, BAAWAIN M S. Effects of pollution on freshwater aquatic organisms[J]. Water Environment Research, 2019, 91(10): 1272-1287. doi: 10.1002/wer.1221
[4] 徐显阳. 多层水质数据监测系统的采集与控制研究[D]. 大连: 大连理工大学, 2021. [5] 曹守启, 葛照瑞, 张铮. 基于物联网的浮标水质监测系统与溶解氧浓度预测模型[J]. 农业机械学报, 2021, 52(11): 210-218. [6] 肖茂华, 周俊博, 王伟臣, 等. 一种新型拖拉机故障诊断系统及故障诊断方法: CN202110892020.4[P]. 2021-10-29. [7] SILLBERG C V, KULLAVANIJAYA P, CHAVALPARIT O. Water quality classification by integration of attribute-realization and support vector machine for the Chao Phraya River[J]. Journal of Ecological Engineering, 2021, 22(9): 70-86. doi: 10.12911/22998993/141364
[8] 杨望灿, 张培林, 任国全, 等. 基于模糊熵与LS-SVM的轴承故障诊断[J]. 机械强度, 2014, 36(5): 666-670. [9] 周金. 基于自适应VMD和PSO-SVM的电能质量扰动检测与分类[D]. 长沙: 湖南大学, 2019. [10] 孙俊, 莫云南, 戴春霞, 等. 基于介电特性与IRIV-GWO-SVR算法的番茄叶片含水率检测[J]. 农业工程学报, 2018, 34(14): 188-195. [11] SHAHEEN M A M, HASANIEN H M, ALKUHAYLI A. A novel hybrid GWO-PSO optimization technique for optimal reactive power dispatch problem solution[J]. Ain Shams Engineering Journal, 2021, 12(1): 621-630. doi: 10.1016/j.asej.2020.07.011
[12] MATOS J, FARIA R P V, NOGUEIRA I B R, et al. Optimization strategies for chiral separation by true moving bed chromatography using particles swarm optimization (PSO) and new Parallel PSO variant[J]. Computers & Chemical Engineering, 2019, 123: 344-356.
[13] 郜云波. 纤维制备生产参数与质量能耗评估预测模型及应用研究[D]. 哈尔滨: 东北林业大学, 2019. [14] GOHIL B N, PATEL D R. A hybrid GWO-PSO algorithm for load balancing in cloud computing environment[C]//2018 Second International Conference on Green Computing and Internet of Things, 2018: 185-191.
[15] 刘双印, 徐龙琴, 李振波, 等. 基于PCA-MCAFA-LSSVM的养殖水质pH值预测模型[J]. 农业机械学报, 2014, 45(5): 239-246. [16] 陈俊英, 邢正, 张智韬, 等. 基于高光谱定量反演模型的污水综合水质评价[J]. 农业机械学报, 2019, 50(11): 200-209. [17] 李鑫星, 王聪, 田野, 等. 基于ZigBee的多参数水质在线监测系统[J]. 农业机械学报, 2015, 46(S1): 168-173. [18] 江先亮, 尚子宁, 金光, 等. 基于无人船的水产养殖水质动态监测系统设计与实验[J]. 农业机械学报, 2020, 46(9): 175-185. [19] 程淑红, 刘洁, 朱丹丹. 基于计算机视觉与SVM的水质异常监测方法[J]. 光电工程, 2014, 41(5): 28-33. [20] 李昕, 陈泽君, 李立君, 等. 基于偏好免疫网络和SVM算法的油茶果多特征识别[J]. 农业工程学报, 2020, 36(22): 205-213. doi: 10.11975/j.issn.1002-6819.2020.22.023 [21] 周建民, 王发令, 张臣臣, 等. 基于特征优选和GA-SVM的滚动轴承智能评估方法[J]. 振动与冲击, 2021, 40(4): 227-234. [22] LIU W, GUO G, CHEN F, et al. Meteorological pattern analysis assisted daily PM2.5 grades prediction using SVM optimized by PSO algorithm[J]. Atmospheric Pollution Research, 2019, 10(5): 1482-1491. doi: 10.1016/j.apr.2019.04.005
[23] 杨柳, 孙金华, 冯仲科, 等. 基于PSO-LSSVM的森林地上生物量估测模型[J]. 农业机械学报, 2016, 47(8): 273-279. [24] 周俊博, 朱烨均, 肖茂华, 等. 基于LWD-QPSO-SOMBP神经网络的拖拉机柴油机故障诊断[J]. 农业工程学报, 2021, 37(17): 39-48. [25] 苏中滨, 张磊磊, 马铮, 等. 基于改进PSO的无人自转旋翼机二自由度PID飞行控制[J]. 农业机械学报, 2022, 53(1): 151-158. [26] 周强, 周永权. 一种基于领导者策略的狼群搜索算法[J]. 计算机应用研究, 2013, 30(9): 2629-2632. [27] TATSUMI K, IBUKI T, TANINO T. A chaotic particle swarm optimization exploiting a virtual quartic objective function based on the personal and global best solutions[J]. Applied Mathematics and Computation, 2013, 219(17): 8991-9011. doi: 10.1016/j.amc.2013.03.029
[28] 曹旺. MATLAB智能优化算法: 从写代码到算法思想[M]. 北京: 北京大学出版社, 2021. [29] MIRJALILI S, MIRJALILI S M, LEWIS A. Grey wolf optimizer[J]. Advances in Engineering Software, 2014, 69: 46-61. doi: 10.1016/j.advengsoft.2013.12.007
[30] 国家环境保护总局, 国家质量监督检验检疫总局. 地表水环境质量标准: GB 3838—2002[S]. 北京: 中国标准出版社, 2002. [31] ZHOU Q, ZHOU Y. Wolf colony search algorithm based on leader strategy[J]. Application Research of Computers, 2013, 30(9): 2629-2632.
[32] 刘冬, 李帅, 付强, 等. 基于KHA优化BP神经网络的地下水水质综合评价方法[J]. 农业机械学报, 2018, 49(9): 275-284. [33] 成玉宁, 王雪原. 拟自然化: 城市湖泊水环境治理的生态智慧与途径: 以南京玄武湖为例[J]. 中国园林, 2021, 37(7): 19-24. [34] 南京市生态环境局. 2022年5月南京市区县级以上集中式生活饮用水水源水质状况报告[EB/OL]. http://www.nanjing.gov.cn/zdgk/202205/t20220526_3428993.html.