# An Attention-Based CNN-LSTM Method for Effluent Wastewater Quality Prediction
## 1 Introduction  
Wastewater treatment, which refers to the use of physical, chemical and biological methods to treat wastewater, can reduce pollution and make full use of water resources. Wastewater treatment plants (WWTPs) play a significant role in water resource recycling, allowing the treated wastewater to be discharged directly or reused. In order to protect the environment, WWTPs need to meet the requirements of local regulations [1]. WWTPs use sensors to obtain effluent wastewater quality indicators and regulate the treatment process according to these indicators; this approach creates hysteresis in the control method and makes it difficult to establish effective control methods for WWTPs. Therefore, most WWTPs make use of excessive control methods, which means the wastewater plants can meet the requirements by adding excessive chemicals, taking over aeration, etc. This measure not only wastes a lot of resources, but also fails to keep WWTPs operating efficiently. If we can predict the quality of effluent wastewater when it flows in, WWTPs can establish effective control methods instead of excessive control methods to save energy and prevent wastewater quality indicators from exceeding the standard. Predicting effluent wastewater quality via modeling simulates the complicated and dynamic process of wastewater treatment, in which many unmeasured biochemical reactions occur. Each biochemical reaction consumes existing substances and produces new substances. The theory of wastewater treatment can explain some of the biochemical reactions;moreover, the model methods based on the reaction mechanism, such as the Activated Sludge Model (ASM) [2; 3], use differential equations to model the dynamic process of wastewater treatment, and their predictive reliability has been verified in practice [4; 5]. However, this kind of method needs to determine a large number of parameters, and these parameters need to be updated with changes in time and working conditions to ensure the accuracy of the prediction. This process of updating parameters requires a lot of manpower and material resources. The rate of biochemical reaction in wastewater treatment will vary with changes in wastewater components, process control settings and weather conditions. Many factors are coupled with each other, which makes the whole wastewater treatment process a complex nonlinear system. Data-driven neural network methods have the powerful capability of modeling nonlinear processes and have been successfully applied in many fields. Compared with model methods based on reaction mechanisms, the neural network method does not require too much mathematical derivation and calculation. It can automatically select the important characteristics of wastewater quality and establish nonlinear relationships to predict effluent wastewater quality according to these characteristics by learning. [PERSON] et al. [6] applied artificial neural networks to predict the wastewater chemical oxygen demand (COD) concentration of treated water in treatment plants. They identified the best model by combining several input variables. [PERSON] et al. [7] applied a neural network ensemble and other machine learning methods to predict effluent biological oxygen demand (BOD), COD and total nitrogen (TN). The results show that the NNE model is a more robust and reliable ensemble method for predicting WWTP performance due to its non-linear averaging kernel. [PERSON] et al. [8] used random forest (RF) models, and deep neural network (DNN) models to predict the total suspended solids (TSS) and phosphate in effluent. [PERSON] et al. [9] proposed a convolutional neural network (CNN) model called Reg-CNN to predict wastewater quality containing COD, total phosphorus (TP), ammonia nitrogen (NH3-N) and pH; the results show that Reg-CNN achieves better prediction results than other machine learning methods. [PERSON] et al. [10] proposed a novel hybrid CLSTMA method and compared CLSTMA with CLSTM; the results shows that CLSTMA is more accurate than CLSTM in predicting performance.