收藏切换
Research and experiment on walnut kernel grading based on improved YOLOv7
收藏切换
Yingjie YU, Kunshu WU, Pengxin RAN, Jianian LI
Journal of Intelligent Agricultural Mechanization | 2025, 6(4) : 17 - 23
Less
收藏切换
Journal of Intelligent Agricultural Mechanization | 2025, 6(4): 17-23
Research and experiment on walnut kernel grading based on improved YOLOv7
Full
Yingjie YU, Kunshu WU, Pengxin RAN, Jianian LI
Affiliations
  • Faculty of Modern Agricultural Engineering, Kunming University of Science and Technology, Kunming 650500, China
  • YU Yingjie, E-mail:

About Author:

YU Yingjie, E-mail:

Published: 2025-11-15 doi: 10.12398/j.issn.2096-7217.2025.04.002
Outline
收藏切换

In China, walnut kernel grading predominantly relies on mechanical and manual methods, which suffer from high economic costs, low efficiency, and poor accuracy, severely limiting the standardization and economic value of walnut kernel products. To achieve automated and intelligent walnut kernel grading, this study proposes a deep learning-based intelligent grading method. An image acquisition device was utilized to capture walnut kernel images across six grades under three distinct background colors: pure white, light green, and conveyor belt. The Python OpenCV library was employed for data augmentation to expand the dataset, resulting in a VOC format dataset of 12 246 images, with training, testing, and validation sets allocated in an 8:1:1 ratio. To select the most suitable model for walnut kernel grading, two models were constructed based on the YOLOv5 and YOLOv7 object detection networks, respectively. Both models were trained using pre-trained weights, achieving average grading accuracies of 87.83% and 91.16% for YOLOv5 and YOLOv7, respectively. During validation, YOLOv7 exhibited mispredictions, prompting the integration of two attention mechanisms, ECANet and CBAM, to refine the model. The improved models demonstrated enhanced performance, with the YOLOv7+CBAM model achieving the highest average accuracy (94.5%) and F1-score (90.2%). Compared to the original YOLOv7, the upgraded model increased average accuracy and F1-score by 3.34% and 5.9%, respectively, while adding only 2ms to inference time. To validate practical feasibility, a recognition system platform was developed for walnut kernel classification testing. Four experimental groups were designed, each containing 120 walnut kernels (20 per grade). The YOLOv7+CBAM model achieved an average recognition accuracy of 91.63%, demonstrating robust grading capabilities for walnut kernel appearance quality. This study provides a reference for intelligent walnut kernel grading systems.

walnut kernel grading  /  YOLOv7  /  object detection  /  attention mechanisms  /  machine vision  /  deep learning
于英杰, 吴坤澍, 冉朋鑫, 李加念. 基于改进YOLOv7的核桃仁分级研究与试验. 智能化农业装备学报(中英文), 2025 , 6 (4) : 17 -23 . DOI: 10.12398/j.issn.2096-7217.2025.04.002
Yingjie YU, Kunshu WU, Pengxin RAN, Jianian LI. Research and experiment on walnut kernel grading based on improved YOLOv7[J]. Journal of Intelligent Agricultural Mechanization, 2025 , 6 (4) : 17 -23 . DOI: 10.12398/j.issn.2096-7217.2025.04.002
  • Yunnan Revitalization Talent Support Program(KKRD202223052)
Year 2025 volume 6 Issue 4
50
13
Cite this Article
BibTeX
Article Info
doi: 10.12398/j.issn.2096-7217.2025.04.002
  • Receive Date:2024-12-12
  • Online Date:2026-11-05
  • Published:2025-11-15
Article Data
Affiliations
History
  • Received:2024-12-12
  • Revised:2025-01-16
Funding
Yunnan Revitalization Talent Support Program(KKRD202223052)
Affiliations
    Faculty of Modern Agricultural Engineering, Kunming University of Science and Technology, Kunming 650500, China

Corresponding:

* LI Jianian, E-mail:
References
Share
https://castjournals.cast.org.cn/joweb/znhnyzbxb/EN/10.12398/j.issn.2096-7217.2025.04.002
Share to
QR

Scan QR to access full text

Cite this article
BibTeX
Citations
表12种不同金属材料的力学参数
科
Family
属数
Number of
genus
种数
Number of
species
占总种数比例
Percentage of
total species (%)
属
Genus
种数
Number of
species
占总种数比例
Percentage of total
species (%)
鹅膏菌科Amanitaceae 2 11 5.26 鹅膏菌属 Amanita 10 4.78
小菇科 Mycenaceae 2 12 5.74 丝盖伞属 Inocybe 5 2.39
多孔菌科 Polyporaceae 8 14 6.70 蜡蘑属 Laccaria 5 2.39
红菇科 Russulaceae 3 23 11.00 小皮伞属 Marasmius 6 2.87
小菇属 Mycena 11 5.26
光柄菇属 Pluteus 5 2.39
红菇属 Russula 17 8.13
栓菌属 Trametes 5 2.39
关闭全屏
  • BibTeX
  • EndNote
  • RefWorks
  • TxT