Abstract:In order to realize the rapid and accurate recognition of greenhouse tomato fruit by agricultural picking robot in the complicated environment of greenhouse, a fast target detection method for greenhouse tomato fruit based on attention mechanism and improved YOLO v5s was proposed. According to the characteristics of small size and fast speed of YOLO v5s(You only look once v5s) model, the convolutional block attention module (CBAM) was added into the backbone network. By concatenating spatial attention module and channel attention module, the problem of color similarity between green tomato fruit and its background was solved. More attention was paid to the target features of green tomato fruit to improve the recognition accuracy. Replacing GIoU Loss with CIoU Loss as the new loss function of the algorithm contributed to improve the positioning accuracy while improving the bounding box regression rate. The test results showed that the recognition accuracy of the CB-YOLO network model for red tomato fruit detecting precision and green tomato fruit detecting precision and mean average precision in greenhouse environment was 99.88%, 98.18% and 99.53%, respectively. Compared with Faster R-CNN network model, YOLO v4-tiny network model and YOLO v5 network model, the detection accuracy and the mean average precision were improved. The CB-YOLO model was deployed to Android system of mobile phones after being tested by different mobile phones, which verified the stability of the performance detection of the deployment model under actual working condition. It will provide technical support for target detection and harvesting based on robotic mobile edge computing in facility environments.