Full-surface detection of apple fruits using enhanced YOLOv5
摘要
Accurate detection of apple surfaces under various orientations in a sorting machine is crucial for applications in precision agriculture, particularly for tasks such as automated quality control. Traditional image processing methods often struggle with complexities introduced by varying fruit orientations. In this study, an enhanced version of the You Only Look Once (YOLOv5) model for full-surface detection of apples is proposed, with a key modification in which the original backbone network is replaced with a more robust architecture. Additionally, the model integrates Convolutional Block Attention Modules (CBAM) for improved feature extraction, which enhances its ability to handle occlusions and complex backgrounds. This innovation optimizes automated sorting and quality control systems, reducing losses and ensuring consistent apple quality. Results show that the enhanced YOLOv5 model performed better than traditional methods, achieving precision rates of 76.80%, 88.40%, 88.20%, and 88.20%, recall rates of 82.30%, 83.20%, 93.10%, and 93.10%, as well as mean average precision (mAP) of 86.00%, 91.70%, 95.00%, and 95.00% respectively for stem up, stem down, sideways, and diagonal orientations. The highest F1-score (90.58) and mAP (95.00) were achieved in the sideways orientation, demonstrating superior performance in this orientation. The model’s enhanced accuracy makes it highly suitable for applications in smart agriculture, particularly in automated apples quality control, where reliable and consistent surface detection is essential.