Corn plant disease and insect pest detection system based on computer vision

Through the methods of pyramid convolution and key vector update, the problems of insufficient feature recognition and insufficient samples in computer vision recognition methods in pest and disease detection are solved, and high-accuracy diseased area segmentation and classification detection are achieved.

CN120707971APending Publication Date: 2025-09-26YULIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511122589.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing computer vision recognition methods lack feature recognition capabilities in plant disease and pest detection, resulting in data imbalance. When there are fewer training samples, the recognition model will overfit and lack generalization capabilities, resulting in low detection accuracy.

Method used

A hybrid attention feature-enhanced Unet model based on pyramid convolution and a sample optimization classification method based on key vector update are adopted. Features of different scales are extracted through multi-kernel convolution. Channel grouping and dual-axis attention are combined to suppress irrelevant background, dynamically filter noisy channels, and enhance the ability to segment lesion areas. Through feature-level target sample optimization, the dependence on a large number of training samples is reduced, and the accuracy of classification detection is improved.

Benefits of technology

It achieves precise segmentation and classification detection of diseased areas, improves detection accuracy, enhances the ability to identify lesions under lighting changes and overlapping leaf scenes, and improves fine-grained classification performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120707971A_ABST
    Figure CN120707971A_ABST
Patent Text Reader

Abstract

The invention relates to the field of intelligent agriculture, in particular to a corn plant disease and insect pest detection system based on computer vision, which comprises an image acquisition module, an image segmentation processing module and a disease and insect pest classification detection module, according to the method, a mixed attention feature enhanced Unet model based on pyramid convolution is creatively adopted, the lesion feature detection capability is improved, the lesion recognition capability in a complex scene is improved through biaxial attention, important features of a lesion region are highlighted through self-adaptive attention guide segmentation optimized by dynamic routing, and the lesion recognition efficiency is improved. Accurate lesion region segmentation is realized; according to the sample optimization classification method based on key vector updating, all feature information is fused into a core set through key updating, the characterization capacity is enhanced, category key features and fuzzy irrelevant features are enhanced through diversity selection and fusion of differential samples, and the information utilization rate of small samples is increased; and accurate plant disease and insect pest classification detection is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent agriculture, and in particular relates to a corn plant disease and insect pest detection system based on computer vision. Background Art

[0002] Plant diseases and insect pests are common problems in agricultural production. They can lead to reduced crop yields, deterioration in quality, and even crop death, seriously impacting farmers' economic benefits. Plant disease and insect pest detection is an important topic in the agricultural field, aiming to detect, identify, and control diseases and pests on plants as early as possible, thereby ensuring the healthy growth and yield of crops. However, when used in plant disease and insect pest detection, existing computer vision recognition methods have insufficient feature recognition capabilities, which can lead to data imbalance problems. At the same time, the small number of training samples can also lead to overfitting and insufficient generalization ability of the recognition model, resulting in low detection accuracy. Summary of the Invention

[0003] In view of the above situation, in order to overcome the defects of the prior art and the problem of insufficient feature recognition ability of the existing computer vision recognition methods, the present invention creatively adopts a hybrid attention feature enhancement Unet model based on pyramid convolution, extracts features of different scales through multi-kernel convolution, combines channel grouping to avoid information confusion, improves the lesion feature detection ability, suppresses irrelevant background and dynamically filters noise channels through dual-axis attention (horizontal / vertical), increases the robustness to illumination changes and the lesion recognition ability in overlapping leaf scenes, and segments the lesion area through adaptive attention-guided bilinear interpolation with dynamic routing optimization, highlights the important features of the lesion area, realizes accurate lesion area segmentation, and provides a reference for lesion segmentation. The method provides a basis for high accuracy of class detection; in order to address the problem that existing methods will lead to overfitting and insufficient generalization ability of the recognition model when there are fewer training samples, thereby leading to low detection accuracy, the present invention creatively adopts a sample optimization classification method based on key vector update, which reduces the dependence on a large number of training samples through feature-level target sample optimization, and integrates the feature information of unused samples into the core set through key update to enhance the characterization ability. While streamlining the target samples, it improves the accuracy of classification detection, selects and integrates difference samples through diversity, strengthens the key features of the category, blurs irrelevant features, improves the information utilization rate of small samples, enhances the fine-grained classification performance, and realizes accurate plant disease classification detection.

[0004] The computer vision-based corn plant disease and insect pest detection system provided by the present invention includes an image acquisition module, an image segmentation and processing module, and a disease and insect pest classification and detection module;

[0005] The image acquisition module acquires plant images of corn plants through a camera and performs noise reduction and normalization preprocessing on the images;

[0006] The image segmentation processing module uses a pyramid convolution-based hybrid attention feature enhancement Unet model to segment the pre-processed plant image into lesion areas to obtain a lesion area map;

[0007] The pest classification detection module adopts a sample optimization classification method based on key vector update to classify and detect lesions according to the lesion area map.

[0008] Furthermore, in the image segmentation processing module, a data processing step of a hybrid attention feature enhancement Unet model based on pyramid convolution is as follows:

[0009] Step S1: Encoder encoding, performing four-layer downsampling encoding on the plant image to obtain a feature map;

[0010] Step S2: Hybrid attention feature enhancement based on pyramid convolution and channel space enhancement features, specifically including the following steps:

[0011] Step S21: Channel group convolution, which divides the feature map into n groups of sub-features along the channel, applies depth-wise separable convolution with different convolution kernels to the n groups of sub-features to extract sub-features of different dimensions, and connects the sub-features to obtain multi-scale features;

[0012] Step S22: enhancing the dual-axis spatial features to obtain spatial enhancement features, specifically including the following steps:

[0013] Step S221: Decompose the multi-scale features along the width and height directions to obtain height features and width features;

[0014] Step S222: 1D convolution enhancement, using 1D depth-separable convolution to enhance the height features and width features;

[0015] Step S223: Generate width-wise spatial attention weights and height-wise spatial attention weights: ; ;

[0016] Where, is the Sigmoid function, and are the enhanced height features and width features respectively, and Represent the height-wise spatial attention weight and width-wise spatial attention weight respectively;

[0017] Step S224: Spatial feature enhancement: Use the high-dimensional spatial attention weight and the wide-dimensional spatial attention weight to reconstruct and enhance the multi-scale features to obtain spatial enhancement features: ;

[0018] Where, Represents multi-scale features, is a dimension transformation function that makes the spatial attention weight and the widthwise spatial attention weight become the same dimension as the multi-scale feature. Enhance the characteristics of the space;

[0019] Step S23: Channel enhancement based on the attention mechanism of dynamic routing optimization to obtain channel enhancement features, specifically including the following steps:

[0020] Step S231: Generate query features, key features, and value features by weighting multi-scale features;

[0021] Step S232: local detail enhancement, query features, key features and value features are spliced ​​together, deep convolution fusion is performed, the number of channels is restored and regenerated, to obtain enhanced query features, enhanced key features and enhanced value features;

[0022] Step S233: constructing and sparsely processing the attention score matrix, constructing the attention score matrix based on the enhanced query features, enhanced key features, and enhanced value features, and retaining a sparse matrix of the first k maximum values ​​of each row of the attention score matrix;

[0023] Step S234: weighted aggregation value features, performing Softmax function activation processing on the sparse matrix to obtain attention weights, and using the attention weights to perform weighted aggregation on the enhanced value features to obtain aggregate value features;

[0024] Step S235: Channel attention weight calculation and feature enhancement. Channel attention weight calculation is performed on the aggregated value features through global average pooling, and channel enhancement is performed on the multi-scale features according to the channel attention weight to obtain channel enhanced features: ; ;

[0025] Where, represents the aggregated value feature, represents global average pooling processing, Represents activation function processing, represents the channel attention weight, represents the channel enhancement feature;

[0026] Step S24: feature fusion, fusing the spatial enhancement feature with the channel enhancement feature to obtain the channel spatial enhancement feature;

[0027] Step S3: Segment the image, decode the channel space enhancement features based on upsampling, generate a segmentation mask, segment the plant image according to the segmentation mask, and obtain a lesion area map.

[0028] In the pest classification detection module, a sample optimization classification method based on key vector update specifically includes the following steps:

[0029] Step Q1: obtaining a lesion area map, obtaining lesion area maps of all plant images from the image segmentation processing module;

[0030] Step Q2: Sample division: divide the diseased area maps of all plant images into a support set and a query set;

[0031] Step Q3: Sample optimization, construct a reduced set from the support set, the formula used is as follows: ;

[0032] Where, is the number of lesion categories, lesion class label representing the lesion, A sample representing the lesion area map, Represents the size of the reduced set, represents a streamlined set;

[0033] Step Q4: Key feature extraction: use the visual encoder to extract features from all lesion area samples in the streamlined set to obtain key features;

[0034] Step Q5: Target sample selection: select the target sample corresponding to each query set sample from the reduced set through random selection, similarity selection, and diversity selection strategies. All target samples constitute a new reduced set: ; ;

[0035] Where, represents the key feature, is the feature vector of the query set sample extracted by the visual encoder, represents the sample in the streamlined set, and These are target samples selected based on similarity and diversity respectively;

[0036] Step Q6: Key update and target sample optimization: Divide the query set into batches, associate each batch with the same target sample, and update the key features of the target sample batch by batch using the update rate: ; ;

[0037] Where, Represents a query set, Represents the batches obtained by division, represents the corresponding associated target sample, is the preset update rate, represents the key features of the target sample before updating, Represents the key features of the updated target sample;

[0038] Step Q7: Reasoning and classification: retrieve the n most similar samples in the new streamlined set as individual conditional expectations, and generate label probabilities based on the individual conditional expectations. Different label probabilities represent different types of lesions: ; ;

[0039] Where, Represents similarity calculation, represents the context sequence consisting of the retrieved n individual conditional expectations and all lesion area maps, represents the generated label probability distribution, That is the label probability.

[0040] The beneficial results achieved by the present invention using the above scheme are as follows:

[0041] (1) To address the problem of insufficient feature recognition capabilities of existing computer vision recognition methods, the present invention creatively adopts a hybrid attention feature enhancement Unet model based on pyramid convolution. It extracts features of different scales through multi-kernel convolution, combines channel grouping to avoid information confusion, improves the lesion feature detection capability, suppresses irrelevant background and dynamically filters noise channels through dual-axis attention (horizontal / vertical), increases robustness to illumination changes and lesion recognition capability in overlapping leaf scenes, and segments the lesion area through dynamic routing optimized adaptive attention-guided bilinear interpolation, highlights the important features of the lesion area, achieves accurate lesion area segmentation, and provides a basis for high accuracy of lesion classification detection;

[0042] (2) In order to solve the problem that the existing methods may lead to overfitting and insufficient generalization ability of the recognition model when there are fewer training samples, thereby resulting in low detection accuracy, the present invention creatively adopts a sample optimization classification method based on key vector update. By optimizing the target samples at the feature level, the dependence on a large number of training samples is reduced. The feature information of unused samples is integrated into the core set through key update to enhance the representation ability. While streamlining the target samples, the accuracy of classification detection is improved. By selecting and fusing different samples through diversity, the key features of the category are strengthened, irrelevant features are blurred, the information utilization rate of small samples is improved, the fine-grained classification performance is enhanced, and accurate plant disease classification detection is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a module diagram of the computer vision-based corn plant disease and insect pest detection system provided by the present invention;

[0044] Figure 2 Schematic diagram of the data processing flow of a hybrid attention feature enhanced Unet model based on pyramid convolution.

[0045] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION

[0046] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0047] Example 1, see Figure 1 , the computer vision-based corn plant disease and insect pest detection system provided by the present invention includes an image acquisition module, an image segmentation and processing module, and a disease and insect pest classification and detection module;

[0048] The image acquisition module acquires plant images of corn plants through a camera and performs noise reduction and normalization preprocessing on the images;

[0049] The image segmentation processing module uses a pyramid convolution-based hybrid attention feature enhancement Unet model to segment the pre-processed plant image into lesion areas to obtain a lesion area map;

[0050] The pest classification detection module adopts a sample optimization classification method based on key vector update to classify and detect lesions according to the lesion area map.

[0051] Example 2, see Figure 2 This embodiment is based on the above embodiment. In the image segmentation processing module, the data processing steps of a hybrid attention feature enhancement Unet model based on pyramid convolution are as follows:

[0052] Step S1: Encoder encoding, performing four-layer downsampling encoding on the plant image to obtain a feature map;

[0053] Step S2: Hybrid attention feature enhancement based on pyramid convolution and channel space enhancement features;

[0054] Step S3: Segment the image, decode the channel space enhancement features based on upsampling, generate a segmentation mask, segment the plant image according to the segmentation mask, and obtain a lesion area map.

[0055] Embodiment 3: This embodiment is based on the above embodiment, and step S2 specifically includes the following steps:

[0056] Step S21: Channel group convolution, which divides the feature map into n groups of sub-features along the channel, applies depth-wise separable convolution with different convolution kernels to the n groups of sub-features to extract sub-features of different dimensions, and connects the sub-features to obtain multi-scale features;

[0057] Step S22: enhancing the dual-axis spatial features to obtain spatial enhancement features;

[0058] Step S23: Channel enhancement based on the attention mechanism of dynamic routing optimization to obtain channel enhancement features;

[0059] Step S24: Feature fusion, fusing the spatial enhancement feature with the channel enhancement feature to obtain the channel spatial enhancement feature.

[0060] Embodiment 4: This embodiment is based on the above embodiment, and step S22 specifically includes the following steps:

[0061] Step S221: Decompose the multi-scale features along the width and height directions to obtain height features and width features;

[0062] Step S222: 1D convolution enhancement, using 1D depth-separable convolution to enhance the height features and width features;

[0063] Step S223: Generate width-wise spatial attention weights and height-wise spatial attention weights: ; ;

[0064] Where, is the Sigmoid function, and are the enhanced height features and width features respectively, and Represent the height-wise spatial attention weight and width-wise spatial attention weight respectively;

[0065] Step S224: Spatial feature enhancement: Use the high-dimensional spatial attention weight and the wide-dimensional spatial attention weight to reconstruct and enhance the multi-scale features to obtain spatial enhancement features: ;

[0066] Where, Represents multi-scale features, is a dimension transformation function that makes the spatial attention weight and the widthwise spatial attention weight become the same dimension as the multi-scale feature. Enhance the features of the space.

[0067] Embodiment 5: This embodiment is based on the above embodiment, and step S23 specifically includes the following steps:

[0068] Step S231: Generate query features, key features, and value features by weighting multi-scale features;

[0069] Step S232: local detail enhancement, query features, key features and value features are spliced ​​together, deep convolution fusion is performed, the number of channels is restored and regenerated, to obtain enhanced query features, enhanced key features and enhanced value features;

[0070] Step S233: constructing and sparsely processing the attention score matrix, constructing the attention score matrix based on the enhanced query features, enhanced key features, and enhanced value features, and retaining a sparse matrix of the first k maximum values ​​of each row of the attention score matrix;

[0071] Step S234: weighted aggregation value features, performing Softmax function activation processing on the sparse matrix to obtain attention weights, and using the attention weights to perform weighted aggregation on the enhanced value features to obtain aggregate value features;

[0072] Step S235: Channel attention weight calculation and feature enhancement. Channel attention weight calculation is performed on the aggregated value features through global average pooling, and channel enhancement is performed on the multi-scale features according to the channel attention weight to obtain channel enhanced features: ; ;

[0073] Where, represents the aggregated value feature, represents global average pooling processing, Represents activation function processing, represents the channel attention weight, represents the channel enhancement feature.

[0074] Example 6. This example is based on the above example. In the pest classification detection module, a sample optimization classification method based on key vector update specifically includes the following steps:

[0075] Step Q1: obtaining a lesion area map, obtaining lesion area maps of all plant images from the image segmentation processing module;

[0076] Step Q2: Sample division: divide the diseased area maps of all plant images into a support set and a query set;

[0077] Step Q3: Sample optimization, construct a reduced set from the support set, the formula used is as follows: ;

[0078] Where, is the number of lesion categories, lesion class label representing the lesion, A sample representing the lesion area map, Represents the size of the reduced set, represents a streamlined set;

[0079] Step Q4: Key feature extraction: use the visual encoder to extract features from all lesion area samples in the streamlined set to obtain key features;

[0080] Step Q5: Target sample selection: select the target sample corresponding to each query set sample from the reduced set through random selection, similarity selection, and diversity selection strategies. All target samples constitute a new reduced set: ; ;

[0081] Where, represents the key feature, is the feature vector of the query set sample extracted by the visual encoder, represents the sample in the streamlined set, and These are target samples selected based on similarity and diversity respectively;

[0082] Step Q6: Key update and target sample optimization: Divide the query set into batches, associate each batch with the same target sample, and update the key features of the target sample batch by batch using the update rate: ; ;

[0083] Where, Represents a query set, Represents the batches obtained by division, represents the corresponding associated target sample, is the preset update rate, represents the key features of the target sample before updating, Represents the key features of the updated target sample;

[0084] Step Q7: Reasoning and classification: retrieve the n most similar samples in the new streamlined set as individual conditional expectations, and generate label probabilities based on the individual conditional expectations. Different label probabilities represent different types of lesions: ; ;

[0085] Where, Represents similarity calculation, represents the context sequence consisting of the retrieved n individual conditional expectations and all lesion area maps, represents the generated label probability distribution, That is the label probability.

[0086] Example 7: Based on the above example, this example uses a pyramid convolution-based hybrid attention feature enhanced Unet model for segmenting corn plant lesion areas:

[0087] (1) Corn leaf spot division

[0088] Lesion characteristics: The disease initially appears as small yellow-brown spots, which later expand into long, brown spots (5-15 mm) with blurred edges that can be easily confused with healthy leaf veins.

[0089] Image conditions: Shot under natural light, partially obscured by leaves;

[0090] Implementation process:

[0091] Encoder encoding (step S1)

[0092] Input 512×512 RGB image, downsampled by ResNet18 to obtain 1 / 4~1 / 32 resolution feature map;

[0093] Low-level features (1 / 4) retain the details of the lesion edge, and high-level features (1 / 32) capture the global semantics of the long lesion;

[0094] Hybrid Attention Feature Enhancement (Step S2)

[0095] Channel grouped convolution (S21):

[0096] The channels are divided into 4 groups, and features are extracted using 3×3, 5×5, 7×7, and 9×9 convolution kernels respectively;

[0097] Effect: 3×3 nuclei detect small yellow-brown spots, 9×9 nuclei identify extended lesions;

[0098] Dual-axis spatial attention (S22):

[0099] Decompose features along the long axis (horizontal) and short axis (vertical) of the leaf and calculate attention weights;

[0100] Dynamic Routing Channel Attention (S23):

[0101] Select the top-30% channels to participate in the calculation and suppress the green channel noise of healthy leaves;

[0102] Effect: The channel weight of the diseased area is increased by 2.1 times;

[0103] Decoding and segmentation (S3)

[0104] When upsampling, the jagged edges of the lesions are preserved through dynamic weighting;

[0105] Results: The Dice coefficient reached 94.2%, and the proportion of misidentifying leaf veins as lesions was reduced to 1.8%.

[0106] (2) Corn rust division

[0107] Lesion characteristics: Small orange pustules (1-3 mm in diameter), densely distributed, easily confused with soil particles or insect eggs;

[0108] Image conditions: drone aerial photography, with motion blur and shadows;

[0109] Implementation process:

[0110] Multi-scale feature extraction (S21)

[0111] The 3×3 convolution kernel detects individual pustules, and the 5×5 convolution kernel identifies dense areas;

[0112] Effect: The detection rate of small lesions is 15.7% higher than that of U²-Net;

[0113] Dual-axis attention anti-interference (S22)

[0114] Attention in the vertical direction suppresses ground shadows, while in the horizontal direction it enhances lesions on the leaf plane;

[0115] Effect: The misjudgment rate of shadow areas dropped from 12.4% to 3.5%;

[0116] Dynamic routing optimization (S23)

[0117] The top-k selection of value features retains the orange feature channel (validated in HSV color space);

[0118] Effect: The accuracy of distinguishing soil particles increased to 97.6%;

[0119] Segmentation Output

[0120] Merge high- and low-level features to avoid small pustules being lost in deep-level features;

[0121] Results: MIoU 89.3%, better than DeepLabv3+ (82.1%).

[0122] Example 8: Based on the above example, this example applies a sample optimization classification method based on key vector update to the classification of lesion area maps:

[0123] Classification of Corn Rust

[0124] Dataset: 5000 corn leaf images collected, including two types of pathology:

[0125] Category 1: Corn leaf spot (gray-brown irregular spots)

[0126] Category 2: Rust (orange-yellow powdery spots)

[0127] Data partitioning:

[0128] Support Set: 4,000 images (2,000 images per category)

[0129] Query Set: 1000 images (500 images per category)

[0130] Implementation steps:

[0131] Reduced set initialization (step Q3)

[0132] Set the reduced set size to 400 (200 images per category) and randomly select the initial reduced set;

[0133] Key feature extraction (step Q4)

[0134] CLIP-ViT was used to extract visual features (key features k) of each lesion image with a dimension of 512;

[0135] Target sample selection (step Q5)

[0136] Diversity selection: For each rust image in the query set, the most dissimilar rust samples in the streamlined set are selected for update, emphasizing key features of the lesions (such as color and texture) while ignoring differences in leaf background.

[0137] Key Update (Step Q6)

[0138] Update the reduced set key features in batches (b=200) to make the rust key features cluster more tightly;

[0139] Reasoning and classification (step Q7)

[0140] For all test images, the top-2 similar samples in the core set are retrieved and the lesion category is predicted with an accuracy of 92.3%.

[0141] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.

[0142] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

[0143] The present invention and its embodiments are described above. This description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if a person skilled in the art is inspired by this and, without departing from the purpose of the present invention, designs structures and embodiments similar to this technical solution without inventiveness, they shall fall within the scope of protection of the present invention.

Claims

1. A computer vision-based corn plant disease and insect pest detection system, characterized by: It includes image acquisition module, image segmentation and processing module, and pest and disease classification and detection module; The image acquisition module acquires plant images of corn plants through a camera and performs noise reduction and normalization preprocessing on the images; The image segmentation processing module uses a pyramid convolution-based hybrid attention feature enhancement Unet model to segment the pre-processed plant image into lesion areas to obtain a lesion area map; The pest classification detection module adopts a sample optimization classification method based on key vector update to classify and detect pests according to the diseased area map.

2. The computer vision-based corn plant disease and insect pest detection system according to claim 1, characterized in that: In the image segmentation processing module, the data processing steps of a hybrid attention feature enhancement Unet model based on pyramid convolution are as follows: Step S1: perform four-layer downsampling encoding on the plant image to obtain a feature map; Step S2: Hybrid attention feature enhancement based on pyramid convolution and channel space enhancement features; Step S3: Decode the channel space enhancement features using an upsampling-based decoder to generate a segmentation mask, segment the plant image according to the segmentation mask, and obtain a lesion area map.

3. The computer vision-based corn plant disease and insect pest detection system according to claim 2, characterized in that: Step S2 specifically includes the following steps: Step S21: Divide the feature map into n groups of sub-features along the channel, apply depthwise separable convolution with different convolution kernels to the n groups of sub-features to extract sub-features of different dimensions, and connect the sub-features to obtain multi-scale features; Step S22: enhancing the dual-axis spatial features to obtain spatial enhancement features; Step S23: Channel enhancement based on the attention mechanism of dynamic routing optimization to obtain channel enhancement features; Step S24: Fusing the spatial enhancement feature with the channel enhancement feature to obtain the channel spatial enhancement feature.

4. The computer vision-based corn plant disease and insect pest detection system according to claim 3, characterized in that: In the pest classification detection module, a sample optimization classification method based on key vector update specifically includes the following steps: Step Q1: obtaining diseased area images of all plant images from the image segmentation processing module; Step Q2: Divide the diseased area maps of all plant images into a support set and a query set; Step Q3: Construct a reduced set from the support set; Step Q4: Use the visual encoder to extract features from all lesion area samples in the streamlined set to obtain key features; Step Q5: Select the target sample corresponding to each query set sample from the reduced set through random selection, similarity selection, and diversity selection strategies. All target samples constitute a new reduced set: ; ; Where, represents the key feature, is the feature vector of the query set sample extracted by the visual encoder, represents the sample in the streamlined set, It stands for streamlined set. and These are target samples selected based on similarity and diversity respectively; Step Q6: Divide the query set into batches, each batch is associated with the same target sample, and update the key features of the target sample batch by batch using the update rate: ; ; Where, Represents a query set, Represents the batches obtained by division, represents the corresponding associated target sample, is the preset update rate, represents the key features of the target sample before updating, Represents the key features of the updated target sample; Step Q7 retrieves the n most similar samples in the new streamlined set as individual conditional expectations, and generates label probabilities based on the individual conditional expectations. Different label probabilities represent different types of pests and diseases.