Maize disease and insect pest detection method based on MTA-YOLOv11

By improving the backbone network, neck network and detection head of the YOLOv11 model, the accuracy and robustness of corn disease and pest detection are enhanced, solving the problems of high model complexity and insufficient small target recognition in existing technologies, and achieving high-precision detection in complex backgrounds.

CN120766136APending Publication Date: 2025-10-10YANSHAN UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510871247.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

Existing computer vision methods have high model complexity in corn disease and pest detection, insufficient ability to recognize small targets and fuzzy edges, and difficulty in achieving high-precision detection in complex backgrounds.

Method used

A detection method based on MTA-YOLOv11 is adopted. By embedding the MERDEM module in the backbone network, replacing the neck network with the TK-FocusBlock module, and inserting the MLKDA module before the detection head, the boundary feature expression of small targets is enhanced, background noise is suppressed, and the receptive field is expanded to achieve cross-scale context modeling.

Benefits of technology

It improves the accuracy and robustness of corn disease and pest detection, can accurately identify small targets and occluded scenes in complex backgrounds, and has good practical value and promotion potential.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120766136A_ABST
    Figure CN120766136A_ABST
Patent Text Reader

Abstract

The invention provides a corn disease and insect pest detection method based on MTA-YOLOv11. The problem that an existing detection method is insufficient in small target recognition and edge feature perception in a complex environment is solved. According to the method, on the basis of YOLOv11n, an MERDEM module, a TK-Focus Block module and an MLKD module are introduced and used for enhancing a detail edge, focusing a key area and fusing multi-scale global semantics respectively, and therefore the model can more accurately detect pest and disease damage targets under the complex background; the method comprises the following steps: constructing a Corn-d corn disease and insect pest image data set, dividing the Corn-d corn disease and insect pest image data set into a training set and a verification set in proportion, evaluating a training process of an MTA-YOLOv11 model through the verification set and storing an optimal model weight, and reasoning a corn field image to be detected according to an optimal model corresponding to the optimal model weight, and outputting a detection result containing the disease and pest category, the positioning frame and the visual label. The corn disease and pest detection precision is improved, and the method is light in weight and high in adaptability to complex scenes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of intelligent agricultural image recognition, specifically a corn disease and pest detection method based on MTA-YOLOv11. BACKGROUND

[0002] Corn is one of the world's major food crops, and its disease and pest control is of great significance to food production. During the growth of corn, common diseases and pests such as corn borer and gray spot disease can cause significant yield loss.

[0003] Traditional disease and pest detection methods mainly rely on manual inspection, which is not only costly and inefficient, but also susceptible to environmental and human factors. Some existing computer vision methods attempt to detect diseases and pests, such as deep learning-based target detection frameworks such as FasterR-CNN, SSD, YOLO series, which can achieve automatic detection to some extent.

[0004] However, these methods often have high model complexity, insufficient recognition ability for small targets and blurred edges, and sensitivity to background noise, making it difficult to achieve ideal detection results in actual field complex environments. Therefore, a lightweight, high-precision, and robust corn disease and pest detection model is needed to meet the needs of real-time detection in agricultural fields. SUMMARY

[0005] In view of this, the present application provides a corn disease and pest detection method based on MTA-YOLOv11, aiming to improve the detection accuracy and robustness of corn diseases and pests in complex background environments, while maintaining model lightweight and efficiency.

[0006] According to a first aspect of an embodiment of the present application, a corn disease and pest detection method based on MTA-YOLOv11 is provided, comprising: step S101: constructing a YOLOv11-based MTA-YOLOv11 model, the MTA-YOLOv11 model comprising a backbone network, a neck network and a detection head; step S102: embedding a MERDEM module in a two-stage C3k2 unit of the backbone network, and using a multi-branch pooling and edge compensation mechanism to strengthen the expression of fuzzy contour and small target boundary features; step S103: replacing an original Bottleneck module in the neck network with a TK-FocusBlock module, and sparsifying the attention matrix through a learnable TKSA selection operator and a spatial attention mechanism to improve the response ability of the MTA-YOLOv11 model to key disease and pest areas and suppress background noise; step S104: inserting an MLKDA module in front of the detection head, expanding the receptive field through a multi-scale large kernel depth separable convolution and a dynamic weighted fusion strategy, realizing cross-scale context modeling and channel selection to generate context-enhanced features; step S105: constructing a Corn-d corn disease and pest image dataset, dividing the corn disease and pest images in the dataset that are finely labeled into a training set and a validation set in proportion, evaluating the training process of the MTA-YOLOv11 model through the validation set and saving the optimal model weight, and inferring the image to be measured of a corn field according to the best model corresponding to the optimal model weight to output a detection result containing a disease and pest category, a positioning box and visualized labeling.

[0007] According to a second aspect of an embodiment of the present application, a target detection method is provided, which detects a to-be-detected image by using the corn disease and pest detection method based on MTA-YOLOv11 according to the first aspect described above, the to-be-detected image being an image in the field of corn disease and pest detection.

[0008] According to a third aspect of the embodiment of the present application, an MTA-YOLOv11 model file stored in a computer readable medium and loadable and executable by a processor is provided, the model file being used for reasoning on a to-be-tested corn field image and outputting a detection result containing a pest and disease class, a positioning box and a visual label, the MTA-YOLOv11 model comprising a backbone network, a neck network and a detection head; wherein two-level C3k2 units of the backbone network are configured to embed a MERDEM module, and a multi-branch pooling and edge compensation mechanism is used to strengthen the expression of fuzzy contour and small target boundary features; the original Bottleneck module in the neck network is replaced with a TK-FocusBlock module, and a learnable TKSA selection operator and a spatial attention mechanism are used to sparsify the attention matrix, so as to improve the response capability of the MTA-YOLOv11 model to key pest and disease areas and suppress background noise; the detection head is configured to insert an MLKDA module, a multi-scale large kernel depth separable convolution and a dynamic weighted fusion strategy are used to expand the receptive field, and cross-scale context modeling and channel selection are realized to generate context-enhanced features.

[0009] According to a fourth aspect of the embodiment of the present application, an electronic device is provided, comprising a processor and a memory storing a program. Wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the steps of the corn pest and disease detection method based on MTA-YOLOv11 as described in the first aspect above, or the steps of the target detection method as described in the second aspect above.

[0010] According to a fifth aspect of the embodiment of the present application, a computer storage medium is provided, having a computer program stored thereon, the program being executed by a processor to implement the corn pest and disease detection method based on MTA-YOLOv11 as described in the first aspect above, or the target detection method as described in the second aspect above.

[0011] In summary, the present application integrates a multi-scale edge detail enhancement module (MERDEM), a TK focus enhancement module (TK-FocusBlock) and a multi-scale large kernel decomposition attention module (MLKDA) on the basis of YOLOv11n. These modules are respectively used to strengthen image edge and detail features, focus on key areas and fuse multi-scale global semantics, so that the model can more accurately detect pest and disease targets in complex background scenes. The present application has obvious precision improvement and robustness enhancement effect in the task of corn pest and disease detection, and has the advantages of high detection precision, strong adaptability to complex scenes and lightweight method. BRIEF DESCRIPTION OF DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art based on these drawings.

[0013] Figure 1 is the step flow chart of the corn disease and pest detection method based on MTA-YOLOv11 of the present application;

[0014] Figure 2 is the overall structure schematic diagram of the corn disease and pest detection method based on MTA-YOLOv11 of the present application;

[0015] Figure 3 is the comparison schematic diagram of the C3k2 module of the original YOLOv11n and the C3k2_MERDEM module structure of the present application;

[0016] Figure 4 is the network structure schematic diagram of the MERDEM module in the present application;

[0017] Figure 5 is the structure schematic diagram of the TK-FocusBlock module in the present application;

[0018] Figure 6 is the network structure schematic diagram of the MLKDA module in the present application;

[0019] Figure 7 is the sample image of the Corn-d corn disease and pest image dataset constructed in the present application;

[0020] Figure 8 is the comparison schematic diagram of the model detection result;

[0021] Figure 9 is the visualization schematic diagram of the model attention area heat map. DETAILED DESCRIPTION

[0022] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.

[0023] It will be understood by those within the art that, in this specification and in the claims that follow, relative terms are used to describe features that can be understood relative to the particular claim feature under discussion. These relative terms are intended to encompass different positional, structural, and / or functional attributes of the features in addition to the attributes specifically recited in the claims. The specific recitation of these terms will not limit the scope or meaning of the claims or the patent. It will be further understood that the use of relational terms such as first, second, top, bottom, upper, lower, left, right, front, rear, rearward, forward, rearwardly, forwardly, down, up, etc., are used for clarity in only the specific context to which they are applied, and are not construed as limiting the scope of the claims or the patent.

[0024] It will be understood by those within the art that, in this specification and in the claims that follow, relative terms are used to describe features that can be understood relative to the particular claim feature under discussion. These relative terms are intended to encompass different positional, structural, and / or functional attributes of the features in addition to the attributes specifically recited in the claims. The specific recitation of these terms will not limit the scope or meaning of the claims or the patent. It will be further understood that the use of relational terms such as first, second, top, bottom, upper, lower, left, right, front, rear, rearward, forward, rearwardly, forwardly, down, up, etc., are used for clarity in only the specific context to which they are applied, and are not construed as limiting the scope of the claims or the patent.

[0025] Reference is made to Figure 1 The main steps of the corn disease and pest detection method based on the MTA-YOLOv11 of the present application include:

[0026] Step S101: constructing a MTA-YOLOv11 model based on YOLOv11, wherein the MTA-YOLOv11 model comprises a backbone network, a neck network and a detection head;

[0027] It should be understood that the MTA-YOLOv11 model based on YOLOv11 of the present application has the characteristic of enhanced feature fusion.

[0028] Step S102: embedding a MERDEM module in the two-stage C3k2 unit of the backbone network, and using a multi-branch pooling and edge compensation mechanism to strengthen the expression of fuzzy contour and small target boundary features;

[0029] Step S103: replacing the original Bottleneck module in the neck network with a TK-FocusBlock module, and sparsifying the attention matrix through a learnable TKSA selection operator and a spatial attention mechanism to improve the response ability of the MTA-YOLOv11 model to key disease and pest areas and suppress background noise;

[0030] Step S104: inserting an MLKDA module in front of the detection head, expanding the receptive field through a multi-scale large kernel depth separable convolution and a dynamic weighted fusion strategy, realizing cross-scale context modeling and channel selection, and generating context-enhanced features;

[0031] Step S105: Construct a Corn-d corn disease and pest image dataset, divide the fine-labeled corn disease and pest images in the dataset into a training set and a validation set in proportion, evaluate the training process of the MTA-YOLOv11 model through the validation set and save the optimal model weight, and perform inference on a to-be-tested corn field image according to the best model corresponding to the optimal model weight, and output a detection result containing a disease and pest category, a positioning box and visualized labeling.

[0032] It should be understood that the MERDEM module is a multi-scale edge detail enhancement module: the present application introduces a MERDEM module in the backbone network of the YOLOv11n model to strengthen the edge and local texture features of the image in the high-level feature extraction stage. The MERDEM module compensates for the loss of spatial information in the traditional upsampling process through auxiliary edge paths, multi-scale pooling and edge enhancers, and effectively enhances the boundary perception of small targets and blurred targets.

[0033] It should also be understood that the TK-FocusBlock module is a TK focus enhancement module: the present application embeds a TK-FocusBlock module in the neck feature fusion stage of the model, focuses on the key information area in the image by fusing a TKSA selection operator and a spatial attention mechanism. The module first uses a depth separable convolution to construct local context information, and then performs sparse attention operation on the feature tensor to filter out the most significant area to suppress background interference; at the same time, the spatial attention branch further depicts the target boundary structure, effectively enhancing the feature expression of the target area.

[0034] It should also be understood that the MLKDA module is a multi-scale large kernel decomposition attention module: the present application inserts an MLKDA module before the detection head of the model to expand the receptive field and fuse global semantic information. The MLKDA module divides the feature map into multiple sub-channels in the channel, and in each sub-channel, a multi-scale convolution processing is performed using depth separable large convolution kernels of different sizes (3x3, 5x5, 7x7, 9x9), and meanwhile, the features of each scale are weighted and fused through learnable attention weights, and are combined and output through residual connection with the original features. This design can improve the detection capability of the model of the present application for multi-scale targets while ensuring computational efficiency; and enhance the modeling effect of fine-grained semantics in complex scenes.

[0035] In summary, the corn disease and pest detection method based on MTA-YOLOv11 of the present application has higher detection accuracy and clearer target boundaries than the original YOLOv11n model, and the performance in dense small targets and occlusion scenes is significantly improved, which has good practical value and promotion potential.

[0036] Optionally, the MERDEM module comprises an auxiliary edge path, a multi-scale edge information extraction unit, an edge enhancer and a feature fusion unit; wherein the auxiliary edge path performs channel compression on the input features through 1x1 convolution to highlight edge information; the multi-scale edge information extraction unit extracts edge features under different receptive fields by using multi-level average pooling and lightweight convolution operation; the edge enhancer enhances the local contrast of the edge region in the feature map through the mean residual mechanism and the Sigmoid activation function; and the feature fusion unit splices the edge features of each scale and the main branch features in the backbone network along the channel dimension, and outputs a detail enhancement feature map through 1x1 convolution fusion:

[0037]

[0038] wherein F main is the main branch feature, F edge is the input feature of the auxiliary edge path, Pool s (·) represents the s-th level average pooling, E s (·) represents the edge enhancer, and [||] is the channel splicing operation, is the cross-scale feature summation.

[0039] Optionally, the TK-FocusBlock module adopts a parameter sharing mechanism to optimize the attention path, so as to control the calculation complexity and improve the inference efficiency, and specifically comprises a depth separable convolution layer, a learnable TKSA selection operator and a spatial attention module; wherein the depth separable convolution layer is used to perform dimension reduction coding on the input features to construct a local context representation; the learnable TKSA selection operator adaptively selects K most relevant key-value pairs for each query vector to realize attention sparsification and suppress irrelevant region interference:

[0040]

[0041] F TK = A TK V

[0042] wherein Q, K and V are query, key and value matrices respectively, d is the feature dimension, TopK(·) retains the first K largest attention coefficients in each query row and sets the remaining positions to zero, F TK is the sparse attention aggregation output, which is then added in residual to the spatial attention branch output to obtain the final output of the TK-FocusBlock; and the spatial attention module is used to enhance the description ability of the target boundary structure by capturing the spatial correlation of the feature map.

[0043] Optionally, the MLKDA module comprises a plurality of depth separable convolution branches and an attention weighted fusion unit; wherein the input features are divided into a plurality of sub-channels along the channel dimension, for each sub-channel, a depth separable convolution branch with different convolution kernel size is used to extract multi-scale context features and output corresponding branch features; the MLKDA module introduces a dynamic attention mechanism, and the attention weighted fusion unit is used to weight the branch features of each scale to generate multi-scale fused context enhanced features a final , the calculation expression is:

[0044] a final = concat(LKA3(a1)·k3(a1), LKA5(a2)·k5(a2), LKA7(a3)·k7(a3), LKA9(a4)·k9(a4))

[0045] wherein a1, a2, a3, a4 are four parts of the input features divided along the channel dimension, LKA3, LKA5, LKA7, LKA9 represent attention convolution operations with different convolution kernel sizes, k3, k5, k7, k9 are attention weight functions corresponding to each branch, the symbol (·) represents element-wise weighted product; after the fusion features are completed, the MLKDA module fuses the context enhanced features a final with the original input feature map x through a residual connection mode, and introduces a learnable scale coefficient scale to adjust the feature intensity, and finally outputs:

[0046] y final =(proh_last(x*a final ))*scale+x

[0047] wherein x is the original input feature map, a final is the context enhanced feature. This fusion strategy ensures that the enhanced features will not disturb the original semantic structure, while improving the diversity and discriminability of feature expression. The MLKDA module normalizes the features output by each convolution branch to stabilize the training and improve the generalization ability.

[0048] It should be understood that the purpose of introducing the dynamic attention mechanism in the MLKDA module is to further improve the adaptability of feature fusion.

[0049] Specifically, the scheme of the application is further described according to the following examples:

[0050] The application discloses a corn disease and pest detection method based on MTA-YOLOv11.

[0051] Step 1: constructing an MTA-YOLOv11 model with enhanced feature fusion characteristics, including a backbone feature extraction network Backbone, a feature fusion network Neck and a detection head Head, specifically, selecting a YOLOv11 model as a baseline network and improving the same to form a target detection model with feature edge enhancement and feature detail fusion characteristics, namely a lightweight target detection model MTA-YOLOv11 model, as shown in Figure 2 , including:

[0052] Step 1-1: the Backbone adopts an improved MERDEM module for feature extraction, and through the cooperative work of an auxiliary edge path, a multi-scale average pooling and an edge enhancer, the fidelity of small target boundaries and texture details is significantly improved, while the lightweight calculation overhead is maintained.

[0053] Step 1-2: the Neck part, the original Bottleneck module is replaced by a TK-FocusBlock module. The module first performs low-dimensional coding through a depth separable convolution, then sparsifies a query-key-value attention matrix by means of a learnable TKSA selection operator, and simultaneously fuses a spatial attention mechanism to explicitly model a spatial boundary, so as to realize accurate focusing on a key ROI in a multi-scale path.

[0054] Step 1-3: the Head part is connected in series with an MLKDA module in front, divides input features into four branches according to channels, respectively adopts different large-core depth separable convolutions, expands a receptive field and captures cross-scale contexts, completes weighted fusion by means of dynamic attention weights, and outputs context-enhanced features through residual connection.

[0055] Step 2: introducing a MERDEM module in a C3k2 structure of the backbone network, as shown in Figure 3 and Figure 4As shown, the module includes an auxiliary edge path, a multi-scale edge information extraction unit, an edge enhancer, and a feature fusion unit. After the input features are reduced in dimension by 1x1 convolution, the multi-scale pooling unit extracts the edge profile at different scales, and the edge contrast of the feature map is enhanced by the edge enhancer. Finally, after the features at each scale are concatenated with the features of the backbone network in the channel dimension, a 1x1 convolution is used to fuse and output enhanced feature maps with more detailed information, thereby improving the detection capability of small targets and blurred targets.

[0056] Step 3: Embed TK-FocusBlock module in the neck feature fusion stage, as shown in Figure 5 The module first reduces and encodes the features by 1x1 and 3x3 depth separable convolution to construct local context representation. Then, the module maps the features into three representations of query (Q), key (K) and value (V), and selects the most relevant KxV feature pairs for attention calculation by TKSA selection operator for each query, realizing the sparsification and focusing of features. At the same time, a spatial attention module (PAM) is introduced to enhance the ability to describe target position and shape by capturing the spatial autocorrelation information of the feature map. The TK-FocusBlock module adopts a parameter sharing mechanism to save computing resources, and finally outputs high-quality feature maps focusing on key areas, significantly enhancing the response capability of the model to pest targets. The bidirectional transmission of feature flow ensures sufficient interaction between shallow texture and deep semantics, significantly reducing background noise and improving small target detection rate.

[0057] Step 4: Insert MLKDA module before the detection head, as shown in Figure 6 The module divides the input features into multiple sub-channels along the channel dimension, and each sub-channel is subjected to multi-scale convolution with depth separable convolution kernels of different sizes (3x3, 5x5, 7x7, 9x9) to capture semantic information at different receptive fields. Then, the MLKDA module generates multi-scale context enhanced features by weighting and fusing the output features of each branch with learnable attention weights, and outputs the fusion result through residual connection with the original input features. In this process, the outputs of each branch are normalized to maintain training stability and improve generalization ability. Through the structure of the MLKDA module, multi-scale information is fully fused, making the model have stronger semantic understanding and robustness when detecting pest targets in complex scenes.

[0058] Step 5: Create Corn-d dataset, as shown in Figure 7 The collected corn pest image dataset is partially manually annotated and divided into training set and validation set, and the specific content of the dataset is:

[0059] Step 5-1: The data set is divided into two sources of diseases and pests: the corn leaf disease data set is obtained from the combination of PlantVillage and PlantDoc in the Kaggle public data set, which provides more training samples, more plant disease types and more environmental backgrounds, and is composed of 4188 corn plant images, which are divided into four categories, namely: healthy corn leaves, common rust, corn wilt and gray spot. The corn leaf pest data set comes from the IP102 public data set, which has more than 75,000 images covering 102 categories, and 19,000 pictures have accurate bounding box annotations, and only the corn-related pest images are extracted here, which are divided into three categories, namely: corn borer, grass armyworm and corn aphid, a total of 1509 image samples, and the resolution is uniformly adjusted to 640x640 pixels.

[0060] Step 5-2: The LabelImg software is used to manually label the pixel area of the corn disease and pest image in JPG format. The maximum circumscribed rectangle frame strategy is adopted, and the adhesion of the labeled frame to the edge of the target area is strictly controlled. Considering the influence of complex environmental factors such as strong light and leaf shielding on feature extraction in actual application scenarios, as well as the class imbalance problem existing in the data set, the original data set is expanded to 7,312 images through random rotation, horizontal flip and other data enhancement techniques. In order to ensure the rigor of the experiment, the data set is divided into training set (5,118), validation set (1,463) and test set (731) according to the ratio of 7:2:1.

[0061] Step 6: The corn disease and pest image in the validation set is input into the best model obtained by training to save the best model.

[0062] Step 7: The best model is used to detect the corn disease and pest image to be detected, and the visual detection result of the corn disease and pest image to be detected is obtained.

[0063] In the method of the application, all experiments are performed on the same computer, the experimental environment and parameter settings are based on the Pytorch framework running in the Python3.10 environment, the CPU is Intel Xeon Platinum8260, the graphics processing unit is NVIDIA Tesla P100-16GB, the memory is 60G, and the operating system is Windows11. The initial learning rate of the test is set to 0.01, the stochastic gradient descent (SGD) method is used to optimize the loss in the training process, the epoch is set to 100, and the batchsize is set to 16.

[0064] The present application adopts six key indicators for quantitative analysis: precision (P), recall (R), mean average precision (mAP), detection speed (FPS), parameter quantity (Params) and floating point operation quantity (GFlops). Among them, the precision P measures the proportion of correct prediction in all instances predicted as positive, reflecting the prediction reliability of the model; the recall R reflects the coverage ability of the model to actual positive samples; the mAP is the core evaluation standard of multi-class detection, which is obtained by averaging the average precision (AP) of each class, and comprehensively reflects the performance of the model in the detection task, wherein the AP is calculated based on the area under the P-R curve, reflecting the single-class detection performance; the calculation formula of the above indicators is:

[0065]

[0066] In the formula, TP represents true positive (the number of correctly predicted positive samples), FP represents false positive (the number of incorrectly predicted positive samples), FN represents false negative (the number of missed positive samples), and n represents the number of detection categories; AP i is the average precision of the ith class.

[0067] In addition, FPS, Params and GFlops are used to measure the running efficiency and complexity of the model.

[0068] To verify the independent benefits and synergistic gains of the three improved units C3k2_MERDEM, TK-FocusBlock and MLKDA in the lightweight MTA-YOLOv11, the present application conducts an ablation experiment on the self-built Corn-d dataset. Eight groups of models are constructed by combining the three units in different combinations, as shown in Table 1, and compared with the baseline YOLOv11n in terms of Precision (P), Recall (R), mAP@0.5, inference speed (FPS), parameter quantity (Params), and calculation quantity (GFLOPs) and other indicators. Marked with √ represents the module used.

[0069] Table 1 Ablation experiment results

[0070]

[0071] As shown in Table 1, each improved unit of the present application brings quantifiable benefits to the baseline YOLOv11n: MERDEM (model 2) multi-scale edge enhancement suppresses background noise, Precision increases by 1.5%, mAP increases by 1.1%, and inference speed increases from 89fps to 133fps, proving its detail fidelity advantage. TK-FocusBlock (model 3) focuses on ROI of plaque through TKSA sparse attention, Precision increases by 1.9%, mAP also increases by 1.1%, and FPS increases to 156fps, showing the effectiveness of key area response enhancement. MLKDA (model 4) large kernel multi-scale semantic fusion expands the receptive field, Precision increases by 1.5%, mAP increases by 1.0%, and parallel depth separable convolution makes FPS surge to 286fps. Three modules combined (model 8) achieve mAP of 91.8%, P of 88.5%, R of 87.9%, and FPS of 227fps under the condition of only 3M parameters and 7.4GFLOPs, achieving the optimal balance of precision and efficiency. As can be seen, MERDEM, TK-FocusBlock and MLKDA respectively strengthen detail perception, regional attention and multi-scale semantics, and after jointing, significant synergistic gain is produced, meeting the real-time and lightweight detection needs of complex agricultural scenes.

[0072] To further evaluate the performance advantages of the MTA-YOLOv11 model in the corn disease and pest detection task, the present application compares it with the current mainstream lightweight target detection models YOLOv5n, YOLOv8n, YOLOv9n, YOLOv10n, as well as the improved algorithms YOLO-SDW and YOLOv8n-ERM. All models are uniformly trained and tested on the self-built Corn-d dataset to ensure consistency and fairness of the evaluation. The experimental results are shown in Table 2. MTA-YOLOv11 achieves excellent detection performance while maintaining a small model size. Specifically, its mAP reaches 91.8%, leading all comparison models. Its parameter quantity is 3.0M, and its computational quantity is 7.4GFLOPs, showing good model lightweight characteristics. Compared with YOLOv5n, MTA-YOLOv11 improves mAP by 2.4%, with only an increase of 0.5M in parameter quantity and a slight increase in computational quantity, reflecting the modest growth of model complexity while improving accuracy. Compared with YOLOv8n, MTA-YOLOv11 improves mAP by 1.2% with equivalent parameter quantity, showing higher detection accuracy. In addition, compared with YOLO-SDW and YOLOv8n-ERM models, MTA-YOLOv11 has significant improvements in precision and recall, and its FPS is only second to YOLOv8n among all comparison models, showing good real-time detection capability. From the comprehensive comparison of models, it can be seen that MTA-YOLOv11 is superior to the current mainstream target detection models in mAP, precision, and parameter efficiency, showing good multi-scale adaptability and environmental robustness. The model maintains low computational complexity and parameter overhead while considering detection performance, has excellent lightweight characteristics and real-time performance, and provides a solid guarantee for the deployment of edge devices in agricultural intelligent scenarios.

[0073] Table 2 Comparison test results of different models

[0074]

[0075] Finally, the MTA-YOLOv11 model containing the above improvement modules infers the image as Figure 8 and Figure 9As shown, on the basis of quantization, the analysis is carried out from the perspective of visualization, and is respectively compared and displayed from two levels of detection result output and model perception area response. On the one hand, the detection frame is used to visually evaluate the recognition ability of each model for the target boundary, the occluded area and the small target. On the other hand, in combination with the heat map visualization technology, the differences in attention of the model to the key area in the feature map layer are analyzed in depth, which assists in understanding the effectiveness of the model in semantic modeling and detail capturing. The technical scheme described in the embodiment of the present application ensures that the corn disease and pest detection method realizes high-precision, rapid and reliable automatic detection in a complex field environment.

[0076] As another example, the embodiment of the present application also provides a target detection method, which detects a to-be-detected image by using the corn disease and pest detection method based on the MTA-YOLOv11 model of the first aspect.

[0077] As another example, the embodiment of the present application also provides an MTA-YOLOv11 model file stored in a computer readable medium, which can be loaded and executed by a processor to infer a to-be-detected corn field image and output a detection result containing a disease and pest category, a positioning frame and a visual annotation. The MTA-YOLOv11 model includes a backbone network, a neck network and a detection head. The two-level C3k2 units of the backbone network are configured to embed a MERDEM module, which uses a multi-branch pooling and edge compensation mechanism to strengthen the expression of fuzzy contour and small target boundary features. The original Bottleneck module in the neck network is replaced by a TK-FocusBlock module, which sparsifies the attention matrix through a learnable TKSA selection operator and a spatial attention mechanism to improve the response ability of the MTA-YOLOv11 model to key disease and pest areas and suppress background noise. The detection head is configured to insert an MLKDA module, which expands the receptive field through a multi-scale large kernel depth separable convolution and a dynamic weighted fusion strategy, realizes cross-scale context modeling and channel selection, and generates context-enhanced features.

[0078] As another example, the present application also provides an electronic device, which will now be described as an example of a hardware device that can be applied to aspects of the present application, which can be a server or a client of the present application. The electronic device is intended to represent a wide variety of digital electronic computing devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computing devices. The electronic device can also represent a wide variety of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.

[0079] The electronic device can include a processor, a communications interface, a memory, and a communications bus.

[0080] The processor, the communications interface, and the memory communicate with each other through the communications bus. The communications interface is used to communicate with other electronic devices or servers.

[0081] The processor is used to execute a program, which can specifically execute the related steps performed by the corn pest and disease detection method based on MTA-YOLOv11 of the first aspect or the target detection method of the second aspect.

[0082] Specifically, the program can include program code, which includes computer operation instructions.

[0083] The processor can be a processor CPU, or an application specific integrated circuit ASIC, or one or more integrated circuits configured to implement embodiments of the present application. The one or more processors included in the smart device can be the same type of processor, such as one or more CPUs; or can be different types of processors, such as one or more CPUs and one or more ASICs.

[0084] The memory is used to store the program. The memory can include a high-speed RAM memory, and can also include a non-volatile memory, such as at least one disk memory.

[0085] The program, when executed by the processor, is used to make the electronic device execute the corn pest and disease detection method based on MTA-YOLOv11 of the first aspect of the present application or the target detection method of the second aspect.

[0086] Further, the specific implementation of each step in the program can refer to the corresponding description in the corresponding steps and units in the above method embodiments, and will not be described here. Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the foregoing method embodiments, and will not be described here.

[0087] The exemplary embodiments of the present application also provide a computer storage medium storing a computer program, wherein the computer program is executed by a processor to implement the method of the embodiments of the present application, and can refer to the corresponding process description in the foregoing method embodiments, and will not be described here.

[0088] The above-described method according to the embodiments of the present application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk or a magneto-optical disk, or be downloaded through a network originally stored in a remote recording medium or a non-transitory machine-readable medium and then stored in a local recording medium, so that the method described herein can be processed by such software using a general computer, a special purpose processor or programmable or special hardware (such as ASIC or FPGA) on the recording medium. It can be understood that the computer, processor, microprocessor controller or programmable hardware includes a storage component (for example, RAM, ROM, flash memory, etc.) that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, processor or hardware, the method described herein is implemented. In addition, when the general computer accesses the code for implementing the method shown herein, the execution of the code will convert the general computer into a special computer for executing the method shown herein.

[0089] So far, specific embodiments of the present application have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In some implementations, multitasking and parallel processing can be advantageous.

[0090] It should be understood that although the present specification is described according to various embodiments, not every embodiment contains only one independent technical solution, and the description of the specification is only for the sake of clarity, and those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be combined appropriately to form other embodiments that those skilled in the art can understand.

[0091] Finally, it should be noted that the above embodiments are only used to illustrate the present application, and are not intended to limit the present application. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application. Therefore, all equivalent technical solutions also belong to the scope of the present application, and the patent protection scope of the present application should be defined by the claims.

Claims

1. A corn disease and insect pest detection method based on MTA-YOLOv11, characterized in that: include: Step S101: constructing an MTA-YOLOv11 model based on YOLOv11, wherein the MTA-YOLOv11 model includes a backbone network, a neck network, and a detection head; Step S102: embedding a MERDEM module in the two-level C3k2 unit of the backbone network, and utilizing a multi-branch pooling and edge compensation mechanism to enhance the expression of fuzzy contours and small object boundary features; Step S103: replacing the original Bottleneck module in the neck network with a TK-FocusBlock module, and sparsifying the attention matrix through a learnable TKSA selection operator and a spatial attention mechanism to improve the responsiveness of the MTA-YOLOv11 model to key pest and disease areas and suppress background noise; Step S104: inserting an MLKDA module before the detection head, expanding the receptive field through multi-scale large-kernel depthwise separable convolution and dynamic weighted fusion strategy, realizing cross-scale context modeling and channel selection, and generating context-enhanced features; Step S105: Construct a Corn-d corn pest and disease image dataset, divide the finely labeled corn pest and disease images in the dataset into a training set and a validation set in proportion, evaluate the training process of the MTA-YOLOv11 model using the validation set and save the optimal model weights, perform inference on the corn field image to be tested based on the best model corresponding to the optimal model weights, and output detection results including pest and disease categories, positioning boxes, and visual annotations.

2. The method according to claim 1, characterized in that The MERDEM module includes an auxiliary edge path, a multi-scale edge information extraction unit, an edge enhancer and a feature fusion unit; The auxiliary edge path performs channel compression on the input features through 1×1 convolution to highlight the edge information; The multi-scale edge information extraction unit uses multi-level average pooling and lightweight convolution operations to extract edge features under different receptive fields; The edge enhancer enhances the local contrast of the edge area in the feature map through the mean residual mechanism and the Sigmoid activation function; The feature fusion unit concatenates the edge features of each scale with the main branch features in the backbone network along the channel dimension, and outputs a detail enhanced feature map through 1×1 convolution fusion: Where, F main is the main branch characteristic, F edge Input features for auxiliary edge paths, Pool s (·) represents the s-th level average pooling, E s (·) represents the edge enhancer, [||] is the channel splicing operation, Sum features across scales.

3. The method according to claim 1, characterized in that The TK-FocusBlock module uses a parameter sharing mechanism to optimize the attention path to control computational complexity and improve inference efficiency. It specifically includes a depthwise separable convolutional layer, a learnable TKSA selection operator, and a spatial attention module. The depth-wise separable convolutional layer is used to perform dimensionality reduction encoding on the input features to construct a local context representation; The learnable TKSA selection operator adaptively selects the K most relevant key-value pairs for each query vector to achieve attention sparsification and suppress interference from irrelevant regions: F TK =A TK V Among them, Q, K, and V are query, key, and value matrices respectively, d is the feature dimension, TopK(·) retains the top K largest attention coefficients in each query row and sets the rest to zero, and F TK It is the sparse attention aggregation output, which is then added to the spatial attention branch output to obtain the final output of TK-FocusBlock; The spatial attention module is used to enhance the ability to depict the target boundary structure by capturing the spatial correlation of the feature map.

4. The method according to claim 1, wherein The MLKDA module includes multiple depth-separable convolution branches and attention weighted fusion units; The input features are divided into several sub-channels along the channel dimension. For each sub-channel, depth-wise separable convolution branches with different convolution kernel sizes are used to extract multi-scale context features and output corresponding branch features. The MLKDA module introduces a dynamic attention mechanism, and weights the branch features of each scale through the attention weighted fusion unit to generate a multi-scale fused context-enhanced feature a final , the calculation expression is: a final =concat(LKA3(a1)·k3(a1),LKA5(a2)·k5(a2),LKA7(a3)·k7(a3),LKA9(a4)·k9(a4)) Among them, a1, a2, a3, and a4 are the four parts of the input features divided by the channel dimension, LKA3, LKA5, LKA7, and LKA9 represent the attention convolution operations using different convolution kernel sizes, k3, k5, k7, and k9 are the attention weight functions corresponding to each branch, and the symbol (·) represents the element-by-element weighted product; After the fusion feature is completed, the MLKDA module uses the residual connection method to combine the context enhancement feature a final It is fused with the original input feature map x and a learnable scale factor scale is introduced to adjust the feature strength to achieve the final output: y final =(proh_last(x*a final ))*scale+x Among them, x is the original input feature map, a final Enhance features for context.

5. A target detection method, characterized in that: The target detection method uses the corn disease and insect pest detection method based on MTA-YOLOv11 according to any one of claims 1 to 4 to detect the image to be detected, and the image to be detected is an image in the field of corn disease and insect pest detection.

6. An MTA-YOLOv11 model file stored in a computer-readable medium, characterized in that: The model file can be loaded and executed by a processor to perform inference on the cornfield image to be tested, and output detection results including pest and disease category, positioning box and visual annotation. The MTA-YOLO v11 model includes a backbone network, a neck network and a detection head; The two-level C3k2 units of the backbone network are configured as embedded MERDEM modules, which use multi-branch pooling and edge compensation mechanisms to enhance the expression of fuzzy contours and small target boundary features. The original Bottleneck module in the neck network was replaced with a TK-FocusBlock module, and the attention matrix was sparsified using a learnable TKSA selection operator and a spatial attention mechanism to improve the MTA-YOLO v11 model's responsiveness to key pest and disease areas and suppress background noise. The detection head is configured to be inserted with an MLKDA module, which expands the receptive field through multi-scale large-kernel depth-separable convolution and dynamic weighted fusion strategy, realizes cross-scale context modeling and channel selection, and generates context-enhanced features.

7. An electronic device, characterized in that: include: processor; Memory for storing programs; The program includes instructions that, when executed by the processor, cause the processor to perform the steps of the corn pest and disease detection method based on MTA-YOLOv11 as described in any one of claims 1 to 4, or the steps of the target detection method as described in claim 5.

8. A computer storage medium, characterized in that A computer program is stored thereon, which, when executed by a processor, implements the corn disease and insect pest detection method based on MTA-YOLOv11 as described in any one of claims 1 to 4, or the target detection method as described in claim 5.

Citation Information

Cited By

  • Forestry pest recognition method and device based on Improved-YOLOv11 and storage medium

    CN122067274A

  • A method, system, equipment and medium for identifying corn kernel varieties

    CN122368990A