Shaowei Mi, Cheng Li, Kui Fang, Xinghui Zhu, Gang Chen
Detecting rice leaf diseases in real-world field environments remains challenging due to varying lesion sizes, diverse lesion morphologies, complex backgrounds, and the limited availability of high-quality annotated datasets. Existing detection models often suffer from performance degradation under these conditions, particularly when training data lack sufficient diversity and structural realism. To address these challenges, this paper proposes a Latent Diffusion Inpainting (LDI) data augmentation method and an improved lightweight detection model, LGH-YOLOv12n. Unlike conventional diffusion-based augmentation methods that generate full images or random patches, LDI performs category-aware latent inpainting, synthesizing realistic lesion patterns by jointly conditioning on background context and disease categories, thereby enhancing data diversity while preserving scene consistency. Furthermore, LGH-YOLOv12n improves upon the YOLOv12n baseline by introducing GSConv in the backbone to reduce channel redundancy and enhance lesion localization, and integrating Hierarchical Multi-head Attention (HMHA) into the neck network to better distinguish disease features from complex field backgrounds. Experimental results demonstrate that LGH-YOLOv12n achieves an F1 of 86.1% and an mAP@50 of 88.3%, outperforming the YOLOv12n model trained without data augmentation by 3.3% and 5.0%, respectively. Moreover, when trained on the LDI-augmented dataset, LGH-YOLOv12n consistently outperforms YOLOv8n, YOLOv10n, YOLOv11n, and YOLOv12n, with mAP@50 improvements of 4.6%, 5.2%, 1.9%, and 2.1%, respectively. These results indicate that the proposed LDI augmentation and LGH-YOLOv12n model provide an effective and robust solution for rice leaf disease detection in complex field environments.