DCP-YOLOv7x: improved pest detection method for low-quality cotton image - Ma, Yukun; Wei, Yajun; Ma, Minsheng; Ning, Zhilong; Qiao, Minghui; Awada, Uchechukwu (Frontiers in Plant Science, 2024)
Introduction Pests are important factors affecting the growth of cotton, and it is a challenge to accurately detect cotton pests under complex natural conditions, such as low-light environments. This paper proposes a low-light environments cotton pest detection method, DCP-YOLOv7x, based on YOLOv7x, to address the issues of degraded image quality, difficult feature extraction, and low detection precision of cotton pests in low-light environments. Methods The DCP-YOLOv7x method first enhances low-quality cotton pest images using FFDNet (Fast and Flexible Denoising Convolutional Neural Network) and the EnlightenGAN low-light image enhancement network. This aims to generate high-quality pest images, reduce redundant noise, and improve target features and texture details in low-light environments. Next, the DAttention (Deformable Attention) mechanism is introduced into the SPPCSPC module of the YOLOv7x network to dynamically adjust the computation area of attention and enhance the feature extraction capability. Meanwhile, the loss function is modified, and NWD (Normalized Wasserstein Distance) is introduced to significantly improve the detection precision and convergence speed of small targets. In addition, the model detection head part is replaced with a DyHead (Dynamic Head) structure, which dynamically fuses the features at different scales by introducing dynamic convolution and multi-head attention mechanism to enhance the model's ability to cope with the problem of target morphology and location variability. Results The model was fine-tuned and tested on the Exdark and Dk-CottonInsect datasets. Experimental results show that the detection Precision (P) of DCP-YOLOv7x for cotton pests is 95.9%, and the Mean Average Precision (mAP@0.5) is 95.4% under a low-light environments, showing improvements of 14.4% and 15.6%, respectively, compared to YOLOv7x. Experiments on the Exdark datasets also achieved better detection results, verifying the effectiveness of the DCP-YOLOv7x model in different low-light environments. Discussion Fast and accurate detection of cotton pests using DCP-YOLOv7x provides strong theoretical support for improving cotton quality and yield. Additionally, this method can be further integrated into agricultural edge computing devices to enhance its practical application value.