Comparative Analysis of EfficientNet-B0 and ViT-B16 for Multiclass Classification of Green Coffee Beans - Syaputra, Muh. Rezky; Rahardi, Majid (Journal of Applied Informatics and Computing, 2025)
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.