Leaf disease identification method and readable storage medium

By adopting multi -scale fusion networks and multi -branch attention mechanisms in leaf disease recognition, the characteristics of deep and superficial lesions are integrated, and the problem of lack of accuracy of the lightweight CNN model in the existing technology in the existing technology has achieved high accuracy of mobile devices and achieved high heights. Classification of accuracy and low -parameters.

CN119380200APending Publication Date: 2025-01-28QILU INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411513266.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The existing lightweight CNN model is difficult to achieve high-precision blade disease classification on mobile devices, and traditional deep convolutional networks have problems such as excessive parameter scale and insufficient feature richness in feature extraction.

Method used

Adopt a multi -scale fusion network, combine the multi -branch fusion of the attention mechanism, integrate the characteristics of deep lesions and shallow lesions, and use the feature extraction network, multi -scale fusion network and classification network to generate target fusion characteristics to achieve more accurate accurate Classification of leaf disease image.

Benefits of technology

The detection effect of small disease spots has been improved, and the high accuracy classification of various leaf disease spots is achieved, reducing the model parameters and calculation, and at the same time, it has good generalization capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119380200A_ABST
    Figure CN119380200A_ABST
Patent Text Reader

Abstract

The invention provides a leaf disease identification method and a readable storage medium, and the method comprises the steps: taking a leaf image of a to-be-detected crop as an input, and employing a feature extraction network to extract shallow scab features and deep scab features from the leaf image; receiving the shallow scab features and the deep scab features as input, and fusing the shallow scab features and the deep scab features by using a multi-scale fusion network to generate target fusion features; and receiving the target fusion feature, and obtaining a disease classification result by using a classification network. According to the method, more accurate classification of the leaf disease images is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of smart agriculture, and in particular relates to a leaf disease identification method and a readable storage medium. Background Art

[0002] The key to plant disease prevention and control is to be able to detect the disease-affected area in a timely and accurate manner and identify the type of disease. In modern smart agricultural production, leaf diseases are an important factor that directly affects plant yield and quality, and are relatively easy to detect.

[0003] With the development of computer vision and deep learning, image-based disease recognition has gradually become a research hotspot. A series of customized improved convolutional neural network (CNN) models have been applied to plant disease recognition and classification, and have achieved good results. Of course, the more accurate the classification model, the more complex its structure, such as VGG16, ResNet50, DenseNet, InceptionNet, etc. trained on ImageNet. It is still a challenge to deploy such models on mobile devices with limited computing resources such as IoT devices. However, rapid detection and recognition of crop diseases is more likely to be deployed on mobile devices to adapt to more convenient applications. However, it is difficult for existing lightweight CNN models to obtain high-precision classification results. For example, an apple disease detection model designed based on SSD (Single Shot multibox Detector) has a detection accuracy of only 83.12% when deployed on a mobile device. Therefore, how to obtain a model with higher accuracy and more suitable for mobile deployment is very important for plant disease diagnosis.

[0004] In addition, different rich features are very important for deep learning tasks. Insufficient feature extraction will affect the accuracy of image detection and classification. Traditional deep convolutional networks tend to increase the network depth and the number of filters to enrich the feature space, but this method will lead to a significant increase in the scale of network parameters. In the classification of leaf disease images, there are too many cases where the lesions of the same type of disease vary greatly in size, and the lesions of different types of diseases are highly similar. In addition, the lesions of different diseases vary in size, shape, and color, and the lesions of the same disease may show greater heterogeneity due to factors such as the environment and variety, which brings challenges to disease classification and recognition. Faced with field images with complex backgrounds, the use of traditional classification and recognition methods or pre-trained models can no longer meet actual needs. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention proposes a leaf disease recognition method, which mixes a multi-scale fusion network, combines a multi-branch fusion attention mechanism with a multi-scale fusion network to fuse the features of deep and shallow spots, so as to achieve more accurate classification of leaf disease images.

[0006] In order to achieve the above object, the present invention provides a leaf disease identification method, comprising:

[0007] Taking the leaf image of the crop to be detected as input, a feature extraction network is used to extract the shallow disease spot features and deep disease spot features from the leaf image;

[0008] Receiving the shallow lesion feature and the deep lesion feature as input, and using a multi-scale fusion network to fuse the shallow lesion feature and the deep lesion feature to generate a target fusion feature;

[0009] The target fusion feature is received, and a classification network is used to obtain a disease classification result.

[0010] In one embodiment, the feature extraction network comprises:

[0011] The first extraction module is configured with convolutional layers, batch normalization and ReLU layers, and pooling layers;

[0012] A second extraction module, connected to the output end of the first extraction module, and configured with a plurality of residual blocks;

[0013] A third extraction module, connected to the output end of the second extraction module, configured with a plurality of residual blocks and a multi-branch coordinated attention submodule connected to the output ends of the plurality of residual blocks;

[0014] The leaf image is passed through the first extraction module and the second extraction module to identify the first shallow disease spot feature;

[0015] The leaf image is passed through the first extraction module, the second extraction module, and the third extraction module to identify the second shallow lesion features, and the shallow lesion features include the first shallow lesion features and the second shallow lesion features.

[0016] In one embodiment, the feature extraction network further comprises:

[0017] a fourth extraction module, connected to the output end of the second extraction module, configured with a plurality of residual blocks and a multi-branch coordinated attention submodule connected to the output ends of the plurality of residual blocks, and the number of the plurality of residual blocks configured in the fourth extraction module is greater than the number of the plurality of residual blocks configured in the third extraction module;

[0018] The leaf image is passed through the first extraction module, the second extraction module, and the fourth extraction module to identify a first deep lesion feature, and the deep lesion feature includes the first deep lesion feature.

[0019] In one embodiment, the multi-branch coordinated attention submodule includes a first branch, a second branch, a third branch, a fourth branch, and a residual connection branch;

[0020] The multi-branch coordinated attention submodule takes the features output by the multiple residual blocks connected to it as input features, where:

[0021] The first branch is configured with a convolution layer, a batch normalization layer, and a ReLU layer, and the input feature passes through the first branch to output a first output feature;

[0022] The second branch is configured with a convolution layer, a batch normalization and a ReLU layer, and a coordinated attention mechanism, and the input feature passes through the second branch to output a second output feature;

[0023] The third branch is configured with a convolution layer, a batch normalization and ReLU layer, and a coordinated attention mechanism, and the input feature passes through the third branch to output a third output feature;

[0024] The fourth branch is configured with a convolution layer, a batch normalization and ReLU layer, and a pooling layer. The input feature passes through the fourth branch and outputs a fourth output feature.

[0025] The first output feature, the second output feature, the third output feature, and the fourth output feature are concatenated and convolved to obtain a concatenated feature;

[0026] The residual connection branch is configured with a convolution layer, a batch normalization and a ReLU layer. The input feature is further spliced ​​with the splicing feature through the residual connection branch to obtain a target output feature, and the target output feature includes the second shallow lesion feature or the first deep lesion feature.

[0027] In one embodiment, the shallow lesion feature and the deep lesion feature are fused to obtain a target fusion feature, including:

[0028] The first shallow lesion feature, the second shallow lesion feature, and the first deep lesion feature are concatenated and convolved to obtain the target fusion feature, and the number of channels of the target fusion feature is the same as the number of channels of the first deep lesion feature.

[0029] In one embodiment, the multi-scale fusion network comprises:

[0030] A first processing module is configured with a spatial attention mechanism and a pooling layer, for receiving the first shallow lesion feature, and obtaining the first feature through two maximum pooling downsampling operations of the spatial attention mechanism and the pooling layer;

[0031] The second processing module is configured with a spatial attention mechanism and a pooling layer, and is used to receive the second shallow lesion feature, and obtain the second feature through a maximum pooling downsampling operation of the spatial attention mechanism and the pooling layer;

[0032] The third processing module is configured with a channel attention mechanism, and is used to receive the first deep lesion feature through the channel attention mechanism to obtain a third feature;

[0033] The first feature, the second feature, and the first feature are concatenated and convolved to obtain the target fusion feature.

[0034] In one embodiment, the classification network is configured with a pooling layer, a linear layer and a Softmax activation function to receive the target fusion feature, and obtain the disease classification result after being processed by the pooling layer, the linear layer and the Softmax activation function.

[0035] In one embodiment, it also includes:

[0036] A data set is constructed using the leaf images of the crop to be detected, and the data set is preprocessed.

[0037] In one embodiment, a hash algorithm is used to compare hash values ​​of any two images in a data set. When the difference in the hash values ​​is less than a preset threshold, the two images are determined to be duplicates, and one of the images is removed.

[0038] On the other hand, the present invention further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the above-mentioned leaf disease identification method are implemented and the same technical effect can be achieved.

[0039] It can be seen from the above scheme that the advantages of the present invention are:

[0040] The leaf disease recognition method provided by the present invention constructs a feature extraction network based on a multi-branch attention mechanism, constructs a multi-scale fusion network based on a channel attention mechanism and a spatial attention mechanism, takes a leaf image of a crop to be detected as input, and uses the feature extraction network to extract shallow disease spot features and deep disease spot features from the leaf image; and further uses the multi-scale fusion network to fuse the shallow disease spot features and the deep disease spot features to generate target fusion features, which can better extract the shallow disease spot features and the deep disease spot features of the leaf, and improve the effect of detecting small disease spots. The method realizes the classification and recognition of various leaf disease spot diseases and provides recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 The overall flow chart of the leaf disease identification method provided by the embodiment of the present invention is shown;

[0042] Figure 2 The overall architecture diagram of the leaf disease recognition model is shown;

[0043] Figure 3 The specific structural diagram of the multi-branch coordinated attention submodule is shown;

[0044] Figure 4 The specific structural diagram of the multi-scale fusion network is shown;

[0045] Figure 5 The accuracy change curves of the model of the present invention and five models of related technologies on the training set are shown;

[0046] Figure 6 The accuracy change curves of the model of the present invention and five models of related technologies on the validation set are shown;

[0047] Figure 7 The loss change curves of the model of the present invention and five models of related technologies on the training set are shown;

[0048] Figure 8 The loss change curves of the model of the present invention and five models of related technologies on the validation set are shown.

[0049] The symbols are:

[0050] 10: Leaf disease recognition model;

[0051] 11: Feature extraction network;

[0052] 111: first extraction module;

[0053] 112: second extraction module;

[0054] 113: third extraction module;

[0055] 114: fourth extraction module;

[0056] 115: Multi-branch coordinated attention submodule;

[0057] 115A: first branch;

[0058] 115B: Second branch;

[0059] 115C: third branch;

[0060] 115D: the fourth branch;

[0061] 115E: residual connection branch;

[0062] 12: Multi-scale fusion network;

[0063] 121: first processing module;

[0064] 122: second processing module;

[0065] 123: third processing module;

[0066] 13: Classification network. DETAILED DESCRIPTION

[0067] In order to make the above features and effects of the present invention more clearly understood, embodiments are given below and described in detail with reference to the accompanying drawings.

[0068] See also Figure 1-Figure 8 As shown, Figure 1 The overall process diagram of the leaf disease identification method provided by one embodiment of the present invention is shown; Figure 2 The overall architecture diagram of the leaf disease recognition model is shown; Figure 3 The specific structural diagram of the multi-branch coordinated attention submodule is shown; Figure 4 The specific structural diagram of the multi-scale fusion network is shown; Figure 5-Figure 8 The accuracy and loss of 5 different models of the present invention and related technologies on the training set and validation set are given respectively.

[0069] For details, please refer to Figure 1 As shown in, it shows the overall flow chart of the leaf disease identification method provided by this embodiment. The leaf disease identification method at least includes the following steps:

[0070] Step S1: construct a data set using the leaf images of the crop to be detected, and preprocess the data set.

[0071] For the dataset constructed for leaf disease recognition in this real-time example, part of it is taken from the leaf images of the crops to be detected in multiple existing datasets and integrated, and the other part uses mobile devices to obtain local data of some diseases of the crops to be detected. Among them, the local data selects more significant diseases to ensure correct labeling; local data can effectively supplement complex background data, which is conducive to improving the generalization ability of the model.

[0072] In addition, the original data used in the above data set is further preprocessed for deduplication. The hash values ​​of any two images in the data set are compared using a hash algorithm. When the difference in the hash values ​​is less than a preset threshold, the two images are determined to be duplicates and one of the images is removed.

[0073] Step S2: using the leaf image of the crop to be detected as input, and using a feature extraction network to extract shallow disease spot features and deep disease spot features from the leaf image.

[0074] In one embodiment, see Figure 2 As shown in Figure 2 The overall architecture diagram of the leaf disease recognition model constructed in an embodiment of the present invention is shown. The leaf disease recognition model 10 includes three parts: a feature extraction network 11, a multi-scale fusion network 12, and a classification network 13.

[0075] In one embodiment, see Figure 2 As shown in , the feature extraction network 11 includes: a first extraction module 111, a second extraction module 112, a third extraction module 113, and a fourth extraction module 114. Among them: the first extraction module 111 is configured with a convolution layer, a batch normalization (Batch Normalization) and a ReLU layer, and a pooling layer. The second extraction module 112 is connected to the output end of the first extraction module 111 and is configured with a plurality of residual blocks (Bottleneck Block). The third extraction module 113 is connected to the output end of the second extraction module 112, and is configured with a plurality of residual blocks (Bottleneck Block) and a multi-branch coordinated attention submodule 115 (MCA) connected to the output end of the plurality of residual blocks. The fourth extraction module 114 is connected to the output end of the second extraction module 112, and is configured with a plurality of residual blocks (Bottleneck Block) and a multi-branch coordinated attention submodule 115 (MCA) connected to the output end of the plurality of residual blocks, and the number of the plurality of residual blocks configured in the fourth extraction module 114 is greater than the number of the plurality of residual blocks configured in the third extraction module.

[0076] Specifically, in this embodiment, the specific implementation method of step S2 is: the preprocessed leaf image is passed through the first extraction module 111 and the second extraction module 112 to identify the first shallow lesion features; the leaf image is passed through the first extraction module 111, the second extraction module 112, and the third extraction module 113 to identify the second shallow lesion features, and the shallow lesion features include the first shallow lesion features and the second shallow lesion features, and the first shallow lesion features and the second shallow lesion features are lesion features of different scales.

[0077] In addition, the leaf image is passed through the first extraction module 111, the second extraction module 112, and the fourth extraction module 114 to identify the first deep lesion feature, and the deep lesion feature includes the first deep lesion feature. In this embodiment, although the third extraction module 113 and the fourth extraction module 114 are both configured with multiple residual blocks and multi-branch coordinated attention submodules, the specific number of residual blocks configured by the two is different. The fourth extraction module 114 is configured with more residual blocks than the third extraction module 113, so that the scale of the second shallow lesion feature of the input leaf image that is finally output by the third extraction module is different from the scale of the first deep lesion feature that is finally output by the fourth extraction module.

[0078] In this embodiment, a multi-branch coordinated attention mechanism is added to the feature extraction network. Figure 3 As shown in Figure 3The specific structural diagram of the multi-branch coordinated attention submodule is shown. The multi-branch coordinated attention submodule 115 comprises a first branch 115A, a second branch 115B, a third branch 115C, a fourth branch 115D, and a residual connection branch 115E.

[0079] The multi-branch coordinated attention submodule 115 uses the features output by the multiple residual blocks of the second extraction module 112 or the multiple residual blocks of the third extraction module 113 connected thereto as input features, wherein: the first branch 115A is configured with a convolution layer, batch normalization and ReLU layer, and the input feature passes through the first branch 115A to output the first output feature; the second branch 115B is configured with a convolution layer, batch normalization and ReLU layer, and a coordinated attention mechanism, and the input feature passes through the second branch 115B to output the second output feature; the third branch 115C is configured with a convolution layer, batch normalization and ReLU layer, and a coordinated attention mechanism, and the input feature passes through the third branch 115C to output the third output feature; the fourth branch 115D is configured with a convolution layer, batch normalization and ReLU layer, and a pooling layer, and the input feature passes through the fourth branch 115D to output the fourth output feature. Then, the first output feature, the second output feature, the third output feature, and the fourth output feature are concatenated and convolved to obtain a concatenated feature. The residual connection branch is configured with a convolution layer, a batch normalization and a ReLU layer. The input feature is further concatenated with the concatenated feature through the residual connection branch 115E to obtain a target output feature, which includes the second shallow lesion feature or the first deep lesion feature. That is, for the multi-branch coordinated attention submodule 115 configured by the second extraction module 112, the target output feature generated is the second shallow lesion feature; for the multi-branch coordinated attention submodule 115 configured by the third extraction module 113, the target output feature generated is the first deep lesion feature.

[0080] For example, in a specific implementation, the first branch 115A is configured with a 1×1 convolution layer, a batch normalization and a ReLU layer, and the input feature passes through the first branch 115A, and the number of output channels is the first output feature of out_channels1; the second branch 115B is configured with a 1×1 convolution layer, a batch normalization and a ReLU layer, and a coordinated attention mechanism, and the input feature passes through the second branch 115B, and the number of output channels is the second output feature of out_channels2; the third branch 115C is configured with a 1×1 convolution layer, a 3×3 convolution layer, a batch normalization and a ReLU layer, and a coordinated attention mechanism, and the input feature passes through the third branch 115C, and the number of output channels is the third output feature of out_channels3; the fourth branch 115D is configured with a 1×1 convolution layer, a batch normalization and a ReLU layer, and a pooling layer, and the input feature passes through the fourth branch 115D, and the number of output channels is the fourth output feature of out_channels4. Then, the first output feature, the second output feature, the third output feature, and the fourth output feature are concatenated and convolved to obtain a concatenated feature. The residual connection branch 115E is configured with a 1×1 convolution layer, a batch normalization layer, and a ReLU layer. The input feature is further concatenated with the concatenated feature through the residual connection branch 115E to obtain a target output feature.

[0081] In this embodiment, a multi-branch coordinated attention submodule is used in the feature extraction network to replace the residual block in Resnet50. The number of parameters of the multi-branch coordinated attention submodule is much smaller than the number of parameters of the convolution operation, which reduces the number of model parameters. In addition, the second and third branches of the multi-branch coordinated attention submodule add an attention mechanism to pay attention to the information of lesions at different scales, thereby improving the recognition accuracy of feature extraction for small target features and target positions. Through the above-mentioned feature extraction network, the shallow and deep lesion features of the input leaf image are identified.

[0082] Step S3, receiving the shallow lesion feature and the deep lesion feature as input, using a multi-scale fusion network to fuse the shallow lesion feature and the deep lesion feature to generate a target fusion feature.

[0083] In this embodiment, the shallow lesion features and deep lesion features of the input leaf image are identified through the feature extraction process of step S2. The shallow lesion features and deep lesion features are further received as input, and a multi-scale fusion network is used to fuse the shallow lesion features and the deep lesion features to generate a target fusion feature, so as to more comprehensively obtain coarse-grained global features and fine-grained local features. Specifically, in one embodiment, the first shallow lesion feature, the second shallow lesion feature, and the first deep lesion feature are spliced ​​and convolved to obtain the target fusion feature, and the number of channels of the target fusion feature is the same as the number of channels of the first deep lesion feature.

[0084] In one embodiment, for a multi-scale fusion network, it is constructed based on the Inception structure and the coordinated attention mechanism, which can further improve the accuracy of the leaf disease recognition model. Multi-scale feature fusion can realize the fusion between features of different depths to reduce the loss of leaf disease detail features caused by the network during the downsampling process, and solve the problem of the disappearance of disease features during image feature extraction. Among them, the Inception structure connects several convolutional layers and pooling layers in parallel, and performs convolution and fusion at multiple sizes at the same time, which can extract richer features of different scales, and is suitable for processing leaf disease spot feature extraction of different sizes and shapes. At the same time, the Inception structure is conducive to the convergence of the network. The coordinated attention mechanism is a lightweight channel attention mechanism, which decomposes the channel attention into two one-dimensional feature encoding processes in the horizontal and vertical directions, respectively, while considering the channel and position space information, making up for the lack of SE channel attention in spatial features. In this way, while capturing remote dependencies and retaining accurate position information, the leaf disease recognition model can more accurately identify more features of the spots.

[0085] Specifically, see Figure 4 As shown in Figure 4 A specific structural diagram of a multi-scale fusion network is shown. In one embodiment, the multi-scale fusion network 12 includes: a first processing module 121, which is configured with a spatial attention mechanism and a pooling layer to receive the first shallow lesion feature, and obtain the first feature after two maximum pooling downsampling operations of the spatial attention mechanism and the pooling layer. A second processing module 122 is configured with a spatial attention mechanism and a pooling layer to receive the second shallow lesion feature, and obtain the second feature after a maximum pooling downsampling operation of the spatial attention mechanism and the pooling layer. A third processing module 123 is configured with a channel attention mechanism to receive the first deep lesion feature through the channel attention mechanism to obtain the third feature. The first feature, the second feature, and the first feature are concatenated and convolved to obtain the target fusion feature.

[0086] In this embodiment, different shallow lesion features and deep lesion features extracted from the crop leaf image to be detected are fused through a multi-scale fusion network to more comprehensively obtain coarse-grained global features and fine-grained local features.

[0087] Step S4: receiving the target fusion feature and using a classification network to obtain a disease classification result.

[0088] In this embodiment, after the shallow lesion features and the deep lesion features are fused in step S3 to obtain the target fusion features, the target fusion features are further input into the classification network to obtain the disease classification results. Figure 2 As shown in , the classification network 13 is configured with a pooling layer, a linear layer and a Softmax activation function to receive the target fusion feature, and obtain the disease classification result after being processed by the pooling layer, the linear layer and the Softmax activation function.

[0089] In addition, the loss function of the leaf disease recognition model can be further utilized, and training can be performed for a preset number of iterations according to the loss function to obtain the optimal disease classification result.

[0090] The method of the present invention is compared with the related technology below to further verify and illustrate the technical effect of the present invention.

[0091] In a specific example, five classic models were selected to be compared with the leaf disease recognition model of the present invention in the same data set. The image size of the integrated data set is 224×224, and the six models share the same operating environment and hyperparameters. The hyperparameter settings include batch size set to 16, epoch to 100, initial learning rate set to 0.002, weight deacy to 0.001, softmax is used as the output layer, and the classification cross entropy loss function is used to calculate the loss value. Figure 5-Figure 8 The accuracy and loss of 5 different models of the present invention and related technologies on the training set and validation set are given respectively.

[0092] In the specific example, the accuracy, recall, precision, specificity, F1 score, floating point operations, and total training parameters of each model are recorded on the test set. Figure 5 The accuracy change curves of the model of the present invention and five models of related technologies (Resnet50, Mobilenet_v3_small, Densenet20, Vgg16, Squeezenet) on the training set are shown, where the vertical axis represents the accuracy and the horizontal axis represents the number of training times (Epoches); Figure 6 The accuracy change curves of the model of the present invention and five models of related technologies on the validation set are shown, where the vertical axis represents the accuracy and the horizontal axis represents the number of training times (Epoches); Figure 7 The loss change curves of the model of the present invention and five models of related technologies on the training set are shown, where the vertical axis represents the loss rate and the horizontal axis represents the number of training times (Epoches); Figure 8 The loss change curves of the model of the present invention and five models of related technologies on the validation set are shown, where the vertical axis represents the loss rate and the horizontal axis represents the number of training epochs. Figure 5-Figure 8 It can be seen that the leaf disease recognition model of the present invention outperforms the other five models in terms of accuracy, recall, precision, specificity, and F1, with an average accuracy of 91.6%, which is about 4.5 percentage points higher than the highest accuracy in the classic model. In terms of floating-point operations and total training parameters, Mobilenet and Squeezenet require more parameters and large amounts of calculation, but the total amount of calculation is reduced by 8.1% and the number of parameters is reduced by 57.9% compared to the baseline model Resnet50. Table 1 shows the comparison of the results of different models on the test set.

[0093] Table 1: Comparison of the results of the present invention and related technologies on the test set

[0094]

[0095] In the specific example, the model of the present invention was generalized on two datasets, DAE and Wheat-leaf-disease. All five evaluation indicators were above 96%. The average inference time of a single sample on the test set was 8.72ms and 8.46ms, respectively. Table 2 shows the generalization test results of the model of the present invention on the DAE and Wheat-leaf-disease datasets.

[0096] Table 2: Generalization test results of the model of the present invention on DAE and Wheat-leaf-disease datasets

[0097]

[0098] In summary, the leaf disease identification method provided by the present invention constructs a feature extraction network based on a multi-branch attention mechanism, constructs a multi-scale fusion network based on a channel attention mechanism and a spatial attention mechanism, takes the leaf image of the crop to be detected as input, and uses the feature extraction network to extract the shallow lesion features and deep lesion features from the leaf image; and further uses the multi-scale fusion network to fuse the shallow lesion features and the deep lesion features to generate target fusion features, which can better extract the shallow lesion features and deep lesion features of the leaves, and improve the effect of detecting small lesions. This method realizes the classification and identification of various leaf lesion diseases, while obtaining a high accuracy rate, reducing parameters and calculations, and has a certain degree of generalization, providing theoretical support for smart agricultural intelligent detection equipment.

[0099] In addition, an embodiment of the present application also provides an electronic device, including a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the above-mentioned leaf disease identification method are implemented and the same technical effect can be achieved.

[0100] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0101] In addition, an embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the above-mentioned leaf disease identification method are implemented and the same technical effect can be achieved.

[0102] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be applied, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0103] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0104] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A leaf disease identification method, characterized in that: Include: Taking the leaf image of the crop to be detected as input, a feature extraction network is used to extract the shallow disease spot features and deep disease spot features from the leaf image; Receiving the shallow lesion feature and the deep lesion feature as input, and using a multi-scale fusion network to fuse the shallow lesion feature and the deep lesion feature to generate a target fusion feature; The target fusion feature is received, and a classification network is used to obtain a disease classification result.

2. The leaf disease identification method according to claim 1, characterized in that: The feature extraction network contains: The first extraction module is configured with convolutional layers, batch normalization and ReLU layers, and pooling layers; A second extraction module, connected to the output end of the first extraction module, and configured with a plurality of residual blocks; A third extraction module, connected to the output end of the second extraction module, configured with a plurality of residual blocks and a multi-branch coordinated attention submodule connected to the output ends of the plurality of residual blocks; The leaf image is passed through the first extraction module and the second extraction module to identify the first shallow disease spot feature; The leaf image is passed through the first extraction module, the second extraction module, and the third extraction module to identify the second shallow lesion features, and the shallow lesion features include the first shallow lesion features and the second shallow lesion features.

3. The leaf disease identification method according to claim 2, characterized in that: The feature extraction network also contains: a fourth extraction module, connected to the output end of the second extraction module, configured with a plurality of residual blocks and a multi-branch coordinated attention submodule connected to the output ends of the plurality of residual blocks, and the number of the plurality of residual blocks configured in the fourth extraction module is greater than the number of the plurality of residual blocks configured in the third extraction module; The leaf image is passed through the first extraction module, the second extraction module, and the fourth extraction module to identify a first deep lesion feature, and the deep lesion feature includes the first deep lesion feature.

4. The leaf disease identification method according to claim 3, characterized in that: The multi-branch coordinated attention submodule includes a first branch, a second branch, a third branch, a fourth branch, and a residual connection branch; The multi-branch coordinated attention submodule takes the features output by the multiple residual blocks connected to it as input features, where: The first branch is configured with a convolution layer, a batch normalization layer, and a ReLU layer, and the input feature passes through the first branch to output a first output feature; The second branch is configured with a convolution layer, a batch normalization and a ReLU layer, and a coordinated attention mechanism, and the input feature passes through the second branch to output a second output feature; The third branch is configured with a convolution layer, a batch normalization and ReLU layer, and a coordinated attention mechanism, and the input feature passes through the third branch to output a third output feature; The fourth branch is configured with a convolution layer, a batch normalization and ReLU layer, and a pooling layer. The input feature passes through the fourth branch and outputs a fourth output feature. The first output feature, the second output feature, the third output feature, and the fourth output feature are concatenated and convolved to obtain a concatenated feature; The residual connection branch is configured with a convolution layer, a batch normalization and a ReLU layer. The input feature is further spliced ​​with the splicing feature through the residual connection branch to obtain a target output feature, and the target output feature includes the second shallow lesion feature or the first deep lesion feature.

5. The leaf disease identification method according to claim 3, characterized in that: The shallow lesion feature and the deep lesion feature are fused to obtain the target fusion feature, including: The first shallow lesion feature, the second shallow lesion feature, and the first deep lesion feature are concatenated and convolved to obtain the target fusion feature, and the number of channels of the target fusion feature is the same as the number of channels of the first deep lesion feature.

6. The leaf disease identification method according to claim 5, characterized in that: The multi-scale fusion network contains: A first processing module is configured with a spatial attention mechanism and a pooling layer, for receiving the first shallow lesion feature, and obtaining the first feature through two maximum pooling downsampling operations of the spatial attention mechanism and the pooling layer; The second processing module is configured with a spatial attention mechanism and a pooling layer, and is used to receive the second shallow lesion feature, and obtain the second feature through a maximum pooling downsampling operation of the spatial attention mechanism and the pooling layer; The third processing module is configured with a channel attention mechanism, and is used to receive the first deep lesion feature through the channel attention mechanism to obtain a third feature; The first feature, the second feature, and the first feature are concatenated and convolved to obtain the target fusion feature.

7. The leaf disease identification method according to claim 1, characterized in that: The classification network is configured with a pooling layer, a linear layer and a Softmax activation function to receive the target fusion feature, and obtains the disease classification result after being processed by the pooling layer, the linear layer and the Softmax activation function.

8. The leaf disease identification method according to claim 1, characterized in that: Also includes: A data set is constructed using the leaf images of the crop to be detected, and the data set is preprocessed.

9. The leaf disease identification method according to claim 8, characterized in that: The hash algorithm is used to compare the hash values ​​of any two images in the data set. When the difference in the hash values ​​is less than the preset threshold, the two images are determined to be duplicates and one of them is removed.

10. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the steps of the leaf disease identification method according to any one of claims 1 to 9 are implemented.