{"title":"GrainNet: efficient detection and counting of wheat grains based on an improved YOLOv7 modeling.","authors":"Xin Wang, Changchun Li, Chenyi Zhao, Yinghua Jiao, Hengmao Xiang, Xifang Wu, Huabin Chai","doi":"10.1186/s13007-025-01363-y","DOIUrl":null,"url":null,"abstract":"<p><strong>Background: </strong>Seed testing plays a crucial role in improving crop yields.In actual seed testing processes, factors such as grain sticking and complex imaging environments can significantly affect the accuracy of wheat grain counting, directly impacting the effectiveness of seed testing. However, most existing methods primarily focus on simple counting tasks and lack general applicability.</p><p><strong>Results: </strong>To enable fast and accurate counting of wheat grains under severe adhesion and complex scenarios, this study collected images of wheat grains from different varieties, backgrounds, densities, imaging heights, adhesion levels, and other natural conditions using various imaging devices and constructed a comprehensive wheat grain dataset through data enhancement techniques. We propose a wheat grain detection and counting model called GrainNet, which significantly improves the counting performance and detection speed across diverse conditions and adhesion levels by incorporating lightweight and efficient feature fusion modules. Specifically, the model incorporates an Efficient Multi-scale Attention (EMA) mechanism, effectively mitigating the interference of background noise on detection results. Additionally, the ASF-Gather and Distribute (ASF-GD) module optimizes the feature extraction component of the original YOLOv7 network, improving the model's robustness and accuracy in complex scenarios. Ablation experiments validate the effectiveness of the proposed methods.Compared with classic models such as Faster R-CNN, YOLOv5, YOLOv7, and YOLOv8, the GrainNet model achieves better detection performance and computational efficiency in various scenarios and adhesion levels. The mean Average Precision reached 93.15%, the F1 score was 0.946, and the detection speed was 29.10 frames per second (FPS). A comparative analysis with manual counting results revealed that the GrainNet model achieved the highest coefficient of determination and Mean Absolute Error values for wheat grain counting tasks, which were 0.93 and 5.97, respectively, with a counting accuracy of 94.47%.</p><p><strong>Conclusions: </strong>Overall, the GrainNet model presented in this study enables accurate and rapid recognition and quantification of wheat grains, which can provide a reference for effective seed examination of wheat grains in real scenarios. Related content can be accessed through the following link: https://github.com/1371530728/grainnet.git .</p>","PeriodicalId":20100,"journal":{"name":"Plant Methods","volume":"21 1","pages":"44"},"PeriodicalIF":4.7000,"publicationDate":"2025-03-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC11934480/pdf/","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Plant Methods","FirstCategoryId":"99","ListUrlMain":"https://doi.org/10.1186/s13007-025-01363-y","RegionNum":2,"RegionCategory":"生物学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"BIOCHEMICAL RESEARCH METHODS","Score":null,"Total":0}
引用次数: 0
Abstract
Background: Seed testing plays a crucial role in improving crop yields.In actual seed testing processes, factors such as grain sticking and complex imaging environments can significantly affect the accuracy of wheat grain counting, directly impacting the effectiveness of seed testing. However, most existing methods primarily focus on simple counting tasks and lack general applicability.
Results: To enable fast and accurate counting of wheat grains under severe adhesion and complex scenarios, this study collected images of wheat grains from different varieties, backgrounds, densities, imaging heights, adhesion levels, and other natural conditions using various imaging devices and constructed a comprehensive wheat grain dataset through data enhancement techniques. We propose a wheat grain detection and counting model called GrainNet, which significantly improves the counting performance and detection speed across diverse conditions and adhesion levels by incorporating lightweight and efficient feature fusion modules. Specifically, the model incorporates an Efficient Multi-scale Attention (EMA) mechanism, effectively mitigating the interference of background noise on detection results. Additionally, the ASF-Gather and Distribute (ASF-GD) module optimizes the feature extraction component of the original YOLOv7 network, improving the model's robustness and accuracy in complex scenarios. Ablation experiments validate the effectiveness of the proposed methods.Compared with classic models such as Faster R-CNN, YOLOv5, YOLOv7, and YOLOv8, the GrainNet model achieves better detection performance and computational efficiency in various scenarios and adhesion levels. The mean Average Precision reached 93.15%, the F1 score was 0.946, and the detection speed was 29.10 frames per second (FPS). A comparative analysis with manual counting results revealed that the GrainNet model achieved the highest coefficient of determination and Mean Absolute Error values for wheat grain counting tasks, which were 0.93 and 5.97, respectively, with a counting accuracy of 94.47%.
Conclusions: Overall, the GrainNet model presented in this study enables accurate and rapid recognition and quantification of wheat grains, which can provide a reference for effective seed examination of wheat grains in real scenarios. Related content can be accessed through the following link: https://github.com/1371530728/grainnet.git .
背景:种子检测在提高作物产量方面起着至关重要的作用。在实际的种子检测过程中,粘粒和复杂的成像环境等因素会显著影响小麦籽粒计数的准确性,直接影响种子检测的有效性。然而,大多数现有的方法主要集中在简单的计数任务上,缺乏普遍的适用性。结果:为实现严重黏附和复杂场景下的小麦籽粒快速准确计数,本研究利用多种成像设备采集了不同品种、背景、密度、成像高度、黏附水平等自然条件下的小麦籽粒图像,并通过数据增强技术构建了综合的小麦籽粒数据集。我们提出了一种名为GrainNet的小麦颗粒检测和计数模型,该模型通过结合轻量级和高效的特征融合模块,显著提高了不同条件和粘附水平下的计数性能和检测速度。具体而言,该模型结合了高效多尺度注意(EMA)机制,有效地减轻了背景噪声对检测结果的干扰。此外,ASF-Gather and Distribute (ASF-GD)模块优化了原始YOLOv7网络的特征提取组件,提高了模型在复杂场景下的鲁棒性和准确性。烧蚀实验验证了所提方法的有效性。与Faster R-CNN、YOLOv5、YOLOv7、YOLOv8等经典模型相比,GrainNet模型在各种场景和黏附水平下都具有更好的检测性能和计算效率。平均平均精度达到93.15%,F1得分为0.946,检测速度为29.10帧/秒(FPS)。与人工计数结果的对比分析表明,GrainNet模型对小麦籽粒计数任务的决定系数和平均绝对误差值最高,分别为0.93和5.97,计数精度为94.47%。结论:总体而言,本研究提出的GrainNet模型能够准确、快速地对小麦籽粒进行识别和量化,可为实际场景下对小麦籽粒进行有效的种子检测提供参考。相关内容可通过以下链接访问:https://github.com/1371530728/grainnet.git。
期刊介绍:
Plant Methods is an open access, peer-reviewed, online journal for the plant research community that encompasses all aspects of technological innovation in the plant sciences.
There is no doubt that we have entered an exciting new era in plant biology. The completion of the Arabidopsis genome sequence, and the rapid progress being made in other plant genomics projects are providing unparalleled opportunities for progress in all areas of plant science. Nevertheless, enormous challenges lie ahead if we are to understand the function of every gene in the genome, and how the individual parts work together to make the whole organism. Achieving these goals will require an unprecedented collaborative effort, combining high-throughput, system-wide technologies with more focused approaches that integrate traditional disciplines such as cell biology, biochemistry and molecular genetics.
Technological innovation is probably the most important catalyst for progress in any scientific discipline. Plant Methods’ goal is to stimulate the development and adoption of new and improved techniques and research tools and, where appropriate, to promote consistency of methodologies for better integration of data from different laboratories.