As the largest river in China, the water quality in the middle reaches of the Yangtze River is crucial for basin ecology and development. This study proposes a multi-model fusion method for real-time water quality evaluation. To address traditional water quality index (WQI) limitations, the entropy weighted water quality index (EWQI) is employed for dynamic weighting, enhancing evaluation validity. Through its dynamic weighting mechanism, the scientific validity and early warning ability of the evaluation are significantly improved. To overcome the constraints of conventional models in capturing nonlinear relationships and temporal dynamic features, three typical machine learning models are introduced and compared, with Long Short-Term Memory (LSTM) shows high accuracy in evaluating EWQI for the middle reaches of the Yangtze River. Meanwhile, the dimensionality of environmental factors is reduced from 17 to 6 using Spearman correlation analysis. To further improve the prediction of LSTM, the mechanisms of Attention and Transformer are introduced to optimize LSTM, and the experiment results demonstrate that the LSTM-Attention model achieved optimal performance on the testing datasets, yielding both the lowest MSE, RMSE and highest R² values among all tested models. This study not only provides a reliable technical solution for precise water quality assessment and dynamic management in the middle Yangtze River, but also offers important insights for decision-making in watershed ecological protection and sustainable development. The established methodological framework can be extended to water quality assessment in other complex river systems.
Xia et al. (Sun,) studied this question.