1. Introduction
The quality of the drinking water, supplied by the Water Utilities (WU) to the citizens, is regulated by different entities to ensure full protection of public health [
1]. In order to accomplish these regulations, WU monitors the Water Distribution System (WDS) placing water quality sensors and analyzers at different strategic locations. Moreover, experts of the WU, take samples periodically (also under regulation) at specific points of the network to analyze on-site. There are different types of water quality sensors, sensors that are able to monitor a single water quality parameter or multiple parameters.
The most common parameters monitored are temperature, chlorine, conductivity and pH. Other parameters such as turbidity, or total organic carbon (TOC) are also measured commonly. Which parameters to measure and how often is determined by the water quality department of the WU [
2].
There are several techniques to treat the water in WDS and keep it healthy for human consumption. One common disinfection technique is the chlorination of water. This process consists of injecting chlorine or derivatives in the water. Thus, chlorine is one of the most important parameters to monitor because is used for disinfection purposes. The operator injects continuously a certain concentration of chlorine in the drinking water, usually in the reservoirs, by means of an automatic controller regulated by set-point [
3]. A low concentration of chlorine can result in incomplete disinfection with consequent danger for the citizens’ health. However, high concentrations of chlorine may produce odor and may also increase levels of trihalomethanes (THMs) in the drinking water. Consequently, having an accurate measure of chlorine is very important. However, it is difficult because of the injected chlorine is consumed [
4]. This consumption is related to reactions in the bulk water and in the pipe wall generating a biofilm (a group of microorganisms adhered to the surface of the pipes).
A standard amperometric chlorine sensor has a membrane and electrolyte to control the reaction of the chemical reduction of hypochlorous acid at the cathode. This causes a change in the current between the anode and the cathode that is proportional to the chlorine concentration. These sensors require a periodic maintenance plan to clean the solids that slowly accumulate in the membrane and to replace the electrolyte. The manufacturer specifies a frequency period for each maintenance action required.
Another important factor to consider when measuring the chlorine is the pH dependency. The relative amount of hypochlorous acid or hypochlorite present depends on pH. Thus, to achieve more accurate chlorine measurements, the pH measurement is required.
Taking into account the complexities mentioned, this paper is focused on developing a methodology that forecasts chlorine sensor’s loss of sensitivity to keep the sensor producing reliable data. This methodology allows the WU to increase data reliability reducing downtime and to establish a predictive maintenance plan reducing corrective actions.
Quality sensors require a continuous calibration following the procedures established by the manufacturer to produce reliable measurements. Additionally, a preventive maintenance plan according to the manufacturer recommendations is required to guarantee data reliability.
However, even applying the recommended preventive planning, quality sensors are prone to suffer from several problems (see
Table 1). Therefore, a corrective plan is still required to address these unexpected problems affecting the availability and reliability of the sensor.
On the other hand, there already exists quite a lot of research regarding methods to detect and avoid contaminant injection in the water distribution networks guaranteeing the safety of the drinking water network [
5,
6,
7]. In [
8], a comparison of a set of sensors (from different manufacturers) assessing distinct quality parameters is carried out. This study examins the sensitivity of the different sensors in the presence of several contaminants. In [
9], the hydraulic data and water quality are considered to minimize false positives numbers in the detection of quality events. In [
10], several change-point detection algorithms are used to analyze the autoregressive model residual. The sensor placement of quality sensors is also an important issue to have a good quality monitoring performance but keeping low operational costs [
11]. In [
12], artificial neural networks (ANNs) are used to model the multivariate water quality parameters and detect possible outliers. In [
13], the authors explore and compare two models for contaminant event detection in WDS: support vector machines (SVM) and minimum volume ellipsoid (MVE). The outputs of these two models are processed by sequence analysis to classify the event as a normal operation or an actual quality contaminant event. In [
14], incorporates hydraulic information to detect events applying spatial analysis to complement the local analysis (for each sensor) with existing mutual hydraulic influences. In [
15], local and spatial data analysis is performed using the simulation of contaminant intrusions. The proposed spatial model detects trends in the network based on finding similar and exceptional behavior in sensors that are located upstream. In [
16], spatial models considering the correlations between observations are implemented to validate water consumption data coming from water flow sensors.
Model-based approaches, such as [
7], have the main drawback that the performance depends directly on the water network model’s accuracy. Moreover, due to the complex behavior of the water parameters, it is unfeasible to develop an accurate physical model to describe the water quality dynamics.
Hence, data-driven approaches are very interesting in this case and therefore widely used.
One important drawback of data-driven approaches is the assumption that data gathered from these sensors are accurate and precise, such as data coming from simulations. However, as we have pointed out, raw data from quality sensors could not be ready to be analyzed or to extract solid conclusions. Unreliable water quality information is a serious problem for the WU to guarantee the citizens safety. Thus, a data cleaning process must be performed first, as [
13] points out.
Hence, the main motivation of this work is to provide a data analytics methodology for monitoring quality sensors and events applicable to drinking water networks.
The contributions of this work are twofold. On the one hand, this work provides a procedure to get a solid information basis, discarding unreliable data, to improve the decision making of the WU in water quality management. On the other hand, a prognosis module estimates the remaining useful life (RUL) of water quality sensors located in the WDS allowing the WU to apply predictive maintenance.
The proposed methodology has been satisfactorily tested on the Barcelona drinking water network.
The structure of the paper is the following: In
Section 2, the considered case study to illustrate the proposed methodology is introduced. In
Section 3, the diagnosis and prognosis methodologies are described. In
Section 4, the results obtained from three real scenarios of the considered case study are presented and discussed. Finally, in
Section 5, the conclusions are provided as well a future research paths.
2. Case Study
To illustrate the proposed prognosis methodology a case study based on a part of the Barcelona water network is used. The Barcelona network is a complex water distribution system with more than 4600 km of pipes that supply drinking water to 218 sectors of demand (see
Figure 1). In this network, there are 200 quality sensors and analyzers in charge to guarantee water quality. Moreover, a laboratory sample daily several points of the network to do more in-depth analyses.
This paper is focused on the zone highlighted with a rectangle in
Figure 1 and depicted in
Figure 2 for illustrative purposes.
The water supplied in this zone can come from two different water purification plants that extract water from the rivers Ter and Llobregat. Since the mineral composition of these rivers is very different water quality can vary significantly depending on which plant the water comes. The water arriving from these plants is stored in a tank to be served to the three associated demand sectors when required. The chlorine injection is done in this tank with an automatic system to keep the concentration at the set-point established according to sanitary regulations. On the other hand, At each demand sector entrance, a multi-parametric quality analyzer is available to continuously monitor the water quality and in particular the chlorine concentration. These analyzer supply date every 15-min to the quality monitoring center. The parameters monitored by these analyzers are temperature, conductivity, pH and chlorine.
The water quality data collected by the sensors are analyzed by the experts using visualization software to check if there exists any quality event or problem. Then, the experts check the chlorine concentrations measured using the sensors with the samples analyzed in the laboratory.
The methodology presented in this paper has been based on the knowledge of the experts used to analyze. This methodology allows checking and even forecasting problems in the quality of the water network.
4. Results
In this section, results based on the Barcelona case study, detailed in
Section 2, are presented next to show the performance of the methodology proposed in this work.
The methodology presented has been tested off-line using real data from several past scenarios [
27]. This work addresses the methodology that will be used on-line by the WU in a medium-term future, once the on-line requirements have been validated and analyzed.
The results presented here are focused on the prognosis module. The diagnosis module results are already presented in [
17], showing anticipation of the sensor fault detection in about 12 days before the experts reported the sensor incidences. Thus, the data used by the prognosis module, to generate the results presented in this section, have been previously validated and processed by the diagnosis module.
The data used to generate the results come from the multi-parametric (chlorine, pH, temperature and conductivity) sensors (0794, 0795 and 0801), the chlorine analyzer X127701D and the incidences reported by the WU experts to the maintenance department (applied to the part of the Barcelona network presented in
Figure 2).
The chlorine concentration observed is around and the minimum value allowed by the Government of Catalonia regulation of chlorine concentration in the WDS is 0.2 . Hence, the minimum threshold to train the models is .
The scenarios analyzed are three different chlorine decay scenarios.
Figure 4 shows the three scenarios A, B and C, vertically stacked. The long-dashed blue line is the chlorine signal of VX127701D, the transport analyzer placed in the reservoir (see
Figure 2). The dashed green line is the V0795 chlorine signal. The solid red line is the V0794 chlorine signal. As it can be noted, the chlorine decays are not equal in velocity and linearity. Scenario A shows a slow decay till 0.2 of chlorine in
h (16 days) with some slumps. Scenario B shows a decay to 0.2 of chlorine in
h (6 days). Scenario C shows a chlorine decay in
h (5 days). Scenario B presents the most linear decay of them. While scenario C presents a slight curve at the end. As it will show next, these factors (slumps and non-linear decays) impacts directly on the prognosis performance.
The prognosis performance metric PH, Equation (
23), have been evaluated on the six models detailed in
Section 3 with
and
, i.e.,
. As mentioned before, the models are trained using one scenario and evaluated with the others to avoid over-fitting and evaluate the generalization.
Figure 5 shows the PH evaluation training each model with one scenario (stacked vertically) and tested with the others (stacked horizontally). The bar plots in the diagonal are the evaluation of the training data sets.
Finally, to summarize the performance results,
Figure 6 shows the PH average for each testing scenario, and again leaving out the scenarios where training and testing are both the same in order to evaluate the generalization performance.
As can be noted, ETS, QRF and SVM algorithms show a good performance when the training and testing scenarios are both the same (see the diagonal results in
Figure 5). However, the PH average in
Figure 6, shows clearly the poor performance of ETS, NN and QRF methods when are applied to testing scenarios different than training scenarios, excluding QRF applied to scenario C. In contrast, drift and Brown methods have the best performance with highest PH averages in
Figure 6. One relevant fact that can be observed in
Figure 6 is the higher average performance obtained in scenario B by almost any model compared against in scenarios A and C. This is because the decay of scenario B is more linear than in A and C (see
Figure 4) and therefore more predictable.
The bad performance of the models NN and QRF is due to the model construction process. These kinds of machine learning models require a lot of data, i.e., a large set of scenarios, to train them in order to generalize properly with new unseen scenarios. In this work, these models have been trained with only one scenario and tested with the others, therefore obtaining worst performance than Brown and drift models. With the exception of the SVM model, which uses only one scenario for training, and is able to perform similar to the Brown model.
The results of the first row of bar plots from
Figure 5 are discussed below. Figures from 7 to 18 present the results obtained with the different results models trained with scenario A and applied to the scenarios B and C.
Figure 7,
Figure 8 and
Figure 9 show the drift, Brown and SVM results when trained with scenario A and applied to scenario B. As commented before, this good performance is due to the linearity of the chlorine decay at the end of scenario B. In contrast, scenario A has small bumps at the end and scenario C has a slight curve leading to worse performances.
Figure 10,
Figure 11 and
Figure 12 show the inferior performance on scenario C by the drift, Brown and SVM models, respectively.
5. Conclusions
This paper presents a prognosis approach for the water quality sensors using advanced data analytics approaches.
The complexity of chlorine sensors requires a regular maintenance plan to avoid monitor unreliable data and infer wrong conclusions. The prognosis framework presented can help the WU to predict these faulty states in order to apply predictive maintenance. Therefore, this allows decreasing corrective actions reducing OPEX costs of the WU.
On the one hand, a diagnosis framework has been briefly discussed that guarantees that no event or sensor fault is present before running the prognosis approach [
17]. On the other hand, a prognosis framework has been presented to predict the RUL of chlorine sensors that presents a chlorine decay due to loss of sensitivity. The proposed prognosis approach has been assessed using three real scenarios from the Barcelona Water Network.
Brown and drift methods have shown a bad performance when non-linear shapes are present on the chlorine decay, such as bumps and curves. While the ETS method shows poor performance when applied to different scenarios that the trained one indicating an inherent over-fitting behavior. The drift method shows the best performance average, but Brown showing a slightly less performance average has less variance. For this reason, Brown is the one proposed to be used in the real implementation.
In contrast, the nonlinear models considered (NNET, QRF and SVM) do not provide the expected good results due to the reduced amount of data used for model construction. They require a larger number of training scenarios to generalize properly with new unseen scenarios.
The complexity of the model is an important requirement for the experts of the WU. Therefore, according to the performance and the simplicity of the implementation, the Brown method is the optimal choice for the prognosis module, discarding the other methods.
The methodology and the results detailed in this work have been presented to the experts of the WU. They expressed their approval and satisfaction with the results obtained. However, this work is a study phase of the methodology and it is not implemented on-line by the WU yet.
Finally, future work will deal with the on-line deployment of the proposed methodology. Moreover, many more decay scenarios in order to improve the machine learning model’s performance will be considered.