Tomato leaf spot disease recognition method based on wave-subnet lightweight model

The Wave-SubNet lightweight model solves the problem of low recognition rate of tomato leaf spot disease by constructing a feature extraction network with Sub and Wave modules and adding an attention mechanism, achieving efficient and accurate disease identification, and is suitable for large-scale planting.

CN116152198BActive Publication Date: 2026-04-28HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAIYIN INSTITUTE OF TECHNOLOGY
Filing Date
2023-02-22
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing convolutional neural network models have low recognition rates in tomato leaf spot disease identification, and traditional methods are inefficient and have poor real-time performance, which cannot meet the needs of large-scale planting.

Method used

The Wave-SubNet lightweight model is adopted. By constructing a feature extraction network based on Sub and Wave modules and adding an improved attention mechanism, it is trained and optimized multiple times to achieve efficient identification of tomato leaf spot disease.

Benefits of technology

It improves the accuracy and speed of identifying tomato leaf spot disease. The model is simple, has low computational resource requirements, and has an identification efficiency of 99.98%, making it suitable for large-scale deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116152198B_ABST
    Figure CN116152198B_ABST
Patent Text Reader

Abstract

The application discloses a tomato leaf spot disease recognition method based on a Wave-SubNet light model, pre-acquired tomato leaf spot disease data pictures, artificial disease spot picture classification and data set making, and disease spot image preprocessing of the data set; a tomato leaf spot disease recognition network model based on the Wave-SubNet light model is constructed, including a preliminary feature extraction module, two Sub modules and four Wave modules; an improved attention mechanism is added at the end of the Sub module and the Wave module, and the Sub and Wave modules are stacked; the network model that has been constructed is trained, the trained model is used in network testing, finally, a classification result is output through a softmax activation function, and the model is iteratively trained multiple times to obtain the best model weight. The model has high recognition rate, simple model structure and great practical application value, and has great prospects in the field of agricultural crop leaf disease and pest recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision image processing and crop pest and disease identification technology, specifically to a method for identifying tomato leaf spot disease based on the Wave-SubNet lightweight model. Background Technology

[0002] In recent years, my country's agricultural industry has developed rapidly, with increasingly complete industrial models and supply chains, leading to continuously rising demands for both the yield and quality of crops. Furthermore, with increasing emphasis on health and a growing awareness of health, the market demand for tomatoes has also grown significantly. However, crop diseases and pests are a major factor affecting tomato yield. Plant diseases and pests are natural disasters that affect normal plant growth and can even lead to plant death throughout the entire growth process, from seed development to seedling stage. Leaf spot is one of the major diseases affecting tomatoes, and it can occur to varying degrees and in different types on the roots, stems, and fruits of common tomatoes. Therefore, early identification of crop diseases is crucial.

[0003] Pest and disease detection is a crucial research area in machine vision. It's a technology that uses machine vision equipment to acquire images and determine the presence of pests and diseases in plant images. However, real-world crop pest and disease images often have complex backgrounds and small affected areas, severely impacting the robustness and accuracy of identification. Furthermore, past methods relied on manual identification by technicians, but the varying levels of knowledge and experience among these technicians resulted in low accuracy and limited applicability to small-scale cultivation. Large-scale cultivation suffered from inefficiency, poor real-time performance, and high human resource costs. However, current advancements in machine vision-based pest and disease detection...

[0004] Detection equipment has been initially applied in agriculture, and to some extent has replaced traditional visual identification. Various deep learning-based pest and disease detection methods have been applied in practical agricultural work, and several domestic and international companies have developed deep learning-based pest and disease software. Therefore, deep learning-based plant pest and disease detection methods not only have significant academic research value but also a very broad market application prospect. Summary of the Invention

[0005] Purpose of the invention: This invention proposes a method for identifying tomato leaf spot disease based on a lightweight Wave-SubNet model. This method overcomes the shortcomings of traditional convolutional neural network models, solves the problem of low identification rate of tomato leaf spot disease, realizes lightweight deployment of tomato leaf spot disease identification, and improves the accuracy and speed of tomato leaf spot disease identification.

[0006] Technical Solution: This invention proposes a method for identifying tomato leaf spot disease based on a lightweight Wave-SubNet model, comprising the following steps:

[0007] (1) Classify the tomato leaf spot disease images obtained in advance and create a dataset;

[0008] (2) Perform image preprocessing on the dataset obtained in step (1) and divide the obtained sample data into training set, validation set and test set;

[0009] (3) Construct a lightweight model based on Wave-SubNet tomato leaf spot disease identification network, including a preliminary feature extraction module, a first feature extraction backbone module and a second feature extraction backbone module; the first feature extraction backbone module consists of two Sub modules and the second feature extraction backbone module consists of four Wave modules; an improved attention mechanism is added at the end of the Sub modules and Wave modules, and the Sub and Wave modules are stacked.

[0010] (4) The tomato leaf spot disease identification network based on the Wave-SubNet lightweight model built in step (3) is first input into the built model through model training after image preprocessing in step (2) for feature extraction. Through continuous iteration of forward and backward propagation, the model parameters are updated through momentum gradient descent algorithm to optimize the network parameters. Finally, the trained results are output through the SoftMax classifier.

[0011] (5) The tomato leaf spot disease identification network based on the Wave-SubNet lightweight model was trained iteratively multiple times, and the training parameters of the model were adjusted until the best model weights were obtained.

[0012] (6) Use the best training model weights obtained in step (5) as the pre-trained model to validate the data images in the test set and evaluate the performance of the model.

[0013] Further, the sample images of tomato leaf spot data in step (1) are used to determine the disease infecting the tomato leaves based on the size of the detected lesions and the color of the leaves around the lesions. The tomato leaf spot disease is divided into ten types according to its severity, including normal tomato leaves, tomato spot disease, tomato mosaic disease, tomato yellow leaf curl disease, tomato powdery mildew, tomato early blight, tomato late blight, tomato leaf spot, tomato leaf mold, and tomato spider mite damage.

[0014] Furthermore, the image preprocessing in step (2) involves data augmentation of all leaf images, including random rotation by 45 degrees, random flipping, and random cropping, to expand the dataset; and the dataset is divided into training set, validation set, and test set in a ratio of 8:1:1.

[0015] Furthermore, the preliminary feature extraction module in step (3) consists of a 7×7 convolution kernel, a 1×1 convolution kernel, and a 3×3 convolution kernel.

[0016] Furthermore, the Sub module in step (3) consists of two 3×3 convolutional kernels, an Improved-CBAM attention mechanism, and a 1×1 convolutional kernel.

[0017] Further, in the Wave module described in step (3), Wave-block1 and Wave-block2 consist of two 5×5 depth convolution kernels, one 3×3 convolution kernel and two 1×1 convolution kernels, while Wave-block3 and Wave-block4 consist of two 7×7 depth convolution kernels, one 3×3 convolution kernel and one 1×1 convolution kernel.

[0018] Further, in step (3), an improved attention mechanism, Improve-CBAM, is added to the Sub module and the end of the Wave module. The Improve-CBAM attention mechanism consists of two parts: spatial attention and channel attention. First, the feature map of size H×W×C is processed by two different pooling methods: global max pooling and global average pooling, to obtain two 1×1×C channel features. Then, the two channel features are fed into a feature extraction block consisting of a 1×1 ordinary convolution, a 3×3 depthwise convolution, and a 1×1 ordinary convolution, with ReLU as the activation function. Finally, the elements of the two output features are added element-wise and fused. The required channel attention map can be obtained by using the Sigmoid activation function.

[0019] Furthermore, the specific operation procedure for step (3) is as follows:

[0020] (31) In the preprocessing stage of the training sample image input model, the input RGB 3-channel tomato leaf image is first processed by step (2) image preprocessing, and the output feature vector is marked as S0;

[0021] (32) Input S0 into the preliminary feature extraction module, and use S0 as the input of the multi-convolutional network to perform a convolution operation with kernel_size=7, and then pass through the ReLU activation function and the MaxPool2d operation with kernel_size=3 to obtain the feature vector S11; perform a convolution operation with kernel_size=1 on S11, and then pass through the ReLU activation function to obtain the feature vector S12; perform a convolution operation with kernel_size=3 on S12, and then pass through the ReLU activation function and the MaxPool2d operation with kernel_size=3 to obtain the feature vector S13;

[0022] (33) Input S13 into the Sub-block1 module, and use S13 as the input of the hybrid convolutional network to perform a kernel_size=3 depth convolution operation, and then pass through the BatchNorm layer and Hardswish activation layer to obtain the feature vector S21; perform a kernel_size=3 convolution operation on S21, and then pass through the BatchNorm layer and Hardswish activation layer to obtain the feature vector S22; input S22 into the Improved-CBAM attention mechanism, the Improved-CBAM attention mechanism injects the attention map along the two independent dimensions of the channel space of the feature map, and performs adaptive feature refinement on the input feature map to obtain the more concentrated feature S23; perform a kernel_size=1 convolution operation on S23, and then pass through the BatchNorm layer to obtain the feature vector S24;

[0023] After passing through the Sub-block2 module: S24 is used as input to the hybrid convolutional network and subjected to a depthwise convolution operation with kernel_size=3, then passed through the BatchNorm layer and Hardswish activation layer to obtain feature vector S31; S31 is subjected to a convolution operation with kernel_size=3, then passed through the BatchNorm layer and Hardswish activation layer to obtain feature vector S32; S32 is input into the Improved-CBAM attention mechanism to obtain feature vector S33; S33 is subjected to a convolution operation with kernel_size=1, then passed through the BatchNorm layer to obtain feature vector S34;

[0024] (34) Input S34 into the Wave-block1 module, and use S34 as the input of the hybrid convolutional network to perform a depthwise convolution operation with kernel_size=5, and then pass it through the BatchNorm layer and the ReLU6 activation layer to obtain the feature vector S41; perform a convolution operation with kernel_size=1 on S41, and then pass it through the BatchNorm layer and the Hardswish activation layer to obtain the feature vector S42; perform a convolution operation with kernel_size=3 on S42, and then pass it through the BatchNorm layer and the Hardswish activation layer to obtain the feature vector S43; perform a convolution operation with kernel_size=1 on S43, and then pass it through the BatchNorm layer to obtain the feature vector S44; perform a depthwise convolution operation with kernel_size=5 on S44, and then pass it through the BatchNorm layer to obtain the feature vector S45; input S45 into the Improved-CBAM attention mechanism to obtain the feature vector S46.

[0025] After passing through the Wave-block2 module: S46 is used as input to the hybrid convolutional network and subjected to a depthwise convolution operation with kernel_size=5, then passed through a BatchNorm layer and a ReLU6 activation layer to obtain feature vector S51; S51 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S52; S52 is subjected to a convolution operation with kernel_size=3, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S53; S53 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer to obtain feature vector S54; S54 is subjected to a depthwise convolution operation with kernel_size=5, then passed through a BatchNorm layer to obtain feature vector S55; S55 is then input into the Improved-CBAM attention mechanism to obtain feature vector S56.

[0026] After passing through the Wave-block3 module: S56 is used as input to the hybrid convolutional network and subjected to a depthwise convolution operation with kernel_size=7, then passed through a BatchNorm layer and a ReLU6 activation layer to obtain feature vector S61; S61 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S62; S62 is subjected to a convolution operation with kernel_size=3, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S63; S63 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer to obtain feature vector S64; S64 is subjected to a depthwise convolution operation with kernel_size=7, then passed through a BatchNorm layer to obtain feature vector S65; S65 is input to the Improved-CBAM attention mechanism to obtain feature vector S66.

[0027] After passing through the Wave-block4 module: S66 is used as input to the hybrid convolutional network and undergoes a depthwise convolution operation with kernel_size=7, followed by a BatchNorm layer and a ReLU6 activation layer to obtain feature vector S71; S71 undergoes a convolution operation with kernel_size=1, followed by a BatchNorm layer and a Hardswish activation layer to obtain feature vector S72; S72 undergoes a convolution operation with kernel_size=3, followed by a BatchNorm layer and a Hardswish activation layer to obtain feature vector S73; S73 undergoes a convolution operation with kernel_size=1, followed by a BatchNorm layer to obtain feature vector S74; S74 undergoes a depthwise convolution operation with kernel_size=7, followed by a BatchNorm layer to obtain feature vector S75; finally, the improved-CBAM attention mechanism is used to obtain feature vector S76.

[0028] (35) Input S76 into AvgPool2d, a fully connected layer and a Softmax activation function, and finally output the classification result.

[0029] Beneficial effects: Compared with the prior art, the beneficial effects of the present invention are as follows:

[0030] 1. The model proposed in this invention does not require manual specification of features, but can automatically extract features from the data, and can achieve good results when processing various types of data;

[0031] 2. The model proposed in this invention adopts a stacked approach of serial modules. It mainly uses the serial connection of two main modules, Sub and Wave, to extract image features, making the feature differentiation of lesions more accurate. The serial connection of the two modules first extracts a large number of tomato lesion features through the Sub module, which greatly enriches the receptive field of the feature map. Furthermore, the stacking of two Sub modules can completely obtain a large number of features of tomato leaf spot disease. The serial connection of four Wave modules further improves the ability to extract specific lesion features. Moreover, the method of building the model by mixing depthwise separable convolution and ordinary convolution greatly reduces the number of model parameters.

[0032] 3. This invention incorporates the lightweight structure Improved-CBAM based on an attention mechanism, which can adjust the feature weights of each channel through network learning. The attention map is injected along two independent dimensions of the feature map: channel and space. This adaptively refines the input feature map, reducing the mixing of non-leaf spot features and thus weakening their adverse effects on the model's recognition performance. This allows the trained model to better achieve the effect of recognizing leaf spot.

[0033] 4. This invention can extract higher-level abstract features from initial images without image preprocessing, making the model highly resistant to interference; it has low computational resource requirements and is easier to deploy, greatly saving computational resources; the model recognition efficiency reaches 99.98%, and compared with traditional classification models, the network structure is simpler, the model parameters are the same or even lower, the convergence speed is faster, and the accuracy is higher, which has great practical application value and has great prospects in the field of identification of leaf diseases and pests in agricultural crops. Attached Figure Description

[0034] Figure 1 This is a flowchart of the present invention;

[0035] Figure 2 This is a schematic diagram of the tomato leaf spot disease identification network structure based on the Wave-SubNet lightweight model;

[0036] Figure 3 This is a schematic diagram of the network structure of the preliminary feature extraction module;

[0037] Figure 4 This is a schematic diagram of the Sub-block module network structure;

[0038] Figure 5 A schematic diagram of the improved-CBAM module network structure;

[0039] Figure 6 This is a schematic diagram of the network structure of the Wave-block module. Detailed Implementation

[0040] The specific implementation of the present invention will now be described in detail with reference to the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art.

[0041] This implementation involves a large number of variables, which are described below as shown in Table 1.

[0042] Table 1 Variable Description Table

[0043] variable Variable Description Sub-block The first feature extraction backbone module Wave-block The second feature extraction backbone module S0 Feature vectors output by image preprocessing S11 The feature vector after the first convolution in the preliminary feature extraction module S12 The feature vector after the second convolution in the initial feature extraction module S13 The feature vector after the third convolution in the initial feature extraction module S21 Feature vector after the first convolution in the Sub-block1 module S22 Feature vector after the second convolution in the Sub-block1 module S23 Feature vectors after attention mechanism in Sub-block1 module S24 The feature vector after the third convolution in the Sub-block1 module S31 Feature vector after the first convolution in the Sub-block2 module S32 Feature vector after the second convolution in the Sub-block2 module S33 Feature vectors after attention mechanism in the Sub-block2 module S34 The feature vector after the third convolution in the Sub-block2 module S41 Feature vector after the first convolution in the Wave-block1 module S42 Feature vector after the second convolution in the Wave-block1 module S43 The feature vector after the third convolution in the Wave-block1 module S44 The feature vector after the fourth convolution in the Wave-block1 module S45 The feature vector after the fifth convolution in the Wave-block1 module S46 Feature vectors after attention mechanism in Wave-block1 module S51 Feature vector after the first convolution in the Wave-block2 module S52 Feature vector after the second convolution in the Wave-block2 module S53 The feature vector after the third convolution in the Wave-block2 module S54 The feature vector after the fourth convolution in the Wave-block2 module S55 The feature vector after the fifth convolution in the Wave-block2 module S56 Feature vectors after attention mechanism in Wave-block2 module S61 Feature vector after the first convolution in the Wave-block3 module S62 Feature vector after the second convolution in the Wave-block3 module S63 The feature vector after the third convolution in the Wave-block3 module S64 The feature vector after the fourth convolution in the Wave-block3 module S65 The feature vector after the fifth convolution in the Wave-block3 module S66 Feature vectors after attention mechanism in the Wave-block3 module S71 Feature vector after the first convolution in the Wave-block4 module S72 Feature vector after the second convolution in the Wave-block4 module S73 The feature vector after the third convolution in the Wave-block4 module S74 The feature vector after the fourth convolution in the Wave-block4 module S75 The feature vector after the fifth convolution in the Wave-block4 module S76 Feature vectors after attention mechanism in the Wave-block4 module F SofMax classification results obtained through model calculation

[0044] This invention proposes a method for identifying tomato leaf spot disease based on a lightweight Wave-SubNet model, such as... Figure 1 As shown, the specific steps include:

[0045] Step 1: Classify and preprocess the pre-acquired tomato leaf spot disease data images, and divide them into training set, validation set and test set.

[0046] Data images of tomato leaf spot disease were obtained by photographing tomatoes in natural settings. The types of diseases infecting tomato leaves were then determined based on the size of the lesions and the color of the leaves around them. Tomato leaf spot diseases were classified into 10 types according to their severity and severity, including normal tomato leaves, tomato spot disease, tomato mosaic virus, tomato yellow leaf curl, tomato powdery mildew, tomato early blight, tomato late blight, tomato leaf spot, tomato leaf mold, and tomato spider mite damage, totaling 1,500 data images.

[0047] Image preprocessing was performed on the dataset, specifically data augmentation of all leaf images. This included random 45-degree rotation (randomly selecting some images and rotating them 45 degrees), random flipping (including horizontal, vertical, and diagonal flipping), and random cropping (randomly selecting portions of the original image samples and enlarging them to the original image size). These three methods were used to augment the dataset, and finally, all images were standardized to 224×224 pixels. After this image preprocessing, a total of 10058 data images were obtained as the final tomato leaf spot disease dataset. The obtained sample data was then divided into training, validation, and test sets in an 8:1:1 ratio.

[0048] Step 2: Construct a tomato leaf spot disease identification network based on the lightweight Wave-SubNet model, such as... Figure 2 As shown, the model includes a preliminary feature extraction module, a first feature extraction backbone module, and a second feature extraction backbone module. The first feature extraction backbone module consists of two Sub modules, and the second feature extraction backbone module consists of four Wave modules. The backbone network modules used in the tomato leaf spot disease recognition network are mainly constructed by mixing depthwise separable convolutions and ordinary convolutions to reduce the number of parameters. An improved CBAM attention mechanism is added after the second convolution in the first feature extraction backbone network, and a similar improved CBAM attention mechanism is added at the end of the second backbone network. The model follows a specific sequence: first, construct the preliminary feature extraction module; then, construct the Sub and Wave backbone networks; stack the Sub and Wave modules; and finally, construct the complete tomato leaf spot disease recognition network model. The specific steps include the following:

[0049] (1) The network structure of the preliminary feature extraction module is as follows: Figure 3As shown, it consists of a 7×7 convolutional kernel, a 1×1 convolutional kernel, and a 3×3 convolutional kernel. First, in the preprocessing stage of inputting the training sample images into the model, the input RGB 3-channel tomato leaf image undergoes image preprocessing, and the output feature vector is labeled S0. S0 is then input into the preliminary feature extraction module, where it undergoes a kernel_size=7 convolution operation as input to the multi-convolutional network, followed by a ReLU activation function and a MaxPool2d operation with a kernel_size=3 to obtain the feature vector S11. S11 undergoes a kernel_size=1 convolution operation, followed by a ReLU activation function to obtain the feature vector S12. Finally, S12 undergoes a kernel_size=3 convolution operation, followed by a ReLU activation function and a MaxPool2d operation with a kernel_size=3 to obtain the feature vector S13.

[0050] (2) The first feature extraction backbone module network structure consists of two sub-modules, such as Figure 4 As shown, the Sub module consists of two 3×3 convolutional kernels, an Improved-CBAM attention mechanism, and a 1×1 convolutional kernel. S13 is input into the first Sub module, and is used as input to a hybrid convolutional network (including ordinary convolutions and depthwise and separable convolutions) for a kernel_size=3 depthwise convolution operation. Then, it passes through a BatchNorm layer and a Hardswish activation layer to obtain the feature vector S21. S21 undergoes a kernel_size=3 convolution operation, then passes through a BatchNorm layer and a Hardswish activation layer to obtain the feature vector S22. S22 is then input into the Improved-CBAM attention mechanism, as shown... Figure 5 As shown, the Improved-CBAM attention mechanism consists of a Channel Attention Module and a Spatial Attention Module, which can perform attention on the channel and spatial dimensions respectively. The Improved-CBAM attention mechanism injects the attention map along the two independent dimensions of the feature map's channel space, adaptively refining the input feature map to obtain a more concentrated feature vector S23; S23 is then subjected to a convolution operation with kernel_size=1, and then passed through a BatchNorm layer to obtain the feature vector S24.

[0051] After passing through the Sub-block2 module: S24 is used as input to the hybrid convolutional network and subjected to a depthwise convolution operation with kernel_size=3, then passed through the BatchNorm layer and Hardswish activation layer to obtain feature vector S31; S31 is subjected to a convolution operation with kernel_size=3, then passed through the BatchNorm layer and Hardswish activation layer to obtain feature vector S32; S32 is input into the Improved-CBAM attention mechanism to obtain feature vector S33; S33 is subjected to a convolution operation with kernel_size=1, then passed through the BatchNorm layer to obtain feature vector S34.

[0052] (3) The second feature extraction backbone module network structure consists of four Wave modules, such as Figure 6 As shown, the Wave module is divided into two types: Wave-block1 and Wave-block2 consist of two 5×5 depth convolution kernels, one 3×3 convolution kernel, and two 1×1 convolution kernels; Wave-block3 and Wave-block4 consist of two 7×7 depth convolution kernels, one 3×3 convolution kernel, and one 1×1 convolution kernel.

[0053] Input S34 into the Wave-block1 module. S34 is then used as input to a hybrid convolutional network (including regular convolutions and depthwise and separable convolutions) for a depthwise convolution operation with kernel_size=5. This is followed by a BatchNorm layer and a ReLU6 activation layer to obtain feature vector S41. S41 is then subjected to a kernel_size=1 convolution operation, followed by a BatchNorm layer and a Hardswish activation layer to obtain feature vector S42. S42 is then subjected to a kernel_size=3 convolution operation, followed by a BatchNorm layer and a Hardswish activation layer to obtain feature vector S43. S43 is then subjected to a kernel_size=1 convolution operation, followed by a BatchNorm layer to obtain feature vector S44. S44 is then subjected to a depthwise convolution operation with kernel_size=5, followed by a BatchNorm layer to obtain feature vector S45. Finally, S45 is input into the Improved-CBAM attention mechanism to obtain feature vector S46.

[0054] After passing through the Wave-block2 module: S46 is used as input to the hybrid convolutional network and subjected to a depthwise convolution operation with kernel_size=5, then passed through a BatchNorm layer and a ReLU6 activation layer to obtain feature vector S51; S51 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S52; S52 is subjected to a convolution operation with kernel_size=3, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S53; S53 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer to obtain feature vector S54; S54 is subjected to a depthwise convolution operation with kernel_size=5, then passed through a BatchNorm layer to obtain feature vector S55; S55 is then input into the Improved-CBAM attention mechanism to obtain feature vector S56.

[0055] After passing through the Wave-block3 module: S56 is used as input to the hybrid convolutional network and subjected to a depthwise convolution operation with kernel_size=7, then passed through a BatchNorm layer and a ReLU6 activation layer to obtain feature vector S61; S61 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S62; S62 is subjected to a convolution operation with kernel_size=3, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S63; S63 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer to obtain feature vector S64; S64 is subjected to a depthwise convolution operation with kernel_size=7, then passed through a BatchNorm layer to obtain feature vector S65; S65 is input into the Improved-CBAM attention mechanism to obtain feature vector S66.

[0056] After passing through the Wave-block4 module: S66 is used as input to the hybrid convolutional network and subjected to a depthwise convolution operation with kernel_size=7, then passed through a BatchNorm layer and a ReLU6 activation layer to obtain feature vector S71; S71 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S72; S72 is subjected to a convolution operation with kernel_size=3, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S73; S73 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer to obtain feature vector S74; S74 is subjected to a depthwise convolution operation with kernel_size=7, then passed through a BatchNorm layer to obtain feature vector S75; the improved-CBAM attention mechanism is then used to obtain feature vector S76.

[0057] Step 3: Input the feature vector S76 obtained by extracting the feature vector in sequence through the three feature modules into the AvgPool2d fully connected layer with kernel_size=7 and stride=1, and then construct a Softmax classifier to convert the input feature vector into a probability vector about the class and output it. Each probability component corresponds to a training class probability.

[0058] Step 4: Train the tomato leaf spot disease identification network based on the built Wave-SubNet lightweight model. First, input the training set after image preprocessing into the built network model for feature extraction. Then, through continuous iterative forward and backward propagation, the model parameters are updated and optimized by the momentum gradient descent algorithm. Finally, the trained result F is output through the SoftMax classifier.

[0059] Step 5: Train the pre-built lightweight Wave-SubNet model for identifying tomato leaf spot disease, and perform multiple iterations of training on the network model, adjusting the model's training parameters: learning rate (lr), batch size (batch_size), number of iterations (epoch), and optimizer, until the best model weights are obtained.

[0060] Step 6: Use the best training model weights as the pre-trained model to validate the data images in the validation set, and evaluate the model's performance using four metrics: accuracy, precision, recall, and F1-measure.

[0061] The calculation formulas for each indicator are as follows:

[0062]

[0063]

[0064]

[0065]

[0066] Among them, TP (True Positives): True positives, which are predicted to be positive and are actually positive; FP (False Positives): False positives, which are predicted to be positive but are actually negative; FN (False Negatives): False negatives, which are predicted to be negative but are actually positive; TN (True Negatives): True negatives, which are predicted to be negative and are actually negative.

[0067] Table 2 Comparison of experimental results using the present invention with those using the traditional model and the lightweight model.

[0068]

[0069] The experimental results of the tomato leaf spot disease identification network model based on the Wave-SubNet lightweight model proposed in this invention are shown in Table 2. It can be seen that the identification efficiency of the proposed model reaches 99.98%. Moreover, the model size is only 3.55M. Compared with traditional classification models, the model is simpler, converges faster, and has higher accuracy, showing high robustness and practical application value. It has great potential in the field of crop leaf disease and pest identification.

Claims

1. A method for identifying tomato leaf spot disease based on a lightweight Wave-SubNet model, characterized in that, Includes the following steps: (1) Classify the tomato leaf spot disease images obtained in advance and create a dataset; (2) Perform image preprocessing on the dataset obtained in step (1) and divide the obtained sample data into training set, validation set and test set; (3) Construct a lightweight model based on Wave-SubNet tomato leaf spot disease identification network, including a preliminary feature extraction module, a first feature extraction backbone module and a second feature extraction backbone module; the first feature extraction backbone module consists of two Sub modules and the second feature extraction backbone module consists of four Wave modules; an improved attention mechanism is added at the end of the Sub modules and Wave modules, and the Sub and Wave modules are stacked. (4) The tomato leaf spot disease identification network based on the Wave-SubNet lightweight model built in step (3) is first input into the built model through model training after image preprocessing in step (2) for feature extraction. Through continuous iteration of forward and backward propagation, the model parameters are updated through momentum gradient descent algorithm to optimize the network parameters. Finally, the trained results are output through the SoftMax classifier. (5) The tomato leaf spot disease identification network based on the Wave-SubNet lightweight model was trained iteratively multiple times, and the training parameters of the model were adjusted until the best model weights were obtained. (6) Use the best training model weights obtained in step (5) as the pre-trained model to validate the data images in the test set and evaluate the performance of the model; The Sub module described in step (3) consists of two 3×3 convolutional kernels, an Improved-CBAM attention mechanism, and a 1×1 convolutional kernel; In step (3), Wave-block1 and Wave-block2 consist of two 5×5 depth convolution kernels, one 3×3 convolution kernel and two 1×1 convolution kernels, while Wave-block3 and Wave-block4 consist of two 7×7 depth convolution kernels, one 3×3 convolution kernel and one 1×1 convolution kernel. Step (3) involves adding an improved attention mechanism, Improved-CBAM, to the Sub module and the end of the Wave module. The Improved-CBAM attention mechanism consists of two parts: spatial attention and channel attention. First, the feature map of size H×W×C is processed by two different pooling methods: global max pooling and global average pooling, to obtain two 1×1×C channel features. Then, the two channel features are fed into a feature extraction block consisting of a 1×1 ordinary convolution, a 3×3 depthwise convolution, and a 1×1 ordinary convolution, using ReLU as the activation function. Finally, the elements of the two output features are added element-wise and fused. The required channel attention map can be obtained by using the Sigmoid activation function. The specific operation procedure for step (3) is as follows: (31) In the preprocessing stage of the training sample image input model, the input RGB 3-channel tomato leaf image is first processed by step (2) image preprocessing, and the output feature vector is marked as S0; (32) Input S0 into the preliminary feature extraction module, and use S0 as the input of the multi-convolutional network to perform a convolution operation with kernel_size=7, and then pass through the ReLU activation function and the MaxPool2d operation with kernel_size=3 to obtain the feature vector S11; perform a convolution operation with kernel_size=1 on S11, and then pass through the ReLU activation function to obtain the feature vector S12; perform a convolution operation with kernel_size=3 on S12, and then pass through the ReLU activation function and the MaxPool2d operation with kernel_size=3 to obtain the feature vector S13; (33) Input S13 into the Sub-block1 module, and use S13 as the input of the hybrid convolutional network to perform a kernel_size=3 depth convolution operation, and then pass through the BatchNorm layer and Hardswish activation layer to obtain the feature vector S21; perform kernel_size=3 convolution operation on S21, and then pass through the BatchNorm layer and Hardswish activation layer to obtain the feature vector S22; input S22 into the Improved-CBAM attention mechanism, the Improved-CBAM attention mechanism injects the attention map along the two independent dimensions of the channel space of the feature map, and performs adaptive feature refinement on the input feature map to obtain the more concentrated feature S23; Perform a convolution operation of kernel_size=1 on S23, and then pass it through the BatchNorm layer to obtain the feature vector S24; After passing through the Sub-block2 module: S24 is used as input to the hybrid convolutional network and subjected to a depthwise convolution operation with kernel_size=3, then passed through the BatchNorm layer and Hardswish activation layer to obtain feature vector S31; S31 is subjected to a convolution operation with kernel_size=3, then passed through the BatchNorm layer and Hardswish activation layer to obtain feature vector S32; S32 is input into the Improved-CBAM attention mechanism to obtain feature vector S33; S33 is subjected to a convolution operation with kernel_size=1, then passed through the BatchNorm layer to obtain feature vector S34; (34) Input S34 into the Wave-block1 module, use S34 as the input of the hybrid convolutional network to perform a depthwise convolution operation of kernel_size=5, and then pass through the BatchNorm layer and ReLU6 activation layer to obtain the feature vector S41. Perform a convolution operation of kernel_size=1 on S41, and then pass it through the BatchNorm layer and the Hardswish activation layer in sequence to obtain the feature vector S42; Perform a convolution operation of kernel_size=3 on S42, and then pass it through the BatchNorm layer and the Hardswish activation layer to obtain the feature vector S43. Perform a convolution operation of kernel_size=1 on S43, and then pass it through the BatchNorm layer to obtain the feature vector S44; S44 is subjected to a depthwise convolution operation with kernel_size=5, and then passed through the BatchNorm layer to obtain the feature vector S45; S45 is input into the Improved-CBAM attention mechanism to obtain the feature vector S46. After passing through the Wave-block2 module: S46 is used as input to the hybrid convolutional network and subjected to a depthwise convolution operation with kernel_size=5, then passed through a BatchNorm layer and a ReLU6 activation layer to obtain feature vector S51; S51 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S52; S52 is subjected to a convolution operation with kernel_size=3, then passed through a BatchNorm layer and a Hardswish activation layer to obtain feature vector S53; S53 is subjected to a convolution operation with kernel_size=1, then passed through a BatchNorm layer to obtain feature vector S54; S54 is subjected to a depthwise convolution operation with kernel_size=5, then passed through a BatchNorm layer to obtain feature vector S55; S55 is then input into the Improved-CBAM attention mechanism to obtain feature vector S56. After passing through the Wave-block3 module: S56 is used as the input of the hybrid convolutional network and subjected to a depthwise convolution operation with kernel_size=7, and then passed through the BatchNorm layer and the ReLU6 activation layer to obtain the feature vector S61; S61 is subjected to a convolution operation with kernel_size=1, and then passed through the BatchNorm layer and the Hardswish activation layer to obtain the feature vector S62. S62 is convolved with kernel_size=3, then passed through BatchNorm and Hardswish activation layers to obtain feature vector S63; S63 is convolved with kernel_size=1, then passed through BatchNorm layers to obtain feature vector S64; S64 is convolved with kernel_size=7, then passed through BatchNorm layers to obtain feature vector S65; S65 is then input into the Improved-CBAM attention mechanism to obtain feature vector S66. After passing through the Wave-block4 module: S66 is used as input to the hybrid convolutional network and undergoes a depthwise convolution operation with kernel_size=7, followed by a BatchNorm layer and a ReLU6 activation layer to obtain feature vector S71; S71 undergoes a convolution operation with kernel_size=1, followed by a BatchNorm layer and a Hardswish activation layer to obtain feature vector S72; S72 undergoes a convolution operation with kernel_size=3, followed by a BatchNorm layer and a Hardswish activation layer to obtain feature vector S73; S73 undergoes a convolution operation with kernel_size=1, followed by a BatchNorm layer to obtain feature vector S74; S74 undergoes a depthwise convolution operation with kernel_size=7, followed by a BatchNorm layer to obtain feature vector S75; and the improved-CBAM attention mechanism is then used to obtain feature vector S76. (35) Input S76 into AvgPool2d, a fully connected layer and a Softmax activation function, and finally output the classification result.

2. The method for identifying tomato leaf spot disease based on a lightweight Wave-SubNet model according to claim 1, characterized in that, The sample images of tomato leaf spot data in step (1) are used to determine the disease infecting the tomato leaves based on the size of the lesions and the color of the leaves around the lesions. The tomato leaf spot disease is divided into ten types according to the severity of the disease, including normal tomato leaves, tomato spot disease, tomato mosaic disease, tomato yellow leaf curl disease, tomato powdery mildew, tomato early blight, tomato late blight, tomato leaf spot, tomato leaf mold, and tomato spider mite damage.

3. The method for identifying tomato leaf spot disease based on a lightweight Wave-SubNet model according to claim 1, characterized in that, The image preprocessing in step (2) involves data augmentation of all leaf images, including random rotation by 45 degrees, random flipping, and random cropping, to expand the dataset; and the dataset is divided into training set, validation set, and test set in a ratio of 8:1:

1.

4. The method for identifying tomato leaf spot disease based on a lightweight Wave-SubNet model according to claim 1, characterized in that, The preliminary feature extraction module in step (3) consists of a 7×7 convolution kernel, a 1×1 convolution kernel, and a 3×3 convolution kernel.

Citation Information

Patent Citations

  • Weather image recognition method based on lightweight convolutional neural network

    CN110929603A

  • Oil and gas pipeline marker identification method based on neural network

    CN111339858A