Hierarchical Two-Stage Hybrid Stacking Framework for Real-Time Strawberry Quality Grading on Edge Devices
Strawberry quality grading is a critical task in post-harvest management due to the fruit's highly perishable nature and significant economic value. While deep learning-based computer vision systems have demonstrated promising performance for automated grading, deploying highly accurate models on resource-constrained edge devices remains challenging because of the trade-off between predictive performance and computational efficiency. To address this issue, this paper proposes a Hierarchical Two-Stage Hybrid Stacking Framework for real-time strawberry quality grading on edge devices. The proposed framework integrates a lightweight YOLO11n detector as a gating network for background removal and region-of-interest extraction, followed by a classification stage that combines lightweight Convolutional Neural Networks (MobileNetV4 and EdgeNeXt) and Vision Transformers (EfficientFormer and TinyViT). A Pareto frontier analysis was conducted to identify models that provide the best balance between accuracy and inference efficiency, while probabilistic soft-voting was employed to construct hybrid ensemble classifiers. Experimental results demonstrate that the optimized YOLO11n gating network achieved an mAP@50 of 93.60% with an inference latency of 11.27 ms. Among all evaluated configurations, the proposed hybrid ensemble combining MobileNetV4 and EfficientFormer delivered the best overall performance, achieving 98.21% classification accuracy and an F1-score of 0.980 with a total inference time of only 13.65 ms. The framework also achieved a recall of 100% for the unripe class, indicating reliable identification of strawberries that are not ready for harvest. Furthermore, five-fold cross-validation confirmed the robustness and stability of the proposed approach across different data partitions. The results demonstrate that combining convolutional and transformer-based architectures within a hierarchical stacking framework effectively exploits complementary local and global feature representations, enabling high-accuracy and low-latency strawberry quality grading suitable for practical deployment on agricultural edge devices.