高级检索+

基于YOLOv11n与图像切片推理的粘虫板害虫检测

Detecting insect pests on sticky traps based on YOLOv11n and image slice inference

  • 摘要: 为提升温室环境中粘虫板上蓟马、粉虱等小目标高密度害虫的检测精度,并满足模型轻量化的应用需求,该研究提出一种融合切片辅助超推理(slicing aided hyper inference, SAHI)与YOLOv11n-LMN模型的害虫检测方法。首先,采用轻量级CPU卷积神经网络(lightweight CPU convolutional neural network,PP-LCNet)替代原主干网络,减少模型参数量与计算开销。然后,引入多尺度相似性注意力模块(multi-scale similarity-aware module,MulSimAM),实现不同尺度信息的加权融合,增强害虫特征表征能力。其次,引入归一化Wasserstein距离(normalized wasserstein distance,NWD)优化损失函数,提高小目标的像素定位精度与模型鲁棒性。最后,采用SAHI图像切片推理技术,将高分辨率的粘虫板图像切割为与检测模型匹配的切片,从而提高识别和定位精度,避免直接下采样引起的小目标细节损失。结果表明,改进模型的精确率、召回率和平均精度均值(mean Average Precision,mAP)较原模型分别提升了4.3、4.8和3.9个百分点,模型大小缩减至4.7 MB。为进一步验证模型性能,对引入SAHI技术前后在整张粘虫板图像中的检测效果进行对比。引入SAHI技术前,YOLOv11n原模型的mAP为49.2%;经过SAHI处理并结合改进模块后,YOLOv11n-LMN+SAHI模型的平均精度均值较引入前提升了40.4个百分点;在Yellow Sticky Traps数据集上,mAP提升至 93.3%,较基线模型高出 2 个百分点。此外,将改进前后模型部署到树莓派上进行测试,结果可知,改进模型检测效果相比原模型有明显提升,单幅粘虫板图像检测时间为9.6 s,表明改进模型具有较好的应用价值。研究结果可为害虫识别及边缘移动设备监测提供技术支持。

     

    Abstract: Insect pests, such as the thrips and whiteflies, have posed a serious threat to the crop yield and quality in greenhouse environments. It is often required to timely and accurately detect insect pests. Among them, yellow sticky traps have been widely used to monitor pest populations. However, manual inspection cannot achieve the high accuracy to prevent crop damage, due to the small size and dense distribution of these pests. In this study, an improved pest detection was proposed using the YOLOv11n-LMN model with the slicing aided hyper inference (SAHI) framework. The small and densely distributed pests were effectively detected to maintain the high model efficiency, particularly for the deployment on edge devices. The small-target detection accuracy was also enhanced to significantly reduce model size and computational complexity. Specifically, the original backbone network was replaced with a lightweight CPU-oriented convolutional neural network, PP-LCNet. Depthwise separable convolutions and the H-Swish activation function were employed to integrate the squeeze-and-excitation (SE) attention mechanism. Feature representation was further improved to reduce the parameters. In addition, a multi-scale similarity-aware module (MulSimAM) was introduced to extract the multi-scale features. Attention weights were adaptively allocated on the different scales. Fine-grained features of small targets were captured to exploit the cross-scale feature correlations, thereby improving the detection accuracy and robustness. Furthermore, the normalized wasserstein distance (NWD) loss function was incorporated to improve localization accuracy for small objects. Modeling bounding boxes was selected over the Gaussian distributions, rather than the conventional IoU-based metrics, such as the complete IoU (CIoU), in dense scenarios. The large images were divided into overlapping slices using the SAHI strategy. The local details were also preserved for accurate and rapid computation in the high-resolution sticky trap images. The slice-level detection was merged and then refined using non-maximum suppression (NMS), resulting in a substantial improvement in the small-object detection. Experimental results demonstrate that the YOLOv11n-LMN model significantly outperformed the baseline YOLOv11 in terms of precision, recall, and mean average precision (mAP). The detection accuracy was improved by 3.1 and 4.9 percentage points, respectively, for the thrips and whiteflies, while the model size was reduced by 4.7 MB. The YOLOv11n-LMN+SAHI model achieved a mAP by 40.4 percentage points on the full armyworm sticky trap images. The original YOLOv11n model was obtained in a mAP of 49.2%. On the yellow sticky traps (YST) dataset, a mAP@50 of 93.9% was 2 percentage points higher than the baseline model after evaluation. Finally, both the baseline and improved models were deployed on a Raspberry Pi platform. The high performance was achieved in an average inference time of 9.6 s per sticky trap image, indicating the strong practical application. These findings can provide an efficient and deployable solution for intelligent pest monitoring in greenhouse agriculture. The valuable technical support can also offer precision farming applications.

     

/

返回文章
返回