Smart Bean Analysis: Rapid Detection with Spectral Data and Deep Learning
Abstract
Beans have become a popular food choice in most countries around the world due to their nutritional value and their high protein, fibre, and mineral content. However, like other high-consumption products, beans are not immune to food adulteration. Fresh beans are more popular and more expensive due to their high quality and short cooking time, which results in reduced energy consumption that is a tempting reason for adulteration. Machine learning is one of the emerging approaches to non-destructive detection of food adulteration. This study investigates the application of supervised learning algorithms – AdaBoost, random forest, and ridge classifiers – to distinguish fresh and stale beans based on spectral data. The data were collected using a VISNIR spectrometer, and the models were evaluated under different noise conditions using metrics such as precision, accuracy, recall, F1 score, and ROC/PR curves. Ridge is the most robust model to noise in all four metrics (Accuracy > 0.95, Precision > 0.92, Recall > 0.97, and F-Score > 0.95). Adaboost and RF perform well in low noise, but their performance degrades as noise increases. Ridge is a better choice for applications with noisy environments or data quality issues.
© 2026 Raziyeh Pourdarbani, Sajad Sabzi, Dorrin Sotoudeh, Mohammadreza Ahmaditeshnizi, Nadia Saadati, Mario Hernandez-Hernandez, published by Slovak University of Agriculture in Nitra
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 3.0 License.