# Application of Machine Learning Models in Optimizing Wastewater Treatment Processes: A Review
## 2 Wastewater Treatment Processes in an Industrial Wastewater Treatment Plant
### Challenges in Wastewater Treatment  
Some of the problems/challenges encountered in wastewater treatment plants caused by changes in daily and seasonal flow rates are as follows: in the morning are maximum wastewater flowrates at the WWTP inlet and low flowrates in the nighttime, rapid flowrate variations, pump cycle frequently, rainfall infiltrations that dilutes wastewater (reducing the biological treatment efficiency), hot weather increases bacteria activity (causing dissolved oxygen reduction) and cold weather slows biological processes (requiring higher chemical reactants dosage), etc. Regarding the climatic conditions, the problems can include heavy rainfall that causes hydraulic overload, temperature fluctuations (disrupting nitrification or denitrification processes), storm events that generate suspended solids that block the grills and screens, and mechanical steps. The problems caused by industrial or accidental variations can be as follows: plant discharge spikes that kill the beneficial bacteria (the biological activity needs weeks to recover), chemical substance spills (which produce a shock in terms of pH variation), which turn the entire biological stage upside down, the factory's immediate shutdown, etc. All these critical problems force human plant operators to take reactive and rash actions (emergency reactant dosage with effects on the plant costs), equipment stress, and usually violation of the environmental regulations. The optimization (especially the control of the necessary reactant flow rates, the reduction of plant operational costs, and the reduction of greenhouse gas emissions, etc.) of the treatment processes from a WWTP presents many challenges, due to the complexity and high nonlinear behavior of the involved processes. A significant challenge is the fact that the analysis, modelling, prediction, and control of such complex and highly nonlinear treatment processes using ML and DL methods requires, first of all, in their training, validation, and testing processes, very large amounts of high-quality data (that are crucial for ML and DL models), supplied by the plant monitoring systems and sensors. In many cases, access to the WWTP databases is not allowed, or they are very difficult to access due to the plant operating imposed regulations, or in the best case scenario (when the plant database is available) the available data are inconsistent (missing or noisy data) because of sensor malfunctions or measurement errors [43]. The usage of ML methods with insufficient and poor quality data (noisy or missing data) leads to misleading predictions regarding the various quality parameters that describe the plant processes, suboptimal control of the plant processes, an increase of the operating costs, wrong decisions in the decision-making process, obtaining a plant effluent that does not comply with the imposes normative, etc. [43; 60]. To solve this situation (lack of data, or poor quality available data), the WWTP can invest in data collection and management infrastructure (quality sensors, performant systems for real-time data acquisition and monitoring, standardized data formats and protocols, etc. ), but this is another challenge that imposes additional costs [43]. Additionally, the usage of ML methods in the optimization of wastewater treatment processes is usually not very welcomed by the WWTP human operators (lack of trust), due to the lack of transparency and to the black-box nature of these methods (such as ANNs), which makes them very hard to interpret and also to implement [43]. A solution to this problem can be the development of explainable ML and DL models that come with a set of facilities (such as visualization tools, a user manual, model algorithms explained in detail, graphs, etc.) dedicated to the WWTP human operators to make them more understandable and accessible for the plant staff [43].