YOLOv5-based dense rice seed counting method integrating C3CBAM and Soft-NMS
• Retain the small-object detection head, remove original medium and large-object heads, propose a tiny rice seed detection head, and optimize the neck network to boost accuracy. • Integrate CBAM attention into C3 modules of YOLOv5 backbone to enhance rice seed feature extraction and detection accuracy. • Adopt Soft-NMS in post-processing to address overlapping boxes of adherent or occluded seeds, reducing misses and improving robustness To improve the counting accuracy in dense rice seed scenarios, this study proposes a YOLOv5-based dense rice seed counting method that integrates C3CBAM and Soft-NMS. This method integrates the CBAM attention module into the shallow C3 modules of the backbone network to enhance image features. Additionally, it removes the original large and medium-sized object detection heads of YOLOv5 and adds a dedicated detection head for tiny rice seeds. For post-processing of model prediction data, the Soft-NMS algorithm is employed to replace standard Non-Maximum Suppression (NMS) and reduce missed detections. Finally, image acquisition, seed counting, and a user interface are integrated into a single system, enabling rice breeders to conduct seed counting tasks more intuitively and efficiently. Compared with the baseline YOLOv5 model, the recall and mAP@[0.5:0.95] of the improved model increase by 6.4% and 5.7%, respectively. Furthermore, this study designs experiments with three levels of seed density. In the intermediate-type rice seed samples, the detection accuracy reaches 100% under light and moderate density conditions, while it maintains stable counting performance under heavy density conditions with an accuracy above 99.7%. This work significantly enhances rice seed counting efficiency for researchers and facilitates rice variety improvement studies.
Authors
- Xiaoyang Liu (ORCID: https://orcid.org/0000-0002-5572-9080)
- Rongjin Zhu
- Chongyang Hu
- Xupeng Huang
- Cheng Wang
- Chenxin Sun
Institutions
- Huaiyin Institute of Technology (CN)
Publication Details
- Journal
- Smart Agricultural Technology
- Published
- 2026-01-06
- DOI
- https://doi.org/10.1016/j.atech.2026.101779
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00