Optimize Operations with Machine Learning
Water utilities are recognizing the power of machine learning to optimize system operations
Katya Bilyk, Sean FitzGerald, Javad Roostaei - Hazen and Sawyer
Last Modified Jan 26, 2023
With tremendous leaps in smart sensors and processing power for data analytics, the water utility industry is beginning to recognize and apply machine learning (ML) as a tool to optimize system operations in a way that was not possible even a few years ago.
As a branch of the broader field of artificial intelligence (AI), ML has vast possibilities for the water industry. At its simplest, machine learning is learning from data. Every day, various types of data are recorded on a massive scale throughout the water sector and ML can be used to analyze these complex data sets, helping operators by leveraging the objective and powerful capabilities of computers to identify and utilize patterns from the data that a human may not recognize. Machine learning models are developed through model training; the model is given a certain percentage of a data set (usually 75-80% of the data) and is then tested by predicting the rest of the data set, or “unseen data.” Well-trained (or calibrated) ML models can explore and process massive and diverse data sets in real time while also providing rapid predictions and/or recommendations for operators—a difficult and sometimes impossible task for a human, especially in a short time frame.
One common misconception is that ML tools will replace human operational decision making. Operational experience and expertise is fundamental to successful ML development and implementation. Water experts are critical to integrating the science of water into model development. And once in production, it will always be important for a human to review the recommendations of the model, periodically verify the model is continuously learning, and apply their own judgment and experience to the question at hand.
Machine Learning vs. Traditional Modeling
Models in the water industry have traditionally focused on known relationships derived from years of research. These mechanistic models simulate known relationships like Monod kinetics for the growth of organisms or the Manning equation for open channel flow. Those equations (rules) along with their inputs (data) can be coded directly into a computer model.
The potential shortcomings of using mechanistic models in real-time decision making may include that the model could be out-of-date and/or not representative, the time it takes to obtain a is too long to have practical use for an operator, or the model and the real-time data are not connected.
ML offers an alternative approach that uses data and answers to learn rules, and uses error minimization algorithms to find the best way to represent a relationship between the data and the answers. ML can be used to gain insight into processes that are not well understood, or too complex to use a conventional equation, or when mechanistic models don’t represent the system well. Some examples include predicting sludge settling characteristics or the percent total solids from a dewatering unit.
Types and Levels of Machine Learning
Machine learning is highly scalable, flexible, and can provide different levels of insights to inform operations. This can include a descriptive model (see figure above) that provides an operator with informed decisions to more complex prescriptive models that recommend a particular action—i.e., set pump speed to 50%—or allow a computer to make the decision and implement the action. More importantly, a machine learning model is only as good as the data used for its “training.” For example, if a model predicts collection system flow and an upstream storage tank is built to attenuate flow, the ML model will have to be retrained to learn how the storage tank affects flow. This is also another example of the critical nature of the human element—while we call these models “smart,” they need human intelligence to be applied correctly.
Machine learning covers a wide variety of approaches to generating insights from data. ML encompasses three prominent methods.
Unsupervised Learning: can provide insights into variables that can be related. In this case there is not a specific target variable one is trying to predict. With unsupervised learning, algorithms can find commonalities and uncover complex relationships across many dimensions.
Supervised Learning: involves forecasting the value of a target variable such as influent wastewater flow given a combination of current known and/or forecasted conditions; or classifying a variable into different groups, such as low dosing or high dosing range for a chlorination system. The goal is to provide specific output for an operator or a PLC to make a decision.
Reinforcement Learning: is currently the least explored, but has tremendous value for process optimization and automation. This example model optimizes blower speed to maintain a specific DO setpoint and target effluent ammonia value by assigning rewards and penalties for being too high or too low; reinforcement learning could also include adding energy costs as penalities.
The 75-mgd Neuse River Resource Recovery Facility (NRRRF) operated by Raleigh Water in North Carolina has a daily flow of 48 mgd and peak hydraulic capacity of 225 mgd.
The facility has stringent total nitrogen (TN) limits of less than 3 mg/L at permitted flow, and a quarterly average effluent total phosphorus limit of 2 mg/L. High flows can impact the facility’s ability to meet these strict nutrient limits; influent flows increase dramatically during heavy and/or sustained rainfall, which can shorten treatment time.
The NRRRF has a 32-million gallon equalization basin (EQ) to withhold a significant portion of the flow and load entering the facility during high flow events. Historically, NRRRF staff utilized collection system pump station data, weather forecasts, and experience to determine when to move flow into the EQ basin.
Pump station data provided about 30-60 minutes of advance warning but could not predict if flows would continue to increase, leaving operators to use their own judgement and experience to optimize the utility of the EQ basin. Raleigh Water realized requiring a human to process the available data and recall how past storm events unfolded was neither practical nor efficient, and that it could benefit greatly from a quantitative model with the ability to predict the flow hydrograph in advance of and during a rainfall event.
Raleigh Water has a traditional collection system model and collection system flow monitors. The collection system model is an excellent tool for planning but is not equipped to provide flow forecasts in real-time, and the flow monitors are not predictive. Hazen determined that this would be an excellent opportunity to develop and implement a machine learning tool to provide real-time flow hydrograph forecasting.
The model development process was conducted entirely on a desktop computer. Hazen used supervised and unsupervised machine learning to gain insight into the input parameters that best predict future flow. The resulting model has 77 inputs, including streamflow, rainfall (past and predicted), and past plant flow. The ML algorithm was calibrated to 6 years of historical data, covering 38 storms, and the model accuracy was +/- 2.8 mgd for any point during the storm. Once the desktop model was developed, the project entered the deployment step.
Azure and SQL were used for the automated data pipeline, with predictions displayed in a web-based Microsoft Power BI dashboard tool. The entire pipeline including data visualization dashboard was securely deployed to work alongside a closed SCADA network. The model errs on the side of being conservative, occasionally predicting a flow that is higher than the actual wastewater flow. Local streamflow surfaced as the most significant variable in predicting the peak flow, so models that predict future streamflow based on predicted rainfall quantities were also developed and incorporated into the ML model.
The project was deployed in a test mode in December 2019 and completed in July 2020. Since then, at least eight major storm events—including Hurricane Isaias—have occurred and been predicted well beforehand. With this tool the plant implemented its wet weather standard operating protocol: putting 2 additional primary clarifiers online, then one additional BNR basin, and finally diverting flow to the EQ basin. Raleigh Water has employed wet weather equalization four times since the model was finalized and the equalization basin volume was never exceeded. The largest rainfall event involved 6.7 inches of rain over a 9-hour period with a peak rainfall intensity of 4.5 inches per hour. Seventeen of the available 32 mg in the EQ basin were utilized and effluent quality the day after the storm was the same as the day prior, indicating the program helped the utility maintain superb nutrient removal and properly utilize its equalization volume.
The resultant model is an extremely valuable tool that provides operators with highly informed decisions, resulting in greater efficiency and reliability to meet stringent effluent limits. The model is responsive to real-time measurements of streamflow, rainfall, and plant influent flow, and its accuracy generally improves the closer it gets to the wet weather event actually occurring.
The Future of Machine Learning and Water
Using machine learning tools alongside expert knowledge will empower the water industry to make more informed and timely data-driven decisions. Machine learning is scalable and can be used to provide timely output for manual operational decisions, or to provide real time operational recommendations and even operational control.
The practical application and planning of ML in operations is expected to increase rapidly as sensor accuracy, prices, and communication speed continue to rapidly improve. The key is to understand the problem at hand, apply the right tool, understand its limitations, and include human expertise in all phases of development and deployment.