Siheng Lu, Yifei Du, Jing Zhao, Yue Yu, Yue Huang, Fuliang Cao, Zhanming Li
Coffee beans from different origins vary significantly in flavor, chemical composition, and sensory properties. As consumer demand for high-quality coffee continues to grow, determining the origin of coffee beans has become crucial for ensuring product quality and safety. Traditional origin identification methods rely on manual sensory evaluation and chemical analyses. In this study, a hyperspectral-guided method based on red-green-blue (RGB) images is proposed for identifying the origin of coffee beans, aiming to achieve efficient and non-destructive quality inspection using low-cost RGB cameras. Hyperspectral and RGB images of Arabica beans from Yunnan (China), Vietnam, Kenya, and Ethiopia were collected, preprocessed, and subjected to feature extraction. A comparison among GoogLeNet, AlexNet, and Vision Transformer (ViT) showed that GoogLeNet with transfer learning achieved 100% validation accuracy on the validation set, and reached an average accuracy of 95% in external real-scene tests with scattered beans. The overall identification accuracy for the four origins ranged from 87.5% to 100%, with a macro F1-score of 0.944. This method, which transfers hyperspectral features to RGB analysis, enhances detection efficiency and demonstrates potential as a cost-effective, scalable solution for coffee quality control. Future work will focus on improving model generalization and exploring self-supervised learning to reduce reliance on hyperspectral imaging.