GVFs in the real world: making predictions online for water treatment

Muhammad Kamran Janjua, Haseeb Shah, Martha White, Erfan Miahi, Marlos C. Machado, Adam White

Abstract

Predicting the behavior of industrial infrastructure is challenging due to partial observability and non-stationarity. This study evaluates the use of General Value Functions (GVFs) and Temporal Difference (TD) learning for real-time sensor prediction in a drinking-water treatment plant. By predicting discounted cumulative sums of future observations rather than point-in-time values, GVFs offer a robust, anticipatory signal. Results show that models combining offline pre-training with continuous online updates outperform traditional forecasting methods, successfully adapting to environmental shifts and sensor fouling.

Introduction

Industrial systems like water treatment plants are notoriously difficult to model. They are "partially observable," meaning sensors capture only a fraction of the relevant state; for instance, a model might observe water turbidity but not the incoming storm causing it. Furthermore, these plants are non-stationary: dynamics change as sensors foul, seasons alter water chemistry, and mechanical components wear out. Traditional $n$-step forecasting, which predicts a value exactly $n$ seconds in the future, often struggles with high-frequency noise and sudden distribution shifts. This paper explores a prediction system that is accurate and robust enough to learn "on the job" in a deployment environment, providing a foundation for future automated control.

Methodology

The researchers move away from classical time-series models in favor of General Value Functions (GVFs). Instead of predicting a single point in the future, a GVF predicts a discounted cumulative sum of future observations. This creates a "smoother" target that is less sensitive to momentary noise and provides an anticipatory signal of upcoming changes.

The multi-stage process of the water treatment plant, from source to storage.

The models are updated using Temporal Difference (TD) learning, allowing the agent to learn incrementally from a stream of data without needing to wait for final outcomes or store massive historical buffers. To handle partial observability without the overhead of Recurrent Neural Networks (RNNs), the authors used "memory traces"—exponentially weighted moving averages of sensor readings—to provide the model with temporal context. A hybrid training approach was employed: agents were first pre-trained on years of offline historical logs to establish initial weights, then allowed to continue learning online during deployment to track changes in the plant's dynamics.

Experimental Setup

The study utilized a massive, high-fidelity dataset from a real drinking-water treatment plant, featuring 480 distinct sensors sampled at 1Hz, totaling over 31 million observations per year. The data includes both water chemistry (pH, turbidity, temperature) and mechanical states (pump speeds, valve positions). The plant operates in distinct modes, such as "production" and "backwashing" (cleaning the filters), which dramatically change the data distribution.

Results and Discussion

Across five critical sensors, including membrane pressure and influent temperature, the GVF-based TD agents achieved a lower Normalized Mean-Squared Error (NMSE) than $n$-step prediction baselines. A key insight is the necessity of online adaptation; the authors found that even models trained on vast offline datasets eventually fail if they stop learning. Real-world shifts—such as a sensor being cleaned or a sudden change in river temperature—require the model to "track" the new reality in real-time.

Sensor data often exhibits significant shifts due to maintenance or environmental changes, requiring continuous online model adaptation.

The GVF targets' inherent lower variance made the learning task more manageable in high-noise environments. Furthermore, the GVF predictions successfully "ramped up" before actual spikes in sensor values, providing a continuous notion of anticipation that is highly valuable for proactive industrial control.

Conclusion

This work demonstrates that reinforcement learning-based prediction methods, specifically GVFs, can outperform traditional forecasting in complex industrial settings. By combining offline knowledge with online tracking, these models remain accurate despite non-stationary dynamics. Future work will focus on using these predictions as inputs for reinforcement learning policies to automate tasks like chemical dosing or backwash scheduling, moving from pure prediction to active control.

Summary updated

BibTeX
@article{janjua2024gvfs,
  author = {Muhammad Kamran Janjua and Haseeb Shah and Martha White and Erfan Miahi and Marlos C. Machado and Adam White},
  title = {{GVFs in the real world: making predictions online for water treatment}},
  journal = {Machine Learning},
  year = {2024},
  doi = {10.1007/s10994-023-06413-x},
}
Figure