Research on Water Quality Prediction Model Based on Spatiotemporal Weighted Fusion and Hierarchical Cross-Attention Mechanisms
Jiaming Zhou, Wei Ke, Jiahuan Huang, Lin Yang, Junzhe Shi
Abstract
In the context of drinking water safety assurance, water quality prediction faces challenges due to temporal fluctuations, seasonal cycles, and the impacts of sudden events. To address the issue of cumulative prediction bias caused by the simplistic feature fusion of traditional methods, this study proposes a neural network architecture that integrates spatiotemporal features with a hierarchical cross-attention mechanism. Innovatively, the model constructs a parallel feature extraction framework, integrating BiGRUs (Bidirectional Gated Recurrent Units) and BiTCNs (Bidirectional Temporal Convolutional Networks). By incorporating a bidirectional spatiotemporal interaction mechanism, the model effectively captures long-term dependencies in time series and local associations in spatial topology. During the feature fusion phase, layer-by-layer weighting through learnable parameters enables adaptive spatiotemporal feature processing. A hierarchical cross-attention module is designed to achieve deep feature integration, enhancing the discriminative expression of spatial features while preserving the dynamics of time series. The experimental results demonstrate that when predicting water quality monitoring data from the Xidong Water Plant, this model excels in forecasting key indicators such as total phosphorus and total nitrogen. Compared to traditional hybrid models, it reduces the MSE (Mean Squared Error) by 33.35%, the MAE (Mean Absolute Error) by 38.05%, and the RMSE (Root Mean Square Error, RMSE) by 19.35%, and increases the R2 (coefficient of determination, R2) by 2.15 percentage points. These achievements break the limitations of traditional methods’ rigid and simplistic feature fusion, fully demonstrating the model’s superiority in prediction accuracy and generalization capabilities.