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 · DOI

Abstract

Industrial processes like drinking-water treatment are notoriously difficult to model due to high dimensionality, noise, and non-stationarity. This paper demonstrates that Reinforcement Learning (RL) techniques—specifically General Value Functions (GVFs) learned via Temporal Difference (TD) methods—can provide more accurate and adaptable real-time predictions for industrial water treatment than traditional time-series models. By updating models online during deployment, the authors successfully mitigate the challenges of sensor noise and distribution shifts in a complex, high-volume physical system.

Introduction and Problem Statement

Industrial water treatment plants are high-dimensional systems with hundreds of sensors. These systems are often "partially observable," meaning available sensors do not capture every external factor affecting the process, such as weather patterns or riverbed erosion.

Overview of the industrial water treatment process, from source to storage.

Crucially, these systems are non-stationary. A model trained on data from one season may fail during another due to environmental changes like snowmelt flooding. Traditional "n-step" forecasting, which predicts a value at a specific future point, often struggles with this volatility. Furthermore, the lack of high-fidelity simulators makes it difficult to pre-train agents before real-world deployment. This research aims to bridge the gap between theoretical RL and practical, online-adapting industrial applications.

Methodology

The researchers moved away from standard supervised learning, adopting General Value Functions (GVFs) and Temporal Difference (TD) Learning.

  • The GVF Approach: 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 naturally anticipates upcoming changes.
  • Temporal Difference (TD) Learning: The model updates on every single time step (1 Hz). Unlike standard regression, TD allows the model to learn from its own subsequent predictions ("bootstrapping"), enabling rapid tracking of system changes.
  • State Representation: To handle partial observability efficiently, the authors used trace-based memory—exponentially weighted moving averages of past sensor readings—rather than computationally expensive Recurrent Neural Networks (RNNs).
  • Hybrid Training: Agents are first trained offline on historical logs to establish a baseline, then fine-tuned online during deployment to adapt to real-time shifts.

Experimental Setup

The study utilized a massive real-world dataset from a Canadian drinking-water treatment plant, consisting of one year of data with over 31 million observations. The initial 480 sensors were narrowed to 185 non-constant sensors measuring pressure, flow, pH, turbidity, and other metrics at a frequency of 1 Hz. The GVF/TD approach was benchmarked against a non-linear n-step baseline and NLinear, a state-of-the-art linear forecasting model.

Key Insights and Results

The Necessity of Online Adaptation

The most significant finding was the impact of distribution shifts. When testing on data just one week after the training period, the accuracy of "Offline-only" models plummeted. In contrast, the OnlineTD model regained accuracy within hours by learning from the new data stream.

Post-flocculation conductivity data showing significant non-stationarity and distribution shifts over time.

Performance Metrics

  • Lower Error: Across five key sensors, including Membrane Pressure and Influent Temperature, TD-based GVF agents consistently achieved a lower Normalized Mean-Squared Error (NMSE) than n-step prediction agents.
  • Anticipation and Smoothing: Because GVFs look at a discounted window of the future, predictions begin to shift before the actual sensor value does, providing a continuous "heads-up" for operators. Additionally, the GVF's exponential weighting acts as a natural low-pass filter, stabilizing learning targets compared to raw, spikey sensor data.
  • Algorithmic Efficiency: Simple trace-based memory proved as effective as complex RNNs in this sensor-rich environment while being significantly easier to deploy.

Conclusion and Future Work

This research proves that RL-based prediction models can outperform traditional baselines in complex industrial settings by leveraging online adaptation. While this study focused on prediction, the ultimate goal is to move toward control—using these forecasts to automate chemical dosing or backwashing schedules. Future challenges include managing hyperparameter sensitivity for online learning and scaling the computational overhead to maintain hundreds of GVFs simultaneously in real-time production environments.

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