Abstract:To address the challenges of detecting cotton leaf diseases in natural environments and the difficulty of manually designing feature extractors that capture similar feature expressions as those of cotton leaf diseases, an improved attention mechanism YOLO v7 algorithm (CBAM-YOLO v7) was proposed. Building upon the YOLO v7 model, the approach integrated the convolutional block attention module (CBAM) into the backbone and head of the model and incorporated a four times downsampling step within the head. The CBAM-YOLO v7 model was employed for the identification of cotton leaf diseases in Southern Xinjiang, and comparative experiments were conducted against YOLO v5 and YOLO v7. Experimental results revealed that in terms of aphid and normal leaf detection, YOLO v7 achieved favorable detection outcomes. Notably, CBAM-YOLO v7 demonstrated higher accuracy in detecting diseases like Fusarium wilt, cotton mirid bugs, and red spider mites when compared with other models. CBAM-YOLO v7 achieved a mean average precision (mAP) of 85.5%, representing a 21 percentage points increase over YOLO v5 and a 4.9 percentage points increase over YOLO v7. Moreover, the detection time for a single image was 29.26ms, offering a theoretical foundation for online monitoring of cotton leaf diseases.