Comparative Analysis of EfficientNet-B0 and ViT-B16 for Multiclass Classification of Green Coffee Beans
DOI:
https://doi.org/10.30871/jaic.v9i6.11563Keywords:
EfficientNetB0, Multi-class Classification, Transfer Learning, USKCoffee, ViTB16Abstract
Green coffee bean classification plays an important role in the coffee supply chain, as bean quality has a direct impact on the taste and final quality of the product. The USK-Coffee dataset, which consists of four bean object classes defect, longberry, peaberry, and premium, is photographed under varied lighting conditions and capture angles, thus challenging the accuracy of conventional visual models. Although lightweight CNN models have been used, not many studies have directly compared transformer-based architectures (ViT-B16) and modern efficient CNNs (EfficientNet-B0) for green coffee bean classification under real conditions. With transfer learning strategy, image augmentation (resize, flip, rotation, color jitter, random crop), and normalization, we evaluate the performance of both models on the dataset. ViT-B16 achieved 85% accuracy on the test data (F1-score 0.85), with a fast batch inference latency of 0.0074 seconds per batch. EfficientNet-B0 achieved 87% accuracy (F1-score 0.87), with a slower batch latency (0.0106 seconds per batch). However, EfficientNet-B0 is significantly faster for single image inference (real-time) (0.035 seconds) compared to ViT-B16 (0.426 seconds). This trade-off higher accuracy/faster single inference on EfficientNet-B0 vs. faster batch processing on ViT-B16 shows that both are feasible for edge computing-based classification systems.
Downloads
References
[1] J. Liu, “Coffee Bean High Accuracy Classification with eXplainable Artificial Intelligence,” pp. 490–497, doi: 10.1145/3659211.3659296.
[2] A. Widyasari, “Pengaruh Ukuran Biji Kopi Robusta pada Kualitas Citarasa Kopi ( The Effect of Robusta Coffee Bean Size on Coffee Taste Quality ),” vol. 11, no. 1, pp. 1–14, 2023.
[3] K. Przybył et al., “Application of Machine Learning to Assess the Quality of Food Products—Case Study: Coffee Bean,” Appl. Sci., vol. 13, no. 19, 2023, doi: 10.3390/app131910786.
[4] K. C. Febrianti et al., “Perbandingan Ekspor Kopi Indonesia Pada Tahun 2021 Dan 2022,” J. Ekon. dan Kewirausahaan West Sci., vol. 2, no. 03, pp. 374–384, 2024, doi: 10.58812/jekws.v2i03.1422.
[5] N. M. Sinta, Z. Alamsyah, and E. Elwamendri, “Analisis Daya Saing Ekspor Kopi Indonesia Dan Vietnam Di Pasar Asean,” J. Ilm. Sosio-Ekonomika Bisnis, vol. 20, no. 1, p. 3, 2018, doi: 10.22437/jiseb.v20i1.5028.
[6] M. Rahimi et al., “Statistik Kopi Indonesia 2023,” vol. 8, 2023.
[7] Bibit Bakoh dan Ratri Wibawanti, “Peningkatan Kapabilitas Penanganan OPT Tanaman Kopi,” 2023.
[8] I. V. C. Motta, N. Vuillerme, H. H. Pham, and F. A. P. de Figueiredo, “Machine learning techniques for coffee classification: a comprehensive review of scientific research,” Artif. Intell. Rev., vol. 58, no. 1, 2025, doi: 10.1007/s10462-024-11004-w.
[9] A. Korkmaz, T. Talan, G. I. Science, and S. Kosunalp, “Comparison of deep learning models in automatic classi fi cation of coffee bean species,” no. April, 2025, doi: 10.7717/peerj-cs.2759.
[10] S. Arwatchananukul, D. Xu, P. Charoenkwan, S. Aung, and R. Saengrayap, “Smart Agricultural Technology Implementing a deep learning model for defect classification in Thai Arabica green coffee beans,” Smart Agric. Technol., vol. 9, no. August, p. 100680, 2024, doi: 10.1016/j.atech.2024.100680.
[11] B. Nair, B. Jayakumari, A. Nanda, and K. Mambilamthoda, “Coffee bean graded based on deep net models,” vol. 14, no. 3, pp. 3084–3093, 2024, doi: 10.11591/ijece.v14i3.pp3084-3093.
[12] R. Gonc et al., “Enhancing green coffee quality assessment through deep learning”.
[13] M. A. Leonardi and A. Y. Chandra, “Analisis Perbandingan CNN dan Vision Transformer untuk Klasifikasi Biji Kopi Hasil Sangrai,” vol. 8, pp. 1398–1407, 2024, doi: 10.30865/mib.v8i3.7732.
[14] M. N. Izza and G. P. Kusuma, “Image Classification of Green Arabica Coffee Using Transformer-Based Architecture,” Int. J. Eng. Trends Technol., vol. 72, no. 6, pp. 304–314, 2024, doi: 10.14445/22315381/IJETT-V72I6P128.
[15] C. Tan, F. Sun, T. Kong, W. Zhang, C. Yang, and C. Liu, “A survey on deep transfer learning,” Lect. Notes Comput. Sci. (including Subser. Lect. Notes Artif. Intell. Lect. Notes Bioinformatics), vol. 11141 LNCS, pp. 270–279, 2018, doi: 10.1007/978-3-030-01424-7_27.
[16] K. Antwi, K. E. Bennin, D. K. Pobi Asiedu, and B. Tekinerdogan, “On the application of image augmentation for plant disease detection: A systematic literature review,” Smart Agric. Technol., vol. 9, no. October, p. 100590, 2024, doi: 10.1016/j.atech.2024.100590.
[17] C. Shorten and T. M. Khoshgoftaar, “A survey on Image Data Augmentation for Deep Learning,” J. Big Data, vol. 6, no. 1, 2019, doi: 10.1186/s40537-019-0197-0.
[18] M. Tan and Q. V. Le, “EfficientNet: Rethinking model scaling for convolutional neural networks,” 36th Int. Conf. Mach. Learn. ICML 2019, vol. 2019-June, pp. 10691–10700, 2019.
[19] Z. Fu, “Vision Transformer : Vit and its Derivatives Swin Transformer : Hierarchical Vision Transformer using,” pp. 1–10, 2022.
[20] D. P. Kingma and J. L. Ba, “Adam: A method for stochastic optimization,” 3rd Int. Conf. Learn. Represent. ICLR 2015 - Conf. Track Proc., pp. 1–15, 2015.
[21] A. Defazio, A. Cutkosky, H. Mehta, and K. Mishchenko, “Optimal Linear Decay Learning Rate Schedules and Further Refinements,” 2023, [Online]. Available: http://arxiv.org/abs/2310.07831
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Muh. Rezky Syaputra, Majid Rahardi

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License (Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) ) that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).








