Deep learning-based classification of nitrate and nitrite concentrations from water samples using colorimetric test strip images

Accurate monitoring of nitrate and nitrite concentrations in water is essential for sustainable agriculture, safeguarding public health, and protecting aquatic ecosystems from nutrient pollution. Traditional methods for detecting nitrate and nitrite in water samples are precise but costly, complex, and time-consuming, limiting their practicality for frequent on-site testing. This research proposes deep learning-based computer vision techniques to classify nitrate and nitrite concentrations using images of colorimetric test strips. An RGB IMX219 camera was used to acquire images of colorimetric test strips under standardized, controlled illumination conditions to ensure consistent image quality. A total of 1938 nitrate images and 1190 nitrite images were collected before augmentation. After preprocessing and training-only data augmentation, both classical machine learning baselines based on hand-crafted color and texture features and deep learning models-including a multilayer perceptron (MLP) and convolutional neural networks (AlexNet, VGG16, ResNet18, and GoogLeNet)-were trained and evaluated using an independent test set and stratified fivefold cross-validation. For nitrate classification, ResNet18 and GoogLeNet achieved near-perfect 100% test accuracy, with mean cross-validation accuracy of 99.97% ± 0.04%, substantially outperforming classical baseline models based on hand-crafted color and texture features, which achieved at most 83.5% test accuracy. For nitrite classification, GoogLeNet achieved the strongest overall performance, with a test accuracy of 97.48% and a fivefold cross-validation accuracy of 95.22% ± 1.17%, substantially outperforming the best classical baseline model, which achieved a maximum test accuracy of 83.19%. These results demonstrate that deep CNN-based feature learning provides a significant performance advantage over simpler methods under controlled imaging conditions, supporting the suitability of the proposed system for rapid, image-based water quality assessment and motivating future evaluation under broader real-world deployment scenarios.

Authors

Institutions

Publication Details

Journal
Environmental Monitoring and Assessment
Published
2026-04-11
DOI
https://doi.org/10.1007/s10661-026-15297-y
Primary Topic
Water Quality Monitoring Technologies
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Deep learning-based classification of nitrate and nitrite concentrations from water samples using colorimetric test strip images

Ali Mirzakhani Nafchi, Mazhar Sher, Chamika Kuruppuarachchi, Azlan Zahid et al.
Environmental Monitoring and Assessment
Water Quality Monitoring Technologies
article

Deep learning-based classification of nitrate and nitrite concentrations from water samples using colorimetric test strip images

Ali Mirzakhani Nafchi, Mazhar Sher, Chamika Kuruppuarachchi, Azlan Zahid, Arshid Ali, Muhammad Roman, Chulwoo Pack
article en

Abstract

Accurate monitoring of nitrate and nitrite concentrations in water is essential for sustainable agriculture, safeguarding public health, and protecting aquatic ecosystems from nutrient pollution. Traditional methods for detecting nitrate and nitrite in water samples are precise but costly, complex, and time-consuming, limiting their practicality for frequent on-site testing. This research proposes deep learning-based computer vision techniques to classify nitrate and nitrite concentrations using images of colorimetric test strips. An RGB IMX219 camera was used to acquire images of colorimetric test strips under standardized, controlled illumination conditions to ensure consistent image quality. A total of 1938 nitrate images and 1190 nitrite images were collected before augmentation. After preprocessing and training-only data augmentation, both classical machine learning baselines based on hand-crafted color and texture features and deep learning models-including a multilayer perceptron (MLP) and convolutional neural networks (AlexNet, VGG16, ResNet18, and GoogLeNet)-were trained and evaluated using an independent test set and stratified fivefold cross-validation. For nitrate classification, ResNet18 and GoogLeNet achieved near-perfect 100% test accuracy, with mean cross-validation accuracy of 99.97% ± 0.04%, substantially outperforming classical baseline models based on hand-crafted color and texture features, which achieved at most 83.5% test accuracy. For nitrite classification, GoogLeNet achieved the strongest overall performance, with a test accuracy of 97.48% and a fivefold cross-validation accuracy of 95.22% ± 1.17%, substantially outperforming the best classical baseline model, which achieved a maximum test accuracy of 83.19%. These results demonstrate that deep CNN-based feature learning provides a significant performance advantage over simpler methods under controlled imaging conditions, supporting the suitability of the proposed system for rapid, image-based water quality assessment and motivating future evaluation under broader real-world deployment scenarios.

Environmental Monitoring and AssessmentVol. 198(5)
Texas A&M University System (US), South Dakota State University (US)
South Dakota Water Resources Institute, South Dakota State University
Zero hunger
Openalex Percentile: Top 15%
Water Quality Monitoring Technologies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.