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.
Roman et al. (Wed,) studied this question.