Using lightweight deep learning algorithm for real-time detection of apple flowers in natural environments - Shang, Yuying; Xu, Xingshi; Jiao, Yitao; Wang, Zheng; Hua, Zhixin; Song, Huaibo (Computers and electronics in agriculture, 2023)
•Apple flowers detection based on lightweight YOLOv5s was proposed.•YOLOv5s was used as the basic framework to detect apple flowers.•ShuffleNetv2 and Ghost Module were introduced to realize the lightweight of the model.•This method is helpful for the visual system of the flower thinning machinery. Flower thinning at the most appropriate stage could achieve high and stable yield of apple. Achieving the accurate and real-time detection of apple flowers can provide necessary technical support for the vision system of thinning robots. An apple flower detection method based on lightweight YOLOv5s algorithm was proposed. The original Backbone of YOLOv5s was replaced by ShuffleNetv2, and the Conv module of the Neck part of YOLOv5s network was replaced by Ghost module. ShuffleNetv2 reduced the memory access cost through Channel Split operation. Ghost module reduced the computing cost of the general volume layer while maintaining the similar detection performance. The combination of these two methods in the improvement of YOLOv5s network can greatly reduce the size of the model and improve the detection speed, which was convenient for the migration and application of the model. To verify the effectiveness of the model, 3005 apple flower images in different environments were used for training and testing. The Precision, Recall, and mean Average Precision (mAP) of YOLOv5s-ShuffleNetv2-Ghost model were 88.40 %, 86.10 %, and 91.80 %, respectively, the model size was only 0.61 MB, and the detection speed was 86.21 fps. The detection speed of YOLOv5s-ShuffleNetv2-Ghost model on the Jetson nano B01 development board was 2.48 fps. The results showed that the method was feasible for real-time and accurate detection of apple flowers. The research can provide technical reference for the development of orchard flower thinning robots.