Acta Agriculturae Zhejiangensis ›› 2026, Vol. 38 ›› Issue (6): 1258-1270.DOI: 10.3969/j.issn.1004-1524.20250732

• Biosystem Engineering • Previous Articles     Next Articles

Recognition method for blueberry ripeness and fruit clusters based on YOLO-AIFI

LI Gonglei1(), HUANG Keyue1, LIU Yinghao1, ZHANG Chenwen1, LI Zitong1, WU Delin1,2,*()   

  1. 1 School of Engineering, Anhui Agricultural University, Hefei 230036, China
    2 Anhui Provincial Engineering Research Center of Intelligent Agricultural Machinery, Hefei 230036, China
  • Received:2025-12-03 Online:2026-06-25 Published:2026-07-14

Abstract:

Aiming at the problem of reduced fruit quality caused by inconsistent ripeness of blueberry fruit clusters and mixed harvested fruits, we propose an improved model of YOLO-AIFI based on YOLO11n, to realize the automatic recognition of blueberry fruit clusters. Three core improvements are introduced into the original YOLO11n framework: a dynamic phantom convolution module is adopted to reduce feature redundancy, a dynamic upsampling module is integrated to enhance feature resolution, and the AIFI (attention-based intra-scale feature interaction) attention mechanism is embedded to strengthen global feature interaction capability. Taking the spatial coordinates of blueberry fruits detected by YOLO-AIFI as a point set, the unsupervised k-means clustering algorithm was applied to identify complete blueberry fruit cluster structures. Experimental validation was conducted on a self-collected dataset containing 3 346 blueberry images. The results demonstrated that the precision of YOLO-AIFI reached 85.0%, the recall rate was 78.9%, and the mAP@0.5 (mean average precision at an intersection over union threshold of 0.5) achieved 82.5% on the test set, which were 3.0, 3.4, and 2.8 percentage points higher than those of the original YOLO11n, respectively. The proposed method maintains superior detection accuracy under complex conditions such as variable illumination, fruit occlusion and dense small-target scenarios, and its overall performance is significantly better than mainstream lightweight models including YOLOv5n. Cross-weather and cross-scene verification on fruits from the same producing area, as well as practical deployment tests on embedded devices, further verifies that the optimized model possesses excellent generalization ability and practical application adaptability for blueberry ripeness detection. On the basis of high-precision discrete fruit detection results output by YOLO-AIFI, the k-means clustering algorithm automatically aggregates spatially adjacent fruit center points into independent clusters, thereby achieving effective recognition and localization of blueberry fruit clusters in natural environments. This study provides a reliable visual detection solution for the automatic harvesting of blueberries.

Key words: blueberry fruit, ripeness detection, attention mechanism, object detection, dynamic convolution, k-means clusterering

CLC Number: