摘要
Smartphones have become ideal platforms for portable colorimetric analysis due to their widespread availability, cost-effectiveness, and advanced imaging capabilities. However, most existing smartphone-based detection methods are susceptible to inconsistent lighting conditions and often rely on external computational resources, which limits their practical application in scenarios like food quality control and environmental monitoring. To overcome these limitations, a fully on-device smartphone colorimetry system integrated with machine learning (ML) is presented. Leveraging the characteristic color transition from light pink to deep purple, the system captures sample images using the built-in smartphone camera and processes them via a custom-developed Android application. To tackle lighting interference, a foundational dataset of 1134 images was constructed under seven controlled lighting conditions using two smartphone models. On the two primary training devices, XGBoost demonstrated the best predictive accuracy ( \(\varvec{R^{2} = 0.9968, \textrm{RMSE} = 0.0044, \textrm{MAPE} = 2.87\%}\) ) among four trained ML models. Furthermore, robust cross-device generalization was successfully validated on two additional unencountered models via an adaptive calibration protocol. The system offers a wide working range (0.045–0.250 mg/L), a low detection limit (0.015 mg/L), and maintains high analytical reliability under diverse lighting scenarios. The system’s practical applicability was demonstrated through the quantification of nitrite in processed meat samples and water. Furthermore, the entire workflow from automatic region-of-interest identification to concentration prediction is performed locally on the smartphone without requiring internet connectivity, ensuring operational autonomy and data privacy. This portable, low-cost, and user-friendly system demonstrates strong potential as a practical tool for on-site food safety screening and environmental surveillance.
危险品化学品经营许可证(带存储)