Discover the SciOpen Platform and Achieve Your Research Goals with Ease.
Search articles, authors, keywords, DOI, etc.
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 12246 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.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Comments on this article