Jun Sun, Xuan Xin, Yan Xin, Sunli Cong
The quality of coffee is significantly influenced by post-harvest processing methods. Conventional analytical techniques for assessing coffee quality are often destructive, time-consuming, and costly. This study explores the non-destructive identification of processing methods applied to Yunnan coffee beans using portable near-infrared (NIR) spectroscopy combined with the lightweight MobileNetV4 model. A comprehensive dataset of 3000 coffee bean samples representing five distinct processing methods was constructed. Spectral data were preprocessed using Savitzky-Golay smoothing, standard normal variate, and detrending algorithms. The proposed MobileNetV4 model, optimized with Bayesian hyperparameter tuning, achieved outstanding performance, with 98.33 % accuracy, 98.39 % precision, 98.33 % recall, and 98.33 % F1-score on the test set. Comparative experiments demonstrated that MobileNetV4 outperformed both traditional machine learning models (Support Vector Machine, Partial Least Squares-Discriminant Analysis, eXtreme Gradient Boosting) and state-of-the-art lightweight deep learning architectures (ShuffleNetV2, EfficientNetV2, GhostNet, MobileNetV3), while maintaining superior computational efficiency. The model has a compact size of 1.53 MB and required only 8 min for training. In conclusion, this research provides a rapid, non-destructive solution for identifying coffee bean processing methods, enabling real-time quality control and fraud detection across production and supply chains.