Abstract:Aiming to address key operational issues in automatic transplanting machines, such as missed planting, seedling blockages and abnormal seedling planting state, an optimized lightweight detection model, YOLO v5n-GE, was proposed for real-time monitoring of seedling conditions within transplanting equipment. The research began by collecting images of both single and multiple pepper seedlings under varying lighting conditions (front and backlighting) using a camera. To reduce computational load and latency, traditional convolutions were replaced with Ghost convolutions on the basis of YOLO v5n model, and the main feature extraction modules were substituted with improved FastGhost and SimAMGhost modules. EMA attention mechanism was applied to enhance the network’s focus on important detail information, effectively improving the model’s recognition results for highly overlapping pepper seedlings, reducing sensitivity to occlusions, and increasing recognition accuracy. Additionally, Shape-IoU loss was used to replace CIoU loss, addressing the influence of the bounding box shape on bounding box regression and improving bounding box regression accuracy. Experimental results on the self-built dataset demonstrated that the improved YOLO v5n-GE model achieved an mAP of 95.3%, representing a 0.3 percentage points improvement over the original model. The model’s parameter count and computational load were reduced by 52.5% and 51.2%, respectively, detection speed was increased by 12.2%. These enhancements enabled efficient, real-time detection of pepper seedlings while maintaining high accuracy, demonstrating the improved algorithm’s effectiveness. The research result can provide technical support for seedling recognition in transplanting machine components with limited hardware resources.