Subspace/Discriminate Ensemble-based Machine Learning on Visible/Near-infrared Spectra as an Effective Procedure for Non-destructive Safety Assessment of Spinach

Document Type : Original Research

Authors

1 Smart Agricultural Research Department, Agricultural Engineering Research Institute, Agricultural Research, Education and Extension Organization (AREEO), Karaj, Iran.

2 Iranian Institute of Research and Development in Chemical Industries, ACECR, Karaj, Iran.

10.22103/bbr.2025.24539.1110

Abstract

In this study, an orthogonal signal correction (OSC)-based partial least squares (PLS) model and ensemble-based machine learning classifiers, combined with visible/near-infrared (Vis/NIR) spectroscopy, were proposed for non-destructive nitrate prediction in spinach leaves and sample safety evaluation. The OSC method was applied before developing the PLS model to enhance prediction accuracy. Spinach safety assessment was based on the maximum permissible nitrate accumulation level. Various ensemble classifiers, including subspace/discriminate, subspace/k-nearest neighbor, boosted trees, bagged trees, and random under-sampling boosted trees, were evaluated for distinguishing safe and unsafe samples. The best classification results were obtained using the subspace/discriminate ensemble classifier, achieving sensitivity, specificity, and accuracy of 95.24%, 98.73%, and 98.45% for the calibration dataset and 100%, 91.8%, and 92.31% for external validation. The receiver operating characteristic (ROC) curve indicated superior discrimination ability, with an area under the curve (AUC) of 0.95. Additionally, the best model demonstrated a high prediction speed of approximately 280 observations per second. These findings highlight that combining Vis/NIR spectroscopy with the subspace/discriminate ensemble classifier provides an effective, rapid, and non-invasive method for detecting nitrate contamination in spinach leaves, making it a promising approach for food safety monitoring.

Keywords


Ashour, A. S., Guo, Y., Hawas, A. R., & Xu, G. (2018). Ensemble of subspace discriminant classifiers for schistosomal liver fibrosis staging in mice microscopic images. Health information science and systems, 6, 1-10. https://doi.org/10.1007/s13755-018-0059-8
Bachir, N., Haddarah, A., SEPULCRE, F., & PUJOLA, M. (2024). Derivation of a no significant risk level (NSRL) of acrylamide in potato-based synthetic models and validation by NIR spectroscopy. Food Chemistry Advances, 4, 100652. https://doi.org/10.1016/j.focha.2024.100652
Biney, J. K. M., Blöcher, J. R., Borůvka, L., & Vašát, R. (2021). Does the limited use of orthogonal signal correction pre-treatment approach to improve the prediction accuracy of soil organic carbon need attention? Geoderma, 388, 114945. https://doi.org/10.1016/j.geoderma.2021.114945
de Brito, A. A., Campos, F., dos Reis Nascimento, A., Damiani, C., da Silva, F. A., de Almeida Teixeira, G. H., & Júnior, L. C. C. (2022). Non-destructive determination of color, titratable acidity, and dry matter in intact tomatoes using a portable Vis-NIR spectrometer. Journal of Food Composition and Analysis, 107, 104288. https://doi.org/10.1016/j.jfca.2021.104288
de Hond, A. A., Steyerberg, E. W., & Van Calster, B. (2022). Interpreting area under the receiver operating characteristic curve. The Lancet Digital Health, 4(12), e853-e855. https://doi.org/10.1016/S2589-7500(22)00188-1
Fearn, T. (2000). On orthogonal signal correction. Chemometrics and intelligent laboratory systems, 50(1), 47-52. https://doi.org/10.1016/S0169-7439(99)00045-3
ISO (International Organization for Standardization). (1984). Fruit, vegetable and derived products - Determination of nitrite and nitrate content - Molecular absorption spectrometric method (Tech. Rep., Standard No. 6635).
INSO (Iranian National Standardization Organization). (2013). Maximum levels for nitrates in agricultural products (Standard No. 16596). (in Persian)
Ito, H. (2014). New ways to evaluate the quality of vegetables using instruments. Japan Agricultural Research Quarterly: JARQ, 48(2), 111-120. https://doi.org/10.6090/jarq.48.111
Ito, H., Horie, H., Ippoushi, K., & Azuma, K. (2003). Potential of Visible-Near Infrared (VIS-NIR) Spectroscopy for Non-destructive Estimation of Nitrate Content Oin Japanese Radishes. International Conference on Quality in Chains. An Integrated View on Fruit and Vegetable Quality 604,
Itoh, H., Nomura, K., Shiraishi, N., Uno, Y., Kuroki, S., & Ayata, K. (2015). Continuous measurement of nitrate concentration in whole lettuce plant by visible-near-infrared spectroscopy. Environmental Control in Biology, 53(4), 205-215. https://doi.org/10.2525/ecb.53.205
Itoh, H., Tomita, H., Uno, Y., & Shiraishi, N. (2011). Development of method for non-destructive measurement of nitrate concentration in vegetable leaves by near-infrared spectroscopy. IFAC Proceedings Volumes, 44(1), 1773-1778. https://doi.org/10.3182/20110828-6-IT-1002.00738
Jamshidi, B. (2017). Non-destructive safety assessment of agricultural products using Vis/NIR spectroscopy. Nir News, 28(1), 4-8. https://doi.org/10.1177/0960336016687519
Jamshidi, B., Mohajerani, E., & Jamshidi, J. (2016). Developing a Vis/NIR spectroscopic system for fast and non-destructive pesticide residue monitoring in agricultural product. Measurement, 89, 1-6. https://doi.org/10.1016/j.measurement.2016.03.069
Jamshidi, B., Mohajerani, E., Jamshidi, J., Minaei, S., & Sharifi, A. (2015). Non-destructive detection of pesticide residues in cucumber using visible/near-infrared spectroscopy. Food Additives & Contaminants: Part A, 32(6), 857-863. https://doi.org/10.1080/19440049.2015.1031192
Jamshidi, B., & Yazdanfar, N. (2022). Development of a spectroscopic approach for non-destructive and rapid screening of cucumbers based on maximum limit of nitrate accumulation. Journal of Food Composition and Analysis, 110, 104513. https://doi.org/10.1016/j.jfca.2022.104513
Kara, M., & Dasgan, H. (2018). Nitrate, nitrite and chlorophyll contents in parsley and their relationships with each other. XXX International Horticultural Congress IHC2018: International Symposium on Fruit and Vegetables for Processing, International 1292,
Li, S., Li, J., Wang, Q., Shi, R., Yang, X., & Zhang, Q. (2024). Determination of soluble solids content of multiple varieties of tomatoes by full transmission visible-near infrared spectroscopy. Frontiers in Plant Science, 15, 1324753. https://doi.org/10.3389/fpls.2024.1324753
Mienye, I. D., & Sun, Y. (2022). A survey of ensemble learning: Concepts, algorithms, applications, and prospects. Ieee Access, 10, 99129-99149. https://doi.org/10.1109/ACCESS.2022.3207287
Mounce, S., Ellis, K., Edwards, J., Speight, V., Jakomis, N., & Boxall, J. (2017). Ensemble decision tree models using RUSBoost for estimating risk of iron failure in drinking water distribution systems. Water Resources Management, 31, 1575-1589. https://doi.org/10.1007/s11269-017-1595-8
Rahi, S., Mobli, H., Jamshidi, B., Azizi, A., & Sharifi, M. (2020). Different supervised and unsupervised classification approaches based on visible/near infrared spectral analysis for discrimination of microbial contaminated lettuce samples: Case study on E. coli ATCC. Infrared Physics & Technology, 108, 103355. https://doi.org/10.1016/j.infrared.2020.103355
Torres, I., Sánchez, M.-T., Vega-Castellote, M., Luqui-Muñoz, N., & Pérez-Marín, D. (2021). Routine NIRS analysis methodology to predict quality and safety indexes in spinach plants during their growing season in the field. Spectrochimica Acta Part A: Molecular and Biomolecular Spectroscopy, 246, 118972. https://doi.org/10.1016/j.saa.2020.118972
Wiedemair, V., Langore, D., Garsleitner, R., Dillinger, K., & Huck, C. (2019). Investigations into the performance of a novel pocket-sized near-infrared spectrometer for cheese analysis. Molecules, 24(3), 428. https://doi.org/10.3390/molecules24030428
Wold, S., Antti, H., Lindgren, F., & Öhman, J. (1998). Orthogonal signal correction of near-infrared spectra. Chemometrics and intelligent laboratory systems, 44(1-2), 175-185. https://doi.org/10.1016/S0169-7439(98)00109-9
WHO (World Health Organization). (1978). Nitrates, nitrites and N–nitroso compounds (Environmental Health Criteria No. 5).