Abstract:
Fresh daylily (
Hemerocallis citrina) is one of the specialty agricultural products for its nutritional properties. The postharvest quality grading of fresh daylilies is often required for their processing, storage, and subsequent deep utilization. However, current manual sorting cannot fully meet the large-scale production in recent years, due to the low efficiency, high labor intensity, and strong subjectivity. Moreover, existing detection models can also suffer from high computational complexity and insufficient recognition accuracy, particularly when the dense arrangements and morphological variations are inherent to fresh daylily buds. In this study, a systematic three-level grading framework was established using bud length as the primary criterion. A pixel threshold conversion model was developed after spatial calibration and geometric correction, enabling the accurate mapping of physical bud lengths to image pixel thresholds. The precise grading annotation was also realized for visual inspection using imaging. A quality grading detection model, named PDi-YOLOv11n, was proposed using an improved YOLOv11n architecture, specifically tailored for fresh daylilies. 1) Feature extraction was enhanced to reduce the computational redundancy under dense and complex arrangement scenarios. The conventional C3k2 module in the backbone network was replaced with a C3k2_CSPPC module, which was integrated with a Cross-Stage Partial Pyramid Compression (CSPPC) structure. Multi-scale feature representations were effectively refined to compress the spatial and channel information over hierarchical stages. Thereby, the performance was improved to discriminate overlapping or closely adjacent daylily buds. 2) A dynamic upsampling module (DySample) was incorporated to reduce the missed detection and inaccurate localization—especially for buds with varying orientations and occlusions. Unlike fixed upsampling, a content-adaptive mechanism was employed to dynamically adjust the sampling locations using feature context. Spatial localization accuracy was significantly enhanced to precisely delineate the boundary features. 3) An iEMA mechanism was introduced into the neck network. Inverted Residual Mobile Block (iRMB) was integrated with the Efficient Multi-scale Attention (EMA) mechanism. Salient features of fresh daylily were extracted to emphasize the discriminative regions at multiple scales, while the background interference was suppressed effectively. The architecture improved the detection efficiency and robustness under varying field conditions. Experimental evaluations were conducted on a self-constructed dataset with the diverse images of fresh daylilies under different lighting, orientation, and density. The PDi-YOLOv11n was substantially improved for the detection precision among all grading categories, compared with the baseline YOLOv11n model. Specifically, the average detection precision increased by 2.6, 5.3, and 2.6percentage points, respectively, for the premium, first-, and second-grade fresh daylily. The precision, recall, and mean average precision were improved by 4.3, 2.4, and 2.6 percentage points, respectively. In addition to high accuracy, the model's lightweight was effectively achieved: The floating-point operations, number of parameters, and model size were reduced by 3.3%, 12.8%, and 13.0%, respectively, compared with the original. The modifications enhanced the detection and computational efficiency suitable for resource-constrained deployment scenarios. To assess practical applicability, the model was deployed on an Android mobile platform. The high grading accuracy was achieved with an average inference time of 0.98 s per image on mobile devices, according to high-resolution images. Overall, the PDi-YOLOv11n model can be expected to balance between high accuracy, computational efficiency, and deployment feasibility in real-time or near-real-time field applications. The length grading, targeted architecture, and lightweighting can provide a reliable and scalable solution for postharvest fresh daylily processing.