Detection of Green Walnuts on Trees Using the Improved YOLOv7 Model
摘要
One application of artificial intelligence in agriculture is the use of machines to detect fruits and evaluate yield. Due to the small size and color of green walnuts similar to leaves, it is important to develop a method that detects walnuts quickly and accurately. Motivated by this issue, we propose a solution using the improved YOLOv7 model and use the improved model for detection and identification. We constructed a dataset with data augmentation to help with this study, containing a total of 10,550 images, including green walnuts from different angles. We used Precision, Recall, F-Measure, and mean Average Precision as the accuracy indexes of the model. Add the Transformer model, the ResNet network, and the SimAm attention mechanism to the network structure of the YOLOv7 model to improve the detection capability of the model. Compared to the YOLOv7 model without improvements, P increased by 1.5%, R increased by 1.3%, F1 increased by 1%, and mAP increased by 1.5%. Compared with other target detection models, the accuracy indexes show better results. This method can maintain high precision in walnut identification and detection and can provide technical support to the machine to recognize walnuts in a complex environment quickly and for a long time. The dataset is publicly available on Github: https://github.com/lunchc/Walnut .