Welcome to Smart Agriculture 中文

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

• Special Issue--Agricultural Information Perception and Models • Previous Articles     Next Articles

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
  • Foundation items:
    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)
  • About author:

    WU Xiaoyan, E-mail:

  • corresponding author:
    WU Huarui, E-mail:

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