Abstract:
To comprehensively address the critical challenges in unstructured agricultural environments where wolfberry (
Lycium barbarum L.) fruits and their corresponding pedicels exhibit extreme morphological scale variations, grow in dense clusters, and are frequently occluded by complex branches and leaves this study proposes DFL-YOLO, a lightweight detection model based on an improved YOLO11 architecture. Existing object detection models typically suffer from high missed detection rates for micro-pedicels, possess excessively large parameter volumes, and struggle to meet the embedded deployment requirements of agricultural mobile harvesting equipment with limited computing power. This research utilizes the YOLO11 model as the baseline to execute structural refinement and lightweight optimization. First, the C3k2-DAttention (deformable attention) mechanism is introduced into the backbone network. By dynamically adjusting the shape of the receptive field, this module actively focuses on and enhances the feature extraction capability for irregular targets, such as elliptical fruits and linear pedicels, effectively suppressing interference from complex foliage backgrounds. Second, to tackle the problem wherein fine pedicel features are easily lost and degraded within deep convolutional networks, a Feature-focusing Diffusion Pyramid Network (FDPN) is designed. By constructing a bidirectional feature flow, the FDPN achieves the highly effective fusion of shallow spatial texture features with deep semantic information, maximally preserving weak geometric features. Third, a Lightweight Shared Convolution Head Design (LSCHD) is adopted to replace the original decoupled detection head. Utilizing a parameter-sharing mechanism, this module compels the network to learn cross-scale generic features, significantly reducing computational costs and parameter redundancy from the perspective of network architecture. Finally, combined with a Layer-adaptive Magnitude-based Pruning (LAMP) strategy, the model is sparsely compressed to accurately eliminate non-critical redundant parameter channels. Extensive experiments were conducted on a self-constructed wolfberry dataset comprising 5 760 images captured in complex environments. The quantitative results demonstrate that the pruned and optimized DFL-YOLO model contains merely 1.45 M parameters and requires 6.3 GFLOPs of computation. Compared with the baseline YOLO11 model, the parameter volume is dramatically reduced by 44% under the premise of maintaining identical computational complexity. Furthermore, the mean average precision at an IoU threshold of 0.5 (AP
50) and AP
50-95 reach 82.4% and 55.5%, respectively, and the F1 score achieves 82.0%. These core metrics represent significant improvements of 1.7, 3.0, and 1.0 percentage points over the baseline model, respectively, with a single-image inference latency of only 2.2 ms. Compared with mainstream object detection models such as YOLOv5, YOLOv8, and RT-DETR, DFL-YOLO exhibits obvious advantages in both detection accuracy and lightweight performance. Additionally, rigorous field experiments conducted in genuine unstructured environments characterized by strong illumination, severe backlighting, and heavy branch-and-leaf occlusions indicate that DFL-YOLO achieves a precision of 88.2%, a recall of 73.8%, and an AP50 of 78.7% across 313 valid field targets, successfully minimizing missed and false detections to 82 and 31, respectively. Through the dual strategy of structural feature enhancement and systematic model pruning, the improved DFL-YOLO model effectively elevates the detection accuracy of tiny pedicels and overlapping fruits in complex environments while realizing a robust lightweight architecture, thereby achieving an optimal balance between detection efficiency and accuracy. The research findings provide highly reliable technical support for the visual perception systems of automated wolfberry harvesting robots.