Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2024 Mar 5:22:100217.
doi: 10.1016/j.wroa.2024.100217. eCollection 2024 Jan 1.

Efficient smartphone-based measurement of phosphorus in water

Affiliations

Efficient smartphone-based measurement of phosphorus in water

Haiping Ai et al. Water Res X. .

Abstract

Agricultural runoff is one of the main sources of excess phosphorus (P) in different water bodies, subsequently leading to eutrophication and harmful algal blooms. To effectively monitor P levels in water, there is a need for simple measurement tools and extensive public involvement to enable regular and widespread sampling. Several smartphone-based P measurement methods have been reported, which extract red-green-blue (RGB) values from colorimetric reactions to build statistical regression models for P quantification. However, these methods typically require meticulous light conditions, involve initial equipment investment, and have undergone limited testing for large-scale applications. To overcome these limitations, this study developed a smartphone-based, equipment-free and facile P colorimetric analysis method. Following the standard procedure of the ascorbic acid approach, colorimetric reactions were captured by a smartphone camera, and RGB values were extracted using Python code for modeling. Different indoor light conditions, phone types, containers, and types of water samples were examined, resulting in a collection of 1922 images. The best regression model, employing random forest with RGB values and container types as inputs, achieved an R2 of 0.97 and an RMSE of 0.051 for P concentrations ranging from 0.01 to 1.0 mg P/L. Additionally, the optimal classification model could estimate the level of P below 0.1 mg P/L with an accuracy of 95.2 (or 77.4 % for <0.05 mg P/L). The strong performance of the developed models, which are also available freely online, suggests an easy and effective tool for more frequent P measurement and greater public involvement.

Keywords: Colorimetric analysis; Machine learning; Phosphorus monitoring; Smartphone.

PubMed Disclaimer

Conflict of interest statement

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.

Figures

Image, graphical abstract
Graphical abstract
Fig 1
Fig. 1
Model performance for each data group based on different (a) indoor light conditions, (b) phone inputs (IOS and Android), and (c) container types in the second, third, and fourth RF model, respectively. Note: The data dataset was randomly stratified split to training and test set in a 4:1 ratio for 20 times by changing the random state from 42 to 61. The model performance is presented as the mean value, and the error bar is the standard deviation.
Fig 2
Fig. 2
Scatter plot of predicted and actual P concentrations in the (a) training set and (b) test set of the third RF model. The gray line is the reference of the 1:1 slope; (c) Prediction residuals for the test set (Prediction residuals = predicted value – actual value). Based on the water sample sources, the test set data was split into DI (pure water-made P solution, black), spiked (real water-made P solution, red), and real (in-situ samples, green). Note: the model performance was based on a random state of 42 as the representative results as the standard deviation of R2 and RMSE is negligible for 20 times of data split (Table 2).
Fig 3
Fig. 3
Experimental setup and the workflow.

Similar articles

Cited by

References

    1. Ai H., Zhang K., Sun J., Zhang H. Short-term Lake Erie algal bloom prediction by classification and regression models. Water Res. 2023 - PubMed
    1. Breiman L. Bagging predictors. Mach. Learn. 1996;24:123–140.
    1. Breiman L. Random forests. Mach. Learn. 2001;45:5–32.
    1. Chen, T. and Guestrin, C. 2016 Xgboost: a scalable tree boosting system, pp. 785–794.
    1. Costa D., Aziz U., Elliott J., Baulch H., Roy B., Schneider K., Pomeroy J. The Nutrient App: developing a smartphone application for on-site instantaneous community-based NO3 and PO4 monitoring. Environ. Modell. Softw. 2020;133

LinkOut - more resources