Abstract:Objective To improve the accuracy of apple defect identification and classification.Methods An apple defect identification method based on improved YOLOv7-tiny is proposed. Firstly, a multi-angle image acquisition system is designed to sample and enhance the surface of the apple. Then, the YOLOv7-tiny network is used to extract the features of the apple. The extracted features are dimensionally reduced and compressed with the improved fuzzy C-means clustering (IFCM) algorithm. Finally, the improved coati optimization algorithm (ICOA) is adopted to automatically optimize the hyperparameters of the YOLOv7 model. The proposed method is compared with other methods, such as ResNet+FPN, YOLOv5s, and PP-YOLOE, in terms of apple defect identification and classification performance under different resolutions and batch sizes.Results When the sample resolution is 224 pixels×224 pixels, the proposed method achieves the detection accuracy of 98.6% and the recall rate of 97.9% and takes only about 50 ms to detect a single image on average, outperforming the other methods.Conclusion This system has high precision and real-time performance and can effectively improve the classification efficiency and quality of apples, which is of great engineering significance for the automatic sorting of fruits.