首页 | 官方网站   微博 | 高级检索  
     

基于改进YOLOv7的果园行间导航线检测
引用本文:彭书博,陈兵旗,李景彬,范鹏宣,刘翔业,房鑫,邓红涛,张雄楚.基于改进YOLOv7的果园行间导航线检测[J].农业工程学报,2023,39(16):131-138.
作者姓名:彭书博  陈兵旗  李景彬  范鹏宣  刘翔业  房鑫  邓红涛  张雄楚
作者单位:中国农业大学工学院,北京 100083;石河子大学机械电气工程学院,石河子 832003
基金项目:国家重点研发计划项目(2016YFD0701504)
摘    要:在复杂果园环境中,传统机器视觉算法难以处理光影变化、遮挡、杂草等因素的干扰,导致导航道路分割不准确。针对此问题,该研究提出了一种改进YOLOv7的果园内导航线检测方法。将注意力机制模块(convolutional block attention module,CBAM)引入到原始YOLOv7模型的检测头网络中,增强果树目标特征,削弱背景干扰;在ELAN-H(efficient layer aggregation networks-head,ELAN-H)模块和Repconv(re-parameterization convolution,Repconv)模块之间引入SPD-Conv(space-to-depth,non-strided convolution,SPD-Conv)模块,提高模型对低分辨率图像或小尺寸目标的检测能力。以树干根部中点作为导航定位基点,利用改进YOLOv7模型得到两侧果树行线的定位参照点,然后利用最小二乘法拟合两侧果树行线和导航线。试验结果表明,改进YOLOv7模型检测精度为95.21%,检测速度为42.07帧/s,相比于原始YOLOv7模型分别提升了2.31个百分点和4.85帧/s,能够较为准确地识别出树干,且对树干较密的枣园图像也能达到较好的检测效果;提取到的定位参照点与人工标记树干中点的平均误差为8.85 cm,拟合导航线与人工观测导航线的平均偏差为4.90 cm,处理1帧图像平均耗时为0.044 s,能够满足果园内导航需求。

关 键 词:图像处理  YOLOv7  目标检测  行间导航线  注意力机制  果园
收稿时间:2023/5/26 0:00:00
修稿时间:2023/7/18 0:00:00

Detection of the navigation line between lines in orchard using improved YOLOv7
PENG Shubo,CHEN Bingqi,LI Jingbin,FAN Pengxuan,LIU Xiangye,FANG Xin,DENG Hongtao,ZHANG Xiongchu.Detection of the navigation line between lines in orchard using improved YOLOv7[J].Transactions of the Chinese Society of Agricultural Engineering,2023,39(16):131-138.
Authors:PENG Shubo  CHEN Bingqi  LI Jingbin  FAN Pengxuan  LIU Xiangye  FANG Xin  DENG Hongtao  ZHANG Xiongchu
Affiliation:College of Engineering, China Agricultural University, Beijing 100083, China;College of Mechanical and Electrical Engineering, Shihezi University, Shihezi 832003, China
Abstract:Automatic navigation has improved the efficiency of farmland operation for the high crop yield. Visual navigation can be expected to realize the automatic navigation in the farmland operation machinery, because of its low hardware cost and wide application. However, the traditional algorithm of image processing cannot fully deal with the interference of light and shadow changes, occlusion, and weeds under the complex environment in an orchard. There is a high demand for better robustness and accuracy in the navigation path. In this study, an accurate and rapid detection of navigation lines was proposed for the orchard using the improved YOLOv7 deep learning model. Firstly, the attention mechanism module (Convolutional Block Attention Module, CBAM) containing the channel and spatial attention module was added to the detection head network of the original YOLOv7 structure. This attention mechanism enabled to more accurately capture the essential features of the target for better representation and generalization of the network. The efficient extraction and enhancement of the trunk key features were realized to weaken the environmental background interference. Secondly, the SPD-Conv (space-to-depth, non-strided convolution, SPD-Conv, i.e., a convolution-free step or pooling) was introduced between the ELAN-H and Repconv modules. As such, the low-resolution images or small-size targets were also detected to reduce the missed and false detection. The data set was collected from Beijing Xingshou Agricultural Professional Cooperative in Changping District, Beijing, China. 28 videos of orchards and a total of 1588 images were obtained under different lighting conditions. The targets were labeled using Labelimg software, with a total of 11043 apple trunks. The detection accuracy of the improved YOLOv7 model was 95.21% after training on the dataset, where the detection speed was 42.07 frames/s. The improved model increased by 2.31 percentage points, and 4.85 frames/s, respectively, compared with the original. Therefore, the improved model can be expected to more accurately identify the trunks of fruit trees, suitable for the apple orchard and jujube garden with the dense tree trunks. The ablation experiments were performed on each improvement point. The model accuracy of 93.97% was achieved after the introduction of the CBAM attention mechanism module, which was 1.07 percentage points over the original. The CBAM attention mechanism and SPD-Conv modules were introduced with a precision of 95.21%, which was a 1.24 percentage point improvement than before, indicating the better effectiveness of each improvement module. The trunk root accurate extraction of midpoint coordinates was crucial for the fitting of the navigation line, particularly with the trunk root midpoint as the navigation positioning base point. The coordinates of the improved YOLOv7 training for the fruit tree trunk were set at the bottom of the rectangular frame, instead of the trunk root midpoint as the locating reference point. Finally, the locating reference points were fitted on both sides of the fruit tree line and navigation line using the least squares method. The average line error of 4.43 pixels was achieved in the error analysis of 769 locating reference points extracted from the randomly selected 100 images from the data set and the manual marking of the trunk midpoints. The internal and external parameter matrixes of the camera were calculated to convert the pixel coordinates into the camera coordinates using Matlab software. The average actual error of 8.85 cm was obtained, indicating the reasonable and effective midpoint at the bottom of the rectangular frame as the locating reference point. The average deviation of the fitting and manual observation navigation line was 2.45 pixels in the 100 images, while the actual deviation was 4.90 cm, which fully met the accuracy requirements of navigation in the orchard. Three videos were randomly selected for the speed detection analysis of navigation lines. The total average time of processing one frame image was 0.044 s, which fully met the speed needs of navigation in the orchard.
Keywords:image processing  YOLOv7  target detection  interrow navigation line  attention mechanism  orchard
点击此处可从《农业工程学报》浏览原始摘要信息
点击此处可从《农业工程学报》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号