<figure><img src="image_1.png" /></figure>

HAL
open science

# Image recognition enhances efficient monitoring of the coagulation-settling in drinking water treatment plants

Hongbo Liu, Yang Chen, Xuwei Pan, Junbo Zhang, Jianhong Huang, Eric

Lichtfouse, Gang Zhou, Haiyu Ge

► To cite this version:

Hongbo Liu, Yang Chen, Xuwei Pan, Junbo Zhang, Jianhong Huang, et al.. Image recognition en-
hances efficient monitoring of the coagulation-settling in drinking water treatment plants. Journal of
Cleaner Production, 2024, 482, pp.144251. 10.1016/j.jclepro.2024.144251. hal-04862815

HAL Id: hal-04862815

https://hal.science/hal-04862815v1

Submitted on 3 Jan 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

Public Domain
# Image recognition enhances efficient monitoring of the coagulation-settling in drinking water treatment plants

Hongbo Liu<sup>a, *</sup>, Yang Chen<sup>a</sup>, Xuwei Pan<sup>a</sup>, Junbo Zhang<sup>a</sup>, Jianhong Huang<sup>a</sup>, Eric Lichtfouse<sup>b</sup>, Gang Zhou<sup>c</sup>, Haiyu Ge<sup>d</sup>

## ABSTRACT

Water pollution is a major issue in the context of increasing population and industrialization, yet many drinking water treatment plants (DWTPs) are not fully efficient countering it. In particular, coagulation-settling stage often faces multiple disturbances and time lags, which lower the efficiency because coagulant dosage cannot be accurately calculated in real-time based on the effluent turbidity. To address this issue, we developed a method using deep learning image recognition to monitor the coagulation-settling stage in real-time. For that we used 5761 operational data and images of flocs from the sedimentation tank of a DWTP in East China in 2022, to build an image recognition regression model that predict the turbidity of the sedimentation tank effluent. Results show that our deep learning regression model, performs better with r-square (R²) of 0.97, mean absolute error (MAE) of 0.016 and mean absolute percentage error (MAPE) of 2.74%, compared with the traditional machine learning giving R² of 0.76, MAE of 0.045 and MAPE of 8.26%. The model also avoids misclassification at different turbidity intervals. The incorporation operational data of the sedimentation tank, prediction accuracy is improved by 79.6%. By adjusting the turbidity data to correct time misalignment, our model effectively handles the time lag caused by the hydraulic retention time of the sedimentation tank, thus enhancing the timeliness and accuracy of its practical application.

## Keywords:

Smart water

Coagulation

Flocs image

Regression prediction

Deep learning

## 1. Introduction

The operation of DWTPs is one of the most important parts of water resource management, with the coagulation dosing playing a critical role (Sillanpää et al., 2018; Gregor et al., 1997). However, the coagulation process faces challenges such as overdosing, which can result in chemical wastage, increased costs, and higher sludge volumes (Shi et al., 2022; Adesina et al., 2019). Given this issue, it is now especially critical to provide an innovative and practical approach for accurate coagulant administration in coagulation dosing procedures.

In water quality monitoring of treatment processes, effluent turbidity is a key index to determine whether the finished water meets standards and plays a crucial role with an optimizing coagulant dosage (Abujazar et al., 2022). Precise real-time monitoring of the turbidity of the sedimentation tank effluent is crucial for timely adjustments of the coagulant dosage. However, current water quality testing, even with real-time

sensors, still faces limitations as it heavily depends on manual calibration and interpretation, which may lead to delays and inaccuracies (Ben-David et al., 2021; Wang et al., 2015; Hou et al., 2017; Lian et al., 2022). This process is prone to external environmental influences, which can affect the accuracy of the data and lead to have time lags in obtaining timely monitoring results. Zulkifli et al. (2018) reviewed that water quality monitoring technology in DWTPs can provide real-time data through sensor monitoring, but the monitoring data may have time lags due to the limitations of sensor response speed and environmental factors. This lag affects the accuracy and timeliness of the data, posing a challenge to both process control in DWTPs (Wang et al., 2021). The lag in monitoring data becomes more pronounced during abrupt changes in water quality or regular seasonal variations, making it a challenge to adjust the coagulant dosage in real-time to maintain stable water quality. Excessive dosing increases the daily operational costs of DWTPs and negatively impacts the water safety of residents (Bahrodin

<footnote><sup>a</sup> School of Environment and Architecture, University of Shanghai for Science and Technology, 516 Jungong Road, 200093, Shanghai, China</footnote>

<footnote><sup>b</sup> State Key Laboratory of Multiphase Flow in Power Engineering, Xi'an Jiaotong University, Xi'an, Shaanxi, 710049, China</footnote>

<footnote><sup>c</sup> Zhejiang Province Environmental Engineering Co., LTD, 9 Huanggushan Road, 310012, Hangzhou, China</footnote>

<footnote><sup>d</sup> School of Architecture and Civil Engineering, West Anhui University, Lu'An, Anhui, 237012, China</footnote>

<footnote>* Corresponding author. 516, Jungong Road, 200093, Shanghai, China.</footnote>

<footnote>E-mail addresses: Liuhb@usst.edu.cn (H. Liu), eric.lichtfouse@icloud.com (E. Lichtfouse).</footnote>
et al., 2021). To handle the time lags of manual operation and sensor monitoring, it is necessary to enhance monitoring technology and introduce intelligent methods to improve the accuracy and timeliness of the data.

Machine learning can handle complex multivariate nonlinear relational problems, and in recent years, its applications in the field of water treatment have increased (Li et al., 2021; Suquet et al., 2020). S. Li et al. (2023) built aquatic bio-logic models to predict pollutant consumption capacity. Sinwar et al. (2021) utilized particle swarm optimization algorithm to optimize the availability and performance of physical treatment units in a wastewater treatment plant. Khawaga et al. (2019) developed a novel chlorination disinfection control scheme by combining an artificial neural network (ANN) model with fuzzy logic control, which improved disinfection efficiency and reduced chlorine consumption by 18%. Suquet et al. (2021) developed enhanced coagulation models to optimize coagulation processes at two Mediterranean DWTPs. In the coagulation-settling process, the in-situ identification and analysis of flocs particle characteristics is of great significance (Satoh et al., 2021). Yu (2014) combined the extracted flocs characteristics with a machine learning model to predict the concentration of suspended solids in the water, which was utilized to optimize the coagulant dosage. Nevertheless, the traditional digital image processing methods are based on rule and feature engineering, which leads to incomplete information extraction due to manual feature design and selection. This causes issues such as information loss and slow processing speed (Acharya et al., 2021). Traditional methods struggle to process complex image characteristics and changing patterns, making it difficult to handle the diverse and complex water quality monitoring data in water treatment. Additionally, processing large-scale data often requires significant time and computational resources, leading to slower speeds that cannot meet the demands of real-time monitoring and precise prediction (Zhou et al., 2019). To address these issues, more intelligent and efficient processing techniques should be implemented.

Deep learning, a subset of machine learning, demonstrates powerful characteristics extraction and data mining capabilities, showing promising applications in the field of water treatment (Fu et al., 2022). Convolutional neural network (CNN) was applied to the study of polymerized aluminum chloride (PAC) flocs image recognition. Yamamura et al. (2020) built a CNN classification model to predict water turbidity based on the results provided by laboratory analysis. The model cannot be directly applied in real production, which limits the real-time and accuracy of water quality monitoring. Besides, in the field of coagulation-settling, existing deep learning research needs further optimization of model structure. Current models do not incorporate or input actual process parameters during training (Bankole et al., 2024). In this study, the model prediction accuracy is improved by 79.6% by incorporating sedimentation tank operational data.

Here, we built a deep learning regression model to predict the turbidity of the sedimentation tank effluent. We used 5761 operational data and PAC flocs images from a DWTP in East China in 2022. A summary of the operational data, including means and standard deviations (SD), is shown in Table S1. The PAC flocs images and operational data of the sedimentation tank were used as inputs to the model, while the turbidity of the effluent served as the output. The model predictions effectively determined effluent turbidity, and significantly outperforming traditional machine learning methods. By adjusting the turbidity data to correct time misalignment, our model effectively handles the time lag caused by the hydraulic retention time of the sedimentation tank, enhancing both the timeliness and accuracy of the process, thereby ensuring more reliable and efficient water treatment.

# 2. Materials and methods

## 2.1. Drinking water treatment plant data and image sources

This study is based on actual operational data and images of PAC

flocs from a DWTP in East China. The raw water source for the plant is a mix of Yangtze River water and lake water, with a capacity of 200,000 m³/day. The coagulant used is PAC, with an Al₂O₃ content of 10.3%-10.7%. The dosing system includes a stock tank, a dilution tank, and a metering pump, allowing the coagulant to be added either directly or after dilution. These actual operational data and PAC flocs images used in the study were taken from the Phase II process of the DWTP. The PAC flocs images were captured by a Barlus Underwater Camera UW-S2F-3C6WX10-PAC, installed approximately 1 m underwater on a perforated baffle wall between the coagulation and sedimentation tank, at the beginning of the advection settling tank. The camera was chosen for its high-resolution imaging, waterproof design, and reliable performance in real-time monitoring. The original images were recorded in video format.

The original videos were captured on nine different dates in February, March, and June 2022. To ensure a diverse range of flocs images, videos were evenly sampled during the time intervals of 00:00 to 00:30, 06:00 to 06:30, 12:00 to 12:30, and 18:00 to 18:30 each day. Following capture, the video timestamps were aligned to correspond with the operational data of the DWTP, segmented into 5 min intervals per minute-long video. A total of 212 video segments were captured, with one image extracted every second, resulting in approximately 11,000 PAC flocs images.

## 2.2. Data preparation

### 2.2.1. Preprocessing of flocs images

Due to the underwater environment, variations in illumination, rapid movement of flocs, and other influencing factors, the flocs images are characterized by noise, dynamic blurring, and uneven illumination (Peng et al., 2024). Firstly, the images extracted from the video were cropped to 1000 × 1000 to remove peripheral distortion and maintain image quality for accurate analysis. To address the above problems of flocs images, this study employed image preprocessing methods to enhance image quality and make the flocs characteristics more distinct. The preprocessing strictly follows the process of grayscale, image smoothing, image segmentation and morphological processing (J. Li et al., 2023). Since the images in this study were taken underwater with uneven illumination and lack of clarity, image enhancement techniques were used in the preprocessing to relieve such problems (Li et al., 2020). In order to adapt to the underwater complexity, the underwater PAC flocs image was enhanced using homomorphic filtering. The effect of preprocessing is shown in Fig. 1. Grayscale removed image color, leaving only a single channel of the flocs image (Xia et al., 2018). Homomorphic filtering enhanced the image, making the flocs particles clearer (Seow and Asari, 2006). Median filter image smoothing removed noise from the flocs image (Amanipour and Ghaemmaghami, 2019). The effects of these filters on the flocs are detailed in Table S2. Image threshold segmentation transformed the entire flocs image into two colors with black background and white flocs (Xing, 2020). Morphological processing (erosion followed by dilation) smoothed the edges of the flocs particles and separated the flocs particles that were mildly adherent.

### 2.2.2. Extraction of process characteristics from flocs images and sedimentation tank

In this study, flocs characteristics in images were extracted and analyzed using connected domain analysis. Some very small connectivity regions were identified due to flocs particle motion and out-of-focus imaging of distant flocs. These smaller regions, with an area less than 150 pixels, were filtered out to improve modeling accuracy for subsequent analysis. After filtering, the connectivity regions representing different flocs particles were successfully labeled, allowing for precise characteristics extraction of flocs particles in the analyzed images.

After preprocessing the PAC flocs images, the OpenCV open-source library was utilized to extract relevant flocs particle characteristics values from the images for subsequent analysis and modeling. All the
<figure><img src="image_2.png" /><figcaption>**Fig. 1.** Images of PAC flocculent bodies in the DWTP sedimentation tank. An original picture was obtained directly from the acquisition device, depicting one image for day and one for night, where white represents the PAC body and black represents the background. Grayscale images consist solely of black, white, and gray tones, while image enhancement techniques improve visual characteristics such as clarity and contrast. Image smoothing reduces noise in an image, and image segmentation divides it into multiple distinct regions or objects. Morphological processing (erosion followed by dilation) smoothed the edges of the flocs particles and separated the flocs particles that were mildly adherent.</figcaption></figure>

extracted characteristics values in this study were based on the calculation of image pixel points. While most of these values do not directly correspond to real-world measurements, they are fundamentally consistent with the actual measured characteristics of flocs particles. When selecting characteristics extracted from the flocs, characteristics such as the number of flocs, area, intensity, and particle size were considered. When the coagulant dose is insufficient, there are fewer flocs particles. When the coagulant dose is too high, there are more flocs particles, but they remain small. Only with the correct dosage do the particles become larger and denser (Lee et al., 2014). Since our data was sourced from a long-term stable DWTP, the flocs were consistently stable throughout the process. Meanwhile, from the perspective of fractal theory in coagulation morphology, the fractal characteristics of the flocs particles are related to their structure, particle size, and strength, which can influence the effectiveness of precipitation separation (Lin et al., 2008). In addition to the characteristics extracted directly from the

images, external factors during image capture also influence the recognition of flocs images. Therefore, the sedimentation tank operational data were included in the analysis and modeling. Since no water temperature monitoring equipment was installed in the sedimentation tank, this study used the local average air temperature instead. After applying window smoothing, the original 11,000 PAC flocs images were reduced to 212. The characteristics listed in Table 1 were extracted for the subsequent construction of the machine learning model.

## 2.3. Machine learning model based on flocs images and sedimentation tank operational data

The back propagation neural network (BPNN) machine learning model was built using data samples extracted from PAC flocs images, sedimentation tank operation, and effluent turbidity data. The nine particle characteristics of PAC flocs and three sedimentation tank
<table><caption>**Table 1**
PAC flocs images characteristics and sedimentation tank operational data.</caption><thead><tr><th>Date</th><th>N</th><th>S (px²)</th><th>ΣS (px²)</th><th>L (px)</th><th>ΣL (px)</th><th>m</th><th>A</th><th>Φ (px)</th><th>D<sub>f2</sub></th><th>Illumination</th><th>Flow (m³/h)</th><th>Temperature (°C)</th></tr></thead><tbody><tr><td>2023-2-24 00:00</td><td>75</td><td>1817</td><td>136278</td><td>175</td><td>13153</td><td>1.34</td><td>0.66</td><td>269</td><td>1.35</td><td>0</td><td>3700</td><td>-1</td></tr><tr><td>2023-2-24 12:00</td><td>59</td><td>5169</td><td>213396</td><td>256</td><td>13718</td><td>1.39</td><td>0.31</td><td>266</td><td>2.59</td><td>1</td><td>3700</td><td>9</td></tr><tr><td>2023-2-24 18:00</td><td>60</td><td>2005</td><td>119389</td><td>183</td><td>10916</td><td>1.35</td><td>0.68</td><td>298</td><td>1.50</td><td>0</td><td>3300</td><td>4</td></tr><tr><td>2023-2-27 00:00</td><td>80</td><td>1549</td><td>121808</td><td>158</td><td>12683</td><td>1.33</td><td>0.67</td><td>248</td><td>1.24</td><td>0</td><td>5700</td><td>8</td></tr><tr><td>2023-2-27 07:05</td><td>70</td><td>2130</td><td>144365</td><td>186</td><td>12831</td><td>1.37</td><td>0.56</td><td>256</td><td>1.82</td><td>1</td><td>5100</td><td>8</td></tr><tr><td>2023-2-27-14:35</td><td>71</td><td>1549</td><td>108986</td><td>158</td><td>11240</td><td>1.36</td><td>0.35</td><td>127</td><td>1.31</td><td>1</td><td>5500</td><td>16</td></tr><tr><td>2023-2-27 23:25</td><td>84</td><td>1412</td><td>115838</td><td>147</td><td>12244</td><td>1.34</td><td>0.68</td><td>235</td><td>1.64</td><td>0</td><td>5500</td><td>10</td></tr><tr><td>2023-3-05 06:00</td><td>73</td><td>1939</td><td>135181</td><td>172</td><td>12321</td><td>1.33</td><td>0.67</td><td>297</td><td>1.70</td><td>0</td><td>5500</td><td>5</td></tr><tr><td>2023-3-05 18:20</td><td>87</td><td>1597</td><td>136896</td><td>160</td><td>13920</td><td>1.34</td><td>0.65</td><td>246</td><td>1.69</td><td>0</td><td>6000</td><td>10</td></tr><tr><td>2023-3-12 06:15</td><td>40</td><td>2448</td><td>95366</td><td>195</td><td>7683</td><td>1.29</td><td>0.74</td><td>401</td><td>1.48</td><td>0</td><td>3600</td><td>18</td></tr></tbody></table>

Note: (1) N: Number of flocs. (2) S: Flocs area. (3) ΣS: Total area. (4) L: Flocs perimeter. (5) ΣL: Total perimeter. (6) m: Flocs aspect ratio. (7) A: Flocs strength. It represents the relative brightness of the flocs. (8) Φ: Flocs equivalent particle size. It used to describe the relative size of floc particles in the image. (9) D<sub>f2</sub>: Fractal dimension of flocs. It is used to describe the complexity of floc shape. (10) Illumination: 0 indicates darkness, 1 indicates daytime. (11) Flow rate: Sedimentation tank inflow flow. (12) Temperature: Local temperature data alternative.

operating characteristics of influent flow, illumination, and temperature were used as the input of the model, and the turbidity of the sedimentation tank effluent was used as the output of the model. To eliminate the influence of different dimensions, the data were first divided into training, validation, and test sets (126 for training, 43 for validation, and 43 for testing). After splitting, standardization was applied to each dataset (Eq. (1)) to avoid data leakage.

$$x_i^* = \frac{x_i - \mu}{\sigma} \qquad (1)$$

In the formula, $x_i^*$ is the standardized data, $x_i$ is the data to be processed,

$\mu$ is the mean of the original data, and $\sigma$ is the standard deviation of the original data.

By using Bayesian optimization algorithm to optimize the hyperparameters of the BPNN before training (Bischl et al., 2023), the optimal hyperparameter combination was identified, and the machine learning model of BPNN was constructed on this basis. The Model A is built using flocs particles and settling tank operating characteristics. Additionally, the Model B is built using data without settling tank operating characteristics. This allowed for assessing the impact of settling tank processes and environmental factors on model performance. Fig. 2 shows the structure of the established Model A.

<figure><img src="image_3.png" /><figcaption>**Fig. 2.** Structure of machine learning Model A. The model consists of 11 input neurons, incorporating PAC flocs images and sedimentation tank operational features. It includes 3 hidden layers with 14 neurons each, and an output layer with 1 neuron representing the turbidity of sedimentation tank effluent.</figcaption></figure>
## 2.4. Deep learning model based on flocs images and sedimentation tank operational data

CNN is a deep learning model widely used in computer vision applications, and residual networks-18 (ResNet-18) is one of the classical frameworks of CNN (Li et al., 2022). In this study, a deep learning model for PAC flocs image recognition was established based on the ResNet-18 to realize automatic feature extraction. The PAC flocs images were directly inputted into the model to predict the turbidity of the sedimentation tank effluent. All PAC flocs images were scaled to 224 × 224 size to meet the input requirements of the model. To reduce the pressure on computer memory, one image was extracted every 2 s, and a total of 5761 PAC flocs images were extracted. Each PAC flocs image was combined with the corresponding sedimentation tank influent flow, illumination, temperature, and turbidity of the sedimentation tank outlet to form data samples for deep learning model building and analysis. The data samples were divided into training set, validation set and test set, in which there are 4608 data samples in the training set, 576 data samples in the validation set and 577 data samples in the test set. The divided data sets are standardized to avoid data leakage.

The structure of the ResNet-18 model is improved to adapt to the input data of mixed data types, and the main framework of the model is consistent with the ResNet-18 model. It mainly contains an PAC flocs image input layer, a convolution layer, and a pooling layer. The input and processing section for the numerical features of the sedimentation tank operation mainly includes the input layer for the three numerical features: influent flow, illumination, and temperature, as well as a fully connected layer with 8 neurons. The fully connected part combines the characteristics extracted from the images and the numerical features, and transmits a total of 72 features from the upper layer of the network into the fully connected part, which consists of three hidden layers containing 1,000, 500, and 50 neurons, respectively. Finally, the data is output through a single output neuron. The PAC flocs image recognition model was built according to the improved ResNet-18 model. Table 2 shows the parameters of the built deep learning model, and Fig. 3 shows the structure of the built deep learning model. To analyze the impact of image information loss on PAC flocs image recognition caused by the preprocessing of PAC flocs images. The original color images and the images after preprocessing were used to build the deep learning model respectively. Model C is built by using the original images and Model D is built by using the images after morphological operations.

<table><caption>**Table 2**

Parameters for building deep learning model.</caption><thead><tr><th>Serial number</th><th>Network structure name</th><th>Output data structure</th><th>Convolution/pooling kernel size</th><th>Sweep step size</th><th>Connection to previous structure serial number</th></tr></thead><tbody><tr><td>1</td><td>Image input layer</td><td>(224,224,3)</td><td>-</td><td>-</td><td>-</td></tr><tr><td>2</td><td>Convolution layer</td><td>(112,112,64)</td><td>(7,7)</td><td>2</td><td>1</td></tr><tr><td>3</td><td>Maximum pooling layer</td><td>(56,56,64)</td><td>(3,3)</td><td>2</td><td>2</td></tr><tr><td>4</td><td>Residual block 1</td><td>(56,56,64)</td><td>(3,3)</td><td>1</td><td>3</td></tr><tr><td>5</td><td>Residual block 2</td><td>(28,28,64)</td><td>(3,3)</td><td>2,1</td><td>4</td></tr><tr><td>6</td><td>Residual block 3</td><td>(14,14,64)</td><td>(3,3)</td><td>2,1</td><td>5</td></tr><tr><td>7</td><td>Residual block 4</td><td>(7,7,64)</td><td>(3,3)</td><td>2,1</td><td>6</td></tr><tr><td>8</td><td>Global average pooling layer</td><td>64</td><td>-</td><td>-</td><td>7</td></tr><tr><td>9</td><td>Numerical input layer</td><td>3</td><td>-</td><td>-</td><td>-</td></tr><tr><td>10</td><td>Dropout</td><td>64</td><td>-</td><td>-</td><td>8</td></tr><tr><td>11</td><td>Fully connected layer 1</td><td>8</td><td>-</td><td>-</td><td>9</td></tr><tr><td>12</td><td>Concatenate</td><td>72</td><td>-</td><td>-</td><td>10,11</td></tr><tr><td>13</td><td>Fully connected layer 2</td><td>1000</td><td>-</td><td>-</td><td>12</td></tr><tr><td>14</td><td>Fully connected layer 3</td><td>500</td><td>-</td><td>-</td><td>13</td></tr><tr><td>15</td><td>Fully connected layer 4</td><td>50</td><td>-</td><td>-</td><td>14</td></tr><tr><td>16</td><td>Output layer</td><td>1</td><td>-</td><td>-</td><td>15</td></tr></tbody></table>

Note: Output data structure: It indicates the shape or size of the data after being processed by a certain layer of network, including the width, height and number of channels of the data. Convolution/pooling kernel size: The size of the window or kernel used in a convolutional or pooling layer, which defines the size of the region where local operations are performed on the input data. Sweep step size: In a convolution or pooling operation, the stride distance that the convolution kernel or pooling window slides over the input data. Connect a structure sequence number: Indicates the serial number of the previous layer connected to the current layer, identifies from which previous layer or layers the data stream is passed to the current layer.

## 2.5. Model evaluation metrics and computing resources

In this study, the model evaluation is based on several key metrics, including objective function (OBJ), loss function (Loss), mean absolute error (MAE), R-squared (R²), mean absolute percentage error (MAPE). The computing resources used include an Intel(R) Core (TM) i7-10750H CPU @ 2.60 GHz, an NVIDIA GeForce RTX 2060 GPU with 6 GB of video memory, and 16 GB of RAM.

$$OBJ = \ln \left[ (1 + MAE)(2 - R^2) \right] \qquad (2)$$

$$Loss = \frac{1}{2n} \sum_{i=1}^{n} (\hat{y}_i - y_i)^2 + \frac{\alpha}{2} \sum_{j=1}^{m} w_j^2 \qquad (3)$$

$$MAE = \frac{\sum_{i=1}^{n} |y_i - \hat{y}_i|}{n} \qquad (4)$$

$$R^2 = 1 - \frac{\sum_{i=0}^{n} (y_i - \hat{y}_i)^2}{\sum_{i=0}^{n} (y_i - \bar{y}_i)^2} \qquad (5)$$

$$MAPE = \frac{100\%}{n} \sum_{i=1}^{n} \left| \frac{\hat{y}_i - y_i}{y_i} \right| \qquad (6)$$

In the formula, n is the number of training data, ŷ is the network output value, y is the actual target value, α is the regularization coefficient, m is the number of weights in the network, and ω is the value of the weights in the network.

# 3. Results and discussion

## 3.1. Prediction of effluent turbidity using machine learning model

By analyzing daytime and nighttime flocs images collected in this study (Fig. 1), It was found that the dark night images were brighter and had better imaging quality due to the illumination at the bottom of the sedimentation tank being turned on. The images taken during the daytime were only illuminated by sunlight, making the image background less distinguishable from the flocs particles. The uneven illumination phenomenon is more serious, which leads to the easy occurrence of image segmentation when the image background is misclassified as PAC
<figure><img src="image_4.png" /><figcaption>Fig. 3. Structure of deep learning model. The model designed for deep learning begins with an input layer that receives and preprocesses PAC flocs image data at a pixel size of 224 × 224. Following this, a convolutional layer extracts features from the input data, generating output feature maps. Batch normalization is applied to enhance training speed and stabilize the model, while activation functions increase the ability of network to learn nonlinear relationships. Subsequently, a max pooling layer reduces the spatial dimensions of the feature maps, mitigating computational complexity and overfitting risks. Global average pooling further reduces the feature map to a single dimension, minimizing parameters and capturing global information. A dropout layer is introduced to further combat overfitting. A fully connected layer then maps these processed features to the output, introducing nonlinear relationships to enhance network expressiveness. Finally, flow rate, illumination, and temperature data are integrated with the image data.</figcaption></figure>

flocs particles. Therefore, it was necessary to take different illumination conditions into account when analyzing and modeling the images. At the same time, because the PAC flocs particles are not static when shooting,

the speed of the camera to capture the moving flocs is not as fast as the flocs, resulting in the fast-moving flocs leaving obvious traces of motion blur in the image. Although image preprocessing can reduce the effect of

<figure><img src="image_5.png" /><figcaption>Fig. 4. Spearman correlation coefficient plot between PAC flocs images and the sedimentation tank operational data. (1) ΣS: Total area. (2) S: Flocs area. (3) m: Flocs aspect ratio. (4) L: Flocs perimeter. (5) A: Flocs strength. It represents the relative brightness of the flocs. (6) Φ: Flocs equivalent particle size. It used to describe the relative size of floc particles in the image. (7) Df2: Fractal dimension of flocs. It is used to describe the complexity of floc shape. (8) Flow rate: Sedimentation tank inflow flow. (9) Illumination: 0 indicates darkness, 1 indicates daytime. (10) Temperature: Local temperature data alternative. (11) Effluent Turbidity: Turbidity of sedimentation tank effluent (NTU).</figcaption></figure>
such dynamic blurring to a certain extent, it cannot be completely
removed objectively. The size of the motion blur caused by dynamic
flocs is related to the speed of flocs movement, which is related to the
influent flow rate of the sedimentation tank. Therefore, the sedimenta-
tion tank influent flow rate was taken into account within the model
building process. After conducting the normality test (Table S3),
Spearman correlation matrix heatmap was created to analyze the rela-
tionship between the extracted PAC flocs images and the sedimentation
tank operation characteristics. As shown in Fig. 4, the correlation be-
tween the flow and the effluent turbidity of the sedimentation tank is the
highest, followed by the area of PAC flocs. Meanwhile, other flocs
characteristics, as well as illumination and temperature, also show a
certain degree of correlation with the turbidity of the sedimentation
tank effluent. Therefore, it is crucial to consider flow rate, illumination,
and temperature in the model building process.

The machine learning model was trained using the optimal hyper-
parameters derived from Bayesian optimization. The combination of
hyperparameters obtained at this time is as follows: the neural network
has 3 hidden layers, each containing 14 neurons; the regularization
coefficient is 4.82 × 10⁻³; the momentum factor is 0.75; and the
learning rate is 1.30 × 10⁻². The Model B obtained an optimal result of
0.79 for the objective function. The optimal combination of hyper-
parameters is as follows: the neural network has 2 hidden layers, each
with 6 neurons; the regularization coefficient is 8.79 × 10⁻³; the mo-
mentum factor is 0.41, and the learning rate is 7.19 × 10⁻². We
implemented an early stopping strategy that halts training when the
validation set performance no longer improves. The batch size was set to
16, and we used 20% of our data as a validation set, applying an
embedded cross-validation approach within the neural network frame-
work to ensure model reliability and stability. During the training

<figure><img src="image_6.png" /><figcaption>**Fig. 5.** Metrics variation during the training iterations of the PAC flocs machine learning model. Model A is built using flocs particles characteristics and settling tank operating characteristics. Additionally, Model B is built using data without settling tank operating characteristics. (a) Loss function variation.; (b) MAE variation.; (c) R² variation.; and (d) Objective function variation.</figcaption></figure>
process of the model, the curves of the loss function (Eq. (3)), the MAE (Eq. (4)), the $R^2$ (Eq. (5)), and the variation of the objective function in the training set as well as in the validation set are shown in Fig. 5.

As can be seen in Fig. 5. After 182 training iterations, Model A achieved a loss of 0.36 on the training set (Fig. 5a) with an MAE of 0.26 (Fig. 5b), an $R^2$ of 0.86 (Fig. 5c), and an objective function value of 0.34 (Fig. 5d). On the validation set, the loss was 0.44 (Fig. 5a), with an MAE of 0.31 (Fig. 5b), an $R^2$ of 0.79 (Fig. 5c), and an objective function value of 0.44 (Fig. 5d).

The variation process of the training curve of the Model B is similar to that of the Model A, but the improvement rate and magnitude of each metric are smaller compared to Model A. Before about 50 training iterations, the Model B improves the metrics fast in the training and validation sets, and after that it improves slowly. Eventually the training early stop was triggered after 502 iterations, at which time the loss function in the training set is 0.48 (Fig. 5a), the MAE is 0.53 (Fig. 5b), the $R^2$ is 0.57 (Fig. 5c), and the objective function is 0.75 (Fig. 5d). The loss function in the validation set is calculated to be 0.57 (Fig. 5a), the MAE is 0.55 (Fig. 5b), the $R^2$ is 0.53 (Fig. 5c), and the objective function is 0.79 (Fig. 5d).

The test evaluation of the final performance was carried out using the test set, where the model outputs obtained from the test set were back-normalized. The model predictions were obtained as shown in Fig. 6, and the evaluation metrics of MAE, MAPE (Eq. (6)), and $R^2$ were calculated based on the predicted and actual values. The $R^2$ of the model A is 0.76, the MAE is 0.045, and the MAPE is 8.26%, while the $R^2$ of the Model B is 0.54, the MAE is 0.056, and the MAPE is 10.1%. A comparison of the test results between the Model A and the Model B reveals that the accuracy and fit of the Model B are lower than those of the Model A, particularly in terms of $R^2$. It highlights the essential connection between DWTP operations, environmental characteristics, and sedimentation tank effluent turbidity, underscoring their critical importance in PAC flocs image recognition.

Taking Model A as the final machine learning model, the prediction results of the model in the test set were further analyzed. It can be seen that the distribution of predicted effluent turbidity and actual effluent turbidity of the Model A in the test set is generally consistent, and the residuals of the predicted effluent turbidity are distributed in the interval of ±0.1 NTU and roughly symmetrically distributed (Fig. 6a). The distribution of the residuals shows that the information in the flocs image recognition feature sample data has been fully reflected by Model A, which is applicable to this data set. Combined with the calculation results of the evaluation indexes of the Model A test, the model can meet the requirements of PAC flocs image data. The residuals of the turbidity predictions from Model B are distributed within the range of ±0.2 NTU, indicating significantly poorer performance compared to Model A

(Fig. 6b). Additionally, we performed an uncertainty analysis for both models. The 95% confidence interval of the residuals for Model A is (−0.03, 0.004), while for Model B it is (−0.03, 0.02). These intervals suggest that Model A exhibits more accurate and reliable predictions, with narrower residual ranges and less uncertainty compared to Model B.

## 3.2. Prediction of effluent turbidity using deep learning model

The combination of hyperparameters for deep learning was obtained by the trial-and-error method, in which the regularization coefficient is $1 \times 10^{-5}$, the momentum factor is 0.4, and the learning rate is 0.35. The training strategy is the same as the machine learning model, but the batch size is set to 32 to improve training efficiency, and the performance of model A is also included in the comparison. The curves of loss function, MAE, $R^2$, and objective function metrics variation in the training set as well as in the validation set during the iteration process of the model are shown in Fig. 7. After 91 training iterations, the Model C achieved the following in the training set, the loss function is 0.29 (Fig. 7a), the MAE is 0.09 (Fig. 7b), the $R^2$ is 0.98 (Fig. 7c), and the objective function is 0.11 (Fig. 7d). The loss function in the validation set was calculated to be 0.30 (Fig. 7a), the MAE is 0.15 (Fig. 7b), the $R^2$ is 0.96 (Fig. 7c), the objective function is 0.17 (Fig. 7d). The Model D yields a loss function value of 0.30 in the training set after 81 iterations (Fig. 7a), the MAE is 0.13 (Fig. 7b), the $R^2$ is 0.97 (Fig. 7c), and the objective function is 0.15 (Fig. 7d). The validation set showed a loss of 0.36 (Fig. 7a), an MAE of 0.20 (Fig. 7b), an $R^2$ of 0.89 (Fig. 7c), and an objective function value of 0.27 (Fig. 7d).

As can be seen in Fig. 7, the deep learning model improved each index extremely fast, and the number of iterations required for training is much less than that of the machine learning Model A. Model C outperforms Model A and Model D in all categories of metrics in both the training set and the validation set. Similarly using the data from the test set for the evaluation of the final performance of the deep learning model, the output of the model obtained from the test set was back-normalized and the predicted results are shown in Fig. 8. Calculating the results of the test evaluation metrics, the $R^2$ of Model C is 0.97, the MAE is 0.016, and the MAPE is 2.74%. The $R^2$ of Model D is 0.91, the MAE is 0.025, and the MAPE is 4.65%.

From the comparison of the test results, it can be seen that the test performance of the Model C is optimal, compared with the machine learning model $R^2$ improved by 27.6%, MAE reduced by 64.4%, MAPE reduced by 66.84%. Moreover, compared with the complex image pre-processing and feature extraction process of the machine learning model, the building process of the deep learning model is also more convenient, which reflects the advantages of deep learning over the

<figure><img src="image_7.png" /><figcaption>**Fig. 6.** Machine learning model test set prediction results. Model A is built using flocs particles characteristics and settling tank operating characteristics. Additionally, Model B is built using data without settling tank operating characteristics. (a) Model A test set prediction results; (b) Model B test set prediction results.</figcaption></figure>
<figure><img src="image_8.png" /><figcaption>Fig. 7. Metrics variation during the training iterations of the deep learning model for PAC flocs image recognition. Model C was constructed by using the original image and Model D was constructed by using the pre-processed image (a) Loss function variation. (b) MAE variation. (c) R² variation; (d) Objective function variation.</figcaption></figure>

machine learning model in the task of PAC flocs image recognition (Liu et al., 2022). At the same time, the Model A has a disadvantage compared to the other two models, which is reflected in the fact that the loss of image information caused by the preprocessing of the PAC flocs image has a significant impact on the PAC flocs image recognition. The results predicted by Model C and Model D in the test set were further analyzed, and due to the large amount of data in the test set, the marginal distribution of the actual value over the predicted value was plotted. As shown in Fig. 8a, it can be seen that the distribution of the predicted values and the actual values of the Model C is roughly the same, and the deviation of the predicted values shows a symmetric distribution, indicating that the model effectively fitted the information in the actual data. Except for a few anomalies, most of the residual turbidity is less than 0.06 NTU, and the deep learning model is able to meet the requirements of PAC flocs image recognition and is more

advantageous than the machine learning model. While the Model D predicted relatively poorly in the test set (Fig. 8b).

### 3.3. Mechanistic insights into deep learning model with raw image

Among the four study models, the deep learning model using raw images presents the best results. The deep learning model has a powerful feature learning capability, and its multi-layered neural network structure enables it to automatically learn advanced features from images (Menghani, 2023). In contrast, although machine learning models can learn a certain degree of features through training, their feature extraction process is limited by feature engineering, and they are unable to fully explore the complex information in images (Dong et al., 2021). The information embedded in PAC flocs images often has complex nonlinear relationships, and deep learning models can effectively
<figure><img src="image_9.png" /><figcaption>Fig. 8. Prediction results of the test set of deep learning model. Model C was constructed by using original images and Model D was constructed by using pre-processed images. (a) Model C. (b) Model D.</figcaption></figure>

capture and model these relationships (Chen et al., 2021). With a multi-level neural network structure, the deep learning model is able to better fit the complex mapping relationship between the original image and the turbidity of the sedimentation tank effluent, thus improving the accuracy of the prediction. The deep learning model adopts an

end-to-end learning approach, which is able to learn and optimize directly from the original input to the output (Fig. 9). This end-to-end learning approach eliminates the intermediate steps between feature extraction and model construction, which facilitates the retention of information in the image and reduces the possibility of information loss

<figure><img src="image_10.png" /><figcaption>Fig. 9. Comparison of mechanistic processes in traditional machine learning and deep learning.</figcaption></figure>
(Li et al., 2018).

The deep learning model can fully utilize its feature learning ability. It can effectively model nonlinear relationships. The end-to-end learning approach also provides significant advantages. By processing the original image, the model accurately predicts turbidity in the sedimentation tank effluent. Compared with the machine learning model and the deep learning model using pre-processed images, the deep learning model using raw images shows more prominent advantages in model performance. This model provides effective technical support for solving the problem of real-time control of the coagulant dosing process in DWTPs.

### 3.4. Future perspectives on optimizing coagulation using the ResNet-18 model

This study provides valuable insights into improving the coagulation dosing system for DWTPs. By integrating advanced image recognition technology, the model is trained using actual data from a DWTP. Compared to traditional turbidity sensors, floc image recognition offers deeper insights into particle characteristics such as size, shape, and number, helping operators better monitor and control the coagulation process. This enables more precise real-time adjustments of the coagulant dosage. In unexpected situations, the model can quickly analyze floc images and deliver prediction results within seconds, allowing for timely decisions. The model adjusts the coagulant dosage based on real-time monitoring and analysis of floc images, alongside the dosage prediction model, reducing the risk of overdose. Furthermore, the model can be easily integrated into existing water treatment systems with minimal disruption, making it a viable solution for improving operational efficiency. Future research could explore the integration of additional data sources, such as chemical composition and bioindicators, to enhance the model predictive capabilities.

## 4. Conclusion

In this study, we utilized 5761 operational data and images from a DWTP to build a deep learning model that successfully predicted sedimentation tank effluent turbidity. The deep learning model demonstrated superior performance ($R^2$ = 0.97, MAE = 0.016, MAPE = 2.74%) compared to the traditional machine learning model ($R^2$ = 0.76, MAE = 0.045, MAPE = 8.26%). Deep learning end-to-end learning approach overcomes the shortcomings of traditional machine learning, and the model incorporated the operational characteristics of sedimentation tank to predict effluent turbidity directly from raw images. The model prediction accuracy is improved by 79.6% by incorporation operational data of the sedimentation tank. By adjusting the turbidity data to correct time misalignment, the model avoids the time lags caused by the hydraulic retention time of the sedimentation tank, thus enhancing the timeliness and accuracy of its practical application. Deploying this model in the automatic control system can stabilize effluent quality.

Deep learning simplifies the modeling process and improves the efficiency and accuracy of the model. The model training process in this study only took about 0.5 h, and model prediction for a single image took only a few milliseconds to complete. By directly inputting raw images, the model automatically learned and extracted key features, eliminating the need to manually design and select features. This approach avoids the information loss and processing steps found in traditional methods, making the model more comprehensive, flexible, and applicable to a variety of scenarios. Learning directly from raw images allows the model to be better adapted to different processes and environmental conditions, which enhances its generalization ability and usefulness. This study provides a simple and effective solution for DWTPs and takes an important step towards realizing an intelligent water treatment system.

### CRediT authorship contribution statement

**Hongbo Liu:** Supervision, Project administration, Funding acquisition, Conceptualization. **Yang Chen:** Writing – review & editing, Writing – original draft, Visualization, Validation, Methodology, Investigation, Formal analysis. **Xuwei Pan:** Writing – review & editing, Data curation. **Junbo Zhang:** Formal analysis, Data curation. **Jianhong Huang:** Formal analysis, Data curation. **Eric Lichtfouse:** Writing – review & editing. **Gang Zhou:** Supervision, Project administration, Funding acquisition. **Haiyu Ge:** Supervision, Project administration.

### Declaration of competing interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

### Acknowledgments

The authors would like to acknowledge funding of this work by the University of Shanghai for Science and Technology Excellent Engineer Joint Training Practice Base Project and the Natural Science Foundation of Shanghai (No.22ZR1443200).

## Appendix A. Supplementary data

Supplementary data to this article can be found online at https://doi.org/10.1016/j.jclepro.2024.144251.

### Data availability

The data that has been used is confidential.

### References

Abujazar, M.S.S., Karaagaç, S.U., Abu Amr, S.S., Alazaiza, M.Y.D., Bashir, M.Jk, 2022. Recent advancement in the application of hybrid coagulants in coagulation-flocculation of wastewater: a review. J. Clean. Prod. 345, 131133. https://doi.org/10.1016/j.jclepro.2022.131133.

Acharya, U.R., Molinari, F., Meiburger, K.M., 2021. The impact of pre- and post-image processing techniques on deep learning frameworks: a comprehensive review for digital pathology image analysis. Comput. Biol. Med. 128, 104129. https://doi.org/10.1016/j.combiomed.2020.104129.

Adesina, O.A., Abdulkareem, F., Yusuff, A.S., Lala, M., Okewale, A., 2019. Response surface methodology approach to optimization of process parameter for coagulation process of surface water using Moringa oleifera seed. South Afr. J. Chem. Eng. 28, 46-51. https://doi.org/10.1016/j.sajce.2019.02.002.

Amanipour, V., Ghaemmaghami, S., 2019. Median filtering forensics in compressed video. IEEE Signal Process. Lett. 26, 287-291. https://doi.org/10.1109/LSP.2018.2889921.

Bahrodin, M.B., Zaidi, N.S., Hussein, N., Sillanpää, M., Prasetyo, D.D., Syafiuddin, A., 2021. Recent advances on coagulation-based treatment of wastewater: transition from chemical to natural coagulant. Curr. Pollut. Reports 7, 379-391. https://doi.org/10.1007/s40726-021-00191-7.

Bankole, A.O., Moruzzi, R., Negri, R.G., Bressane, A., Reis, A.G., Sharifi, S., James, A.O., Bankole, A.R., 2024. Machine learning framework for modeling flocculation kinetics using non-intrusive dynamic image analysis. Sci. Total Environ. 908, 168452. https://doi.org/10.1016/j.scitotenv.2023.168452.

Ben-David, E.A., Habibi, M., Haddad, E., Hasanin, M., Angel, D.L., Booth, A.M., Sabbah, I., 2021. Microplastic distributions in a domestic wastewater treatment plant: removal efficiency, seasonal variation and influence of sampling technique. Sci. Total Environ. 752, 141880. https://doi.org/10.1016/j.scitotenv.2020.141880.

Bischl, B., Binder, M., Lang, M., Pielok, T., Richter, J., Coors, S., Thomas, J., Ullmann, T., Becker, M., Boulesteix, A., Deng, D., Lindauer, M., 2023. Hyperparameter optimization: foundations, algorithms, best practices, and open challenges. WIREs Data Mining Knowl. Disc. 13, e1484. https://doi.org/10.1002/widm.1484.

Chen, D., Wawrzyński, P., Lv, Z., 2021. Cyber security in smart cities: a review of deep learning-based applications and case studies. Sustain. Cities Soc. 66, 102655. https://doi.org/10.1016/j.scs.2020.102655.

Dong, S., Wang, P., Abbas, K., 2021. A survey on deep learning and its applications. Compu. Sci. Review 40, 100379. https://doi.org/10.1016/j.cosrev.2021.100379.

Fu, G., Jin, Y., Sun, S., Yuan, Z., Butler, D., 2022. The role of deep learning in urban water management: a critical review. Water Res. 223, 118973. https://doi.org/10.1016/j.watres.2022.118973.
Gregor, J.E., Nokes, C.J., Fenton, E., 1997. Optimising natural organic matter removal from low turbidity waters by controlled pH adjustment of aluminium coagulation. Water Res. 31, 2949-2958. https://doi.org/10.1016/S0043-1354(97)00154-1.

Hou, X., Feng, L., Duan, H., Chen, X., Sun, D., Shi, K., 2017. Fifteen-year monitoring of the turbidity dynamics in large lakes and reservoirs in the middle and lower basin of the Yangtze River, China. Rem. Sens. Environ. 190, 107-121. https://doi.org/10.1016/j.rse.2016.12.006.

Khawaga, R.I., Abdel Jabbar, N., Al-Asheh, S., Abouleish, M., 2019. Model identification and control of chlorine residual for disinfection of wastewater. J. Water Proc. Eng. 32, 100936. https://doi.org/10.1016/j.jwpe.2019.100936.

Lee, C.S., Robinson, J., Chong, M.F., 2014. A review on application of flocculants in wastewater treatment. Process Saf. Environ. Protect. 92, 489-508. https://doi.org/10.1016/j.psep.2014.04.010.

Li, C., Guo, C., Ren, W., Cong, R., Hou, J., Kwong, S., Tao, D., 2020. An underwater image enhancement benchmark dataset and beyond. IEEE Trans. Image Process. 29, 4376-4389. https://doi.org/10.1109/TIP.2019.2955241.

Li, J., Chen, L., Shen, J., Xiao, X., Liu, X., Sun, X., Wang, X., Li, D., 2023. Improved Neural Network with spatial pyramid pooling and online datasets preprocessing for underwater target detection based on side scan sonar imagery. Rem. Sens. 15, 440. https://doi.org/10.3390/rs15020440.

Li, L., Rong, S., Wang, R., Yu, S., 2021. Recent advances in artificial intelligence and machine learning for nonlinear relationship analysis and process control in drinking water treatment: a review. Chem. Eng. J. 405, 126673. https://doi.org/10.1016/jcej.2020.126673.

Li, P., Wang, D., Wang, L., Lu, H., 2018. Deep visual tracking: review and experimental comparison. Pattern Recogn. 76, 323-338. https://doi.org/10.1016/j.patcog.2017.11.007.

Li, S., Zhu, G., Li, X., Wan, P., Yuan, F., Xu, S., Hursthouse, A.S., 2023. Ecosystem-inspired model and artificial intelligence predicts pollutant consumption capacity by coagulation in drinking water treatment. Environ. Chem. Lett. 21, 2499-2508. https://doi.org/10.1007/s10311-023-01602-5.

Li, Z., Liu, F., Yang, W., Peng, S., Zhou, J., 2022. A survey of convolutional neural networks: analysis, applications, and prospects. IEEE Transact. Neural Networks Learn. Syst. 33, 6999-7019. https://doi.org/10.1109/TNNLS.2021.3084827.

Lian, Z., Ai, C., Zhou, Y., 2022. Research and innovation of rapid test method for water quality analysis. J. Phys. Conf. 2152, 012038. https://doi.org/10.1088/1742-6596/2152/1/012038.

Lin, J.-L., Huang, C., Chin, C.-J.M., Pan, J.R., 2008. Coagulation dynamics of fractal flocs induced by enmeshment and electrostatic patch mechanisms. Water Res. 42, 4457-4466. https://doi.org/10.1016/j.watres.2008.07.043.

Liu, B., Ding, M., Shaham, S., Rahayu, W., Farokhi, F., Lin, Z., 2022. When machine learning meets privacy: a survey and outlook. ACM Comput. Surv. 54, 1-36. https://doi.org/10.1145/3436755.

Menghani, G., 2023. Efficient deep learning: a survey on making deep learning models smaller, faster, and better. ACM Comput. Surv. 55, 1-37. https://doi.org/10.1145/3578938.

Peng, S., Guo, Y., Wang, J., Wang, Y., Zhang, W., Zhou, X., Jiang, L., Lai, B., 2024. The coagulation-precipitation turbidity prediction model for precision drug delivery system based on deep learning and machine vision. J. Environ. Chem. Eng. 12, 112211. https://doi.org/10.1016/j.jece.2024.112211.

Satoh, H., Kashimoto, Y., Takahashi, N., Tsujimura, T., 2021. Deep learning-based morphology classification of activated sludge flocs in wastewater treatment plants. Environ. Sci. J. Integr. Environ. Res.: Water Res. Technol. 7, 298-305. https://doi.org/10.1039/D0EW00908C.

Seow, M.-J., Asari, V.K., 2006. Ratio rule and homomorphic filter for enhancement of digital colour image. Neurocomputing 69, 954-958. https://doi.org/10.1016/j.neucom.2005.07.003.

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. J. Water Proc. Eng. 45, 102526. https://doi.org/10.1016/j.jwpe.2021.102526.

Sillanpää, M., Ncibi, M.C., Matilainen, A., Vepsäläinen, M., 2018. Removal of natural organic matter in drinking water treatment by coagulation: a comprehensive review. Chemosphere 190, 54-71. https://doi.org/10.1016/j.chemosphere.2017.09.113.

Sinwar, D., Saini, M., Singh, D., Goyal, D., Kumar, A., 2021. Availability and performance optimization of physical processing unit in sewage treatment plant using genetic algorithm and particle swarm optimization. Intern. J. Syst. Assur. Eng. Manage. 12, 1235-1246. https://doi.org/10.1007/s13198-021-01163-2.

Suquet, J., Godo-Pla, L., Valentí, M., Verdaguer, M., Martin, M.J., Poch, M., Monclús, H., 2020. Development of an environmental decision support system for enhanced coagulation in drinking water production. Water 12, 2115. https://doi.org/10.3390/w12082115.

Suquet, J., Godo-Pla, L., Valentí, M., Ferrández, L., Verdaguer, M., Poch, M., Martín, M. J., Monclús, H., 2021. Assessing the effect of catchment characteristics to enhanced coagulation in drinking water treatment: RSM models and sensitivity analysis. Sci. Total Environ. 799, 149398. https://doi.org/10.1016/j.scitotenv.2021.149398.

Wang, K.-J., Wang, P.-S., Nguyen, H.-P., 2021. A data-driven optimization model for coagulant dosage decision in industrial wastewater treatment. Comput. Chem. Eng. 152, 107383. https://doi.org/10.1016/j.compchemeng.2021.107383.

Wang, Y., Wilson, J.M., VanBriesen, J.M., 2015. The effect of sampling strategies on assessment of water quality criteria attainment. J. Environ. Manag. 154, 33-39. https://doi.org/10.1016/j.jenvman.2015.02.019.

Xia, M., Liu, X., Wong, T.-T., 2018. Invertible grayscale. ACM Trans. Graph. 37, 1-10. https://doi.org/10.1145/3272127.3275080.

Xing, Z., 2020. An improved emperor penguin optimization based multilevel thresholding for color image segmentation. Knowl. Base Syst. 194, 105570. https://doi.org/10.1016/j.knosys.2020.105570.

Yamamura, H., Putri, E.U., Kawakami, T., Suzuki, A., Ariesyady, H.D., Ishii, T., 2020. Dosage optimization of polyaluminum chloride by the application of convolutional neural network to the floc images captured in jar tests. Separ. Purif. Technol. 237, 116467. https://doi.org/10.1016/j.seppur.2019.116467.

Yu, R.-F., 2014. On-line evaluating the SS removals for chemical coagulation using digital image analysis and artificial neural networks. Int. J. Environ. Sci. Technol. 11, 1817-1826. https://doi.org/10.1007/s13762-014-0657-1.

Zhou, L., Zhang, C., Liu, F., Qiu, Z., He, Y., 2019. Application of deep learning in food: a review. Compr. Rev. Food Sci. Food Saf. 18, 1793-1811. https://doi.org/10.1111/1541-4337.12492.

Zulkifli, S.N., Rahim, H.A., Lau, W.-J., 2018. Detection of contaminants in water supply: a review on state-of-the-art monitoring technologies and their applications. Sensor. Actuator. B Chem. 255, 2657-2689. https://doi.org/10.1016/j.snb.2017.09.078.