Abstract:In order to accurately identify the different fruit targets on apple trees, and automatically distinguish the fruit occluded by different branches, providing visual guidance for the mechanical picking end-effector to actively adjust the pose of apple picking to avoid the shelter of the branches, a real-time recognition method of apple picking pattern based on improved YOLOv5m for picking robot was proposed. Firstly, BottleneckCSP module was designed and improved to BottleneckCSP-B module which was used to replace the BottleneckCSP module in backbone architecture of original YOLOv5m network. The ability of image deep feature extraction of the original BottleneckCSP module was enhanced, and the original YOLOv5m backbone network was lightweight designed and improved. Secondly, SE module was inserted to the proposed improved backbone network, to better extract the features of different apple targets. Thirdly, the bonding fusion mode of feature maps, which were input to the target detection layer of medium size in the original YOLOv5m network, were improved, and the recognition accuracy of apple was improved. Finally, the initial anchor box sizes of the original network were improved, avoiding the misrecognition of apples in farther plant row. The experimental results indicated that the graspable, circuitous-graspable (up-graspable, down-graspable, left-graspable, right-graspable) and ungraspable apples could be identified effectively by using the proposed improved model in the study. The recognition recall, precision, mAP and F1 were 85.9%, 81.0%, 80.7% and 83.4%, respectively. The average recognition time was 0.025s per image. Contrasted with original YOLOv5m, YOLOv3 and EfficientDet-D0 model, the mAP of the proposed improved YOLOv5m model was increased by 5.4 percentage points, 22 percentage points and 20.6 percentage points, respectively on test set. The size of the improved model was 89.59% of original YOLOv5m model. The proposed method can provide technical support for the picking end-effector of robot to pick apples in different poses avoiding the shelter of branches, to reduce the loss of apple picking.