Improved RT-DETR Model for Simultaneous Detection of Young Pear Fruits and Fruit Stalks in Natural Environments
Abstract
Manual fruit thinning is labor-intensive and inefficient, making the development of intelligent visual detection systems a crucial approach for improving the quality and production efficiency of the pear industry. However, in natural orchard environments, young pear fruits are small in size with slender fruit stalks, and their texture and color characteristics are highly similar to those of tender branches. Furthermore, variations in illumination and occlusions caused by branches and leaves make it difficult for existing detection models to simultaneously and accurately identify fruits and fruit stalks, limiting their application in automated thinning equipment. In this study, Yuluxiang pear was selected as the research object, and image data were collected under diverse field conditions, including forward-lighting, backlighting, close-range shooting, long-range shooting and fruit overlapping. A dedicated dataset containing 3057 images was established. Based on the RT-DETR-R18 network, a lightweight and high-precision fruit–stalk synchronous detection model was proposed. Specifically, the backbone network was reconstructed by integrating GCConv with C2f modules to enhance global feature extraction for slender fruit stalks. The bottleneck structure was optimized using GCConvC3 to reduce feature degradation under occlusion conditions, and an additional 4× down-sampling P2 detection head was introduced to improve the detection capability for small targets. To fully validate the model performance and stability, three types of experiments were conducted in this study: ablation experiments, repeated experiments with different random seeds, and comparative experiments. Ablation experiments verified the cumulative performance improvements brought by the introduced modules. Repeated experiments with different random seeds were performed to explore training randomness-induced performance fluctuations, and the results demonstrated that the proposed model maintains stable overall detection accuracy with minor metric fluctuations. Comparative experiments demonstrated that the proposed model achieved a compact parameter size of only 15.97 M, with a precision of 95.0% for young pear fruit detection and an mAP50 of 83.0% for fruit stalk detection, outperforming all comparative models in overall mAP50. The training convergence curves and Grad-CAM++ visualization results further confirmed the stable optimization process and enhanced feature attention capability of the proposed model. By achieving a favorable balance between detection accuracy and model lightweightness, this approach provides effective technical support for the development of intelligent fruit thinning equipment and vision-based systems for smart pear orchards.