AbstractThis study proposes a walnut target detection algorithm based on improved YOLOv5 and x‐ray imaging to meet the demand for internal quality detection and removal in the Xinjiang walnut industry. By replacing the C3 module in the backbone layer with the C2f module and the couple‐head in the head layer with the decouple‐head, the algorithm reduces computational complexity, enhances robustness and generalizability, and retains more spatial information, thereby improving the performance of multicategory small target detection. In addition, this paper replaces the original CIOU loss function with the EIOU loss function to improve the convergence speed of the algorithm's accuracy and boundary aspect ratio. Compared with the original model, the improved model, improved YOLOv5, maintains the same average precision for normal walnuts while increasing the average precision for shriveled walnuts and empty‐shell walnuts by 8.2% and 0.4%, respectively. Compared with other mainstream models, such as VGG16, ResNet50, YOLOv5s, YOLOv7, YOLOv8s, YOLOv9s, and YOLOv10s, this model achieves the highest detection accuracy and good detection performance, with a single‐image detection time of 11.9 ms, meeting the requirements for real‐time detection. This work lays a foundation for automatic robot detection of the internal quality and removal of walnuts, showing practical application potential.Practical applicationsXinjiang stands as a prominent producer of walnuts; however, due to the decentralized nature of its cultivation and management processes, a notable prevalence of internal empty shells and shrinkage is observed, which substantially diminishes their commercial value. The integration of YOLOv5 with x‐ray imaging technology promises to enhance the precision of internal quality assessments of walnuts. The improved YOLOv5 model, as delineated in this study, exhibits the highest detection accuracy when benchmarked against a multitude of other models. It achieves a detection latency of merely 11.9 ms per image, thereby satisfying the stringent demands for real‐time detection applications. This model is designed for integration into x‐ray systems with an adjunctive sorting mechanism, which facilitates the inspection and exclusion of defective walnuts on conveyor belts.
Read full abstract