Development of an AI-Enabled Vision-Based On-Site Rapid Detection of Nitrates and Nitrites from Drainage Samples
Muhammad Roman, Azlan Zahid, Ali Mirzakhani Nafchi, Mazhar Sher
South Dakota State University · Texas A&M University System
Key points
From the paper's conclusion- This technology can enable farmers, water quality researchers, and agronomists to efficiently monitor the levels of nitrates and nitrites in tile drainage samples, enabling data-driven decisions to maximize crop yields.
Abstract
Abstract Plant growth is significantly impacted by the concentration of nutrients in the soil. Accurate and real-time measurement of nitrates and nitrites levels remains a significant challenge. Existing laboratory-based methods are expensive, time-consuming, and labor-intensive, highlighting the need for a rapid, on-site solution. This study proposes a rapid method for measuring nitrates and nitrite levels in water samples collected from tile drainage. We utilized Hach Nitrate and Nitrite test strips for image dataset collection as these test strips change color based on the concentration of nitrate and nitrite in the water samples. A purpose-built black box, equipped with an internal lighting arrangement for imaging test strips, was designed to collect images of the test strips. Unlike many existing smartphone-based colorimetric approaches, which are sensitive to ambient lighting variations and often rely on external calibration or offline analysis, the proposed system integrates a controlled illumination environment with real-time edge computation for robust on-site detection of nitrate and nitrite. An Nvidia Orin Nano module, connected with an IMX219 camera sensor, was used to capture images of the test strips. Image preprocessing was performed, followed by the implementation of a VGG16-based network for feature extraction. A dataset of approximately 3128 images spanning multiple nitrate and nitrite concentration levels was collected under controlled imaging conditions. Multiple machine learning models including logistic regression (LR), support vector machines (SVM), k-nearest neighbors (KNN), naïve Bayes (NB), and random forest (RF) were evaluated for classification. The nitrate detection using KNN achieved an accuracy of 99.96% training, 99.92% testing, and 99.79% cross-validation. For nitrite detection, the SVM model achieved accuracy of 99.02%, 98.04%, and 98.07% for training, testing, and cross-validation, respectively, demonstrating both systems' high reliability and practical applicability for real-time monitoring. The total system cost is approximately USD 300, highlighting the affordability and practicality of the proposed solution for on-site water quality monitoring. This technology can enable farmers, water quality researchers, and agronomists to efficiently monitor the levels of nitrates and nitrites in tile drainage samples, enabling data-driven decisions to maximize crop yields.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Deep learning-based classification of nitrate and nitrite concentrations from water samples using colorimetric test strip imagesEnvironmental Monitoring and Assessment · 2026
- Smart Paper-Based Nanosensor for Simultaneous Environmental eMonitoring of Nitrate and NitriteACS Measurement Science Au · 2025
- Rapid and home-testable integrated colorimetric sensor for nitrite detection in urine.Mikrochimica acta · 2026
- Machine Learning-Assisted Colorimetric Quantification of Nitrite in Plateau Lake Waters.Analytical chemistry · 2026
- Controlled image-based prediction of soil nutrient concentrations (NPK) using machine and deep learning.PloS one · 2026
- Real‐Time Nutritional Monitoring Using Edge AI and IoT Cameras2026