Abstract:Aiming to address the challenges of diverse scales, similar visual characteristics, and high model complexity in detecting grape diseases in field environments, a novel detection method was proposed based on YOLO v5s-RCW. Using YOLO v5s as the baseline network, the receptive-field attention convolution (RFAConv) was introduced into the feature extraction structure to dynamically generate spatial features in the receptive field matching the size of the convolution kernel and assign unique attention weights to each receptive field in the network, which effectively mitigated the parameter sharing limitation of traditional convolutional operations in handling disease targets of varying sizes. Additionally, the compatible intersection over union (CIoU) loss function was replaced with the wise intersection over union (WIoU) loss function, optimizing the penalty mechanism for anchor boxes of different sizes and significantly reducing performance fluctuations caused by variations in disease scale. The results demonstrated that compared with YOLO v5s, the model improved accuracy, recall, and mean average precision by 7, 6, and 1.7 percentage points, respectively. The model's feature discrimination capability was further enhanced by integrating the convolutional block attention module (CBAM) into the backbone network, while reducing the number of parameters by 18.3%. The YOLO v5s-RCW model was deployed on a cloud server, and users can call the detection function transformed into an application programming interface (API) through the WeChat mini program, enabling convenient detection of grape diseases. The average inference time of the model was 13.9 ms, which improved the efficiency and accuracy of disease detection and provided technical support for grape disease detection.