Weed detection is an important part of precision agriculture because it allows farmers to manage weeds more efficiently and reduce unnecessary herbicide use. With the use of UAVs, it is now possible to capture high-resolution images of agricultural fields, but identifying weeds from these images is still challenging due to complex backgrounds, lighting variations, and the visual similarity between crops and weeds. In this study, an improved YOLOv7-based approach is developed to address these challenges using UAV imagery collected from rainfed cotton fields in the Texas Panhandle. The original dataset consisted of high-resolution UAV images, which were divided into smaller patches and manually annotated to label weed and cotton classes. After cleaning the dataset and applying simple augmentation techniques, a total of 8396 images were used for training and testing. To improve detection performance, two modifications were introduced: Convolutional Block Attention Module (CBAM) to help the model focus on important features and Bidirectional Feature Pyramid Network (BiFPN) to improve how information is shared across different scales. Three models—YOLOv7-CBAM, YOLOv7-BiFPN, and the combined CB-YOLOv7—were evaluated. The results show that CBAM helps detect more weed instances, BiFPN reduces false detections, and the combined model gives the best overall performance, achieving an mAP@0.5 of 0.89 and an F1-score of 0.84. Overall, the study shows that improving both the dataset and the model can lead to more reliable weed detection under real field conditions. The proposed approach can be useful for identifying weeds in cotton fields using UAV imagery and can support better crop management and more efficient use of herbicides in precision agriculture.
Das et al. (Thu,) studied this question.