A method and system for detecting crop leaf diseases and pests

By improving the multi-scale parallel quadratic division fusion network and the efficient segmentation and integration downsampling network of the YOLOv12 model, the problems of low efficiency and low accuracy in traditional crop pest and disease detection are solved, and efficient and accurate pest and disease detection is achieved.

CN121438115BActive Publication Date: 2026-03-24NANCHANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Traditional crop pest and disease detection relies on human experience, which is inefficient and makes it difficult to detect diseases and pests in large fields at an early stage. Existing image processing and machine learning methods have low accuracy and poor generalization ability in complex environments.

Method used

The YOLOv12 model is improved by adopting a multi-scale parallel quadratic division fusion network and an efficient segmentation and integration downsampling network. Through multi-scale local modeling and efficient signal feature integration, the performance and efficiency of the pest and disease detection model are improved.

Benefits of technology

While maintaining detection accuracy, storage losses and computational overhead are reduced, thus improving the efficiency and accuracy of detecting crop leaf diseases and pests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121438115B_ABST
    Figure CN121438115B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of crop image processing, and in particular to a crop leaf disease and pest detection method and system, the method comprising: obtaining an initial crop leaf image, improving an existing model and a parallel quadratic division operation to obtain an improved YOLOv12n model, including: a multi-scale parallel quadratic division operation, replacing MD2f modules with C3k2 and A2f modules of a backbone network and a neck network in the existing model, replacing SRCDown network with all down-sampling structure blocks in the existing model, iteratively optimizing and training the improved YOLOv12n model to obtain a crop leaf disease and pest detection model; inputting the initial crop leaf image into the crop leaf disease and pest detection model for detection, and outputting a leaf disease and pest detection result. The present application can reduce storage loss and improve the detection efficiency of crop leaf diseases and pests under the premise of similar accuracy as the YOLOv12n model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of large-scale monitoring and scientific prevention and control of crop diseases, and in particular to a method and system for detecting crop leaf diseases and pests. Background Technology

[0002] Crop diseases and pests are one of the key factors threatening global food security and sustainable agricultural development.

[0003] Traditionally, the monitoring and identification of pests and diseases have relied primarily on agricultural experts or experienced farmers who conduct field inspections and make judgments by visually observing leaf symptoms (such as lesions, mold, discoloration, etc.). This method is highly dependent on personal experience and has inherent drawbacks such as strong subjectivity, low efficiency, high labor costs, and difficulty in achieving early detection and comprehensive coverage of large-scale fields. In addition, when diseases are in their latent or early stages, the symptoms are not obvious and are difficult to detect with the naked eye, often missing the optimal control period, leading to reduced crop yields or even crop failure.

[0004] Existing image processing and machine learning methods for detecting crop diseases and pests still have certain limitations, mainly in that they heavily rely on the researcher's experience and feature selection skills. Manually designed features often have poor generalization ability. When faced with new crop varieties, different lighting conditions, complex field backgrounds (such as soil and weed obstruction), or different stages of disease development, pre-designed features may not work effectively, leading to a significant decrease in recognition accuracy. Summary of the Invention

[0005] The present invention aims to at least improve one of the technical problems existing in the prior art. To this end, the present invention proposes a method and system for detecting diseases and pests on crop leaves.

[0006] The technical solution of the present invention is as follows:

[0007] A method for detecting diseases and pests on crop leaves, comprising:

[0008] S1. Obtain an image dataset of crop leaves, label it, and divide it into a training image set, a validation image set, and a test image set;

[0009] S2, construct a multi-scale parallel quadratic division fusion network and an efficient segmentation-integration downsampling network. Use the multi-scale parallel quadratic division fusion network as the backbone network in the YOLOv12 model, and use the efficient segmentation-integration downsampling network as the downsampling network in the YOLOv12 model. Adjust the YOLOv12 model backbone network to improve performance while reducing the weight of the YOLOv12 model. The multi-scale parallel quadratic division fusion network includes... Pointwise convolution, It can perform separable convolution, batch normalization, SiLU activation function, ReLU activation function, feature segmentation, feature concatenation, and feature interaction multi-scale parallel quadratic division network through multi-scale operations and point-by-point division of feature signals;

[0010] S3, use the image dataset to iteratively train the improved YOLOv12 model to obtain a crop leaf disease and pest detection model;

[0011] S4, input the image dataset into the crop leaf disease and pest detection model for detection, and output the crop leaf disease and pest detection results.

[0012] In one possible technical solution, further, in S2, the processing procedure of the multi-scale parallel quadratic division fusion network includes:

[0013] The input features are processed by a projective convolution module consisting of pointwise convolution with a kernel of 1, batch normalization, and SiLU activation function to obtain feature map X, which projects the number of input feature channels to the number of target output channels N. Then, feature map X is processed by a separating convolution module consisting of pointwise convolution with a kernel of 1, batch normalization, and SiLU activation function to divide feature map X into feature map A and feature map B in the channel dimension. No task processing is performed on feature map A.

[0014] Feature map B is processed by n cascaded multi-scale parallel quadratic division blocks to obtain feature map B4. Finally, feature map B4 is added to residual edge feature map B to obtain the concatenated feature map. The purpose of this residual connection is to alleviate the problem of excessive loss of semantic information.

[0015] The concatenated feature map is processed by a projective convolution module consisting of pointwise convolution with a kernel of 1, batch normalization, and SiLU activation function to obtain feature map Y. Subsequently, feature map Y is processed by an efficient fusion convolution module consisting of a separable convolution with a kernel of 7, batch normalization, and SiLU activation function to obtain feature map Y. .

[0016] In one possible technical solution, further, in S2, feature map B is processed by n cascaded multi-scale parallel quadratic division blocks to obtain feature map B4, specifically including:

[0017] Feature map B is passed through a multi-scale dilation and separation convolutional module to obtain an efficient dynamically adjusted receptive field, and then through an efficient fusion convolutional module to obtain the final feature map. This allows for efficient integration and summarization of biases based on features processed by multi-scale separation convolution modules.

[0018] Feature map The parallel processing proceeds through three branches: the first branch, the second branch, and the third branch. Each branch has a high-dimensional convolutional projection convolution module consisting of a 1-kernel convolution, batch normalization, and SiLU activation function. This high-dimensional convolutional projection convolution module processes the feature map... Initially projected to a high-dimensional feature space to obtain a richer representation of channel space features;

[0019] Specifically, the high-dimensional convolutional projection convolution module increases the number of channel features in the first and third branch feature maps from N to 3N, and increases the number of channel features in the second branch feature map from N to 6N.

[0020] The first and third branches each use an efficient fusion convolutional module to perform spatial weighted fusion of the channel spatial feature representations, and then each applies the Sigmoid function to re-evaluate the global high-value signal features, outputting feature maps. and feature map ;

[0021] The second branch bisects the high-dimensional features along the channel dimension and processes them separately using the ReLU6 activation function to enhance nonlinear expressive power, outputting a feature map. and feature map ;

[0022] feature map As the dividend, the feature map The feature map is obtained by dividing by the divisor. , feature map As the dividend, the feature map The feature map is obtained by dividing by the divisor. The high-dimensional feature space distribution map and the high-dimensional nonlinear space map are divided by the core operator to achieve the purpose of high-dimensional nonlinear space modeling;

[0023] feature map and feature map Feature map B3 is obtained by concatenating along the channel dimension. Feature map B3 has 6N channels. Then, feature map B4 is obtained by performing an efficient projection convolution.

[0024] In one possible technical solution, further, in S2, the efficient segmentation and integration downsampling network processing procedure includes:

[0025] Input feature map A, with shape as First, the feature map A is convolved using a projective convolution with a kernel of 1 to increase the number of channels. Expand to the number of output channels ;

[0026] Then, a spatial segmentation operation is performed to extract spatial features. Figure 4Divide the image into four equal parts to obtain feature maps A1, A2, A3, and A4. The shape of each feature map is as follows: ;

[0027] A subsequent channel reassembly operation concatenates feature maps A1, A2, A3, and A4 along the channel dimension to obtain the final feature map. At this time, the feature map Shape ;

[0028] Finally, the feature map is processed by an efficient weighted convolution consisting of a separable convolution with a kernel of 1, batch normalization, and the SiLU activation function. The number of channels is projected onto the target channel dimension and reweighted. This downsampling module can transfer the rich semantic information of the sample to the dimensional space with the least possible loss and perform spatial scaling at the same time. Finally, the projection convolution module transfers the target dimension signal features back to the recombined features.

[0029] In one possible technical solution, the multi-scale dilated separable convolution module further comprises a separable convolution with a kernel of 3 and a dilation rate of 2, a separable convolution with a kernel of 5 and a dilation rate of 2, a separable convolution with a kernel of 7 and a dilation rate of 2, and a branch that does not undergo any processing.

[0030] In one possible technical solution, the first branch and the third branch are further composed of dual convolution modules. The dual convolution module consists of a high-dimensional convolutional projection convolution module with a kernel of 1, batch normalization and SiLU activation function, an efficient fusion convolution module with a kernel of 1, batch normalization and SiLU activation function, and a Simoid function.

[0031] The second branch consists of a high-dimensional convolutional projection convolution module with a kernel of 1, batch normalization, and SiLU activation function; a fusion convolution module with a kernel of 1; a channel splitting operation; and a parallel ReLU6 activation function module.

[0032] In one possible technical solution, the efficient projective convolution further comprises a separable convolution with a kernel of 7, batch normalization, and a SiLU activation function.

[0033] A crop leaf disease and pest detection system, comprising:

[0034] The image acquisition module is used to acquire a dataset of crop leaf images, which is divided into a training image set, a validation image set, and a test image set.

[0035] The model improvement module is used to construct a multi-scale parallel quadratic division fusion network and an efficient segmentation-integration downsampling network. The multi-scale parallel quadratic division fusion network serves as the backbone network in the YOLOv12 model, and the efficient segmentation-integration downsampling network serves as the downsampling network in the YOLOv12 model. The backbone network of the YOLOv12 model is adjusted to improve performance while reducing the model's weight. The multi-scale parallel quadratic division fusion network includes... Pointwise convolution, It can perform separable convolution, batch normalization, SiLU activation function, ReLU activation function, feature segmentation, feature concatenation, and feature interaction multi-scale parallel quadratic division network through multi-scale operations and point-by-point division of feature signals;

[0036] The model training module is used to iteratively optimize and train the improved YOLOv12n model based on YOLO-ized training image data to obtain a crop leaf disease and pest detection model.

[0037] The target detection module is used to input the crop leaf image dataset into the above-mentioned crop leaf disease and pest detection model for testing, and output the crop leaf disease and pest test results.

[0038] The method for detecting crop leaf diseases and pests according to the present invention has the following advantages compared with the prior art:

[0039] In the multi-scale parallel quadratic division fusion network (MD2f module), an innovative approach of multi-scale local modeling plus parallel quadratic division block is proposed. This aims to further enhance the ability to model context features in high-dimensional nonlinear signal features after adaptively summarizing local semantic information. While increasing attention to high-value local semantic information, the core operator division is used to further weight and assign values ​​to potential high-dimensional nonlinear channel signal features. To avoid NaN (infinity) in the result due to subsequent division operations, the two divisor branches are first processed by the ReLU6 activation function to avoid the case of division by 0.

[0040] By using the spatial-channel-reprojection technique, spatial semantic information is innovatively divided and integrated into the channel dimension. Then, projection convolution is applied to project the channel dimension number to the target channel dimension number, so as to minimize the excessive loss of semantic information during the downsampling process and reduce the computational overhead at the same time.

[0041] Therefore, the improved YOLOv12n model proposed in this application can not only adaptively model contextual features locally, but also perform high-value weighted integration of potential high-value, high-dimensional nonlinear signal features. In the field of large-scale crop monitoring and scientific prevention and control, the crop disease and pest detection model based on the improved YOLOv12n model can reduce storage consumption and improve the detection efficiency of crop leaf diseases and pests while having similar accuracy to the YOLOv12n model.

[0042] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the crop leaf disease and pest detection method described above.

[0043] A computer storage medium storing instructions that, when executed on a computer, cause the computer to perform the crop leaf disease and pest detection method described above.

[0044] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0045] To more clearly illustrate the technical solutions of the embodiments of the present invention, 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.

[0046] Figure 1 This is a flowchart of a method for detecting crop leaf diseases and pests according to an embodiment of the present invention;

[0047] Figure 2 This is a network diagram of a method for detecting crop leaf diseases and pests according to an embodiment of the present invention;

[0048] Figure 3 This is a schematic diagram of the MD2f module of the crop leaf disease and pest detection method according to an embodiment of the present invention;

[0049] Figure 4 This is a schematic diagram of a D2Block network for a crop leaf disease and pest detection method according to an embodiment of the present invention.

[0050] Figure 5 This is a schematic diagram of the MD2WM network for the crop leaf disease and pest detection method according to an embodiment of the present invention;

[0051] Figure 6This is a schematic diagram of the SRCDown network for the crop leaf disease and pest detection method according to an embodiment of the present invention;

[0052] Figure 7 This is a schematic diagram of the crop leaf disease and pest detection system proposed in the second embodiment of this application. Detailed Implementation

[0053] The embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0054] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component.

[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0056] The terms "first," "second," "third," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects and not to describe a particular order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, it may include a series of steps or units, or optionally, steps or units not listed, or other steps or units inherent to these processes, methods, products, or devices.

[0057] The accompanying drawings show only the portions relevant to this application, not all of them. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations may be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process may correspond to a method, function, procedure, subroutine, subprogram, etc.

[0058] The terms “component,” “module,” “system,” “unit,” etc., used in this specification are used to refer to computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution. For example, a unit can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, a thread of execution, a program, and / or distributed between two or more computers. Furthermore, these units can be executed from various computer-readable media on which various data structures are stored. Units can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from a second unit interacting with another unit between a local system, a distributed system, and / or a network; for example, the Internet interacting with other systems via signals).

[0059] Example 1

[0060] See Figure 1 and Figure 2 As shown, this embodiment provides a method for detecting crop leaf diseases and pests, which includes:

[0061] S1: Obtain an image dataset of crop leaves, label it, and divide it into a training image set, a validation image set, and a test image set;

[0062] S2: Construct a multi-scale parallel quadratic division fusion network and an efficient segmentation-integration downsampling network. Use the multi-scale parallel quadratic division fusion network as the backbone network in the YOLOv12 model, and use the efficient segmentation-integration downsampling network as the downsampling network in the YOLOv12 model. Adjust the YOLOv12 model backbone network to improve performance while reducing the weight of the YOLOv12 model. The multi-scale parallel quadratic division fusion network includes... Pointwise convolution, It can perform separable convolution, batch normalization, SiLU activation function, ReLU activation function, feature segmentation, feature concatenation, and feature interaction multi-scale parallel quadratic division network through multi-scale operations and point-by-point division of feature signals;

[0063] S3, use the image dataset to iteratively train the improved YOLOv12 model to obtain a crop leaf disease and pest detection model;

[0064] S4, input the image dataset into the crop leaf disease and pest detection model for detection, and output the crop leaf disease and pest detection results.

[0065] It should be noted that, in this embodiment, S1 also includes format conversion of the partitioned dataset to meet training requirements.

[0066] For example, images are selected from a publicly available crop leaf dataset to ensure diverse leaf samples from pests and diseases. Next, the label files are converted from their original format to YOLO format to suit subsequent training and validation needs. Based on the size of the image set and the target sample ratio of the original dataset, a Stratified K-Fold sampling scheme is used to sample from different category data folders, dividing the image dataset into training, validation, and test image sets to ensure a reasonable target sample ratio among the three.

[0067] To obtain a more accurate and efficient training image set, data cleaning was performed on both the training and validation sets. Images without bounding boxes or with duplicate bounding boxes were removed, and unreasonable bounding boxes were manually relabeled. The test set required no additional processing.

[0068] In optimizing the training image set, various image enhancement techniques were employed to expand the diversity and richness of the data. These techniques include:

[0069] (1) Mosaic enhancement method, which involves randomly selecting four images from the dataset, performing independent data augmentation on each image, and then stitching the four images together into one, thereby effectively increasing the complexity and diversity of the dataset.

[0070] (2) Image blending technique: This technique involves randomly selecting two sample images and blending them in a certain proportion, while the classification results are also distributed in the corresponding proportion, thereby achieving data augmentation.

[0071] (3) Copy and paste strategy. This strategy is another effective data augmentation method. Two images are randomly selected for augmentation, and a target subset of one image is randomly selected and pasted into a random position on the other image.

[0072] (4) Random flipping technique: This technique randomly flips the image horizontally or vertically to simulate image changes at different angles. Random scaling technique: This technique can randomly adjust the size of the image, either shrinking or enlarging it, thereby simulating objects of different scales.

[0073] (5) Random affine transformation technique, which involves a single affine transformation and translation operation, including rotation, translation, scaling and shearing, etc. These operations can simulate a variety of transformations of objects in three-dimensional space, further enhancing the complexity and generalization ability of the dataset.

[0074] It should be noted that in S2, the existing YOLOv12n model is improved to obtain the improved YOLOv12n model, specifically including:

[0075] S21: Replace the C3k2 and A2f structural blocks in the backbone and neck networks of the YOLOv12n model with the MD2f module, including replacing the Bottleneck and ABlock blocks in the C3k2 and A2f blocks with the D2Block network;

[0076] It should be noted that the MD2f module is an improved version of C3K2 in YOLOv12, mainly replacing the Bottleneck block in C3K2 with the D2Block network. Specifically, it replaces the C3K2 and A2f structural blocks in the YOLOv12n model with the MD2f module, including replacing the Bottleneck block in C3K2 and the ABlock block in A2f with the D2Block network. For details, please refer to [link to relevant documentation]. Figure 3 Here is a structural diagram of the MD2f module, and its processing steps specifically include:

[0077] The input features are processed by a projective convolution module consisting of pointwise convolution with a kernel of 1, batch normalization, and SiLU activation function to obtain feature map X, which projects the number of input feature channels to the number of target output channels N. Then, feature map X is processed by a separating convolution module consisting of pointwise convolution with a kernel of 1, batch normalization, and SiLU activation function to divide feature map X into feature map A and feature map B in the channel dimension. No task processing is performed on feature map A.

[0078] Feature map B is processed by n cascaded multi-scale parallel quadratic division blocks to obtain feature map B4. Finally, feature map B4 is added to residual edge feature map B to obtain the concatenated feature map. The purpose of this residual connection is to alleviate the problem of excessive loss of semantic information.

[0079] The concatenated feature map is processed by a projective convolution module consisting of pointwise convolution with a kernel of 1, batch normalization, and SiLU activation function to obtain feature map Y. Subsequently, feature map Y is processed by an efficient fusion convolution module consisting of a separable convolution with a kernel of 7, batch normalization, and SiLU activation function to obtain feature map Y. .

[0080] More specifically, see [link to relevant document] Figure 4 Here is the structure diagram of the D2Block network. In S21, feature map B is processed by n cascaded multi-scale parallel quadratic division blocks to obtain feature map B4, specifically including:

[0081] Feature map B is passed through a multi-scale dilated separable convolutional module to obtain an efficient dynamically adjusted receptive field, and then through an efficient fusion convolutional module consisting of a separable convolution with a kernel of 7, batch normalization, and the SiLU activation function to obtain the feature map. This allows for efficient integration and summarization of biases based on features processed by multi-scale separation convolution modules.

[0082] Feature map The parallel processing proceeds through three branches: the first branch, the second branch, and the third branch. Each branch has a high-dimensional convolutional projection convolution module consisting of a 1-kernel convolution, batch normalization, and SiLU activation function. This high-dimensional convolutional projection convolution module processes the feature map... The initial projection onto a high-dimensional feature space yields richer channel space feature representations. Specifically, the first and third branches consist of dual convolutional modules, each comprising a high-dimensional convolutional projection convolutional module with a kernel of 1, batch normalization, and SiLU activation, an efficient fusion convolutional module with a kernel of 1, batch normalization, and SiLU activation, and a Simoid function. The second branch consists of a high-dimensional convolutional projection convolutional module with a kernel of 1, batch normalization, and SiLU activation, a fusion convolutional module with a kernel of 1, a channel segmentation operation, and a parallel ReLU6 activation function module. The high-dimensional convolutional projection convolutional module increases the number of channel features in the feature maps of the first and third branches from N to 3N, and increases the number of channel features in the feature map of the second branch from N to 6N.

[0083] The first and third branches each use an efficient fusion convolutional module to perform spatial weighted fusion of the channel spatial feature representations, and then each applies the Sigmoid function to re-evaluate the global high-value signal features, outputting feature maps. and feature map ;

[0084] The second branch bisects the high-dimensional features along the channel dimension and processes them separately using the ReLU6 activation function to enhance nonlinear expressive power, outputting a feature map. and feature map ;

[0085] feature map As the dividend, the feature map The feature map is obtained by dividing by the divisor. , feature map As the dividend, the feature map The feature map is obtained by dividing by the divisor. The high-dimensional feature space distribution map and the high-dimensional nonlinear space map are divided by the core operator to achieve the purpose of high-dimensional nonlinear space modeling;

[0086] feature map and feature map Feature map B3 is obtained by concatenating along the channel dimension. Feature map B3 has 6N channels. Then, feature map B4 is obtained by passing it through an efficient projective convolution consisting of a separable convolution with a kernel of 7, batch normalization, and SiLU activation function.

[0087] For details, please refer to Figure 5 The structure diagram of the MD2WM network. In the MD2WM network: Feature map B is first passed in parallel through a separating convolution with a kernel of 3 and an expansion rate of 2, a separating convolution with a kernel of 5 and an expansion rate of 2, a separating convolution with a kernel of 7 and an expansion rate of 2, and a branch that does not perform any processing. This is to achieve the purpose of efficiently and dynamically adaptively adjusting the receptive field.

[0088] S22: Replace all downsampling modules in the YOLOv12 network with the SRCDown network.

[0089] Specifically, the SRCDown network can be found in [reference needed]. Figure 6 Input feature map A, shape is First, the feature map A is convolved using a projective convolution with a kernel of 1 to increase the number of channels. Expand to the number of output channels ;

[0090] Then, a spatial segmentation operation is performed to extract spatial features. Figure 4 Divide the image into four equal parts to obtain feature maps A1, A2, A3, and A4. The shape of each feature map is as follows: ;

[0091] A subsequent channel reassembly operation concatenates feature maps A1, A2, A3, and A4 along the channel dimension to obtain the final feature map. At this time, the feature map Shape ;

[0092] Finally, the feature map is processed by an efficient weighted convolution consisting of a separable convolution with a kernel of 1, batch normalization, and the SiLU activation function. The number of channels is projected onto the target channel dimension and reweighted. This downsampling module can transfer the rich semantic information of the sample to the dimensional space with the least possible loss and perform spatial scaling at the same time. Finally, the projection convolution module transfers the target dimension signal features back to the recombined features.

[0093] It should be noted that this embodiment also includes three decoupled detection heads for different scales, such as... Figure 2As shown, its internal structure follows the design of the YOLOv12 network detection head, containing a classification branch and a regression branch. The regression branch sequentially connects two convolutional modules (each containing a 3-kernel convolution, a SiLU activation function, and a batch normalization) and a regression convolutional module (a 1-kernel pointwise convolution). The classification branch sequentially connects two depthwise separable convolutional modules (each containing a 3-kernel separable convolution, a SiLU activation function, a batch normalization, a 1-kernel pointwise convolution, a SiLU activation function, and a batch normalization) and a classification convolutional module (a 1-kernel pointwise convolution). Feature maps are fed into the regression and classification branches respectively. The regression branch outputs four values ​​for each grid point (center offset x and y, box width w, and height h). The classification branch outputs the probability of each grid point belonging to each category, and finally outputs a set of dense prediction results for samples of a specific size.

[0094] To verify the technical effects of the present invention, the following specific implementation examples are provided in this embodiment:

[0095] The images used in the dataset are all taken from real-world locations and taken from different angles of crop leaves. The dataset contains 14,282 crop leaf images with detailed annotations, covering diseases including leaf blight, gray spot, and rust. This image diversity ensures comprehensive coverage of leaf angles, enhancing the robustness of the model trained on this dataset. Furthermore, image bounding boxes were manually annotated using an image annotation tool (LabelImg) to ensure high accuracy and reliability of image annotations. The crop leaf dataset includes 13,770 training images, 256 validation images, and 256 test images.

[0096] Table 1 shows some configuration information for training the model of this invention.

[0097] Table 1. Configuration Table for Model Training

[0098]

[0099] To ensure fairness, the training strategy used in this invention is consistent with that of YOLOv12n, and the training framework used is Ultralytics. See Table 2 for a detailed comparison of the final results.

[0100] Table 2. Comparison of experimental results

[0101]

[0102] Experimental results show that, compared with the YOLOv12n model, the number of model parameters in this patented model is reduced by 34% and the amount of computation is reduced by 24.8%. Furthermore, it maintains an accuracy advantage in average precision at an intersection-union ratio of 0.75. In summary, this patented model achieves similar accuracy to YOLOv12n while having lower storage and computational costs.

[0103] Example 2

[0104] See Figure 7 As shown, this embodiment provides a crop leaf disease and pest detection system, which includes:

[0105] The image acquisition module is used to acquire a dataset of crop leaf images, which is divided into a training image set, a validation image set, and a test image set. Finally, the overall dataset is converted into a different format.

[0106] The model improvement module is used to construct a multi-scale parallel quadratic division fusion network and an efficient segmentation-integration downsampling network. The multi-scale parallel quadratic division fusion network serves as the backbone network in the YOLOv12 model, and the efficient segmentation-integration downsampling network serves as the downsampling network in the YOLOv12 model. The backbone network of the YOLOv12 model is adjusted to improve performance while reducing the model's weight. The multi-scale parallel quadratic division fusion network includes... Pointwise convolution, It can perform separable convolution, batch normalization, SiLU activation function, ReLU activation function, feature segmentation, feature concatenation, and feature interaction multi-scale parallel quadratic division network through multi-scale operations and point-by-point division of feature signals;

[0107] Specifically, the model improvement module is used to improve the existing YOLOv12n model to obtain an improved YOLOv12n model. The model improvement module includes a first module replacement unit and a second module replacement unit, wherein:

[0108] The first module replacement unit is used to replace the C3k2 and A2f modules in the backbone and neck networks of the YOLOv12n model with the proposed innovative MD2f module to improve its context modeling capabilities.

[0109] The second module replacement unit is used to replace all downsampling modules in the YOLOv12n model with the proposed innovative SRCDown network in order to integrate and transfer rich spatial semantic information to the channel dimension space with the least possible loss.

[0110] The model training module is used to iteratively optimize and train the improved YOLOv12n model based on the YOLO-ized training image data to obtain the improved YOLOv12n model for detecting crop leaf diseases and pests.

[0111] The target detection module is used to input the crop leaf image dataset into the improved YOLOv12n crop leaf disease and pest detection model for testing, and output the crop leaf disease and pest test results.

[0112] The crop leaf disease and pest detection system in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), etc. This application embodiment does not impose specific limitations.

[0113] The crop leaf disease and pest detection system in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.

[0114] This application provides a crop leaf disease and pest detection system that can achieve... Figure 1 The various processes involved in implementing a method for detecting diseases and pests on crop leaves are described in the following embodiments. To avoid repetition, they will not be repeated here.

[0115] The method and system for detecting crop leaf diseases and pests according to the present invention are based on an improved YOLOv12n method. This method is implemented using an improved YOLOv12n model. The improved YOLOv12n model includes: in the MD2f module, an innovative approach of multi-scale local modeling plus parallel quadratic division blocks is proposed. This aims to further enhance the modeling ability of contextual features in high-dimensional nonlinear signal features after adaptively summarizing local semantic information. While increasing the focus on high-value local semantic information, it also applies the core operator division to further weight and assign values ​​to potential high-dimensional nonlinear channel signal features. To avoid NaN (infinity) results from subsequent division operations, the two divisor branches first undergo ReLU6 activation function processing. To avoid division by zero, the improved YOLOv12n model innovatively divides spatial semantic information into channel dimensions using a spatial-channel-reprojection technique. Projective convolution then projects the channel dimensions to the target channel dimensions, minimizing excessive loss of semantic information during downsampling and reducing computational overhead. Therefore, the improved YOLOv12n model proposed in this application not only adaptively models contextual features locally but also performs high-value weighted integration of potentially high-value, high-dimensional nonlinear signal features. In the field of large-scale crop monitoring and scientific prevention, the crop pest and disease detection model based on the improved YOLOv12n model achieves similar accuracy to the YOLOv12n model while reducing storage consumption and improving the detection efficiency of crop leaf pests and diseases.

[0116] Optionally, this application also provides an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the various processes of the above-described embodiment of the method for detecting diseases and pests on crop leaves and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0117] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described method for detecting crop leaf diseases and pests, and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0118] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0119] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention.

[0120] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example.

[0121] Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The reference to "embodiment" herein means that a specific feature, structure, or characteristic described in connection with an embodiment can be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily indicate the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0122] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A method for detecting diseases and pests on crop leaves, characterized in that, include: S1, Obtain an image dataset of crop leaves; S2, construct a multi-scale parallel quadratic division fusion network and an efficient segmentation-integration downsampling network. Use the multi-scale parallel quadratic division fusion network as the backbone network in the YOLOv12 model, and use the efficient segmentation-integration downsampling network as the downsampling network in the YOLOv12 model. The processing steps of the multi-scale parallel quadratic division fusion network include: The input features are processed by a projective convolution module consisting of pointwise convolution with a kernel of 1, batch normalization, and SiLU activation function to obtain feature map X, which projects the number of input feature channels to the number of target output channels N. Then, feature map X is processed by a separating convolution module consisting of pointwise convolution with a kernel of 1, batch normalization, and SiLU activation function to divide feature map X into feature map A and feature map B in the channel dimension. No task processing is performed on feature map A. Feature map B is processed by n cascaded multi-scale parallel quadratic division blocks to obtain feature map B4, which includes: Feature map B is passed through a multi-scale dilation and separation convolutional module to obtain an efficient dynamically adjusted receptive field, and then through an efficient fusion convolutional module to obtain the final feature map. ; Feature map The parallel processing proceeds through three branches: the first branch, the second branch, and the third branch. Each branch has a high-dimensional convolutional projection convolution module consisting of a 1-kernel convolution, batch normalization, and SiLU activation function. This high-dimensional convolutional projection convolution module processes the feature map... Initially projected to a high-dimensional feature space to obtain a richer representation of channel space features; The first and third branches each use an efficient fusion convolutional module to perform spatial weighted fusion of the channel spatial feature representations, and then each applies the Sigmoid function to re-evaluate the global high-value signal features, outputting feature maps. and feature map ; The second branch bisects the high-dimensional features along the channel dimension and processes them separately using the ReLU6 activation function to enhance nonlinear expressive power, outputting a feature map. and feature map ; feature map As the dividend, the feature map The feature map is obtained by dividing by the divisor. , feature map As the dividend, the feature map The feature map is obtained by dividing by the divisor. ; feature map and feature map Feature map B3 is obtained by concatenating along the channel dimension, and then feature map B4 is obtained by passing it through an efficient projection convolution. Finally, the feature map B4 is added to the residual edge feature map B to obtain the concatenated feature map; The concatenated feature map is processed by a projective convolution module consisting of pointwise convolution with a kernel of 1, batch normalization, and SiLU activation function to obtain feature map Y. Subsequently, feature map Y is processed by an efficient fusion convolution module consisting of a separable convolution with a kernel of 7, batch normalization, and SiLU activation function to obtain feature map Y. S3, use the image dataset to iteratively train the improved YOLOv12 model to obtain a crop leaf disease and pest detection model; S4, input the image dataset into the crop leaf disease and pest detection model for detection, and output the crop leaf disease and pest detection results.

2. The method for detecting crop leaf diseases and pests according to claim 1, characterized in that, In S2, the efficient segmentation and integration downsampling network processing procedure includes: Input feature map A, with shape as First, the feature map A is convolved using a projective convolution with a kernel of 1 to increase the number of channels. Expand to the number of output channels ; The spatial feature map is then divided into four equal parts by a spatial partitioning operation, resulting in feature map A1, A2, A3, and A4. Each feature map has the following shape: ; A subsequent channel reassembly operation concatenates feature maps A1, A2, A3, and A4 along the channel dimension to obtain the final feature map. At this time, the feature map Shape ; Finally, the feature map is processed by an efficient weighted convolution consisting of a separable convolution with a kernel of 1, batch normalization, and the SiLU activation function. The number of channels is projected onto the target channel dimension and reweighted. Finally, the projection convolution module performs target dimension signal feature transfer on the recombined features.

3. The method for detecting crop leaf diseases and pests according to claim 1, characterized in that, The multi-scale dilated separable convolution module consists of a separable convolution with a kernel of 3 and a dilation rate of 2, a separable convolution with a kernel of 5 and a dilation rate of 2, a separable convolution with a kernel of 7 and a dilation rate of 2, and a branch that does not undergo any processing.

4. The method for detecting crop leaf diseases and pests according to claim 1, characterized in that, The first branch and the third branch are composed of dual convolution modules. The dual convolution module consists of a high-dimensional convolutional projection convolution module with a kernel of 1, batch normalization and SiLU activation function, an efficient fusion convolution module with a kernel of 1, batch normalization and SiLU activation function, and a Simoid function. The second branch consists of a high-dimensional convolutional projection convolution module with a kernel of 1, batch normalization, and SiLU activation function; a fusion convolution module with a kernel of 1; a channel splitting operation; and a parallel ReLU6 activation function module.

5. The method for detecting crop leaf diseases and pests according to claim 1, characterized in that, The efficient projective convolution consists of a separable convolution with a kernel of 7, batch normalization, and the SiLU activation function.

6. A crop leaf disease and pest detection system, characterized in that, The method for detecting crop leaf diseases and pests as described in any one of claims 1 to 5 includes: The image acquisition module is used to acquire a dataset of crop leaf images; The model improvement module is used to construct a multi-scale parallel quadratic division fusion network and an efficient segmentation-integration downsampling network. The multi-scale parallel quadratic division fusion network serves as the backbone network in the YOLOv12 model, and the efficient segmentation-integration downsampling network serves as the downsampling network in the YOLOv12 model. The backbone network of the YOLOv12 model is adjusted to improve performance while reducing the model's weight. The multi-scale parallel quadratic division fusion network includes... Pointwise convolution It can perform separable convolution, batch normalization, SiLU activation function, ReLU activation function, feature segmentation, feature concatenation, and feature interaction multi-scale parallel quadratic division network through multi-scale operations and point-by-point division of feature signals; The model training module is used to iteratively optimize and train the improved YOLOv12n model based on YOLO-ized training image data to obtain a crop leaf disease and pest detection model. The target detection module is used to input crop leaf image datasets into the crop leaf disease and pest detection model for testing, and output the crop leaf disease and pest test results.

7. A computer device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the crop leaf disease and pest detection method as described in any one of claims 1 to 5.

8. A computer storage medium, characterized in that, The computer storage medium stores instructions that, when executed on the computer, cause the computer to perform the crop leaf disease and pest detection method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • A moving target detection and tracking method for urban traffic

    CN109697420A

  • Nuclear magnetic image brain tumor detection method and system

    CN120070455A