Lightweight corn disease detection method and system

By improving the Backbone, Neck, and Head parts of the YOLOv8n network, a lightweight maize disease detection model was constructed, solving the balance between accuracy and lightweight design in the YOLO series models. This resulted in efficient and accurate maize disease detection, suitable for field environments.

CN122023779APending Publication Date: 2026-05-12SHANDONG ACADEMY OF AGRICULTURAL SCIENCES
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG ACADEMY OF AGRICULTURAL SCIENCES
Filing Date
2026-02-05
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing maize disease detection models based on the YOLO series struggle to balance accuracy and lightweight design, resulting in issues such as missed detection of small-target diseases, misjudgment of similar diseases, and weak resistance to interference in complex backgrounds, failing to meet the actual detection needs in natural field environments.

Method used

A lightweight maize disease detection model was constructed, using YOLOv8n as the base network. The C2f module of the Backbone was replaced with the C2f_Faster module, and the UpSample module of the Neck was replaced with DySample. The multi-scale convolutional attention module MSCA was embedded in the Neck and Head. Through the collaborative work of the C2f_Faster module, DySample and MSCA, multi-scale feature extraction and denoising were achieved, improving detection accuracy and efficiency.

Benefits of technology

It achieves a balance between lightweight model and high accuracy, effectively alleviates the problem of disease occlusion, reduces computational load, reduces missed detection of small targets and misjudgment of similar diseases, and adapts to edge devices to achieve real-time detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122023779A_ABST
    Figure CN122023779A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight corn disease detection method and system, and belongs to the technical field of image processing, and the method comprises the steps: obtaining corn leaf images in each growth period under a natural growth condition, inputting the images into a pre-trained lightweight corn disease detection model, and outputting a corresponding disease detection result. The C2fFaster module splits the disease spot feature map extracted by the Backbone into a plurality of branches, extracts disease detail features of each branch and then fuses the disease detail features so as to generate a multi-scale disease spot feature map; the DySample receives a single-scale disease spot feature map, resamples an input feature map by dynamically generating a sampling point set to generate a high-resolution feature map, and fuses the high-resolution feature map with a multi-scale disease spot feature map; de-noising the fused multi-scale feature map by the MSCA, and outputting a feature map without interference; and carrying out classification and positioning mapping on the interference-removed feature map by Head, and outputting a disease detection result. According to the method, the corn diseases can be quickly and accurately identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to a lightweight method and system for detecting corn diseases. Background Technology

[0002] Corn is my country's largest grain crop, with a wide planting area and high yield. It is not only an important support for ensuring national food security, but also a key feed ingredient, which is of great significance to the development of animal husbandry. However, corn is susceptible to diseases during its growth. If 2-3 disease infection points appear in the field, it can easily lead to a significant decline in the yield of the entire plot. Therefore, early and accurate detection of corn diseases is crucial to ensuring grain yield.

[0003] Traditional maize disease identification relies on manual experience, requiring leaf-by-leaf screening, which is inefficient and prone to false negatives and missed detections. In recent years, deep learning technology, especially convolutional neural networks (CNNs), has been widely used in agricultural disease identification, with the YOLO series algorithms becoming an important tool for crop disease detection due to their real-time advantages. Related research has improved detection performance by adding an attention module and improving the network neck structure on top of YOLOv8.

[0004] However, existing maize disease detection models based on the YOLO series generally suffer from the problem of balancing accuracy and lightweight design. Some lightweight models, although small in size and low in computation, have defects such as missed detection of small target diseases, misjudgment of similar diseases, and weak anti-interference ability in complex backgrounds, resulting in low detection accuracy and failing to meet the actual detection needs in natural field environments. Summary of the Invention

[0005] To address the problems existing in the above-mentioned fields, this invention proposes a lightweight corn disease detection method and system. The constructed lightweight corn disease detection model can achieve efficient and accurate identification of corn diseases, providing technical support for early diagnosis and precise prevention and control of corn diseases.

[0006] To address the aforementioned technical problems, this invention discloses a lightweight method for detecting corn diseases, comprising the following steps: Acquire maize leaf images at various growth stages under natural growth conditions; The acquired maize leaf images are input into a pre-trained lightweight maize disease detection model, which outputs disease detection results. The lightweight maize disease detection model uses YOLOv8n as its base network, including Backbone, Neck, and Head. All C2f modules in the Backbone are replaced with C2f_Faster modules; in the upsampling stage of the PAN-FPN structure in the Neck, the UpSample module is replaced with the dynamic sampling module DySample; and a multi-scale convolutional attention module MSCA is embedded between the Neck and Head. The C2f_Faster module splits the disease spot feature map of the corn leaf image extracted by Backbone into multiple branches, extracts the disease detail features of each branch, and then fuses them to generate a multi-scale disease spot feature map. The DySample receives a single-scale disease spot feature map, resamples the input feature map by dynamically generating a sampling point set to generate a high-resolution feature map, and fuses it with the multi-scale disease spot feature map. The MSCA denoises the fused multi-scale feature map and outputs a feature map with interference removed. The Head classifies and maps the interference-removed feature map and outputs the disease detection result.

[0007] Preferably, the step of inputting the acquired maize leaf images into a pre-trained lightweight maize disease detection model and outputting disease detection results specifically includes: The lightweight maize disease detection model uses the YOLOv8n base network, which includes Backbone, Neck, and Head, wherein: All C2f modules in the Backbone section are replaced with C2f_Faster modules. The C2f_Faster modules are created by replacing the Bottleneck structure in the C2f modules of the Backbone section with FasterBlock from FasterNet. The FasterBlock uses partial convolution PConv instead of traditional depthwise convolution. In the upsampling stage of the PAN-FPN structure in the Neck section, the UpSample module is replaced with the dynamic sampling module DySample; A multi-scale convolutional attention module (MSCA) is embedded between the Neck and the Head; the MSCA includes a local information aggregation module, a multi-scale context capture module, and a channel relationship simulation module. The C2f_Faster module splits the disease spot feature map of the corn leaf image extracted by the Backbone into multiple branches. The FasterBlock uses partial convolution PConv, which only performs convolution operation on a portion of the disease spot feature map of each branch. After outputting the disease detail features of each branch, the features are fused to generate a multi-scale disease spot feature map. In the Neck section, a PAN-FPN structure is adopted. Through top-down propagation and bottom-up aggregation, the generated multi-scale disease spot feature map is concatenated and fused with the high-resolution feature map to generate a fused multi-scale feature map. The high-resolution feature map generation process is as follows: input the single-scale disease spot feature map from the multi-scale disease spot feature map into the DySample, first generate a dynamic sampling point set through linear transformation and pixel recombination, and then resample the input disease spot feature map according to the generated dynamic sampling point set. The local information aggregation module uses deep convolution to filter high-frequency noise in the fused multi-scale feature map to obtain a noise-removed local feature map; the multi-scale context capture module uses multi-branch deep convolution to extract multiple receptive field features from the noise-removed local feature map to generate multi-scale context features; the channel relationship simulation module performs channel linear combination of the multi-scale context features through convolution operations to output a feature map with interference removed. The Head classifies and maps the feature maps after removing interference, and outputs the disease detection results.

[0008] Preferably, the high-resolution feature map generation process involves inputting a single-scale lesion feature map from a multi-scale lesion feature map into the DySample, first generating a dynamic sampling point set through linear transformation and pixel recombination, and then resampling the input lesion feature map based on the generated dynamic sampling point set. Specifically, this includes: The DySample divides the input single-scale disease spot feature map into two paths, and performs linear transformations on the linear layers of the input and output channels respectively to obtain the two-path linear transformation results. Multiply one of the linear transformation results by a preset dynamic range factor, and then reassemble it with the other linear transformation result to generate a dynamic sampling point set; Based on the generated dynamic sampling point set, the input disease spot feature map is resampled using the built-in grid_sample function of PyTorch to generate a high-resolution feature map corresponding to the disease spot feature map.

[0009] Preferably, the channel relationship simulation module performs channel linear combination of multi-scale context features through convolution operations to output a feature map with interference removed, specifically including: The channel relationship simulation module uses 1×1 pointwise convolution to perform channel linear combination of multi-scale context features and output a feature map with interference removed.

[0010] Preferably, acquiring maize leaf images at various growth stages under natural growth conditions specifically includes: Using a DSLR camera with a resolution of 2048×1536 pixels, images of corn leaves at various growth stages under natural growing conditions were captured on-site. The corn leaf images included single images, video frames, or live camera footage. During shooting, the distance between the lens and the leaf was maintained at 0.5~1m. The acquired corn leaf images were preprocessed, including scaling while maintaining aspect ratio and uniformly adjusting the width of the corn leaf images to 640 pixels. The LabelImg tool was used to annotate the preprocessed maize leaf images, marking the lesion boundaries, disease categories, and confidence levels. Training set data was constructed and input into the lightweight maize disease detection model for model training.

[0011] Preferably, the output disease detection results include the disease category, confidence level, and lesion bounding box coordinates for each corn leaf image.

[0012] Preferably, it also includes a lightweight corn disease detection system, comprising: The data acquisition module is used to acquire images of maize leaves at various growth stages under natural growth conditions; The disease detection module is used to input the acquired maize leaf images into a pre-trained lightweight maize disease detection model and output the disease detection results. A lightweight maize disease detection model construction module is used to build a lightweight maize disease detection model. This model uses YOLOv8n as its base network, including Backbone, Neck, and Head. All C2f modules in the Backbone are replaced with C2f_Faster modules; in the upsampling stage of the PAN-FPN structure in the Neck, the UpSample module is replaced with the dynamic sampling module DySample; and a multi-scale convolutional attention module MSCA is embedded between the Neck and Head. The C2f_Faster module... The disease spot feature map extracted from the maize leaf image by Backbone is split into multiple branches. The disease detail features of each branch are extracted and then fused to generate a multi-scale disease spot feature map. The DySample receives a single-scale disease spot feature map, resamples the input feature map by dynamically generating a sampling point set to generate a high-resolution feature map, and then fuses it with the multi-scale disease spot feature map. The MSCA denoises the fused multi-scale feature map and outputs a feature map with interference removed. The Head classifies and maps the interference-removed feature map and outputs the disease detection result.

[0013] Compared with the prior art, the present invention has the following beneficial effects: This invention proposes a lightweight maize disease detection method. The constructed lightweight maize disease detection model uses YOLOv8n as its base network, replacing all C2f modules in the Backbone with C2f_Faster modules. In the upsampling stage of the PAN-FPN structure in the Neck part, the UpSample module is replaced with the dynamic sampling module DySample. A multi-scale convolutional attention module MSCA is embedded between the Neck and Head. This model, through the collaborative work of the C2f_Faster module, DySample, and MSCA, achieves an optimal balance between structural efficiency, feature representation, and localization accuracy. It ensures a lightweight model while overcoming the accuracy bottleneck of traditional lightweight models, effectively alleviating disease occlusion problems and reducing computational load. Compared to the original YOLOv8 model, it can accurately identify maize diseases, reduce missed detections of small targets and misjudgments of similar diseases, and adapt to edge devices for real-time detection.

[0014] In the Backbone section, the C2f_Faster module enables the extraction of multi-scale lesion feature maps while achieving model lightweighting, solving the problem of traditional models struggling to balance lightweighting and feature extraction capabilities, thus laying the foundation for model deployment. In the Neck section, the DySample and the Neck's inherent PAN-FPN structure enable the fusion and detail enhancement of multi-scale lesion feature maps, addressing the detail loss issue caused by lightweighting and improving the quality of small target features. The resulting fused multi-scale feature maps are input into the MSCA, where a multi-dimensional attention mechanism achieves precise feature purification, resolving the issues of complex background interference and confusion with similar diseases, and enhancing feature discriminability. The resulting interference-free feature maps are then input into the Head, where efficient classification and localization are achieved through a decoupled head. Since the input features have undergone multiple rounds of optimization, the Head module does not need to deal with a large amount of interference information, resulting in faster inference speed and higher classification and localization accuracy. Attached Figure Description

[0015] Figure 1 This is a schematic diagram of the overall method flow of the present invention; Figure 2 This is a network architecture diagram of a lightweight maize disease detection model provided in an embodiment of the present invention; Figure 3 A flowchart of linear transformation and pixel recombination provided in an embodiment of the present invention; Figure 4 A flowchart of resampling provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of a lightweight corn disease detection system provided in an embodiment of the present invention. Detailed Implementation

[0016] The following will refer to the appendices in the embodiments of the present invention. Figures 1-5 The technical solutions in the embodiments of the present invention will be clearly and completely described. It should be understood that the terminology used in the present invention is only for describing particular implementation methods and is not intended to limit the present invention.

[0017] Example like Figure 1 As shown in the embodiment of the present invention, a lightweight corn disease detection method is provided, which includes the following steps: S1: Obtain maize leaf images at each growth stage under natural growth conditions; S2: Input the acquired maize leaf images into the pre-trained lightweight maize disease detection model and output the disease detection results; The lightweight maize disease detection model uses YOLOv8n as its base network, including Backbone, Neck, and Head. All C2f modules in the Backbone are replaced with C2f_Faster modules; in the upsampling stage of the PAN-FPN structure in the Neck, the UpSample module is replaced with the dynamic sampling module DySample; and a multi-scale convolutional attention module MSCA is embedded between the Neck and Head. The C2f_Faster module splits the disease spot feature map of the corn leaf image extracted by Backbone into multiple branches, extracts the disease detail features of each branch, and then fuses them to generate a multi-scale disease spot feature map. DySample receives the disease spot feature map at a single scale, resamples the input feature map by dynamically generating a set of sampling points to generate a high-resolution feature map, and then fuses it with the multi-scale disease spot feature map. MSCA denoises the fused multi-scale feature map and outputs a feature map with interference removed. Head classifies and maps the feature map with interference removed and outputs the disease detection results.

[0018] S1 Data Acquisition and Data Processing Process S1.1 Original Image Acquisition: Field shooting was conducted using a DSLR camera with a resolution of 2048×1536 pixels. During shooting, the distance between the lens and the leaves was kept at 0.5~1m to avoid excessive blurring. The subjects included different types of diseases in maize at various growth stages and field scenes under different light and shading conditions. At the same time, maize disease-related images were screened from authoritative agricultural datasets such as PlantVillage and Agricultural DiseaseDataset to supplement the diversity of the dataset.

[0019] S1.2 Image Preprocessing and Annotation: The original images of all collected maize leaf images were scaled while maintaining aspect ratio, and the image width was uniformly adjusted to 640 pixels. The LabelImg annotation tool was used to annotate the diseased areas in the preprocessed maize leaf images. The annotation box should be closely attached to the edge of the lesion, with an error of no more than 5 pixels. For occluded lesions, if the occlusion area is ≤1 / 3, they are annotated normally; if the occlusion area is >1 / 3, they are not annotated to avoid interfering with model training. After annotation, a txt format annotation file was generated to construct the YOLO standard dataset.

[0020] S1.3 Dataset Augmentation and Splitting: The labeled images were augmented with random rotation (rotation angle range 0°~360°), translation (translation amplitude ±10%), illumination adjustment (brightness change range ±20%, contrast change range ±15%), and noise addition (Gaussian noise intensity 0.01~0.03), resulting in 4840 valid images. The augmented dataset was then randomly divided into a training set (3872 images), a validation set (484 images), and a test set (484 images) in an 8:1:1 ratio.

[0021] Construction of the S2 Lightweight Maize Disease Detection Model S2.1 Basic Model Selection: such as Figure 2 As shown, the YOLOv8n network is the basic network, and its network structure consists of three parts: Backbone, Neck, and Head. The Backbone adopts an improved CSPDarknet53 architecture with the C2f module as the core. The Neck adopts a PAN-FPN structure to achieve multi-scale feature fusion. The Head adopts a decoupled head design to improve classification and localization accuracy, and uses an anchor-free mechanism to simplify the training process.

[0022] S2.2 Optimization of the Network Structure of the Lightweight Maize Disease Detection Model Constructed in this Invention 2.2.1 Replacement of the C2f module in the Backbone section: Addressing the computational redundancy and frequent memory access issues in the original YOLOv8n Backbone C2f module, such as... Figure 3As shown, this invention introduces FasterBlock from FasterNet to replace the Bottleneck structure in the original YOLOv8n C2f module, forming the C2f_Faster module. The FasterBlock core uses partial convolution (PConv) instead of traditional depthwise convolution, performing convolution operations only on a portion of the input feature map while keeping the remaining channels unchanged. This reduces computational cost and memory access frequency while improving computational efficiency by utilizing feature redundancy information. The C2f_Faster module inherits the multi-branch feature fusion logic of C2f and retains the "convolution-split-fusion" structural framework. That is, in the original YOLOv8n Backbone part, all C2f modules are replaced with C2f_Faster modules. The maize leaf image is input into the Backbone for feature extraction, and the output is a disease spot feature map. The C2f_Faster module splits the disease spot feature map into multiple branches. FasterBlock uses partial convolution PConv to perform convolution operations only on a portion of the disease spot feature map of each branch. After outputting the disease detail features of each branch, they are fused to generate multi-scale disease spot feature maps, achieving network lightweighting while ensuring that the disease feature extraction capability is not lost.

[0023] S2.2.2 Replacement of the UpSample module in the Neck section: Addressing the issues of feature detail loss and contextual information fragmentation caused by the traditional UpSample module's use of bilinear interpolation or nearest-neighbor interpolation, such as... Figure 4 As shown, this invention introduces the DySample module to replace the UpSample module in the upsampling stage of the PAN-FPN structure in the Neck section of the original YOLOv8n. The DySample module achieves upsampling through two steps: "dynamic sampling point generation - feature resampling". First, the single-scale lesion feature map in the multi-scale lesion feature map is divided into two paths, which are linearly transformed by linear layers matching the number of input and output channels, resulting in two linear transformation results. One of the linear transformation results is multiplied by a dynamic range factor of 0.5 and then pixel-shuffled with the other linear transformation result to obtain a result of size [missing value]. offset ,like Figure 3 As shown, a dynamic sampling point set is generated, increasing the flexibility of sampling point offsets; then, based on the generated dynamic sampling point set, the PyTorch built-in grid_sample function is used, as follows: Figure 4As shown, the input disease spot feature map is resampled to generate a high-resolution feature map; the multi-scale disease spot feature map generated by the C2f_Faster module is concatenated and fused with the resampled high-resolution feature map to generate a fused multi-scale feature map, so as to improve the ability to preserve details of small target disease features.

[0024] S2.2.3 MSCA Embedding: A multi-scale convolutional attention module (MSCA) is embedded between the Neck and Head parts of the original YOLOv8n. This module consists of three parts: ① Local Information Aggregation Module: High-frequency noise in the multi-scale fusion features generated by deep convolution is filtered to obtain a noise-removed local feature map. This is achieved using deep convolution to aggregate local spatial information with low computational cost; ② Multi-scale Context Capture Module: Multi-branch deep convolution is used to extract multiple receptive field features from the noise-removed local feature map to generate multi-scale context features. Each branch uses convolution kernels of different sizes, such as 7×7, 11×11, and 21×21, to capture multi-scale context information with different receptive fields; ③ Channel Relationship Simulation Module: The multi-scale context features are linearly combined through convolution operations to output a feature map with interference removed. The number of channels in the feature map is changed by 1×1 pointwise convolution, and the features of different channels are linearly combined to simulate the relationship between channels. The MSCA module enhances disease characteristics and suppresses background interference without increasing computational load, thereby improving the model's ability to resist interference from complex backgrounds and distinguish similar diseases.

[0025] Model training process The lightweight corn disease detection model was constructed by inputting the training set divided into S1 in batches. The training parameters were set as follows: batch size of 16, number of training epochs of 200, and initial learning rate of 0.01. The learning rate was adjusted using a cosine annealing learning rate scheduling strategy. The CIoU loss function was used as the localization loss, and the cross-entropy loss function was used as the classification loss. The model parameters were updated through backpropagation. During the training process, the model performance was monitored in real time using the validation set. When the mAP of the validation set did not improve for 10 consecutive epochs, the training was stopped, the optimal model weights were saved, and the trained lightweight corn disease detection model was obtained.

[0026] S4: Application of Corn Disease Detection and Visualization System S4.1 Input of image to be detected: Through the function selection area of ​​the visual interactive system, select to import a single image, video file or open the camera to obtain real-time image as the corn leaf image to be detected.

[0027] S4.2 Image Preprocessing: The system automatically processes the input corn leaf image to be detected according to the preprocessing method in S1, maintaining the aspect ratio and scaling the image width to 640 pixels, without manual intervention, to obtain the processed corn leaf image to be detected.

[0028] S4.3 Model Detection and Result Filtering: The processed maize leaf images to be detected are input into the trained lightweight maize disease detection model. The constructed model extracts disease features through the C2f_Faster module of Backbone, achieves multi-scale feature fusion through the PAN-FPN structure and DySample module of Neck, focuses on disease features and suppresses background interference through the MSCA module, and finally outputs disease category, confidence score and lesion bounding box coordinates by the decoupling head of Head. The system has a built-in confidence threshold (default 0.5, supports manual adjustment) to filter prediction results below the threshold and retain valid detection results.

[0029] S4.4 Result Display and Output: such as Figure 5 As shown, this is the page of the visual interactive system for lightweight corn disease detection provided by the present invention, which includes an image display area, a result display area, and a function selection area. Figure 5 The upper part of the display area is the image display area. The left side shows the original image or video display box, and the right side shows the detection results display box, including lesion boundaries, disease categories, and confidence levels. After detection, the system marks the lesion boundaries (different colors correspond to different disease categories), disease categories (text labels), and confidence levels (numerical labels) on the original image and displays them in the detection results display box. Figure 5 The lower left part of the image is the results display area, which synchronously records the imported image path, detection time, identified disease categories and corresponding confidence levels to complete the detection operation. Figure 5 The lower right side of the screen is the function selection area, which includes four function buttons: image file, video file, camera, and stop.

[0030] The visualization and interactive system of this invention is built on PyQt5 and adopts a single-window multi-view design. The interface follows the operating habits of the agricultural field, with light colors as the main color and green function buttons to ensure visual comfort during long-term use. The default window size is 1280×800 pixels, and it supports full screen and window scaling. All UI elements adopt a responsive layout to adapt to display devices of different sizes. The upper half of the window is the image display area (the left side displays the original image / video, and the right side displays the detection results), the bottom left side is the result display area, and the bottom right side is the function selection area (including four function buttons: image file, video file, camera, and stop).

[0031] This invention also proposes a lightweight corn disease detection system, comprising: The data acquisition module is used to acquire images of maize leaves at various growth stages under natural growth conditions; The disease detection module is used to input the acquired maize leaf images into a pre-trained lightweight maize disease detection model and output the disease detection results. A lightweight maize disease detection model construction module is used to build a lightweight maize disease detection model. This model uses YOLOv8n as its base network, including Backbone, Neck, and Head. All C2f modules in the Backbone are replaced with C2f_Faster modules; in the upsampling stage of the PAN-FPN structure in the Neck, the UpSample module is replaced with the dynamic sampling module DySample; and a multi-scale convolutional attention module MSCA is embedded between the Neck and Head. The C2f_Faster module... The disease spot feature map extracted from the maize leaf image by Backbone is split into multiple branches. The disease detail features of each branch are extracted and then fused to generate a multi-scale disease spot feature map. The DySample receives a single-scale disease spot feature map, resamples the input feature map by dynamically generating a sampling point set to generate a high-resolution feature map, and then fuses it with the multi-scale disease spot feature map. The MSCA denoises the fused multi-scale feature map and outputs a feature map with interference removed. The Head classifies and maps the interference-removed feature map and outputs the disease detection result.

[0032] The beneficial effects of the lightweight corn disease detection method proposed in this invention are as follows: 1. Achieving a three-dimensional balance between accuracy, lightweight design, and efficiency: The constructed lightweight maize disease detection model improves the structure of three networks in the Backbone, Neck, and Head parts through the C2f_Faster, DySample, and MSCA modules, respectively. This effectively alleviates the problem of insufficient feature extraction caused by disease occlusion and reduces the computational load of the model. Compared with the original YOLOv8 model, the mean average precision (mAP) is improved. It can accurately identify maize diseases, reduce missed detections of small targets and misjudgments of similar diseases, and is also adaptable to edge devices, enabling real-time detection. 2. Significant Module Collaborative Optimization Results: The model constructed in this invention achieves lightweighting through the C2f_Faster module, reducing computation by 22.2% compared to YOLOv8n; the DySample module compensates for the accuracy loss caused by lightweighting, improving the detection accuracy of small target defects by 3.1%; the MSCA module enhances the anti-interference capability of complex backgrounds, improving accuracy by 0.9%~1.5% compared to traditional attention modules (SA, CBAM, etc.) without adding additional computational burden. The C2f_Faster module, DySample module, and MSCA module work together to achieve the optimal balance of "structural efficiency-feature representation-localization accuracy". 3. Highly practical and applicable to a wide range of scenarios: It is suitable for static image detection and dynamic video monitoring of corn diseases in the field. It can be combined with drone aerial photography and portable detection equipment to achieve large-scale and mobile monitoring. The supporting visualization system is easy to operate and caters to the needs of both professionals and ordinary farmers. It can also be extended to fields such as multi-crop disease identification, agricultural Internet of Things integration, and pest and disease control assistance.

[0033] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

[0034] Furthermore, unless otherwise stated, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. All references to this specification are incorporated by way of citation to disclose and describe methods relating to those references. In the event of any conflict with any incorporated reference, the content of this specification shall prevail.

Claims

1. A lightweight method for detecting corn diseases, characterized in that, Includes the following steps: Acquire maize leaf images at various growth stages under natural growth conditions; The acquired maize leaf images are input into a pre-trained lightweight maize disease detection model, which outputs disease detection results. The lightweight maize disease detection model uses YOLOv8n as its base network, including Backbone, Neck, and Head. All C2f modules in the Backbone are replaced with C2f_Faster modules; in the upsampling stage of the PAN-FPN structure in the Neck, the UpSample module is replaced with the dynamic sampling module DySample; and a multi-scale convolutional attention module MSCA is embedded between the Neck and Head. The C2f_Faster module splits the disease spot feature map of the corn leaf image extracted by Backbone into multiple branches, extracts the disease detail features of each branch, and then fuses them to generate a multi-scale disease spot feature map. The DySample receives a single-scale disease spot feature map, resamples the input feature map by dynamically generating a sampling point set to generate a high-resolution feature map, and fuses it with the multi-scale disease spot feature map. The MSCA denoises the fused multi-scale feature map and outputs a feature map with interference removed. The Head classifies and maps the interference-removed feature map and outputs the disease detection result.

2. The lightweight corn disease detection method according to claim 1, characterized in that, The process of inputting the acquired maize leaf images into a pre-trained lightweight maize disease detection model and outputting disease detection results specifically includes: The lightweight maize disease detection model uses the YOLOv8n base network, which includes Backbone, Neck, and Head, wherein: All C2f modules in the Backbone section are replaced with C2f_Faster modules. The C2f_Faster modules are created by replacing the Bottleneck structure in the C2f modules of the Backbone section with FasterBlock from FasterNet. The FasterBlock uses partial convolution PConv instead of traditional depthwise convolution. In the upsampling stage of the PAN-FPN structure in the Neck section, the UpSample module is replaced with the dynamic sampling module DySample; A multi-scale convolutional attention module (MSCA) is embedded between the Neck and the Head; the MSCA includes a local information aggregation module, a multi-scale context capture module, and a channel relationship simulation module. The C2f_Faster module splits the disease spot feature map of the corn leaf image extracted by the Backbone into multiple branches. The FasterBlock uses partial convolution PConv, which only performs convolution operation on a portion of the disease spot feature map of each branch. After outputting the disease detail features of each branch, the features are fused to generate a multi-scale disease spot feature map. In the Neck section, a PAN-FPN structure is adopted. Through top-down propagation and bottom-up aggregation, the generated multi-scale disease spot feature map is concatenated and fused with the high-resolution feature map to generate a fused multi-scale feature map. The high-resolution feature map generation process is as follows: input the single-scale disease spot feature map from the multi-scale disease spot feature map into the DySample, first generate a dynamic sampling point set through linear transformation and pixel recombination, and then resample the input disease spot feature map according to the generated dynamic sampling point set. The local information aggregation module uses deep convolution to filter high-frequency noise in the fused multi-scale feature map to obtain a noise-removed local feature map; the multi-scale context capture module uses multi-branch deep convolution to extract multiple receptive field features from the noise-removed local feature map to generate multi-scale context features; the channel relationship simulation module performs channel linear combination of the multi-scale context features through convolution operations to output a feature map with interference removed. The Head classifies and maps the feature maps after removing interference, and outputs the disease detection results.

3. The lightweight corn disease detection method according to claim 2, characterized in that, The high-resolution feature map generation process involves inputting a single-scale lesion feature map from a multi-scale lesion feature map into the DySample, first generating a dynamic sampling point set through linear transformation and pixel recombination, and then resampling the input lesion feature map based on the generated dynamic sampling point set. Specifically, this includes: The DySample divides the input single-scale disease spot feature map into two paths, and performs linear transformations on the linear layers of the input and output channels respectively to obtain the two-path linear transformation results. Multiply one of the linear transformation results by a preset dynamic range factor, and then reassemble it with the other linear transformation result to generate a dynamic sampling point set; Based on the generated dynamic sampling point set, the input disease spot feature map is resampled using the built-in grid_sample function of PyTorch to generate a high-resolution feature map corresponding to the disease spot feature map.

4. The lightweight corn disease detection method according to claim 2, characterized in that, The channel relationship simulation module performs channel linear combination of multi-scale context features through convolution operations, outputting a feature map with interference removed, specifically including: The channel relationship simulation module uses 1×1 pointwise convolution to perform channel linear combination of multi-scale context features and output a feature map with interference removed.

5. The lightweight corn disease detection method according to claim 1, characterized in that, The acquisition of maize leaf images at various growth stages under natural growth conditions specifically includes: Using a DSLR camera with a resolution of 2048×1536 pixels, images of corn leaves at various growth stages under natural growing conditions were captured on-site. The corn leaf images included single images, video frames, or live camera footage. During shooting, the distance between the lens and the leaf was maintained at 0.5~1m. The acquired corn leaf images were preprocessed, including scaling while maintaining aspect ratio and uniformly adjusting the width of the corn leaf images to 640 pixels. The LabelImg tool was used to annotate the preprocessed maize leaf images, marking the lesion boundaries, disease categories, and confidence levels. Training set data was constructed and input into the lightweight maize disease detection model for model training.

6. The lightweight corn disease detection method according to claim 1, characterized in that, The output disease detection results include the disease category, confidence level, and lesion bounding box coordinates for each corn leaf image.

7. A lightweight corn disease detection system, characterized in that, include: The data acquisition module is used to acquire images of maize leaves at various growth stages under natural growth conditions; The disease detection module is used to input the acquired maize leaf images into a pre-trained lightweight maize disease detection model and output the disease detection results. A lightweight maize disease detection model construction module is used to build a lightweight maize disease detection model. This model uses YOLOv8n as its base network, including Backbone, Neck, and Head. All C2f modules in the Backbone are replaced with C2f_Faster modules; in the upsampling stage of the PAN-FPN structure in the Neck, the UpSample module is replaced with the dynamic sampling module DySample; and a multi-scale convolutional attention module MSCA is embedded between the Neck and Head. The C2f_Faster module... The disease spot feature map extracted from the maize leaf image by Backbone is split into multiple branches. The disease detail features of each branch are extracted and then fused to generate a multi-scale disease spot feature map. The DySample receives a single-scale disease spot feature map, resamples the input feature map by dynamically generating a sampling point set to generate a high-resolution feature map, and then fuses it with the multi-scale disease spot feature map. The MSCA denoises the fused multi-scale feature map and outputs a feature map with interference removed. The Head classifies and maps the interference-removed feature map and outputs the disease detection result.