Aiming at the problem of high false detection and missed detection rate of apple surface defects in complex environments, a new apple surface defect detection network: space-to-depth convolution-Multi-scale Empty Attention-Context Guided Feature Pyramid Network-You Only Look Once version 8 nano (SMC-YOLOv8n) is designed. Firstly, space-to-depth convolution (SPD-Conv) is introduced before each Faster Implementation of CSP Bottleneck with 2 convolutions (C2f) in the backbone network as a preprocessing step to improve the quality of input data. Secondly, the Bottleneck in C2f is removed in the neck, and Multi-scale Empty Attention (MSDA) is introduced to enhance the feature extraction ability. Finally, the Context Guided Feature Pyramid Network (CGFPN) is used to replace the Concat method of the neck for feature fusion, thereby improving the expression ability of the features. Compared with the YOLOv8n baseline network, mean Average Precision (mAP) 50 increased by 2.7% and 1.1%, respectively, and mAP50-95 increased by 4.1% and 2.7%, respectively, on the visible light apple surface defect data set and public data set in the self-made complex environments.The experimental results show that SMC-YOLOv8n shows higher efficiency in apple defect detection, which lays a solid foundation for intelligent picking and grading of apples.
Read full abstract