Abstract:The cane replanting machine is a replanting device developed to solve the problem of lack of seedlings in the sugarcane field, and it is very important for the field operation of the replanting machine to accurately identify and locate the cane seedlings. In order to solve the problem that it is difficult to accurately detect and locate cane seedlings in sugarseed field, a method for detecting and locating cane seedlings with binocular camera combined with improved YOLO v5 object detection algorithm was proposed. For object detection, an improved YOLO v5s network model was proposed YOLO v5s_P234_ SGG. Firstly, the pictures of cane seedlings were taken under different lighting and near and far conditions, and the data was preprocessed and annotated to construct the dataset of cane seedlings, and then the large target detection layer of the original YOLO v5s network model was eliminated, and a small object detection layer was added to make the model better adapt to the recognition needs of small targets such as cane seedlings. Secondly, the SimAM attention mechanism was introduced into the backbone network to enhance the model’s attention to the key feature information of the cane seedlings, and SlimNeck was introduced instead of the Neck network, which reduced the complexity of the model while maintaining sufficient accuracy and replacing the ordinary convolution module in the backbone network with the Ghost module, which significantly reduced the size of the model. Experimental results showed that the accuracy of the proposed method on the root cane seedling dataset reached 95.8%, the recall rate reached 95.2%, and the average accuracy reached 97.1%, compared with the original YOLO v5s network, the accuracy was increased by 3.1 percentage points, the recall rate was increased by 2.6 percentage points, the average accuracy was increased by 3.1 percentage points, the model volume was decreased by 7.7MB, the number of parameters were decreased by 4062632, the FLOPs was decreased by 7.8×109, and the detection time of a single image was decreased by 3.7ms. The results of the cane seedling positioning test showed that the average relative error of the binocular ranging and positioning algorithm was 0.97%, and the maximum relative error was 4.60%. The accurate identification and ranging of sugarcane seedlings were successfully realized, which provided important real-time information and decision-making support for subsequent agricultural intelligent operations.