Corn disease and insect pest detection method and system and medium

Through single-stage object detection algorithm and feature fusion technology, the problem of poor identification of multiple diseases and pests in the existing technology is solved, and efficient and accurate multi-object recognition and distinction is achieved, reducing equipment requirements and Testing cost.

CN119091113APending Publication Date: 2024-12-06GUANGDONG POLYTECHNIC NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411040418.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing corn pest detection system focuses on a single disease or pest in terms of detection targets, ignoring the interaction and joint impact between disease and pest, resulting in poor generalization capabilities of the model and needs to be used when dealing with multiple diseases and pests. Multiple models, increasing equipment requirements and inspection costs.

Method used

Using a single-stage object detection algorithm, a corn pest detection model including feature extractor and detection head is constructed, and the pre-processed data set is used for training and verification, combined with ABiFPN, MDWR and other structures, the identification and distinction of multiple targets is achieved. And feature fusion is performed through an adaptive weighted bidirectional feature pyramid network to reduce the amount of parameters and calculations.

Benefits of technology

Multi-objective identification and distinction between corn diseases and pests is achieved, equipment requirements and detection costs are reduced, the generated model files are small in size, and can run on microcontrollers with limited storage capacity, improving detection accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091113A_ABST
    Figure CN119091113A_ABST
Patent Text Reader

Abstract

The invention discloses a corn disease and insect pest detection method and system and a medium. The method comprises the steps that corn disease and insect pest pictures are acquired, and a data set is constructed, expanded and labeled; preprocessing the marked data set, wherein the preprocessing comprises fuzzy processing, overturning processing, gray processing, histogram equalization and grid tiling; constructing a corn pest detection model comprising a feature extractor and a detection head based on a single-stage target detection algorithm, and performing training and verification by using the preprocessed data set; and performing corn disease and pest detection by using the trained corn disease and pest detection model. The single-stage target detection algorithm constructed by the invention can realize accurate distinguishing and positioning of corn pests and disease types, and solves the limitation that in the prior art, only single recognition can be carried out on diseases or pests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of target detection, and in particular relates to a method, system and medium for detecting corn pests and diseases. Background Art

[0002] As the foundation for human survival and development, agriculture faces major challenges in plant pest and disease monitoring and prevention. These challenges are directly related to agricultural production efficiency and crop quality. Traditional plant pest and disease monitoring mainly relies on manual observation, which is not only time-consuming and inefficient, but also limited by human resources and expertise, and its accuracy and efficiency cannot meet the high standards of modern agriculture. With the continuous growth of population and the increase in food demand, more efficient and accurate plant pest and disease detection methods are urgently needed.

[0003] In recent years, the rapid progress of deep learning technology has provided new solutions to this challenge. In particular, in the field of computer vision, deep learning has shown its great potential in image recognition and processing. The algorithms related to it are divided into single-stage and two-stage target detection. The single-stage target detection method means that target detection can be achieved by extracting features only once. It is designed to complete the two tasks of object classification and bounding box regression at the same time without the use of pre-generated region proposals. It is famous for its high efficiency and speed.

[0004] Most existing corn pest and disease detection systems focus on a single disease or pest in terms of detection targets. They usually target specific problems of corn and ignore the interaction and joint impact between diseases and pests. In actual use, the generalization ability of the model is poor. In the case of dealing with multiple diseases and pests, multiple models need to be used for joint detection, which places high demands on the equipment and also increases the cost of detection. Summary of the invention

[0005] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and provide a method, system and medium for detecting corn pests and diseases.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] One aspect of the present invention provides a method for detecting corn pests and diseases, comprising the following steps:

[0008] Obtain corn pest and disease images, build a data set, and expand and annotate it;

[0009] Preprocess the labeled data set, including blurring, flipping, grayscale processing, histogram equalization, and grid tiling;

[0010] A corn pest and disease detection model including a feature extractor and a detection head was constructed based on a single-stage target detection algorithm, and the preprocessed dataset was used for training and verification.

[0011] Use the trained corn pest and disease detection model to detect corn pests and diseases.

[0012] As a preferred technical solution, the acquisition of corn pest and disease images and the construction of a data set are specifically as follows:

[0013] Use mobile phones, drones, and fixed cameras to collect corn pest and disease images as a dataset.

[0014] As a preferred technical solution, the data set is expanded and annotated, specifically:

[0015] Use corn pest and disease images from public datasets to expand the dataset;

[0016] The corn pest and disease images in the dataset are labeled. The diseases include wilt, rust, gray spot and stripe, and the pests include fall armyworm, yellow stem borer and yellow stem borer larvae.

[0017] As a preferred technical solution, the preprocessing of the labeled data set is specifically as follows:

[0018] Blur: Add random Gaussian blur;

[0019] Flip: add horizontal or vertical flip;

[0020] Grayscale processing: introduce random grayscale enhancement to convert the image into a single-channel grayscale image;

[0021] Histogram equalization: nonlinear stretching of the image;

[0022] Tiled Grid: Divides the image into tiles.

[0023] As a preferred technical solution, the feature extractor extracts features through a convolution module, a C2f structure, and a multi-scale expansion residual module;

[0024] The convolution module includes two-dimensional convolution, two-dimensional batch normalization, and SiLU function processing, specifically:

[0025] Apply a two-dimensional convolution operation to the input data to extract features;

[0026] Perform batch normalization on the output features of the previous operation to help stabilize and speed up the training process;

[0027] Apply a nonlinear activation function to the batch-normalized feature map obtained in the previous step to introduce nonlinear characteristics;

[0028] The C2f structure processes the input data through two convolution operations and uses segmentation and splicing operations, specifically:

[0029] y0,y1=split(Conv1(x),2);

[0030] y i =Bottleneck i (y i-1 );

[0031] y=concat(y0,y1,…,y n );

[0032] Z = Conv2(y);

[0033] Among them, Conv1() is the first convolution operation, split() is split into two parts along the channel dimension; Bottleneck i () represents the i-th bottleneck block, i = 1, 2, ..., n; concat() concatenates all parts together along the channel dimension; Conv2() is the second convolution operation;

[0034] The multi-scale expansion residual module adopts a two-step residual feature extraction method, which is specifically as follows:

[0035] C1(x)=SiLU(BN(Conv(x)));

[0036] C2(x,d)=D d DConv(C1(x));

[0037] MDWR(x)=PConv(BN(Γ d {C2(x,d)}))+x;

[0038] Where x represents the input feature map, BN() refers to batch normalization, Conv() represents a 3×3 standard convolution, and D d DConv() represents a 3×3 convolution in the depth direction with a dilation rate d, PConv() represents a point-wise convolution, and Γ d {} represents the concatenation operation of all d.

[0039] As a preferred technical solution, the detection head uses an adaptive weighted bidirectional feature pyramid network to process the features P2, P3, P4, and P5 extracted in the previous step and make predictions, specifically:

[0040] Upsample the feature map P5, adaptively fuse the upsampled output feature map with the feature layer P4 obtained in the feature extraction process to obtain a first fused feature layer S1, input the first fused feature layer to the C2f module to obtain a feature layer S2, and output 256 channels;

[0041] The feature map output after upsampling the feature layer S2 is adaptively fused with the feature layer P3 to obtain a second fused feature layer S3, and the second fused feature layer is input into the C2f module to obtain a feature layer S4, and 256 channels are output;

[0042] The feature layer S4 is convolved to obtain a feature layer S5, which is adaptively fused with the feature layer P2 to obtain a third fused feature layer S6, and the third fused feature layer is input into the C2f module to obtain a feature layer S7, which outputs 256 channels;

[0043] The feature layer S8 obtained by performing a convolution operation on the feature layer S7 is adaptively fused with the feature layer P3 to obtain a fourth fused feature layer S9, and the fourth fused feature layer is input into the C2f module to obtain a feature layer S10, and 256 channels are output;

[0044] The feature layer S11 obtained by performing a convolution operation on the feature layer S10 is adaptively fused with the feature layer P4 to obtain a fifth fused feature layer S12, and the fifth fused feature layer is input into the C2f module to obtain a feature layer S13, and 256 channels are output;

[0045] The feature layer S14 obtained by performing a convolution operation on the feature layer S13 is adaptively fused with the feature layer P5 to obtain a sixth fused feature layer S15, and the sixth fused feature layer is input into the C2f module to obtain a feature layer S16, and 256 channels are output;

[0046] The feature layer S16 is input into the detection module, and the detection result is finally output;

[0047] The adaptive fusion uses features from the current layer and the upper or lower layer, obtains spatial adaptive weights by performing convolution, cascading and Softmax operations, and aggregates context information to the output by calculating the weighted sum, as follows:

[0048] x′ i =Conv 1*1 (X i );

[0049] Z=Concat(x′1,x′2,…,x′ n );

[0050] F = Softmax(Conv adaptive(Z));

[0051] F=(F1,F2,…,F n );

[0052]

[0053] where x′ i is the input feature X i The result of convolution, i in the formula is a certain input feature map; Z concatenates the convolved feature maps according to the channel dimension, and n in the formula is the number of input feature maps; Conv adaptive It is a special 1x1 convolutional layer whose input is the concatenation of all processed feature maps and whose output F is the fusion weight; in the last step, F is split into F1, F2, …, F n , and x′ i Perform weighted summation to obtain the output Y.

[0054] As a preferred technical solution, the loss function of the corn pest detection model introduces the penalty of distance attention to reduce geometric factors, which is specifically as follows:

[0055]

[0056] in, For enlarging normal quality anchor boxes W g , H g is the size of the smallest enclosing box, x gt ,y gt is the center coordinate of the target box, x and y are the center coordinates of the bounding box; β is the outlier, r is the gradient gain, δ is the hyperparameter, and when β = δ, δ makes r = 1.

[0057] As a preferred technical solution, in the verification step of the corn pest and disease detection model, the accuracy, recall rate, and mAP are evaluated, and the recognition and differentiation effect of the corn pest and disease detection model on corn pests and diseases is observed.

[0058] Another aspect of the present invention further provides a corn pest detection system, which is applied to the above-mentioned corn pest detection method, and includes a data acquisition module, a data preprocessing module, a corn pest detection model construction and training module, and a corn pest detection module;

[0059] The data acquisition module is used to obtain corn pest and disease pictures, build a data set and expand and annotate it;

[0060] The data preprocessing module is used to preprocess the labeled data set, including blurring, flipping, grayscale processing, histogram equalization and grid tiling;

[0061] The corn pest and disease detection model construction and training module is used to construct a corn pest and disease detection model including a feature extractor and a detection head according to a single-stage target detection algorithm, and use the preprocessed data set for training and verification;

[0062] The corn pest and disease detection module uses the trained corn pest and disease detection model to perform corn pest and disease detection.

[0063] Another aspect of the present invention provides a storage medium storing a program, which, when executed by a processor, implements the above-mentioned corn disease and insect pest detection method.

[0064] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0065] (1) The present invention enhances the model's feature extraction and feature fusion capabilities through structures such as ABiFPN, MDWR, and WIoU, so that the trained model can simultaneously perform multi-target recognition of diseases and pests. By reconstructing the network structure, the number of parameters and the amount of calculation of the original model are reduced, thereby reducing the requirements for equipment and further reducing the cost required for detection.

[0066] (2) The single-stage target detection algorithm constructed by the present invention can accurately distinguish and locate corn pests and disease types, solving the limitation of the prior art that only single identification of diseases or pests can be performed.

[0067] (3) The model file (.pt) generated by the training of the present invention is only 4 megabytes in size and can be run on most single-chip microcomputers with strict restrictions on storage capacity. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 is a flow chart of a corn disease and insect pest detection method according to an embodiment of the present invention;

[0069] Figure 2 It is a schematic diagram of the structure of the overall model of the single-stage target detection algorithm according to an embodiment of the present invention;

[0070] Figure 3 is a schematic diagram of the structure of an Adaptive Fusion module according to an embodiment of the present invention;

[0071] Figure 4 1 is a schematic diagram of the structure of a corn disease and insect pest detection system according to an embodiment of the present invention;

[0072] Figure 5 It is a schematic diagram of the structure of the storage medium of an embodiment of the present invention. DETAILED DESCRIPTION

[0073] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0074] Example

[0075] like Figure 1 As shown, this embodiment provides a method for detecting corn pests and diseases, comprising the following steps:

[0076] Step 1: Obtain corn pest and disease images, build a data set, and expand and annotate them;

[0077] In this embodiment, step 1 specifically includes: using mobile phones, drones, and fixed cameras to collect corn pests and diseases pictures as a data set, and using corn pests and diseases pictures in a public data set to expand the data set;

[0078] The corn pest and disease images in the dataset are labeled to distinguish four diseases in the images: Blight, Corn rust leaf, Corn Gray leaf spot, maize-streak-disease, and three insect pests: fall armyworm larva, yellow stem borer, and yellow stem borer larva.

[0079] Step 2: Preprocess the labeled corn pest and disease images and output them in .txt labeled data set format;

[0080] In this example, step 2 specifically includes: preprocessing using blurring, flipping, grayscale processing, histogram equalization, tiling grid and other methods.

[0081] Blur: Add random Gaussian blur to allow the model to handle different focus conditions of different devices.

[0082] Flip: Add horizontal or vertical flip to make the model insensitive to target orientation.

[0083] Grayscale processing: random grayscale enhancement is introduced to convert the image into a single-channel grayscale image, making the model insensitive to color.

[0084] Histogram equalization: Perform nonlinear stretching on the image to make dark details brighter.

[0085] Tiled Grid: Splits the image into tiles to improve recognition accuracy of small objects.

[0086] Step 3: Use the single-stage target detection algorithm to build a corn pest and disease detection model, and use the preprocessed data set for training;

[0087] The corn pest and disease detection model includes a feature extractor and a detection head;

[0088] The feature extractor extracts features through a convolution module, a C2f structure, and a multi-scale dilated residual module (MDWR module), specifically:

[0089] The convolution module includes two-dimensional convolution, two-dimensional batch normalization, and SiLU function processing, specifically:

[0090] Applies a 2D convolution operation to the input data to extract features.

[0091] Perform batch normalization on the output features of the previous operation to help stabilize and speed up the training process.

[0092] Apply a nonlinear activation function to the batch-normalized feature map obtained in the previous step to introduce nonlinear characteristics;

[0093] The C2f structure processes the input data through two convolution operations and uses segmentation and splicing operations, specifically:

[0094] y0,y1=split(Conv1(x),2)

[0095] y i =Bottleneck i (y i-1 )

[0096] y=concat(y0,y1,…,y n )

[0097] Z = Conv2(y)

[0098] Among them, Conv1() is the first convolution operation, split() is split into two parts along the channel dimension; Bottleneck i () represents the i-th bottleneck block, i = 1, 2, ..., n; concat() concatenates all parts together along the channel dimension; Conv2() is the second convolution operation;

[0099] The multi-scale expansion residual module adopts a two-step residual feature extraction method, which is specifically as follows:

[0100] C1(x)=SiLU(BN(Conv(x)));

[0101] C2(x,d)=D d DConv(c1(x));

[0102] MDWR(x)=PConv(BN(Γ d {C2(x,d)}))+x;

[0103] Where x represents the input feature map, BN() refers to batch normalization, Conv() represents a 3×3 standard convolution, and D d DConv() represents a 3×3 convolution in the depth direction with a dilation rate d, PConv() represents a point-wise convolution, and Γ d {} represents the concatenation operation of all d.

[0104] like Figure 2 As shown in nodes 10 to 28, the detection head uses an adaptive bi-directional feature pyramid network (ABiFPN) to process the features extracted in the previous step and make predictions. The adaptive bi-directional feature pyramid network uses different scale features of the image for target detection and adds a residual link between the P2 and P3 layers ( Figure 2 Between nodes 19 and 20); using the adaptive fusion module (AdaptiveFusion) to perform weight fusion to improve the model feature utilization and efficiency; making full use of the lower layer of the backbone and introducing the low-level feature P2 ( Figure 2 At node 19), the original P6 and P7 layers are deleted to improve small target detection and reduce the number of parameters.

[0105] Furthermore, in this example, the adaptive weighted bidirectional feature pyramid network processes the features P2, P3, P4, and P5 extracted in the previous step and makes predictions, specifically:

[0106] Upsample the feature map P5, adaptively fuse the upsampled output feature map with the feature layer P4 obtained in the feature extraction process to obtain a first fused feature layer S1, input the first fused feature layer to the C2f module to obtain a feature layer S2, and output 256 channels;

[0107] The feature map output after upsampling the feature layer S2 is adaptively fused with the feature layer P3 to obtain a second fused feature layer S3, and the second fused feature layer is input into the C2f module to obtain a feature layer S4, and 256 channels are output;

[0108] The feature layer S4 is convolved to obtain a feature layer S5, which is adaptively fused with the feature layer P2 to obtain a third fused feature layer S6, and the third fused feature layer is input into the C2f module to obtain a feature layer S7, which outputs 256 channels;

[0109] The feature layer S8 obtained by performing a convolution operation on the feature layer S7 is adaptively fused with the feature layer P3 to obtain a fourth fused feature layer S9, and the fourth fused feature layer is input into the C2f module to obtain a feature layer S10, and 256 channels are output;

[0110] The feature layer S11 obtained by performing a convolution operation on the feature layer S10 is adaptively fused with the feature layer P4 to obtain a fifth fused feature layer S12, and the fifth fused feature layer is input into the C2f module to obtain a feature layer S13, and 256 channels are output;

[0111] The feature layer S14 obtained by performing a convolution operation on the feature layer S13 is adaptively fused with the feature layer P5 to obtain a sixth fused feature layer S15, and the sixth fused feature layer is input into the C2f module to obtain a feature layer S16, and 256 channels are output;

[0112] The feature layer S16 is input into the detection module, and the detection result is finally output.

[0113] Furthermore, in this example, Figure 3 As shown in the figure, the Adaptive Fusion module uses features from the current layer and the upper or lower layer (taking node 17 as an example, the features from P3 of the current layer and P4 of the next layer are fused here). The module obtains spatial adaptive weights by performing convolution, cascading and Softmax operations. By calculating the weighted sum, the context information can be aggregated to the output, as follows:

[0114] x′ i =Conv 1*1 (X i );

[0115] Z=Concat(x′1,x′2,…,x′ n );

[0116] F = Softmax(Conv adaptive (Z));

[0117] F=(F1,F2,…,F n );

[0118]

[0119] where x′ i is the input feature Xi The result of convolution, i in the formula is a certain input feature map; Z concatenates the convolved feature maps according to the channel dimension, and n in the formula is the number of input feature maps; Conv adaptive It is a special 1x1 convolutional layer whose input is the concatenation of all processed feature maps and whose output F is the fusion weight; in the last step, F is split into F1, F2, …, F n , and x′ i Perform weighted summation to obtain the output Y.

[0120] Step 4: Use the trained model to test it on the validation set of the corn pest and disease dataset.

[0121] In this example, step 4 is as follows: use the trained best.pt model file to test it on the validation set of the corn pest and disease dataset, evaluate its accuracy, recall, mAP and other parameters, and observe the model's recognition and differentiation effect on corn pests and diseases in the validation set to verify the model's usability and efficiency.

[0122] Furthermore, in this embodiment, the loss function of the corn pest detection model introduces the penalty of distance attention reduction geometric factors, which is specifically as follows:

[0123]

[0124] in, For enlarging normal quality anchor boxes W g , H g is the size of the smallest enclosing box, x gt ,y gt is the center coordinate of the target box, x and y are the center coordinates of the bounding box; β is the outlier, r is the gradient gain, δ is the hyperparameter, and when β = δ, δ makes r = 1.

[0125] like Figure 4 As shown, in another embodiment of the present application, a corn pest and disease detection system is provided, the system comprising a data acquisition module, a data preprocessing module, a corn pest and disease detection model construction and training module, and a corn pest and disease detection module;

[0126] The data acquisition module is used to obtain corn pest and disease pictures, build a data set and expand and annotate it;

[0127] The data preprocessing module is used to preprocess the labeled data set, including blurring, flipping, grayscale processing, histogram equalization and grid tiling;

[0128] The corn pest and disease detection model construction and training module is used to construct a corn pest and disease detection model including a feature extractor and a detection head according to a single-stage target detection algorithm, and use the preprocessed data set for training and verification;

[0129] The corn pest and disease detection module uses the trained corn pest and disease detection model to perform corn pest and disease detection.

[0130] It should be noted here that the system provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure is divided into different functional modules to complete all or part of the functions described above. The system is a corn disease and pest detection method applied to the above embodiment.

[0131] like Figure 5 As shown, in another embodiment of the present application, a storage medium is further provided, storing a program, and when the program is executed by a processor, a method for detecting corn pests and diseases is implemented, specifically:

[0132] Obtain corn pest and disease images, build a data set, and expand and annotate it;

[0133] Preprocess the labeled data set, including blurring, flipping, grayscale processing, histogram equalization, and grid tiling;

[0134] A corn pest and disease detection model including a feature extractor and a detection head was constructed based on a single-stage target detection algorithm, and the preprocessed dataset was used for training and verification.

[0135] Use the trained corn pest and disease detection model to detect corn pests and diseases.

[0136] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0137] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A method for detecting corn pests and diseases, characterized in that: The steps include: Obtain corn pest and disease images, build a data set, and expand and annotate it; Preprocess the labeled data set, including blurring, flipping, grayscale processing, histogram equalization, and grid tiling; A corn pest and disease detection model including a feature extractor and a detection head was constructed based on a single-stage target detection algorithm, and the preprocessed dataset was used for training and verification. Use the trained corn pest and disease detection model to detect corn pests and diseases.

2. A method for detecting corn pests and diseases according to claim 1, characterized in that: The acquisition of corn pest and disease images and the construction of a data set are specifically as follows: Use mobile phones, drones, and fixed cameras to collect corn pest and disease images as a dataset.

3. A method for detecting corn pests and diseases according to claim 1, characterized in that: Expand and annotate the data set, specifically: Use corn pest and disease images from public datasets to expand the dataset; The corn pest and disease images in the dataset are labeled. The diseases include wilt, rust, gray spot and stripe, and the pests include fall armyworm, yellow stem borer and yellow stem borer larvae.

4. A method for detecting corn pests and diseases according to claim 1, characterized in that: The preprocessing of the labeled data set is specifically as follows: Blur: Add random Gaussian blur; Flip: add horizontal or vertical flip; Grayscale processing: introduce random grayscale enhancement to convert the image into a single-channel grayscale image; Histogram equalization: nonlinear stretching of the image; Tiled Grid: Divides the image into tiles.

5. A method for detecting corn pests and diseases according to claim 1, characterized in that: The feature extractor extracts features through a convolution module, a C2f structure, and a multi-scale expansion residual module; The convolution module includes two-dimensional convolution, two-dimensional batch normalization, and SiLU function processing, specifically: Apply a two-dimensional convolution operation to the input data to extract features; Perform batch normalization on the output features of the previous operation to help stabilize and speed up the training process; Apply a nonlinear activation function to the batch-normalized feature map obtained in the previous step to introduce nonlinear characteristics; The C2f structure processes the input data through two convolution operations and uses segmentation and splicing operations, specifically: y0,y1=split(Conv1(x),2) y i =Bottleneck i (y i-1 ) y=concat(y0,y1,…,y n ) Z = Conv2(y) Among them, Conv1() is the first convolution operation, split() is split into two parts along the channel dimension; Bottleneck i () represents the i-th bottleneck block, i = 1, 2, ..., n; concat() concatenates all parts together along the channel dimension; Conv2() is the second convolution operation; The multi-scale expansion residual module adopts a two-step residual feature extraction method, which is specifically as follows: C1(x)=SiLU(BN(Comv(x))); C2(x,d)=D d DConv(C1(x)); MDWR(x)=PConv(BN(Γ d {C2(x,d)}))+x; Where x represents the input feature map, BN() refers to batch normalization, Conv() represents a 3×3 standard convolution, and D d DConv() represents a 3×3 convolution in the depth direction with a dilation rate d, PConv() represents a point-wise convolution, and Γ d {} represents the concatenation operation of all d.

6. A method for detecting corn pests and diseases according to claim 5, characterized in that: The detection head uses an adaptive weighted bidirectional feature pyramid network to process the features P2, P3, P4, and P5 extracted in the previous step and make predictions, specifically: The feature map P5 is upsampled, and the upsampled output feature map is adaptively fused with the feature layer P4 obtained in the feature extraction process to obtain a first fused feature layer S1, and the first fused feature layer is input into the C2f module to obtain a feature layer S2, and 256 channels are output; The feature map output after upsampling the feature layer S2 is adaptively fused with the feature layer P3 to obtain a second fused feature layer S3, and the second fused feature layer is input into the C2f module to obtain a feature layer S4, and 256 channels are output; The feature layer S4 is convolved to obtain a feature layer S5, which is adaptively fused with the feature layer P2 to obtain a third fused feature layer S6, and the third fused feature layer is input into the C2f module to obtain a feature layer S7, which outputs 256 channels; The feature layer S8 obtained by performing a convolution operation on the feature layer S7 is adaptively fused with the feature layer P3 to obtain a fourth fused feature layer S9, and the fourth fused feature layer is input into the C2f module to obtain a feature layer S10, and 256 channels are output; The feature layer S11 obtained by performing a convolution operation on the feature layer S10 is adaptively fused with the feature layer P4 to obtain a fifth fused feature layer S12, and the fifth fused feature layer is input into the C2f module to obtain a feature layer S13, and 256 channels are output; The feature layer S14 obtained by performing a convolution operation on the feature layer S13 is adaptively fused with the feature layer P5 to obtain a sixth fused feature layer S15, and the sixth fused feature layer is input into the C2f module to obtain a feature layer S16, and 256 channels are output; The feature layer S16 is input into the detection module, and the detection result is finally output; The adaptive fusion uses features from the current layer and the upper or lower layer, obtains spatial adaptive weights by performing convolution, cascading and Softmax operations, and aggregates context information to the output by calculating the weighted sum, as follows: x′ i =Conv 1*1 (X i ); Z=Concat(x′1,x′2,…,x′ n ); F=Softmax(Conv adaptive (Z)); F=(F1,F2,…,F n ); where x i ′ is the input feature X i The result of convolution, i in the formula is a certain input feature map; Z concatenates the convolved feature maps according to the channel dimension, and n in the formula is the number of input feature maps; Conv adaptive It is a special 1x1 convolutional layer whose input is the concatenation of all processed feature maps and whose output F is the fusion weight; in the last step, F is split into F1, F2, …, F n , and X i ′ Perform weighted summation to obtain the output Y.

7. A method for detecting corn pests and diseases according to claim 1, characterized in that: The loss function of the corn pest detection model introduces the penalty of distance attention to reduce geometric factors, which is as follows: in, For enlarging normal quality anchor boxes W g , H g is the size of the smallest enclosing box, x gt ,y gt is the center coordinate of the target box, x and y are the center coordinates of the bounding box; β is the outlier, r is the gradient gain, δ is the hyperparameter, and when β = δ, δ makes r = 1.

8. A method for detecting corn pests and diseases according to claim 1, characterized in that: In the verification step of the corn pest and disease detection model, the accuracy, recall rate, and mAP are evaluated, and the recognition and differentiation effect of the corn pest and disease detection model on corn pests and diseases is observed.

9. A corn pest detection system, characterized in that: A corn pest and disease detection method applied to any one of claims 1-8, comprising a data acquisition module, a data preprocessing module, a corn pest and disease detection model construction and training module, and a corn pest and disease detection module; The data acquisition module is used to obtain corn pest and disease pictures, build a data set and expand and annotate it; The data preprocessing module is used to preprocess the labeled data set, including blurring, flipping, grayscale processing, histogram equalization and grid tiling; The corn pest and disease detection model construction and training module is used to construct a corn pest and disease detection model including a feature extractor and a detection head according to a single-stage target detection algorithm, and use the preprocessed data set for training and verification; The corn pest and disease detection module uses the trained corn pest and disease detection model to perform corn pest and disease detection.

10. A storage medium storing a program, characterized in that: When the program is executed by a processor, a corn disease and insect pest detection method according to any one of claims 1 to 8 is implemented.