高级检索+

基于改进YOLOv11n的鲜黄花菜品质分级检测算法

Quality grading detection algorithm for fresh daylily based on improved YOLOv11n

  • 摘要: 鲜黄花菜作为特色农产品,采后品质分级检测是其商品化处理和精深加工的关键环节。针对当前人工分拣效率低、主观性强及模型计算复杂度高、识别精度不足等问题,该研究建立以花蕾长度为核心的三级分级体系,通过空间标定与几何修正构建像素阈值转换模型,将物理长度映射为图像像素阈值,实现图像的分级标注,在此基础上,提出一种基于改进YOLOv11n鲜黄花菜品质分级检测模型PDi-YOLOv11n。首先,将骨干网络中传统的C3k2模块替换为融合了跨阶段部分连接特征金字塔压缩模块(cross-stage partial pyramid compression, CSPPC)的C3k2_CSPPC模块,增强模型在密集、复杂排列场景下的识别精度并降低计算冗余。其次,为改善鲜黄花菜漏检,定位不准的问题,引入动态上采样模块(dynamic upsampling, DySample)通过内容自适应机制,提升模型对鲜黄花菜的定位精度。最后,在颈部网络中引入融合倒置残差结构(inverted residual mobile block, iRMB)与高效多尺度注意力机制(efficient multi-scale attention, EMA)的iEMA机制,强化对鲜黄花菜的关键特征提取并抑制背景干扰,提高模型检测效率。试验结果表明,与原模型YOLOv11n相比,PDi-YOLOv11n在自建鲜黄花菜数据集上,对于特级、一级和二级鲜黄花菜平均检测精度分别提高了2.6、5.3、2.6个百分点,总体的准确率、召回率和平均精度均值分别提高了4.3、2.4和2.6个百分点,对模型进行轻量化处理后,浮点运算量、参数量和模型大小分别缩减了3.3%、12.8%、13.0%。实用性方面,模型部署在基于Android的移动检测系统中,在保持较高分级检测精度的同时,移动端对高分辨率鲜黄花菜图像平均检测耗时为0.98 s。该模型在精度与效率方面具备良好平衡性,可为鲜黄花菜自动化分级提供技术支撑。

     

    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.

     

/

返回文章
返回