Method and system for detecting severity of grape downy mildew leaf diseases
Through the detection method of severity of grape downy mildew leaf disease, image segmentation is performed using efficient channel attention processing and hollow convolution, which solves the problems of low detection efficiency and inconsistent results in the prior art, and achieves rapid and accurate monitoring of disease severity.
Patent Information
- Application Number
- CN202510272097.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-04-29
AI Technical Summary
When detecting the severity of grape downy mildew leaf disease, the prior art relies on manual observation efficiency, inconsistent results and difficult to achieve rapid monitoring and real-time evaluation of large-scale crops.
A method of detecting the severity of the leaf disease of grape downy mildew is used to obtain the images to be tested, and the features are extracted using efficient channel attention processing and hollow convolution extraction are performed. The background and leaves, health and lesions are divided respectively. The proportion of the lesions area to the leaf area is finally calculated to determine the severity of the disease.
It improves the accuracy and efficiency of disease severity detection, can quickly and in real time monitor large-scale crops, reducing the dependence and error of manual testing.
Smart Images

Figure CN119904861A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to a method and system for detecting the severity of grape downy mildew leaf disease. Background Art
[0002] At present, the detection of the severity of grape downy mildew leaf disease mainly relies on manual observation and evaluation, which has many defects and shortcomings. First, manual detection requires a lot of manpower and time, especially in large-scale farmland, the detection efficiency is extremely low, and it is difficult to meet actual needs. Secondly, manual evaluation is greatly affected by the experience and status of the tester, which can easily lead to inconsistent or biased test results. Third, manual methods are difficult to achieve rapid monitoring and real-time evaluation of a large range of crops, which often delays the best time for disease prevention and control.
[0003] In addition, although deep learning technology has made some progress in crop disease detection in recent years, existing technologies mainly focus on the identification of lesions and lack accurate calculation of the severity of the disease. Summary of the invention
[0004] The invention provides a method and system for detecting the severity of grape downy mildew leaf disease.
[0005] The technical solution of the present invention is as follows: The present invention provides a method for detecting the severity of grape downy mildew leaf disease, comprising the following steps: S1: Obtain an image of grape downy mildew leaves to be inspected, extract image features through efficient channel attention processing, and predict the category of each pixel after the extracted features are processed by dilated convolution, where the category of the pixel is background or leaf; According to the predicted pixel category, the leaf area is marked to obtain a mask image; According to the mask image, the background of the image of the grape downy mildew leaf to be inspected is removed to obtain a first segmented image; S2: The first segmented image is processed sequentially through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing. The feature map after spatial attention processing is repeatedly processed sequentially through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing for several times to obtain the first feature map. After the first feature map is upsampled, it is sequentially subjected to multi-scale feature processing and channel space attention processing to obtain a first multi-scale feature map; after repeated upsampling, it is sequentially subjected to multi-scale feature processing and channel space attention processing for several times to obtain a second feature map; After the second feature map is upsampled, the category of each pixel is predicted, and the category of the pixel is healthy or diseased; According to the predicted pixel category, the lesion area is marked to obtain a second segmented image; S3: According to the second segmented image, the proportion of the diseased spot area to the leaf area is calculated to obtain the severity of the disease.
[0006] In step S2, after upsampling, multi-scale feature processing and channel space attention processing are performed in sequence, and the operations are as follows: The upsampled feature maps are fused after 1×1 convolution and 3×3 convolution respectively. The fused feature maps are processed by batch normalization, ReLU activation function, channel attention, and spatial attention in turn to obtain multi-scale feature maps.
[0007] In step S2, the operations are as follows: The feature map to be processed is processed by 1×1 convolution, batch normalization, and Swish activation function in sequence, and then by depthwise separable convolution, batch normalization, and Swish activation function. The obtained feature map is processed by efficient channel attention to obtain the attention feature map. The attention feature map is processed by point convolution, batch normalization, and spatial attention in sequence to obtain the processed feature map.
[0008] In step S2, after the first feature map is upsampled, it is sequentially subjected to multi-scale feature processing and channel space attention processing to obtain a first multi-scale feature map; after repeated upsampling, it is sequentially subjected to multi-scale feature processing and channel space attention processing operations for several times to obtain a second feature map, specifically: After the first feature map is upsampled, it is processed by multi-scale features and channel space attention in sequence to obtain a first multi-scale feature map; After the first multi-scale feature map is upsampled, it is processed by multi-scale feature processing and channel space attention processing in sequence to obtain a second multi-scale feature map; After the second multi-scale feature map is upsampled, it is processed by multi-scale feature processing and channel space attention processing in sequence to obtain a third multi-scale feature map; After the third multi-scale feature map is upsampled, it undergoes multi-scale feature processing and channel space attention processing in sequence to obtain the second feature map.
[0009] In step S2, the first segmented image is sequentially processed by depth-separable convolution, efficient channel attention processing, point convolution, and spatial attention processing, and the feature map after spatial attention processing is repeatedly processed by depth-separable convolution, efficient channel attention processing, point convolution, and spatial attention processing for several times to obtain a first feature map, specifically: The first segmented image is processed sequentially through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain a first processed feature map; The feature map after the first processing is processed in sequence through depth-wise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain the feature map after the second processing; The feature map after the second processing is processed in sequence through depth-wise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain the feature map after the third processing; The feature map after the third processing is processed in sequence through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain a feature map after the fourth processing; The feature map after the fourth processing is processed in sequence through depth-wise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain the first feature map.
[0010] In step S1, the background of the image of the grape downy mildew leaf to be inspected is removed according to the mask image to obtain a first segmented image, specifically: The size of the mask image is adjusted to be consistent with the size of the image of the grape downy mildew leaf to be tested; the image of the grape downy mildew leaf to be tested is read in color and the mask image is read in grayscale respectively, and the read data is converted from the NumPy array to a PyTorch tensor to obtain the leaf image tensor and the mask image tensor; The mask image tensor is binarized and converted into a mask image with only 0 and 1; The mask image after binary processing is multiplied by the leaf image tensor pixel by pixel, and the background of the image of the grape downy mildew leaf to be inspected is removed to obtain the first segmented image.
[0011] In step S2, after the second feature map is upsampled, the category of each pixel is predicted, specifically: The second feature map is upsampled by bilinear interpolation, and the features of each pixel are mapped to the category space through a 1×1 convolution to generate the corresponding category prediction score. The category prediction score of each pixel is processed by the Softmax function and converted into a probability distribution. The category with the highest probability is used as the predicted category of the pixel.
[0012] The detection method is implemented based on a prediction model, and the prediction model is trained using semi-supervised learning.
[0013] The present invention also provides a grape downy mildew leaf disease severity detection system, comprising: Leaf and background segmentation module: used to obtain the image of grape downy mildew leaves to be tested, extract image features through efficient channel attention processing, and predict the category of each pixel after the extracted features are processed by dilated convolution. The category of the pixel is background or leaf; According to the predicted pixel category, the leaf area is marked to obtain a mask image; According to the mask image, the background of the image of the grape downy mildew leaf to be inspected is removed to obtain a first segmented image; Healthy and diseased spot segmentation module: used for the first segmented image to pass through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing in sequence. The feature map after spatial attention processing is repeatedly passed through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing several times to obtain the first feature map; After the first feature map is upsampled, it is sequentially subjected to multi-scale feature processing and channel space attention processing to obtain a first multi-scale feature map; after repeated upsampling, it is sequentially subjected to multi-scale feature processing and channel space attention processing for several times to obtain a second feature map; After the second feature map is upsampled, the category of each pixel is predicted, and the category of the pixel is healthy or diseased; According to the predicted pixel category, the lesion area is marked to obtain a second segmented image; Morbidity detection module: used to calculate the proportion of the diseased area to the leaf area based on the second segmented image, and obtain the severity of the disease.
[0014] The healthy and diseased spot segmentation module also includes a multi-scale feature map module, which is used to fuse the upsampled feature maps after 1×1 convolution and 3×3 convolution respectively, and the fused feature maps are sequentially subjected to batch normalization processing, ReLU activation function processing, channel attention processing, and spatial attention processing to obtain a multi-scale feature map.
[0015] Beneficial Effects The present invention adopts two segmentations. First, the image of grape downy mildew leaves to be inspected is used to predict the category of each pixel through efficient channel attention processing and hole convolution processing to obtain a mask image, and the background and leaves are segmented by using the mask image; the first segmented image is subjected to efficient channel attention and spatial attention to extract features; when upsampling, multi-scale feature extraction is combined with 1×1 convolution and 3×3 convolution to perform cross-layer feature fusion. At the same time, channel attention processing and spatial attention processing are combined to strengthen the attention to the diseased area, so that the healthy area and the diseased area on the leaves of the first segmented image are segmented, thereby obtaining disease severity information and improving prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a schematic diagram of the correlation between the disease severity obtained using the detection method of the present application and the actual disease severity. DETAILED DESCRIPTION
[0017] The following examples are intended to illustrate the present invention rather than to further limit the present invention.
[0018] The present invention provides a method for detecting the severity of grape downy mildew leaf disease, comprising the following steps: S1: Obtain an image of grape downy mildew leaves to be inspected, extract image features through efficient channel attention processing, and predict the category of each pixel after the extracted features are processed by dilated convolution, where the category of the pixel is background or leaf; According to the predicted pixel category, the leaf area is marked to obtain a mask image; The background of the image of the grape downy mildew leaf to be inspected is removed according to the mask image to obtain a first segmented image.
[0019] In step S1, efficient channel attention (ECA) is used to extract image features to capture contextual information of different scales.
[0020] Furthermore, the extracted features are processed through dilated convolution to capture a larger receptive field, thereby accurately predicting the category of each pixel.
[0021] When marking the leaf area, it is usually represented in binary format, with the leaf area being 1 and other areas being 0, so as to distinguish the background area from the leaf area.
[0022] In order to separate the background of the image of the grape downy mildew leaf to be inspected from the leaf, preferably, the background of the image of the grape downy mildew leaf to be inspected is removed according to the mask image to obtain a first segmented image, specifically: The size of the mask image is adjusted to be consistent with the size of the image of the grape downy mildew leaf to be tested; the image of the grape downy mildew leaf to be tested is read in color and the mask image is read in grayscale respectively, and the read data is converted from the NumPy array to a PyTorch tensor to obtain the leaf image tensor and the mask image tensor; The mask image tensor is binarized and converted into a mask image with only 0 and 1; The mask image after binary processing is multiplied by the leaf image tensor pixel by pixel, and the background of the image of the grape downy mildew leaf to be inspected is removed to obtain the first segmented image.
[0023] The first segmented image obtained in step S1 well separates the background and leaves of the image of the grape downy mildew leaf to be inspected.
[0024] S2: The first segmented image is processed sequentially through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing. The feature map after spatial attention processing is repeatedly processed sequentially through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing for several times to obtain the first feature map. After the first feature map is upsampled, it is sequentially subjected to multi-scale feature processing and channel space attention processing to obtain a first multi-scale feature map; after repeated upsampling, it is sequentially subjected to multi-scale feature processing and channel space attention processing for several times to obtain a second feature map; After the second feature map is upsampled, the category of each pixel is predicted, and the category of the pixel is healthy or diseased; According to the predicted pixel category, the lesion area is marked to obtain a second segmented image.
[0025] In order to segment the diseased area in the leaf, it is necessary to extract features and perform upsampling on the first segmented image.
[0026] First, the first segmented image is downsampled, the resolution is gradually reduced, and the number of channels is increased. Preferably, the first segmented image is sequentially processed by depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing, and the feature map after spatial attention processing is repeatedly processed by depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing for several times to obtain a first feature map, which can be, for example: The first segmented image is processed sequentially through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain a first processed feature map; The feature map after the first processing is processed in sequence through depth-wise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain the feature map after the second processing; The feature map after the second processing is processed in sequence through depth-wise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain the feature map after the third processing; The feature map after the third processing is processed in sequence through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain a feature map after the fourth processing; The feature map after the fourth processing is processed in sequence through depth-wise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain the first feature map.
[0027] The above feature extraction goes through five stages in total, and the extraction captures the global and local information of the first segmented image. By combining efficient channel attention and spatial attention, the focus on the key information areas and important feature channels of the image is enhanced. Efficient channel attention weights different feature channels to ensure that the most discriminative features are learned. Spatial attention improves segmentation accuracy by adaptively focusing on relevant areas in the image and suppressing the influence of irrelevant areas.
[0028] Furthermore, during the downsampling process, depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing are performed in sequence. The operations are as follows: The feature map to be processed is processed by 1×1 convolution, batch normalization, and Swish activation function in sequence, and then by depthwise separable convolution, batch normalization, and Swish activation function. The obtained feature map is processed by efficient channel attention to obtain the attention feature map. The attention feature map is processed by point convolution, batch normalization, and spatial attention in sequence to obtain the processed feature map.
[0029] The present invention adaptively adjusts the importance of channel features of the feature map to be processed through efficient channel attention processing, accurately captures the correlation between channels, and improves the expression ability. Then, through spatial attention processing, according to the spatial distribution information of the input feature map, the features of the key areas are dynamically enhanced and the unimportant areas are suppressed, thereby improving the learning ability of spatial features. Through the collaborative work of efficient channel attention processing and spatial attention processing, it is possible to more effectively focus on valuable information and avoid the interference of redundant features.
[0030] In image segmentation tasks, the present invention can effectively improve the accuracy of segmentation results and the ability to restore details while maintaining high computational efficiency.
[0031] Then, the first feature map is upsampled to achieve feature fusion and gradually restore the resolution. Preferably, after the first feature map is upsampled, it is sequentially subjected to multi-scale feature processing and channel space attention processing to obtain a first multi-scale feature map; after repeated upsampling, it is sequentially subjected to multi-scale feature processing and channel space attention processing operations for several times to obtain a second feature map, which may be, for example: After the first feature map is upsampled, it is processed by multi-scale features and channel space attention in sequence to obtain a first multi-scale feature map; After the first multi-scale feature map is upsampled, it is processed by multi-scale feature processing and channel space attention processing in sequence to obtain a second multi-scale feature map; After the second multi-scale feature map is upsampled, it is processed by multi-scale feature processing and channel space attention processing in sequence to obtain a third multi-scale feature map; After the third multi-scale feature map is upsampled, it undergoes multi-scale feature processing and channel space attention processing in sequence to obtain the second feature map.
[0032] The above process gradually restores the resolution through four steps and fuses the extracted deep and shallow feature maps to achieve effective fusion of global and local information.
[0033] Furthermore, after upsampling, multi-scale feature processing and channel space attention processing are performed in sequence, and the operations are as follows: The upsampled feature maps are fused after 1×1 convolution and 3×3 convolution respectively. The fused feature maps are processed by batch normalization, ReLU activation function, channel attention, and spatial attention in turn to obtain multi-scale feature maps.
[0034] The present invention combines multi-scale feature extraction of 1×1 convolution and 3×3 convolution to perform cross-layer feature fusion when restoring the resolution at each step. At the same time, it combines channel attention processing and spatial attention processing to strengthen the attention on the lesion area and enhance the feature expression ability of the lesion area.
[0035] Finally, in step S2, after the second feature map is upsampled, the category of each pixel is predicted, specifically: The second feature map is upsampled by bilinear interpolation, and the features of each pixel are mapped to the category space through a 1×1 convolution to generate the corresponding category prediction score. The category prediction score of each pixel is processed by the Softmax function and converted into a probability distribution. The category with the highest probability is used as the predicted category of the pixel.
[0036] The second feature map is upsampled by bilinear interpolation and 1×1 convolution to ensure that the output feature map is consistent with the input image size and generate a segmentation result. The segmentation result can well distinguish the healthy area from the diseased area on the leaf.
[0037] Regarding generating segmentation results, specifically: Since each pixel on the leaf has a probability of being predicted as healthy or diseased, the class with the highest probability is taken as the predicted class for that pixel.
[0038] In this way, each pixel on the leaf is classified into a healthy or diseased category. For example, category values 1 and 2 are used to represent the diseased and healthy categories respectively, and different categories are marked with different colors. For example, pixels in the diseased area are marked red, and pixels in the healthy area are marked green. All red pixels on the leaf constitute the diseased area, and all green pixels constitute the healthy area, thereby clearly marking the diseased area and healthy area on the leaf.
[0039] The second segmented image obtained in step S2 well separates the diseased spots of the image of the grape downy mildew leaf to be inspected from the leaf.
[0040] S3: According to the second segmented image, the proportion of the diseased spot area to the leaf area is calculated to obtain the severity of the disease.
[0041] Specifically, the proportion of the diseased area in the sum of the diseased area and the healthy area is calculated, which can be the proportion of all red pixels in the sum of the red pixels and the green pixels, to obtain the severity of the disease.
[0042] The present invention adopts two segmentations. First, the image of grape downy mildew leaves to be inspected is used to predict the category of each pixel through efficient channel attention processing and hole convolution processing to obtain a mask image, and the background and leaves are segmented by using the mask image; the first segmented image is subjected to efficient channel attention and spatial attention to extract features; when upsampling, multi-scale feature extraction is combined with 1×1 convolution and 3×3 convolution to perform cross-layer feature fusion. At the same time, channel attention processing and spatial attention processing are combined to strengthen the attention to the diseased area, so that the healthy area and the diseased area on the leaves of the first segmented image are segmented, thereby obtaining disease severity information and improving prediction accuracy.
[0043] The present invention also provides a grape downy mildew leaf disease severity detection system, comprising: Leaf and background segmentation module: used to obtain the image of grape downy mildew leaves to be tested, extract image features through efficient channel attention processing, and predict the category of each pixel after the extracted features are processed by dilated convolution. The category of the pixel is background or leaf; According to the predicted pixel category, the leaf area is marked to obtain a mask image; According to the mask image, the background of the image of the grape downy mildew leaf to be inspected is removed to obtain a first segmented image; Healthy and diseased spot segmentation module: used for the first segmented image to pass through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing in sequence. The feature map after spatial attention processing is repeatedly passed through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing several times to obtain the first feature map; After the first feature map is upsampled, it is sequentially subjected to multi-scale feature processing and channel space attention processing to obtain a first multi-scale feature map; after repeated upsampling, it is sequentially subjected to multi-scale feature processing and channel space attention processing for several times to obtain a second feature map; After the second feature map is upsampled, the category of each pixel is predicted, and the category of the pixel is healthy or diseased; According to the predicted pixel category, the lesion area is marked to obtain a second segmented image; Morbidity detection module: used to calculate the proportion of the diseased area to the leaf area based on the second segmented image, and obtain the severity of the disease.
[0044] Furthermore, the healthy and diseased spot segmentation module also includes a multi-scale feature map module, which is used to fuse the upsampled feature maps after 1×1 convolution and 3×3 convolution respectively, and the fused feature maps are sequentially subjected to batch normalization processing, ReLU activation function processing, channel attention processing, and spatial attention processing to obtain a multi-scale feature map.
[0045] Experimental Evaluation The present application method is implemented based on a pre-built prediction model. In order to ensure the prediction accuracy, the prediction model is trained using semi-supervised learning so that the average confidence of the prediction category reaches the preset standard. The ratio of the training test data set and the semi-supervised data set is set to 1:20. Among them, the training test data set is a data set of 700 labeled grape downy mildew leaves; the semi-supervised data set is 14,000 unlabeled grape downy mildew leaf data.
[0046] Because there are many unlabeled data sets used for semi-supervised learning, after 10 rounds of training, the model selects the best model currently trained to predict the pictures, and then calculates the confidence of the healthy category and the diseased category of each picture. According to the confidence of the prediction results, the confidence of the prediction of the healthy category is set to be greater than 99%, and the confidence of the prediction of the diseased category is set to be greater than 85%. Then, the confidence can enter the training set and participate in the next round of training. Specifically, the average confidence of each category (healthy, diseased) is calculated as follows: Step 1, according to the formula: , calculate the confidence of each pixel; In the formula, Pixel The confidence level of the pixel The probability value of belonging to the predicted category is given by the class with the largest predicted category probability get.
[0047] Step 2, according to the formula: , calculate the number of pixels of the predicted category; In the formula, Indicates the category For The number of pixels; Indicates that the pixel The predicted category is category The number of pixels is accumulated.
[0048] Step 3, according to the formula: , calculate the average confidence of each category; In the formula, The average confidence for each category, which represents the average level of prediction confidence of all pixels in that category; Pixel confidence level; Indicates the category For The number of pixels; Indicates that it is predicted as a category A collection of pixels.
[0049] The detection method of this application is used for detection, such as Figure 1 As shown. The Y axis is the predicted disease severity, and the X axis is the actual disease severity. The blue points intuitively show the difference between the predicted disease severity and the actual disease severity. The overall distribution of the points reflects the prediction accuracy. The red dotted line of y=x represents the fitting dotted line of the actual disease severity. Most of the data points are distributed near the red dotted line of y=x, indicating that there is a high linear correlation between the predicted disease severity and the actual disease severity, which shows that the prediction result is consistent with the actual situation. And the high determination coefficient value (R 2 ) further proved that the prediction accuracy was high and could well reflect the actual severity of the disease.
Claims
1. A method for detecting the severity of grape downy mildew leaf disease, characterized in that: The following steps are involved: S1: Obtain an image of grape downy mildew leaves to be inspected, extract image features through efficient channel attention processing, and predict the category of each pixel after the extracted features are processed by dilated convolution, where the category of the pixel is background or leaf; According to the predicted pixel category, the leaf area is marked to obtain a mask image; According to the mask image, the background of the image of the grape downy mildew leaf to be inspected is removed to obtain a first segmented image; S2: The first segmented image is processed sequentially through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing. The feature map after spatial attention processing is repeatedly processed sequentially through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing for several times to obtain the first feature map. After the first feature map is upsampled, it is sequentially subjected to multi-scale feature processing and channel space attention processing to obtain a first multi-scale feature map; after repeated upsampling, it is sequentially subjected to multi-scale feature processing and channel space attention processing for several times to obtain a second feature map; After the second feature map is upsampled, the category of each pixel is predicted, and the category of the pixel is healthy or diseased; According to the predicted pixel category, the lesion area is marked to obtain a second segmented image; S3: According to the second segmented image, the proportion of the diseased spot area to the leaf area is calculated to obtain the severity of the disease.
2. The method for detecting the severity of grape downy mildew leaf disease according to claim 1, characterized in that: In step S2, after upsampling, multi-scale feature processing and channel space attention processing are performed in sequence, and the operations are as follows: The upsampled feature maps are fused after 1×1 convolution and 3×3 convolution respectively. The fused feature maps are processed by batch normalization, ReLU activation function, channel attention, and spatial attention in turn to obtain multi-scale feature maps.
3. The method for detecting the severity of grape downy mildew leaf disease according to claim 1, characterized in that: In step S2, the operations are as follows: The feature map to be processed is processed by 1×1 convolution, batch normalization, and Swish activation function in sequence, and then by depthwise separable convolution, batch normalization, and Swish activation function. The obtained feature map is processed by efficient channel attention to obtain the attention feature map. The attention feature map is processed by point convolution, batch normalization, and spatial attention in sequence to obtain the processed feature map.
4. The method for detecting the severity of grape downy mildew leaf disease according to claim 1, characterized in that: In step S2, after the first feature map is upsampled, it is sequentially subjected to multi-scale feature processing and channel space attention processing to obtain a first multi-scale feature map; after repeated upsampling, it is sequentially subjected to multi-scale feature processing and channel space attention processing operations for several times to obtain a second feature map, specifically: After the first feature map is upsampled, it is processed by multi-scale features and channel space attention in sequence to obtain a first multi-scale feature map; After the first multi-scale feature map is upsampled, it is processed by multi-scale feature processing and channel space attention processing in sequence to obtain a second multi-scale feature map; After the second multi-scale feature map is upsampled, it is processed by multi-scale feature processing and channel space attention processing in sequence to obtain a third multi-scale feature map; After the third multi-scale feature map is upsampled, it undergoes multi-scale feature processing and channel space attention processing in sequence to obtain the second feature map.
5. The method for detecting the severity of grape downy mildew leaf disease according to claim 1, characterized in that: In step S2, the first segmented image is sequentially processed by depth-separable convolution, efficient channel attention processing, point convolution, and spatial attention processing, and the feature map after spatial attention processing is repeatedly processed by depth-separable convolution, efficient channel attention processing, point convolution, and spatial attention processing for several times to obtain a first feature map, specifically: The first segmented image is processed sequentially through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain a first processed feature map; The feature map after the first processing is processed in sequence through depth-wise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain the feature map after the second processing; The feature map after the second processing is processed in sequence through depth-wise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain the feature map after the third processing; The feature map after the third processing is processed in sequence through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain a feature map after the fourth processing; The feature map after the fourth processing is processed in sequence through depth-wise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing to obtain the first feature map.
6. The method for detecting the severity of grape downy mildew leaf disease according to claim 1, characterized in that: In step S1, the background of the image of the grape downy mildew leaf to be inspected is removed according to the mask image to obtain a first segmented image, specifically: The size of the mask image is adjusted to be consistent with the size of the image of the grape downy mildew leaf to be tested; the image of the grape downy mildew leaf to be tested is read in color and the mask image is read in grayscale respectively, and the read data is converted from the NumPy array to a PyTorch tensor to obtain the leaf image tensor and the mask image tensor; The mask image tensor is binarized and converted into a mask image with only 0 and 1; The mask image after binary processing is multiplied by the leaf image tensor pixel by pixel, and the background of the image of the grape downy mildew leaf to be inspected is removed to obtain the first segmented image.
7. The method for detecting the severity of grape downy mildew leaf disease according to claim 1, characterized in that: In step S2, after the second feature map is upsampled, the category of each pixel is predicted, specifically: The second feature map is upsampled by bilinear interpolation, and the features of each pixel are mapped to the category space through a 1×1 convolution to generate the corresponding category prediction score. The category prediction score of each pixel is processed by the Softmax function and converted into a probability distribution. The category with the highest probability is used as the predicted category of the pixel.
8. The method for detecting the severity of grape downy mildew leaf disease according to any one of claims 1 to 7, characterized in that: The detection method is implemented based on a prediction model, and the prediction model is trained using semi-supervised learning.
9. A grape downy mildew leaf disease severity detection system, characterized in that: include: Leaf and background segmentation module: used to obtain the image of grape downy mildew leaves to be tested, extract image features through efficient channel attention processing, and predict the category of each pixel after the extracted features are processed by dilated convolution. The category of the pixel is background or leaf; According to the predicted pixel category, the leaf area is marked to obtain a mask image; According to the mask image, the background of the image of the grape downy mildew leaf to be inspected is removed to obtain a first segmented image; Healthy and diseased spot segmentation module: used for the first segmented image to pass through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing in sequence. The feature map after spatial attention processing is repeatedly passed through depthwise separable convolution, efficient channel attention processing, point convolution, and spatial attention processing several times to obtain the first feature map; After the first feature map is upsampled, it is sequentially subjected to multi-scale feature processing and channel space attention processing to obtain a first multi-scale feature map; after repeated upsampling, it is sequentially subjected to multi-scale feature processing and channel space attention processing for several times to obtain a second feature map; After the second feature map is upsampled, the category of each pixel is predicted, and the category of the pixel is healthy or diseased; According to the predicted pixel category, the lesion area is marked to obtain a second segmented image; Morbidity detection module: used to calculate the proportion of the diseased area to the leaf area based on the second segmented image, and obtain the severity of the disease.
10. The grape downy mildew leaf disease severity detection system according to claim 9, characterized in that: The healthy and diseased spot segmentation module also includes a multi-scale feature map module, which is used to fuse the upsampled feature maps after 1×1 convolution and 3×3 convolution respectively, and the fused feature maps are sequentially subjected to batch normalization processing, ReLU activation function processing, channel attention processing, and spatial attention processing to obtain a multi-scale feature map.