CN-121999368-A - Agricultural disease and insect pest identification method
Abstract
The invention discloses an agricultural disease and insect pest identification method which comprises the following steps of ① obtaining an image dataset of pests, weeds and diseases, ② preprocessing the collected partial dataset, ③ constructing a multi-category identification network model which takes a dense connection feature fusion structure as a main body, adopting label smoothing loss to reduce model prediction confidence and overfitting tendency in a training stage, ④ classifying the dataset, dividing the image dataset into training sets according to the proportion of 6:2:2, and then using the divided dataset for improved model training. Compared with the prior art, the method has the advantages of being capable of coping with challenges such as similarity among classes, intra-class difference and class imbalance existing in the data set and providing a new thought and technical path for intelligent identification of agricultural pests.
Inventors
- QIAO XI
- Qiu Jinxue
- HUANG TAO
- HUANG YIQI
- LIU CONGHUI
- WAN FANGHAO
- QIAN WANQIANG
Assignees
- 中国农业科学院农业基因组研究所
Dates
- Publication Date
- 20260508
- Application Date
- 20260128
Claims (10)
- 1. The method for identifying the agricultural diseases, the insect pests and the weeds is characterized by comprising the following steps: The method comprises the steps of firstly, manually collecting images of pests and weeds in a natural field environment, and simultaneously adding a disease data set in PLANTVILLAGE open source data sets from a Kaggle platform to form a cost data set together; Preprocessing the collected data set, including random rotation, horizontal overturn, brightness and contrast adjustment and other operations, wherein the image size is uniformly adjusted to be 224 multiplied by 224 square pixels; Step three, constructing a dense connection multi-category identification network model-CSLNet for coordinate attention-shallow depth supervision, which is used for multi-category identification of agricultural pests, weeds and crop diseases, wherein CSLNet comprises an initial feature extraction module, a dense connection trunk formed by a first dense block, a second dense block, a third dense block, a fourth dense block and a transition block which are sequentially connected, a coordinate attention module arranged behind the first dense block, a depth supervision module arranged at the output of a plurality of stages of the initial feature extraction module, and a classification output module at the tail end; Classifying the data set, and dividing the image data set into a training set, a verification set and a test set according to the proportion of 6:2:2; And fifthly, using the divided data set for model training of CSLNet, calculating total loss based on final classification output and at least two auxiliary classification outputs in the training process, wherein the total loss adopts a label smooth loss function, and parameter updating is carried out by adopting a AdamW optimizer and combining with a learning rate preheating and cosine annealing scheduling strategy.
- 2. The method of claim 1, wherein the data set contains 120 pests, including 9628 images of 62 pests, 5042 images of 28 plants, and 11074 images of 30 diseases.
- 3. The method for identifying agricultural disease, insect and weed, as defined in claim 1, wherein the initial feature extraction module comprises a 7×7 convolution layer with a stride of 2, a batch normalization layer, an activation layer and a3×3, and a stride of 2 maximum pooling layer, and generates a first-stage feature map of 64 channels.
- 4. The method for identifying agricultural disease, insect and weed, as defined in claim 3, wherein the number of dense layers of the first to fourth dense blocks is 6, 12, 24 and 16, respectively, each dense layer adopts a bottleneck structure, comprises 1×1 convolution dimensionality reduction and 3×3 convolution to generate new features, and splice historical features along a channel dimension, and each transition block comprises 1×1 convolution and 2×2 average pooling layers.
- 5. The method of claim 3, wherein the coordinate attention module generates the height and width attention weights by performing adaptive averaging pooling along the height and width directions, respectively, through channel dimension reduction, activation and convolution-Sigmoid operations, and performs element-by-element weighting on the input feature map, wherein when the input image size is 224×224, the feature map spatial size processed by the module is 56×56.
- 6. The method of claim 5, wherein the depth supervision module comprises a plurality of auxiliary classification branches respectively connected to outputs of a convolution layer, a batch normalization layer, an activation layer or a pooling layer of the initial feature extraction module, and each auxiliary classification branch comprises a global average pooling layer and a shared 64-dimensional fully-connected classifier.
- 7. The method for identifying agricultural disease, insect and pest according to claim 6, wherein the function of the total loss in S5 is expressed as: ; Wherein, the Representing the loss function of the main classifier, Representing the loss of the kth auxiliary classifier, , The effect of the main loss and the auxiliary loss is controlled as the weight coefficient.
- 8. The method for identifying agricultural disease, insect and pest according to claim 1, wherein the tag smoothing loss function is configured to smooth the real tag so that the target probability of the correct category is And meanwhile, the remaining probabilities are uniformly distributed to other categories, and the formula is as follows: ; Wherein, the Is the target probability after label smoothing; is a smoothing factor, set to 0.1; for the total number of categories, according to the smoothed labels, the label smoothing loss is expressed as: 。
- 9. The method for identifying agricultural diseases, weeds and pests according to claim 1, wherein the AdamW optimizer in S5 adopts a linear preheating strategy to increase the learning rate from 0 to a basic value in the initial stage of training, and then adopts a cosine annealing strategy to attenuate the learning rate.
- 10. The method for identifying agricultural diseases, weeds and pests according to claim 1, wherein in the model training process, when the accuracy of the verification set of the current turn is higher than the historical optimal value, the current model parameters are saved as an optimal model.
Description
Agricultural disease and insect pest identification method Technical Field The invention relates to the technical field of multi-category identification of agricultural pests, weeds and crop diseases, in particular to an identification method of agricultural pests, weeds and crop diseases. Background With the aggravation of global climate change and the continuous improvement of the intensive degree of agriculture, the agricultural pests such as pests, pathogenic microorganisms, weeds and the like form an increasingly serious threat to the grain safety and the sustainable development of agriculture. About 30% -40% of the grain yield per year is lost to pests and economic losses are over $1000 billion per year as counted by the United nations Food and Agriculture Organization (FAO). The harmful range of pests is enlarged through long-distance migration and drug resistance evolution, pathogenic microorganisms break through the traditional prevention and control means by means of gene mutation, weeds are continuously expanded with strong ecological adaptability and invasion capacity, and the three organisms form serious threats to the stability of an ecological system and agricultural production. Traditional agricultural pest identification methods rely primarily on morphological feature analysis or molecular biological detection. The method generally needs complicated observation, measurement and comparison by experienced professional technicians, has the problems of complex operation, long time consumption, strong subjectivity and the like, and is difficult to popularize and apply in large-scale quarantine and real-time monitoring. In recent years, with the rapid development of computer vision and deep learning technology, an automatic method based on image recognition provides a new solution for agricultural pest recognition. The use of Convolutional Neural Networks (CNNs) in the agricultural field has made significant progress. However, different types of pests in the agricultural ecosystem often coexist and interact, and single species identification cannot meet the intelligent monitoring requirement in complex scenes. Particularly in application scenes such as port quarantine, field diagnosis, ecological prevention and control and the like, a unified recognition model capable of considering multi-species, multi-scene and multi-scale features is needed. Disclosure of Invention The invention aims to solve the technical problems, overcome the technical defects, and provide the agricultural pest and insect pest identification method which can cope with challenges such as similarity among classes, intra-class difference and class imbalance existing in a data set and provide a new thought and technical path for intelligent identification of agricultural pests. In order to solve the technical problems, the technical scheme provided by the invention is that the method for identifying the agricultural diseases, the insect pests and the weeds comprises the following steps: The method comprises the steps of obtaining an image dataset, manually collecting images of pests and weeds in a natural field environment by using a smart phone, and simultaneously adding a disease dataset in a PLANTVILLAGE open source dataset from a Kaggle platform to form a cost dataset together. Preprocessing the collected partial data set, wherein the main mode comprises operations of random rotation, horizontal overturning, brightness and contrast adjustment and the like, and the image size is uniformly adjusted to be 224 multiplied by 224 square pixels; And thirdly, constructing a dense connection multi-category identification network model-CSLNet with coordinate attention-shallow depth supervision, which is used for multi-category identification of agricultural pests, weeds and crop diseases. The network model comprises an initial feature extraction module, a dense connection feature fusion trunk, a coordinate attention module, a depth supervision module and a classification output module, wherein the initial feature extraction module sequentially comprises a convolution layer, a batch normalization layer, an activation layer and a pooling layer and is used for downsampling an input image and generating a first stage feature map, the dense connection feature fusion trunk comprises a first dense block, a first transition block, a second dense block, a second transition block, a third dense block, a third transition block and a fourth dense block which are sequentially connected, the coordinate attention module is connected behind the first dense block and is used for carrying out attention weighting on direction and position information of the first dense block output feature map, the depth supervision module is connected at a plurality of stage outputs of the initial feature extraction module and is used for generating a plurality of auxiliary classification outputs, and the classification output module is used for carrying out global ag