# An Attention-Based CNN-LSTM Method for Effluent Wastewater Quality Prediction
## 1 Introduction
[PERSON] et al. [11] applied a CNN, a recurrent neural network (RNN) and other machine learning methods to predict the effluent concentrations of several wastewater quality indicators (COD, BOD, etc. ); the authors attribute the poor prediction result to the small datasets. WAN et al. [12] improved long short-term memory networks (LSTM) by combining the oblivion gate and the input gate into a new input gate, adding a peephole and integrating the Gaussian regression algorithm to achieve the prediction of the COD and suspended matter of the effluent. [PERSON] et al. [13] proposed a long short-term memory network water quality prediction model (SSAA-LSTM) based on SSA and an attention mechanism to predict the COD. Existing data-driven neural network methods are based on a single neural network model to predict effluent wastewater quality. The existing methods have achieved significant performance in the prediction of effluent wastewater quality, but there are still some problems to be tackled:  
First and foremost, the existing neural network methods mostly adopt a single neural network structure for prediction, and have weak nonlinear modeling ability, making it difficult to model the complex biochemical process of wastewater treatment. Second, wastewater treatment is a continuous flow and mixing process; wastewater quality data collected at adjacent sampling times have a strong correlation, and effluent wastewater quality information from the previous moment should also be fully applied to predict effluent wastewater quality. Finally, in its actual production, wastewater will continuously pour into WWTPs; wastewater quality condition is in flux, and the prediction method should have the ability to update dynamically. We propose a CNN-LSTM-Attention hybrid model called CLATT in combination with the sliding window method to predict the quality of effluent wastewater. A CNN [14; 15] can capture local patterns of time series data, such as trends, while an LSTM [16] can integrate these patterns into long-term dependencies. The proposed method improves nonlinear modeling ability by establishing a CNN-LSTM hybrid model. In addition, an attention mechanism is used to integrate the output of the LSTM at adjacent sampling times and extract the information from previous moments. In this paper, a sliding window method is also proposed. By dividing the original prediction method into multi-step prediction, the internal parameters of the model can be dynamically updated with time, enabling it to meet the actual production demand of WWTPs. Extensive experimental results show that our method is more accurate than other deep neural networks. Briefly, our main contributions are:  
* A hybrid model for effluent wastewater quality prediction that uses a CNN as an encoder and an LSTM as a decoder. * An attention mechanism to extract the correlation between the wastewater quality data at the adjacent sampling time. * A sliding window method that supports dynamic updating and can meet the actual use requirements of real-world wastewater treatment plants. The rest of the paper is arranged as follows: Section 2 presents the theoretical background of our method. Section 3 introduces the details of the proposed method. Section 4 describes the results of the experiments with the corresponding analysis. In Section 5, the conclusion is provided.