Deep learning-based plant leaf disease classification method, system and equipment
Through the CAST-Net network model and self-distillation method, the problem of time-consuming and labor-intensive identification of plant leaf diseases is solved, efficient and automated disease classification is achieved, and the recognition accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202311785071.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, plant leaf disease identification consumes manpower and material resources and takes time, making it difficult to achieve efficient and automated classification.
The CAST-Net network model based on deep learning is adopted, combined with the self-distillation method and the multi-head attention mechanism, and the model is trained using the enhanced image set to extract local and global feature information.
The automation level and accuracy of plant leaf disease classification have been improved, the calculation amount and model parameters have been reduced, and efficient disease identification and classification have been achieved.
Smart Images

Figure CN120339662A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition and processing, and particularly to a method, system and device for classifying plant leaf diseases based on deep learning. Background Art
[0002] During the growth process of plants, it is inevitable to encounter problems of pests and diseases. If the diseases cannot be discovered and identified in a timely manner, corresponding measures cannot be taken promptly to prevent the losses caused by the diseases. If manual methods are used to identify pests and diseases, it will consume a considerable amount of manpower and material resources and take a long time to obtain results. Summary of the Invention
[0003] The object of the present invention is to provide a method, system and device for classifying plant leaf diseases based on deep learning, which completes the classification of plant leaf diseases based on deep learning, and improves the automation level, accuracy and efficiency of plant leaf disease classification.
[0004] To achieve the above object, the present invention provides the following solutions:
[0005] A method for classifying plant leaf diseases based on deep learning includes:
[0006] Obtaining an image of a plant leaf to be recognized;
[0007] Inputting the image of the plant leaf to be recognized into a trained CAST-Net network model to obtain a disease classification result of the plant leaf to be recognized; the disease classification result includes whether the plant is diseased and the type of disease; the trained CAST-Net network model is obtained by training the CAST-Net network model using the self-distillation method according to an enhanced atlas of plant leaf diseases; the CAST-Net network model includes: a ShallowBlock layer, a first downsampling layer, a multi-Stage layer, a global average pooling layer and a fully-connected layer connected in sequence; the multi-Stage layer is built based on depth convolution, point convolution and multi-head attention mechanism.
[0008] Optionally, the multi-Stage layer includes: a first Stage layer, a second downsampling layer, a second Stage layer, a third downsampling layer, a third Stage layer, a fourth downsampling layer and a fourth Stage layer connected in sequence;
[0009] The first Stage layer includes: a first local feature information extraction module and a first global feature information extraction module connected in sequence;
[0010] The second Stage layer includes: a second local feature information extraction module and a second global feature information extraction module connected in sequence;
[0011] The third Stage layer includes: a third local feature information extraction module and a third global feature information extraction module connected in sequence;
[0012] The fourth Stage layer includes: a fourth local feature information extraction module and a fourth global feature information extraction module connected in sequence;
[0013] The first local feature information extraction module, the second local feature information extraction module, the third local feature information extraction module, and the fourth local feature information extraction module all include: a plurality of local feature information extraction units connected in sequence;
[0014] The first global feature information extraction module, the second global feature information extraction module, the third global feature information extraction module, and the fourth global feature information extraction module all include: a plurality of global feature information extraction units connected in sequence.
[0015] Optionally, the local feature information extraction unit includes: a channel association layer, a depth convolution layer, a first normalization - non - linear activation layer, a point convolution layer, a second normalization - non - linear activation layer, and a first concave - type fully - connected layer connected in sequence;
[0016] The input end of the channel association layer is also connected to the input end of the first concave - type fully - connected layer.
[0017] Optionally, the global feature information extraction unit includes: a first convolution layer, an attention mechanism layer, a first splicing sub - unit, a second convolution layer, a global feature information extraction sub - unit, and a second concave - type fully - connected layer connected in sequence;
[0018] The output end of the first convolution layer is also connected to the input end of the first splicing sub - unit;
[0019] The output end of the second convolution layer is also connected to the input end of the second concave - type fully - connected layer.
[0020] Optionally, the first concave - type fully - connected layer and the second concave - type fully - connected layer have the same structure;
[0021] The first concave - type fully - connected layer includes: a second splicing sub - unit, a batch sample normalization layer, a third convolution layer, a non - linear activation layer, a fourth convolution layer, and a third splicing sub - unit connected in sequence;
[0022] The output end of the second splicing sub - unit is connected to the input end of the third splicing sub - unit.
[0023] Optionally, the global feature information extraction sub - unit includes: a dilated convolution layer, a third normalization - non - linear activation layer, and a fifth convolution layer connected in sequence.
[0024] Optionally, the ShallowBlock layer includes: a sixth convolutional layer, a multi-branch layer, and a weighted splicing layer connected in sequence;
[0025] The input end of the sixth convolutional layer is connected to the input end of the weighted splicing layer as a residual branch;
[0026] The multi-branch layer includes a maximum pooling layer, an average pooling layer, and a multi-convolutional layer connected in parallel;
[0027] The multi-convolutional layer includes: a first convolutional branch, a second convolutional branch, and a fourth splicing sub-unit;
[0028] The input ends of the first convolutional branch and the second convolutional branch are both connected to the output end of the sixth convolutional layer;
[0029] The output ends of the first convolutional branch and the second convolutional branch are both connected to the input end of the fourth splicing sub-unit;
[0030] The output end of the fourth splicing sub-unit is connected to the input end of the weighted splicing layer;
[0031] The first convolutional branch includes a seventh convolutional layer and an eighth convolutional layer connected in sequence;
[0032] The second convolutional branch includes a ninth convolutional layer.
[0033] Optionally, before obtaining the plant leaf image to be recognized, it further includes:
[0034] Constructing a CAST-Net network model;
[0035] Obtaining a plant leaf disease atlas;
[0036] Performing enhancement processing on the plant leaf disease atlas to obtain an enhanced plant leaf disease atlas; the enhancement processing includes one or more of random exposure processing, Gaussian noise processing, and random pixel erasing processing;
[0037] Training the CAST-Net network model using the self-distillation method according to the enhanced plant leaf disease atlas to obtain a trained CAST-Net network model.
[0038] A plant leaf disease classification system based on deep learning, including:
[0039] An image acquisition module for acquiring a plant leaf image to be recognized;
[0040] A disease classification module, which is used to input the to-be-recognized plant leaf image into the trained CAST-Net network model to obtain the disease classification result of the to-be-recognized plant leaf; the disease classification result includes whether it is diseased and the type of disease; the trained CAST-Net network model is obtained by training the CAST-Net network model using the self-distillation method according to the enhanced plant leaf disease atlas; the CAST-Net network model includes: a ShallowBlock layer, a first downsampling layer, a multi-Stage layer, a global average pooling layer, and a fully connected layer connected in sequence; the multi-Stage layer is built based on depth convolution, point convolution, and multi-head attention mechanism.
[0041] An electronic device includes a memory and a processor. The memory is used to store a computer program, and the processor runs the computer program so that the electronic device executes the described method for classifying plant leaf diseases based on deep learning; the memory is a readable storage medium.
[0042] According to the specific embodiments provided by the present invention, the following technical effects are disclosed by the present invention:
[0043] A method, system, and device for classifying plant leaf diseases based on deep learning provided by the present invention extract and fuse the global information and local information of the network, solve the problems that the loss value fluctuates too much during the training stage of the network model for plant leaf disease images and it is difficult to reach the optimal value. Finally, the CAST-Net model is distilled using the self-distillation method based on the recognition and classification of plant leaf diseases, reducing the number of model parameters and the amount of calculation, and at the same time improving the accuracy of recognizing and classifying plant leaf diseases. Description of the Drawings
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required to be used in the embodiments. Obviously, the following described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0045] Figure 1 It is a flowchart of the method for classifying plant leaf diseases based on deep learning in Embodiment 1 of the present invention;
[0046] Figure 2 It is a schematic diagram of the principle of the method for classifying plant leaf diseases based on deep learning in Embodiment 1 of the present invention;
[0047] Figure 3 It is a schematic diagram of the enhancement processing result in Embodiment 1 of the present invention;
[0048] Figure 4 Schematic diagram of the structure of the shallow feature extraction module (ShallowBlock layer) in Embodiment 1 of the present invention;
[0049] Figure 5 Schematic diagram of the structure of the local feature information extraction unit (SCBlock) in Embodiment 1 of the present invention;
[0050] Figure 6 Schematic diagram of the structure of the global feature information extraction unit (DTBlock) in Embodiment 1 of the present invention;
[0051] Figure 7 Schematic diagram of the structure of the CAST-Net network model in Embodiment 1 of the present invention;
[0052] Figure 8 Comparison diagram of the dynamic learning rate functions of the CAST-Net network model in Embodiment 1 of the present invention and other methods;
[0053] Figure 9 Comparison diagram of the losses of the CAST-Net network model in Embodiment 1 of the present invention and other methods;
[0054] Figure 10 Effect diagram of the shallow feature extraction structure for extracting the features of plant disease image samples in Embodiment 1 of the present invention. Detailed implementation manners
[0055] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0056] The purpose of the present invention is to provide a method, system and device for classifying plant leaf diseases based on deep learning, which completes the classification of plant leaf diseases based on deep learning, and improves the automation level, accuracy and efficiency of plant leaf disease classification.
[0057] To make the above objects, features and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.
[0058] Embodiment 1
[0059] As Figure 1 - Figure 2 shown, this embodiment provides a method for classifying plant leaf diseases based on deep learning, including:
[0060] Step 101: Obtain the plant leaf image to be recognized.
[0061] Step 102: Input the plant leaf image to be recognized into the trained CAST-Net network model to obtain the disease classification result of the plant leaf to be recognized. The disease classification result includes whether it is diseased and the type of disease. The trained CAST-Net network model is obtained by training the CAST-Net network model using the self-distillation method according to the enhanced plant leaf disease atlas. The CAST-Net network model includes: a ShallowBlock layer, a first downsampling layer, a multi-Stage layer, a global average pooling layer, and a fully connected layer connected in sequence. The multi-Stage layer is built based on depth convolution, point convolution, and multi-head attention mechanism. The CAST-Net network model is a deep learning neural network based on convolution operation and attention mechanism proposed in this embodiment for detecting and recognizing plant pest and disease data images.
[0062] Among them, the multi-Stage layer includes: a first Stage layer, a second downsampling layer, a second Stage layer, a third downsampling layer, a third Stage layer, a fourth downsampling layer, and a fourth Stage layer connected in sequence. The first Stage layer includes: a first local feature information extraction module and a first global feature information extraction module connected in sequence. The second Stage layer includes: a second local feature information extraction module and a second global feature information extraction module connected in sequence. The third Stage layer includes: a third local feature information extraction module and a third global feature information extraction module connected in sequence. The fourth Stage layer includes: a fourth local feature information extraction module and a fourth global feature information extraction module connected in sequence. The first local feature information extraction module, the second local feature information extraction module, the third local feature information extraction module, and the fourth local feature information extraction module all include: a plurality of local feature information extraction units connected in sequence. The first global feature information extraction module, the second global feature information extraction module, the third global feature information extraction module, and the fourth global feature information extraction module all include: a plurality of global feature information extraction units connected in sequence.
[0063] The local feature information extraction unit includes: a channel association layer, a depth convolution layer, a first normalization-nonlinear activation layer, a point convolution layer, a second normalization-nonlinear activation layer, and a first concave fully connected layer connected in sequence. The input end of the channel association layer is also connected to the input end of the first concave fully connected layer.
[0064] The global feature information extraction unit includes: a first convolution layer, an attention mechanism layer, a first splicing subunit, a second convolution layer, a global feature information extraction subunit, and a second concave fully connected layer connected in sequence. The output end of the first convolution layer is also connected to the input end of the first splicing subunit. The output end of the second convolution layer is also connected to the input end of the second concave fully connected layer.
[0065] The structures of the first concave fully-connected layer and the second concave fully-connected layer are the same. The first concave fully-connected layer includes: a second splicing subunit, a batch sample normalization layer, a third convolutional layer, a non-linear activation layer, a fourth convolutional layer, and a third splicing subunit connected in sequence. The output end of the second splicing subunit is connected to the input end of the third splicing subunit.
[0066] The global feature information extraction subunit includes: a dilated convolutional layer, a third normalization-nonlinear activation layer, and a fifth convolutional layer connected in sequence.
[0067] The ShallowBlock layer includes: a sixth convolutional layer, a multi-branch layer, and a weighted splicing layer connected in sequence; the input end of the sixth convolutional layer is connected to the input end of the weighted splicing layer as a residual branch; the multi-branch layer includes a max pooling layer, an average pooling layer, and a multi-convolutional layer connected in parallel; the multi-convolutional layer includes: a first convolutional branch, a second convolutional branch, and a fourth splicing subunit; the input ends of the first convolutional branch and the second convolutional branch are both connected to the output end of the sixth convolutional layer; the output ends of the first convolutional branch and the second convolutional branch are both connected to the input end of the fourth splicing subunit; the output end of the fourth splicing subunit is connected to the input end of the weighted splicing layer; the first convolutional branch includes a seventh convolutional layer and an eighth convolutional layer connected in sequence; the second convolutional branch includes a ninth convolutional layer.
[0068] Before step 101, it further includes:
[0069] Step 103: Construct the CAST-Net network model.
[0070] Step 104: Obtain the plant leaf disease atlas.
[0071] Step 105: Perform enhancement processing on the plant leaf disease atlas to obtain the enhanced plant leaf disease atlas. The enhancement processing includes one or more of random exposure processing, Gaussian noise processing, and random pixel erasing processing.
[0072] Step 106: According to the enhanced plant leaf disease atlas, use the self-distillation method to train the CAST-Net network model to obtain the trained CAST-Net network model.
[0073] Taking the data samples collected in the real environment as an example, the present embodiment will be specifically described.
[0074] 1. Preparation of experimental materials.
[0075] In order to simulate the data samples collected in the real environment, the present embodiment preprocesses the plant disease images by means of data augmentation, such as Figure 3, A is processed by randomly exposing the original image with a 50% probability, B is processed by randomly adding Gaussian noise of different degrees to the original image with a 50% probability, and C is processed by randomly erasing pixels within a certain range in the original image with a 50% probability. A + B + C is to fuse three data preprocessing methods before training, randomly process the original single image in the laboratory according to a certain proportion to simulate the captured images in the real environment, and then train the CAST-Net model on the processed dataset so that the model can obtain better generalization ability.
[0076] 2. Shallow feature extraction is performed on the image samples.
[0077] As Figure 4 shown, the shallow feature extraction structure includes: 1. First branch: Maxpooling is used to extract the significant features of the local area of the feature map; 2. Second branch: Avgpooling is used to extract the overall data information features of the feature map; 3. Third branch: Two convolutional branches are respectively used to more richly extract the local features of the feature map with the number of channels halved, and finally Concat splicing is performed; 4. Residual branch: The original feature information is saved. Finally, the four branches are multiplied by the adaptive learning weight coefficients and then the Add operation is performed to complete the feature fusion to obtain the image feature information of different granularities extracted at different scales.
[0078] The first formula is:
[0079] F = w1 × f r + w2 × f m + w3 × f a + w4 × f c (1)
[0080] where w1, w2, w3, and w4 are normalized weight coefficients, f m is the feature of the First branch, f a is the feature of the Second branch, f c is the feature of the third branch, f r is the feature of the residual branch.
[0081] As Figure 10, in this embodiment, a heat map is used to compare the extraction effects of the shallow feature extraction module and the original shallow feature extraction module on the features of plant disease images. The following five types of plant disease images are compared: Apple_Black_rot, Corn_cercospora_leaf_spot, Apple_Cedar_apple_rust, Pepper_bell_Bacterial_spot, and Tomato_Bacterial_spot. In this embodiment, a shallow feature extraction structure is used to extract features from the input plant disease images in multiple scales. Feature fusion can make the extracted features richer and reduce the loss of useful information. Obviously, the module in this embodiment pays significantly better attention to the features of plant disease spots in the shallow layer of the network than the original shallow feature extraction module (4 convolutional layers of 3×3).
[0082] 3. Deep feature extraction, recognition, and classification are performed on the image samples.
[0083] As Figure 5 , the SCB module uses depth convolution and point convolution for feature extraction, and adds an inter-channel information correlation operation to make the information between the channels of the feature map correlated with each other, so as to better extract the features of the feature map. The SCB module first correlates the channels of the input feature information so that when the features extracted in the previous iteration of model training enter the SCB again for feature extraction, the information connection between the channels is taken into account. Then, it enters a depth convolution with a filter size of 3×3 for local feature extraction. After normalization and non-linear activation, it enters a point convolution with a filter size of 1×1 for feature integration. After the same normalization process and non-linear activation, it finally enters the concave fully connected layer to obtain the plant disease classification probability.
[0084] As Figure 6, the DTB structure includes a DCB structure and a multi-head attention structure. The DCB sub-module uses dilated convolution with a 3×3 convolution kernel and a dilation rate of 2 to increase the receptive field of the convolution kernel for local feature extraction while avoiding excessive extraction of redundant information. After that, normalization and non-linear activation are performed, and then a 1×1 convolution is used for feature integration. At the same time, a residual structure is used to avoid problems such as gradient vanishing and difficult model optimization as the network depth increases. Specifically, the DCB module increases the receptive field of the original 3×3 convolution to be equivalent to that of a 5×5 convolution without increasing the computational amount, which can ensure that not too much information is lost as the network depth deepens during the convolution process. In the DTB structure, the plant disease image sample first enters a convolution layer composed of 1×1 filters, followed by an attention mechanism to extract the global information of the input plant disease image features, then feature integration is performed in a 1×1 convolution layer, and then it enters the DCB module. The dilated convolution uses a large receptive field to extract the local information of the plant disease image features, and then after feature integration, considering the problem of gradient vanishing, a residual connection is also adopted. Finally, it enters the concave fully connected layer to realize the recognition and classification of the plant disease image features.
[0085] 4. Analysis of the influence of the dynamic learning rate function on the model training loss value.
[0086] To solve the problems that the loss value is prone to repeatedly jump around the minimum value in the later stage of model training and the fluctuation range of the loss value is too large in the early and middle stages, this embodiment uses a new dynamic learning rate function formula to train the model. This embodiment uses the symmetric function e of the exponential function -X to construct a new dynamic learning function. As x takes values in the range from 0 to 1, the value of e -X slowly decreases and does not drop to 0. This can ensure that the model still has the ability to learn new feature information in the later stage. And a constant η max learning rate is adopted in the first 5 epochs, allowing the model to learn more knowledge in the early stage. After 5 epochs, the proposed dynamic learning rate function is used to decay the learning rate according to the increase in the number of epochs, so that the Loss decreases stably and the accuracy increases. The dynamic learning rate function formula is:
[0087]
[0088] where η represents the dynamic learning rate at the current epoch, η min represents the set minimum learning rate, η max represents the set maximum learning rate, E cur represents the current epoch number, E max represents the set maximum epoch number, and N is used to control e -XThe parameter that determines the decay rate of the function, i.e., the larger the N, the faster the decay of e -X The faster the function decays, the faster the learning rate decays, and the smaller the N, the faster the decay of e -X The slower the function decays, the slower the learning rate decays.
[0089] For example Figure 8 - Figure 9 To verify the effectiveness of the dynamic learning rate function proposed in this embodiment, it was compared with some other dynamic learning rate functions during the model training process. Purple represents the static learning rate, green represents the multi-step dynamic learning rate, red represents the dynamic learning rate of this embodiment, and blue represents the single-step learning rate. Other learning rate functions cause large fluctuations in the loss curve, indicating that the model does not converge well. In contrast, the dynamic learning rate function of this embodiment first uses a relatively large learning rate to learn the edge feature information of plant disease spots at the early stage of model training. After the model has a certain amount of knowledge, as the number of epochs increases, the learning rate decreases in a smooth trend, enabling the model to continue learning more advanced semantic information. In the case of gradually decreasing learning rate, the model will not skip the optimal value and cause the loss curve to oscillate. Therefore, the dynamic learning rate function of this embodiment makes the model loss gradually decrease and the curve stable.
[0090] 5. Distill the model.
[0091] To further improve the recognition and classification accuracy of the model for plant disease image data samples, this embodiment adopts an optimized self-distillation method. Through distillation with soft targets overlapping with part of the next Batch of samples, the training samples are associated with a backward propagation process during each forward propagation, thereby improving the learning efficiency. Since the traditional self-supervised image classification method generates one-hot encoding to calculate the cross-entropy loss after model training, this only considers the loss at the correct label positions in the training samples and ignores the loss at the incorrect label positions. Therefore, in each Epoch iteration of the training stage using the self-distillation method, the lightweight network in this embodiment simultaneously assumes the roles of both the student and the teacher. The role of the teacher is to generate soft target optimization for the next Epoch, and the role of the student is to distill and learn from the softened labels in the previous Epoch. The method formula includes:
[0092]
[0093]
[0094]
[0095] Loss = loss CE + α·loss LB .
[0096] where p i is the probability that the current sample belongs to class i, x i refers to the logit corresponding to class i of the current sample, n is the total number of sample classes, and loss CE is the cross-entropy loss. τ is the temperature of distillation, is the probability that the current sample belongs to class i at the (t - 1)-th iteration of soft-labeling at temperature τ, α is a hyperparameter that controls the proportion of the distillation loss in the total loss, and Loss is the total loss in model training.
[0097] 6. CAST-Net model structure.
[0098] As Figure 7 shown, the overall structure of the CAST-Net neural network model is as follows: Since the SCBlock is used to extract local feature information of plant disease images, and the DTBlock is used to extract global feature information of plant disease images, in this embodiment, the SCBlock and the DTBlock are connected in series to combine the local feature information and the global feature information of plant disease images. And the input image first passes through the ShallowBlock to obtain rich shallow feature information, and then enters the series-connected SCBlock and DTBlock for in-depth feature information extraction, so as to realize the classification and recognition of plant leaf disease categories by the entire -Net model. n1, n2, n3, n4 are set to different overlapping times for each layer of Stage. From previous experience, it can be known that as the number of layers of the network model deepens, the complexity of the model increases, and the accuracy of the model for identifying each plant leaf disease will also be better. CAST-Net mainly uses [3, 4, 10, 3] in the experiment, that is, the SCB is stacked 3 times in Stage1, the SCB is stacked 3 times and the DTB is stacked 1 time in Stage2, the SCB is stacked 8 times and the DTB is stacked 2 times in Stage3, the SCB is stacked 2 times and the DTB is stacked 1 time in Stage4, and finally, the input plant disease image is discriminated by the fully connected layer.
[0099] 7. Result analysis.
[0100] In the embodiment, to verify the accuracy of the plant leaf disease classification and recognition method based on deep learning of the present application, this embodiment conducts mixed training and testing on 39 types of diseases of different plant species and 10 types of diseases of a single plant species respectively, and compares with other detection network models.
[0101] As shown in Table 1 and Table 2, the results of the mixed tests of the CAST-Net neural network model and other 5 network models (named Next-Vit, ResNet34, MobileNet, ViT-base or ConvNeXt) on the leaf disease datasets of 39 different species of plants and the leaf disease datasets of 10 single species of plants are presented, including the recognition classification accuracy, loss value, recall rate, precision rate, model F1 value, model parameter quantity, and model calculation quantity. Table 1 shows the results of the mixed tests of different disease category data of 10 single plants. The model parameter quantity of this embodiment is 11.69M, the calculation quantity is 1.84G, and the recognition classification accuracy, loss value, recall rate, precision rate, and F1 value of the model are 97.5%, 0.105, 0.967, 0.964, and 0.965 respectively. It can be seen from this that the CAST-Net network model of this embodiment has a smaller model parameter quantity and calculation quantity, can meet the requirements of real-time detection and recognition, and has a higher accuracy rate.
[0102] Table 1 Comparison Table of the Results of the Mixed Tests of Different Disease Category Data of 10 Single Plants
[0103]
[0104] To further prove the generalization ability of the model of this embodiment, Table 2 shows the results of the mixed tests of different disease category data of 39 species of plants. The model parameter quantity of this embodiment is 11.69M, the calculation quantity is 1.84G, and the recognition classification accuracy, loss value, recall rate, precision rate, and F1 value of the model are 98.0%, 0.102, 0.966, 0.976, and 0.970 respectively. At the same time, after using the optimized self-distillation method, the recognition classification accuracy of the model of this embodiment is further improved to 99.0% without increasing the model parameter quantity and calculation quantity.
[0105] Table 2 Comparison Table of the Results of the Mixed Tests of Different Disease Category Data of 39 Species of Plants
[0106]
[0107] Embodiment 2
[0108] To execute the method corresponding to the above Embodiment 1 to achieve the corresponding functions and technical effects, a plant leaf disease classification system based on deep learning is provided below, including:
[0109] An image acquisition module for acquiring an image of a plant leaf to be recognized.
[0110] The disease classification module is used to input the plant leaf image to be recognized into the trained CAST-Net network model to obtain the disease classification result of the plant leaf to be recognized. The disease classification result includes whether the plant is diseased and the type of disease. The trained CAST-Net network model is obtained by training the CAST-Net network model using the self-distillation method according to the enhanced plant leaf disease atlas. The CAST-Net network model includes: a ShallowBlock layer, a first downsampling layer, a multi-Stage layer, a global average pooling layer, and a fully connected layer connected in sequence. The multi-Stage layer is built based on depth convolution, point convolution, and multi-head attention mechanism.
[0111] Embodiment 3
[0112] This embodiment provides an electronic device, including a memory and a processor. The memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the method for classifying plant leaf diseases based on deep learning described in Embodiment 1. The memory is a readable storage medium.
[0113] In this specification, each embodiment is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the system disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0114] In this article, specific examples are used to elaborate on the principles and implementation manners of the present invention. The descriptions of the above embodiments are only used to help understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for classifying plant leaf diseases based on deep learning, characterized in that Including: Obtain the image of the plant leaf to be recognized; Input the image of the plant leaf to be recognized into the trained CAST-Net network model to obtain the disease classification result of the plant leaf to be recognized; The disease classification result includes whether it is diseased and the type of disease; The trained CAST-Net network model is obtained by training the CAST-Net network model using the self-distillation method according to the enhanced plant leaf disease atlas; The CAST-Net network model includes: a ShallowBlock layer, a first downsampling layer, a multi-Stage layer, a global average pooling layer, and a fully connected layer connected in sequence; The multi-Stage layer is built based on depth convolution, point convolution, and multi-head attention mechanism.
2. The method for classifying plant leaf diseases based on deep learning according to claim 1, wherein The multi-Stage layer includes: a first Stage layer, a second downsampling layer, a second Stage layer, a third downsampling layer, a third Stage layer, a fourth downsampling layer, and a fourth Stage layer connected in sequence; The first Stage layer includes: a first local feature information extraction module and a first global feature information extraction module connected in sequence; The second Stage layer includes: a second local feature information extraction module and a second global feature information extraction module connected in sequence; The third Stage layer includes: a third local feature information extraction module and a third global feature information extraction module connected in sequence; The fourth Stage layer includes: a fourth local feature information extraction module and a fourth global feature information extraction module connected in sequence; The first local feature information extraction module, the second local feature information extraction module, the third local feature information extraction module, and the fourth local feature information extraction module all include: a plurality of local feature information extraction units connected in sequence; The first global feature information extraction module, the second global feature information extraction module, the third global feature information extraction module, and the fourth global feature information extraction module all include: a plurality of global feature information extraction units connected in sequence.
3. A method for classifying plant leaf diseases based on deep learning according to claim 2, characterized in that, The local feature information extraction unit includes: a channel association layer, a depth convolution layer, a first normalization-nonlinear activation layer, a point convolution layer, a second normalization-nonlinear activation layer, and a first concave fully connected layer connected in sequence; The input end of the channel association layer is also connected to the input end of the first concave fully connected layer.
4. A method for classifying plant leaf diseases based on deep learning according to claim 3, characterized in that, The global feature information extraction unit includes: a first convolution layer, an attention mechanism layer, a first splicing subunit, a second convolution layer, a global feature information extraction subunit, and a second concave fully connected layer connected in sequence; The output end of the first convolution layer is also connected to the input end of the first splicing subunit; The output end of the second convolution layer is also connected to the input end of the second concave fully connected layer.
5. The method for classifying plant leaf diseases based on deep learning according to claim 4, characterized in that, The structures of the first concave fully connected layer and the second concave fully connected layer are the same; The first concave fully connected layer includes: a second splicing subunit, a batch sample normalization layer, a third convolution layer, a nonlinear activation layer, a fourth convolution layer, and a third splicing subunit connected in sequence; The output end of the second splicing subunit is connected to the input end of the third splicing subunit.
6. A method for classifying plant leaf diseases based on deep learning according to claim 4, characterized in that, The global feature information extraction subunit includes: a dilated convolutional layer, a third normalization-nonlinear activation layer, and a fifth convolutional layer connected in sequence.
7. A method for classifying plant leaf diseases based on deep learning according to claim 1, characterized in that, The ShallowBlock layer includes: a sixth convolutional layer, a multi-branch layer, and a weighted splicing layer connected in sequence; The input end of the sixth convolutional layer is connected to the input end of the weighted splicing layer as a residual branch; The multi-branch layer includes a maximum pooling layer, an average pooling layer, and a multi-convolutional layer connected in parallel; The multi-convolutional layer includes: a first convolutional branch, a second convolutional branch, and a fourth splicing subunit; The input ends of the first convolutional branch and the second convolutional branch are both connected to the output end of the sixth convolutional layer; The output ends of the first convolutional branch and the second convolutional branch are both connected to the input end of the fourth splicing subunit; The output end of the fourth splicing subunit is connected to the input end of the weighted splicing layer; The first convolutional branch includes a seventh convolutional layer and an eighth convolutional layer connected in sequence; The second convolutional branch includes a ninth convolutional layer.
8. A method for classifying plant leaf diseases based on deep learning according to claim 1, characterized in that, Before obtaining the plant leaf image to be recognized, it further includes: Constructing a CAST-Net network model; Obtaining a plant leaf disease atlas; Performing enhancement processing on the plant leaf disease atlas to obtain an enhanced plant leaf disease atlas; the enhancement processing includes one or more of random exposure processing, Gaussian noise processing, and random pixel erasing processing; Training the CAST-Net network model using the self-distillation method according to the enhanced plant leaf disease atlas to obtain a trained CAST-Net network model.
9. A plant leaf disease classification system based on deep learning, characterized in that, It includes: An image acquisition module for acquiring a plant leaf image to be recognized; A disease classification module for inputting the plant leaf image to be recognized into the trained CAST-Net network model to obtain a disease classification result of the plant leaf to be recognized; the disease classification result includes whether it is diseased and the type of disease; The trained CAST-Net network model is obtained by training the CAST-Net network model using the self-distillation method according to the enhanced plant leaf disease atlas; The CAST-Net network model includes: a ShallowBlock layer, a first downsampling layer, a multi-Stage layer, a global average pooling layer, and a fully connected layer connected in sequence; The multi-Stage layer is built based on depth convolution, point convolution, and multi-head attention mechanism.
10. An electronic device, characterized in that, It includes a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute a method for classifying plant leaf diseases based on deep learning according to any one of claims 1 to 8; The memory is a readable storage medium.