Abstract:Building water quality models to predict variations in water quality is essential for drinking water safety, human health, and ecological balance. In this study, a bidirectional two-layer hybrid Seq2Seq model based on wavelet decomposition denoising and long short-term memory (LSTM), i.e., a W-Bi2Seq2Seq model, is proposed to predict changes in water quality. The Daubechies5 (db5) wavelet is used to decompose datasets into low-frequency series and high-frequency ones. The high-frequency series are removed as noise, and only the low-frequency signal is kept and used as the input to the proposed model. Data series of four water quality indices (pH, NH3-N, conductivity, and turbidity) are collected from the Menlou Reservoir in Yantai, Shandong Province for model training, verification, and testing. The proposed wavelet-based bidirectional two-layer model (Bi2) is compared with the wavelet-based unidirectional one-layer model (Uni1), wavelet-based bidirectional one-layer model (Bi1), wavelet-based unidirectional two-layer model (Uni2), traditional LSTM model, and LSTM model based on wavelet decomposition (W-LSTM). The experimental results show that all the four Seq2Seq models have favorable performance in fitting the historical datasets of the four indices during the training process. Nevertheless, the testing results indicate that Bi2 is superior to the other five models in terms of prediction accuracy and generalization ability and significantly improves the prediction accuracy on water quality data with high complexity.