Disease and pest detection method based on deep learning and transfer learning

Through methods based on deep learning and transfer learning, the problems of strong subjectivity, low efficiency and low accuracy of traditional pest detection methods are solved, and efficient and accurate pest detection is achieved, with wide application prospects.

CN119992308APending Publication Date: 2025-05-13中电科国海信通科技(海南)有限公司
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411797948.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

Traditional pest detection methods have problems such as strong subjectivity, low efficiency and low accuracy, and existing computer vision and artificial intelligence technologies still have a large number of problems with definite data dependence and insufficient model generalization capabilities in actual applications.

Method used

Using pest and disease detection methods based on deep learning and transfer learning, through the steps of data collection, data preprocessing, model construction, model training, model evaluation and model optimization, the pre-trained deep learning model is used for transfer learning, reducing dependence on a large amount of labeled data, and improving the generalization ability of the model.

Benefits of technology

It improves the accuracy and efficiency of pest detection, reduces dependence on labeled data, enhances the generalization ability of the model, and has a wide range of application prospects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119992308A_ABST
    Figure CN119992308A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of agricultural disease and pest detection, and provides a disease and pest detection method based on deep learning and transfer learning, which performs feature extraction of litchi disease and pest images through a transfer learning network, can reduce the dependence on a large amount of labeled data, and improves the generalization ability of a model. Litchi disease and insect pest images are classified and recognized through the deep learning model, and the accuracy and efficiency of litchi disease and insect pest detection can be improved. The method has the characteristics of high efficiency and accuracy, can effectively identify the litchi diseases and insect pests through an advanced image processing technology and a deep learning algorithm, and provides a new solution for agricultural production. Meanwhile, the method can also be applied to detection of diseases and insect pests of different types and degrees, and has a relatively wide application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of agricultural pest detection, and in particular relates to a pest detection method based on deep learning and transfer learning. Background Art

[0002] China is the world's largest producer of lychees. Lychees have significant competitive advantages in the international market, with demand increasing year by year and broad export prospects. High added value provides strong support for Chinese specialty agricultural products to open up the international market. In recent years, the planting area of ​​lychees has expanded year by year, becoming an important cash crop for farmers.

[0003] However, during the growth process, litchi is susceptible to a variety of diseases and pests, which seriously affect the yield and quality of the fruit. Diseases and pests have a huge impact on litchi production and seriously affect the development of the litchi industry. Therefore, early identification and timely prevention of diseases and pests are imminent.

[0004] Traditional pest and disease detection methods mainly rely on manual observation and empirical judgment, which has the problems of strong subjectivity, low efficiency, and low accuracy. With the development of computer vision and artificial intelligence technology, the use of computers for pest and disease detection has become a research hotspot. However, existing pest and disease detection methods still have certain limitations in practical applications, such as the need for a large amount of labeled data and insufficient model generalization ability. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a method for detecting pests and diseases based on deep learning and transfer learning, aiming to solve the problems raised in the above-mentioned background technology.

[0006] The embodiment of the present invention is implemented as follows: a pest detection method based on deep learning and transfer learning, comprising the following steps: Step 1: Data collection: Collect litchi pest and disease image dataset; Step 2: Data preprocessing: Preprocess the image, including image cleaning, image enhancement, image normalization, image size unification, and image annotation to improve image quality and model robustness.

[0007] Step 3: Model construction: Use the pre-trained deep learning model as the basic network to train the pest and disease image dataset to extract the features of the pest and disease images; the pre-trained deep learning model can be a convolutional neural network (CNN), a recurrent neural network (RNN) or other suitable models; Step 4: Model training: Using transfer learning technology, fine-tune the pre-trained model to train a recognition model for specific crop pests and diseases; Step 5: Model evaluation: Use the test set to evaluate the trained model. Evaluation indicators include accuracy, precision, recall, etc.

[0008] Step 6: Model optimization: Optimize the model based on the evaluation results, including adjusting hyperparameters and optimizing network structure.

[0009] A further technical solution is that in step 1, the data sources are as follows: Tower base stations are used as high-position cameras for rental to obtain pest and disease materials over a large area; low-position cameras are 5-meter poles deployed in litchi fields to continuously obtain close-up pest and disease materials; pest monitoring instruments report pest categories and counts in real time to obtain pest materials; mobile phone photos and uploads or WeChat mini-programs provide close-up photography; image data of crop pests and diseases are collected through field photography, web crawlers, etc. The acquired data are preliminarily screened to remove blurry, duplicated, and disease-free images to ensure data quality.

[0010] According to a further technical solution, step 2 comprises the following specific steps: Step 2.1: Image cleaning; Remove blurry, unclear or irrelevant images to ensure data quality; Step 2.2: Image enhancement; The images are enhanced by random flipping, translation, scaling, zooming, cropping, adjusting brightness, etc. to increase the number of samples and improve the generalization ability of the model; Step 2.3: Image normalization; Normalize the image pixel values ​​to a uniform range (such as 0 to 1 or -1 to 1) to improve training results.

[0011] Step 2.4: Unify the image size; Change the resolution of all images to 224x224 to ensure consistent data size for the input model.

[0012] Step 2.5: Image annotation; Use annotation tools to annotate images and identify different types of pests and diseases; annotation tools can include LabelImg, VGG Image Annotator, etc.

[0013] Further technical solution, the step 3 comprises the following specific steps: Step 3.1: Select the model; Built on the ResNet34 model; Step 3.2: Build the model structure; Backbone network: The convolution blocks in the backbone feature network of the ResNet34 model are set to layer1, layer2, layer3 and layer4, using a residual structure, and the activation function is set to the ReLU function; Output layer: The output number of the last fully connected layer of the ResNet34 model is set to the number of pest type categories to adapt to different detection tasks.

[0014] According to a further technical solution, step 4 comprises the following specific steps: Step 4.1: Load the pre-trained model; Load pre-trained ResNet34 model weights on large datasets such as ImageNet; Step 2: Transfer learning; First, freeze the bottom convolutional layers. In the initial stage, keep the low-level convolutional layers of the pre-trained model to utilize the general features learned by it; Then replace the top fully connected layer, replace the last layer of the pre-trained model with a fully connected layer adapted to the litchi pest and disease classification task, and adjust the output nodes to match the specific number of categories.

[0015] Finally, the model was retrained and the newly added fully connected layer was trained using the litchi pest and disease dataset. At the same time, some high-level convolutional layers were unfrozen as needed to further optimize the model.

[0016] A further technical solution is that in step 6, when optimizing the model, the Adam optimizer is used for training to speed up the convergence speed; the loss function uses cross entropy; a suitable learning rate is selected, usually starting from a smaller learning rate to prevent the knowledge of the pre-trained model from being destroyed during fine-tuning; and an appropriate batch size is selected to ensure the stability and convergence speed of the training process.

[0017] The embodiment of the present invention provides a method for detecting pests and diseases based on deep learning and transfer learning, and its beneficial effects are as follows: (1) Using transfer learning networks to extract features from pest and disease images can reduce reliance on large amounts of labeled data and improve the generalization ability of the model; (2) Classifying and identifying pest and disease images through deep learning models can improve the accuracy and efficiency of pest and disease detection; (3) It can be applied to the detection of pests and diseases of different types and degrees and has a broad application prospect. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A flowchart of a pest detection method based on deep learning and transfer learning provided by an embodiment of the present invention; Figure 2A schematic diagram of a transfer learning network structure in a pest and disease detection method based on deep learning and transfer learning provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0020] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments.

[0021] like Figure 1 and 2 As shown, a pest detection method based on deep learning and transfer learning provided by an embodiment of the present invention includes the following steps: Step 1: Data collection: Collect litchi pest and disease image dataset; Step 2: Data preprocessing: Preprocess the image, including image cleaning, image enhancement, image normalization, image size unification, and image annotation to improve image quality and model robustness.

[0022] Step 3: Model construction: Use the pre-trained deep learning model as the basic network to train the pest and disease image dataset to extract the features of the pest and disease images. The pre-trained deep learning model can be a convolutional neural network (CNN), a recurrent neural network (RNN), or other suitable models.

[0023] When doing transfer learning, it is crucial to choose a suitable pre-trained model. We chose proven deep convolutional neural networks (CNNs) such as ResNet, Inception, or VGG, which have been trained on large image datasets (such as ImageNet) and have strong feature extraction capabilities.

[0024] Step 4: Model training: Using transfer learning technology, fine-tune the pre-trained model to train a recognition model for specific crop pests and diseases; Step 5: Model evaluation: Use the test set to evaluate the trained model. Evaluation indicators include accuracy, precision, recall, etc.

[0025] Step 6: Model optimization: Optimize the model based on the evaluation results, including adjusting hyperparameters and optimizing network structure.

[0026] As a preferred embodiment of the present invention, in step 1, the data sources are as follows: The high-position cameras are rented on tower base stations, with a height of about 25-30 meters, to obtain pest and disease materials over a large area; the low-position cameras are deployed on 5-meter poles in the litchi fields to continuously obtain pest and disease materials in close range; the insect monitoring instrument reports the pest category and count in real time to obtain pest materials; mobile phone photos are uploaded or WeChat applet provides close-up shooting. Image data of crop pests and diseases are collected through field shooting, web crawlers, etc. The acquired data are preliminarily screened to remove blurry, duplicated, and disease-free images to ensure data quality.

[0027] As a preferred embodiment of the present invention, step 2 includes the following specific steps: Step 2.1: Image cleaning: remove blurry, unclear or irrelevant images to ensure data quality.

[0028] Step 2.2: Image enhancement; The images are enhanced by random flipping, translation, scaling, zooming, cropping, adjusting brightness, etc. to increase the number of samples and improve the generalization ability of the model.

[0029] Step 2.3: Image normalization; Normalize the image pixel values ​​to a uniform range (such as 0 to 1 or -1 to 1) to improve training results.

[0030] Step 2.4: Unify the image size; Change the resolution of all images to 224x224 to ensure consistent data size for the input model.

[0031] Step 2.5: Image annotation; Cooperate with agricultural experts to use annotation tools to annotate images and identify different types of pests and diseases; annotation tools can include LabelImg, VGG Image Annotator, etc.

[0032] As a preferred embodiment of the present invention, step 3 includes the following specific steps: Step 3.1: Select the model; It is built based on the ResNet34 model because the ResNet model performs well in image classification tasks and is suitable for transfer learning.

[0033] Step 3.2: Build the model structure; Backbone network: The convolution blocks in the backbone feature network of the ResNet34 model are set to layer1, layer2, layer3 and layer4, using a residual structure, and the activation function is set to the ReLU function.

[0034] Output layer: The output number of the last fully connected layer of the ResNet34 model is set to the number of pest type categories to adapt to different detection tasks.

[0035] As a preferred embodiment of the present invention, step 4 includes the following specific steps: Step 4.1: Load the pre-trained model; Load pre-trained ResNet34 model weights on large datasets such as ImageNet; Step 2: Transfer learning; First, freeze the bottom convolutional layers. In the initial stage, keep the low-level convolutional layers of the pre-trained model to utilize the general features learned by it; Then replace the top fully connected layer, replace the last layer of the pre-trained model with a fully connected layer adapted to the litchi pest and disease classification task, and adjust the output nodes to match the specific number of categories.

[0036] Finally, the model was retrained and the newly added fully connected layer was trained using the litchi pest and disease dataset. At the same time, some high-level convolutional layers were unfrozen as needed to further optimize the model.

[0037] As a preferred embodiment of the present invention, in step 6, when optimizing the model, the Adam optimizer is used for training to speed up the convergence speed; the loss function uses cross entropy; a suitable learning rate is selected, usually starting from a smaller learning rate to prevent the knowledge of the pre-trained model from being destroyed during fine-tuning; and an appropriate batch size is selected to ensure the stability and convergence speed of the training process. A pest detection method based on deep learning and transfer learning comprises the following steps: Step 1: Data collection: Collect litchi pest and disease image dataset; Step 2: Data preprocessing: Preprocess the image, including image cleaning, image enhancement, image normalization, image size unification, and image annotation to improve image quality and model robustness.

[0038] Step 3: Model construction: Use the pre-trained deep learning model as the basic network to train the pest and disease image dataset to extract the features of the pest and disease images. The pre-trained deep learning model can be a convolutional neural network (CNN), a recurrent neural network (RNN), or other suitable models.

[0039] When doing transfer learning, it is crucial to choose a suitable pre-trained model. We chose proven deep convolutional neural networks (CNNs) such as ResNet, Inception, or VGG, which have been trained on large image datasets (such as ImageNet) and have strong feature extraction capabilities.

[0040] Step 4: Model training: Using transfer learning technology, fine-tune the pre-trained model to train a recognition model for specific crop pests and diseases; Step 5: Model evaluation: Use the test set to evaluate the trained model. Evaluation indicators include accuracy, precision, recall, etc.

[0041] 6. Model optimization: Optimize the model based on the evaluation results, including adjusting hyperparameters and optimizing network structure.

[0042] As a preferred embodiment of the present invention, in step 1, the data sources are as follows: The high-position cameras are rented tower base stations with a height of about 25-30 meters, which can obtain pest and disease materials over a large area; the low-position cameras are deployed on 5-meter poles in the litchi fields to continuously obtain pest and disease materials in close range; the insect monitoring instrument reports the pest category and count in real time to obtain pest materials; the quick-shooting app or WeChat applet provides close-up shooting. Image data of crop pests and diseases are collected through field shooting, web crawlers, etc. The acquired data are preliminarily screened to remove blurry, duplicated, and disease-free images to ensure data quality.

[0043] As a preferred embodiment of the present invention, step 2 includes the following specific steps: Step 2.1: Image cleaning: remove blurry, unclear or irrelevant images to ensure data quality.

[0044] Step 2.2: Image enhancement; The images are enhanced by random flipping, translation, scaling, zooming, cropping, adjusting brightness, etc. to increase the number of samples and improve the generalization ability of the model.

[0045] Step 2.3: Image normalization; Normalize the image pixel values ​​to a uniform range (such as 0 to 1 or -1 to 1) to improve training results.

[0046] Step 2.4: Unify the image size; Change the resolution of all images to 224x224 to ensure consistent data size for the input model.

[0047] Step 2.5: Image annotation; Cooperate with agricultural experts to use annotation tools to annotate images and identify different types of pests and diseases; annotation tools can include LabelImg, VGG Image Annotator, etc.

[0048] As a preferred embodiment of the present invention, step 3 includes the following specific steps: Step 3.1: Select the model; It is built based on the ResNet34 model because the ResNet model performs well in image classification tasks and is suitable for transfer learning.

[0049] Step 3.2: Build the model structure; Backbone network: The convolution blocks in the backbone feature network of the ResNet34 model are set to layer1, layer2, layer3 and layer4, using a residual structure, and the activation function is set to the ReLU function.

[0050] Output layer: The output number of the last fully connected layer of the ResNet34 model is set to the number of pest type categories to adapt to different detection tasks.

[0051] As a preferred embodiment of the present invention, step 4 includes the following specific steps: Step 4.1: Load the pre-trained model; Load pre-trained ResNet34 model weights on large datasets such as ImageNet; Step 2: Transfer learning; First, freeze the bottom convolutional layers. In the initial stage, keep the low-level convolutional layers of the pre-trained model to utilize the general features learned by it; Then replace the top fully connected layer, replace the last layer of the pre-trained model with a fully connected layer adapted to the litchi pest and disease classification task, and adjust the output nodes to match the specific number of categories.

[0052] Finally, the model was retrained and the newly added fully connected layer was trained using the litchi pest and disease dataset. At the same time, some high-level convolutional layers were unfrozen as needed to further optimize the model.

[0053] As a preferred embodiment of the present invention, in step 6, when optimizing the model, the Adam optimizer is used for training to speed up the convergence speed; the loss function uses cross entropy; a suitable learning rate is selected, usually starting from a smaller learning rate to prevent the knowledge of the pre-trained model from being destroyed during fine-tuning; and an appropriate batch size is selected to ensure the stability and convergence speed of the training process.

[0054] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A pest detection method based on deep learning and transfer learning, characterized in that: The following steps are involved: Step 1: Data collection: Collect litchi pest and disease image dataset; Step 2: Data preprocessing: Preprocess the image, including image cleaning, image enhancement, image normalization, image size unification, and image annotation to improve image quality and model robustness. Step 3: Model construction: Use the pre-trained deep learning model as the basic network to train the pest and disease image dataset to extract the features of the pest and disease images; the pre-trained deep learning model can be a convolutional neural network or a recurrent neural network; Step 4: Model training: Using transfer learning technology, fine-tune the pre-trained model to train a recognition model for specific crop pests and diseases; Step 5: Model evaluation: Use the test set to evaluate the trained model. The evaluation indicators include accuracy, precision, and recall. Step 6: Model optimization: Optimize the model based on the evaluation results, including adjusting hyperparameters and optimizing the network structure.

2. The pest detection method based on deep learning and transfer learning according to claim 1, characterized in that: In step 1, the data sources are as follows: Tower base stations are used as high-position cameras for rental to obtain pest and disease materials over a large area; low-position cameras are 5-meter poles deployed in litchi fields to continuously obtain close-up pest and disease materials; pest monitoring instruments report pest categories and counts in real time to obtain pest materials; mobile phone photos and uploads or WeChat mini-programs provide close-up photography; image data of crop pests and diseases are collected through field photography and web crawlers; The acquired data were preliminarily screened to remove blurry, duplicated, and disease-free images to ensure data quality.

3. The pest detection method based on deep learning and transfer learning according to claim 1, characterized in that: The step 2 comprises the following specific steps: Step 2.1: Image cleaning; Remove blurry, unclear or irrelevant images to ensure data quality; Step 2.2: Image enhancement; The images were enhanced by random flipping, translation, scaling, zooming, cropping, and adjusting brightness to increase the number of samples and improve the generalization ability of the model; Step 2.3: Image normalization; Normalize the image pixel values ​​to a uniform range to improve the training effect; Step 2.4: Unify the image size; Change the resolution of all images to 224x224 to ensure consistent data size for the input model; Step 2.5: Image annotation; Use annotation tools to annotate images and identify different types of pests and diseases; the annotation tools used are LabelImg or VGGImage Annotator.

4. The pest detection method based on deep learning and transfer learning according to claim 3, characterized in that: The step 3 comprises the following specific steps: Step 3.1: Select the model; Built on the ResNet34 model; Step 3.2: Build the model structure; Backbone network: The convolution blocks in the backbone feature network of the ResNet34 model are set to layer1, layer2, layer3 and layer4, using a residual structure, and the activation function is set to the ReLU function; Output layer: The output number of the last fully connected layer of the ResNet34 model is set to the number of pest type categories to adapt to different detection tasks.

5. The pest detection method based on deep learning and transfer learning according to claim 4, characterized in that: The step 4 comprises the following specific steps: Step 4.1: Load the pre-trained model; Load pre-trained ResNet34 model weights on a large dataset; Step 2: Transfer learning; First, freeze the bottom convolutional layers. In the initial stage, keep the low-level convolutional layers of the pre-trained model to utilize the general features learned by it; Then replace the top fully connected layer and the last layer of the pre-trained model with a fully connected layer adapted to the litchi pest and disease classification task, and adjust the output nodes to match the specific number of categories; Finally, the model was retrained and the newly added fully connected layer was trained using the litchi pest and disease dataset. At the same time, some high-level convolutional layers were unfrozen to further optimize the model.

6. The pest detection method based on deep learning and transfer learning according to claim 5, characterized in that: In step 6, when optimizing the model, the Adam optimizer is used for training to speed up the convergence speed; the loss function uses cross entropy; and the learning rate and batch size are selected according to the needs.

Citation Information

Cited By

  • Incremental depth transfer learning method and system for remote sensing real-time detection of crop diseases and insect pests

    CN120673270A

  • Rice disease and insect pest automatic classification method fused with deep learning model

    CN120747614A