高级检索+

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

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

  • 摘要: 机采籽棉在采收与加工过程中易混入棉壳、棉枝、碎叶等非纤维杂质,其形态复杂、尺度不一、边缘模糊,严重影响杂质率检测精度与后续收购品质评估。为提高复杂背景下机采籽棉杂质实例分割的检测精度与模型部署效率,该研究基于YOLOv8s-seg框架提出了一种轻量高效的籽棉杂质实例分割模型YOLO-LECNet。该模型在特征提取、跨层交互和边界优化三方面进行系统改进:采用EC2f(efficient cross-stage partial-connection with 2 convolutions, EC2f)结构在C2f模块中采用Ghost双分支结构替代原有冗余卷积,以降低模型计算复杂度;其次,引入LCA(local-context attention,LCA)模块,增强局部细节特征与上下文语义信息的交互能力,提高碎叶等小尺度杂质的边界感知能力;最后,采用CEIoU(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, are easily mixed into machine-harvested seed cotton during harvesting and processing. These impurities have complex morphologies, varying scales and blurred boundaries, which seriously affect impurity rate detection accuracy and subsequent quality evaluation during seed cotton procurement. To improve the instance segmentation accuracy and model deployment efficiency of seed cotton impurities under complex backgrounds, this study proposed a lightweight and efficient instance segmentation model named YOLO-LECNet based on the YOLOv8s-seg framework. The model was systematically improved in terms of feature extraction, cross-layer feature interaction and boundary optimization.First, an Efficient C2f (EC2f) structure was adopted to replace redundant convolutions with a Ghost dual-branch design, reducing the number of parameters by approximately 43.0% and the floating point operations (FLOPs) by 36.3%. This design reduced feature redundancy while maintaining the representation ability of impurity texture and semantic information. Second, a Local-Context Attention (LCA) module was introduced to enhance the interaction between local detail features and contextual semantic information. By strengthening impurity-related feature responses and suppressing cotton fiber background interference, the model improved the boundary perception ability for small-scale impurities, especially broken leaves with weak texture and low contrast. Third, a Channel-Enhanced IoU (CEIoU) loss function was used to improve the bounding box regression accuracy of irregular and deformed impurity targets, thereby enhancing the fitting ability of predicted regions to complex impurity boundaries.Based on the instance segmentation results, the impurity area information extracted from images was further combined with physical factors such as compressed sample thickness and seed cotton bulk density to establish an impurity rate prediction model, realizing quantitative estimation from visual segmentation results to impurity mass and impurity rate. The experimental results showed that YOLO-LECNet achieved better accuracy and lightweight performance than the baseline model. With 6.7 M parameters and an inference speed of 148.9 FPS, 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, compared with the baseline YOLOv8s-seg model.Ablation experiments further verified the contribution of each module to model performance. The combination of LCA, EC2f and CEIoU enabled YOLO-LECNet to achieve the best overall performance, indicating that feature response enhancement, lightweight feature extraction and boundary regression optimization had good synergistic effects. Compared with other mainstream instance segmentation models, YOLO-LECNet showed stronger ability in small-impurity segmentation, weak-boundary recognition and irregular-target localization while maintaining lower model complexity. The visualization results also showed that the proposed model reduced missed detections, boundary discontinuities and background mis-segmentation under complex cotton fiber backgrounds, and produced more complete masks for broken leaves, cotton shells and slender cotton branches.For impurity rate estimation, the multi-view image fusion strategy effectively reduced the uncertainty caused by occlusion and uneven impurity distribution in a single view. When four-view images were used for joint prediction, the prediction error tended to be stable, and the predicted impurity rate showed good consistency with the measured value. The coefficient of determination reached 0.822, while the mean absolute error and root mean square error were approximately 1.02% and 1.20%, respectively, indicating that the model could accurately reflect the real impurity level of seed cotton samples.In addition, the edge deployment experiment showed that YOLO-LECNet could be converted and 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, achieving a model size of 17 MB and an average inference time of 144.4 ms per image. These results demonstrate its potential for practical edge-side application. Overall, YOLO-LECNet achieved a good balance among impurity boundary recognition, small-target segmentation and model lightweight design. The proposed method provides an efficient and deployable engineering solution for seed cotton impurity detection and impurity rate evaluation.

     

/

返回文章
返回