Full text
CCWI 2025 - 21st Computing & Control for the Water Industry Conference, Sheffield, UK MACHINE LEARNING PREDICTION OF OZONE EXPOSURE FOR IMPROVING THE OZONATION PROCESS IN A DRINKING WATER TREATMENT PLANT Grigorios Kyritsakas1, Alex van der Helm2, Bas Jacobs2, Luuk Rietveld1 1 Delft University of Technology, Stevinweg 1, Delft, 2628 CN, the Netherlands 2 Waternet, Korte Ouderkerkerdijk 7, 1096 AC, Amsterdam, the Netherlands 1g.kyritsakas @tudelft.nl ABSTRACT Ozonation is a critical process in drinking water treatment plants for disinfection and oxidation of contaminants. Determining the optimal ozone dosage is challenging due to the complex interplay of various factors and the reliance on a low frequency of grab samples for ozone concentration measurements - and consequently estimation of the ozone exposure - as well as monitoring of pathogenic micro-organisms. This paper describes the development of a datadriven soft sensor aimed at providing daily predictions of ozone concentration and ozone exposure values. Three machine learning techniques - random forest, eXtreme Gradient Boosting, and Physics-Informed Neural Networks - and ensemble combinations of those, were tested and compared. Preliminary results indicate that an ensemble of 15 eXtreme Gradient Boosting models exhibited the best performance, capturing up to 82.6% of the variance in ozone exposure values on the testing dataset (R2=0.826). However, while the current model shows high reliability, it tends to underestimate high CT values, above 2.5mgO3/l *min, a limitation likely due to their underrepresentation in the training data. The results support the potential of soft sensors to enhance process monitoring and ozone dosage optimization in drinking water treatment. Keywords: ozonation, machine learning, soft sensors INTRODUCTION Ozonation is widely used in drinking water treatment plants (DWTPs) for disinfection and oxidation of organic micro-pollutants. The process involves dissolving ozone gas into water within a multi-chambered ozonation tank. The effectiveness of ozonation depends on factors including ozone dosage, water temperature, and the presence of natural organic matter (NOM). One of the major challenges faced by the water utilities is to determine the optimal ozone dosage that provides sufficient disinfection with a minimal formation of undesirable bromate at the lowest energy use. In the absence of a reliable model for disinfection, water utilities commonly use the ozone exposure (CT) parameter which is expressed as the concentration of ozone (C) times the contact time (T) [1]. Leiduin DWTP, with a capacity of 70 Mm3/year, is one of the two drinking water treatment facilities that supplies the city of Amsterdam, the Netherlands. Process engineers, working in Leiduin DWTP, also use the CT values to adjust the ozone dosage for disinfection. Currently, the CT values are calculated using ozone concentration measurements in biweekly grab samples taken from each one of the four different ozone chambers of the process. While this approach is
CCWI 2025 - 21st Computing & Control for the Water Industry Conference, Sheffield, UK good for periodic control of the ozone dosage, the biweekly frequency of the samples cannot capture any sudden increase in or decrease of the concentration of pathogenic micro-organisms in the in-between the sampling periods. To address these limitations, a data-driven soft sensor is developed for predicting daily CT values using sensor data, such as water temperature, as stored in the SCADA system of the DWTP and machine learning (ML) methodologies. Three ML approaches β random forest (RF), extreme gradient boosting (XGB), and a Physics-Informed Neural Network (PINN) β and combinations of those were tested and evaluated [2],[3],[4]. This study highlights the potential of data-driven models to optimize ozonation processes, reduce operational costs, and ensure consistent drinking water quality. METHODS Case study area, data collection and data pre-processing Leiduin is one of the two DWTPs for Amsterdam and produces approximately 70% of the water that feeds the Amsterdam area. Considering that in the Netherlands no disinfection residuals are used, the ozonation, in this DWTP, is an important disinfection process, second to the slow sand filtration. The ozonation process consists of four different chambers and each chamber consists of nine compartments. There are different sensors that are used to monitor this process both in the inlet and the outlet of the ozonation tank. In addition, grab samples are collected for the monitoring of water quality parameters that are not captured by sensors, such as the concentration of ozone (O3) in the different compartments, bacteriological indicator parameters and UV absorbance at 254 nm (UV254) in the outlet. Subsequently, the CT in the ozonation tank is calculated using the measured O3 concentrations in the different ozonation departments as follows: πΆπ =βππ3,πβ(π‘πβπ‘πβ1) (1) π π=0 Where: cO3,i: the ozone concentration at department i (mg/l) n: the total number of departments (10 in this case) t: time in minutes CT: Ozone exposure (mgO3/l *min) For this study, 4 years of water quality sensor and grab sampleβs data, measured in the inlet, the outlet, and the different compartments of the ozonation tank, were collected. The full list of the water quality parameters are presented in Table 1. The sensor dataset was cleaned using a data preprocessing approach that included four steps i) the timestamp errors and missing data replacement ii) single -point outliersβ replacement, iii) thresholdbased replacement iv) drift correction.
CCWI 2025 - 21st Computing & Control for the Water Industry Conference, Sheffield, UK Table 1. Full list of the water quality parameters used in this study. Sensor Data stored in SCADA (frequency - units) Grab samples data (total number of samples over the study period-units) Calculated water quality data (units) -Turbidity in the inlet (hourlyFTU) -UV254 in the inlet (hourly-m-1) -Temperature (hourly - oC) -Flow rate in contact chamber 1 (hourly - m3/h) -Flow rate in chamber 2 (hourly - m3/h) -Flow rate in chamber 3 (hourly - m3/h) -Flow rate in chamber 4 (hourly - m3/h) - O3 dosage in contact chamber 1 (hourly - mgO3/l) - O3 dosage in contact chamber 2 (hourly - mgO3/l) - O3 dosage in contact chamber 3 (hourly - mgO3/l) - O3 dosage in contact chamber 4 (hourly - mgO3/l) -UV254 in the outlet (227m-1) -O3 concentration in chamber 1 compartments 1-10 (126 - mg/l) -O3 concentration in chamber 2 compartments 1-10 (129 - mg/l) -O3 concentration in chamber 3 compartments 1-10 (131 - mg/l) -O3 concentration in chamber 4 compartments 1-10 (132 - mg/l) -CT in the ozonation tank in chamber 1 (mgO3/l *min) -CT in the ozonation tank in chamber 2 (mgO3/l *min) -CT in the ozonation tank in chamber 3 (mgO3/l *min) -CT in the ozonation tank in chamber 4 (mgO3/l *min) UV254 in the ozonation outlet soft sensor development The yield of ozone (Y β mgO3/l/m-1) refers to the amount of ozone that is decomposed or consumed in the ozonation process per unit of UV254 reduction. This is a key parameter in modelling and optimizing ozonation processes, especially in drinking water treatment, where UV254 is often used as a proxy for organic matter that reacts with ozone [1]. Y is calculated as follows: π=πΆπ3,ππ βπΆπ3,ππ’π‘ ππππ βππππ’π‘ (2) However, in this case study sensor data on UV254 were not available in the ozonation outlet and, thus, initially, a UV254 soft sensor was developed using 3 different ML methodologies, linear regression (LR), XGB and RF to predict the UV254 , using only sensor water quality data as inputs. For the soft sensor the data inputs were the UV254, the turbidity, the ozone dosage, the temperature, the flow, the hour and the month that the sample was collected, and the residence time (in minutes) calculated based on the flow and the volume of ozonation tank. The model was trained and tested using as outputs the available UV254 data in ozonation outlet from the collected grab samples. For integrating the grab samples and sensor data, the used sensor data were only those that were measured at the same day and hour as the grab samples were collected (227 samples in total). Ozone exposure soft sensor development For the ozone exposure soft sensor three different ML methodologies were tested, RF, XGB and PINNs. For the first two methodologies, the aim was to predict directly the CT values of the ozonation process and for the latter the aim was to predict O3 at each compartment of each one of the 4 chambers and
CCWI 2025 - 21st Computing & Control for the Water Industry Conference, Sheffield, UK based on these outputs the CT is calculated. More specifically the development of the model was as follows: RF and XGB models The O3 data were obtained from grab samples, therefore, the used sensor data were those measured the hour and the day that each grab sample was collected and up to 6 hours before that. Moreover, additional inputs included the month and the hour the sample was collected, the predicted UV254 in the ozonation outlet and the yield of ozone (Y), calculated using equation (2). Overall, the available input features were 41. A random grid search approach was used for the optimisation of the hyper parameters of both the RF model (number of trees, max depth of the tree, minimum samples per tree) and the XGB model (number of trees, max depth of the tree, learning rate). Moreover, an initial random feature selection was followed by a refinement step based on feature importance. PINN model For the development of the PINN, a multi-layer perceptron was used. For the data loss part of the PINN, the mean square error (MSE) was used. The physical knowledge introduced in the development of the PINN by embedding the differential equation developed in [1] and it has been defined as follows: ππΆπ3 ππ‘ =βππππ΄(ππβπππ)πβππ3ππ3 (3) Where: kUVA: the UVA decay rate (min-1) UV: The UV in the water (m-1) UVo: The UV after the completion of the ozonation process (m-1) Y: the yield for ozone consumed per UV decrease (mg/l/ m-1) kOo: the first order kinetic of ozone decomposition (min-1) CO3: the concentration of ozone (mg/l). The output of this model was the ozone concentration at each department, and the inputs were the sensor data measured at the time that the grab samples were made, the predicted UV254 in the outlet, the yield of ozone Y as calculated using equation (2) and, finally, the time required for the water to travel from the one compartment of the chamber to the following one. The decay rates were calculated using the least square method for each measured line (ozone grab sample collected on that day) separately. Performance metrics The available data were split randomly in 80% training and 20% testing data, and a 5-fold approach was used during the training. The evaluation of the soft sensor was achieved using three different performance metrics, mean square error (MSE), root mean square error (RMSE) and the coefficient of determination (R2). RESULTS AND DISCUSSION Estimation of UV254 in the ozonation outlet An initial analysis was conducted for each one of the three ML models using all 7 available features. Subsequently, an ensemble combination of the best
CCWI 2025 - 21st Computing & Control for the Water Industry Conference, Sheffield, UK performing models was examined. The performance metrics of the most accurate soft sensor tests are presented in Table 2. All three tests indicate that more that 75% of the output variance could be captured from this soft sensor. Moreover, Table 2 shows that LR was the key method for the UV254 prediction, indicating that an almost linear relationship existed between the ozonation inlet and outlet UV254. Based on these results, the ensemble of LR and XGB was identified as the best-performing model. Thus, the outlet UV254 and the yield for ozone consumption (Y) were calculated using this approach. Table 2. UV254 in the ozonation outlet soft sensor performance metrics ML model Features MSE RMSE R2 LR & RF UV254 0.025 0.159 0.756 LR & RF UV254, Flowrate, temperature 0.03 0.173 0.75 LR & XGB UV254, Turbidity 0.024 0.155 0.768 Estimation of the ozone exposure in the ozonation process All models were initially run using all the input variables. Following this, feature selection was performed using the Gini index feature importance and the Shapley Additive exPlanations (SHAP) were used for the identification of the most influential features. Additionally, ensemble models combining different base learners were examined. In these ensemble approaches, the contribution of each model was weighted according to its RΒ² performance on the training dataset using a 5-fold cross-validation approach. Table 3 presents the performance metrics of some of the implemented tests including the two best performing ones. Table 3. CT of the ozonation process soft sensor performance metrics ML model No Features MSE RMSE R2 PINN 9 0.11 0.331 0.56 RF 16 0.08 0.276 0.64 XGB 16 0.066 0.256 0.708 15 XGB ensemble models from 5 to maximum of 16 0.052 0.229 0.826 30 XGB + RF ensemble models from 5 to maximum of 16 0.078 0.279 0.655 XGB appears to be the most effective ML model for this problem, as both the single XGB and the ensemble XGB had high performance results. The performance of the PINN was suboptimal, likely due to the low values and limited variance of ozone concentrations in the dataset. A potential solution for improving the PINN model is to further optimize the ozone (ko3) and UV254 (kUVA) decay rates using data-driven approaches. Regarding the weaknesses of the best model, as Figure 1a shows, it consistently underpredicted CT values above 2.5mgO3/l *min. This likely results from the absence of high CT values in the
CCWI 2025 - 21st Computing & Control for the Water Industry Conference, Sheffield, UK current dataset. Finally, SHAP analysis (Figure 1b) for the features across multiple models indicated that the yield for ozone consumption, water temperature and the ozone dosage were the most influential parameters for the performance of the model. Figure 1. a) Predicted vs observed CT values of the best performing approach b) SHAP diagram of one of the models used in the best ensemble approach CONCLUSIONS This study demonstrated that ozone exposure (CT) in the ozonation process can be reliably estimated using machine learning models. For CT estimation, XGB and its ensemble variants outperformed other models, achieving an RΒ² of up to 0.826. SHAP analysis highlighted ozone dosage, temperature, and ozone consumption yield as the most influential variables, reinforcing their importance in ozonation dynamics. Future work will focus on refining ensemble model selection, improving the performance of the PINN approach through data-driven optimization of ozone and UV254 decay rates, and developing new models for predicting assimilable organic carbon (AOC) and bromate at the ozonation outlet. These models will leverage CT predictions, supporting real-time control of the ozonation process. Accurate AOC and bromate estimation is essential, as AOC relates to biological stability in distribution networks, while bromate is a harmful disinfection byproduct regulated for public health protection. REFERENCES [1] A. W. C. van der Helm, L. C. Rietveld, E. T. Baars, P. W. M. H. Smeets, and J. C. van Dijk, "Modelling disinfection and by-product formation during the initial and the second phase of natural water ozonation in a pilot-scale plug flow reactor," Journal of Water Supply: Research and Technology-Aqua, vol. 57, no. 6, pp. 435-449, 2008, doi: 10.2166/aqua.2008.089. [2] L. Breiman, "Random Forests," Machine Learning, vol. 45, no. 1, pp. 5-32, 2001, doi: 10.1023/A:1010933404324. [3] T. Chen and C. Guestrin, "XGBoost: A scalable tree boosting system," in Proc. 22nd ACM SIGKDD Int. Conf. Knowl. Discov. Data Min. (KDD), San Francisco, CA, USA, 2016, pp. 785β794, doi: 10.1145/2939672.2939785. [4] G. E. Karniadakis, I. G. Kevrekidis, L. Lu, P. Perdikaris, P. Wang, S. Yang, and L. Lu, "Physics-informed machine learning," Nature Reviews Physics, vol. 3, p. 422, 2021, doi: 10.1038/s42254-021-00314-5.