Farmland disease and pest detection method and system based on target detection

By building a CNN-based farmland pest detection network, the problem of low manual identification efficiency in the existing technology is solved, fast and accurate pest identification is achieved, and intelligent agricultural production is supported.

CN119068332APending Publication Date: 2024-12-03WUHAN POLYTECHNIC UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing pest and disease detection mainly relies on artificial light judgment, is inefficient and has high requirements for staff, and cannot achieve fast and accurate pest and disease identification and classification.

Method used

Using a target detection method, a farmland pest detection network based on CNN is constructed by collecting farmland pest and disease images, performing manual annotation and regional segmentation, and a CNN-based farmland pest and disease detection network is trained and used for detection, identifying and classifying pests and diseases.

Benefits of technology

It realizes rapid and accurate pest identification, reduces the requirements for staff, and supports intelligent and automated agricultural production systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068332A_ABST
    Figure CN119068332A_ABST
Patent Text Reader

Abstract

The invention discloses a farmland disease and pest detection method and system based on target detection, and is applied to the technical field of disease and pest recognition. The method comprises the following steps: collecting an existing farmland disease and insect pest image and carrying out manual marking to obtain all disease and insect pest and variety information in the image; preprocessing and region segmentation are carried out on the farmland pest and disease damage images, so that each segmented farmland pest and disease damage image only has one pest and disease damage state; constructing a CNN-based farmland pest and disease detection network; taking the segmented farmland pest and disease damage images and the corresponding manual labels as a training set, and training a farmland pest and disease damage detection network; and detecting a to-be-detected farmland based on the trained farmland pest and disease damage detection network. According to the invention, the detection method based on target identification is adopted to detect diseases and pests in the farmland, whether diseases and pests exist in the farmland and the types of the diseases and pests can be rapidly and accurately identified, and reference is provided for prevention and subsequent treatment of the diseases and pests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pest identification, and more particularly to a method and system for detecting pests and diseases in farmland based on target detection. Background Art

[0002] Crop pests and diseases are one of the main agricultural disasters in my country. They are characterized by many types, great impact, and frequent outbreaks. Crop pests and diseases directly affect the metabolic process of crops and are one of the main threats to reduce crop yield and quality. The scope and severity of their occurrence often cause significant losses to my country's national economy, especially agricultural production. Therefore, the prevention and control of pests and diseases is very important for agricultural production. It is of great significance for farmers to take effective prevention and control measures in a timely manner to achieve rapid and accurate detection and classification of pests and diseases. However, most of the existing pest and disease control schemes are viewed by artificial light judgment, which requires a lot of manpower and requires a high level of understanding of pests and diseases. Therefore, how to provide a method and system for detecting farmland pests and diseases based on target detection is a problem that technicians in this field urgently need to solve. Summary of the invention

[0003] In view of this, the present invention provides a method and system for detecting farmland pests and diseases based on target detection, which recognizes pest and disease defects on crop leaves through a target detection algorithm to achieve automated farmland pest and disease detection.

[0004] In order to achieve the above object, the present invention provides the following technical solutions:

[0005] A method for detecting farmland pests and diseases based on target detection comprises the following steps:

[0006] S1. Collect pest and disease images of existing farmland and manually annotate them to obtain all pest and disease status information in the images;

[0007] S2, performing regional segmentation and preprocessing on the farmland pest and disease images, so that each farmland pest and disease image after segmentation has only one pest and disease state;

[0008] S3, build a CNN-based farmland pest and disease detection network;

[0009] S4, using the segmented farmland pest and disease images and their corresponding manual annotations as training sets to train a farmland pest and disease detection network;

[0010] S5. Detect the farmland to be detected based on the trained farmland pest and disease detection network.

[0011] Optionally, in S1, information on the types of pests and diseases in the image is identified by manual annotation, and all pest and disease areas in the image are manually marked to generate a true target frame.

[0012] Optionally, S2 specifically includes: performing regional segmentation on the farmland pest and disease images so that each farmland pest and disease image after segmentation has only one pest and disease state, and performing data augmentation on the segmented farmland pest and disease images to expand the data volume.

[0013] Optionally, S3 specifically includes: the farmland pest and disease detection network includes a region generation network, a convolutional neural network, a SVM classifier and a result output unit, wherein the region generation network is used to generate candidate frames, the convolutional neural network is used to extract image features, the SVM classifier is used to classify candidate frames, and the result output unit is used to determine the final classification result.

[0014] Optionally, S4 is specifically:

[0015] S41, training a region generation network for generating candidate boxes and a convolutional neural network for extracting image features through a training set;

[0016] S42, performing IoU calculation between the candidate boxes of different images in the training set and their corresponding real target boxes, taking samples greater than a preset positive threshold as positive samples, and taking samples less than a preset negative threshold as negative samples;

[0017] S43. For each pest and disease state in the training set, the corresponding SVM classifier is trained using positive samples and negative samples of the corresponding type.

[0018] Optionally, S5 is specifically:

[0019] S51, collecting image data of the farmland to be inspected in real time;

[0020] S52, inputting the image data into the farmland pest detection network to generate a candidate frame;

[0021] S53, the farmland pest detection network extracts features of image data and classifies the features;

[0022] S54, screening the candidate boxes and outputting the final detection results.

[0023] Optionally, S54 is specifically as follows: for a classification result of a pest category, the classification confidence of all candidate boxes is sorted in descending order, the IoU values ​​between all other candidate boxes and the candidate box with the largest confidence are calculated, and the candidate boxes with IoU values ​​greater than a preset threshold are deleted, and the process of sorting, calculating IoU values ​​and deleting candidate boxes is repeated until all candidate boxes are calculated, and the candidate boxes with classification confidence less than the preset threshold of the category are deleted.

[0024] A farmland pest and disease detection system based on target detection executes the above-mentioned farmland pest and disease detection method based on target detection, including an image acquisition module, a data processing module, a network construction module, a network training module and a pest and disease recognition module; the image acquisition module is used to collect farmland pest and disease images, the data processing module performs regional segmentation and preprocessing on the farmland pest and disease images, the network construction module is used to construct a farmland pest and disease detection network based on CNN, the network training module is used to train the farmland pest and disease detection network, and the pest and disease recognition module detects the farmland to be detected based on the trained farmland pest and disease detection network.

[0025] It can be seen from the above technical solution that compared with the prior art, the present invention provides a method and system for detecting pests and diseases in farmland based on target detection, which has the following beneficial effects: the present invention adopts a detection method based on target recognition to detect pests and diseases in farmland, which solves the problem that the existing manual recognition method is inefficient and has high requirements for staff, and can quickly and accurately identify whether there are pests and diseases in the farmland and their types, providing a reference for the prevention and subsequent control of pests and diseases, and helping to establish an intelligent and automated agricultural production system. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0027] Figure 1 The present invention is a flow chart of the method for detecting farmland pests and diseases. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] The embodiment of the present invention discloses a method for detecting farmland pests and diseases based on target detection, such as Figure 1 As shown, the following steps are included:

[0030] S1. Collect pest and disease images of existing farmland and manually annotate them to obtain all pest and disease status information in the images;

[0031] S2, performing regional segmentation and preprocessing on the farmland pest and disease images, so that each farmland pest and disease image after segmentation has only one pest and disease state;

[0032] S3, build a CNN-based farmland pest and disease detection network;

[0033] S4, using the segmented farmland pest and disease images and their corresponding manual annotations as training sets to train a farmland pest and disease detection network;

[0034] S5. Detect the farmland to be detected based on the trained farmland pest and disease detection network.

[0035] Furthermore, in S1, information on the types of pests and diseases in the image is identified by manual annotation, and all pest and disease areas in the image are manually marked to generate a true target frame.

[0036] In the embodiment of the present invention, a total of four kinds of pests and diseases are identified. Different kinds of pests and diseases cause different defects to the leaves of crops in the farmland, which is used as the basis for identification.

[0037] Furthermore, S2 specifically includes: performing regional segmentation on the farmland pest and disease images so that each farmland pest and disease image after segmentation has only one pest and disease state, and performing data augmentation on the segmented farmland pest and disease images to expand the data volume.

[0038] In the embodiment of the present invention, the amount of data is expanded by operations such as rotation, enlargement or reduction, flipping, adding or eliminating noise, corrosion and expansion, and adjusting brightness and saturation.

[0039] Furthermore, S3 is specifically: the farmland pest and disease detection network includes a region generation network, a convolutional neural network, an SVM classifier and a result output unit, wherein the region generation network is used to generate candidate frames, the convolutional neural network is used to extract image features, the SVM classifier is used to classify candidate frames, and the result output unit is used to determine the final classification results.

[0040] In an embodiment of the present invention, the region generation network is an RPN network, and the convolutional neural network is AlexNet, wherein the convolutional neural network includes 5 convolutional layers, 3 maximum pooling layers, 3 fully connected layers and 1 output layer, the 3 maximum pooling layers are respectively located after the 1st, 2nd and 5th convolutional layers, the 3 fully connected layers are all located after the 3rd maximum pooling layer, the output layer is located after the 3 fully connected layers, and each convolutional layer includes a convolution kernel, a bias term, a ReLU activation function and a local response normalization module; an SVM classifier is used to replace the output layer of the convolutional neural network.

[0041] Furthermore, S4 is specifically:

[0042] S41, training a region generation network for generating candidate boxes and a convolutional neural network for extracting image features through a training set;

[0043] S42, performing IoU calculation between the candidate boxes of different images in the training set and their corresponding real target boxes, taking samples greater than a preset positive threshold as positive samples, and taking samples less than a preset negative threshold as negative samples;

[0044] S43. For each pest and disease state in the training set, the corresponding SVM classifier is trained using positive samples and negative samples of the corresponding type.

[0045] In the embodiment of the present invention, the preset positive threshold of IoU is set to 0.6, and the preset negative threshold of IoU is set to 0.1.

[0046] Furthermore, S5 is specifically:

[0047] S51, collecting image data of the farmland to be inspected in real time;

[0048] S52, inputting the image data into the farmland pest detection network to generate a candidate frame;

[0049] S53, the farmland pest detection network extracts features of image data and classifies the features;

[0050] S54, screening the candidate boxes and outputting the final detection results.

[0051] Furthermore, S54 is specifically as follows: for a classification result of a pest category, the classification confidence of all candidate boxes is sorted in descending order, the IoU values ​​between all other candidate boxes and the candidate box with the largest confidence are calculated, and the candidate boxes with IoU values ​​greater than a preset threshold are deleted, and the process of sorting, calculating IoU values ​​and deleting candidate boxes is repeated until all candidate boxes are calculated, and the candidate boxes with classification confidence less than the preset threshold of the category are deleted.

[0052] and Figure 1 Corresponding to the method described, an embodiment of the present invention further discloses a farmland pest and disease detection system based on target detection, which executes the above-mentioned farmland pest and disease detection method based on target detection, including an image acquisition module, a data processing module, a network construction module, a network training module and a pest and disease recognition module; the image acquisition module is used to collect farmland pest and disease images, the data processing module performs regional segmentation and preprocessing on the farmland pest and disease images, the network construction module is used to construct a CNN-based farmland pest and disease detection network, the network training module is used to train the farmland pest and disease detection network, and the pest and disease recognition module detects the farmland to be detected based on the trained farmland pest and disease detection network.

[0053] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0054] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for detecting farmland pests and diseases based on target detection, characterized in that: The following steps are involved: S1. Collect pest and disease images of existing farmland and manually annotate them to obtain all pest and disease status information in the images; S2, performing regional segmentation and preprocessing on the farmland pest and disease images, so that each farmland pest and disease image after segmentation has only one pest and disease state; S3, build a CNN-based farmland pest and disease detection network; S4, using the segmented farmland pest and disease images and their corresponding manual annotations as training sets to train a farmland pest and disease detection network; S5. Detect the farmland to be detected based on the trained farmland pest and disease detection network.

2. A method for detecting farmland pests and diseases based on target detection according to claim 1, characterized in that: In S1, the pest type information in the image is identified by manual annotation, and all the pest areas in the image are manually marked to generate a real target frame.

3. The method for detecting farmland pests and diseases based on target detection according to claim 1, characterized in that: S2 specifically includes: performing regional segmentation on the farmland pest and disease images so that each of the segmented farmland pest and disease images has only one pest and disease state, and performing data augmentation on the segmented farmland pest and disease images to expand the data volume.

4. The method for detecting farmland pests and diseases based on target detection according to claim 1, characterized in that: S3 is specifically: the farmland pest and disease detection network includes a region generation network, a convolutional neural network, an SVM classifier and a result output unit, wherein the region generation network is used to generate candidate frames, the convolutional neural network is used to extract image features, the SVM classifier is used to classify candidate frames, and the result output unit is used to determine the final classification results.

5. A method for detecting farmland pests and diseases based on target detection according to claim 4, characterized in that: S4 is specifically: S41, training a region generation network for generating candidate boxes and a convolutional neural network for extracting image features through a training set; S42, performing IoU calculation between the candidate boxes of different images in the training set and their corresponding real target boxes, taking samples greater than a preset positive threshold as positive samples, and taking samples less than a preset negative threshold as negative samples; S43. For each pest and disease state in the training set, the corresponding SVM classifier is trained using positive samples and negative samples of the corresponding type.

6. The method for detecting farmland pests and diseases based on target detection according to claim 1, characterized in that: S5 is as follows: S51, collecting image data of the farmland to be inspected in real time; S52, inputting the image data into the farmland pest detection network to generate a candidate frame; S53, the farmland pest detection network extracts features of image data and classifies the features; S54, screening the candidate boxes and outputting the final detection results.

7. A method for detecting farmland pests and diseases based on target detection according to claim 6, characterized in that: S54 is specifically as follows: for a classification result of a pest category, the classification confidence of all candidate boxes is sorted in descending order, the IoU values ​​between all other candidate boxes and the candidate box with the largest confidence are calculated, and the candidate boxes with IoU values ​​greater than a preset threshold are deleted. The process of sorting, calculating IoU values ​​and deleting candidate boxes is repeated until all candidate boxes are calculated, and the candidate boxes with classification confidence less than the preset threshold of the current category are deleted.

8. A farmland pest detection system based on target detection, characterized in that: A method for detecting farmland pests and diseases based on target detection according to any one of claims 1 to 7 is implemented, comprising an image acquisition module, a data processing module, a network construction module, a network training module and a pest and disease recognition module; the image acquisition module is used to collect farmland pest and disease images, the data processing module performs regional segmentation and preprocessing on the farmland pest and disease images, the network construction module is used to construct a CNN-based farmland pest and disease detection network, the network training module is used to train the farmland pest and disease detection network, and the pest and disease recognition module detects the farmland to be detected based on the trained farmland pest and disease detection network.