YU Yingjie, E-mail: 646677093@qq.com
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.
| 科 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 |