Multi-scale attention pest and disease target detection method and system, electronic equipment and storage medium

By introducing MSKA and GSConv modules into the YOLOv11 network, the problems of insufficient receptive field and weak multi-scale capability are solved, enabling efficient, small-target identification and accurate detection in agricultural pest and disease detection.

CN120976531APending Publication Date: 2025-11-18XINJIANG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511120753.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing pest and disease detection methods in agricultural scenarios suffer from problems such as insufficient receptive field, weak multi-scale capability, and large parameter computation, especially in the recognition of small targets, and the model has insufficient generalization ability.

Method used

A multi-scale attention-based pest and disease target detection method is adopted. By introducing the MSKA module and GSConv module into the YOLOv11 network, the receptive field and multi-scale feature extraction capabilities are enhanced, while reducing the computational cost. This includes fusing ECA units and lightweight convolutional structures.

Benefits of technology

Without increasing the number of parameters and computational load, it significantly improves the detection accuracy of small-target pests and diseases and the multi-scale detection capability of the model, and enhances the detection accuracy and robustness in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976531A_ABST
    Figure CN120976531A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of agricultural pest detection, and provides a multi-scale attention pest target detection method and system, electronic equipment and a storage medium, and the method comprises the steps: collecting a to-be-detected image, and recognizing a pest target detection model; the training process of the pest and disease damage target detection model comprises improved YOLOv11 network construction and model training; according to the invention, through multi-dimensional information enhancement and structure fusion, the model improves the detection precision of small target diseases and insect pests in a complex scene while ensuring that excessive parameter quantity and calculation quantity are not increased.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of agricultural pest detection, and in particular to a multi-scale attention pest target detection method and system, an electronic device and a storage medium. BACKGROUND

[0002] The candidate region extraction is abbreviated as RPN; with the development of artificial intelligence and computer vision technology, the target detection method has been widely used in industrial detection, traffic monitoring, safety protection and pest identification in agricultural scenes. Among them, the agricultural pest detection as a key link in agricultural intelligence puts forward higher requirements for model precision, inference speed and device deployment adaptability. At present, the mainstream target detection framework widely used in the academic and industrial circles mainly includes two types: 1) two-stage method, such as FasterR-CNN, which classifies and regresses after RPN, has high precision, but has problems of slow inference speed, high occupation of computing resources, etc., and is not suitable for edge deployment; 2) single-stage method, such as YOLO series and SSD, gradually becomes a widely used detection model in actual scenes due to its simple structure and fast speed. Among them, YOLO series as the mainstream single-stage detection framework has introduced structure optimization strategies such as CSPDarknet, PANet, SPP, RepConv in multiple versions to improve detection performance and model efficiency.

[0003] But in the scene of agricultural pest identification with small target density, small morphological difference and similar shape, the following challenges still exist: 1) insufficient receptive field: since the pest area is usually small, the target features are easily submerged in the down-sampling process, and the existing network structure has limited receptive field in the backbone, which makes it difficult to effectively obtain the target context information; 2) weak multi-scale capability: the pest morphology on crop leaves is significantly different, and although the conventional FPN, PANet and other structures have certain multi-scale fusion capability, the information expression between feature layers is still insufficient, especially the small target features are easily ignored; 3) large parameter calculation amount: for example, the FasterR-CNN model has more than 200M parameters, which is not conducive to deployment on resource-limited edge devices or low-power terminals; 4) few public data sets in agricultural scenes, and the model generalization ability is not strong: the existing model is trained on general COCO, VOC and other data, and has poor adaptability to agricultural pest data sets, and the structure needs to be optimized accordingly. SUMMARY

[0004] In order to overcome the deficiencies of the prior art, the purpose of the present application is to provide a multi-scale attention pest target detection method, system, electronic device and storage medium, which solves the problems of insufficient receptive field, weak multi-scale capability and large parameter calculation amount of traditional methods.

[0005] To achieve the above purpose, the present application provides the following solutions:

[0006] A multi-scale attention pest and disease target detection method, comprising:

[0007] Collecting an image of a target area to obtain a to-be-detected image;

[0008] Inputting the to-be-detected image into a pre-trained pest and disease target detection model for recognition to obtain a pest and disease detection result; the training process of the pest and disease target detection model comprises:

[0009] Replacing a C3k2 module in a Backbone part of an original YOLOv11 network with a C3k2_MSKA module fusing an ECA unit and an MSKA unit, and replacing a convolution module in the original YOLOv11 network with a GSConv module to obtain an improved YOLOv11 network;

[0010] Training the YOLOv11 network using a pre-collected data set to obtain the trained pest and disease target detection model.

[0011] Preferably, the improved YOLOv11 network comprises: the Backbone part, the Neck part and the Head part connected in sequence; the Backbone part comprises: a first CBS module, a second CBS module, a first C3k2_MSKA module, a first GSConv module, a second C3k2_MSKA module, a second GSConv module, a third C3k2_MSKA module, a third GSConv module, a fourth C3k2_MSKA module, an SPPF module and a C2PSA module connected in sequence.

[0012] Preferably, the Neck part comprises: a first Upsample module, a first Concat module, a first C3k2 module, a second Upsample module, a second Concat module, a second C3k2 module, a fourth GSConv module, a third C3k2 module, a third Concat module, a fourth C3k2 module, a fifth GSConv module and a fourth Concat module connected in sequence.

[0013] The second C3k2_MSKA module is connected with the second Concat module; the third C3k2_MSKA module is connected with the first Concat module; and the C2PSA module is connected with the first Upsample module and the fifth GSConv module respectively.

[0014] Preferably, the Head section includes: a first Detect module, a second Detect module, and a third Detect module;

[0015] The first Detect module is connected to the second C3k2 module; the second Detect module is connected to the third Concat module; and the third Detect module is connected to the fourth Concat module.

[0016] Preferably, the processing procedure of the MSKA unit includes:

[0017] The original feature map input to the MSKA unit is normalized and subjected to 1×1 convolution to obtain a preprocessed feature map; the expression of the preprocessed feature map is: ;in, The preprocessed feature map; The original feature map; This indicates a channel dimension normalization operation; This represents a 1×1 convolution operation;

[0018] The preprocessed feature map is divided into a first part and a second part along the channel direction;

[0019] The first part is subjected to multi-receptive-field convolution processing to obtain the spatial receptive-field response; the expression for the multi-receptive-field convolution processing includes: , , , , ;in, ; , , , These are respectively the first sub-channel block, the second sub-channel block, the third sub-channel block, and the fourth sub-channel block of the first part; , , , They are respectively , , , The result after multi-receptor field convolution processing; Indicates to Perform four-channel partitioning with a convolution kernel of 3; For the spatial receptive field response; This represents channel-by-channel multiplication; Indicates to Perform depthwise convolution with a kernel of 3; This refers to the i-th sub-channel block of the first part; This refers to the first part of the i-th sub-channel block of the first part; Indicates to Perform depthwise convolution with a kernel of k×k;

[0020] The spatial receptive field response and the second part are multiplied and convolved by 1×1 to obtain a receptive feature map. The receptive feature map and the original feature map are then residually concatenated to obtain an enhanced feature map. The expression for the enhanced feature map is: ;in, The enhanced feature map; For scaling parameters; This is the second part; This indicates element-wise multiplication.

[0021] Preferably, the processing procedure of the ECA unit includes:

[0022] Global average pooling is performed on the enhanced feature map to obtain the channel description vector;

[0023] Using 1×1 convolution and The activation function calculates the channel attention coefficients using the channel description vector.

[0024] The enhanced feature map and the channel attention coefficients are multiplied channel by channel to obtain the output feature map.

[0025] Preferably, a multi-scale attention-based pest and disease target detection system includes:

[0026] The image acquisition module is used to acquire images of the target area to obtain the image to be detected;

[0027] The pest and disease identification module is used to input the image to be detected into a pre-trained pest and disease target detection model for identification, and obtain pest and disease detection results.

[0028] Preferably, an electronic device includes: at least one processor and a memory communicatively connected to the processor; wherein the memory stores instructions executable by the processor, the instructions being executed by the processor to enable the processor to perform the aforementioned multi-scale attention-based pest and disease target detection method.

[0029] Preferably, a non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute the aforementioned multi-scale attention-based pest and disease target detection method.

[0030] The present invention discloses the following technical effects:

[0031] This invention provides a multi-scale attention-based pest and disease target detection method, system, electronic device, and storage medium. By enhancing multi-dimensional information and fusion structure, it solves the problems of insufficient receptive field, weak multi-scale capability, and large parameter calculation volume of traditional methods, and achieves improved detection accuracy of small target pests and diseases in complex scenes without increasing the number of parameters and calculation volume. Attached Figure Description

[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a schematic diagram of the multi-scale attention-based pest and disease target detection process provided in an embodiment of the present invention;

[0034] Figure 2 A model structure diagram provided for an embodiment of the present invention;

[0035] Figure 3 This is a structural diagram of the MSKA module provided in an embodiment of the present invention;

[0036] Figure 4 This is a structural diagram of the ECA module provided in an embodiment of the present invention;

[0037] Figure 5 This is a structural diagram of the GSConv module provided in an embodiment of the present invention;

[0038] Figure 6 A model comparison curve provided for an embodiment of the present invention. Detailed Implementation

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

[0040] The purpose of this invention is to provide a multi-scale attention-based pest and disease target detection method, system, electronic device, and storage medium to solve the problems of insufficient receptive field, weak multi-scale capability, and large parameter calculation volume of traditional methods.

[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0042] Figure 1 This is a schematic diagram of the multi-scale attention-based pest and disease target detection process provided in an embodiment of the present invention, as shown below. Figure 1 As shown, this invention provides a multi-scale attention-based pest and disease target detection method, comprising:

[0043] Step 100: Acquire an image of the target area to obtain the image to be detected;

[0044] Step 200: Input the image to be detected into a pre-trained pest and disease target detection model for identification to obtain pest and disease detection results; the training process of the pest and disease target detection model includes:

[0045] Step 201: Replace the C3k2 module in the Backbone section of the original YOLOv11 network with the C3k2_MSKA module that integrates ECA and MSKA units, and replace the convolutional module in the original YOLOv11 network with the GSConv module to obtain the improved YOLOv11 network.

[0046] Step 202: Train the YOLOv11 network using the pre-collected dataset to obtain the trained pest and disease target detection model.

[0047] Furthermore, the improved YOLOv11 network includes: the Backbone, Neck, and Head units connected in sequence; the Backbone unit includes: a first CBS module, a second CBS module, a first C3k2_MSKA module, a first GSConv module, a second C3k2_MSKA module, a second GSConv module, a third C3k2_MSKA module, a third GSConv module, a fourth C3k2_MSKA module, an SPPF module, and a C2PSA module connected in sequence.

[0048] Specifically, the Neck section includes: a first Upsample module, a first Concat module, a first C3k2 module, a second Upsample module, a second Concat module, a second C3k2 module, a fourth GSConv module, a third C3k2 module, a third Concat module, a fourth C3k2 module, a fifth GSConv module, and a fourth Concat module connected in sequence.

[0049] The second C3k2_MSKA module is connected to the second Concat module; the third C3k2_MSKA module is connected to the first Concat module; and the C2PSA module is connected to the first Upsample module and the fifth GSConv module, respectively.

[0050] Furthermore, the Head section includes: a first Detect module, a second Detect module, and a third Detect module;

[0051] The first Detect module is connected to the second C3k2 module; the second Detect module is connected to the third Concat module; and the third Detect module is connected to the fourth Concat module.

[0052] Specifically, the processing procedure of the MSKA unit includes:

[0053] The original feature map input to the MSKA unit is normalized and subjected to 1×1 convolution to obtain a preprocessed feature map; the expression of the preprocessed feature map is: ;in, The preprocessed feature map; The original feature map; This indicates a channel dimension normalization operation; This represents a 1×1 convolution operation;

[0054] The preprocessed feature map is divided into a first part and a second part along the channel direction;

[0055] The first part is subjected to multi-receptive-field convolution processing to obtain the spatial receptive-field response; the expression for the multi-receptive-field convolution processing includes: , , , , ;in, ; , , , These are respectively the first sub-channel block, the second sub-channel block, the third sub-channel block, and the fourth sub-channel block of the first part; , , , They are respectively , , , The result after multi-receptor field convolution processing; Indicates to Perform four-channel partitioning with a convolution kernel of 3; For the spatial receptive field response; This represents channel-by-channel multiplication; Indicates to Perform depthwise convolution with a kernel of 3; This refers to the i-th sub-channel block of the first part; This refers to the first part of the i-th sub-channel block of the first part; Indicates to Perform depthwise convolution with a kernel of k×k;

[0056] The spatial receptive field response and the second part are multiplied and convolved by 1×1 to obtain a receptive feature map. The receptive feature map and the original feature map are then residually concatenated to obtain an enhanced feature map. The expression for the enhanced feature map is: ;in, The enhanced feature map; For scaling parameters; This is the second part; This indicates element-wise multiplication.

[0057] Furthermore, the processing procedure of the ECA unit includes:

[0058] Global average pooling is performed on the enhanced feature map to obtain the channel description vector;

[0059] Using 1×1 convolution and The activation function calculates the channel attention coefficients using the channel description vector.

[0060] The enhanced feature map and the channel attention coefficients are multiplied channel by channel to obtain the output feature map.

[0061] Specifically, this embodiment provides a multi-scale attention-based pest and disease target detection method. The core innovation lies in proposing a target detection network architecture that integrates a multi-scale large-kernel convolutional attention module (MSKA) and a lightweight convolutional structure (GSConv), which has been validated on an agricultural pest identification task (PEST24 dataset). This method has the following innovations: 1) Proposing the MSKA module: This module integrates large-kernel convolutions (3×3, 5×5, 7×7, 9×9) at multiple scales to expand the receptive field and enhance spatial awareness; it also introduces an efficient channel attention mechanism (ECA) to highlight important semantic channels and suppress redundant information; the MSKA module replaces the traditional Bottleneck structure, constructing multi-scale deep feature extraction paths in different layers of the backbone. 2) Introducing the GSConv module: This replaces some standard convolutional operations, thereby improving the network's lightweight nature. The GSConv module, by combining depthwise separable convolution with channel shuffle, significantly reduces computation and parameter count while maintaining feature representation capabilities, optimizing channel information flow within the convolutional structure. 3) Multi-module integrated structure design: The network backbone includes regular convolution, C3k2_MSKA, GSConv, SPPF (spatial pyramid pooling), and C2PSA (fusion of channel and spatial attention) modules; the network head structure uses a C3k2 structure for feature fusion, and multi-scale detection output is achieved through progressive upsampling and the Detect module. Application results: This embodiment is validated on the publicly available agricultural pest dataset PEST24. Compared to the baseline YOLOv11s model, without increasing the number of parameters, mAP50 is improved from 68.4% to 70.6%, precision reaches 74.4%, and the total parameters are controlled at 21.2M.

[0062] Furthermore, to address the insufficient expressive power of existing mainstream methods in detecting small targets such as pests and diseases, this embodiment proposes an improved target detection method. This method primarily optimizes modules at the backbone and neck levels, proposing a multi-scale convolutional feature extraction module (MSKA) combined with a lightweight GSConv convolutional module. Through multi-dimensional information enhancement and structural fusion, the model improves the detection accuracy of small targets such as pests and diseases in complex scenes without significantly increasing the number of parameters and computational cost.

[0063] refer to Figure 2 The structure of the present invention is as follows Figure 2As shown, this method follows the overall framework of YOLOv11 and introduces a multi-scale convolutional feature extraction module (MSKA) into the backbone network C3k2, integrating the GSConv structure to improve the model's feature perception capability and detection accuracy in complex scenes. The overall network structure still consists of three parts: Backbone, Neck, and Head, maintaining the advantages of the YOLO series in compact structure and fast inference speed. The backbone network uses multi-level convolution and feature extraction modules for downsampling and semantic information extraction. Based on the C3k2 module already used in the original YOLOv11, this embodiment proposes a multi-scale feature enhancement module to be added to the original backbone network C3K2, replacing the bottleneck structure with a Bottleneck module with MSKA. This module extracts local features under different receptive fields through multi-scale branch large-kernel depth convolutions (3×3, 5×5, 7×7, 9×9), and achieves implicit feature enhancement through channel-wise multiplication. Combined with ECA attention, it effectively improves the network's ability to represent fine-grained and small target regions. In the feature extraction stages at each scale (P2, P3, P4, P5), C3k2_MSKA is embedded multiple times to improve feature extraction quality. In the final stage, the spatial pyramid pooling fast module (SPPF) and the C2PSA channel attention module further enhance context modeling capabilities. During the feature fusion and prediction stage, feature maps from different scales are fused layer by layer, and upsampling and concatenation operations are performed to construct multi-branch detection paths. GSConv is introduced to further reduce computational cost and improve expressive power. Finally, the detection head inputs the fused three-scale features into the prediction branch, achieving a unified detection output for small, medium, and large targets. The overall structure effectively improves the network's detection robustness and its ability to perceive multi-scale targets in complex scenes while maintaining inference speed.

[0064] Specifically, MSKA: Multi-Scale Attention Module. To enhance the model's ability to represent multi-scale targets and local textures, this invention proposes a Multi-Scale Kernel Attention (MSKA) module. MSKA is a self-designed module proposed in this embodiment, which differs from existing attention mechanisms such as SE, CBAM, and SK. Its core lies in the fusion of a multi-scale large-kernel convolutional structure and a lightweight ECA attention mechanism. Its structure is as follows: Figure 3 As shown, this module simulates convolutional responses under different receptive fields through channel partitioning and parallel branching. While maintaining low computational cost, it enhances the expressive power of the feature map and introduces an efficient channel attention mechanism (ECA) to further improve the discriminative power of the features. Specifically, let the input feature map be... First, it is normalized and then expanded to 2C channels through 1×1 convolution, that is:

[0065]

[0066] in This is a channel-level normalization operation. Then... Divided into two parts along the direction of the passage, denoted as and They are used for feature enhancement and backbone propagation respectively, satisfying:

[0067]

[0068] In order to extract multi-scale spatial information It is evenly divided into four sub-channel blocks For each sub-block, i = 1, 2, 3, 4, each sub-block is processed through a large-kernel convolutional branch with a different receptive field. Each branch consists of a depthwise separable convolutional layer. The module (LargeKernelAttention) models feature responses using a depthwise convolution of the same size. The processing results for the four sub-blocks are shown below:

[0069]

[0070]

[0071]

[0072]

[0073] The LKA structure consists of three depthwise convolutions, specifically:

[0074]

[0075] The three convolutional directions described above model local, longitudinal, and lateral long-range dependencies, respectively. The sum of these three features forms the orientation-aware response characteristics. Through this method, the MSKA module models different spatial receptive field responses in each subspace and implicitly enhances them using channel-wise multiplication. The fused result is... , with the main branch The input and output feature maps are multiplied and then compressed through a 1×1 convolution to obtain a feature map. This feature map is then fused with the input feature map via residual connections to output an enhanced feature map. .

[0076]

[0077]

[0078] in, This represents element-wise multiplication. For learnable scaling parameters, This is the input feature map.

[0079] refer to Figure 4 After enhancing feature generation, the MSKA module also introduces the ECA (Efficient Channel Attention) module, the structure of which is as follows: Figure 4 As shown, this further enhances the modeling of inter-channel information. The ECA module employs a combination of global average pooling and one-dimensional convolution, achieving inter-channel attention weight modeling without the need for complex fully connected layers. Its mathematical expression is as follows:

[0080] First, the residual fusion output feature map Perform global average pooling to obtain the channel description vector:

[0081]

[0082] Subsequently, Convolution extracts the correlation between local channels, and through The activation function generates channel attention coefficients:

[0083]

[0084] Finally, the original feature map Attention coefficient Multiplying each channel sequentially yields the ECA-weighted output feature map:

[0085]

[0086] This process implements adaptive weighting of feature map channel dimensions, effectively improving the model's response to salient target regions, and is particularly suitable for the fine recognition of multi-scale pest targets in agricultural images. The MSKA module is integrated into the C3k2 module in the YOLOv11 backbone structure, named C3k2_MSKA, to replace its bottleneck structure. This module plays a key role in multi-level semantic extraction, enhancing the ability to recognize multi-scale targets while avoiding the loss of feature information caused by depthwise separable convolution.

[0087] refer to Figure 5 GSConv: GroupShuffleConvolution lightweight convolution module. To further improve the inference efficiency of neural networks on edge devices, this embodiment introduces the GSConv (GroupShuffleConvolution) module. Its structure is as follows: Figure 5As shown, GSConv uses a combination of pointwise and depthwise convolutions to perform channel shuffle after channel concatenation, thereby effectively reducing the number of parameters and computational overhead while maintaining feature expressiveness. The specific operation of the GSConv module is as follows: Let the input feature map be... First, preliminary feature mapping is performed using 1×1 point convolution:

[0088]

[0089] Then the results Perform 3×3 depthwise separable convolutions to enhance the local spatial receptive field:

[0090]

[0091] The two are then concatenated to obtain the feature combination:

[0092]

[0093] To enhance information exchange between channels, GSConv applies a channel rearrangement operation to the concatenated feature map:

[0094]

[0095] in This represents the channel rearrangement function. Number of channel groups. Final output feature map. It maintains good expressive power while possessing higher computational efficiency. Through the above structural design, GSConv effectively improves the model's lightweightness without significantly sacrificing accuracy, making it particularly suitable for object detection scenarios with high requirements for inference speed and resource consumption.

[0096] Specifically, experimental verification and performance comparison: To verify the effectiveness of the multi-scale attention-based pest and disease target detection method proposed in this invention, the publicly available agricultural pest dataset PEST24 was used for experiments. The method described in this invention was compared with mainstream target detection models such as YOLOv8s and RT-DETR, and the evaluation metrics included mAP50, precision, and the number of model parameters (Params). The experimental setup is as follows:

[0097] Dataset: PEST24 dataset, which contains images of crop diseases and pests taken in various real-world environments, featuring small and densely packed targets;

[0098] Evaluation metrics: mean accuracy (mAP@50), precision, number of model parameters;

[0099] Comparison models: YOLOv5s, YOLOv8s, RT-DETR, etc.;

[0100] Platform environment: NVIDIA RTX 4090 GPU, PyTorch framework, image input size set to 640×640.

[0101] Furthermore, experimental results show that, without increasing model complexity, the method in this embodiment achieves an mAP50 of 70.6% on the test set, a 2.2 percentage point improvement compared to YOLOv11s (68.4%); the accuracy reaches 74.4%, a significant improvement compared to YOLOv11s (67.4%), indicating that this embodiment has a greater advantage in terms of accuracy against pests and diseases; the total number of model parameters is 21.2M, a decrease compared to YOLOv11s (21.7M), maintaining good detection performance while balancing computational and parameter count. Figure 6 As shown, in the early stages of training, the mAP50 curve of the method in this embodiment on the validation set is slightly lower than that of Mamba-YOLO. However, in the later stages, the method in this embodiment outperforms the mainstream object detection methods, indicating that the method in this embodiment also performs well in terms of training convergence and detection stability.

[0102] As an optional implementation, this embodiment also provides a multi-scale attention-based pest and disease target detection system, including:

[0103] The image acquisition module is used to acquire images of the target area to obtain the image to be detected;

[0104] The pest and disease identification module is used to input the image to be detected into a pre-trained pest and disease target detection model for identification, and obtain pest and disease detection results.

[0105] As an optional implementation, this embodiment also provides an electronic device, including: at least one processor, and a memory communicatively connected to the processor; wherein the memory stores instructions executable by the processor, the instructions being executed by the processor to enable the processor to perform the aforementioned multi-scale attention-based pest and disease target detection method.

[0106] As an optional implementation, this embodiment also provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the aforementioned multi-scale attention-based pest and disease target detection method.

[0107] The beneficial effects of this invention are as follows:

[0108] This invention addresses the need for high accuracy in agricultural pest and disease detection by proposing a target detection network architecture that integrates a multi-scale large-kernel convolutional attention mechanism with a channel rearrangement lightweight convolutional structure. The model enhances spatial awareness and channel modeling capabilities during feature extraction by introducing a self-designed MSKA module into the backbone network; simultaneously, it utilizes the GSConv module to reduce the number of model parameters and computational complexity.

[0109] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0110] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A multi-scale attention-based pest and disease target detection method, characterized in that, include: Acquire images of the target region to obtain the image to be detected; The image to be detected is input into a pre-trained pest and disease target detection model for identification, and pest and disease detection results are obtained. The training process of the pest and disease target detection model includes: The C3k2 module in the Backbone section of the original YOLOv11 network is replaced with the C3k2_MSKA module that integrates ECA and MSKA units, and the convolutional module in the original YOLOv11 network is replaced with the GSConv module to obtain the improved YOLOv11 network. The YOLOv11 network is trained using the pre-collected dataset to obtain the trained pest and disease target detection model.

2. The multi-scale attention-based pest and disease target detection method according to claim 1, characterized in that, The improved YOLOv11 network includes: a Backbone, a Neck, and a Head connected in sequence; the Backbone includes: a first CBS module, a second CBS module, a first C3k2_MSKA module, a first GSConv module, a second C3k2_MSKA module, a second GSConv module, a third C3k2_MSKA module, a third GSConv module, a fourth C3k2_MSKA module, an SPPF module, and a C2PSA module connected in sequence.

3. The multi-scale attention-based pest and disease target detection method according to claim 2, characterized in that, The Neck section includes: a first Upsample module, a first Concat module, a first C3k2 module, a second Upsample module, a second Concat module, a second C3k2 module, a fourth GSConv module, a third C3k2 module, a third Concat module, a fourth C3k2 module, a fifth GSConv module, and a fourth Concat module connected in sequence. The second C3k2_MSKA module is connected to the second Concat module; the third C3k2_MSKA module is connected to the first Concat module; and the C2PSA module is connected to the first Upsample module and the fifth GSConv module, respectively.

4. The multi-scale attention-based pest and disease target detection method according to claim 3, characterized in that, The Head section includes: a first Detect module, a second Detect module, and a third Detect module; The first Detect module is connected to the second C3k2 module; the second Detect module is connected to the third Concat module; and the third Detect module is connected to the fourth Concat module.

5. The multi-scale attention-based pest and disease target detection method according to claim 4, characterized in that, The processing procedure of the MSKA unit includes: The original feature map input to the MSKA unit is normalized and subjected to 1×1 convolution to obtain a preprocessed feature map; the expression of the preprocessed feature map is: ;in, The preprocessed feature map; The original feature map; This indicates a channel dimension normalization operation; This represents a 1×1 convolution operation; The preprocessed feature map is divided into a first part and a second part along the channel direction; The first part is subjected to multi-receptive-field convolution processing to obtain the spatial receptive-field response; the expression for the multi-receptive-field convolution processing includes: , , , , ;in, ; , , , These are respectively the first sub-channel block, the second sub-channel block, the third sub-channel block, and the fourth sub-channel block of the first part; , , , They are respectively , , , The result after multi-receptor field convolution processing; Indicates to Perform four-channel partitioning with a convolution kernel of 3; For the spatial receptive field response; This represents channel-by-channel multiplication; Indicates to Perform depthwise convolution with a kernel of 3; This refers to the i-th sub-channel block of the first part; This refers to the first part of the i-th sub-channel block of the first part; Indicates to Perform depthwise convolution with a kernel of k×k; The spatial receptive field response and the second part are multiplied and convolved by 1×1 to obtain a receptive feature map. The receptive feature map and the original feature map are then residually concatenated to obtain an enhanced feature map. The expression for the enhanced feature map is: ;in, The enhanced feature map; For scaling parameters; This is the second part; This indicates element-wise multiplication.

6. The multi-scale attention-based pest and disease target detection method according to claim 5, characterized in that, The processing procedure of the ECA unit includes: Global average pooling is performed on the enhanced feature map to obtain the channel description vector; Using 1×1 convolution and The activation function calculates the channel attention coefficients using the channel description vector. The enhanced feature map and the channel attention coefficients are multiplied channel by channel to obtain the output feature map.

7. A multi-scale attention-based pest and disease target detection system, characterized in that, For implementing the multi-scale attention-based pest and disease target detection method according to claim 1, the system comprises: The image acquisition module is used to acquire images of the target area to obtain the image to be detected; The pest and disease identification module is used to input the image to be detected into a pre-trained pest and disease target detection model for identification, and obtain pest and disease detection results.

8. An electronic device, characterized in that, include: At least one processor, and a memory communicatively connected to the processor; wherein the memory stores instructions executable by the processor, the instructions being executed by the processor to enable the processor to perform a multi-scale attention-based pest and disease target detection method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to execute the multi-scale attention-based pest and disease target detection method according to any one of claims 1 to 6.