Search

CN-122023779-A - Lightweight corn disease detection method and system

CN122023779ACN 122023779 ACN122023779 ACN 122023779ACN-122023779-A

Abstract

The invention discloses a light corn disease detection method and a light corn disease detection system, which belong to the technical field of image processing, acquire corn leaf images of various growth periods under natural growth conditions, input the corn leaf images into a pre-trained light corn disease detection model, and output corresponding disease detection results. The method comprises the steps of dividing a disease spot characteristic diagram extracted by a Backbone into a plurality of branches by a C2f_Faster module, respectively extracting disease detail characteristics of each branch, fusing the branches to generate a multi-scale disease spot characteristic diagram, receiving a single-scale disease spot characteristic diagram by DySample, resampling the input characteristic diagram through a dynamic generation sampling point set to generate a high-resolution characteristic diagram, fusing the high-resolution characteristic diagram with the multi-scale disease spot characteristic diagram, denoising the fused multi-scale characteristic diagram by MSCA, outputting a characteristic diagram with interference removed, classifying and positioning the characteristic diagram with interference removed by a Head, and outputting a disease detection result. The method can rapidly and accurately identify corn diseases.

Inventors

  • ZHENG JIYE
  • GU WENHUI
  • ZHANG XIAOYAN
  • NIU LUYAN
  • MENG JING
  • WU ZONGFAN

Assignees

  • 山东省农业科学院

Dates

Publication Date
20260512
Application Date
20260205

Claims (7)

  1. 1. The lightweight corn disease detection method is characterized by comprising the following steps of: Acquiring corn leaf images of each growth period under natural growth conditions; Inputting the acquired corn leaf image into a pre-trained lightweight corn disease detection model, and outputting a disease detection result; The lightweight corn disease detection model takes YOLOv n as a basic network and comprises Backbone, neck and Head, wherein all C2f modules of a Backbone part are replaced by C2f_Faster modules, a UpSample module is replaced by a dynamic sampling module DySample in an up-sampling link of a PAN-FPN structure of a Neck part, and a multi-scale convolution attention module MSCA is embedded between Neck and Head; The C2f_Faster module splits a disease spot characteristic image of a corn leaf image extracted by a backlight into a plurality of branches, respectively extracts disease detail characteristics of each branch and then fuses the branches to generate a multi-scale disease spot characteristic image, the DySample receives the single-scale disease spot characteristic image, resamples the input characteristic image through a dynamic generation sampling point set to generate a high-resolution characteristic image and fuses the high-resolution characteristic image with the multi-scale disease spot characteristic image, the MSCA denoises the fused multi-scale characteristic image to output a characteristic image with interference removed, and the Head classifies and locates the characteristic image with interference removed to output a disease detection result.
  2. 2. The method for detecting light corn diseases according to claim 1, wherein inputting the acquired corn leaf image into a pre-trained light corn disease detection model, outputting disease detection results, specifically comprising: The lightweight corn disease detection model uses YOLOv n base network, the original YOLOv n base network comprises Backbone, neck and Head, wherein: Replacing all C2f modules of the backbond part with C2f_Faster modules, wherein the C2f_Faster modules are Bottleneck structures in the C2f modules of the backbond part by FasterBlock in FASTERNET, and the FasterBlock replaces the traditional depth convolution with partial convolution PConv; In the up-sampling link of the PAN-FPN structure of the Neck part, the UpSample module is replaced by a dynamic sampling module DySample; embedding a multi-scale convolution attention module MSCA between the Neck and the Head, wherein the MSCA comprises a local information aggregation module, a multi-scale context capture module and a channel relation simulation module; The C2f_Faster module splits the disease spot feature map of the corn leaf image extracted by the backstone into a plurality of branches, the FasterBlock adopts partial convolution PConv to only carry out convolution operation on partial channels of the disease spot feature map of each branch, and the disease spot feature map of each branch is fused after outputting disease detail features of each branch to generate a multi-scale disease spot feature map; In the Neck part, a PAN-FPN structure is adopted, and the generated multi-scale disease spot characteristic diagram and a high-resolution characteristic diagram are spliced and convolved in a mode of top-down transmission and bottom-up aggregation to generate a fused multi-scale characteristic diagram, wherein the high-resolution characteristic diagram generation process is that a single-scale disease spot characteristic diagram in the multi-scale disease spot characteristic diagram is input into the DySample, a dynamic sampling point set is generated through linear transformation and pixel recombination, and then the input disease spot characteristic diagram is resampled according to the generated dynamic sampling point set; The local information aggregation module adopts high-frequency noise in the fused multi-scale feature map generated by depth convolution filtering to obtain a noise-removed local feature map, and the multi-scale context capture module adopts multi-branch depth convolution to extract multi-receptive field features of the noise-removed local feature map to generate multi-scale context features; and the Head classifies and maps the feature images with the interference removed, and outputs disease detection results.
  3. 3. The method for detecting corn diseases by weight according to claim 2, wherein the high resolution feature map generating process is that a single-scale disease spot feature map of the multi-scale disease spot feature map is input into DySample, a dynamic sampling point set is generated by linear transformation and pixel recombination, and then the input disease spot feature map is resampled according to the generated dynamic sampling point set, and the method specifically comprises the steps of: dividing an input single-scale disease spot characteristic diagram into two paths through DySample, and respectively carrying out linear transformation on linear layers of the number of input channels and the number of output channels to obtain a two-path transformation result; After multiplying one path of linear transformation result by a preset dynamic range factor, carrying out pixel recombination with the other path of linear transformation result to generate a dynamic sampling point set; and resampling the input disease spot feature map through a grid_sample function built in PyTorch according to the generated dynamic sampling point set to generate a high-resolution feature map corresponding to the disease spot feature map.
  4. 4. The method for detecting the light corn diseases according to claim 2, wherein the channel relation simulation module performs channel linear combination on the multi-scale context features through convolution operation, and outputs a feature map for removing interference, and the method specifically comprises the following steps: the channel relation simulation module adopts 1X 1 point-by-point convolution to carry out channel linear combination on the multi-scale context characteristics and outputs a characteristic diagram for removing interference.
  5. 5. The method for detecting diseases of lightweight corn according to claim 1, wherein the step of obtaining corn leaf images of each growth period under natural growth conditions comprises: Taking corn leaf images of each growth period under natural growth conditions by adopting a single-lens reflex camera with the resolution of 2048 multiplied by 1536 pixels on the spot, wherein the corn leaf images comprise single images, video frames or real-time pictures of cameras, and the distance between a lens and a leaf is kept at 0.5-1 m during taking; preprocessing the obtained corn leaf image, wherein the preprocessing comprises the steps of keeping aspect ratio scaling and uniformly adjusting the width of the corn leaf image to 640 pixels; And marking the preprocessed corn leaf image by adopting a LabelImg tool, marking a disease spot bounding box, disease categories and confidence, constructing training set data, and inputting the training set data into a lightweight corn disease detection model for model training.
  6. 6. The method of claim 1, wherein the output disease detection results comprise disease category, confidence and lesion bounding box coordinates for each corn leaf image.
  7. 7. A lightweight corn disease detection system, comprising: The data acquisition module is used for acquiring corn leaf images of each growth period under the natural growth condition; The disease detection module is used for inputting the acquired corn leaf images into a pre-trained lightweight corn disease detection model and outputting disease detection results; The lightweight corn disease detection model construction module is used for constructing a lightweight corn disease detection model, the lightweight corn disease detection model takes YOLOv n as a basic network and comprises Backbone, neck and Head, all C2f modules of a Backbone part are replaced by C2f_Faster modules, upSample modules are replaced by dynamic sampling modules DySample in an up-sampling link of a PAN-FPN structure of a Neck part, a multiscale convolution attention module MSCA is embedded between Neck and Head, the C2f_Faster module splits a disease spot characteristic image of a corn leaf image extracted by the Backbone into a plurality of branches, disease detail characteristics of each branch are extracted respectively and then fused, so that a multiscale disease spot characteristic image is generated, the DySample receives a single-scale disease spot characteristic image, resamples the input characteristic image through a dynamic generation sampling point set, generates a high-resolution characteristic image, fuses the high-resolution characteristic image with the multiscale disease spot characteristic image, the MSCA denoises the fused multiscale characteristic image, outputs a disturbance removal characteristic image, and the Head detection result is mapped with a positioning disturbance removal result.

Description

Lightweight corn disease detection method and system Technical Field The invention relates to the technical field of image processing, in particular to a lightweight corn disease detection method and system. Background Corn is the first large grain crop in China, has wide planting area and high yield, is not only an important support for guaranteeing the national grain safety, but also a key feed raw material, and has great significance for the development of animal husbandry. However, corn is easy to be affected by diseases in the growing process, and if disease infection points are formed at 2-3 positions in the field, the whole land yield is extremely easy to slide down greatly, so that early accurate detection of corn diseases is important to guaranteeing the grain yield. Traditional corn disease identification relies on manual experience, leaves need to be screened one by one, and the problems of low efficiency and high false detection rate of missed detection exist. In recent years, deep learning technology, particularly Convolutional Neural Network (CNN), is widely applied to agricultural disease identification, and YOLO series algorithm becomes an important tool for crop disease detection due to the advantage of real-time property. Related researches improve detection performance by adding an attention module on the basis of YOLOv, improving a network neck structure and the like. However, the existing corn disease detection model based on the YOLO series generally has the problem that the precision and the light weight are difficult to balance, wherein, although part of the light weight model has small volume and low calculated amount, the model has the defects of missed detection of small target diseases, misjudgment of similar diseases, weak anti-interference capability of complex background and the like, so that the detection precision is low, and the actual detection requirement in the natural field environment cannot be met. Disclosure of Invention Aiming at the problems in the field, the invention provides a light-weight corn disease detection method and a light-weight corn disease detection system, and the constructed light-weight corn disease detection model can realize efficient and accurate identification of corn diseases and provide technical support for early diagnosis and accurate control of corn diseases. In order to solve the technical problems, the invention discloses a lightweight corn disease detection method, which comprises the following steps: Acquiring corn leaf images of each growth period under natural growth conditions; Inputting the acquired corn leaf image into a pre-trained lightweight corn disease detection model, and outputting a disease detection result; The lightweight corn disease detection model takes YOLOv n as a basic network and comprises Backbone, neck and Head, wherein all C2f modules of a Backbone part are replaced by C2f_Faster modules, a UpSample module is replaced by a dynamic sampling module DySample in an up-sampling link of a PAN-FPN structure of a Neck part, and a multi-scale convolution attention module MSCA is embedded between Neck and Head; The C2f_Faster module splits a disease spot characteristic image of a corn leaf image extracted by a backlight into a plurality of branches, respectively extracts disease detail characteristics of each branch and then fuses the branches to generate a multi-scale disease spot characteristic image, the DySample receives the single-scale disease spot characteristic image, resamples the input characteristic image through a dynamic generation sampling point set to generate a high-resolution characteristic image and fuses the high-resolution characteristic image with the multi-scale disease spot characteristic image, the MSCA denoises the fused multi-scale characteristic image to output a characteristic image with interference removed, and the Head classifies and locates the characteristic image with interference removed to output a disease detection result. Preferably, the inputting the obtained corn leaf image into a pre-trained lightweight corn disease detection model, outputting a disease detection result, specifically includes: The lightweight corn disease detection model uses YOLOv n base network, the original YOLOv n base network comprises Backbone, neck and Head, wherein: Replacing all C2f modules of the backbond part with C2f_Faster modules, wherein the C2f_Faster modules are Bottleneck structures in the C2f modules of the backbond part by FasterBlock in FASTERNET, and the FasterBlock replaces the traditional depth convolution with partial convolution PConv; In the up-sampling link of the PAN-FPN structure of the Neck part, the UpSample module is replaced by a dynamic sampling module DySample; embedding a multi-scale convolution attention module MSCA between the Neck and the Head, wherein the MSCA comprises a local information aggregation module, a multi-scale context capture module and a channel relation simul