高级检索+

基于YOLO-LECNet的机采籽棉含杂率检测

Impurity rate detection of machine-harvested seed cotton based on YOLO-LECNet

  • 摘要: 机采籽棉在采收与加工过程中易混入棉壳、棉枝、碎叶等非纤维杂质,其形态复杂、尺度不一、边缘模糊,严重影响杂质率检测精度与后续收购品质评估。为提高复杂背景下机采籽棉杂质实例分割的检测精度与模型部署效率,该研究基于YOLOv8s-seg框架提出了一种轻量高效的籽棉杂质实例分割模型YOLO-LECNet。该模型在特征提取、跨层交互和边界优化三方面进行系统改进:采用高效跨阶段部分连接双卷积(efficient cross-stage partial-connection with 2 convolutions, EC2f)结构在C2f模块中采用Ghost双分支结构替代原有冗余卷积,以降低模型计算复杂度;其次,引入局部上下文注意力模块(local-context attention,LCA)模块,增强局部细节特征与上下文语义信息的交互能力,提高碎叶等小尺度杂质的边界感知能力;最后,采用通道增强型交并比损失函数(channel-enhanced intersection over union,CEIoU)损失函数,强化不规则形变杂质目标的边界框回归精度。结果表明,与基线模型YOLOv8s-seg相比,YOLO-LECNet在自建机采籽棉杂质实例分割数据集上的精确率、召回率、Box mAP@0.5和Mask mAP@0.5:0.95分别提高了6.7、5.9、6.6和8.0个百分点。对模型进行轻量化改进后,参数量和浮点运算量分别降低5.0 M和11.9 G,推理速度达到148.9帧/s。含杂率检测方面,当采用多视角输入时,平均绝对误差和均方根误差分别约为1.02%和1.20%。实用性方面,模型部署在基于RK3588的边缘计算平台上,在提高边缘端杂质分割精度的同时,模型大小降低8 MB,单张图像平均推理时间降低17.9 ms。该研究所提出YOLO-LECNet在杂质边界识别、微小目标分割及模型轻量化之间取得良好平衡,为籽棉杂质检测与含杂率评估提供了一种高效、可部署的工程化解决方案。

     

    Abstract: Non-fiber impurities, such as cotton shells, cotton branches, and broken leaves, can easily be mixed into machine-harvested seed cotton during harvesting and processing. These impurities can seriously threaten the detection accuracy of the impurity rate and subsequent quality evaluation during seed cotton procurement, due to their complex morphologies, different sizes, and blurred boundaries. This study aims to improve the accuracy of instance segmentation and deployment for seed cotton impurities under complex backgrounds. A lightweight and efficient instance segmentation was also proposed, named YOLO-LECNet, using the YOLOv8s-seg framework. A series of improvements was used to systematically enhance feature extraction, cross-layer feature interaction, and boundary optimization. 1) An Efficient C2f (EC2f) structure with a Ghost dual-branch design was adopted to replace redundant convolutions, thereby reducing computational complexity and feature redundancy while maintaining effective feature representation.. Feature redundancy was reduced to maintain the representation of impurity texture and semantic information. 2) A Local-Context Attention (LCA) module was introduced to enhance the interaction between local features and contextual semantic information. Responses to the impurity feature were strengthened to suppress background interference from cotton fiber. Boundary perception was improved for small-scale impurities, especially broken leaves with weak texture and low contrast. 3) A Channel-Enhanced IoU (CEIoU) loss function was used to improve the accuracy of bounding box regression for irregular and deformed impurity targets, thereby enhancing the fitting of predicted regions to complex impurity boundaries. The impurity area was extracted from images after instance segmentation to further combine with physical factors, such as compressed sample thickness and seed cotton bulk density. A prediction model of impurity rate was established to realize quantitative estimation from visual segmentation to impurity mass and rate. The experimental results showed that YOLO-LECNet achieved better accuracy and lightweight performance compared with the baseline YOLOv8s-seg model. The precision, recall, Box mAP@0.5, and Mask mAP@0.5:0.95 were improved by 6.7, 5.9, 6.6, and 8.0 percentage points, respectively, particularly with 6.7 M parameters and an inference speed of 148.9 FPS. Ablation experiments verified the contribution rates of each module to performance. The LCA, EC2f, and CEIoU were combined for the best overall performance, indicating the high feature response, lightweight feature extraction, and boundary regression optimization. As such, YOLO-LECNet shared the stronger performance on small-impurity segmentation, weak-boundary recognition, and irregular-target localization, with lower model complexity, compared with other mainstream instance segmentation models. The visualization also showed that the missing detections, boundary discontinuities, and background mis-segmentation were reduced under complex backgrounds of cotton fiber. More complete masks were produced for broken leaves, cotton shells, and slender cotton branches. In impurity rate estimation, the multi-view image fusion effectively reduced the uncertainty caused by occlusion and uneven impurity distribution in a single view. Once four-view images were used for joint prediction, the prediction error tended to be stable. The impurity rate showed better consistency with the measured values. The coefficient of determination reached 0.822, while the mean absolute error and root mean square error were 1.02% and 1.20%, respectively. The real impurity level of seed cotton samples was represented accurately after measurement. In addition, the edge deployment experiment showed that YOLO-LECNet was converted and then deployed on the RK3588 platform. Compared with YOLOv8s-seg, the deployed YOLO-LECNet model reduced the model size by 8 MB and the average inference time by 17.9 ms, with a model size of 17 MB and an average inference time of 144.4 ms per image. There was great potential for edge-side application in practice. Overall, YOLO-LECNet can be expected to better balance impurity boundary recognition, small-target segmentation, and a lightweight model. The findings can provide an efficient and deployable engineering solution for seed cotton impurity detection and impurity rate evaluation.

     

/

返回文章
返回