CropNet++ViT: An Efficient Hybrid CNN-Vision Transformer for Uncertainty-Aware Fruit Quality Assessment and Grading in Smart Agriculture
摘要
Accurate fruit quality assessment is essential for improving grading consistency, reducing postharvest losses, and supporting intelligent decision-making in modern agriculture. Manual inspection remains subjective and prone to variability under diverse environmental and imaging conditions. To address these challenges, this paper proposes CropNet++ViT, a hybrid deep learning framework that integrates EfficientNetB2 and DenseNet121 for multi-scale local feature extraction with a Vision Transformer (ViT)-B/16 backbone for global contextual reasoning, fused via a novel asymmetric cross-attention mechanism. Unlike existing hybrid approaches that employ convolutional neural network (CNN) and ViT features symmetrically, the proposed cross-attention module assigns ViT-derived global representations as the Query and CNN-derived local features as Key and Value, enabling directional, complementary feature integration. Monte Carlo Dropout quantifies predictive uncertainty to support human-in-the-loop decision-making, and Gradient-weighted Class Activation Mapping (Grad-CAM) provides visual interpretability of model decisions. The proposed model is evaluated on three benchmark datasets, achieving classification accuracies of 96.9% (Tomato Quality), 96.6% (FruitQ), and 94.8% (FruitSeg30), with an overall average of 95.8%, outperforming individual CNN-only and ViT-only baselines by approximately 1.5–2.0%. Cross-domain evaluation demonstrates strong generalization, maintaining 93.8–94.7% accuracy across unseen datasets without fine-tuning. Uncertainty analysis confirms a clear separation between correct and incorrect predictions, with entropy increasing from 0.21 to 0.47, enabling reliable identification of low-confidence cases. These results establish the proposed CropNet++ViT model as a scalable, interpretable, and uncertainty-aware solution for automated fruit grading in smart agriculture.