Whole fruit surface detection and grading of strawberry external quality based on YOLOv11
-
-
Abstract
Postharvest grading is often required to evaluate the maturity, bruising, weight, and shape of strawberries. However, single-view imaging cannot fully meet the complete surface observation in recent years. This study aimed to develop a whole-surface detection and grading for strawberry external quality using three-view image acquisition with an improved YOLOv11n-seg model. A hanging-type online imaging was developed to acquire strawberry images from three viewpoints under non-occluded conditions. A total of 1 030 strawberries were collected to generate 3 090 images. Among them, 2 490 images from 830 fruits were used to construct the instance segmentation dataset, while 600 images from the remaining 200 fruits were used for grading validation. The original segmentation architecture was improved to replace the backbone with MobileNetV4. Convolutional Block Attention Module (CBAM) was embedded to introduce the Efficient Intersection over Union (EIoU) loss for localization optimization. The improved model was used to segment the ripe, bruise-free, unripe, and bruised regions on the strawberry surface. The surface coloration ratio and bruise ratio were calculated using the segmentation masks from three views. Geometric features were further extracted from the fruit mask after convex hull completion and pose normalization, particularly for weight prediction and shape grading. The three-view acquisition experiment showed that the imaging scheme achieved a repeated area ratio of 7.2% to 7.3%, while no fruit-surface region was missed, indicating effective whole-surface coverage. On the test set, the improved model achieved a precision of 94.7%, a recall of 91.0%, an mAP0.5 of 96.3%, and an mAP0.5-0.9 of 80.8% for the bounding-box branch. In the mask branch, the corresponding metric values reached 95.3%, 91.5%, 96.2%, and 68.7%, respectively. In ripe bruise-free regions, the branches reached a precision of 99.8%, a recall of 100.0%, and an mAP0.5 of 99.5%, respectively. The overall accuracy reached 94.0% and 91.5%, respectively, for strawberry maturity classification and bruise grading. In weight prediction, the multiple linear regression model achieved a coefficient of determination of 0.93, and the root mean square error was 2.59 g. In shape grading, the random forest model achieved the highest accuracy when the centroid-distance sequence length was 18. Compared with single-view detection, multi-view detection improved shape grading accuracy by 10.6 percentage points. There was an overall grading accuracy of 91.0% in the final grading validation with 200 strawberries. The average inference time was 28.8 ms after deployment with TensorRT in half-precision mode on a graphics processing unit. The whole-surface acquisition, fine-grained region segmentation, and multi-index fusion grading were effectively realized for strawberries. The grading performance and deployment speed can meet the practical requirements of accurate and real-time postharvest grading. The finding can also provide a technical basis to evaluate strawberry quality during processing.
-
-