生态环境学报 ›› 2023, Vol. 32 ›› Issue (9): 1673-1681.DOI: 10.16258/j.cnki.1674-5906.2023.09.014

• 研究论文 • 上一篇    下一篇

基于粒子群优化的GRU广东省跨境断面水质预测模型研究

鲁言波(), 陈湛峰*(), 李晓芳   

  1. 广东省生态环境监测中心,广东 广州 510308
  • 收稿日期:2023-06-21 出版日期:2023-09-18 发布日期:2023-12-11
  • 通讯作者: *陈湛峰。E-mail: gdhbczf@163.com
  • 作者简介:鲁言波(1978年生),男,高级工程师,硕士研究生,主要从事环境监测及管理研究。E-mail: yanbolu@163.com
  • 基金资助:
    广东省重点领域研发计划项目(2020B1111350001)

A Study on Water Quality Prediction Model of Cross-boundary Sections in Guangdong Province Based on GRU Improved with Particle Swarm Optimization

LU Yanbo(), CHEN Zhanfeng*(), LI Xiaofang   

  1. Guangdong Ecological and Environmental Monitoring Center, Guangzhou 510308, P. R. China
  • Received:2023-06-21 Online:2023-09-18 Published:2023-12-11

摘要:

水质预测是跨界断面环境风险分析的重要方法,对水质监控和水源保护具有重要作用。GRU是水质预测的常规模型,但广东跨界断面众多、水质数据变化较大,不同断面不同时间段的GRU水质预测需要对超参数进行多次训练调整,以保证模型获得较高的精度。为快速简便地实现GRU模型的迁移使用,提出了PSO-GRU水质预测模型,引入粒子群优化算法,对GRU的超参数进行优化,减少了超参数设置的经验性和随机性,提高模型预测精度。构建PSO-GRU水质预测模型的步骤主要为,1)分析水质特征,确定滑动窗口,构建数据集(训练集、验证集、测试集);2)设置PSO-GRU的相关参数的初始值,通过计算PSO的适应度值来获得新的GRU超参数,经过迭代,追踪超参数局部最优解和全局最优解,最终得到全局最优超参数;3)将最优超参数构建GRU模型进行水质预测。将PSO-GRU用于8个跨境断面水质预测,并与LSTM、GRU模型进行对比,结果表明,1)PSO-GRU模型拥有较好的泛化性,能够在8个跨境断面水质预测中迁移使用,并取得较好的预测结果,达到应用要求。2)LSTM、GRU超参数的设置需要经过多次试验,且难以获得超参数的全局最优值,PSO-GRU能够自适应调试超参数,预测结果优于其他模型,SRMSESMAESMAPE较LSTM、GRU分别降低了39.6%、35.6%、38.6%和39.1%、34.8%、37.8%。3)降雨量作为输入能够提高PSO-GRU的预测精度,与历史数据组合输入能取得更高的精度。PSO-GRU结构简单,易于实现,且泛化能力强,能够快速迁移到其他断面进行水质预测,为快速简便水质预测提供了实践依据。

关键词: 粒子群优化, LSTM模型, GRU模型, 省界断面, 水质预测

Abstract:

The downstream of many cross-boundary sections in Guangdong Province serves as an important drinking water source. Water quality prediction is important for environmental risk analysis of cross-boundary sections and plays an important role in water quality monitoring and water source protection. The GRU model is commonly used for water quality prediction. However, with many cross sections and significant variations in water quality data in Guangdong Province, multiple training and adjustment of hyperparameters are required to ensure higher accuracy of the model in predicting water quality for different sections and time periods. For quick and easy transfer of GRU models, the PSO-GRU model was proposed. The particle swarm optimization algorithm was introduced to optimize the hyperparameters of GRU, which reduced the experience and randomness of the setting of hyperparameters and improved the prediction accuracy of the model. The steps to construct the PSO-GRU model are as follows: 1) analyzing the water quality characteristics, determining the sliding window, and building the data set (training set, verification set, test set); 2) setting the initial values of related parameters of PSO-GRU, and obtaining new hyperparameters of GRU by calculating the fitness value of PSO. After iteration, tracing the local optimal solution and global optimal solution of the hyperparameters, and finally obtaining the global optimal hyperparameters; 3) the optimal hyperparameters were used to construct a GRU model for water quality prediction. The PSO-GRU model was applied to predict water quality in 8 cross-boundary sections, and compared with LSTM and GRU models. The results showed that 1) the PSO-GRU model met the application requirement and has good generalization and achieved accurate predictions, surpassing the performance of other models. 2) The configuration of LSTM and GRU hyperparameters requires many tests, and it is difficult to obtain the globally optimal values. PSO-GRU, on the other hand, exhibits adaptability in fine-tuning the hyperparameters, resulting in superior prediction outcomes compared to other models. Compared with LSTM and GRU, PSO-GRU demonstrates a significant reduction in RMSE, MAE and MAPE by 39.6%, 35.6%, and 38.6% and 39.1%, 34.8% and 37.8%, respectively. 3) The inclusion of rainfall data as an input improved the prediction accuracy of the PSO-GRU model, and combining with historical data can achieve higher accuracy. PSO-GRU is simple in structure, easy to implement, and has strong generalization ability. It provides a practical basis for fast and simple water quality prediction, allowing for quick migration to other sections.

Key words: particle swarm optimization, LSTM, GRU, section of provincial boundary, water quality prediction

中图分类号: