Lightweight network-based tomato disease and insect pest identification research method

By building a lightweight network based on NanoDet-Plus, combining the DPNet target detection network and multi-scale feature fusion structure, the problem of low recognition accuracy in tomato disease detection is solved, and efficient and accurate disease detection is achieved and identification, suitable for embedded device deployment, meet practical application needs.

CN119169612APending Publication Date: 2024-12-20NINGBO UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411181209.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Traditional convolutional neural networks have low recognition accuracy in tomato disease detection, complex model structure, large parameters, difficult to promote, and cannot meet the actual application needs.

Method used

Using a lightweight network based on NanoDet-Plus, combining DPNet target detection network and multi-scale feature fusion structure, a lightweight tomato pest recognition model is built, and real-time detection and automation application is realized through high-definition cameras.

Benefits of technology

It significantly improves the accuracy of disease detection and model generalization capabilities, reduces the network size, realizes real-time detection and automation applications, and is easy to deploy and widely promote in embedded devices, and has important economic and social benefits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169612A_ABST
    Figure CN119169612A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of deep learning intelligent agriculture, in particular to a tomato disease and insect pest recognition research method based on a lightweight network, which comprises the following steps: S1, collecting and preprocessing a tomato leaf disease and insect pest original image data set; s2, according to classification of tomato diseases, dividing the tomato leaf disease normalized image data set into a training set and a verification set according to a proportion of 8: 2; s3, constructing a lightweight tomato leaf disease identification model based on DPNet; s4, setting model initial parameters, and training the constructed tomato leaf disease lightweight identification model to obtain model parameters; s5, performing precision verification on the 10 trained tomato leaf disease lightweight identification models by using the overall verification set in the S2; s6, deploying the trained tomato leaf disease lightweight identification model to a tomato base, obtaining a tomato growth stage image, and inputting the image into the tomato leaf disease lightweight identification model; and the requirements of current practical application are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of deep learning smart agriculture, and in particular to a research method for tomato pest and disease identification based on a lightweight network. Background Art

[0002] Tomato is one of the most important vegetable crops in the global economy. It is widely planted because of its strong adaptability, cold and heat resistance, short growth cycle and high yield. However, tomatoes are susceptible to various diseases during their growth, such as leaf spot, early blight and late blight. These diseases not only limit the growth and development of tomatoes, resulting in a decrease in yield, but also affect their quality and taste, and may even cause plant death, resulting in serious economic losses. Therefore, rapid and accurate detection and control of tomato diseases is crucial to ensuring food security and sustainable agricultural development.

[0003] Traditional manual inspection and chemical analysis methods for tomato leaf diseases rely on experts and are easily affected by personal factors, resulting in misjudgment and untimely diagnosis, causing economic losses. In recent years, with the development of computer vision and machine learning technology, the tomato leaf disease recognition method based on machine learning manually extracts disease image features and then inputs them into the classifier for recognition. It has low accuracy and requires manual labeling, which is time-consuming and laborious. Convolutional neural networks have made significant progress in crop disease recognition and can automatically extract diseased leaf features for recognition. However, the feature extraction of traditional convolutional neural networks is not comprehensive enough and it is easy to learn more background features in complex backgrounds, resulting in low recognition accuracy. In addition, the model structure is complex, the number of parameters is large, and the amount of calculation is high, making it difficult to promote in real life. There are great limitations in tomato disease detection and it cannot meet the needs of current practical applications. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a tomato disease and pest identification research method based on a lightweight network, which can achieve efficient and accurate disease detection and identification while significantly improving the disease detection accuracy and the generalization ability of the model.

[0005] A lightweight network-based tomato pest and disease identification research method of the present invention comprises the following steps: S1. Collect and preprocess the original image dataset of tomato leaf diseases and insect pests; S2. According to the classification of tomato diseases, the normalized tomato leaf disease image dataset is divided into a training set and a validation set in a ratio of 8:2. If the total number of tomato leaf images of a certain disease type cannot be divided by 10, the excess tomato leaf images are put into the training set of the disease type, and the training sets of all disease types are combined to obtain an overall training set, and the validation sets of all disease types are combined to obtain an overall validation set; S3, build a lightweight tomato leaf disease recognition model based on DPNet; S4, setting the initial parameters of the model, training the constructed lightweight recognition model for tomato leaf diseases, and obtaining the model parameters; S5. Use the overall verification set in S2 to verify the accuracy of the 10 trained tomato leaf disease lightweight recognition models, select the model with the highest verification accuracy as the best tomato leaf disease lightweight recognition model, if there are multiple models with high accuracy and the same accuracy, randomly select one of the multiple models as the best tomato leaf disease lightweight recognition model, save the weight of the best tomato leaf disease lightweight recognition model, and obtain the trained tomato leaf disease lightweight recognition model; S6. Deploy the trained lightweight tomato leaf disease recognition model to the tomato base, obtain tomato growth stage images through a high-definition camera, and input the images into the lightweight tomato leaf disease recognition model; the present invention constructs a lightweight tomato disease and pest recognition model based on NanoDet-Plus, adopts advanced network structure and data processing methods, realizes efficient and accurate disease detection and recognition, and significantly improves the disease detection accuracy and the generalization ability of the model, reduces the network volume, realizes real-time detection and automated application, is easy to deploy in some embedded devices, and is easy to promote on a large scale. It has important economic and social benefits and meets the needs of current practical applications.

[0006] Preferably, in S1, the specific steps of collecting the original image dataset of tomato leaf pests and diseases and preprocessing it are: S1.1. Take N images of tomato leaves with diseases at a tomato planting base, where N is an integer greater than or equal to 2000, and label each tomato leaf image according to the type of tomato disease, to obtain N labeled tomato leaf disease images to form a tomato leaf disease original image dataset; S1.2, using the preprocessing methods of flipping, random rotation, brightness transformation, Gaussian blur, adding agitation, random cropping and random translation to process each tomato leaf image in the tomato leaf disease original image dataset to obtain the tomato leaf disease expanded image dataset; S1.3. The image resolution of each tomato leaf image in the tomato leaf disease expanded image dataset is first scaled to 224 pixels × 224 pixels, and then normalized to obtain a tomato leaf disease normalized image dataset.

[0007] Preferably, in S3, the tomato disease recognition model includes three parts: Backbone, Neck and Head. Backbone adopts a parallel architecture, uses multiple ASU modules with a stride of 2 to form a low-resolution feature extraction path, and uses multiple ASU modules with a stride of 1 to form a high-resolution feature extraction path. The two paths use 2 Bi-FM modules to enhance cross-resolution feature integration and interaction. Neck starts with 3 1×1 convolutional layers to produce features with the same number of channels and various resolutions. Neck fusion includes 2 LCCM-TD modules and 2 LCCM-BU modules; Head includes 1 5×5 convolutional layer and 1 1×1 convolutional layer.

[0008] Preferably, in S3, the specific steps of constructing a lightweight tomato leaf disease recognition model based on DPNet are: S3.1. The main body of the network uses the DPNet target detection network. DPNet adopts a dual-path structure, one of which is used to capture spatial features and the other is used to capture contextual information. S3.2. In the Neck part, DPNet adds a lightweight attention mechanism and a multi-scale feature fusion structure; S3.3. A new lightweight tomato pest and disease detection model is constructed through S3.1 and S3.2; the constructed lightweight tomato leaf disease recognition model is obtained; the main body of the network uses the DPNet target detection network to improve the detection accuracy and efficiency. DPNet adopts a dual-path structure, one of which is used to capture spatial features and the other is used to capture contextual information to improve the network's detection ability for various targets. In the Neck part, DPNet adds a lightweight attention mechanism and a multi-scale feature fusion structure to replace the standard FPN structure in the original network. These improvements help to better integrate image detail information and improve the detection accuracy of small targets. Finally, a new lightweight tomato pest and disease detection model is constructed through S3.1 and S3.2; the constructed lightweight tomato leaf disease recognition model is obtained.

[0009] Preferably, in S4, the initial parameters of the model are set, and the specific steps of training the constructed lightweight recognition model for tomato leaf diseases are as follows: S4.1, input the entire training set in S2 into the established lightweight recognition model for tomato leaf diseases; S4.2, set the training parameters, where the initial learning rate is set to 0-1, the optimizer momentum is set to 0-1, the weight decay is set to 0-0.001, the batch size is set to 0-20, and the number of training epochs is set to 200; S4.3. Save a model after every 20 epochs of training. After 200 epochs of training, 10 models will be obtained, and 10 trained tomato leaf disease lightweight recognition models will be obtained.

[0010] Preferably, in S6, the specific steps of deploying the trained lightweight tomato leaf disease recognition model to the tomato base are as follows: S6.1. Install high-definition cameras at the tomato base to obtain images of tomato growth stages; S6.2. Deploy the lightweight tomato leaf disease recognition model to the Raspberry Pi 4B+; S6.3, connecting the camera output to the Raspberry Pi 4B+, and transmitting the acquired tomato disease image to the input of the lightweight recognition model for tomato leaf diseases; S6.4. The lightweight recognition model for tomato leaf diseases outputs the detected images to the management center for management personnel to view.

[0011] Preferably, in S4.2, the initial learning rate is set to 0.1.

[0012] Preferably, in S4.2, the optimizer momentum is set to 0.9.

[0013] Preferably, in S4.2, the weight decay is set to 0.0001.

[0014] Preferably, in S4.2, the batch size is set to 16.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention constructs a lightweight tomato disease and pest identification model based on NanoDet-Plus, adopts advanced network structure and data processing methods, realizes efficient and accurate disease detection and identification, and significantly improves the disease detection accuracy and the generalization ability of the model, reduces the network volume, realizes real-time detection and automated application, is easy to deploy in some embedded devices, and is easy to promote on a large scale. It has important economic and social benefits and meets the needs of current practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a detection flow chart of the present invention; Figure 2 is a structural diagram of a lightweight tomato leaf disease identification model of the present invention; Figure 3 is a structural diagram of the ASU module of the lightweight tomato leaf disease recognition model of the present invention; Figure 4 It is a Bi-FM structure diagram of the lightweight tomato leaf disease recognition model of the present invention. DETAILED DESCRIPTION

[0017] In order to facilitate understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. The present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0018] Example 1 like Figures 1 to 4 As shown, a tomato pest and disease identification research method based on a lightweight network of the present invention comprises the following steps: S1. Collect and preprocess the original image dataset of tomato leaf diseases and insect pests; S2. According to the classification of tomato diseases, the normalized tomato leaf disease image dataset is divided into a training set and a validation set in a ratio of 8:2. If the total number of tomato leaf images of a certain disease type cannot be divided by 10, the excess tomato leaf images are put into the training set of the disease type, and the training sets of all disease types are combined to obtain an overall training set, and the validation sets of all disease types are combined to obtain an overall validation set; S3, build a lightweight tomato leaf disease recognition model based on DPNet; S4, setting the initial parameters of the model, training the constructed lightweight recognition model for tomato leaf diseases, and obtaining the optimal model parameters; S5. Use the overall verification set in S2 to verify the accuracy of the 10 trained tomato leaf disease lightweight recognition models, select the model with the highest verification accuracy as the best tomato leaf disease lightweight recognition model, if there are multiple models with high accuracy and the same accuracy, randomly select one of the multiple models as the best tomato leaf disease lightweight recognition model, save the weight of the best tomato leaf disease lightweight recognition model, and obtain the trained tomato leaf disease lightweight recognition model; S6. Deploy the trained lightweight recognition model for tomato leaf diseases to the tomato base, obtain images of tomato growth stages through a high-definition camera, and input the images into the lightweight recognition model for tomato leaf diseases; In S1, the specific steps of collecting the original image dataset of tomato leaf pests and diseases and preprocessing are as follows: S1.1. Take N images of tomato leaves with diseases at a tomato planting base, where N is an integer greater than or equal to 2000, and label each tomato leaf image according to the type of tomato disease, to obtain N labeled tomato leaf disease images to form a tomato leaf disease original image dataset; S1.2, using the preprocessing methods of flipping, random rotation, brightness transformation, Gaussian blur, adding agitation, random cropping and random translation to process each tomato leaf image in the tomato leaf disease original image dataset to obtain the tomato leaf disease expanded image dataset; S1.3, scaling the image resolution of each tomato leaf image in the tomato leaf disease expanded image dataset to 224 pixels × 224 pixels, and then performing normalization processing to obtain a tomato leaf disease normalized image dataset; In S3, the specific steps of constructing a lightweight tomato leaf disease recognition model based on DPNet are as follows: S3.1. The main body of the network uses the DPNet target detection network. DPNet adopts a dual-path structure, one of which is used to capture spatial features and the other is used to capture contextual information. S3.2. In the Neck part, DPNet adds a lightweight attention mechanism and a multi-scale feature fusion structure; S3.3. Construct a new lightweight tomato pest and disease detection model through S3.1 and S3.2; obtain the constructed lightweight tomato leaf disease recognition model.

[0019] Example 2 like Figures 1 to 4 As shown, a tomato pest and disease identification research method based on a lightweight network of the present invention comprises the following steps: S1. Collect and preprocess the original image dataset of tomato leaf diseases and insect pests; S2. According to the classification of tomato diseases, the normalized tomato leaf disease image dataset is divided into a training set and a validation set in a ratio of 8:2. If the total number of tomato leaf images of a certain disease type cannot be divided by 10, the excess tomato leaf images are put into the training set of the disease type, and the training sets of all disease types are combined to obtain an overall training set, and the validation sets of all disease types are combined to obtain an overall validation set; S3. Construct a lightweight tomato leaf disease recognition model based on DPNet; the tomato disease recognition model includes three parts: Backbone, Neck and Head. Specifically, Backbone adopts a parallel architecture, uses multiple ASU modules with a stride of 2 to form a low-resolution feature extraction path, and uses multiple ASU modules with a stride of 1 to form a high-resolution feature extraction path. The two paths use two Bi-FM modules to enhance cross-resolution feature integration and interaction. The ASU modules are as follows: Figure 3 As shown, the Bi-FM module is Figure 4As shown in the figure; Neck starts with 3 1×1 convolutional layers to produce features with the same number of channels and various resolutions. Neck fusion includes 2 LCCM-TD modules and 2 LCCM-BU modules; Head includes 1 5×5 convolutional layer and 1 1×1 convolutional layer; S4, setting the initial parameters of the model, training the constructed lightweight recognition model for tomato leaf diseases, and obtaining the optimal model parameters; S5. Use the overall verification set in S2 to verify the accuracy of the 10 trained tomato leaf disease lightweight recognition models, select the model with the highest verification accuracy as the best tomato leaf disease lightweight recognition model, if there are multiple models with high accuracy and the same accuracy, randomly select one of the multiple models as the best tomato leaf disease lightweight recognition model, save the weight of the best tomato leaf disease lightweight recognition model, and obtain the trained tomato leaf disease lightweight recognition model; S6. Deploy the trained lightweight recognition model for tomato leaf diseases to the tomato base, obtain images of tomato growth stages through a high-definition camera, and input the images into the lightweight recognition model for tomato leaf diseases; In S1, the specific steps of collecting the original image dataset of tomato leaf pests and diseases and preprocessing are as follows: S1.1. Take N images of tomato leaves with diseases at a tomato planting base, where N is an integer greater than or equal to 2000, and label each tomato leaf image according to the type of tomato disease, to obtain N labeled tomato leaf disease images to form a tomato leaf disease original image dataset; S1.2, using the preprocessing methods of flipping, random rotation, brightness transformation, Gaussian blur, adding agitation, random cropping and random translation to process each tomato leaf image in the tomato leaf disease original image dataset to obtain the tomato leaf disease expanded image dataset; S1.3, scaling the image resolution of each tomato leaf image in the tomato leaf disease expanded image dataset to 224 pixels × 224 pixels, and then performing normalization processing to obtain a tomato leaf disease normalized image dataset; In S3, the specific steps of constructing a lightweight tomato leaf disease recognition model based on DPNet are as follows: S3.1. The main body of the network uses the DPNet target detection network. DPNet adopts a dual-path structure, one of which is used to capture spatial features and the other is used to capture contextual information. S3.2. In the Neck part, DPNet adds a lightweight attention mechanism and a multi-scale feature fusion structure; S3.3, construct a new lightweight tomato pest and disease detection model through S3.1 and S3.2; obtain the constructed lightweight tomato leaf disease recognition model; In S4, the initial parameters of the model are set, and the specific steps for training the constructed lightweight recognition model for tomato leaf diseases are as follows: S4.1, input the entire training set in S2 into the established lightweight recognition model for tomato leaf diseases; S4.2, set the training parameters, where the initial learning rate is set to 0.1, the optimizer momentum is set to 0.9, the weight decay is set to 0.0001, the batch size is set to 16, and the number of training epochs is set to 200; S4.3. After every 20 epochs of training, a model is saved. After 200 epochs of training, 10 models are obtained, and 10 trained lightweight recognition models for tomato leaf diseases are obtained. In S6, the trained lightweight recognition model for tomato leaf diseases is deployed to the tomato base in the following specific steps: S6.1. Install high-definition cameras at the tomato base to obtain images of tomato growth stages; S6.2. Deploy the lightweight tomato leaf disease recognition model to the Raspberry Pi 4B+; S6.3, connecting the camera output to the Raspberry Pi 4B+, and transmitting the acquired tomato disease image to the input of the lightweight recognition model for tomato leaf diseases; S6.4. The lightweight recognition model for tomato leaf diseases outputs the detected images to the management center for management personnel to view.

[0020] The main functions achieved by the present invention are: by constructing a lightweight tomato disease and pest identification model based on NanoDet-Plus, the present invention adopts advanced network structure and data processing methods, realizes efficient and accurate disease detection and identification, and at the same time significantly improves the disease detection accuracy and the generalization ability of the model, reduces the network volume, realizes real-time detection and automated application, is easy to deploy in some embedded devices, and is easy to promote on a large scale. It has important economic and social benefits and meets the needs of current practical applications.

[0021] The invention discloses a lightweight network-based tomato pest and disease identification research method, wherein the installation method, connection method or setting method are all common mechanical methods, and any method that can achieve its beneficial effects can be implemented.

[0022] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A research method for tomato pest and disease identification based on lightweight network, characterized in that: The following steps are involved: S1. Collect and preprocess the original image dataset of tomato leaf diseases and insect pests; S2. According to the classification of tomato diseases, the normalized tomato leaf disease image dataset is divided into a training set and a validation set in a ratio of 8:

2. If the total number of tomato leaf images of a certain disease type cannot be divided by 10, the excess tomato leaf images are put into the training set of the disease type, and the training sets of all disease types are combined to obtain an overall training set, and the validation sets of all disease types are combined to obtain an overall validation set; S3, build a lightweight tomato leaf disease recognition model based on DPNet; S4, setting the initial parameters of the model, training the constructed lightweight recognition model for tomato leaf diseases, and obtaining the model parameters; S5. Use the overall verification set in S2 to verify the accuracy of the 10 trained tomato leaf disease lightweight recognition models, select the model with the highest verification accuracy as the best tomato leaf disease lightweight recognition model, if there are multiple models with high accuracy and the same accuracy, randomly select one of the multiple models as the best tomato leaf disease lightweight recognition model, save the weight of the best tomato leaf disease lightweight recognition model, and obtain the trained tomato leaf disease lightweight recognition model; S6. Deploy the trained lightweight tomato leaf disease recognition model to the tomato base, obtain tomato growth stage images through a high-definition camera, and input the images into the lightweight tomato leaf disease recognition model.

2. The method for identifying tomato pests and diseases based on a lightweight network as claimed in claim 1, characterized in that: In S1, the original image dataset of tomato leaf diseases and pests is collected and preprocessed. The specific steps are as follows: S1.

1. Take N images of tomato leaves with diseases at a tomato planting base, where N is an integer greater than or equal to 2000, and label each tomato leaf image according to the type of tomato disease, to obtain N labeled tomato leaf disease images to form a tomato leaf disease original image dataset; S1.2, using the preprocessing methods of flipping, random rotation, brightness transformation, Gaussian blur, adding agitation, random cropping and random translation to process each tomato leaf image in the tomato leaf disease original image dataset to obtain the tomato leaf disease expanded image dataset; S1.

3. The image resolution of each tomato leaf image in the tomato leaf disease expanded image dataset is first scaled to 224 pixels × 224 pixels, and then normalized to obtain a tomato leaf disease normalized image dataset.

3. The method for identifying tomato pests and diseases based on a lightweight network as claimed in claim 1, characterized in that: In S3, the tomato disease recognition model consists of three parts: Backbone, Neck and Head. Backbone adopts a parallel architecture and uses multiple ASU modules with a stride of 2 to form a low-resolution feature extraction path. Multiple ASU modules with a stride of 1 are used to form a high-resolution feature extraction path. The two paths use two Bi-FM modules to enhance cross-resolution feature integration and interaction. Neck starts with three 1×1 convolutional layers to produce features with the same number of channels and various resolutions. Neck fusion includes 2 LCCM-TD modules and 2 LCCM-BU modules; Head includes 1 5×5 convolutional layer and 1 1×1 convolutional layer.

4. The method for identifying tomato pests and diseases based on a lightweight network as claimed in claim 3, characterized in that: In S3, the specific steps for building a lightweight tomato leaf disease recognition model based on DPNet are as follows: S3.

1. The main body of the network uses the DPNet target detection network. DPNet adopts a dual-path structure, one of which is used to capture spatial features and the other is used to capture contextual information. S3.

2. In the Neck part, DPNet adds a lightweight attention mechanism and a multi-scale feature fusion structure; S3.

3. Construct a new lightweight tomato pest and disease detection model through S3.1 and S3.2; obtain the constructed lightweight tomato leaf disease recognition model.

5. The method for identifying tomato pests and diseases based on a lightweight network as claimed in claim 1, characterized in that: In S4, the initial parameters of the model are set, and the specific steps for training the constructed lightweight recognition model for tomato leaf diseases are as follows: S4.1, input the entire training set in S2 into the established lightweight recognition model for tomato leaf diseases; S4.2, set the training parameters, where the initial learning rate is set to 0-1, the optimizer momentum is set to 0-1, the weight decay is set to 0-0.001, the batch size is set to 0-20, and the number of training epochs is set to 200; S4.

3. Save a model after every 20 epochs of training. After 200 epochs of training, 10 models will be obtained, and 10 trained tomato leaf disease lightweight recognition models will be obtained.

6. The method for identifying tomato pests and diseases based on a lightweight network as claimed in claim 1, characterized in that: In S6, the trained lightweight tomato leaf disease recognition model is deployed to the tomato base. The specific steps are as follows: S6.

1. Install high-definition cameras at the tomato base to obtain images of tomato growth stages; S6.

2. Deploy the lightweight tomato leaf disease recognition model to the Raspberry Pi 4B+; S6.3, connecting the camera output to the Raspberry Pi 4B+, and transmitting the acquired tomato disease image to the input of the lightweight recognition model for tomato leaf diseases; S6.

4. The lightweight recognition model for tomato leaf diseases outputs the detected images to the management center for management personnel to view.

7. The method for identifying tomato pests and diseases based on a lightweight network as claimed in claim 5, characterized in that: In S4.2, the initial learning rate is set to 0.

1.

8. The method for identifying tomato pests and diseases based on a lightweight network as claimed in claim 5, characterized in that: In S4.2, the optimizer momentum is set to 0.

9.

9. The method for identifying tomato pests and diseases based on a lightweight network as claimed in claim 5, characterized in that: In S4.2, the weight decay is set to 0.0001.

10. The method for identifying tomato pests and diseases based on a lightweight network as claimed in claim 5, characterized in that: In S4.2, the batch size is set to 16.