Avocado ripeness classification using handheld Raman spectroscopy: addressing data imbalance with machine learning and resampling techniques.
Journal:
Food chemistry
Published Date:
Jan 18, 2026
Abstract
Food waste is a global concern, partially caused by destructive testing and inaccurate visual inspections that misclassify quality. This study developed a machine learning-assisted handheld Raman spectroscopy for non-destructive classification of avocado ripeness. A total of 1274 Raman spectra were collected alongside firmness and internal quality measurements for model training. Characteristic peaks reflected chlorophyll decline and anthocyanin increase during ripening. A two-layer one-dimensional convolutional neural network (1D-CNN) outperformed models wither more layers (i.e., 4 and 6 layers) on the original imbalanced dataset, achieving a receiver operating characteristic-area under the curve (ROC-AUC) of 0.831. In practice, ripeness stages often have uneven sample sizes, challenging classification. The synthetic minority oversampling technique improved the performance of traditional models, with support vector machine and random forest achieving ROC-AUC values ≥0.786. The 1D-CNN, however, performed best on the original dataset. These results highlight a rapid, non-destructive, in-field approach to food ripeness assessment, offering a practical tool to reduce food waste.
Authors
Keywords
No keywords available for this article.