Abstract:Accurate morphological detection of mechanically harvested fresh tea leaves is beneficial for improving the accuracy and efficiency of automated grading. YOLO v5n-DRSW, an advanced YOLO v5n based model specifically designed for the precise recognition of machine-harvested tea leaf morphologies was introduced. The model integrated several innovative features: a distribution shifting convolution (DSConv) module in the head network to reduce complexity and enhance efficiency; a reparameterized generalized feature pyramid network (RepGFPN) in the neck to improve generalization and robustness; and the squeeze-and-excitation (SE) attention mechanism embedded in the backbone to strengthen feature perception for small targets like tender buds. By leveraging a global field of view, this mechanism further enhanced the perception capability of the feature maps. Additionally, the wise intersection over union (WIoU) loss function was used to dynamically adjust gradient contributions during training. Compared with the baseline, YOLO v5n-DRSW exhibited significant advantages in detecting machine-harvested tea leaves with complex morphologies. Experimental results demonstrated that YOLO v5n-DRSW achieved 98. 1% accuracy, a 2. 1 percentage points improvement over the baseline, with an inference time of just 2. 11 ms per frame. This rapid processing speed represented a notable improvement over the baseline model. The model also reduced floating-point operations by 2. 44% , confirming its lightweight nature. In practical applications, it attained an average online recognition accuracy of 94. 34% with a miss rate below 1. 1% , highlighting its strong potential for enhancing automated tea leaf grading systems. Overall, the model demonstrated excellent detection performance, providing reliable assistance for improving the morphological detection outcomes of fresh tea leaves.