Classification of Peruvian Cacao Samples from Different Varieties and Geographical Origins Using Near-Infrared Spectroscopy and Machine Learning
The rapid and non-destructive identification of cacao varieties and geographical origins is essential for strengthening traceability, authenticity assessment, and quality management in the Peruvian cacao production chain. This study aimed to evaluate the capability of near-infrared (NIR) spectroscopy combined with machine learning to classify Peruvian cacao samples into eight predefined groups associated with different varieties, genetic backgrounds, and geographical origins. Its main contribution is the comparative evaluation of four machine learning algorithms under standardized spectral preprocessing and experimental conditions. A dataset of 12,000 spectral observations was analyzed. The samples were prepared under standardized laboratory conditions, ground, and analyzed using NIR spectroscopy. The spectra were preprocessed using Standard Normal Variate (SNV) normalization to reduce scattering-related variability, followed by Principal Component Analysis (PCA) for dimensionality reduction. Logistic Regression, Support Vector Machine, Random Forest, and Gradient Boosting were evaluated using an 80:20 training-testing partition, with hyperparameter optimization through grid search and cross-validation. Performance was assessed using accuracy, precision, recall, and multiclass area under the receiver operating characteristic curve (ROC-AUC). Gradient Boosting achieved the highest performance, with 98% accuracy, 98% recall, 97% precision, and a ROC-AUC of 0.99, followed by Random Forest (96%), Logistic Regression (83%), and Support Vector Machine (70%) in accuracy. These findings demonstrate the effectiveness of ensemble methods in distinguishing predefined cacao groups based on their spectral profiles. The novelty lies in integrating spectral analysis and machine learning to discriminate Peruvian cacao groups considering varietal, genetic, and geographical distinctions. However, the results represent group classification rather than definitive geographical authentication or direct quality prediction. Further validation using independent batches, geographical sources, and chemical or sensory reference measurements is necessary to establish the model's generalizability.
Authors
- Luis Humberto Aguayo Fernández
Institutions
- Universidad Tecnológica del Perú (PE)
Publication Details
- Journal
- Journal of Applied Data Sciences
- Published
- 2026-12-01
- DOI
- https://doi.org/10.47738/jads.v7i4.1568
- Primary Topic
- Spectroscopy and Chemometric Analyses
- Type
- article
- Field-Weighted Citation Impact
- 0.00