Lightweight Vision-transformer-based Coffee Bean Quality Inspection with Class-aware Unsupervised Domain Adaptation
With the rapid development of automated optical inspection (AOI) technology and imaging sensor systems, image-based coffee bean quality inspection has emerged as an effective alternative to manual sorting.High-resolution imaging sensors are capable of capturing critical surface features of coffee beans, including texture, color, and structural patterns, thereby providing rich input for downstream intelligent classification algorithms.However, most existing research has concentrated on green beans, while labeled datasets for roasted beans remain scarce.This imbalance severely restricts the generalization capability of trained models in realworld applications.To address this issue, a class-aware unsupervised domain adaptation (UDA) framework based on the vision transformer (ViT) architecture is proposed.The framework simultaneously aligns the feature distributions between the source domain (green beans) and the target domain (roasted beans), while enhancing class-level consistency during training.This design effectively mitigates domain shifts induced by variations in coffee processing stages, thereby improving model robustness in cross-domain scenarios.In addition, to enhance deployment efficiency and operational practicality in intelligent sensing environments, a model compression strategy is further introduced.By leveraging the modular dependency structure inherent in transformer-based architectures, we developed an approach that integrates structured pruning with knowledge distillation (KD) to significantly reduce model complexity while preserving classification performance.Experimental results confirm that the proposed method delivers high classification accuracy and generalization capability, demonstrating its potential for deployment in image-based coffee bean quality inspection systems.
Authors
- Zih-Ching Chen
- Ching-Yi Chen
- Hsien-Chun Cho
Publication Details
- Journal
- Sensors and Materials
- Published
- 2025-08-28
- DOI
- https://doi.org/10.18494/sam5701
- Primary Topic
- Spectroscopy and Chemometric Analyses
- Type
- article
- Field-Weighted Citation Impact
- 0.00