Abstract:
Mechanical topping has been one of the most critical procedures in cotton cultivation. The precise identification of apical top buds is often required to avoid missing immature buds for high yield. However, existing topping can fail to distinguish between mature and immature cotton top buds in the densely planted fields, leading to inefficient detection under varying maturity levels and complex environmental conditions. In this study, a YOLOv5s-based model (DFR-SN-YOLO) was proposed for the lightweight and accurate detection of the cotton top bud. A lightweight backbone was integrated with the position-aware attention, receptive-field-aware feature fusion, and a Shape-NWD-IoU loss function. The backbone network was redesigned using depthwise separable convolution (DWConv). An optimized C3_Faster module was employed to reduce the computational complexity for the high efficiency of the feature extraction. The standard convolution was replaced with the efficient DWConv convolution to reduce the number of model parameters. The C3_Faster module was incorporated with the Partial Convolution (PConv) to minimize the memory access and computational redundancy. Furthermore, CoordAttention (CA) was embedded into the backbone to capture the spatial positional relationships between mature and immature top buds. The CA was retained on the location-specific features using 1D average pooling in a horizontal and vertical manner, in order to detect the small top buds. A C3_RFCBAMConv module was introduced into the neck network. Receptive Field Attention (RFA) was combined with a modified convolutional block attention module (CBAM). The spatial feature perception was enhanced to dynamically adjust the convolutional kernel parameters according to the spatial patterns of the receptive field. A squeeze-and-excitation (SE) module was integrated for the channel attention, and a spatial attention module (SAM) for the spatial feature weighting. The robust recognition of immature top buds was observed under the cluttered environments. A hybrid loss function, Shape-NWD-IoU (SN-IoU), was proposed to detect the small and irregularly shaped cotton top buds. The SN-IoU was combined with the Shape-IoU. The geometric constraints (e.g., aspect ratio and scale) of bounding boxes were incorporated with the normalized wasserstein distance (NWD), indicating the similarity between Gaussian-modeled bounding boxes. The localization accuracy was improved on the immature top buds after fusion, particularly under low intersection-over-union (IoU) scenarios. A series of experiments was conducted on a dataset of 5,115 images (expanded by saturation adjustment, noise injection, and angle flipping). The images under diverse lighting and occlusion conditions were collected from the cotton fields in Xinjiang. The improved model was trained on an NVIDIA RTX 4090 GPU with a batch size of 32 and a learning rate of 0.01. Evaluation metrics included the precision (
P), recall (
R), mAP, parameters, GFLOPs, and inference speed (FPS). DFR-SN-YOLO was compared with several widely-used object detection models, including the YOLO series (v3-v11) for one-stage networks; Faster RCNN, Mask RCNN, and Cascade R-CNN for two-stage networks; DETR; and existing bud recognition models, such as YOLO-cpp and Bud-YOLO. The results show that the DFR-SN-YOLO outperformed the rest in terms of the average detection accuracy (mAP).Compared with the baseline, the meanaverage precision (mAP@50) increased by 3 percentage points to 97.5%, the accuracy of top buds rose by 3.9 percentagepoints to 92.4%, and the recall rate reached 95.0%. This effectively addresses the issue of missed detection of small top buds. Inaddition, the model parameters are only 3.9M. Furthermore, the inference speed reached 37 frames/s when deployed on the edge computing device, Jetson Nano 4GB. The cotton apical buds were accurately identified in the different growth states, and then the number of computation parameters was determined for the high accuracy of the apical bud identification. This work can provide the technical support to the subsequent intelligent mechanical topping of cotton.