Abstract:Aiming to address the challenges in nighttime automated harvesting of edible roses in Yunnan, including limited samples, low maturity recognition accuracy, missed small targets, and constrained edge computing capacity, the targeted technical optimizations were conducted. In the data enhancement stage, an improved AttentionGAN-based day-night image conversion model was constructed, incorporating the multi-scale attention mechanism, designing a progressive fusion strategy, and simultaneously implementing lightweight modification of the generator. For the detection model, the YOLO-NRP model was built based on YOLO v8n: the C2f backbone was replaced with the RVG-Ghost (RepVGG-Ghost) module, the ECA-Spatial attention mechanism was embedded at the end of the backbone network to enhance key feature expression, and the neck network was optimized with PAFPN-Lite to strengthen multi-scale feature fusion. Experimental results showed that the images generated by the improved AttentionGAN achieved a Frechet inception distance (FID) of 87. 97 and a structural similarity index (SSIM) of 0. 588 2, with significantly better quality than that of the original model, effectively expanding the nighttime dataset. The YOLO-NRP model achieved 91. 3% precision, 90. 2% recall, 94. 3% mAP50, and 80. 7% mAP50 95, with all indicators outperforming the YOLO v8n baseline model. Meanwhile, the model weighed only 5. 49 MB and had an inference speed of 70. 26 f/ s, meeting the requirements of edge device deployment and providing reliable technical support for the development of automated harvesting equipment.