A Lightweight Cotton Field Weed Detection Model Enhanced with EfficientNet and Attention Mechanisms - Lu Zheng; Lyujia Long; Chengao Zhu; Mengmeng Jia; Pingting Chen; Jun Tie (Agronomy)
Cotton is a crucial crop in the global textile industry, with major production regions including China, India, and the United States. While smart agricultural mechanization technologies, such as automated irrigation and precision pesticide systems, have improved crop management, weeds remain a significant challenge. These weeds not only compete with cotton for nutrients but can also serve as hosts for diseases, affecting both cotton yield and quality. Existing weed detection models perform poorly in the complex environment of cotton fields, where the visual features of weeds and crops are similar and often overlap, resulting in low detection accuracy. Furthermore, real-time deployment on edge devices is difficult. To address these issues, this study proposes an improved lightweight weed detection model, YOLO-WL, based on the YOLOv8 architecture. The model leverages EfficientNet to reconstruct the backbone, reducing model complexity and enhancing detection speed. To compensate for any performance loss due to backbone simplification, CA (cross-attention) is introduced into the backbone, improving feature sensitivity. Finally, AFPN (Adaptive Feature Pyramid Network) and EMA (efficient multi-scale attention) mechanisms are integrated into the neck to further strengthen feature extraction and improve weed detection accuracy. At the same time, the model maintains a lightweight design suitable for deployment on edge devices. Experiments on the CottonWeedDet12 dataset show that the YOLO-WL model achieved an mAP of 92.30%, reduced the detection time per image by 75% to 1.9 ms, and decreased the number of parameters by 30.3%. After TensorRT optimization, the video inference time was reduced from 23.134 ms to 2.443 ms per frame, enabling real-time detection in practical agricultural environments.