Sugarcane field re-seeding robot is a promising yield-enhancing technology proposed to solve the seedling absences in sugarcane fields. In this study, in combination with developing the sugarcane field re-seeding robot, an improved YOLOv5s model was proposed to detect sugarcane seedlings and predict seed replenishment positions. Firstly, field images of one-month-old sugarcane seedlings were taken at different light conditions as a dataset. Secondly, the Slim-Neck was introduced to replace the Neck network, which can reduce the complexity of the model while maintaining sufficient accuracy. Thirdly, the Efficient Channel Attention (ECA) module was added to the Backbone network to enhance the model's attention on critical feature information of sugarcane seedlings. Fourthly, the SCYLLA-IoU (SIoU) loss function was introduced to speed up the convergence of the proposed model. Lastly, a method for predicting seed replenishment positions was proposed and verified by the field tests. The experimental results showed that the mean average precision (mAP), precision, and recall of the improved YOLOv5s model were 93.1 %, 92.1 %, and 89.9 %, respectively, and the detection speed was 82 frames per second (FPS), which increased the mAP by 1.5 % and the detection speed by 12.3 % compared to the original YOLOv5s model. In addition, compared with Faster R-CNN, SSD, and YOLOv4-tiny models, the improved YOLOv5s model had a higher accuracy, faster detection speed, and less memory consumption. The field test showed that the real-time detection speed of the improved YOLOv5s model was 23 FPS in Nvidia Jetson TX2. The real-time detection precision of sugarcane seedlings was 97.2 %, and the recall was 86.7 %. The mean relative error between the numbers of seed replenishment positions predicted by the robot and that predicted by the human was 18.7 %. Consequently, the improved YOLOv5s model can efficiently and accurately detect sugarcane seedlings and predict seed replenishment positions. This technology provides valuable visual detection support for the sugarcane field re-seeding robot.