欢迎您访问《智慧农业(中英文)》官方网站! English

Smart Agriculture ›› 2024, Vol. 6 ›› Issue (2): 107-117.doi: 10.12133/j.smartag.SA202401008

• 专刊--农业信息感知与模型 • 上一篇    下一篇

基于改进YOLOv8s的大田甘蓝移栽状态检测算法

吴小燕1,2, 郭威2,3,4,5, 朱轶萍2, 朱华吉2,3,4,5, 吴华瑞2,3,4,5()   

  1. 1. 广西大学 计算机与电子信息学院,广西 南宁 530000,中国
    2. 国家农业信息化工程技术研究中心,北京 100097,中国
    3. 北京市农林科学院 信息技术研究中心,北京 100097,中国
    4. 农业农村部数字乡村技术重点实验室,北京 100097,中国
    5. 农业农村部农业信息技术重点实验室,北京 100097,中国
  • 收稿日期:2024-01-11 出版日期:2024-03-30
  • 基金资助:
    国家重点研发计划(2022YFD1600605); 国家现代农业产业技术体系项目(CARS-23-D07); 中央引导地方科技发展资金项目(2023ZY1-CGZY-01)
  • 作者简介:

    吴小燕,研究方向为深度学习、计算机视觉。E-mail:

  • 通信作者:
    吴华瑞,博士,研究员,研究方向为农业智能系统、农业大数据智能服务等。E-mail:

Transplant Status Detection Algorithm of Cabbage in the Field Based on Improved YOLOv8s

WU Xiaoyan1,2, GUO Wei2,3,4,5, ZHU Yiping2, ZHU Huaji2,3,4,5, WU Huarui2,3,4,5()   

  1. 1. School of Computer and Electronic Information, Guangxi University, Nanning 530000, China
    2. National Engineering Research Center for Information Technology in Agriculture, Beijing 100097, China
    3. Information Technology Research Center, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
    4. Key Laboratory of Digital Rural Technology, Ministry of Agriculture and Rural Affairs, Beijing 100097, China
    5. Key Laboratory of Agri-informatics, Ministry of Agriculture and Rural Affairs, Beijing 100097, China
  • Received:2024-01-11 Online:2024-03-30
  • corresponding author:
    WU Huarui, E-mail:
  • About author:

    WU Xiaoyan, E-mail:

  • Supported by:
    National Key Research and Development Program of China(2022YFD1600605); National Modern Agricultural Industry Technology System Project(CARS-23-D07); Central Government Guide Local Science and Technology Development Fund Project(2023ZY1-CGZY-01)

摘要:

[目的/意义] 借助智能化识别及图像处理等技术来实现对移栽后蔬菜状态的识别和分析,将会极大提高识别效率。为了实现甘蓝大田移栽情况的实时监测和统计,提高甘蓝移栽后的成活率以及制定后续工作方案,减少人力和物力的浪费,研究一种自然环境下高效识别甘蓝移栽状态的算法。 [方法] 采集移栽后的甘蓝图像,利用数据增强方式对数据进行处理,输入YOLOv8s(You Only Look Once Version 8s)算法中进行识别,通过结合可变形卷积,提高算法特征提取和目标定位能力,捕获更多有用的目标信息,提高对目标的识别效果;通过嵌入多尺度注意力机制,降低背景因素干扰,增加算法对目标区域的关注,提高模型对不同尺寸的甘蓝的检测能力,降低漏检率;通过引入Focal-EIoU Loss(Focal Extended Intersection over Union Loss),优化算法定位精度,提高算法的收敛速度和定位精度。 [结果和讨论] 提出的算法经过测试,对甘蓝移栽状态的召回率R值和平均精度均值(Mean Average Precision,mAP)分别达到92.2%和96.2%,传输速率为146帧/s,可满足实际甘蓝移栽工作对移栽状态识别精度和速度的要求。 [结论] 提出的甘蓝移栽状态检测方法能够实现对甘蓝移栽状态识别的准确识别,可以提升移栽质量测量效率,减少时间和人力投入,提高大田移栽质量调查的自动化程度。

关键词: 甘蓝移栽, YOLOv8s, 目标检测, 多尺度注意力机制, 可变形卷积

Abstract:

[Objective] Currently, the lack of computerized systems to monitor the quality of cabbage transplants is a notable shortcoming in the agricultural industry, where transplanting operations play a crucial role in determining the overall yield and quality of the crop. To address this problem, a lightweight and efficient algorithm was developed to monitor the status of cabbage transplants in a natural environment. [Methods] First, the cabbage image dataset was established, the cabbage images in the natural environment were collected, the collected image data were filtered and the transplanting status of the cabbage was set as normal seedling (upright and intact seedling), buried seedling (whose stems and leaves were buried by the soil) and exposed seedling (whose roots were exposed), and the dataset was manually categorized and labelled using a graphical image annotation tool (LabelImg) so that corresponding XML files could be generated. And the dataset was pre-processed with data enhancement methods such as flipping, cropping, blurring and random brightness mode to eliminate the scale and position differences between the cabbages in the test and training sets and to improve the imbalance of the data. Then, a cabbage transplantation state detection model based on YOLOv8s (You Only Look Once Version 8s) was designed. To address the problem that light and soil have a large influence on the identification of the transplantation state of cabbage in the natural environment, a multi-scale attention mechanism was embedded to increase the number of features in the model, and a multi-scale attention mechanism was embedded to increase the number of features in the model. Embedding the multi-scale attention mechanism to increase the algorithm's attention to the target region and improve the network's attention to target features at different scales, so as to improve the model's detection efficiency and target recognition accuracy, and reduce the leakage rate; by combining with deformable convolution, more useful target information was captured to improve the model's target recognition and convergence effect, and the model complexity increased by C3-layer convolution was reduced, which further reduced the model complexity. Due to the unsatisfactory localization effect of the algorithm, the focal extended intersection over union loss (Focal-EIoU Loss) was introduced to solve the problem of violent oscillation of the loss value caused by low-quality samples, and the influence weight of high-quality samples on the loss value was increased while the influence of low-quality samples was suppressed, so as to improve the convergence speed and localization accuracy of the algorithm. [Results and Discussions] Eventually, the algorithm was put through a stringent testing phase, yielding a remarkable recognition accuracy of 96.2% for the task of cabbage transplantation state. This was an improvement of 2.8% over the widely used YOLOv8s. Moreover, when benchmarked against other prominent target detection models, the algorithm emerged as a clear winner. It showcased a notable enhancement of 3% and 8.9% in detection performance compared to YOLOv3-tiny. Simultaneously, it also managed to achieve a 3.7% increase in the recall rate, a metric that measured the efficiency of the algorithm in identifying actual targets among false positives. On a comparative note, the algorithm outperformed YOLOv5 in terms of recall rate by 1.1%, 2% and 1.5%, respectively. When pitted against the robust faster region-based convolutional neural network (Faster R-CNN), the algorithm demonstrated a significant boost in recall rate by 20.8% and 11.4%, resulting in an overall improvement of 13%. A similar trend was observed when the algorithm was compared to the single shot multibox detector (SSD) model, with a notable 9.4% and 6.1% improvement in recall rate. The final experimental results show that when the enhanced model was compared with YOLOv7-tiny, the recognition accuracy was increased by 3%, and the recall rate was increased by 3.5%. These impressive results validated the superiority of the algorithm in terms of accuracy and localization ability within the target area. The algorithm effectively eliminates interferenced factors such as soil and background impurities, thereby enhancing its performance and making it an ideal choice for tasks such as cabbage transplantation state recognition. [Conclusions] The experimental results show that the proposed cabbage transplantation state detection method can meet the accuracy and real-time requirements for the identification of cabbage transplantation state, and the detection accuracy and localization accuracy of the improved model perform better when the target is smaller and there are weeds and other interferences in the background. Therefore, the method proposed in this study can improve the efficiency of cabbage transplantation quality measurement, reduce the time and labor, and improve the automation of field transplantation quality survey.

Key words: transplantation of cabbage, YOLOv8s, target detection, multi-scale attention, deformable convolution