摘要
为提高水稻病虫害检测精度,解决病虫害种类繁多、尺度不一、生长环境复杂导致的误检漏检问题,便于模型在边缘设备进行部署,提出一种基于改进YOLOv8的水稻病虫害检测方法 PBM-YOLOv8。首先使用部分卷积(partial convolution,PConv)设计PCBlock结构,替换YOLOv8特征提取模块中的瓶颈(bottleneck)结构,以减少模型参数量,提升检测速度;其次为了减少非相邻层语义信息特征融合时的稀释,在颈部网络增加平衡特征融合层,重构特征金字塔(feature pyramid networks,FPN)为平衡特征金字塔(balanced feature pyramid,BFP),对融合的特征层进行特征再提取,并引入嵌入高斯非局部注意力(embedded Gaussian non-local attention,EGNA)消除多层融合导致的混叠效应,最大程度减小特征丢失;最后将损失函数更换为MPDIOU,改善因样本差异性大而导致的检测框失真,同时降低模型训练的计算负担。试验结果表明,改进模型PBM-YOLOv8在水稻病虫害数据集上取得了更为优异的试验效果,相较于原始YOLOv8n基线模型精确度及平均准确率均值分别提高了1.3和1.1个百分点。将PBM-YOLOv8部署在RK3588上经多线程优化后检测速度可达到71.4帧/s,满足实际应用的需求,可实现对水稻病虫害的实时精准检测。
Rice diseases and pests have posed a serious threat to agricultural production in recent years.Particularly,false and missed detections have been caused by the diversity,scale,and complex growth environments of these pests.This study aims to enhance the detection accuracy of rice diseases and pests,in order to facilitate the deployment of detection models on edge devices.An improved YOLOv8-based model was developed to detect rice diseases and pests.Several innovations were also incorporated to optimize the performance of the model.Firstly,partial convolution(PConv)was introduced to design the PCBlock structure and then integrated into the feature extraction module of YOLOv8.As such,the module of lightweight feature extraction known as C2f-PCBlock significantly reduced the number of model parameters,thereby enhancing the detection speed without compromising accuracy.The complexity of the model was then reduced to deploy on the resourceconstrained edge devices.Secondly,the semantic information was diluted to cause the feature fusion across non-adjacent layers.A balanced Feature fusion layer was then added to the neck network.feature pyramid networks(FPN)was restructured into balanced feature pyramid(BFP).The preservation of critical features was improved during fusion.Additionally,the embedded Gaussian non-local attention(EGNA)mechanism was incorporated to mitigate the aliasing behavior from the multilayer feature fusion.The important features were retained to reduce the loss of information,leading to more accurate detections.The loss function of the model was also enhanced to replace the standard IoU-based loss with MPDIoU.The distortions were avoided in the detection bounding boxes,due to the significant variations in sample sizes.MPDIoU was used to reduce these distortions for less computational burden,indicating more efficient training.Extensive experiments were conducted on a rice pest and disease dataset.The results demonstrate that the improved model,named PBM-YOLOv8,outperformed the rest.Specifically,PBM-YOLOv8 was achieved in the precision rate of 6.1,8.0,4.2,1.3,and 1.9 percentage points higher than Fast R-CNN,SSD,YOLOv5n,YOLOv8n,and YOLOv9t,respectively.The recall rates were also significantly improved,with an increase of 7.1,8.4,5.6,2.8,and 3.2 percentage points,respectively.Furthermore,the mean average precision(mAP)values were 5.7,7.3,3.8,1.1,and 1.5 percentage points higher than those of the compared models,respectively.PBM-YOLOv8 was selected as a leading model,in terms of detection accuracy.Moreover,the PBM-YOLOv8 model was highly efficient with only 4.8M parameters,which was far less than the 41.3 M of Fast R-CNN and the 15.6 M of SSD.A high processing speed was maintained with 92.8 frames/s,in order to balance the accuracy with computational efficiency.The effectiveness of the improved model was further validated.PBM-YOLOv8 was deployed on the RK3588 embedded board.The deployment showed an accelerated detection speed of 71.4 frames per second,with an average accuracy of 95.1%.This performance can fully meet the demands of practical applications,thus enabling real-time and accurate detection of rice pests and diseases.The multi-thread optimization was adopted in the deployment.The parallel acceleration of multi-core NPU was also realized for the model inference and CPU for post-processing.The model has further enhanced the efficiency and feasibility for real-world use.
作者
刘鹏
张天翼
冉鑫
史佳霖
毕誉轩
王彩霞
LIU Peng;ZHANG Tianyi;RAN Xin;SHI Jialin;BI Yuxuan;WANG Caixia(College of Electronic Information Engineering,Changchun University of Science and Technology,Changchun 130022,China)
出处
《农业工程学报》
EI
CAS
CSCD
北大核心
2024年第20期147-156,共10页
Transactions of the Chinese Society of Agricultural Engineering
基金
吉林省科技发展计划项目(20210201021GX)。