Hybrid cnn transformer improves banana quality grade classification accuracy
Enhancing Cross-Grade Generalization in Banana Variety Classification via Hybrid CNN-Transformers and Knowledge Self-Distillation
Computer Vision and Pattern RecognitionArtificial Intelligence
Summary
Banana quality varies by maturity and handling, making it hard for computers to recognize different types reliably. The authors studied a way to teach computer vision models to better identify banana varieties across different quality grades they haven't seen before. They combined two kinds of image analysis methods, CNNs and Transformers, into a hybrid model and used a technique to align their learning. This approach helped the model more accurately classify bananas, even when tested on challenging situations with varying quality.
What this means in practice
- •For precision agriculture teams: Deploy improved banana variety classifiers that maintain accuracy despite variations in fruit quality and handling conditions.
- •For food quality control teams: Implement hybrid vision systems to enhance automated sorting of fruit by quality grade for better supply chain management.
Authors
Khush Kataruka, Mohammad Muzammila, Zahid Akhtar, Raghavendra Ramachandra, Praveen Kumar Chandaliya
Abstract
In recent years, automated fruit classification systems have become a more critical component in precision agriculture for efficient yield estimation, quality control, and supply chain optimization. However, they still face significant challenges under varying quality, fruit maturity, illumination, texture degradation, morphological attributes, domain shift, and post-harvest handling conditions. In this study, we address the challenging issue of cross-grade banana variety classification. This is a real-world setting where models that have been trained on specific quality grades must generalize to unseen grades to handle significant domain shift. Under a rigorous Leave-One-Grade-Out evaluation protocol, we present a thorough comparative analysis of CNNs, ViTs, and dual-stream hybrid architectures using a large-scale dataset of 31,678 banana images with three varieties and three quality grades. Specifically, to address the drawbacks of single-paradigm frameworks, we present a dual-stream Swin ResNet hybrid framework enhanced with KL-divergence-based self-distillation to align probabilistic feature representations across the CNN and Transformer streams. Comprehensive experimental analyzes show that the presented hybrid framework with KL-divergence based self-distillation achieves better overall performance, i.e., it attains a mean accuracy of 81.25% and significantly surpasses CNN and Transformer baseline models. Qualitative analysis further confirms that the hybrid framework in this study improves discriminative feature transferability, improves attention localization, and stabilizes optimization.