Research on LSTM Model for River Dissolved Oxygen Prediction Optimized by Attention Mechanism

Research on LSTM Model for River Dissolved Oxygen Prediction Optimized by Attention Mechanism

Zhou Quan1, Hu Xuanming2, Wang Dongkun2, Zhang Wucai1, Chen Zhongying1, Wang Jinpeng1, Wang Pengyang2, Ren Xiuwen1

1. South China Institute of Environmental Sciences, Ministry of Ecology and Environment, Key Laboratory of Water Environment Simulation and Pollution Control, Guangzhou, Guangdong 5105302. University of Macau, National Key Laboratory of Smart City IoT, Macau SAR 999078

Abstract

Dissolved oxygen (DO) is an important water quality indicator in water bodies. Constructing data-driven models to achieve accurate predictions of dissolved oxygen will provide scientifically effective technical means for water environment management.

Considering the strong nonlinearity and significant non-stationarity of dissolved oxygen time series data, we propose a river dissolved oxygen prediction model based on a dual-stage attention weight optimization mechanism using long short-term memory (LSTM) networks (DAIW-LSTM model). The encoder of this model includes a spatial attention mechanism with dual-stage weight optimization, while the decoder incorporates a temporal attention mechanism with dual-stage weight optimization.

This model was applied to the daily average dissolved oxygen prediction study at water quality monitoring stations such as Baiyun Lixi Dam, Liuxi River Villa, and Conghua Street Corner in the Liuxi River Basin. A comparative analysis of the prediction performance between this model and baseline models like DA-LSTM, LSTM, and Bi-LSTM was conducted, exploring the impact of feature weight optimization mechanisms and upstream water quality data inputs on model prediction performance.

Results show that:

① The accuracy of the DAIW-LSTM model was validated through comparisons with baseline models, with its symmetric mean absolute percentage error (SMAPE), mean absolute error (MAE), and mean squared error (MSE) for the dissolved oxygen prediction at Baiyun Lixi Dam being 0.075, 0.611, and 0.712, respectively, the best among all models.

② For the new attention weight optimization mechanism, the second stage optimizes and corrects the preliminary weights from the first stage; for important features affecting dissolved oxygen predictions such as pH, conductivity, water temperature, and air temperature, the DAIW-LSTM model adaptively adjusts their weight distribution over the time series, thereby improving the model’s prediction accuracy.

③ By analyzing the impact of upstream water quality feature inputs through nine combinations of experiments, it is found that the DAIW-LSTM model still performs the best, and this series of combination experiments also proves the importance of selecting upstream stations and their feature variables.

The study indicates that the introduction of the attention weight optimization mechanism allows this model to exhibit better applicability and accuracy compared to other baseline models, providing new insights for surface water quality prediction research.

Research on LSTM Model for River Dissolved Oxygen Prediction Optimized by Attention Mechanism

Figure 1: The study area and the indication of the automatic water quality monitoring station

Figure 1: The study area and the indication of the automatic water quality monitoring station

Research on LSTM Model for River Dissolved Oxygen Prediction Optimized by Attention Mechanism

Citation: Zhou Quan, Hu Xuanming, Wang Dongkun, Zhang Wucai, Chen Zhongying, Wang Jinpeng, Wang Pengyang, Ren Xiuwen. Prediction of Dissolved Oxygen in Rivers Based on LSTM Model with Improved Attention Mechanism[J]. Research of Environmental Sciences, 2023, 36(6): 1135-1146. DOI: 10.13198/j.issn.1001-6929.2023.02.18

Citation: ZHOU Quan, HU Xuanming, WANG Dongkun, ZHANG Wucai, CHEN Zhongying, WANG Jinpeng, WANG Pengyang, REN Xiuwen. Prediction of Dissolved Oxygen in Rivers Based on LSTM Model with Improved Attention Mechanism[J]. Research of Environmental Sciences, 2023, 36(6): 1135-1146. DOI: 10.13198/j.issn.1001-6929.2023.02.18

Research on LSTM Model for River Dissolved Oxygen Prediction Optimized by Attention Mechanism

Leave a Comment