Recently, cameras of mobile have phones emerged as an alternative for quantifying water turbidity. Most of these studies lack a strategy to determine the water turbidity for new samples, focusing mainly on one particular device. Nevertheless, widespread use of these approaches requires a predictive capacity on out-of-the-sample images acquired in devices of different capabilities. We studied the influence of mobile device camera sensors on the predictive performance of water turbidity for non-previously observed turbid images. For this, a reference database with turbid images acquired for different mobile devices was constructed. A machine learning method based on image quality measures and linear classifiers (least squares and LASSO) was proposed to perform predictions on each mobile device. Relative accuracy and precision were evaluated. Results suggest that these approaches may provide accurate predictions reaching most than 80% of relative accuracy with high test-retest reliability (> 0.99). Nevertheless, our results also indicate that the predictive performance levels dropped in low capacity quality sensors. Therefore, despite the high performance that can be reached using these approaches, widespread use on multiple mobile devices may require further development of low-quality sensors and a better understanding of their operative ranges.

  • Mobile phone cameras may serve as an alternative for quantification of water turbidity.

  • We studied mobile cameras’ influence on the predictive performance of water turbidity.

  • These approaches resulted in high accuracies (>80%) and precisions (>0.99).

  • Nevertheless, low-quality sensors resulted in low performance.

  • Widespread use of these approaches requires in low-quality devices.

In the absence of water treatment plants, water turbidity assessment constitutes a crucial strategy to control the harmful effects of consumption of untreated water (Economy 2011; Islam et al. 2020). Water turbidity quantification also serves as a tool in environmental studies for monitoring pollution in possibly hazardous effluents (Rugner et al. 2014). The relationship between the concentration of suspended solids and stream velocity can also be monitored by assessing water turbidity (Mitchell et al. 2003), among other applications.

Human visual assessment represents an approach to quantify water turbidity by using the so-called Secchi disk (Colley & Smith 2001). Despite its simplicity, subjective human visual system capacity to quantify the lack of transparency is hardly reproducible (Preisendorfer 1986). An alternative instrumental approach uses the nephelometer (Davies-Colley & Smith 2001; Pérez et al. 2013); however the cost is prohibitive (Dahlgren et al. 2004). Alternatively, computer vision provides a mechanism for quantifying water turbidity by acquiring samples of images degraded by the turbidity (Toivanen et al. 2013; Wang et al. 2013; Jamale & Pardeshi 2014; Näykki et al. 2014; Karnawat & Patil 2016; Chai et al. 2017; Hamidi et al. 2017; Mullins et al. 2018; Koydemir et al. 2019). The main limitation of these approaches is the use of specialized camera devices (Wang et al. 2013; Jamale & Pardeshi 2014, Chai et al. 2017).

More recently, optical sensor capabilities provided by the camera on mobile devices were also studied for the task of water turbidity quantification (Toivanen et al. 2013; Näykki et al. 2014; Karnawat & Patil 2016, Chai et al. 2017; Hamidi et al. 2017; Koydemir et al. 2019). Most of these studies have focused on correlating the visual degradation of the turbid image and the level of turbidity (Karnawat & Patil 2016, Chai et al. 2017; Hamidi et al. 2017). Nevertheless, the use of these tools for water turbidity monitoring tasks requires predicting the level of turbidity on non-previously observed samples. Some studies have explored this prediction capacity (Toivanen et al. 2013; Näykki et al. 2014; Koydemir et al. 2019). However, the result depends on non-controllable environmental illumination conditions (Toivanen et al. 2013; Näykki et al. 2014), and the influence of different mobile cameras on the quantification performance is still poorly understood (Toivanen et al. 2013; Koydemir et al. 2019). Additionally, most of these predictive studies are hardly reproducible.

The main objective of this work was to study the influence of mobile device camera sensors on the predictive capacity of water turbidity for unknown non-previously observed turbid images acquired under controlled illuminated conditions, in contrast to previous studies focused on more specialized acquisition devices or in establishing a possible statistical relationship between image quality and the turbidity level. For this, we introduced a novel reference database of turbid images aimed to evaluate the prediction of water turbidity and suitable to study different computer-based methods devised for this task. In addition, we propose a novel and highly reproducible water turbidity quantification method based on image quality distortion metrics and machine learning. This method provided predictions of turbidity that were compared in accuracy and precision for the different mobile device camera sensors.

A predictive system was first constructed and then evaluated on previously non-observed samples to study the generalization ability of mobile based computer-vision water turbidity assessment tools. This system was trained on a set of images with different turbidity levels. These images were obtained using a device filled with liquid with different turbidity levels, obtained in controlled conditions, and printed geometric patterns. A light beam source pointed to these geometric patterns allowed light scattering. Finally, a mobile digital camera captured the distorted images corresponding to different levels of turbidity. Figure 1 illustrates the proposed scheme.

Figure 1

Experimental configuration for turbid image samples acquisition. A set of images with different turbidity levels was obtained by using a device with two geometric printed patterns. A light beam source was targeted to the patterns resulting in light scattering, and a digital camera captured the corresponding distorted images.

Figure 1

Experimental configuration for turbid image samples acquisition. A set of images with different turbidity levels was obtained by using a device with two geometric printed patterns. A light beam source was targeted to the patterns resulting in light scattering, and a digital camera captured the corresponding distorted images.

Close modal

The light scattering produced by the particles in suspension of the turbid liquid introduces image quality changes. A set of visual quality measures quantified these decreases in optical quality of the geometric patterns. These measures served as input for a machine learning algorithm, which established the relationship between optical quality degradation and turbidity levels and allowed prediction on new samples.

Turbid image database

Turbidity refers to the scattering and attenuation of light caused by suspended matter in the water (Taccogna & Munro 1995). Turbidity causes loss of water clarity and transparency. This loss degrades the optical quality of objects underwater. The aim here was to relate these variations with the level of water turbidity by using machine learning.

The proposed experimental setting aims to control three factors that influence the optical quality of turbid images, namely, the suspended sediment concentration (SSC), the intensity of light (IL), and the scattering volume (SV). The SSC is the amount of mass of suspended matter per volumetric unit of water. The IL is the light beam source intensity pointed to the geometric pattern. The SV refers to the intersection volume between an observed field of view and the light beam's cone of light.

In the proposed setting, a mixing of different skimmed milk concentrations and clear water controlled the SSC. Skimmed milk particles may have different sizes ranging from 10 to 600 nm (Garcia & Gracias 2011). Small particles of about 10 nm scatter an equal amount of light forward and backward, while for large particles with more than 100 nm, there is a strong small-angle forward scattering and weak backscattering (Garcia & Gracias 2011). In particular, a mixture of 1,650 mL of water at environmental temperature and 0.5 mL of skimmed milk at environmental temperature provided the reference for obtaining different turbid liquids. This particular mixture represents a volume to volume percentage of 0.03. This concentration level varied from 0.03 to 0.60% in steps of 0.03% for 20 levels of turbid water. Figure 1 shows that these concentration levels are visually different.

These mixtures filled up the measurement device. This device included two visual patterns located at different heights (middle and bottom). A light beam source with nine light-emitting diodes (50–55 lumens per piece) illuminated the geometrical patterns to control the IL. The light source and the camera device positioned close enough to maximize the camera field of view and the light volume, allowing control of the SV (see Figure 1). A black layer covering the device minimized the interferences of external light sources; more details about this device can be found in Supplementary Material 1.

To study the degradation in optical quality under different geometrical conditions three different visual patterns were studied: (1) a squared pattern (see Figure 2(a)), composed four squares of black and white colors. (2) a Secchi pattern, corresponding to the geometrical model used in the Secchi disk device (see Figure 2(b)), and (3) a double square pattern, similar to the one used by Toivanen (Toivanen et al. 2013) (see Figure 2(c)).

Figure 2

Geometrical patterns of reference in the proposed approach. At left, the geometrical pattern used in the geometrical squared pattern, in the middle Secchi disk, and at right visual pattern proposed in Toivanen (Toivanen et al. 2013).

Figure 2

Geometrical patterns of reference in the proposed approach. At left, the geometrical pattern used in the geometrical squared pattern, in the middle Secchi disk, and at right visual pattern proposed in Toivanen (Toivanen et al. 2013).

Close modal

The colors and the shapes of the selected visual patterns aimed to account for possible variations, in contrast, luminosity, and geometry of the images under conditions of turbidity (Wang et al. 2004).

Images acquired with four different mobile digital cameras allowed studying generalization ability under various sensing conditions. These devices included: device 1 (2 Megapixels, acquisition resolution 720 × 480), device 2 (10 Megapixels, acquisition resolution 1920 × 1080), device 3 (12 Megapixels, acquisition resolution 1920 × 1080) and device 4 (21 Megapixels, acquisition resolution 1920 × 1080); more details about the mobile device configuration can be found in Supplementary Material 2.

Database construction

A set of different datasets with turbid images served to explore the proposed method's generalization ability over non-previously observed samples. These datasets contained images with different water turbidity levels, combining the three visual patterns and four acquisition devices. In total, 12 datasets were constructed, each composed of 21 samples with different volume/volume percentages of concentration. Each dataset included a reference 0/0 volume/volume concentration. The full experiment was repeated twice, including the liquid preparation and image acquisition, to study the method's generalization capacity on non-previously observed samples.

Quantification of quality distortion

Full reference image quality measurements quantified the level of distortion of the underwater geometric patterns (Pedersen & Hardeberg 2012). These measurements account for the difference between an ideal quality reference image, the image with zero concentration, and another image with degraded quality, the image in turbid conditions. Quality measurements used included mean squared error (MSE), peak signal-to-noise ratio (PSNR), structural similarity (SSIM), and luminance (LUM) (Wang et al. 2004).

Mean squared error
Given two images, distorted (D) and reference (R), the MSE corresponds to the average of the squares of the difference between pixels, i.e.:
formula
where i is an index over the pixels, N the total of pixels, is the value of the i-th pixel in the reference image R and is the value of the i-th pixel in the distorted image D. The MSE captures deviations in intensities between the reference and the distorted images at the pixel level. However, geometrical transformations between the two images highly influence this measure. Therefore, small translations between both images introduced on the acquisition may affect this measurement.
Peak signal-to-noise ratio
The PSNR between D and R corresponds to an MSE normalization, as follows:
formula
where is the maximum intensity value in the distorted image D. This measure represents the distortions captured by the MSE in a logarithmic scale accounting for variations associated with the intensity ranges. This measurement is also sensitive to geometrical transformations between the reference and the distorted images (D'Angelo et al. 2010).
Structural similarity
The SSIM quantifies the distortion level between two images by considering changes in the structural information of a distorted image compared to the reference one (Wang et al. 2004). The SSIM between R and D is computed as:
formula
where and corresponds to the mean and the standard deviation of the intensities in the image R, respectively, and is the covariance between the image R and the image D, and are constants used to stabilize the numerical computations, and L = 255 is the dynamic range of the pixel-values; both and were fixed for all devices. The first term of the SSIM accounts for changes in the luminance (LUM) between both images, characterizing alterations in the mean of the intensities of R and D. The second term models variations linked to image contrast, which are captured by each image's standard deviation. The covariance between R and D captures the variations in image structure (Wang et al. 2004). The LUM term in the SSIM expression was also considered an independent measure of distortion. This measure accounts for the expected changes in intensity commonly observed in turbid water (Wang et al. 2004).

Level of turbidity prediction

After computing the image quality measurements, a machine learning-based prediction method quantified the level of turbidity. In particular, the least absolute shrinkage and selection operator (LASSO) provided the mapping between the four quality measurements computed and the turbidity level (Tibshirani 1996). LASSO is a penalized regression, with an additional L1 regularization term. This approach allows using complex models and avoids overfitting, making it suitable for optimized predictions (Musoro et al. 2014).

Experimental evaluation

The evaluation aimed first to explore the most suitable experimental configuration (predictive model+geometrical pattern) for predicting the level of turbidity in each camera device and then to assess the prediction capacity of this setting on non-previously observed scenarios. The database corresponding to the first experiment repetition provided the best experimental configuration for each camera device. This model predicted turbidity levels on non-previously observed samples corresponding to the second independent experiment of acquisition; both accuracy and precision of predictions were studied for each device.

A two-fold cross-validation scheme provided the best experimental configuration. The first 20 turbid images composed the first partition. Two regression methods adjusted these samples on the different geometric patterns, namely, least square (LS) and LASSO. For each mobile device, six experimental configurations were considered: LS and square, LASSO and square, LS and Secchi, LASSO and Secchi, LS and double square, and LASSO and double square. The test partition with the second 20 turbid images helped select the best experimental configuration (Joanneum 2005). The average of the absolute error of prediction (absolute error of prediction = |predicted was used as a statistical parameter to characterize each experimental configuration's performance. The minimum absolute average error provided the best setting on each device. Finally, to quantify the method's generalization capacity for each device, the selected experimental configuration predicted the turbidity level on the 40 non-previously observed turbid images from the independent experimental dataset.

For each predictive algorithm selected per device, predictive performance was evaluated by using the relative error:
formula
the relative accuracy defined as 1 - , the Pearson correlation between the predicted and the actual turbidity values, and the repeatability or test–retest reliability defined as the Pearson correlation between the predictions for two repetitions available.

The main objective of this work was to study the capacity to predict water turbidity level based on images obtained from different camera sensors of mobile devices. First, we compared the prediction ability for each mobile device when using different experimental configurations. Second, for the best configuration obtained for each mobile device, we evaluated its prediction performance on new turbid images resulting from the second independent acquisition repetition (see section Database construction).

Predictive capacity of different experimental configurations

In the first series of experiments, for each mobile acquisition device studied we evaluated its prediction capacity for different experimental configurations (geometric pattern and prediction model). As a measure of predictive performance, we used the absolute error of prediction, i.e., the absolute value of the difference between the predicted and the experimental concentrations considered.

Figure 3 shows the violin plots of the absolute error of approximation for the different mobile devices. These violin plots show the probability of observing different values of prediction error for different experimental configurations.

Figure 3

Absolute error for different acquisition devices and geometric patterns obtained during the validation phase. Each violin plot refers to the absolute error for two different regression models: least squares (LS in red) and least absolute shrinkage and selection operator (LASSO in green). These violin plots show the probability density of prediction error data at different values. Please refer to the online version of this paper to see this figure in colour: http://dx.doi.org/10.2166/wst.2021.238.

Figure 3

Absolute error for different acquisition devices and geometric patterns obtained during the validation phase. Each violin plot refers to the absolute error for two different regression models: least squares (LS in red) and least absolute shrinkage and selection operator (LASSO in green). These violin plots show the probability density of prediction error data at different values. Please refer to the online version of this paper to see this figure in colour: http://dx.doi.org/10.2166/wst.2021.238.

Close modal

Each experimental configuration corresponded to a combination between a visual pattern (square, Secchi and double square) and a prediction method (LS in red and LASSO in green) on the different devices.

Table 1 reports the averages of the absolute error of prediction for each experimental configuration in the different mobile devices.

Table 1

Prediction errors for different experimental configurations

Mobile device
Experimental configurationDevice 1Device 2Device 3Device 4
LS and square 5.07 0.40 0.22 0.21 
LASSO and square 2.11 1.77 1.27 0.67 
LS and Secchi 0.42 0.30 0.45 0.19 
LASSO and Secchi 0.83 1.74 1.07 1.08 
LS and double square 2.28 0.41 0.33 0.61 
LASSO and double square 1.36 1.24 1.61 1.00 
Mobile device
Experimental configurationDevice 1Device 2Device 3Device 4
LS and square 5.07 0.40 0.22 0.21 
LASSO and square 2.11 1.77 1.27 0.67 
LS and Secchi 0.42 0.30 0.45 0.19 
LASSO and Secchi 0.83 1.74 1.07 1.08 
LS and double square 2.28 0.41 0.33 0.61 
LASSO and double square 1.36 1.24 1.61 1.00 

Averages of absolute prediction errors for the different experimental configurations on the different mobile devices. The best experimental configuration was LS and the visual pattern Secchi for devices 1, 2 and 4. In device 3 the best experimental configuration was LS and the square pattern.

As observed, for device 1 (Figure 3(a)), device 2 (Figure 3(b)), and device 4 (Figure 3(d)), the best predictive experimental configuration corresponded to the combination of the Secchi pattern and the LS prediction method. The average absolute errors were 0.42, 0.30 and 0.19 for devices 1, 2 and 4, respectively. In device 3 (Figure 3(c)), the best predictive experimental configuration was the squared pattern using the LS prediction method with an average of the absolute error 0.22. Prediction performance for high and medium resolution devices (devices 4, 3 and 2) outperformed low-resolution device (devices 1). There were no major differences in predictive performance between the different geometric patterns except in device 1.

Predictive performance on different mobile devices

For each mobile device, we assessed its predictive capacity on completely unknown observed samples for its best experimental configuration (geometric pattern and prediction model) in the two repetitions of the second series of experiments. Figures 47 show predictions over the different turbidity levels on the different mobile devices. For each level of turbidity, four predictions (two images of reference × two repetitions of turbid scenes per level of concentration) were computed. The figures show the two images acquired for the different concentrations and the image used as a reference in the bottom-right area. The dashed line corresponds to the ideal prediction of turbidity.

Figure 4

Device 4 turbidity prediction. Predictions of the levels of turbidity level based on the Secchi pattern for acquisition device 4. High resolution acquisition device resulted in low prediction error.

Figure 4

Device 4 turbidity prediction. Predictions of the levels of turbidity level based on the Secchi pattern for acquisition device 4. High resolution acquisition device resulted in low prediction error.

Close modal
Figure 5

Device 3 turbidity prediction. Predictions of the levels of turbidity level based on the square pattern for acquisition device 3. Middle resolution acquisition device resulted in low prediction error.

Figure 5

Device 3 turbidity prediction. Predictions of the levels of turbidity level based on the square pattern for acquisition device 3. Middle resolution acquisition device resulted in low prediction error.

Close modal
Figure 6

Device 1 turbidity prediction. Predictions of the levels of turbidity level based on the Secchi pattern for the acquisition device 1. Low resolution acquisition device resulted in high prediction error.

Figure 6

Device 1 turbidity prediction. Predictions of the levels of turbidity level based on the Secchi pattern for the acquisition device 1. Low resolution acquisition device resulted in high prediction error.

Close modal
Figure 7

Device 2 turbidity prediction. Predictions of the levels of turbidity level based on the Secchi pattern for acquisition device 2. Middle resolution acquisition device resulted in high prediction error.

Figure 7

Device 2 turbidity prediction. Predictions of the levels of turbidity level based on the Secchi pattern for acquisition device 2. Middle resolution acquisition device resulted in high prediction error.

Close modal

Figure 4 shows the predictions resulted from using device 4 with the Secchi pattern. As observed, this device resulted in low prediction error. The predictive method has a relative accuracy of 80.5% in this device, with a correlation between predictions and real values of 0.99 and a high test–retest reliability of 1.0.

Figure 5 shows the predictions obtained in device 3 with the square pattern. In this case, the predictive method has an accuracy of 64%, with a correlation of 0.98 and a test–retest reliability of 0.99.

Devices 1 and 2 resulted in correlations between predicted values and reference values of −0.04 and 0.95, respectively. In addition, these two devices resulted in the highest relative errors of 165% (devices 1) and 67% (devices 2). In both cases the test–retest reliability was 0.99.

Figures 6 and 7 shows the predictions obtained in device 1 and 2 both with the Secchi pattern, respectively. As observed, low performance predictions were obtained in device 1, while for device 2 predictions improved.

This paper studies the capacity to predict water turbidity level based on images obtained from different camera sensors of mobile devices. The study focused on a highly realistic scenario of predicting the turbidity level of water from non-previously observed images, in contrast to previous studies that mainly focused on establishing a possible correlation between turbidity and optical distortions without considering out-of-the-sample evaluations. The predictive performance for different mobile devices was compared under various experimental conditions, including geometrical patterns and predictive algorithms under controlled illumination conditions. For each device, the best experimental configuration was found, and its predictive capacity was assessed on unobserved samples, resulting from an independent experiment of acquisition. The predictive results provided by these models suggest that camera sensor mobile device selection highly influences the capacity to predict water turbidity in these approaches. In particular, the predictive performance levels drop drastically when low capacity quality sensors were used.

Previous studies have shown that mobile device cameras could help to predict turbidity on sampled water instead of manual or instrumental measurements (Toivanen et al. 2013; Näykki et al. 2014; Karnawat & Patil 2016, Chai et al. 2017; Hamidi et al. 2017; Koydemir et al. 2019). These works focused on one or two camera mobile devices, and they specifically tuned their approaches to these particular acquisition configurations. Nevertheless, the widespread use of these approaches should consider the heterogeneity of camera sensor mobile devices provided by different brands (Mercan et al. 2021). In this work, we studied the prediction performance of water turbidity for four camera sensor devices with various capabilities: device 1 - low, devices 2 and 3 - medium, and device 4 - high (see Supplementary Material 1) under the same experimental conditions. Our result suggests that most studied devices may provide high correlations (>.95) between predictions and the reference values of turbidity. However, low-capability devices resulted in low predictive capacities, suggesting that sensor resolution highly influence these predictions. This result is significant for the potential widespread use of these approaches because, despite the continuous advance in the capacity to acquire image quality, a large percentage of potential users still rely on these low-quality devices (Mercan et al. 2021). Further work may consider devising precisely tailored approaches to these kinds of devices, for instance, by exploiting increasing data availability for these devices and machine learning.

A closer evaluation of the relative accuracy expressed in percent indicates that a better camera sensor may help improve accuracy, reaching performances of 80% of relative accuracy. This result reinforces the fact that individual camera capabilities may influence these predictions. Importantly, accuracies vary across different levels of turbidity. For instance, in device 4 the absolute error was lower for the range of turbidities lower than 5.5, in comparison with the higher levels of turbidity. This result suggests that mobile devices may better quantify turbidity in particular ranges. A similar observation between high quantification performance for low levels of turbidly was also previously reported by Koydemir et al. (Koydemir et al. 2019). The ranges in which predictive performance of water turbidity is higher may help to delimitate possible uses of these approaches and should be better understood in mobile devices.

Previous works have focused on optimizing predictive performances, concentrating mainly on one device (Toivanen et al. 2013; Näykki et al. 2014; Koydemir et al. 2019). Nevertheless, this device per device adjustment approach is unrealistic because of the variety of potential mobile devices and the different acquisitions qualities expected for these devices. Our results on different experimental configurations suggest that in addition to the camera sensor, other factors such as the geometric pattern of reference may influence predictive performance for different devices, see Table 1. In this work, we overcame the limitation of heterogeneity of acquisition devices by relying on a machine learning approach. Specifically, data from one reproducible controlled experiment was used to learn the specific prediction strategy. The proposed methodology is easily extended to other mobile devices, allowing the selection of an appropriate experimental configuration and quantifying prediction performance.

Besides high levels of accuracy, water turbidity quantification using multiple mobile devices also requires a better understanding of the levels of reliability, reproducibility, and stability. Our results show that the reliability for the proposed approach in all studied mobile devices measured as test–retest reliability was high (>0.99). This result suggests that predictions obtained for mobile devices seem to be stable in short time points. Reproducibility aims to measure the variability introduced by different operators. The setting herein proposed focused on comparing different camera sensors. Therefore, the effect of different operators was not considered. Further work may also study the deployment of this solution and the level of reproducibility introduced by this factor. Finally, stability quantifies the variability of the measurements in the long term. In the setting proposed here, this feature may be linked to the level of degradation of the mobile device, which may also be studied. In addition, the resolution of the measurement, which delimitates possible uses of these approaches, should also be further studied, for instance, by examining the predictive performance when increasing the number of turbidity levels.

Our results have different implications for water quality assessment. Firstly, the proposed method opens the possibility of implementing broad-scale strategies for sampling and quantifying various water sources in rural zones (Gaikwad & Munavalli 2016). These data may support, for instance, the development of evidence-based policies for water quality management (WHO/UNICEF Joint Water Supply and Sanitation Monitoring Programme, 2014). Secondly, our results suggest that computer vision-based methods may support environmental monitoring in human-based activities such as mining and agriculture, which can influence water turbidity (Dahlgren et al. 2004). Thirdly, consumers can directly use this development as a first objective stage in daily water monitoring, in particular, in rural zones (Caux et al. 1997). Finally, this monitoring tool can also be useful in water treatment plants in which a periodic quantification of turbid water levels is performed (Gaikwad & Munavalli 2016). Nevertheless, implementation of all these application should carefully consider acquisition devices capabilities, as our results suggest.

The present study has some limitations. First, the number of mobile acquisition devices studied limits the experimental configuration. Our aim was to explore capacities of these devices to perform predictions of the water turbidity level. Our results suggest that the acquisition device's resolution is the most relevant parameter to guarantee a high predictive capacity. Nevertheless, other parameters of mobile devices such as exposition time and optical configuration may also impact this predictive capacity. Therefore, future studies may consider additional capabilities beyond image resolution acquisition. Second, the model presented here is based on image quality distortion. Recently, alternative prediction methods have also been proposed (Liu et al. 2018). In line with our main goal these methods may improve predictive capacity of mobile devices. Unfortunately, there is no quantitative comparison of the predictive performance of these methods. In order to tackle this limitation we include the dataset1 and code2 used in this work to evaluate the predictive capacity. Future work on the evaluation of additional methods of prediction potentially used on mobile devices data can also be tested on this database in future studies (Khullar & Singh 2021). Third, the turbidity reference values used for machine learning training were based on volume/volume percentage concentration. Future studies may also consider acquisition using mobile devices with controlled nephelometric turbidity units to standardize reporting units. Finally, both machine learning methods explored here were linear, and there was no control on negative predictions of the turbidity value. This selection may influence the negative predictions in Figures 6 and 7, and the low predicted values observed for high values of turbidity in devices 3 and 4. In principle, there is no particular reason to assume a linear mapping between the quality features herein used and the turbidity levels. However, two principles guided the selection of linear methods: (1) Occam's razor principle, i.e., simple models on small samples may provide higher generalization rates, (2) the wish for a simple quantification of the prediction error without considering particularities on the predictive operative ranges. Nevertheless, non-linear methods with constraints on the prediction to control for operative ranges of prediction can also be quickly evaluated and compared because of the availability of the data and the source code for the proposed method.

We studied the influence of mobile device camera sensors on the predictive performance of water turbidity for unknown non-previously observed turbid images acquired under controlled illuminated conditions. For this, we proposed a novel method based on machine learning which is suitable for use with different camera sensor devices. In addition, we constructed a novel database based on a reproducible methodology, which can also be used to study different computer vision prediction methodologies. We compared four mobile devices with varying capabilities in their predictive performance. Our results suggest that the proposed approach may reach competitive levels of prediction, both in accuracy and in precision. However, these performances drastically dropped with the decrease in quality of the camera sensor used, and prediction performance may differ for different turbidity ranges. These results suggest that these approaches may be suitable for high-quality camera sensors, at least for some turbidity ranges. Nevertheless, further work should be performed on low-quality sensors.

Caux
P.
,
Moore
D.
&
MacDonald
D.
1997
Ambient water quality guidelines (criteria) for turbidity, suspended and benthic sediments. Water Management Branch, Environment and Resource Management Division, British Columbia Ministry of Environment, Lands and Parks, Victoria, British Columbia Canada
.
Chai
M. M. E.
,
Ng
S. M.
&
Chua
H. S.
2017
An alternative cost-effective image processing based sensor for continuous turbidity monitoring
.
In: 11th Asian Conference on Chemical Sensors (ACCS2015), vol. 1808, no. 1.
Colley
R. D.
&
Smith
D.
2001
Turbidity, suspended sediment, and water clarity: a review
.
Journal of the American Water Resources Association
37
(
5
),
1085
1101
.
Visual Secchi p. 1088, instrumental nephelometer p. 1090
.
Dahlgren
R.
,
Nieuwenhuyse
E.
&
Litton
G.
2004
Transparency tube provides reliable water-quality measurements
.
California Agriculture
58
(
3
),
149
153
.
D'Angelo
A.
,
Zhaoping
L.
&
Barni
M.
2010
A full-reference quality metric for geometrically distorted images
.
IEEE Transactions on Image Processing
19
(
4
),
867
881
.
Davies-Colley
R.
&
Smith
D.
2001
Turbidity suspended sediment, and water clarity: a review
.
JAWRA Journal of the American Water Resources Association
37
(
5
),
1085
1101
.
Economy
E. C.
2011
The River Runs Black: the Environmental Challenge to China's Future
.
Cornell University Press
,
Ithaca, USA
.
Gaikwad
V.
&
Munavalli
G.
2016
Treatability, study for river water with moringa oleifera and nirmali seeds
.
International Journal of Research in Engineering and Technology
05
(
18
),
50
54
.
Garcia
R.
&
Gracias
N.
2011
Detection of Interest Points in Turbid Underwater Images.
OCEANS 2011 IEEE-Spain
.
IEEE
,
Santander, Spain
, pp.
1
9
.
Hamidi
F. N.
,
Zainuddin
M. F.
,
Abbas
Z.
&
Ahmad
A. F.
2017
Low cost and simple procedure to determine water turbidity with image processing
.
ICISPC 2017: Proceedings of the International Conference on Imaging, Signal Processing and Communication July 2017, pp. 30–34
.
Islam
M. S.
,
Hassan-uz Zaman
M.
,
Islam
M. S.
,
Clemens
J. D.
&
Ahmed
N.
2020
Waterborne pathogens: review of outbreaks in developing nations
. In:
Waterborne Pathogens
(H. Bridle, ed.).
Elsevier
,
London
, pp.
43
56
.
Jamale
R. S.
&
Pardeshi
S. A.
2014
Turbidity measurement using video camera
.
International Journal of Electrical, Electronics and Computer Systems (IJEECS)
2
(
3
),
17
22
.
Joanneum
F.
2005
Cross-Validation Explained
.
Institute for Genomics and Bioinformatics, Graz University of Technology
,
Graz
,
Austria
.
Karnawat
V.
&
Patil
S. L.
2016
Turbidity detection using image processing
. In:
2016 International Conference on Computing, Communication and Automation (ICCCA)
.
IEEE
, pp.
1086
1089
.
Koydemir
H. C.
,
Rajpal
S.
,
Gumustekin
E.
,
Karinca
D.
,
Liang
K.
,
Göröcs
Z.
,
Tseng
D.
&
Ozcan
A.
2019
Smartphone-based turbidity reader
.
Scientific Reports
9
(
1
),
1
11
.
Liu
Y.
,
Chen
Y.
&
Fang
X.
2018
A review of turbidity detection based on computer vision
.
IEEE Access
6
,
60586
60604
.
Mitchell
S.
,
Lawler
D.
,
West
J. R.
&
Couperthwaite
J.
2003
Use of continuous turbidity sensor in the prediction of fine sediment transport in the turbidity maximum of the Trent estuary, UK
.
Estuarine, Coastal and Shelf Science
58
(
3
),
645
652
.
Mullins
D.
,
Coburn
D.
,
Hannon
L.
,
Jones
E.
,
Clifford
E.
&
Glavin
M.
2018
A novel image processing-based system for turbidity measurement in domestic and industrial wastewater
.
Water Science and Technology
77
(
5
),
1469
1482
.
Musoro
J. Z.
,
Zwinderman
A. H.
,
Puhan
M. A.
,
ter Riet
G.
&
Geskus
R. B.
2014
Validation of prediction models based on lasso regression with multiply imputed data
.
BMC Medical Research Methodology
14
(
1
),
116
.
Näykki
T.
,
Koponen
S.
,
Väisänen
T.
,
Pyhälahti
T.
,
Toivanen
T.
&
Leito
I.
2014
Validation of a new measuring system for water turbidity field measurements
.
Accreditation and Quality Assurance
19
(
3
),
175
183
.
Pedersen
M.
&
Hardeberg
J. Y.
2012
Full-reference image quality metrics: classification and evaluation
.
Foundations and Trends in Computer Graphics and Vision
7
(
1
),
1
80
.
Pérez
G.
,
Lagomarsino
L.
&
Zagarese
H.
2013
Optical properties of highly turbid shallow lakes with contrasting turbidity origins: the ecological and water management implications
.
Journal of Environmental Management
130
(
1
),
207
220
.
Instrumental (nephelometric turbidity) and visual (Secchi disk)
.
Preisendorfer
R. W.
1986
Secchi disk science: visual optics of natural waters
.
Limnology and Oceanography
31
(
5
),
906
926
.
Taccogna
G.
&
Munro
K.
1995
The Streamkeepers Handbook: A Practical Guide to Stream and Wetland Care
.
Salmonid Enhancement Program, Dept. Fisheries and Oceans
,
Vancouver, BC
.
Tibshirani
R.
1996
Regression shrinkage and selection via the lasso
.
Journal of the Royal Statistical Society. Series B (Methodological)
58
(
1
),
267
288
.
Toivanen
T.
,
Koponen
S.
,
Kotovirta
V.
,
Molinier
M.
&
Chengyuan
P.
2013
Water quality analysis using an inexpensive device and a mobile phone
.
Environmental Systems Research
2
(
1
),
1
.
Wang
Z.
,
Bovik
A. C.
,
Sheikh
H. R.
&
Simoncelli
E. P.
2004
Image quality assessment: from error visibility to structural similarity
.
IEEE Transactions on Image Processing
13
(
4
),
600
612
.
Wang
Q. Q.
,
Xu-Yu
L. I.
&
Zhang
M. L.
2013
Different turbidity fast detection technology based on CCD
.
Instrument Technique Sensor
13
(
4
),
97
101
.
WHO/UNICEF
Joint Water Supply and Sanitation Monitoring Programme 2014. Progress on Drinking Water and Sanitation: 2014 Update
.
World Health Organization, Geneva
.
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/).

Supplementary data