Grape Disease Identification Method, Device, Electronic Device and Storage Medium

Through the combination of multi-scale feature fusion, inverted residual and attention mechanism modules, the parameters and accuracy problems of grape disease image recognition in complex natural environments are solved, and the recognition accuracy is improved while reducing the parameter quantity.

CN114494828BActive Publication Date: 2025-07-18CHINA AGRI UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210045022.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-14
Publication Date
2025-07-18
Estimated Expiration
2042-01-14

AI Technical Summary

Technical Problem

When the prior art recognizes grape disease images in complex natural environments, it is impossible to ensure that the number of parameters is small and the recognition accuracy is high.

Method used

The disease recognition model consisting of a multi-scale feature fusion module, an inverted residual module, an attention mechanism module and a pooling layer is adopted. The multi-scale feature fusion module extracts the multi-scale features of the disease image, the inverted residual module reduces the amount of parameters and increases the network depth, and the attention mechanism module enhances the ability to extract key disease features.

Benefits of technology

On the premise of reducing the amount of parameters, the accuracy of grape disease recognition is improved, the model's ability to extract disease characteristics in complex backgrounds is enhanced, and the influence of irrelevant information is suppressed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494828B_ABST
    Figure CN114494828B_ABST
Patent Text Reader

Abstract

The present invention provides a grape disease recognition method, device, electronic device and storage medium. The grape disease recognition method includes: obtaining a grape leaf disease image data set; training a disease recognition model based on the grape leaf disease image data set; obtaining a grape disease image to be recognized, and inputting the grape disease image to be recognized into the disease recognition model to obtain a grape disease recognition result; wherein, the disease recognition model includes: a multi-scale feature fusion module, an inverted residual module, an attention mechanism module, a pooling layer and a classifier module. The grape disease recognition method, device, electronic device and storage medium provided by the present invention can solve the defect in the prior art that when recognizing disease images in a complex natural environment, it is impossible to ensure both a small number of parameters and a high recognition accuracy, and realize ensuring a high recognition accuracy while reducing the number of parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of disease identification, and particularly to a method, device, electronic device and storage medium for identifying grape diseases. Background Art

[0002] Grapes are one of the oldest fruit tree species in the world. It is a crop widely planted around the world and has rich nutritional value, medicinal value and economic value, etc. Therefore, the yield and quality of grapes have an important impact on human life. However, every year, crops including grapes are severely damaged in yield due to the invasion of diseases. In addition, most of the traditional methods for identifying crop diseases rely on manual observation and empirical judgment or rely on specific experimental analysis in the laboratory to identify the types of diseases. This is obviously a very inefficient and complex operation method, which is difficult to meet the needs of actual agricultural production. Therefore, researching the intelligent identification of crop diseases will have very important significance.

[0003] Existing technical solutions have proposed a disease identification model based on a deep convolutional neural network. Although certain progress has been made in the field of plant disease identification, the classic convolutional neural network model still has problems of a large number of model parameters and a large amount of computation; although the number of parameters and the amount of computation of the lightweight convolutional neural network model have been greatly reduced, when dealing with disease images in a natural complex environment, its recognition accuracy is still relatively low. Summary of the Invention

[0004] The present invention provides a method, device, electronic device and storage medium for identifying grape diseases, which are used to solve the defect in the prior art that when identifying disease images in a complex natural environment, it is impossible to simultaneously ensure a small number of parameters and a high recognition accuracy, and to achieve a high recognition accuracy while reducing the number of parameters.

[0005] The present invention provides a method for identifying grape diseases, including:

[0006] Obtaining a grape leaf disease image dataset;

[0007] Training a disease recognition model based on the grape leaf disease image dataset;

[0008] Obtaining a grape disease image to be recognized, and inputting the grape disease image to be recognized into the disease recognition model to obtain a grape disease recognition result;

[0009] Wherein, the disease recognition model includes: a multi-scale feature fusion module, an inverted residual module, an attention mechanism module, a pooling layer and a classifier module.

[0010] According to the grape disease recognition method provided by the present invention, the pooling layer includes a max-pooling layer and an average-pooling layer.

[0011] According to the grape disease recognition method provided by the present invention, the multi-scale feature fusion module includes multiple branches and a conventional convolutional layer connected to the output ends of the multiple branches;

[0012] Among them, each branch includes a global average pooling layer, a conventional convolutional layer, and an atrous convolutional layer.

[0013] According to the grape disease recognition method provided by the present invention, the inverted residual module includes a conventional convolutional layer, a depth convolutional layer, and a point convolutional layer.

[0014] According to the grape disease recognition method provided by the present invention, the attention mechanism module includes:

[0015] A feature transformation layer for converting the feature map output by the inverted residual module into a target feature map;

[0016] A compression encoding layer for compressing and encoding the target feature map to obtain a global feature;

[0017] A fully connected layer for activating the global feature to obtain the importance value of the corresponding channel of the target feature map;

[0018] A reconstruction layer for weighting the channel space of the target feature map based on the importance value of the corresponding channel of the target feature map and then outputting.

[0019] According to the grape disease recognition method provided by the present invention, the acquisition of the grape leaf disease image dataset includes:

[0020] Obtaining an initial dataset; wherein the initial dataset includes various types of grape leaf disease image data;

[0021] Performing random rotation, horizontal flipping, or vertical flipping on the initial dataset to expand the data of the initial dataset and obtain the grape leaf disease image dataset.

[0022] The present invention also provides a grape disease recognition device, including:

[0023] An acquisition module for acquiring a grape leaf disease image dataset;

[0024] A training module for training a disease recognition model based on the grape leaf disease image dataset;

[0025] An identification module, configured to obtain an image of a grape disease to be identified, and input the image of the grape disease to be identified into the disease identification model to obtain a grape disease identification result;

[0026] Wherein, the disease identification model includes: a multi-scale feature fusion module, an inverted residual module, an attention mechanism module, a pooling layer, and a classifier module.

[0027] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of any of the above-mentioned grape disease identification methods are implemented.

[0028] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned grape disease identification methods are implemented.

[0029] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned grape disease identification methods are implemented.

[0030] The grape disease identification method, device, electronic device, and storage medium provided by the present invention can reduce the parameters and costs of the network model through the inverted residual module in the disease identification model, and can also increase the depth of the network model and improve the non-linear representation ability of the model. In addition, by extracting and fusing multi-scale features of the disease image through the multi-scale feature fusion module, the recognition accuracy of the model for different diseases is improved. Moreover, the attention mechanism module embedded in the disease identification model enhances the ability of the model to extract key disease features from images with complex backgrounds and suppresses other irrelevant information, thereby further improving the average recognition accuracy of the model.

[0031] Therefore, the grape disease identification method provided by the present invention can solve the defect in the prior art that it is impossible to simultaneously ensure a small number of parameters and a high recognition accuracy when identifying disease images in a complex natural environment, and can achieve a high recognition accuracy while reducing the number of parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0033] Figure 1It is a schematic flow diagram of the grape disease recognition method provided by the present invention;

[0034] Figure 2 It is a schematic diagram of the multi-scale feature fusion module provided by the present invention;

[0035] Figure 3 It is one of the schematic diagrams of the inverted residual module provided by the present invention;

[0036] Figure 4 It is another schematic diagram of the inverted residual module provided by the present invention;

[0037] Figure 5 It is a schematic diagram of the attention mechanism module provided by the present invention;

[0038] Figure 6 It is a schematic diagram of the disease recognition model provided by the present invention;

[0039] Figure 7 It is a schematic structural diagram of the grape disease recognition device provided by the present invention;

[0040] Figure 8 It is a schematic structural diagram of the electronic device provided by the present invention. Detailed implementation manners

[0041] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts shall fall within the protection scope of the present invention.

[0042] The following will be combined with Figures 1 - 8 Describe the grape disease recognition method, device, electronic device and storage medium of the present invention.

[0043] The present invention provides a grape disease recognition method, including:

[0044] Step 110, obtain a grape leaf disease image dataset.

[0045] It can be understood that the grape leaf disease image dataset may include: anthracnose images, brown spot images, downy mildew images, and healthy grape leaf images.

[0046] Step 120, train a disease recognition model based on the grape leaf disease image dataset.

[0047] It can be understood that, based on the grape leaf disease image dataset, a preset neural network is trained to obtain a disease recognition model, namely the GrapeNet model.

[0048] Step 130: Obtain a grape disease image to be recognized, and input the grape disease image to be recognized into the disease recognition model to obtain a grape disease recognition result.

[0049] Among them, the disease recognition model includes: a multi-scale feature fusion (Multi-scale Residual Atrous Convolution, MRAC) module, an inverted residual module, an attention mechanism module (Squeeze-and-Excitation Networks, SENet), a pooling layer, and a classifier module.

[0050] It can be understood that the receptive field of the high-level network is relatively large, and its semantic information representation ability is strong, but the resolution of the feature map is low, and the geometric information representation ability is weak (lack of spatial geometric feature details); the receptive field of the low-level network is relatively small, and its geometric detail information representation ability is strong. Although the resolution is high, the semantic information representation ability is weak. The high-level semantic information can accurately detect or segment the target. Therefore, in deep learning, adding all these features together is very effective for detection and segmentation, and this process is the multi-scale feature fusion process.

[0051] In some embodiments, the pooling layer includes: a max pooling layer and an average pooling layer.

[0052] In some embodiments, the multi-scale feature fusion module includes: multiple branches, and a conventional convolutional layer connected to the output ends of the multiple branches;

[0053] Among them, each branch includes: a global average pooling layer, a conventional convolutional layer, and an atrous convolutional layer. The convolutional layer in this embodiment includes a convolutional function, a regularization function, and an activation function.

[0054] It can be understood that since the grape leaf disease images collected in a natural complex environment often contain more noise and the image background is relatively complex, the difficulty of grape leaf disease recognition is greater. Therefore, the present invention adds a multi-scale feature fusion module to extract as many key features of the disease as possible in different receptive fields and multi-scale spaces.

[0055] The structure of the multi-scale feature fusion module is as Figure 2As shown in the figure. In this multi-scale feature fusion module, the input feature map passes through a global average pooling layer, a 1×1 convolutional layer, and 3×3 dilated convolutional layers with dilation rates of 1, 2, and 3 respectively. Five branches are processed in parallel to obtain richer feature information of the disease image. Then, the feature maps obtained by convolving each branch are merged into a new feature map, and a 1×1 convolution is used to perform feature fusion on the new feature map. At the same time, if the shape of the input feature map is the same as that of the output feature map, then through a residual (shortcut) connection, the input and output feature maps are added together, so that the shallow features are fused with the deep feature maps. The residual connection improves the ability of gradient cross-layer propagation and can reduce the situation of gradient disappearance in the deep convolutional layer to a certain extent.

[0056] Therefore, compared with the existing classic convolutional neural network (CNN) model, embedding a multi-scale feature fusion module in the disease recognition model proposed in the present invention can capture multi-scale disease information, so that for disease images with complex backgrounds, more discriminative disease feature information can be obtained, which helps to more accurately identify grape leaf diseases. At the same time, the multi-scale feature fusion module proposed in the present invention can be flexibly embedded into other deep neural network models for image recognition, extract multi-scale information of the image, and perform feature fusion, so that the performance of the model is greatly improved.

[0057] In some embodiments, the inverted residual module includes: a conventional convolutional layer, a depth convolutional layer, and a point convolutional layer.

[0058] It can be understood that in the disease recognition model provided by the present invention, an inverted residual module is used to reduce the number of parameters of the model, and its main highlight lies in depthwise separable convolution.

[0059] The structure of the inverted residual module is as Figure 3 and Figure 4 shown. It can be seen that the inverted residual module is mainly composed of ordinary convolution, depthwise convolution, and pointwise convolution. When the input feature map enters the inverted residual module, first, an ordinary convolution with a kernel size of 1×1 is used for dimension increase operation, then the depthwise convolution extracts the depth features of the feature map, and the number of channels of the feature map does not change. Finally, the pointwise convolution is used to perform dimension reduction operation on the feature map.

[0060] At the same time, when the stride in the depthwise convolution = 1, that is, the shapes of the input and output feature maps are the same, then through the shortcut branch, the output feature map of the pointwise convolution and the input feature map are added together to obtain the final output feature map of the inverted residual module, as Figure 3 shown.

[0061] When the stride in the depth convolution is 2, the inverted residual module has no shortcut branch. The depth convolution performs downsampling while extracting depth features, expanding the receptive field of the network. Eventually, both the spatial dimensions H and W of the feature map output by the inverted residual module will be halved, as Figure 4 shown.

[0062] In summary, embedding the inverted residual module in the disease recognition model not only greatly reduces the number of parameters and costs of the disease recognition model, but also increases the depth of the network to a certain extent and improves the non-linear representation ability of the model. Therefore, embedding the inverted residual module in this model can greatly alleviate the problem of too large number of parameters and computational volume in the classical convolutional neural model.

[0063] In some embodiments, the attention mechanism module includes:

[0064] A feature transformation layer for converting the feature map output by the inverted residual module into a target feature map;

[0065] A compression and encoding layer for compressing and encoding the target feature map to obtain a global feature;

[0066] A fully connected layer for activating the global feature to obtain the importance value of the corresponding channel of the target feature map;

[0067] A reconstruction layer for weighting the channel space of the target feature map based on the importance value of the corresponding channel of the target feature map and then outputting.

[0068] It can be understood that the attention mechanism module is embedded in the disease recognition model provided by the present invention, enabling it to focus on the grape leaf disease area in the image and reducing the influence of complex backgrounds on disease recognition.

[0069] The attention mechanism module is a channel attention mechanism. It learns the importance of different channel features through the network and assigns different weights to different channels in turn according to different importance levels. The higher the importance of the channel features, the greater the weight assigned, and the lower the importance of the channel features, the smaller the weight assigned. The attention mechanism module is mainly divided into three steps: compression, excitation, and reconstruction, among which the first two are the most critical steps. The structure of the attention mechanism module is as Figure 5 shown.

[0070] In Figure 5 , X represents the input feature map, F tr represents the transformation process from the feature map X to the feature map U, that is, F tr : X → U, X ∈ R C1×H1×W1 , U ∈ R C×H×W, where C1, H1, and W1 represent the number of channels, height, and width of the feature map X respectively; similarly for the feature map U, where C, H, and W represent the number of channels, height, and width respectively. The convolutional kernel is K = [k1, k2,..., k c , where k1 represents the first convolutional kernel, k c represents the c-th convolutional kernel, and thus the output feature map is U = [u1, u2,..., u c , where u c 's calculation formula is as follows:

[0071]

[0072] In the formula represents a 3D convolutional kernel. When it performs a convolution operation with the original feature map, the learned channel features are the accumulated values of each channel, and this is mixed with the learned local features. The attention mechanism module is to solve this mixed channel feature relationship, so that the model can learn the feature relationships of each channel and highlight the more important channel information.

[0073] In Figure 5 , Fsq represents the compression operation of the attention mechanism module. It compresses and encodes the information of the entire space on each channel into a global feature through a global average pooling layer. As Figure 5 shown, for the feature map U with C channels, the spatial dimension of each channel H×W is compressed into a 1×1 global feature. After the Fsq operation, a feature map with the shape of C×1×1 is obtained, and the specific calculation formula is as follows.

[0074]

[0075] In Figure 5 , Fex represents the excitation operation of the attention mechanism module. Its main function is to learn the relationships between the channels of the feature map and assign different weight values to each channel according to their different importance levels. The specific implementation process of the Fex operation is to pass all the global features obtained from the Fsq operation into two fully connected layers, and then activate them with the ReLU (Rectified Linear Unit) and Sigmoid (S-shaped growth curve) activation functions respectively after the two fully connected layers, so that the model can learn the importance level of each channel of the feature map. The specific calculation formula of the Fsq operation is as follows.

[0076] s = F ex (z, W) = σ(g(z, W)) = σ(W2ReLU(W1z))

[0077] In the formula, Among them, r represents the compression ratio of the channel. In the Fex operation, in order to better learn the correlation between each channel of the feature map, when the feature map passes through the first fully connected layer, the number of neurons C is reduced by dividing by r, and then when passing through the second fully connected layer, it is upsampled to restore to the original number of neurons. Finally, after the above operations, a feature map of C×1×1 is obtained. To a certain extent, this greatly reduces the number of model parameters and computational complexity, and increases the non-linear fitting effect of the model. At the same time, since there is often a certain correlation between the channels of the feature map, the relationships learned through the network are often not mutually exclusive. To solve this phenomenon, the Fex operation uses the Sigmoid activation function after the second fully connected layer.

[0078] F scale represents the reconstruction operation, that is, the channel feature weights predicted by the attention mechanism module are weighted to each channel space of the feature map to obtain a new feature map U1. F scale The specific calculation formula is as follows.

[0079] U1 = F scale (u C , s C ) = s C ·u C

[0080] In the formula, F scale (u C , s C ) represents the channel operation between feature mappings, where u c ∈R H×W , s C represents that the weight of the c-th channel in the feature map is s.

[0081] In summary, the attention mechanism module embedded in the disease recognition model enhances the model's ability to extract key disease features from disease images in complex backgrounds and suppresses other irrelevant information, thereby further improving the recognition accuracy of the model.

[0082] In some embodiments, the obtaining of the grape leaf disease image dataset includes:

[0083] Obtaining an initial dataset; wherein, the initial dataset includes various types of grape leaf disease image data;

[0084] Performing random rotation, horizontal flipping, or vertical flipping on the initial dataset to perform data augmentation on the initial dataset to obtain the grape leaf disease image dataset.

[0085] It is understandable that, first, the grape leaf disease image data is collected, and the unusable images are excluded to establish an initial dataset of grape leaf diseases; a total of 2022 images are collected in this initial dataset, including 548 images of anthracnose, 717 images of phyllosticta leaf spot, 414 images of downy mildew, and 343 images of healthy grape leaves.

[0086] The initial dataset is divided into a training set and a test set, and the original dataset is augmented by means of random rotation, horizontal or vertical flipping, etc., so as to increase the diversity of the original data, and finally the generalization ability of the trained model is stronger.

[0087] The disease recognition model is trained with the data-augmented dataset, and the model weights with the best performance during the training process are saved.

[0088] Based on the disease recognition model trained in the above way, the images in the test set are used for testing to obtain the predicted categories of the test samples, so as to realize the recognition of grape leaf diseases.

[0089] In summary, by introducing an attention mechanism module and designing a multi-scale feature fusion module, the disease recognition model can accurately extract features from grape disease images with complex backgrounds. The overall structure of the disease recognition model is as Figure 6 shown. It can be seen from Figure 6 that the disease recognition model proposed by the present invention mainly consists of a multi-scale feature fusion module, an inverted residual module, an attention mechanism module, a max pooling layer, an average pooling layer, and a classifier module.

[0090] Among them, k represents the size of the convolutional kernel, s represents the stride of the convolutional operation, and p represents the random inactivation ratio of neurons in the neural network.

[0091] The disease recognition model first uses a multi-scale feature fusion module to extract the multi-scale feature information of the disease and obtain a rich feature representation of the image. Then it is followed by a max pooling layer for reducing the size of the image. After the max pooling layer, 3 multi-scale feature fusion modules, an inverted residual module, and an attention mechanism module are connected to increase the depth of the network with a small number of parameters, thereby improving the non-linear representation ability of the model.

[0092] The average pooling layer is used to reduce the spatial dimension of the feature map and increase the receptive field of the model. The last classifier module uses a fully connected layer and combines the softmax function to realize the classification of diseases.

[0093] The disease recognition model provided by the present invention has a relatively small number of parameters and a higher recognition accuracy for grape leaf diseases. An inverted residual module is embedded in the disease recognition model to construct a network, greatly reducing the number of model parameters and computational costs. At the same time, a multi-scale feature fusion module is adopted in the disease recognition model to extract and fuse multi-scale features of disease images, improving the recognition accuracy of the model for different diseases.

[0094] In addition, the attention mechanism module embedded in the disease recognition model enhances the model's ability to extract key disease features from images with complex backgrounds and suppresses other irrelevant information, thus further improving the average recognition accuracy of the model. Therefore, the disease recognition model provided by the present invention achieves a high recognition accuracy while maintaining a relatively small number of parameters.

[0095] In summary, the grape disease recognition method provided by the present invention includes: obtaining a grape leaf disease image dataset; training a disease recognition model based on the grape leaf disease image dataset; obtaining a grape disease image to be recognized and inputting the grape disease image to be recognized into the disease recognition model to obtain a grape disease recognition result; wherein the disease recognition model includes: a multi-scale feature fusion module, an inverted residual module, an attention mechanism module, a pooling layer, and a classifier module.

[0096] In the grape disease recognition method provided by the present invention, through the inverted residual module in the disease recognition model, the parameters and costs of the network model can be reduced, and the depth of the network model can also be increased, improving the non-linear representation ability of the model. In addition, by extracting and fusing multi-scale features of disease images through the multi-scale feature fusion module, the recognition accuracy of the model for different diseases is improved. Moreover, the attention mechanism module embedded in the disease recognition model enhances the model's ability to extract key disease features from images with complex backgrounds and suppresses other irrelevant information, thus further improving the average recognition accuracy of the model.

[0097] Therefore, the grape disease recognition method provided by the present invention can solve the defect in the prior art that it is impossible to ensure both a small number of parameters and a high recognition accuracy when recognizing disease images in a complex natural environment, and can achieve a high accuracy while reducing the number of parameters.

[0098] Next, the grape disease recognition device provided by the present invention will be described. The grape disease recognition device described below can be correspondingly referred to the grape disease recognition method described above.

[0099] As Figure 7 shown, the grape disease recognition device 700 provided by the present invention includes: an acquisition module 710, a training module 720, and an identification module 730.

[0100] The acquisition module 710 is used to acquire the grape leaf disease image dataset.

[0101] The training module 720 is used to train a disease recognition model based on the grape leaf disease image dataset.

[0102] The recognition module 730 is used to acquire the grape disease image to be recognized, and input the grape disease image to be recognized into the disease recognition model to obtain the grape disease recognition result.

[0103] Among them, the disease recognition model includes: a multi-scale feature fusion module, an inverted residual module, an attention mechanism module, a pooling layer, and a classifier module.

[0104] In some embodiments, the pooling layer includes: a max pooling layer and an average pooling layer.

[0105] In some embodiments, the multi-scale feature fusion module includes: multiple branches, and a conventional convolutional layer connected to the output ends of the multiple branches;

[0106] Among them, each branch includes: a global average pooling layer, a conventional convolutional layer, and an atrous convolutional layer.

[0107] In some embodiments, the inverted residual module includes: a conventional convolutional layer, a depth convolutional layer, and a point convolutional layer.

[0108] In some embodiments, the attention mechanism module includes:

[0109] A feature transformation layer for converting the feature map output by the inverted residual module into a target feature map;

[0110] A compression encoding layer for compressing and encoding the target feature map to obtain a global feature;

[0111] A fully connected layer for activating the global feature to obtain the importance value of the corresponding channel of the target feature map;

[0112] A reconstruction layer for weighting the channel space of the target feature map based on the importance value of the corresponding channel of the target feature map and then outputting.

[0113] In some embodiments, the acquisition module 710 includes: an acquisition unit and a processing unit.

[0114] The acquisition unit is used to acquire an initial dataset; among them, the initial dataset includes grape leaf disease image data of multiple types;

[0115] The processing unit is used to perform random rotation, horizontal flipping, or vertical flipping on the initial data set to augment the data of the initial data set and obtain the grape leaf disease image data set.

[0116] The electronic device, computer program product, and storage medium provided by the present invention will be described below. The electronic device, computer program product, and storage medium described below can be correspondingly referred to the grape disease recognition method described above.

[0117] Figure 8 An example of the schematic physical structure of an electronic device is shown in Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840. Among them, the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call the logical instructions in the memory 830 to execute the grape disease recognition method, which includes:

[0118] Step 110: Obtain a grape leaf disease image data set;

[0119] Step 120: Based on the grape leaf disease image data set, train a disease recognition model;

[0120] Step 130: Obtain a grape disease image to be recognized, and input the grape disease image to be recognized into the disease recognition model to obtain a grape disease recognition result.

[0121] In addition, when the logical instructions in the above-mentioned memory 830 are implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0122] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the grape disease recognition method provided by the above-mentioned various methods, and the method includes:

[0123] Step 110: Obtain a grape leaf disease image dataset;

[0124] Step 120: Based on the grape leaf disease image dataset, train a disease recognition model;

[0125] Step 130: Obtain a grape disease image to be recognized, and input the grape disease image to be recognized into the disease recognition model to obtain a grape disease recognition result.

[0126] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it realizes the grape disease recognition method provided by the above-mentioned various methods, and the method includes:

[0127] Step 110: Obtain a grape leaf disease image dataset;

[0128] Step 120: Based on the grape leaf disease image dataset, train a disease recognition model;

[0129] Step 130: Obtain a grape disease image to be recognized, and input the grape disease image to be recognized into the disease recognition model to obtain a grape disease recognition result.

[0130] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative labor.

[0131] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for identifying grape diseases, characterized in that, Including: Obtaining a grape leaf disease image dataset; Training a disease recognition model based on the grape leaf disease image dataset; Obtaining a grape disease image to be recognized, and inputting the grape disease image to be recognized into the disease recognition model to obtain a grape disease recognition result; Wherein, the disease recognition model includes: a multi-scale feature fusion module, an inverted residual module, an attention mechanism module, a pooling layer, and a classifier module; The multi-scale feature fusion module includes: multiple branches, and a conventional convolutional layer connected to the output ends of the multiple branches; Wherein, the multiple branches include a branch constructed based on a global average pooling layer, a conventional convolutional layer, and an upsampling layer, a branch constructed based on a conventional convolutional layer, a branch constructed based on a dilated convolutional layer with a dilation rate of 1, a branch constructed based on a dilated convolutional layer with a dilation rate of 2, and a branch constructed based on a dilated convolutional layer with a dilation rate of 3; The multi-scale feature fusion module is configured to perform parallel processing on the input feature map through each branch respectively, merge the feature maps obtained by convolution of each branch into a new feature map, and perform feature fusion on the new feature map by using the conventional convolutional layer connected to the output ends of the multiple branches. If the output feature map of the conventional convolutional layer connected to the output ends of the multiple branches is consistent with the shape of the input feature map, the output feature map is added to the input feature map by using a residual connection to obtain the output result of the multi-scale feature fusion module; The inverted residual module includes a depth convolutional layer; When the stride in the depth convolutional layer is equal to 1, the inverted residual module further includes a conventional convolutional layer and a point convolutional layer connected in series with the depth convolutional layer, and a residual branch establishing a direct connection path between the input end of the conventional convolutional layer and the output end of the point convolutional layer. The output feature map of the inverted residual module is obtained by adding the output feature map of the point convolutional layer to the input feature map of the inverted residual module through the residual branch. When the stride in the depth convolutional layer is equal to 2, the inverted residual module further includes a conventional convolutional layer and a point convolutional layer connected in series with the depth convolutional layer. The depth convolutional layer is used to extract depth features while performing downsampling operations. The spatial dimensions H and W of the output feature map of the inverted residual module are halved, and the output feature map of the inverted residual module is the output feature map of the point convolutional layer.

2. The grape disease recognition method according to claim 1, characterized in that, The pooling layer includes: a max pooling layer and an average pooling layer.

3. The grape disease recognition method according to claim 1, characterized in that, The attention mechanism module includes: A feature transformation layer for converting the feature map output by the inverted residual module into a target feature map; A compression encoding layer for performing compression encoding on the target feature map to obtain a global feature; A fully connected layer for activating the global feature to obtain the importance value of the corresponding channel of the target feature map; A reconstruction layer for outputting the channel space of the target feature map after weighting based on the importance value of the corresponding channel of the target feature map.

4. The grape disease recognition method according to any one of claims 1-3, characterized in that The obtaining of the grape leaf disease image dataset includes: Obtain an initial data set; wherein, the initial data set includes image data of various types of grape leaf diseases; Perform random rotation, horizontal flipping, or vertical flipping on the initial data set to perform data augmentation on the initial data set and obtain the grape leaf disease image data set.

5. A grape disease recognition device, characterized in that, Including: An acquisition module for acquiring a grape leaf disease image data set; A training module for training a disease recognition model based on the grape leaf disease image data set; A recognition module for acquiring a grape disease image to be recognized and inputting the grape disease image to be recognized into the disease recognition model to obtain a grape disease recognition result; Wherein, the disease recognition model includes: a multi-scale feature fusion module, an inverted residual module, an attention mechanism module, a pooling layer, and a classifier module; The multi-scale feature fusion module includes: multiple branches, and a conventional convolutional layer connected to the output ends of the multiple branches; Wherein, the multiple branches include a branch constructed based on a global average pooling layer, a conventional convolutional layer, and an upsampling layer, a branch constructed based on a conventional convolutional layer, a branch constructed based on a dilated convolutional layer with a dilation rate of 1, a branch constructed based on a dilated convolutional layer with a dilation rate of 2, and a branch constructed based on a dilated convolutional layer with a dilation rate of 3; The multi-scale feature fusion module is used to parallel-process the input feature map through each branch, merge the feature maps obtained by convolution of each branch into a new feature map, and perform feature fusion on the new feature map by using the conventional convolutional layer connected to the output ends of the multiple branches. If the output feature map of the conventional convolutional layer connected to the output ends of the multiple branches is consistent with the shape of the input feature map, then use residual connection to add the output feature map and the input feature map to obtain the output result of the multi-scale feature fusion module; The inverted residual module includes a depth convolutional layer; When the stride in the depth convolutional layer is equal to 1, the inverted residual module further includes a conventional convolutional layer and a point convolutional layer serially connected to the depth convolutional layer, and a residual branch establishing a direct connection path between the input end of the conventional convolutional layer and the output end of the point convolutional layer. The output feature map of the inverted residual module is obtained by adding the output feature map of the point convolutional layer and the input feature map of the inverted residual module through the residual branch; when the stride in the depth convolutional layer is equal to 2, the inverted residual module further includes a conventional convolutional layer and a point convolutional layer serially connected to the depth convolutional layer. The depth convolutional layer is used to extract depth features while performing downsampling operations. The spatial dimensions H and W of the output feature map of the inverted residual module are halved, and the output feature map of the inverted residual module is the output feature map of the point convolutional layer.

6. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, the steps of the grape disease recognition method according to any one of claims 1 to 4 are implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the grape disease recognition method according to any one of claims 1 to 4 are implemented.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the grape disease recognition method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Automatic identification method and system for litchi downy blight based on image identification, and storage medium

    CN113610048A