Rapid detection of Yunnan Xiaomila based on lightweight YOLOv7 algorithm - Wang, Fenghua; Jiang, Jin; Chen, Yu; Sun, Zhexing; Tang, Yuan; Lai, Qinghui; Zhu, Hailong (Frontiers in Plant Science, 2023)
Real-time fruit detection is a prerequisite for using the xiaomila harvesting robot in the harvesting process. Existing deep learning network detection algorithms are mostly ineffective in detecting densely distributed, branch-covered xiaomila fruits in natural scenes, and the model inference process involves too many computational parameters, making it difficult to run on embedded devices. To solve these problems, this paper adopts Yolov7-tiny as the transfer learning model for the field detection of xiaomila, collects images of immature and mature xiaomila fruits under different lighting conditions, and proposes an effective model called Yolo-PD for fast and accurate detection of xiaomila fruits. Firstly, the main feature extraction network is fused with deformable convolution by replacing the traditional convolution module in the Yolov7-tiny main network and the ELAN module with deformable convolution, which reduces network parameters while improving the detection accuracy of multi-scale xiaomila targets. Secondly, the SE (Squeeze-and-Excitation) attention mechanism is introduced into the reconstructed main feature extraction network to improve its ability to extract key features of xiaomila in complex environments, realizing multi-scale xiaomila fruit detection. The effectiveness of the proposed method is verified through ablation experiments under different lighting conditions and model comparison experiments. The experimental results indicate that Yolov7-PD achieves higher detection performance than other single-stage detection models. Through these improvements, Yolov7-PD achieves a mAP (mean Average Precision) of 90.3%, which is 2.2%, 3.6%, and 5.5% higher than that of the original Yolov7-tiny, Yolov5s, and Mobilenetv3 models, respectively, the model size is reduced from 12.7 MB to 12.1 MB, and the model's unit time computation is reduced from 13.1 GFlops to 10.3 GFlops. The results indicate that the proposed real-time xiaomila detection method is effective and can promote the development of intelligent and reliable harvesting robots.