Dashe Li, Haoran Xing, Ying Li, Lingyu Fu, Ningrui Gu, Huanhai Yang, Shue Liu
Accurate prediction of water quality parameters is essential for risk warning and intelligent management in aquaculture. However, water quality time series remain difficult to forecast because of time-varying cross-variable dependencies, coexisting periodic variations and abrupt changes, and the limited ability of existing models to preserve complex frequency components and local fluctuations. To address these challenges, we proposed a Dynamic Multilevel Fusion Network (DMFNet) for complex nonstationary water quality forecasting. First, a Dynamic Confidence Relation Graph (DCRG) constructs dynamic graph structures from local patch windows and captures time-varying dependencies among variables through relational modeling and dynamic weighting. Second, Temporal Agent Attention (TAA) employs learnable agent tokens to aggregate historical patch-level information and propagate global temporal states to local segments, improving the representation of periodic variations and localized fluctuations. Third, a Frequency-Calibrated Mamba prediction head (FC-Mamba) calibrates future sequences through frequency-domain filtering and bidirectional Mamba state modeling, thereby enhancing their frequency structure and fluctuation patterns. Experiments on eight water quality datasets from Australia, the United States, and China cover diverse aquatic environments from 2013 to 2025. Results show that DMFNet achieves higher accuracy and stability in long-term forecasting. Compared with seven mainstream deep learning baselines, it reduces mean absolute error (MAE) and root mean square error (RMSE) by 0.0591 and 0.0786 on average, respectively, while improving coefficient of determination (R2) and Kling-Gupta efficiency (KGE) by 0.1244 and 0.0854 on average. This study offers a new perspective for stable forecasting of complex nonstationary water quality time series in aquaculture.