基于YOLO-SSAR的自然环境下红花检测算法

    Safflower detection algorithm in natural environment based on YOLO-SSAR

    • 摘要: 针对自然环境中红花智能采摘存在红花尺度变化大、遮挡情况复杂的问题,该研究对YOLOv5模型进行优化,提出了一种基于多尺度特征提取的YOLO-SSAR目标检测算法。首先,采用ShuffleNet v2轻量化结构对Backbone层主干特征提取网络进行替换,减少模型参数量和计算量;其次,在Neck层添加基于空洞卷积和共享权重的Scale-Aware RFE模块,提高模型对于多尺度特征信息的提取能力;最后,为解决目标检测中类内、类间遮挡问题,在Head层引入排斥损失函数对原损失函数进行替换,减少因非极大值抑制(non-maximum suppression,NMS)阈值选取不当造成的漏检或误检,提高模型的检测精度。试验结果表明,YOLO-SSAR算法在测试集上的精确率、召回率和平均精度均值分别为90.1%、88.5%、93.4%,对比YOLOv5原始模型分别提升了5.9、9.2和7.7 个百分点,推理速度为115 帧/s,模型大小为9.7 MB,与主流算法YOLOv4、YOLOv7、YOLOV8s、Faster R-CNN、SSD相比,精确率分别高出6.8、7.2、6.3、16.2和10.8个百分点、召回率高出9.4、10.3、9.5、17.3和59.4个百分点,平均精度均值较对比算法分别高出8.8、8.2、8.1、14.9和19.4个百分点。研究表明,YOLO-SSAR算法在提升综合检测性能的同时也降低了计算复杂度,研究结果可以为红花智能采摘研究提供算法参考。

       

      Abstract: Safflower has attracted much attention in the field of intelligent harvesting due to their economic value and difficulty in harvesting. Safflower grown in natural environments often exists large scale variations and complex occlusion situations, which poses higher requirements for object detection algorithms. However, traditional object detection models often encounters missed or false detections when dealing with these issues, seriously affecting picking efficiency and accuracy. In this study, a YOLO-SSAR object detection algorithm based on multi-scale feature extraction was proposed by optimizing the original YOLOv5 model. The effectiveness and rationality of the improved algorithm were verified through ablation experiments, model comparison experiments, and detection effect analysis. Firstly, the ShuffleNet v2 lightweight structure was used to replace the backbone feature extraction network of the backbone layer to reduce the number of model parameters and calculations, and utilized efficient channel mixing and depthwise separable convolution to improve the efficiency of input feature extraction. Secondly, a Scale-Aware RFE module based on dilated convolution and shared weights was added to the Neck layer to improve the model's ability, which extracted multi-scale feature information. This module shared the weights of the main branch with other branches, lowering the number of model parameters while reducing the risk of overfitting by fusing residual connections, allowing objects of different scales to be uniformly transformed with the same representation ability. Finally, in order to solve the problem of intra-class and inter-class occlusion in object detection, the repulsion loss function was introduced into the head layer to replace the original loss function, so as to reduce the missed detection or false detection caused by improper selection of non-maximum suppression (NMS) threshold, and improved the detection rate of target overlap occlusion in dense scenes. The experimental results showed that the precision, recall,and mean average precision of the YOLO-SSAR algorithm on the test set were 90.1%, 88.5%, and 93.4%, respectively. Compared with the original YOLOv5 model, the YOLO-SSAR algorithm were improved by 5.9, 9.2, and 7.7 percentage points, respectively, the inference speed reached 115 frames per second, and the model size was 9.7 MB, which emerged efficiency and lightweight advantages in practical applications. Compared with the mainstream algorithms YOLOv4, YOLOv7, YOLOV8s, Faster R-CNN and SSD, the detection accuracy of YOLO-SSAR algorithm was in a leading position, compared to the two-stage object detection algorithm of Faster R-CNN and the multi-scale object detection algorithm of SSD, which increased by 5.5 times and 3.6 times respectively. Meanwhile, the model size was only 4% of Faster R-CNN and 10% of SSD. The minimum model parameter quantity had good prospects in mobile devices with limited computing resources. The precision was 6.8, 7.2, 6.3, 16.2, and 10.8 percentage points higher, the recall was 9.4, 10.3, 9.5, 17.3, and 59.4 percentage points higher, and the mean average precision was 8.8, 8.2, 8.1, 14.9 and 19.4 percentage points higher than the comparison algorithm, respectively. Research suggested that the YOLO-SSAR algorithm could improve comprehensive detection performance while reducing computational complexity. The findings can provide algorithm references for the study of intelligent harvesting of safflower.

       

    /

    返回文章
    返回