Corn leaf disease detection method based on lightweight target detection network
Patent Information
- Application Number
- CN202610888226.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-08-07
AI Technical Summary
这导致现有算法极易出现深层病斑特征提取不充分、对边缘模糊及小尺度病斑定位困难且召回能力有限,以及在复杂背景干扰下因缺乏注意力引导而误检频发的问题
[0015]因此,本发明采用上述基于轻量化目标检测网络的玉米叶部病害检测方法,通过设计的MSGCKA特征增强模块,提升了复杂田间场景中识别小尺度、弱纹理病斑的能力,尤其是在病斑边缘特征不明显或背景干扰强烈的区域,能够通过大核卷积与特征重标定强化深层病斑特征表达,显著减少玉米病害误检与漏检的情况。构建了一种GCoMRA注意力增强模块,通过联合空间位置坐标感应和多尺度深度卷积区域响应,很好地抑制了叶脉纹理、光照变化及复杂背景土壤的干扰,从而在有效控制计算开销的前提下,增强了模型对点状、扩散性及模糊边缘病斑等显著区域的感知能力,提高了复杂农田背景下目标识别的鲁棒性和精度。设计了一种RDSD轻量化解耦检测头,通过将分类与边界框回归任务分离,并在回归分支中引入连续的深度可分离卷积(DSConv)及基于DFL的分布式边界框解码机制,有效缓解了复杂背景下边缘模糊、尺度小及形状不规则病斑定位与召回困难的问题,在显著降低模型计算复杂度的同时提升了检测性能与模糊病斑的召回率。
Smart Images

Figure CN122530822A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of target recognition and intelligent agriculture technology, and in particular to a method for detecting diseases in maize leaves based on a lightweight target detection network. Background Technology
[0002] Images of maize leaf diseases, captured by inspection drones or portable field monitoring devices, are widely used in smart agriculture, intelligent crop disease monitoring, and precision agricultural production management. Particularly in real-time field disease control, the identification of major maize leaf diseases is crucial for ensuring stable maize yields and guiding precise pesticide application. However, real-world farmland environments are complex, presenting challenges such as significant variations in lesion scale, weak texture features in small-scale lesions, strong background interference, and blurred lesions.
[0003] Currently, lightweight single-stage detectors, represented by the YOLO series, have achieved some breakthroughs in inference speed and accuracy for identifying leaf diseases in maize. However, they still have limitations when facing complex real-world farmland scenarios. In actual field image acquisition, maize lesions often exhibit large scale differences, weak texture details in small-scale lesions, and indistinct edge features. This leads to existing algorithms being prone to insufficient extraction of deep lesion features, difficulty in locating blurred edges and small-scale lesions with limited recall, and frequent false detections due to a lack of attention guidance in complex background interference.
[0004] In summary, existing target recognition algorithms still have significant limitations in practical applications. They are unable to achieve high-precision, high-recall, and lightweight identification of major leaf diseases in maize under real farmland scenarios with large differences in lesion scale, weak texture features of small-scale lesions, strong background interference, and blurred lesions. Summary of the Invention
[0005] The purpose of this invention is to provide a method for detecting maize leaf diseases based on a lightweight target detection network, which significantly improves the model's accuracy in identifying maize leaf diseases with large differences in lesion scale, weak texture features of small-scale lesions, strong background interference, and blurred lesions.
[0006] To achieve the above objectives, this invention provides a method for detecting leaf diseases in maize based on a lightweight target detection network, comprising the following steps: Step 1: Collect images of corn leaf diseases, adjust the image size, label the types of corn leaf diseases, construct a corn leaf disease dataset and divide it into training and validation sets, and preprocess the training set. Step 2: Construct the MSGCKA module, GCoMRA attention module, and RDSD lightweight decoupled detection head. The MSGCKA feature enhancement module improves the model's ability to represent small-scale, weakly textured, and blurred-edge lesions by improving the feature splitting mechanism, introducing large-kernel multi-scale receptive field capture, and contextual attention recalibration. The GCoMRA attention module guides the network to effectively suppress interference from background textures and irrelevant regions by jointly combining spatial coordinate position awareness and multi-scale deep convolutional region response. Step 3: Construct an improved YOLO11n target recognition model, including an improved feature extraction Backbone module, an improved feature fusion Neck module, and an improved Head module; Step 4: Using the preprocessed training and validation sets from Step 1, train and validate the improved YOLO11n target recognition model to obtain the final improved YOLO11n target recognition model for identifying corn leaf diseases.
[0007] Preferably, the preprocessing in step one includes Mosaic data enhancement, random scaling, horizontal flipping, and color dithering. Mosaic data enhancement divides multiple images into random proportions and stitches them together to form a new image. The generated image is then subjected to random scaling within a range of ±50% with a gain coefficient of 0.5, random horizontal flipping with a probability of 50%, and random adjustment of the image's hue, saturation, and brightness within the HSV color space.
[0008] Preferably, in step two, the MSGCKA module includes a feature splitting shortcut branch, a main deep feature extraction branch of the GCKA-Bottleneck unit, and a feature integration and splicing layer. The main deep feature extraction branch of the GCKA-Bottleneck unit extracts the input features through convolution and feeds them into the GCKA structure. In the GCKA structure, contextual information is extracted through multi-scale depthwise convolution and attention weights are generated. These weights are then multiplied element-wise with the reserved features to achieve recalibration. The feature integration and splicing layer concatenates the output of the main deep feature extraction branch with the output of the feature splitting shortcut branch. Finally, dimensionality reduction and channel mapping are performed through a 1×1 CBS convolutional layer.
[0009] Preferably, in step two, the GCoMRA module includes a channel pre-fusion layer, a coordinate attention layer, a multi-scale receptive field parallel branch, and a spatial weight recalibration layer. The multi-scale receptive field parallel branch feeds the features output by the coordinate attention layer into a parallel structure containing 7×7, 11×11, and 21×21 depthwise convolutions to extract multi-scale semantics. The spatial weight recalibration layer generates spatial weights from the aggregated features of the multi-scale receptive field parallel branch and multiplies them element-wise by channel with the shortcut branch reserved by the coordinate attention layer. Finally, the features are deeply interleaved through the Conv convolutional layer.
[0010] Preferably, in step two, the RDSD lightweight decoupled detection head includes a classification branch and a regression branch; the classification branch replaces the conventional spatial convolution with two consecutive 1×1 ordinary convolutions to eliminate computational redundancy; the regression branch consists of three consecutively stacked 3×3 depth-separable convolutions and one 1×1 ordinary convolution, and the DFL distributed bounding box decoding mechanism is connected at the end of this branch to accurately predict the boundaries of blurred lesions.
[0011] Preferably, the data flow steps in the improved feature extraction Backbone module in step three are as follows: S11. Input the preprocessed input image from step one into the improved feature extraction Backbone module; S12. The input image passes through two cascaded CBS modules in sequence. The CBS module contains Conv2d convolution, BatchNorm2d batch normalization, and SiLU activation function. S13. Input the feature map into the first MSGCKA module to achieve deep interweaving and full fusion of shallow weak spatial details and deep multi-scale semantic features; S14. The data is downsampled by the third CBS module and then input into the second MSGCKA module. The output here is the feature of the small target, which is called input one. S15. Input 1 is downsampled by the fourth CBS module and then input to the third MSGCKA module. The output here is the feature of a medium-sized target, which is called Input 2. S16. Input 2 is downsampled by the fifth CBS module and then input into the fourth MSGCKA module for deep feature extraction; S17. Feature map input SPPF module, aggregates multi-scale context and expands receptive field; S18. The feature map is input to the C2PSA module to extract deep global context information. The output here is the feature of a large target, denoted as input three.
[0012] Preferably, in step three, input one, input two, and input three are jointly input into the improved feature fusion Neck module for multi-scale feature fusion. The data flow steps in the improved feature fusion Neck module are as follows: S21, Input three-input upsampling module Upsample; S22. Perform channel concatenation between input 2 and the feature map upsampled in step S21; The outputs of S23 and S22 are processed by an MSGCKA module for feature aggregation to obtain the neck mid-section features. S24. The neck mid-section features are upsampled by the Upsample module and concatenated with the input channel to obtain the output of S24. The outputs of S25 and S24 enter the MSGCKA module to obtain the output of S25, which serves as the first input to the Head recognition module, corresponding to small target recognition. S26. The output of S25 is downsampled by the CBS module; S27. Perform channel stitching on the feature map and the middle neck feature after downsampling in S26; The outputs of S28 and S27 are fed into the MSGCKA module to obtain the output, which is called the output of S28. This output is then passed through the GCoMRA attention module and used as the second input of the Head recognition module, corresponding to medium target recognition. S29. The output of S28 is downsampled by the CBS module to obtain the output of S29. S210. The output of S29 is concatenated with the third deep input, and the output is used as the third input of the Head module for large target recognition.
[0013] Preferably, in step three, the Head module calculates and outputs the bounding box information of the target in parallel on the three-way multi-scale feature map output by the improved feature fusion Neck module, including the horizontal and vertical coordinates of the center point, width, height, confidence score, and target category.
[0014] Preferably, in step four, a transfer learning strategy is adopted during training. The SGD optimizer is selected, and all weight parameters of the improved feature extraction Backbone module, the improved feature fusion Neck module, and the recognition Head module of the improved YOLO11n target recognition model are jointly trained throughout the entire process. The average precision (mAP), frames per second (FPS), precision, and recall are selected to evaluate the performance of the model.
[0015] Therefore, this invention employs the aforementioned maize leaf disease detection method based on a lightweight target detection network. Through the designed MSGCKA feature enhancement module, it improves the ability to identify small-scale, weakly textured lesions in complex field scenarios, especially in areas where lesion edge features are indistinct or where background interference is strong. It enhances the expression of deep lesion features through large-kernel convolution and feature recalibration, significantly reducing false positives and false negatives in maize disease detection. A GCoMRA attention enhancement module is constructed, which effectively suppresses interference from leaf vein texture, light variations, and complex soil backgrounds by combining spatial coordinate sensing and multi-scale deep convolutional region responses. This enhances the model's ability to perceive significant areas such as point-like, diffuse, and blurred-edge lesions while effectively controlling computational overhead, improving the robustness and accuracy of target recognition in complex farmland backgrounds. A lightweight decoupled detection head, RDSD, is designed. By separating the classification and bounding box regression tasks and introducing continuous depthwise separable convolution (DSConv) and a DFL-based distributed bounding box decoding mechanism in the regression branch, it effectively alleviates the difficulties in locating and recalling lesions with blurred edges, small scale, and irregular shapes in complex backgrounds. It significantly reduces the computational complexity of the model while improving detection performance and recall rate of blurred lesions.
[0016] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0017] Figure 1 Example images of maize leaf diseases collected for this invention; Figure 2 This is a flowchart of the data preprocessing process of the present invention; Figure 3 This is a schematic diagram of the MSGCKA module of the present invention; Figure 4 This is a schematic diagram of the GCoMRA attention module of the present invention; Figure 5 This is a schematic diagram of the CA attention mechanism of the present invention; Figure 6 This is a schematic diagram of the detection head of the original YOLO11n model; Figure 7 This is a schematic diagram of the RDSD detection head of the present invention; Figure 8 This is a diagram illustrating the overall architecture of the improved YOLO11n target recognition model of this invention. Figure 9 This is the overall architecture diagram of the original YOLO11n model; Figure 10 This is a comparison chart of the mAP indices for different types of maize leaf diseases identified by the five models in Table 1 of this invention; Figure 11This is a visual comparison chart showing the identification of different corn leaf diseases by the five models in Table 1 of this invention. Detailed Implementation
[0018] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0019] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0020] Example Please see Figures 1-11 This invention provides a method for detecting leaf diseases in maize based on a lightweight target detection network, comprising the following steps: Step 1: Collect images of corn leaf diseases, adjust the image size, label the types of corn leaf diseases, construct a corn leaf disease dataset and divide it into training and validation sets, and preprocess the training set.
[0021] ① Image collection: A total of 4,185 images of corn leaf diseases were collected from different shooting angles and distances on the RoboflowUniverse platform. The corn leaf diseases include four typical corn leaf diseases: wilt, common rust, gray leaf spot, and healthy. Figure 1 The image shows four typical corn leaf diseases: wilt, common rust, gray leaf spot, and healthy corn.
[0022] ② Adjust the size of the corn leaf disease images. Use FSCapture software to capture the collected corn leaf disease images to a size of 800×800 pixels.
[0023] ③ Label corn leaf diseases: Use labelme to label the corn leaf diseases in all corn leaf disease images after step ②.
[0024] ④ Using the 4185 maize leaf disease images processed in step ③, a maize leaf disease dataset was constructed and divided in a 7:2:1 ratio: 2930 images were used for training, 837 for validation, and 418 for testing.
[0025] ⑤ Preprocess the training set to overcome the problem of imbalanced samples and enhance the model's generalization ability.
[0026] To enhance the model's generalization ability in complex farmland environments, four data augmentation operations were performed on the training set, such as... Figure 2 As shown, the four data augmentation methods are Mosaic data augmentation, random scaling, horizontal flipping, and color dithering, in that order. The logic for using these four data augmentation methods is as follows: For the images in the training set, the system performs Mosaic data augmentation; subsequently, random scaling, horizontal flipping, and color dithering are performed sequentially on the generated images.
[0027] a. Mosaic Data Augmentation: Mosaic data augmentation involves segmenting multiple images (usually four) at random proportions and then stitching them together to create a new image. This method greatly enriches the background context of the image, effectively improving the model's ability to identify small-scale, weakly textured lesions in complex farmland scenes, and overcoming the problems of low proportion of small target samples and complex background environments.
[0028] b. Random scaling: Without altering the original physical aspect ratio of the corn leaf diseases, the image is randomly scaled within a range of ±50% using a gain factor of 0.5. This operation simulates different shooting angles in actual farmland scenes, significantly enhancing the model's adaptability to targets of different scales.
[0029] c. Horizontal Flip: The image is randomly flipped horizontally with a 50% probability. This operation increases the spatial diversity of maize leaf vein direction, lesion distribution location, and field environment background, and enhances the model's robustness in recognizing different leaf growth orientations and shooting angles (Note: Considering the natural light direction in real field scenes (usually from top to bottom) and the general growth posture of maize leaves, vertical flipping was not enabled to prevent the introduction of unnatural light and shadow and morphological interference features).
[0030] d. Color jitter: Randomly adjusts the hue, saturation, and brightness of the image within the HSV color space. This operation effectively simulates the light distribution and color shift under different weather conditions (such as sunny, cloudy, and rainy days) and different field shooting conditions (such as direct sunlight at noon, backlighting, color temperature changes in the early morning and evening, or shadows formed by mutual shading of leaves), significantly improving the model's ability to recognize and adapt to the complex and variable lighting environment of actual farmland and the fading phenomenon of lesions at different stages of infection.
[0031] Through the above data augmentation operations, a large number of diverse training samples that closely match the real farmland environment were generated, which effectively improved the model's generalization ability in different field monitoring scenarios and natural conditions. To a large extent, it overcame the problems of high target false negative rate and low recognition accuracy caused by large differences in the scale of corn leaf lesions, strong interference from complex backgrounds, weak textures and blurred edges.
[0032] ⑥ Adjust the input image of the maize leaf disease dataset after processing with the four data augmentation operations to a size of 640×640 pixels.
[0033] Step 2: Construct the MSGCKA module, GCoMRA attention module, and RDSD lightweight decoupled detection head; construct the Multi-Scale Global Context Kernel Attention (MSGCKA) module, the GSConv-enhanced Coordinate Multi-Receptive Attention (GCoMRA) module, and generate the Regression-enhanced Deepthwise-Separable Decoupled (RDSD) detection head.
[0034] The MSGCKA module includes a feature splitting shortcut branch, a main deep feature extraction branch of the GCKA-Bottleneck unit, and a feature integration and concatenation layer. The main deep feature extraction branch extracts the input features through convolution and feeds them into the GCKA structure. In the GCKA structure, contextual information is extracted through multi-scale depthwise convolution and attention weights are generated. These weights are then multiplied element-wise with the reserved features to achieve recalibration. The feature integration and concatenation layer concatenates the output of the main deep feature extraction branch with the output of the feature splitting shortcut branch. Finally, a 1×1 CBS convolutional layer is used for dimensionality reduction and channel mapping.
[0035] The GCoMRA module includes a channel pre-fusion layer, a coordinate attention layer, a multi-scale receptive field parallel branch, and a spatial weight recalibration layer. The multi-scale receptive field parallel branch feeds the features output by the coordinate attention layer into a parallel structure containing 7×7, 11×11, and 21×21 depthwise convolutions to extract multi-scale semantics. The spatial weight recalibration layer generates spatial weights from the aggregated features of the multi-scale receptive field parallel branch and multiplies them element-wise by channel with the shortcut branch reserved by the coordinate attention layer. Finally, the features are deeply interleaved through a Conv convolutional layer.
[0036] The RDSD lightweight decoupled detection head includes a classification branch and a regression branch. The classification branch replaces the conventional spatial convolution with two consecutive 1×1 ordinary convolutions to eliminate computational redundancy. The regression branch consists of three consecutively stacked 3×3 depthwise separable convolutions and one 1×1 ordinary convolution. At the end of this branch, the DFL distributed bounding box decoding mechanism is connected to accurately predict the boundaries of blurred lesions.
[0037] Analysis of the characteristics of the maize leaf disease dataset revealed the following: First, maize leaf lesions exhibit strong interference from complex farmland backgrounds, weak texture details, and indistinct edge features. In real natural farmland environments, identifying maize leaf diseases faces numerous challenges. Firstly, due to complex field backgrounds and poor lighting conditions such as backlighting, lesions are prone to feature degradation and loss of internal texture details. Secondly, early-stage diseases (such as common rust) are commonly found in farmland, resulting in small lesions with extremely low resolution and very weak pixel features and texture details. Thirdly, lesions often lose their complete geometric outline and semantic features due to natural leaf tilting or severe occlusion by other leaves. Finally, actual diseased areas are often integrated into the background noise of complex soil, weeds, and normal leaf veins and leaf textures with similar colors and shapes, making it extremely difficult to distinguish the boundary between the lesion and the background.
[0038] Therefore, it is necessary to construct a multi-scale feature, spatial location and multi-receptive field attention enhancement mechanism to suppress the interference of soil, light intensity, leaf veins and leaf texture on lesion identification in complex farmland environments, and to improve the ability to extract key features of small-scale, weak texture and irregular lesions.
[0039] Secondly, maize leaf lesions exhibit significant multi-scale differences and degenerative characteristics of blurred and diffused edges after imaging. Analysis of maize leaf disease data collected from actual farmland reveals extremely large scale differences in lesions, ranging from tiny rust spores the size of pinheads to large patches of necrotic spots covering the leaf surface. Simultaneously, lesions with diffused edges due to natural disease spread, and lesions with a smooth color transition from normal leaf tissue, show obvious blurred and degenerate target characteristics after imaging. Due to the loss of tiny pixels caused by early disease, the irregular shape resulting from natural lesion spread, and the decrease in image contrast caused by complex lighting, conventional networks are prone to feature smoothing effects during deep feature extraction, leading to the loss of high-frequency edge information. This blurred edge and small-scale characteristic makes it extremely difficult for the model to accurately locate disease features, and its recall capability is very limited, making it highly susceptible to missed detections.
[0040] Therefore, it is essential to perform effective regional feature enhancement for multi-scale targets and introduce decoupling mechanisms and finer-grained bounding box decoding mechanisms to address edge blurring and degradation characteristics, thereby significantly improving the localization accuracy and recall capability of blurred lesions.
[0041] The MSGCKA module is constructed to adapt to the characteristics of weak texture details in small-scale lesions and strong interference from complex backgrounds. Addressing the problem of weak texture details, indistinct edge features, and strong interference from complex farmland backgrounds in maize leaf disease images, which makes it difficult to extract effective disease features, this invention designs the MSGCKA feature enhancement module. This module enhances the key salient features of lesions and suppresses background noise such as leaf veins and soil by improving the feature splitting mechanism, introducing large-kernel multi-scale receptive field capture and contextual attention recalibration, thereby enhancing the model's ability to deeply represent small-scale, weakly textured, and blurred-edge lesions. Figure 3 As shown, the MSGCKA module includes: a. Feature-based traffic splitting and integration main architecture (corresponding to) Figure 3 (Left side MSGCKA structure): such as Figure 3 The left side shows the macroscopic architecture of the module, designed to extract deeper semantic information while preserving shallow details. Input features are first processed through a 1×1 CBS convolutional layer to adjust the number of channels. Then, a split operation divides the features into two sub-feature branches along the channel dimension. One branch acts as a shortcut connection, directly passing the feature downwards to preserve the original shallow lesion details. The other branch is concatenated through multiple GCK-Bottleneck units for deeper feature extraction and receptive field enhancement. Finally, the outputs of the two branches are concatenated and then processed through a 1×1 CBS convolutional layer for cross-channel feature integration and dimensionality reduction. The ingenuity of this design lies in eliminating excessive internal residual connections found in traditional modules, preventing the dilution of subtle textures or small target features in corn leaves, and forcing the network to rely on deeper convolutional branches to extract purer discriminative lesion details. Simultaneously, the shallow features preserved through splitting and the deep semantics are concatenated at the end, achieving high-quality feature complementarity.
[0042] b. Local feature enhancement and residual connectivity (corresponding to) Figure 3 (Intermediate GCKA-Bottleneck structure): such as Figure 3The middle section shows the GCKA-Bottleneck unit, used to enhance the local edges and basic texture patterns of lesions. The features input to this unit are first compressed to C / 2 through a 1×1 CBS convolutional layer. This operation, through channel-dimensional information compression and non-linear activation, forces the model to retain the most discriminative local texture features and suppresses redundant or noisy channels. Next, a 3×3 CBS convolutional layer restores the number of channels to C. This operation effectively captures the local edges and basic texture patterns of lesions (such as local fragments of spots and stripes), which is particularly beneficial for the initial structural enhancement of lesions with blurred edges. Subsequently, the features are fed into the GCKA core substructure for processing. Finally, a residual connection is drawn from the original input of the unit and element-wise added to the GCKA output. The outermost residual connection is introduced primarily to ensure that fine spatial details in the original input (such as the sharp corners and edge directions of small lesions) are transmitted to the output without attenuation, avoiding information loss due to multiple non-linear transformations. For small-scale lesions, this connection ensures that their minute features are not diluted, and when added to the enhanced features, the salience of the lesion is further enhanced.
[0043] c. Global Context Big Kernel Attention Mechanism (corresponding to) Figure 3 (right-side GCKA structure): such as Figure 3 The right side shows the GCKA substructure, used to extract multi-scale contextual information and perform feature recalibration to address the challenges of large lesion scale differences and extremely weak texture. This structure consists of two branches: the upper branch is a multi-scale spatial modeling branch, where input features are sequentially processed through 5×5DWConv (depth-wise convolution), 7×7DWConv, and 1×1Conv2d. Specifically, 5×5DWConv expands the receptive field with minimal parameter increases, capturing the transition zone of healthy mesophyll tissue surrounding the lesion and enhancing the modeling of pixel-to-pixel dependencies in lesions with blurred edges; 7×7DWConv further expands the receptive field to a larger extent, integrating rich surrounding background information. For small-scale lesions with sparse texture (such as early rust spots) or chlorotic, weak-textured lesions, the large receptive field can highlight the lesion's presence through long-distance contextual contrast cues. The subsequent 1×1Conv2d projects multi-scale spatial information into a compact channel representation, generating adaptive spatial attention weights. The lower-level operation employs a lightweight gating fusion mechanism, performing element-wise product (Element-wise Product) on the original input features of GCKA and the large-kernel attention weight map generated by the upper-level branch, corresponding to the respective channels. Figure 3The area marked with a circle (⊙) is used as an example. This operation is equivalent to using the contextual information extracted by large-kernel convolution as attention weights to adaptively enhance or suppress the original features. The texture features of regions with high response values (i.e., regions highly correlated with the lesion context) are amplified, while irrelevant leaf veins or soil background regions are weakened. This context-guided texture enhancement strategy helps the model effectively separate diseases from the background in complex farmland environments, significantly reducing the risk of missed and false detections.
[0044] To address the issue of complex farmland background interference and multi-scale lesion features, this invention constructs a GCoMRA (GSConv-enhanced Coordinate Multi-Receptive Field Attention) module. This module, by combining spatial coordinate location awareness with multi-scale deep convolutional region responses, guides the network to effectively suppress interference from background textures and irrelevant regions, focusing more intently on key salient regions related to the disease. For example... Figure 4 As shown, the specific structure and processing flow of the GCoMRA module are as follows: a. Lightweight channel fusion and coordinate position awareness (corresponding to) Figure 4 (Front-end GSConv and CoordinateAttention structure): such as Figure 4 As shown in the front end, the input feature map is first processed by GSConv (lightweight channel fusion convolution). Since the lesion area in corn disease images is usually small, using ordinary convolution is computationally too burdensome, while pure depthwise convolution, with its independent channel information, is not conducive to fusing the color and texture features of the lesions. GSConv achieves sufficient mixing between channels in a lightweight manner, avoiding over-parameterization of the model while providing an efficient feature foundation for subsequent modeling. Subsequently, the fused features are fed into CoordinateAttention (coordinate attention, such as...). Figure 5 (As shown in the image) This module independently encodes positional information along the horizontal and vertical directions, outputting coordinate-enhanced features. Considering that corn lesions (such as gray spot) often extend along the leaf veins, exhibiting a strong directional distribution, this coordinate attention mechanism can accurately model the relative positional relationship between the lesion area and the leaf texture, embedding lesion coordinate information into the channel descriptor. This greatly enhances the model's ability to perceive the shape and location of lesions, alleviating confusion caused by the similarity between lesions and background colors.
[0045] b. Parallel extraction of multi-scale local features and global receptive field (corresponding to...) Figure 4(Multi-scale DWConv structure in the middle): To address the extremely wide scale differences in maize leaf diseases (from pinhead-sized rust spores to large patches of necrotic spots covering the leaf surface), this invention designs multi-scale depth convolution branches. The coordinate-enhanced features are first passed through a 5×5 DWConv (depth-wise convolution). This operation expands the receptive field with minimal parameters, enabling precise capture of lesion texture, edges, and local color changes, effectively avoiding the loss of fine structures in early, extremely small-scale lesions. Subsequently, the output feature map from the 5×5 DWConv is fed into three branches: 7×7, 11×11, and 21×21 DWConv, which are connected in parallel to form a single structure. Among them, the 7×7 branch captures the transition relationship between lesions and surrounding healthy tissue, enhancing the boundary localization ability of lesions with blurred edges; the 11×11 branch integrates a larger range of leaf veins and mesophyll background, helping to distinguish lesions of similar color from the leaf base color; the 21×21 branch obtains the global receptive field, models the long-distance dependence of lesions on the overall leaf structure, light and shadow, and other background information, providing contextual contrast cues for lesions with weak texture. The outputs of the three parallel branches are finally added point by point ( Figure 4 The multi-scale aggregated features are obtained by representing them as ⊕. The use of DWConv effectively controls the number of parameters, achieving a perfect balance between lightweight design and a large receptive field.
[0046] c. Spatial weight recalibration and feature integration (corresponding to...) Figure 4 Tail-end feature fusion structure): such as Figure 4 As shown at the end, the multi-scale aggregated features are first mapped to spatial augmentation weights through a 1×1 ordinary convolution (Conv) to further highlight the spatial response of lesion regions. Subsequently, this module introduces a residual shortcut connection derived from the output of the CoordinateAttention module, and performs element-wise product (Element-wise Product) on the shortcut features and the generated spatial augmentation weights. Figure 4 The multiplication operation (denoted as ⨂) enables adaptive recalibration of key lesion regions. It filters coordinate enhancement features through multi-scale spatial response weights, amplifying the lesion signal and significantly suppressing background noise introduced by leaf veins and light variations. Finally, the recalibrated features are channel-integrated through a 1×1 ordinary convolution (Conv) at the tail, projected to a suitable channel dimension, and further mixed with coordinate location information and multi-scale spatial information to output a final high-quality enhanced feature map. This design fundamentally improves the disease detection rate and robustness of the model in complex field environments.
[0047] A lightweight, decoupled detection head for RDSD is constructed to address the difficulties in locating ambiguous lesions and the computational redundancy issues. To address the limited recall capability of existing lightweight detection models for ambiguous lesions and the computational redundancy of original detection heads in maize leaf disease detection, this invention designs an improved RDSD detection head. For example... Figure 6 The image shows the original YOLOv11n detector head structure. This invention addresses the limitations of this basic structure through targeted optimization (e.g., Figure 7 As shown), the specific improvements are broken down into the following two key points: a. Reconstructing the classification branch to eliminate computational redundancy: In the original detection head, the classification branch (upper branch) uses two layers of 3×3DSConv for spatial feature extraction. However, in maize disease detection tasks, the classification task focuses more on the global semantic differences between lesion categories (such as color distribution and overall texture), without requiring complex boundary space modeling. Therefore, the RDSD detection head of this invention simplifies the spatial convolution in the classification branch to two consecutive 1×1Conv layers. This improvement avoids feature competition between the classification and regression branches and allocates more of the limited model parameters to the regression branch, which has a greater impact on localization accuracy. While maintaining high class discrimination capability, it significantly reduces redundant computation in the classification branch.
[0048] b. Introduce multi-layer depthwise separable convolutions to enhance regression boundary localization capabilities: such as... Figure 6 In the original detection head shown, the regression branch (lower branch) mainly uses two layers of ordinary 3×3 Conv for bounding box prediction. Conventional convolution is prone to feature smoothing effects during local weighted summation and stacking, resulting in the loss of high-frequency edge information, making it difficult to accurately capture the blurred and diffused edges of corn lesions and the fine-grained boundaries of small-scale lesions. Therefore, the RDSD detection head of this invention abandons the ordinary convolution with a large number of parameters in the regression branch, and instead stacks three layers of 3×3 DSConv (depth separable convolution) and one layer of 1×1 Conv. Among them, the DWConv (depth convolution) inside DSConv independently extracts the edge and texture details of the lesion for each channel, avoiding the spatial information from being submerged in channel mixing; then, the edge and semantic response are fused across channels through PWConv (pointwise convolution). This multi-layer DSConv stacking refines the local contour information of lesions from shallow to deep, significantly reducing the number of model parameters and computational complexity. Combined with the DFL (Distribution Focal Loss) distributed bounding box decoding mechanism at the end of the branch, it effectively improves the fine-grained localization accuracy and final recall rate of lesions with blurred edges and irregular shapes in complex farmland backgrounds.
[0049] Step 3: Construct an improved YOLO11n target recognition model. The improved YOLO11n target recognition model constructed in this invention is as follows: Figure 8As shown, it includes an improved feature extraction Backbone module, an improved feature fusion Neck module, and a head recognition module. (Similar to...) Figure 9 Compared to the original YOLO11n model shown, the improved YOLO11n target recognition model of this invention uses a newly designed MSGCKA module to replace the original C3K2 module in the backbone and neck modules; adds a GCoMRA attention module after the P4 level in the Neck part; and replaces the detection head in the Head part with a newly designed RDSD lightweight decoupled detection head.
[0050] The detailed steps of data processing in the improved YOLO11n target recognition model constructed in this invention are as follows: The data flow in the improved feature extraction Backbone module is as follows: S11. Input the preprocessed image from step one. Figure 8 The improved feature extraction Backbone module is shown. The input image size is 640×640 pixels, and the number of channels is 3 (i.e., RGB three channels).
[0051] S12. The input image is sequentially processed through two cascaded CBS modules (containing Conv2d convolution, BatchNorm2d batch normalization, and SiLU activation function). The first CBS module adjusts the feature map to 320×320 pixels, and the number of channels becomes 16; the second CBS module further downsamples the feature map to 160×160 pixels, and the number of channels becomes 32.
[0052] S13. The feature map is input into the first MSGCKA module. This module adopts an innovative multi-branch residual enhancement architecture, mainly including feature splitting, local texture reconstruction, and global contextual attention feature recalibration. The input feature map is first fused through a 1×1 CBS convolutional layer and the number of channels is adjusted. Then, a split operation is performed to split the feature into two parallel branches along the channel dimension. One shortcut branch is used to preserve the basic texture details of shallow lesions without loss. The main branch is then fed into multiple GCKA-Bottleneck units. In each unit, the feature is first sequentially compressed through 1×1 CBS and 3×3 CBS convolutional layers for channel compression and refined extraction of local edge features, and then enters the core GCKA structure. In the GCKA structure, the feature is split again, and the attention branch passes through 5×5 DWConv and 7×7 DWConv in sequence. This operation maintains lightweightness while extracting features from multiple scales. This module enhances the local pathological details of small-scale lesions and the global farmland background context. Then, it generates adaptive attention weights containing spatial correlations using 1×1 Conv2d, and multiplies these weights element-wise with the reserved input feature branches within GCKA to achieve adaptive recalibration of weakly textured lesion regions and effectively suppress farmland background noise such as leaf veins. The GCKA-enhanced features are then added channel-wise with the initial input features of GCKA-Bottleneck to complete residual interleaving. Finally, the backbone features, deeply enhanced by multiple GCKA-Bottleneck layers, are concatenated with the shallow shortcut branches reserved in the initial Split layer, and dimensionality reduction and channel mapping are performed using a 1×1 CBS convolutional layer at the end, achieving deep interleaving and full fusion of shallow, weak spatial details and deep, multi-scale semantic features. After this module, the feature map size remains unchanged, but the number of channels increases to 64.
[0053] S14. The data is downsampled by the third CBS module, and the feature map becomes 80×80 pixels with 64 channels. Then it is input into the second MSGCKA module, where the feature map size remains at 80×80 pixels, and the number of channels doubles to 128. The output here extracts the features of small-sized targets, denoted as "Input 1".
[0054] S15. "Input 1" is downsampled by the fourth CBS module, and the feature map becomes 40×40 pixels, while the number of channels remains 128. Then it is input into the third MSGCKA module, with the size and number of channels remaining unchanged (40×40 pixels, 128 channels). The output here extracts the features of a medium-sized target, denoted as "Input 2".
[0055] S16. Input 2 is downsampled by the fifth CBS module, and the feature map becomes 20×20 pixels with the number of channels doubled to 256. Then it is input into the fourth MSGCKA module for deep feature extraction, and the output feature map is still 20×20 pixels with 256 channels.
[0056] S17. Feature map input SPPF module, aggregates multi-scale context and expands receptive field.
[0057] S18, Feature Map Input C2PSA Module. This module contains a cross-stage local network design and multiple PSABlock modules (including an Attention mechanism module and an FNN feedforward network module) cascaded internally to extract deep global context information. The output feature map of this module is 20×20 pixels in size and has 256 channels. The output here extracts features of large-sized targets and is denoted as "Input Three".
[0058] The three inputs extracted from the improved feature extraction Backbone module—"Input 1" (80×80, 128 channels), "Input 2" (40×40, 128 channels), and "Input 3" (20×20, 256 channels)—are jointly input into the improved feature fusion Neck module for multi-scale feature fusion. The data flow within the improved feature fusion Neck module is as follows: S21. "Input 3" passes through the upsampling module, and the feature map is enlarged to 40×40 pixels, while the number of channels remains unchanged at 256.
[0059] S22. Concat the "Input 2" (128 channels) with the upsampled feature map (256 channels) from step S21. The concatenated feature map is 40×40 pixels in size, and the number of channels is added together to become 384 (i.e., the sum of 128 and 256).
[0060] The outputs of S23 and S22 are processed by an MSGCKA module for feature aggregation. The output feature map size remains unchanged, but the number of channels is reduced to 128. This output is denoted as the "neck middle feature".
[0061] S24. The "neck middle feature" is enlarged to 80×80 pixels through the upsampling module, while the number of channels remains unchanged at 128. Then, it is concatenated with "input one" to form a channel concatenation. After concatenation, the number of channels becomes 256, while the number of pixels remains unchanged.
[0062] The outputs of S25 and S24 enter the MSGCKA module, and the aggregated feature map size is 80×80 pixels, with the number of channels reduced to 64. This output is used as the first input to the Head recognition module (corresponding to small target recognition).
[0063] S26. The output of S25 is downsampled by the CBS module, and the feature map becomes 40×40 pixels, while the number of channels remains unchanged (64 channels).
[0064] S27. Perform channel concatenation (Concat) on the feature map (64 channels) downsampled in S26 and the "neck middle feature" (128 channels). The size of the concatenated feature map is 40×40 pixels and the number of channels becomes 192.
[0065] The outputs of S28 and S27 are fed into the MSGCKA module. After aggregation, the feature map size is 40×40 pixels, and the number of channels is reduced to 128. This output is then passed through the GCoMRA attention module (with the number of channels and pixels remaining unchanged) and used as the second input to the recognition Head module (corresponding to medium-sized target recognition).
[0066] S29. The output of S28 is downsampled by the CBS module (step size 2), and the feature map becomes 20×20 pixels, while the number of channels remains unchanged (128 channels).
[0067] S210. The output of S29 is concatenated with the deep "Input Three" (20×20, 256 channels), resulting in 384 channels. After aggregation by the MSGCKA module, the number of channels is reduced to 256. This output is then used as the third input to the Head recognition module (corresponding to large target recognition).
[0068] The data flow in the Head module is identified as follows: The improved feature fusion Neck module outputs three multi-scale feature maps, which are then input into a lightweight, decoupled RDSD detection head. The small target recognition branch of the RDSD detection head receives the first input 80×80 pixel, 64-channel feature map; the medium target recognition branch receives the second input 40×40 pixel, 128-channel feature map; and the large target recognition branch receives the third input 20×20 pixel, 256-channel feature map.
[0069] Finally, the Head module calculates and outputs the bounding box coordinates (center point x and y coordinates, width, and height), confidence score, and target category of the target in parallel on the feature maps of these three different resolutions, thus completing the entire target recognition task.
[0070] Step 4: Using the training and validation sets obtained from the data preprocessing in Step 1, train and validate the improved YOLO11n target recognition model to obtain the final improved YOLO11n target recognition model for identifying corn leaf diseases. This embodiment also uses a test set to evaluate the performance of the final improved YOLO11n target recognition model.
[0071] During training, a transfer learning strategy was employed, using the SGD optimizer to jointly train all weight parameters of the improved feature extraction Backbone module, improved feature fusion Neck module, and recognition Head module of the improved YOLO11n target recognition model throughout the entire training process. The training epochs were set to 200, the batch size to 16, and the iteration count to 36600. The initial learning rate was set to 1e-2, and the loss function was CIoU. Mosaic data augmentation was enabled during training, and validation was performed on a validation set after each training epoch. Training stopped when the number of training epochs reached the set value (200 epochs) or the loss function converged, and all weight parameters corresponding to the optimal validation set result were saved.
[0072] To better reflect the performance of the improved YOLO11n target recognition model of this invention, the average precision (mAP), frames per second (FPS), precision (P), and recall (R) are selected to evaluate the model's performance during the performance evaluation process.
[0073] The following tests the five models using a test set: (1) Original YOLO11n model.
[0074] (2) Model (1) combined with MSGCKA module.
[0075] (3) Model (1) combines the GCoMRA attention module.
[0076] (4) Model (1) combined with RDSD detection head.
[0077] (5) The present invention improves the YOLO11n target recognition model.
[0078] The test results are shown in Table 1.
[0079] Table 1 Test Results
[0080] The main challenges in detecting leaf diseases in maize lie in strong background interference, large differences in lesion scale, and blurred boundaries. On the one hand, small-scale lesions occupy a small proportion of the image and are easily obscured by leaf vein patterns, light variations, and complex backgrounds. On the other hand, large-area lesions have irregular shapes and are easily confused with leaf shadows and withered areas. Therefore, the model not only needs to have the ability to sensitively capture small lesions but also needs to maintain a stable representation of large-scale diseased areas.
[0081] As shown in Table 1, compared with the original network, the introduction of the MSGCKA module improved the P-value and mAP@0.5 by 3.78% and 1.46%, respectively, while reducing GFLOPs from 6.3 to 6.1 and the number of parameters from 2.58M to 2.54M. This result demonstrates that the MSGCKA module can enhance the feature extraction and fusion capabilities of the network without introducing additional computational overhead, thereby making the model more discriminative of maize leaf lesion areas and significantly reducing the interference of farmland background noise. It is worth noting that when this improved module is introduced alone, the Recall drops slightly to 79.33%, indicating that its ability to screen high-confidence features is enhanced, but its coverage of small-scale, vaguely defined lesions is somewhat insufficient.
[0082] When the GCoMRA attention module was introduced alone, the model achieved the highest P-value (89.53%, a 5.00 percentage point improvement over the baseline model). This module achieves lightweight feature pre-fusion through GSconv and embeds spatial coordinate information into the channel representation using the CoordinateAttention mechanism, accurately capturing the directional features of leaf lesions. Simultaneously, the introduction of multi-scale deep convolution effectively expands the receptive field, enabling the network to consider the spatial relationships between a large area of leaf lesions and local textures. However, when this module was introduced alone, Recall decreased to 78.17%, indicating that while this attention mechanism strengthens the response to significant lesions, it inevitably suppresses some edge pixels, resulting in some hard-to-detect samples not being adequately recalled.
[0083] When using only RDSDHead, the model achieved a more balanced improvement across all metrics (Precision 86.52%, Recall 82.46%, mAP @ 0.583.89), and a significant decrease in computational cost (GFLOPs reduced to 5.2, parameter count reduced to 2.28M). For maize leaf disease detection, the detection head directly affects the quality of bounding box regression and classification confidence prediction. The improved detection head can more effectively handle the localization and classification of lesions at different scales, especially showing better adaptability to irregular and extremely small-scale lesions.
[0084] The model achieved optimal performance when MSGCKA, GCoMRA, and the improved detector head were integrated simultaneously. The final model's mAP@0.5 jumped to 85.36% (+3.46%), while Recall and F1Score reached 83.32% (+2.94%) and 85.08% (+2.66%), respectively. Furthermore, the improved model's GFLOPs decreased from 6.3 to 4.6, and the number of parameters decreased from 2.58M to 2.26M, representing reductions of approximately 27.0% and 12.4%, respectively. This indicates that the improved model does not rely on simply stacking parameters to gain accuracy, but rather improves feature representation efficiency and detector head prediction capabilities based on a lightweight structural design.
[0085] To more intuitively illustrate the contribution of each improvement, several typical images were selected for comparison. The comparison results are as follows: Figure 11 As shown.
[0086] In the detection of Blight lesions in scenario a, the basic YOLOv11n model performed poorly under complex field conditions characterized by weak lesion texture details, a dark background, and curled, overlapping leaves: the first set of examples showed significant false positives due to background texture and lighting, while the second set of examples showed significant false negatives due to leaf curling and occlusion. Introducing the MSGCKA module enabled the model to capture small-scale texture details more accurately, eliminating the false positives in the first set of examples. Introducing the GCoMRA attention mechanism enhanced the model's spatial perception and multi-scale response capabilities, more effectively suppressing interference from background texture and overlapping leaves, thus eliminating false positives in the second set of examples. Furthermore, the introduction of the RDSD detection head further decoupled the model's classification and regression tasks, improving lesion localization accuracy and confidence, resulting in more precise bounding box positions and more stable recognition results in both sets of examples. When all three worked synergistically, the model performed optimally, with no false positives in the first set of examples and accurate detection of all lesions in the second set, with precise bounding boxes and higher confidence.
[0087] In scenario b, CommonRust lesions are dot-like, densely distributed, and small in size. The basic YOLOv11n model has limited perception in this situation, struggling to separate small-scale lesions from the complex leaf texture, resulting in missed detections. The introduction of the MSGCKA module enhances the model's feature extraction ability for dense, small targets, enabling effective disease detection. GCoMRA, through lightweight feature enhancement, improves the model's spatial perception along the leaf direction, better distinguishing lesions from normal leaf veins and suppressing background interference. The RDSD detection head further refines the model's bounding box regression, resulting in more stable localization and classification of dense lesions. After integrating all these improvements, the model can identify lesions more completely and accurately, achieving optimal overall detection performance.
[0088] For scenario c, GrayLeafSpot pathological features are elongated, and the basic YOLOv11n, limited by its receptive field and insufficient feature extraction capabilities, resulted in missed detections of this type of disease. The introduction of the MSGCKA module enhanced the model's feature continuity and improved the problem of insufficient feature extraction. The introduction of the GCoMRA module enhanced the model's spatial perception along the leaf direction, enabling better differentiation between lesions and normal leaf veins and suppressing interference from irrelevant factors such as the background. The RDSD detection head improved the regression accuracy of blurred boundaries, making the detection box fit the true contour of the lesion more closely. With the synergy of these three components, the model maintains high accuracy and robustness even in the blurry, elongated, and vein-dependent gray spot disease detection scenario, achieving optimal results.
[0089] This demonstrates that the integration of the improved modules significantly enhances the detection performance of the YOLOv11n model in complex agricultural scenarios, further improving its ability to handle issues such as small-scale lesions, weak texture details, light interference, and leaf occlusion. Ultimately, the improved model exhibits more accurate and stable disease detection performance, better meeting the needs of actual field monitoring.
[0090] In addition, to clearly demonstrate the advantages of the improved YOLO11n target recognition model, comparative experiments were conducted using classic models such as the original YOLO13n, YOLO12n, YOLO11n, YOLOv10n, YOLOv8n, YOLOv6n, YOLOv5n, and RT-DETR. The experiment also incorporated two-stage detection models such as Faster R-CNN, as well as typical maize leaf disease detection methods proposed by other researchers. Improved YOLOv11n is cited in Zhou, P.; Wang, Q.; Zhan, M.; Zhu, B.; Yi, K.; Jiang, C.; Wang, J. YOLOv11n-DualPC-Lite: A lightweight, high-precision real-time detection model for aspirating leaf diseases. Front. Plant Sci. 2026, 17, 1797083. Improved YOLOv8n is cited in Xu, M.; Zhang, X.; Ma, N. ;Li,Y. Detection Method of Corn Leaf Diseases Based on CA-YOLOv8. IN MATE H Agric. Eng. 2024, 73, 129–138. Among them, Improved YOLOv8s are from Wang,P.;Tan,J.;Yang,Y.;Zhang,T.;Wu,P.;Tang,X.;Li,H.;He,X.;Chen,X. Efficient and accurate identification of maizerust disease using deep learning model. Front. Plant Sci. 2025,15,1490026. The experimental results are shown in Table 2.
[0091] Table 2 Experimental Results
[0092] Analysis of various mainstream detection algorithms in Table 2 shows that YOLOv11n, as the baseline model, exhibits significant comprehensive advantages and high adaptability to maize leaf disease detection tasks. In terms of detection accuracy, YOLOv11n's mAP@0.5 is 81.90%, superior to YOLOv5n, YOLOv6n, YOLOv8n, YOLOv12n, and YOLOv13n. Furthermore, its precision and recall rates reach 84.53% and 80.38%, respectively, also outperforming other traditional models, demonstrating its stronger feature capture ability for the morphologically variable maize leaf diseases. Compared to the two-stage detection model Faster R-CNN, YOLOv11n improves precision, recall, and mAP@0.5 by 5.62, 33.19, and 2.99 percentage points, respectively, with a particularly significant improvement in recall, indicating that YOLOv11n has a stronger ability to suppress missed detections of lesions. Then, from the perspective of model lightweighting, YOLOv11n has only 2.58M parameters and a computational cost of 6.3 GFLOPs. While maintaining similar low resource consumption as YOLOv12n and YOLOv5n, it has significant advantages in all other indicators. In contrast, although RT-DETR based on the Transformer architecture has certain technological advantages, its 32.00M parameters are about 12.4 times that of YOLOv11n, and its mAP index is also relatively low, making it difficult to meet the real-time requirements of embedded inspection equipment in smart agriculture. Therefore, considering factors such as accuracy, computational efficiency, and model parameter size, YOLOv11n was selected as the baseline model for maize leaf disease detection for further improvement.
[0093] Further comparison with current mainstream improved detection algorithms reveals that Ours achieves a better trade-off between detection accuracy and computational cost. Specifically, compared to ImprovedYOLOv11n, Ours improves precision, recall, F1-score, and mAP@0.5 by 3.12, 1.46, 2.93, and 2.49 percentage points, respectively, while maintaining the same computational complexity, validating Ours' superior feature extraction efficiency. Furthermore, compared to ImprovedYOLOv8n, although our model has slightly lower precision, it achieves increases in recall, F1-score, and mAP@0.5 of 2.39%, 1.18%, and 1.10%, respectively, while having lower parameter count and computational load. Moreover, compared to the larger ImprovedYOLOv8s, Ours improves across all accuracy metrics, and reduces GFLOPs and Params to 4.6 and 2.26M, respectively. In summary, Ours demonstrates higher overall detection performance while maintaining lower computational costs, making it more suitable for lightweight, real-time detection tasks of corn leaf diseases.
[0094] This invention addresses the problems of blurred lesion edge features caused by factors such as strong interference from complex farmland backgrounds, drastic changes in light conditions, and mutual shading by leaves, as well as high false negative rates and low localization accuracy caused by factors such as significant differences in lesion scale, extremely weak texture details in early micro-lesions, and irregular natural diffusion patterns of lesions. It proposes an effective lightweight improvement scheme. Extensive experimental results show that the method of this invention significantly improves the recall rate and real-time performance of blurred lesions while maintaining high accuracy and significantly reducing the number of model parameters. It also demonstrates excellent anti-interference ability and robustness in complex and dynamic field scenarios. This invention not only plays a positive role in promoting smart agriculture crop phenotypic analysis and precision pest and disease control technologies, but also provides practical technical support for agricultural applications such as intelligent agricultural machinery field inspection, UAV aerial plant protection, agricultural IoT disease dynamic monitoring systems, and portable disease rapid diagnosis terminals.
[0095] Therefore, this invention employs the aforementioned corn leaf disease detection method based on a lightweight target detection network. While maintaining high accuracy, it preserves real-time disease identification through a lightweight convolutional structure and optimized network design. Especially in resource-constrained portable agricultural inspection equipment and edge computing environments, the model of this invention can respond quickly and adapt to applications with high real-time requirements, such as intelligent agricultural disease dynamic monitoring systems and UAV field inspection scenarios. Specifically designed and structurally optimized for corn leaf disease identification scenarios, the model's parameter count and computational complexity are strictly controlled (reducing GFLOPs and parameter count by 27.0% and 12.4% respectively compared to the original model), exhibiting lightweight and high efficiency characteristics, facilitating deployment and implementation on diverse agricultural hardware platforms. Whether on high-performance computing servers in the agricultural cloud or low-power devices such as agricultural machinery embedded systems and portable detectors, this invention can achieve stable and reliable operation. It also supports flexible expansion and adaptation based on field inspection scenarios and task scale, effectively meeting the needs of corn major leaf disease identification in environments with varying lighting conditions, complex interference, variable target sizes, and real-time requirements.
[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for detecting leaf diseases in maize based on a lightweight target detection network, characterized in that, Includes the following steps: Step 1: Collect images of corn leaf diseases, adjust the image size, label the types of corn leaf diseases, construct a corn leaf disease dataset and divide it into training and validation sets, and preprocess the training set. Step 2: Construct the MSGCKA module, GCoMRA attention module, and RDSD lightweight decoupled detection head. The MSGCKA feature enhancement module improves the model's ability to represent small-scale, weakly textured, and blurred-edge lesions by improving the feature splitting mechanism, introducing large-kernel multi-scale receptive field capture, and contextual attention recalibration. The GCoMRA attention module guides the network to effectively suppress interference from background textures and irrelevant regions by jointly combining spatial coordinate position awareness and multi-scale deep convolutional region response. Step 3: Construct an improved YOLO11n target recognition model, including an improved feature extraction Backbone module, an improved feature fusion Neck module, and an improved Head module; Step 4: Using the preprocessed training and validation sets from Step 1, train and validate the improved YOLO11n target recognition model to obtain the final improved YOLO11n target recognition model for identifying corn leaf diseases.
2. The method for detecting maize leaf diseases based on a lightweight target detection network according to claim 1, characterized in that: The preprocessing in step one includes Mosaic data augmentation, random scaling, horizontal flipping, and color dithering. Mosaic data augmentation divides multiple images into random proportions and stitches them together to form a new image. The generated image is then subjected to random scaling within a range of ±50% with a gain factor of 0.5, random horizontal flipping with a 50% probability, and random adjustment of the image's hue, saturation, and brightness within the HSV color space.
3. The method for detecting maize leaf diseases based on a lightweight target detection network according to claim 2, characterized in that: In step two, the MSGCKA module includes a feature splitting shortcut branch, a main deep feature extraction branch of the GCKA-Bottleneck unit, and a feature integration and concatenation layer. The main deep feature extraction branch of the GCKA-Bottleneck unit extracts the input features through convolution and feeds them into the GCKA structure. In the GCKA structure, contextual information is extracted through multi-scale depthwise convolution and attention weights are generated. These weights are then multiplied element-wise with the reserved features to achieve recalibration. The feature integration and concatenation layer concatenates the output of the main deep feature extraction branch with the output of the feature splitting shortcut branch. Finally, a 1×1 CBS convolutional layer is used for dimensionality reduction and channel mapping.
4. The method for detecting maize leaf diseases based on a lightweight target detection network according to claim 3, characterized in that: In step two, the GCoMRA module includes a channel pre-fusion layer, a coordinate attention layer, a multi-scale receptive field parallel branch, and a spatial weight recalibration layer. The multi-scale receptive field parallel branch feeds the features output by the coordinate attention layer into a parallel structure containing 7×7, 11×11, and 21×21 depthwise convolutions to extract multi-scale semantics. The spatial weight recalibration layer generates spatial weights from the aggregated features of the multi-scale receptive field parallel branch and multiplies them element-wise by channel with the shortcut branch reserved by the coordinate attention layer. Finally, the features are deeply interleaved through the Conv convolutional layer.
5. The method for detecting maize leaf diseases based on a lightweight target detection network according to claim 4, characterized in that: In step two, the RDSD lightweight decoupled detection head includes a classification branch and a regression branch. The classification branch replaces the conventional spatial convolution with two consecutive 1×1 ordinary convolutions to eliminate computational redundancy. The regression branch consists of three consecutively stacked 3×3 depthwise separable convolutions and one 1×1 ordinary convolution. At the end of this branch, the DFL distributed bounding box decoding mechanism is connected to accurately predict the boundaries of blurred lesions.
6. The method for detecting maize leaf diseases based on a lightweight target detection network according to claim 5, characterized in that: The data flow in the improved feature extraction Backbone module in step three is as follows: S11. Input the preprocessed input image from step one into the improved feature extraction Backbone module; S12. The input image passes through two cascaded CBS modules in sequence. The CBS module contains Conv2d convolution, BatchNorm2d batch normalization, and SiLU activation function. S13. Input the feature map into the first MSGCKA module to achieve deep interweaving and full fusion of shallow weak spatial details and deep multi-scale semantic features; S14. The data is downsampled by the third CBS module and then input into the second MSGCKA module. The output here is the feature of the small target, which is called input one. S15. Input 1 is downsampled by the fourth CBS module and then input to the third MSGCKA module. The output here is the feature of a medium-sized target, which is called Input 2. S16. Input 2 is downsampled by the fifth CBS module and then input into the fourth MSGCKA module for deep feature extraction; S17. Feature map input SPPF module, aggregates multi-scale context and expands receptive field; S18. The feature map is input to the C2PSA module to extract deep global context information. The output here is the feature of a large target, denoted as input three.
7. The method for detecting maize leaf diseases based on a lightweight target detection network according to claim 6, characterized in that: In step three, inputs one, two, and three are jointly input into the improved feature fusion Neck module for multi-scale feature fusion. The data flow steps in the improved feature fusion Neck module are as follows: S21, Input three-input upsampling module Upsample; S22. Perform channel concatenation between input 2 and the feature map upsampled in step S21; The outputs of S23 and S22 are processed by an MSGCKA module for feature aggregation to obtain the neck mid-section features. S24. The neck mid-section features are upsampled by the Upsample module and concatenated with the input channel to obtain the output of S24. The outputs of S25 and S24 enter the MSGCKA module to obtain the output of S25, which serves as the first input to the Head recognition module, corresponding to small target recognition. S26. The output of S25 is downsampled by the CBS module; S27. Perform channel stitching on the feature map and the middle neck feature after downsampling in S26; The outputs of S28 and S27 are fed into the MSGCKA module to obtain the output, which is called the output of S28. This output is then passed through the GCoMRA attention module and used as the second input of the Head recognition module, corresponding to medium target recognition. S29. The output of S28 is downsampled by the CBS module to obtain the output of S29. S210. The output of S29 is concatenated with the third deep input, and the output is used as the third input of the Head module for large target recognition.
8. The method for detecting maize leaf diseases based on a lightweight target detection network according to claim 7, characterized in that: In step three, the Head module calculates and outputs the bounding box information of the target in parallel on the three-way multi-scale feature map output by the improved feature fusion Neck module, including the horizontal and vertical coordinates of the center point, width, height, confidence score and target category.
9. The method for detecting maize leaf diseases based on a lightweight target detection network according to claim 8, characterized in that: In step four, a transfer learning strategy is adopted during training. The SGD optimizer is selected, and all weight parameters of the improved feature extraction Backbone module, the improved feature fusion Neck module, and the recognition Head module of the improved YOLO11n target recognition model are jointly trained throughout the entire process. The average precision (mAP), frames per second (FPS), precision, and recall are selected to evaluate the performance of the model.