Coagulation is an important water treatment step in a water treatment plant (WTP). Jar tests are performed to determine the required dose of coagulant; however, these tests are slow to be performed and do not give a response in real-time to changes in raw water quality that changes abruptly during the day. To overcome this limitation, this research developed artificial neural network (ANN) models, using full-scale WTP data that served to calibrate the model and then predict the coagulant dosage, considering raw water as data input, in compliance with the treated water quality parameters. The best model was able to predict the coagulant dosage with a mean squared error of 0.016 and a correlation coefficient equal to 0.872. These results corroborate to promote coagulant dosage automation in WTPs, making it clear that ANN models allow a faster response in dosage definition and reduce the need for human interaction in the process.

  • Artificial neural network models consider water quality parameters of raw water and treated water to predict the best coagulant dosage, considering the operation cost and water quality.

  • The water quality parameters ‘pH’ and ‘turbidity’ were the most assertive in the prediction algorithm.

  • The parameters ‘residual fluoride’ and ‘residual chlorine’ had the worst performance among all water quality parameters studied.

Water treatment is a fundamental process to ensure the supply of quality drinking water to the population. One of the main challenges of this process is the precise control of coagulant dosage, which plays a fundamental role in the effective removal of impurities and particles present in raw water. Traditionally, the control of coagulant dosage in WTP depends on a manual method called the jar test, and it may take 30–45 min to obtain the required result (Loc et al. 2020). Consequently, jar tests do not respond to rapid changes in water quality (Jayaweera & Aziz 2018). Optimizing this dosage is essential to improve coagulation performance in water treatment plants (WTPs) and to bring benefits such as greater operational efficiency and quality of treated water.

In this context, numerous studies have been conducted to explore innovative predictive control and modeling approaches that allow real-time adjustment of the coagulant dosage, considering various scenarios and uncertainties. Artificial intelligence, especially artificial neural networks (ANNs) and other machine learning techniques, have emerged as promising tools to improve the coagulation process in WTPs.

Among the relevant studies, Bello et al. (2014) proposed an advanced predictive control with multiple models to optimize coagulant dosing in real-time. Likewise, Kim & Parnichkun (2017) presented a hybrid model that combines the k-means clustering algorithm and the adaptive neuro-fuzzy inference system to predict the turbidity of treated water and determine the ideal coagulant for drinkable water.

Another interesting approach is described by Bobadilla et al. (2019), which uses the multiple response surface methodology to determine the main operational parameters in coagulation, while Heddam et al. (2011a, 2011b) performed a comparative study between radial basis function (RBF) neural networks and generalized regression neural networks to model the coagulant dosage.

In addition, a study by Jayaweera & Aziz (2018) developed and compared models of neural networks, extreme learning machine (ELM), and multi-layer perceptron (MLP), to predict the ideal dosage of a coagulant in WTPs, while Jayaweera & Aziz (2021) presented an efficient neural network model to assist the coagulation process in WTPs, optimizing coagulant dosage and improving efficiency.

Wu & Lo (2008) proposed a method to predict real-time coagulant dosage using ANNs and the adaptive network-based fuzzy inference system (ANFIS). Boumezbeur et al. (2023) developed a hybrid machine learning model (ELM-Bat) to determine the optimal dosage of coagulant in WTPs of drinking water, obtaining a greater accuracy.

Furthermore, Heddam et al. (2011a, 2011b) applied an ANFIS-based model for the coagulant dosage in a WTP. Maier (2004) describes the use of ANNs to predict optimal doses of aluminum sulfate and treated water quality parameters, contributing to more efficient treatment and better quality of treated water.

Another relevant study is the work of Jayaweera et al. (2019), which describes an approach using an ELM with RBF to improve the predictive capacity of the coagulation process. Shi et al. (2022) explore the use of real-time UV–Vis spectra of raw water to determine dosages of coagulants in the treatment process. Finally, Haghiri et al. (2018) employ ANNs to predict the ideal dosage of coagulant in jar test experiments, increasing the efficiency of the coagulation process in WTPs.

It is noteworthy that artificial intelligence has been increasingly explored by researchers around the world to improve the control and efficiency of water treatment in WTPs. The cited studies demonstrate the potential of these techniques to optimize the coagulation process, ensuring high-quality treated water and meeting the growing demand for safe water resources.

In the Brazilian context, few similar studies have been carried out in water treatment stations, as done by Gomes et al. (2015) and Menezes et al. (2018). Therefore, this study aims to adapt and apply the use of ANNs in the coagulation process of the José Pedro Horstmann Water Treatment Station, located in Santa Catarina. Using the data measured in this plant, it is expected that the predictive neural network model can improve the control of coagulant dosage and predict the quality of treated water.

Case study

WTP José Pedro Horstmann is located in Palhoça, Santa Catarina State, Brazil as shown in Figure 1. It is capable to produce up to 3 m3 s−1 and provide treated water for the municipalities of Florianópolis, São José, Biguaçu, Palhoça, and Santo Amaro da Imperatriz (CASAN 2018). It is a WTP based on the traditional method, which includes coagulation, flocculation, sedimentation, filtration, and disinfection steps.
Figure 1

Water treatment plant location map.

Figure 1

Water treatment plant location map.

Close modal
The water quality control at WTP is carried out within 2 h and the extraction of water for analysis occurs at four distinct points during water treatment in WTP, as shown in Figure 2. The collected data are manually entered by operators into a system, storing it in a database:
  • Extraction point 1 – Raw water extraction occurs before the coagulation stage and analyses pH, turbidity, and coagulant dosage.

  • Extraction point 2 – Occurs between coagulation and decanting/flocculation and includes pH, color, turbidity, chlorine dosage, fluorilical acid dosage, and geocalcium dosage analysis.

  • Extraction point 3 – Occurs right after the filtration step and it analyses pH, color, turbidity, and geocalcium dosage.

  • Extraction point 4 – Occurs at the end of all treatment steps, before the treated water distribution, and analyses pH, color, turbidity, residual chlorine, and residual fluoride.

Figure 2

Water quality measurement points.

Figure 2

Water quality measurement points.

Close modal

The original data obtained from WTP José Pedro Horstmann are presented in Table 1. It contained 8,040 sets of inputs that represented the parameters of water quality. These sets cover 670 days of records made every 2 h, from 01 January 2019 to 31 October 2020.

Table 1

Collected data from all four extraction points

Water quality parameters
Extraction pointParameterAcronym
Raw water (Extraction point 1) pH RW-pH 
Color (uH) RW-col 
Turbidity (NTU) RW-turb 
Coagulant dosage (mg/L) RW-dos 
Decanted water (Extraction point 2) pH DW-pH 
Color (uH) DW-col 
Turbidity (NTU) DW-turb 
Geocalcium dosage (mg/L) DW-geoc 
Filtered water (Extraction point 3) pH FW-pH 
Color (uH) FW-col 
Turbidity (NTU) FW-turb 
Chlorine dosage (mg/L) FW-chlo 
Fluorilical acid dosage (mg/L) FW-fluor 
Geocalcium dosage (mg/L) FW-geoc 
Treated water (Extraction point 4) pH TW-pH 
Color (uH) TW-col 
Turbidity (NTU) TW-turb 
Residual chlorine (mg/L) TW-chlo 
Residual fluoride (mg/L) TW-fluor 
Water quality parameters
Extraction pointParameterAcronym
Raw water (Extraction point 1) pH RW-pH 
Color (uH) RW-col 
Turbidity (NTU) RW-turb 
Coagulant dosage (mg/L) RW-dos 
Decanted water (Extraction point 2) pH DW-pH 
Color (uH) DW-col 
Turbidity (NTU) DW-turb 
Geocalcium dosage (mg/L) DW-geoc 
Filtered water (Extraction point 3) pH FW-pH 
Color (uH) FW-col 
Turbidity (NTU) FW-turb 
Chlorine dosage (mg/L) FW-chlo 
Fluorilical acid dosage (mg/L) FW-fluor 
Geocalcium dosage (mg/L) FW-geoc 
Treated water (Extraction point 4) pH TW-pH 
Color (uH) TW-col 
Turbidity (NTU) TW-turb 
Residual chlorine (mg/L) TW-chlo 
Residual fluoride (mg/L) TW-fluor 

It is important to highlight that during the period studied, there was a change in the type of coagulant used by the company to clarify raw water. In the period of 01 January 2019 until 21 December 2019, aluminum sulfate was used as a coagulant in the water treatment. From 22 December 2019 to 31 October 2020, the final date of the data provided by the company, the coagulant used was poly aluminum chloride (PAC). These data are categorized and explained in Table 2, along with the statistical characteristics of the database without the processing step.

Table 2

Statistical data from the database before the processing step

Water quality parametersAverageStandard deviationCoef. variationMin. valueMax. value
Raw water (Extraction point 1) RW-pH 6.641 0.484 0.073 0.000 8,920 
RW-col 66.012 63.838 0.967 0.000 4,074,000 
RW-turb 15.188 92.249 6.074 0.000 8,046,000 
RW-dos 16.289 8.386 0.515 0.000 252,910 
Decanted water (Extraction point 2) DW-pH 6.454 0.812 0.126 0.000 9,780 
DW-col 6.805 6.966 1.024 0.000 85,000 
DW-turb 2.300 2.518 1.095 0.000 48,300 
DW-geoc 3.170 2.429 0.766 0.000 53,330 
Filtered water (Extraction point 3) FW-pH 6.459 0.724 0.112 0.000 9,090 
FW-col 2.806 1.840 0.656 0.000 40,000 
FW-turb 0.503 1.172 2.330 0.000 86,000 
FW-chlo 6.326 3.269 0.517 0.000 162,040 
FW-fluor 0.671 0.213 0.317 0.000 7,480 
FW-geoc 2.574 1.938 0.753 0.000 12,000 
Treated water (Extraction point 4) TW-pH 6.700 0.347 0.052 0.000 8,150 
TW-col 3.052 2.013 0.660 0.000 50,000 
TW-turb 0.899 0.812 0.904 0.000 22,700 
TW-chlo 3.679 0.448 0.122 0.000 5,300 
TW-fluor 0.800 0.094 0.118 0.000 1,370 
Water quality parametersAverageStandard deviationCoef. variationMin. valueMax. value
Raw water (Extraction point 1) RW-pH 6.641 0.484 0.073 0.000 8,920 
RW-col 66.012 63.838 0.967 0.000 4,074,000 
RW-turb 15.188 92.249 6.074 0.000 8,046,000 
RW-dos 16.289 8.386 0.515 0.000 252,910 
Decanted water (Extraction point 2) DW-pH 6.454 0.812 0.126 0.000 9,780 
DW-col 6.805 6.966 1.024 0.000 85,000 
DW-turb 2.300 2.518 1.095 0.000 48,300 
DW-geoc 3.170 2.429 0.766 0.000 53,330 
Filtered water (Extraction point 3) FW-pH 6.459 0.724 0.112 0.000 9,090 
FW-col 2.806 1.840 0.656 0.000 40,000 
FW-turb 0.503 1.172 2.330 0.000 86,000 
FW-chlo 6.326 3.269 0.517 0.000 162,040 
FW-fluor 0.671 0.213 0.317 0.000 7,480 
FW-geoc 2.574 1.938 0.753 0.000 12,000 
Treated water (Extraction point 4) TW-pH 6.700 0.347 0.052 0.000 8,150 
TW-col 3.052 2.013 0.660 0.000 50,000 
TW-turb 0.899 0.812 0.904 0.000 22,700 
TW-chlo 3.679 0.448 0.122 0.000 5,300 
TW-fluor 0.800 0.094 0.118 0.000 1,370 

Data selection and transformation

As the data provided by WTPs were manually entered by the operator into the system, it could happen to have entries with null values or quantities that are out of the close observations caused by typing errors. Therefore, in this paper, it was necessary to consider the data sequence by avoiding neural network inconsistent training results and distortions.

Thus, the data that originates possible registration errors, lack of records, and/or anomalous water quality parameters’ values were removed from the database. These criteria were defined considering the values with physical significance for the parameters, as shown in Table 3. The result of this step was the creation of a subset database without the sets that met the criteria defined.

Table 3

Data set exclusion criteria

DiscriminationParameterCriteria
Raw water (Extraction point 1) RW-pH - Values less than 4 
RW-col - Values greater than 400
- Null values 
RW-turb - Values greater than 250
- Null values 
RW-dos - Values greater than 100
- Null values 
Decanted water (Extraction point 2) DW-pH - Values less than 4 
DW-col - Null values 
DW-turb - Values greater than 30
- Null values 
DW-geoc - Values greater than 20
- Null values 
Filtered water (Extraction point 3) FW-pH - Values less than 4 
FW-col - Null values 
FW-turb - Values greater than 30
- Null values 
FW-chlo - Values greater than 30
- Null values 
FW-fluor - Null values 
FW-geoc - Null values 
Treated water (Extraction point 4) TW-pH - Null values 
TW-col - Null values 
TW-turb - Null values 
TW-chlo - Null values 
TW-fluor - Null values 
DiscriminationParameterCriteria
Raw water (Extraction point 1) RW-pH - Values less than 4 
RW-col - Values greater than 400
- Null values 
RW-turb - Values greater than 250
- Null values 
RW-dos - Values greater than 100
- Null values 
Decanted water (Extraction point 2) DW-pH - Values less than 4 
DW-col - Null values 
DW-turb - Values greater than 30
- Null values 
DW-geoc - Values greater than 20
- Null values 
Filtered water (Extraction point 3) FW-pH - Values less than 4 
FW-col - Null values 
FW-turb - Values greater than 30
- Null values 
FW-chlo - Values greater than 30
- Null values 
FW-fluor - Null values 
FW-geoc - Null values 
Treated water (Extraction point 4) TW-pH - Null values 
TW-col - Null values 
TW-turb - Null values 
TW-chlo - Null values 
TW-fluor - Null values 

In this research, the data from the obtained subset database were normalized by linearly sizing the values of the observations to values between −1 and 1. That is, the minimum and maximum values of the observations are identified, and Equation (1) is applied for each entry of the treated database:
(1)

The normalization of a database consists of a set of rules whose purpose is to organize the collected data to reduce redundancy, increase integrity, and increase database performance. This technique facilitates the detection of the relative importance of each parameter by the ANN model (Wu & Lo 2010).

Data processing

Parameters used for the ANN

ANN is a technique that simulates the learning mechanism in the human brain. The ANN architecture used in this research is MLP, and its optimization algorithm is backpropagation, which consists of a set of artificial neurons distributed in layers. The first one is the input layer, which holds the function of receiving the raw data and sending it to the next layer, the middle layers are called hidden layers that are responsible for processing the information, and finally, there is the output layer, which aims to present the result of the modeled problem (Aggarwal 2018). Figure 3 illustrates the multilayer structure of an MLP.
Figure 3

Multilayer neural network (adapted from Aggarwal (2018)).

Figure 3

Multilayer neural network (adapted from Aggarwal (2018)).

Close modal

Gaya et al. (2017) state that the use of only one hidden layer of neurons is sufficient to solve most real-world problems. In this paper, it was chosen to use three hidden layers, because this small increase in the number of layers did not require more computational power in the training of the proposed ANN models.

The error metrics used to compare the trained models are mean squared error (MSE) and the correlation coefficient (r). As the objective of ANN training is to obtain an adequate mapping of the relationship between input and output data, a well-trained network is fundamental to the success of the model. For this, it is common to divide the database that feeds ANN into three groups: one for training, one for validation, and the last for testing (Basheer 2000). In this research, 60% of the data were used to train the model, 20% of the data to validate the model, and 20% of the data for testing.

The tool used to implement the ANN models was the NNTool, from Matlab®. Table 4 indicates the implementation parameters models, while Table 5 indicates the training parameters of ANNs in this paper.

Table 4

Implementation parameters of the proposed ANN models

ANN models implementation parameters
Network type Feed-forward backpropagation 
Training function  Levenberg–Marquardt 
Performance function Mean square error 
Number of layers 
Number of neurons per layer 29 
Transfer function Log-sigmoid 
ANN models implementation parameters
Network type Feed-forward backpropagation 
Training function  Levenberg–Marquardt 
Performance function Mean square error 
Number of layers 
Number of neurons per layer 29 
Transfer function Log-sigmoid 
Table 5

Training parameters of the proposed ANN models

ANN models training parameters
Epochs 1,000 
Time Infinite 
Performance goal 1.00 × 10−4 
Minimum performance gradient 1.00 × 10−7 
Maximum validation failures 25 
Training data 60% 
Validation data 20% 
Test data 20% 
ANN models training parameters
Epochs 1,000 
Time Infinite 
Performance goal 1.00 × 10−4 
Minimum performance gradient 1.00 × 10−7 
Maximum validation failures 25 
Training data 60% 
Validation data 20% 
Test data 20% 

Proposed models

This research was carried out in two phases. In the first phase, the ANN model's purpose was to predict the coagulant dosage applied in the water treatment, considering the parameters of water quality as inputs. For this, three ANN models were proposed, each with distinct input parameters. Table 6 shows which parameters are considered in each of the models. The output parameter of all three models was the ‘coagulant dosage’.

Table 6

ANN models input and output data (first phase)

DataParametersModel 1Model 2Model 3
Input RW-pH 
RW-col 
RW-turb 
DW-pH   
DW-col   
DW-turb   
DW-geoc   
FW-pH   
FW-col   
FW-turb   
FW-chlo  
FW-fluor  
FW-geoc  
TW-pH 
TW-col 
TW-turb 
TW-chlo  
TW-fluor  
Output RW-dos 
DataParametersModel 1Model 2Model 3
Input RW-pH 
RW-col 
RW-turb 
DW-pH   
DW-col   
DW-turb   
DW-geoc   
FW-pH   
FW-col   
FW-turb   
FW-chlo  
FW-fluor  
FW-geoc  
TW-pH 
TW-col 
TW-turb 
TW-chlo  
TW-fluor  
Output RW-dos 

Figures 46 illustrate the simplified structure for models 1, 2, and 3 of the first phase, respectively.
Figure 4

Simplified structure for model 1 (Phase 1).

Figure 4

Simplified structure for model 1 (Phase 1).

Close modal
Figure 5

Simplified structure for model 2 (Phase 1).

Figure 5

Simplified structure for model 2 (Phase 1).

Close modal
Figure 6

Simplified structure for model 3 (Phase 1).

Figure 6

Simplified structure for model 3 (Phase 1).

Close modal

In the second phase of the research, it was sought to evaluate individually the predictive capacity of ANN models for each of the water quality parameters. Thus, the previous three ANN models implemented were used at this stage. However, the parameter ‘coagulant dosage’ was considered as a model's input data, instead of output data. Also, the parameters of treated water quality (Extraction Point 4) were used as the model's output data. Table 7 shows which parameters were considered in each of the proposed models.

Table 7

ANN models input and output data (second phase)

DataParametersModel 1Model 2Model 3
Input RW-pH 
RW-col 
RW-turb 
RW-dos 
DW-pH   
DW-col   
DW-turb   
DW-geoc   
FW-pH   
FW-col   
FW-turb   
FW-chlo  
FW-fluor  
FW-geoc  
Output TW-pH 
TW-col 
TW-turb 
TW-chlo  
TW-fluor  
DataParametersModel 1Model 2Model 3
Input RW-pH 
RW-col 
RW-turb 
RW-dos 
DW-pH   
DW-col   
DW-turb   
DW-geoc   
FW-pH   
FW-col   
FW-turb   
FW-chlo  
FW-fluor  
FW-geoc  
Output TW-pH 
TW-col 
TW-turb 
TW-chlo  
TW-fluor  

Figures 79 illustrate the simplified structure for models 1, 2, and 3 of the second phase, respectively.
Figure 7

Simplified structure for model 1 (Phase 2).

Figure 7

Simplified structure for model 1 (Phase 2).

Close modal
Figure 8

Simplified structure for model 2 (Phase 2).

Figure 8

Simplified structure for model 2 (Phase 2).

Close modal
Figure 9

Simplified structure for model 3 (Phase 2).

Figure 9

Simplified structure for model 3 (Phase 2).

Close modal

Many null information in the original data set and high dispersion of the data (indicated by the high values of the coefficient of variation of the data – Table 2) suggest failures in the recording of the data collected by the WTP operators in the period studied. At the end of the data selection stage, after applying the criteria presented in Table 3 for the exclusion of entries, the number of valid data referring to the use of aluminum sulfate as a coagulant in the studied period decreased by 27.72%, while the number of valid data for the PAC decreased by 6.27%. Overall, the final data set decreased from 8.040 to 6.861 observations (14.66%), as summarized in Table 8.

Table 8

Category of data sets selected after exclusion criteria

CategoryOriginal data assembly no.Data after treatment assembly no.% Reduction
Alum sulfate 3.145 2.273 27.72 
PAC 4.895 4.588 6.27 
Total 8.040 6.861 14.66 
CategoryOriginal data assembly no.Data after treatment assembly no.% Reduction
Alum sulfate 3.145 2.273 27.72 
PAC 4.895 4.588 6.27 
Total 8.040 6.861 14.66 

The ability to predict the coagulant dosage of the ANN models proposed in the first phase of this work was evaluated by the metrics MSE and the correlation coefficient (r). The values presented in Table 9 correspond to the predictive statistics of each proposed model.

Table 9

Coagulant dosage predictive statistics of each model

ModelsPredictive statistics
Alum sulfate
PAC
MSErMSEr
Model 1 0.026 0.859 0.042 0.587 
Model 2 0.018 0.885 0.023 0.836 
Model 3 0.015 0.933 0.016 0.872 
ModelsPredictive statistics
Alum sulfate
PAC
MSErMSEr
Model 1 0.026 0.859 0.042 0.587 
Model 2 0.018 0.885 0.023 0.836 
Model 3 0.015 0.933 0.016 0.872 

Model 1, which used only the parameters of water quality of extraction points 1 and 4 as the input data, presented a slightly lower performance than the other models, when the coagulant used in the treatment was aluminum sulfate. Based on the observations in which the coagulant was PAC, model 1 had its performance significantly below the other models proposed.

Model 2 adopted the same input data as model 1, in addition to the parameters ‘geocalcium dosage’ (extraction points 2 and 3), ‘chlorine dosage’, ‘fluorosilicic acid dosage’ (both from extraction point 3), ‘residual chlorine’, and ‘residual fluoride’ (both from extraction point 4). The model performed well, presenting low MSE and r close to 1, for the two types of coagulants used in the water treatment.

Model 3 considered all parameters of all extraction points. It was the model with the best performance, both for the coagulant aluminum sulfate and for the coagulant PAC (MSE = 0.015 and r = 0.933 for the first one against MSE = 0.016 and r = 0.872 for the second one). The graphs in Figures 10 and 11 compile the statistical results of the first stage of this research, whose output data of the proposed models was the parameter ‘coagulant dosage’.
Figure 10

MSE of coagulant dosage predictions for each model.

Figure 10

MSE of coagulant dosage predictions for each model.

Close modal
Figure 11

r of the coagulant dosage predictions for each model.

Figure 11

r of the coagulant dosage predictions for each model.

Close modal

As a resume, it can be said that all three models had good results when the coagulant used is alum sulfate, having low MSE and r values close to 1. So, they could be satisfactorily used to explain the coagulant dosage in the studied WTP. On the other hand, for PAC, only models 2 and 3 presented good results, while model 1 failed to explain the phenomenon, having a small r value.

It can be also observed that the greater the number of model entries, the better the ability to predict the coagulant value satisfactorily. Model 3 had a decrease of approximately 42.3% in its MSE value compared to model 1, and its r value grew 8.6%, compared to the same model. Comparing models 2 and 3, model 3 had a MSE value 16.7% smaller and an r value 5.4% bigger than model 2. Based on this information, model 3 would be recommended for a possible implementation, although it is necessary to evaluate the computational processing power required and data availability against the gain achieved. The coagulant dosage values predicted by the models of this study vs. the coagulant dosage values measured at the extraction point are shown in Figure 12.
Figure 12

Predicted vs. measured coagulant dosage for phase 1.

Figure 12

Predicted vs. measured coagulant dosage for phase 1.

Close modal

It can be observed that the results achieved in this phase of the research are consistent with the results of other peer surveys. Table 10 shows the same statistical metrics used in this research for the models implemented in some similar studies, i.e., referring to the prediction of coagulant dosage using ANNs.

Table 10

Comparison with similar studies

PaperModel input parametersCoagulantMSEr
Yu et al. (2000)  - Turbidity
- Conductivity
- pH
- Treated water's turbidity 
Alum sulfate 0.00194 0.985 
Wu & Lo (2008)  - Turbidity
- Coagulant dosage from the previous day 
PAC 0.0000127 0.962 
Haghiri et al. (2018)  - pH
- Alkalinity
- Turbidity
- Temperature 
Alum sulfate 0.12 0.975 
Jayaweera & Aziz (2018)  - pH
- Turbidity
- Color
- Dissolved soirees
- Alkalinity 
Alum sulfate 0.000483 0.987 
PaperModel input parametersCoagulantMSEr
Yu et al. (2000)  - Turbidity
- Conductivity
- pH
- Treated water's turbidity 
Alum sulfate 0.00194 0.985 
Wu & Lo (2008)  - Turbidity
- Coagulant dosage from the previous day 
PAC 0.0000127 0.962 
Haghiri et al. (2018)  - pH
- Alkalinity
- Turbidity
- Temperature 
Alum sulfate 0.12 0.975 
Jayaweera & Aziz (2018)  - pH
- Turbidity
- Color
- Dissolved soirees
- Alkalinity 
Alum sulfate 0.000483 0.987 

In the second phase of this study, by evaluating each output parameter of the models proposed, it was noticed that the parameters color and turbidity had similar assertiveness and were slightly superior to the parameter pH, considering both the use of aluminum sulfate and PAC.

Table 11 shows statistical indices of all output data, and Figures 13 and 14 graphically show the MSE and r, respectively, of each water quality parameter predicted by models in this phase. Following this, Figures 1517 show the predicted vs. measured data relationship of each implemented model's output parameter.
Table 11

Models predictive statistics (second phase)

ModelsParametersAccuracy
Alum sulfate
PAC
MSErMSEr
Model 1 pH 0.034 0.668 0.011 0.574 
Color 0.036 0.439 0.018 0.594 
Turbidity 0.047 0.748 0.006 0.593 
Model 2 pH 0.034 0.751 0.035 0.734 
Color 0.008 0.603 0.012 0.629 
Turbidity 0.04 0.798 0.009 0.652 
Residual chloride 0.033 0.577 0.026 0.376 
Residual fluoride 0.205 0.031 0.05 0.234 
Model 3 pH 0.027 0.732 0.01 0.752 
Color 0.014 0.825 0.006 0.872 
Turbidity 0.025 0.85 0.003 0.861 
Residual chloride 0.052 0.208 0.041 0.345 
Residual fluoride 0.203 0.313 0.045 0.24 
ModelsParametersAccuracy
Alum sulfate
PAC
MSErMSEr
Model 1 pH 0.034 0.668 0.011 0.574 
Color 0.036 0.439 0.018 0.594 
Turbidity 0.047 0.748 0.006 0.593 
Model 2 pH 0.034 0.751 0.035 0.734 
Color 0.008 0.603 0.012 0.629 
Turbidity 0.04 0.798 0.009 0.652 
Residual chloride 0.033 0.577 0.026 0.376 
Residual fluoride 0.205 0.031 0.05 0.234 
Model 3 pH 0.027 0.732 0.01 0.752 
Color 0.014 0.825 0.006 0.872 
Turbidity 0.025 0.85 0.003 0.861 
Residual chloride 0.052 0.208 0.041 0.345 
Residual fluoride 0.203 0.313 0.045 0.24 
Figure 13

MSE of the predictions of each water quality parameter for each model.

Figure 13

MSE of the predictions of each water quality parameter for each model.

Close modal
Figure 14

r of the predictions of each water quality parameter for each model.

Figure 14

r of the predictions of each water quality parameter for each model.

Close modal
Figure 15

Predicted data vs. measured data (Model 1).

Figure 15

Predicted data vs. measured data (Model 1).

Close modal
Figure 16

Predicted data vs. measured data (Model 2).

Figure 16

Predicted data vs. measured data (Model 2).

Close modal
Figure 17

Predicted data vs. measured data (Model 3).

Figure 17

Predicted data vs. measured data (Model 3).

Close modal

The parameters pH, color, and turbidity all had their best predictive performance in model 3, considering the data set referring to the use of PAC. For pH, it was obtained values of MSE and r equal to 0.010 and 0.752, respectively. The performance of the color MSE was equal to 0.006 and r was equal to 0.872. Finally, turbidity presented MSE and r equal to 0.003 and 0.861, respectively.

Both the parameters ‘residual chlorine’ and ‘residual fluoride’ obtained very low statistical indices in all models, considering both aluminum sulfate and PAC as coagulants; so it can be concluded that the models proposed in this research were not able to predict these parameters’ values with the necessary precision.

Furthermore, regarding the type of coagulant, in the first phase of the research it was observed that, even with the number of valid observations considering aluminum sulfate as the coagulant used in water treatment is lower than the number of valid observations considering PAC as the coagulant (approximately 50% lower), all models performed better with aluminum sulfate as the coagulant. However, in the second research phase that considered the individual parameters of treated water as the output data of the proposed models, the MSE of the predictions considering aluminum sulfate as the coagulant were higher (meaning worst performance) than the predictions considering PAC. Especially, the parameter ‘residual fluoride’ which presented a great discrepancy in the MSE when compared to the performance of the models with aluminum sulfate data with the data with PAC.

In this research, the implementation of ANN models was proposed to predict the dosage of coagulant applied in the treatment of water, considering the parameters of raw water and treated water of WTP José Pedro Horstmann (Palhoça, in Santa Catarina, Brazil). It also proposed the application of these ANN models in the prediction of the quality parameters of treated water, considering the coagulant dosage applied in the treatment. In general, the implemented models performed satisfactorily, with MSE values and r close to the values of similar studies performed by peers. These results corroborate the research that attempts to promote automation in the dosage of coagulants in WTPs, making it clear that ANN models allow faster response in the definition of dosage and reduce the need for human interaction in the process.

In the prediction of the dosage of the coagulant applied, it is noteworthy that the ANN model with the best performance is the model that considers the parameters of quality of raw water, water after decanting, water filtration, treated water, and dosages of geocalcium, fluorosilicic acid, and chlorine, affected during water treatment (Model 3). This model performed better when the coagulant used in the water treatment was PAC (MSE = 0.016 and r = 0.872), even with a lower number of observations with PAC than with aluminum sulfate as the coagulant.

In the individual parameters prediction of water quality based on the coagulant dosage, the same model mentioned again had the best performance among the proposed models. It was observed that the parameters ‘pH’ and ‘turbidity’ are the most assertive in the prediction (data considering PAC as the coagulant obtained slightly better results). On the other hand, the parameters ‘residual fluoride’ and ‘residual chlorine’ had the worst performance among all water quality parameters studied, either with PAC or aluminum sulfate as the coagulant. Because of this, for the prediction of these parameters, the proposed ANN models are not adequate and other types of mathematical modeling should be studied for a satisfactory result. Moreover, the observations whose coagulant applied in the water treatment was PAC performed better than the observations whose coagulant applied was aluminum sulfate.

The limitations of this study lie on the few water quality parameters available in the database, and in the use of only one machine learning technique. As a suggestion for future studies in this line of research, it is recommended to use water quality parameters that could not be obtained in this research, such as temperature and alkalinity of raw water. It also suggests applying these models in parallel with the jar test, to evaluate their efficiency in a WTP in operation. Another interesting suggestion is to use other machine learning techniques to assess predictive efficiency with the same database as this paper.

All relevant data are included in the paper or its Supplementary Information.

The authors declare there is no conflict.

Aggarwal
C. C.
2018
Neural Networks and Deep Learning, Neural Networks and Deep Learning
.
Springer International Publishing
,
Cham
.
https://doi.org/10.1007/978-3-319-94463-0
.
Basheer
I. A.
2000
Selection of methodology for neural network modeling of constitutive hystereses behavior of soils
.
Computer-Aided Civil and Infrastructure Engineering
15
,
445
463
.
https://doi.org/10.1111/0885-9507.00206
.
Bello
O.
,
Hamam
Y.
&
Djouani
K.
2014
Coagulation process control in water treatment plants using multiple model predictive control
.
Alexandria Engineering Journal
53
(
4
),
939
948
.
http://dx.doi.org/10.1016/j.aej.2014.08.002
.
Bobadilla
M. C.
,
Lorza
R.
,
García
R. E.
,
Gómez
F. S.
&
González
E. V.
2019
Coagulation: Determination of key operating parameters by multi-response surface methodology using desirability functions
.
Water
11
(
2
),
398
.
http://dx.doi.org/10.3390/w11020398
.
Boumezbeur
H.
,
Laouacheria
F.
,
Heddam
S.
&
Djemili
L.
2023
Modelling coagulant dosage in drinking water treatment plant using advanced machine learning model: Hybrid extreme learning machine optimized by bat algorithm
.
Environmental Science and Pollution Research
30
(
28
),
72463
72483
.
http://dx.doi.org/10.1007/s11356-023-27224-6
.
Casan
C. C. d. Á. e. S.
2018
Cia Catarinense de Águas e Saneamento Cia Catarinense de Águas e Saneamento [WWW Document]
. .
Gaya
M. S.
,
Yusuf
L. A.
,
Mustapha
M.
,
Muhammad
B.
,
Sani
A.
,
Tijjani
A. T. A.
,
Wahab
N. A.
&
Khairi
M. T. M.
2017
Estimation of turbidity in water treatment plant using Hammerstein-Wiener and neural network technique
.
Indonesian Journal of Electrical Engineering and Computer Science
5
(
3
),
666
.
http://dx.doi.org/10.11591/ijeecs.v5.i3.pp666-672
.
Gomes
L. S.
,
Souza
F. A. A.
,
Pontes
R. S. T.
,
Fernandes Neto
T. R.
&
Araújo
R. A. M.
2015
Coagulant dosage determination in a water treatment plant using dynamic neural network models
.
International Journal of Computational Intelligence and Applications
14
(
3
),
1550013
.
http://dx.doi.org/10.1142/s1469026815500133
.
Haghiri
S.
,
Daghighi
A.
&
Moharramzadeh
S.
2018
Optimum coagulant forecasting by modeling jar test experiments using ANNs
.
Drinking Water Engineering and Science
11
(
1
),
1
8
.
http://dx.doi.org/10.5194/dwes-11-1-2018
.
Heddam
S.
,
Bermad
A.
&
Dechemi
N.
2011a
ANFIS-based modelling for coagulant dosage in drinking water treatment plant: A case study
.
Environmental Monitoring and Assessment
184
(
4
),
1953
1971
.
http://dx.doi.org/10.1007/s10661-011-2091-x
.
Heddam
S.
,
Bermad
A.
&
Dechemi
N.
2011b
Applications of radial-basis function and generalized regression neural networks for modeling of coagulant dosage in a drinking water-treatment plant: A comparative study
.
Journal of Environmental Engineering
137
(
12
),
1209
1214
.
http://dx.doi.org/10.1061/(asce)ee.1943-7870.0000435
.
Jayaweera
C.
&
Aziz
N.
2018
Development and comparison of extreme learning machine and multi-layer perceptron neural network models for predicting optimum coagulant dosage for water treatment
.
Journal of Physics: Conference Series
1123
,
012032
.
http://dx.doi.org/10.1088/1742-6596/1123/1/012032
.
Jayaweera
C. D.
&
Aziz
N.
2021
An efficient neural network model for aiding the coagulation process of water treatment plants
.
Environment, Development and Sustainability
24
(
1
),
1069
1085
.
http://dx.doi.org/10.1007/s10668-021-01483-0
.
Jayaweera
C.
,
Othman
M.
&
Aziz
N.
2019
Improved predictive capability of coagulation process by extreme learning machine with radial basis function
.
Journal of Water Process Engineering
32
,
100977
.
http://dx.doi.org/10.1016/j.jwpe.2019.100977
.
Loc
H. H.
,
Do
Q. H.
,
Cokro
A. A.
&
Irvine
K. N.
2020
Deep neural network analyses of water quality time series associated with water-sensitive urban design (WSUD) features
.
Journal of Applied Water Engineering and Research
8
,
313
332
.
https://doi.org/10.1080/23249676.2020.1831976
.
Maier
H.
2004
Use of artificial neural networks for predicting optimal alum doses and treated water quality parameters
.
Environmental Modelling & Software
19
(
5
),
485
494
.
http://dx.doi.org/10.1016/s1364-8152(03)00163-4
.
Menezes
F. C. d.
,
Fontes
R. M.
,
Oliveira-Esquerre
K. P.
&
Kalid
R.
2018
Application of uncertainty analysis of artificial neural networks for predicting coagulant and alkalizer dosages in a water treatment process
.
Brazilian Journal of Chemical Engineering
35
(
4
),
1369
1381
.
http://dx.doi.org/10.1590/0104-6632.20180354s20170039
.
Shi
Z.
,
Chow
C. W. K.
,
Fabris
R.
,
Liu
J.
,
Sawade
E.
&
Jin
B.
2022
Determination of coagulant dosages for process control using online UV-Vis spectra of raw water
.
Journal of Water Process Engineering
45
,
102526
.
http://dx.doi.org/10.1016/j.jwpe.2021.102526
.
Wu
G.-D.
&
Lo
S.-L.
2008
Predicting real-time coagulant dosage in water treatment by artificial neural networks and adaptive network-based fuzzy inference system
.
Engineering Applications of Artificial Intelligence
21
(
8
),
1189
1195
.
http://dx.doi.org/10.1016/j.engappai.2008.03.015
.
Wu
G. D.
&
Lo
S. L.
2010
Effects of data normalization and inherent-factor on decision of optimal coagulant dosage in water treatment by artificial neural network
.
Expert Systems with Applications
37
,
4974
4983
.
https://doi.org/10.1016/j.eswa.2009.12.016
.
Yu
R. F.
,
Kang
S. F.
,
Liaw
S. L.
&
Chen
M. C.
2000
Application of artificial neural network to control the coagulant dosing in water treatment plant
.
Water Science and Technology
42
,
403
408
.
This is an Open Access article distributed under the terms of the Creative Commons Attribution Licence (CC BY 4.0), which permits copying, adaptation and redistribution, provided the original work is properly cited (http://creativecommons.org/licenses/by/4.0/).