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

    Detecting safflower in the natural environment using 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 often drawn much attention in the field of intelligent harvesting, due to their economic value. The safflower harvesting has also posed the higher requirements for object detection, due to the large-scale variations and complex occlusion in natural environments. Furthermore, missed or false detection has often occurred in traditional object detection, thus seriously affecting picking efficiency and accuracy. In this study, a YOLO-SSAR object detection was proposed to optimize the original YOLOv5 model using multi-scale feature extraction. The effectiveness and rationality of the improved algorithm were verified through ablation experiments, model comparison, and detection effect analysis. Firstly, the ShuffleNet v2 lightweight structure was used to replace the backbone feature extraction network of the backbone layer, in order to reduce the number of model parameters and calculations. The efficient channel mixing and depthwise separable convolution were utilized to improve the efficiency of input feature extraction. Secondly, a Scale-Aware RFE module was added to the Neck layer using dilated convolution and shared weights, in order to extract the multi-scale features. The weights of the main branch were shared with the rest branches, thus lowering the number of model parameters. The risk of overfitting was also reduced to fuse the residual connections, thereby allowing the objects of different scales to be uniformly transformed with the same representation. Finally, the repulsion loss function was introduced into the head layer to replace the original loss function, in order to avoid the intra-class and inter-class occlusion in the object detection. There was a reduction in the missed or false detection caused by improper selection of the non-maximum suppression (NMS) threshold. The detection rate of the target was improved with the 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 was 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, indicating high efficiency and lightweight in practical applications. Compared with the mainstream algorithms YOLOv4, YOLOv7, YOLOV8s, Faster R-CNN, and SSD, the detection accuracy of the YOLO-SSAR algorithm was in a leading position. Compared with the two-stage and multi-scale object detection of Faster R-CNN and SSD, the improved model 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 quantity of parameters shared the great prospects in the mobile devices with the 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 mainstream algorithm, respectively. The YOLO-SSAR algorithm improved the detection performance with less computational complexity. The findings can provide the algorithm references for the intelligent harvesting of safflower.

       

    /

    返回文章
    返回