Abstract:Black rot and brown spot disease of grapes are diseases that seriously threaten grape yields, and identification of grape diseases early is of great significance for disease prevention and control and grape yield. However, current disease detection methods have a high leakage rate. The black rot and brown spot were taken as the research objects, a method for detecting grape black rot and brown spot based on adaptive discriminator enhanced style generation adversarial network combined with improved YOLO v7 was proposed. Firstly, the grape disease data were expanded by the adaptive discriminator enhanced style generation adversarial network + deblurring processing. Secondly, the MSRCP algorithm was used to enhance the image and improve the lighting environment to highlight the characteristics of disease spots. Finally, based on the YOLO v7 network framework, the BiFormer attention mechanism was embedded in the feature extraction network to strengthen the key features of the target area. BiFPN was used instead of PA-FPN to better realize multi-scale feature fusion and reduce computational complexity. SPD module was introduced in the detection head section of YOLO v7 to improve the detection performance of low-resolution images. The combination of CIoU and NWD loss function was used to redefine the loss function to achieve rapid and accurate identification of small targets. The experimental results showed that the accuracy of spot detection in this method reached 94.1%, which was 5.7 percentage points higher than that of the original algorithm, and 3.3 percentage points, 3.8 percentage points, and 4.4 percentage points higher than that of Faster R-CNN, YOLO v3-SPP, and YOLO v5x models, respectively, which can realize the rapid and accurate identification of early grape diseases, which was of positive significance for ensuring the development of the grape industry.