Shipin yu jixie (Sep 2024)
Research on fruit appearance detection and classification method based on YOLOv8
Abstract
[Objective] To establish a nondestructive detection method for fruit appearance. [Methods] Nectarines were used as the research subject. The IQQU3 smart phone camera was used to capture the picture data, which was then preprocessed. The image annotation program Labelimg was used to label the data. Panning, left-right flipping, and mirror flipping were used to enlarge the data. Using an ratio of 8∶2, the enlarged photos were split into training and test sets. Lastly, the data was trained for 150 epochs using five YOLOv8 models (n, s, m, l, x). The training results of the five models were compared and analyzed in order to determine which detection model was the best. [Results] The nectarine dataset was constructed, there were 4,205 total photos; YOLOv8 (n, s, m, l, x) the total loss values in the training set were 2.275, 1.778, 1.482, 1.880, and 1.401, respectively, The total loss values of the test set were 2.724, 2.253, 2.057, 2.105, and 2.004, respectively; YOLOv8 (n, s, m, l, x) precision were 94.0%, 98.0%, 97.4%, 97.3%, 97.9%, respectively, The recall were 95.4%, 95.5%, 95.9%, 96.9%, and 96.9%, respectively. In a comprehensive comparison YOLOv8s was the better model, and the average detection accuracy mAP_0.5 was 97.8%. The average precision of fresh, bruise and scar were 96.2%, 98.8% and 98.4%, respectively. The inference time and calculation amount (GFLOPs) were 179.4 ms and 28.4 respectively. [Conclusion] YOLOv8 can effectively detect the quality of fruit appearance, which can be used for non-destructive testing of fruit appearance, and this study can provide new ideas for non-destructive testing of fruits.
Keywords