Abstract:
Urban wastewater treatment processes exhibit complex characteristics such as uncertainty, nonlinearity,and time delay, which pose significant challenges to water quality control and energy consumption optimization. To address these issues, this study proposed an SSA-LSTM-Attention model enhanced with fluctuation-aware positional encoding for the prediction of effluent chemical oxygen demand(COD). The model integrated an attention mechanism to extract key information from water quality data and employed an improved fluctuation-aware positional encoding to dynamically identify regions of data fluctuation, thereby enhancing the model's focus on critical positions. A long short-term memory(LSTM) network was utilized to capture the long-term dependencies in COD data, while the sparrow search algorithm(SSA) was applied to optimize the LSTM-Attention model by identifying the optimal network parameters. Historical water quality data from a wastewater treatment plant were used to validate the predictive performance of the model. Experimental results showed that the proposed model achieved a mean squared error(MSE) of 4.469 3 (mg/L)2, mean absolute error(MAE) of 1.382 3 mg/L, mean absolute percentage error(MAPE) of 7.592 4%, and a coefficient of determination(R²) of 0.910 8, all of which outperformed those of the comparison models. Furthermore, comparative experiments demonstrated that the fluctuation-aware positional encoding outperforms relative and absolute positional encoding in capturing data fluctuation points. These findings indicated that the SSA-LSTM-Attention model was effective in predicting effluent COD in wastewater treatment and provided valuable support for the operation and management of wastewater treatment plants.
Key words:
wastewater quality prediction,
long short-term memory neural network,
sparrow search algorithm,
attention mechanism,
wavelet denoising,
fluctuation-aware positional encoding
摘要:
城市污水处理过程存在不确定性、非线性和时滞等复杂特性,给水质控制和能耗优化带来挑战。为此,提出了一种基于波动位置编码改进的SSA-LSTM-Attention模型用于预测出水COD。该模型结合注意力机制(Attention mechanism)提取水质数据中的关键信息,利用改进的波动位置编码动态识别数据波动区域,增强模型对关键位置的关注,并通过长短期记忆网络(LSTM)捕捉COD数据的长期依赖关系。麻雀搜索算法(SSA)进一步优化LSTM-Attention模型,寻找最佳网络参数。以某污水处理厂的历史水质数据为实验对象,验证了该模型的预测性能。实验结果表明,该模型的均方误差、平均绝对误差、平均绝对百分比误差和决定系数分别为4.469 3 (mg/L)2、1.382 3 mg/L、7.592 4%和0.910 8,均优于其他对比模型。在波动位置编码与相对位置编码、绝对位置编码的对比实验中,波动位置编码在预测数据波动位置方面表现更优。上述结果验证了SSA-LSTM-Attention模型在污水处理出水COD预测中的有效性,为污水处理厂的运营管理提供了有力的支持。
关键词:
污水水质预测,
长短期记忆神经网络,
麻雀搜索算法,
注意力机制,
小波降噪,
波动位置编码
CLC Number:
Lei WANG, Hongwei LU, Yue SUN, Kangzhou HUI, Yikun ZHAO, Mingyong LIU, Zihang LIU, Jie LI. Optimization of effluent COD prediction using LSTM based on improved fluctuation-aware positional attention mechanism[J]. Industrial Water Treatment, 2026, 46(4): 103-112.
王雷, 陆宏伟, 孙岳, 惠康洲, 赵艺琨, 刘明勇, 刘子航, 李杰. 基于改进波动位置注意力机制优化LSTM的出水COD预测[J]. 工业水处理, 2026, 46(4): 103-112.