A crop disease identification method based on adaptive dynamic grouping
Through adaptive dynamic grouping convolution and multi-level channel rearrangement technology, combined with the inverse residual module and the dynamic grouping recognition module, the problem of high computing resource requirements in crop disease recognition is solved, and efficient and accurate disease detection is achieved on mobile devices.
Patent Information
- Application Number
- CN202411940119.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2044-12-26
AI Technical Summary
Although existing deep learning models are highly accurate in crop disease recognition, they have high demand for computing resources and are difficult to deploy efficiently on mobile or embedded devices. How to improve model recognition efficiency while maintaining accuracy is a challenge.
Adaptive dynamic grouping convolution and multi-level channel rearrangement technology are adopted, combined with inverse residual module, dynamic grouping recognition module and classifier, and a lightweight crop disease recognition model is established through jump connection and data enhancement.
It realizes efficient and accurate disease detection on devices with limited computing resources, reduces the computational complexity and parameter amount of neural network models, shortens training time, and enhances feature extraction and generalization capabilities.
Smart Images

Figure CN119785102B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of crop disease identification, and in particular relates to a crop disease identification method based on adaptive dynamic grouping. Background Art
[0002] Crop disease identification is one of the most critical tasks in smart agriculture, playing a vital role in ensuring food security and improving agricultural productivity. Traditional manual identification methods are time-consuming and labor-intensive, and recognition accuracy is often affected by the observer's subjective judgment. Inspired by the superiority of deep neural networks, various deep learning models, such as convolutional neural networks, have been used for crop disease recognition tasks. By capturing both local and global features, these models have achieved remarkable results in recognition accuracy. However, due to the increased network depth and slow inference speed, these models require extensive computing resources and storage space, making them difficult to deploy efficiently on mobile or embedded devices with limited computing power.
[0003] To address this issue, lightweight neural networks have emerged for crop disease recognition tasks on mobile devices. For example, the MobileNet series significantly reduces computational costs by using depthwise separable convolutions. EfficientNet-B0 employs a compound scaling strategy to balance different network depths, widths, and input resolutions, demonstrating strong performance in wheat disease recognition tasks. SqueezeNet significantly reduces model parameters by introducing the Fire module and increases the number of output channels by adjusting the ratio of 1×1 and 3×3 convolutions, enabling recognition of various leaf diseases. However, improving model recognition efficiency while maintaining accuracy remains a challenge. Summary of the Invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a crop disease identification method based on adaptive dynamic grouping, which solves the problem of difficulty in improving the model recognition efficiency while maintaining the accuracy of the crop disease identification model.
[0005] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is: a method for identifying crop diseases based on adaptive dynamic grouping, comprising the following steps:
[0006] S1: Obtain a dataset of crop disease images and perform data augmentation to obtain training set data;
[0007] S2: Establish a crop disease recognition model based on DGC dynamic group convolution and MLCS multi-level channel rearrangement;
[0008] S3: Based on the crop disease recognition model, the training set data is used for training to obtain a trained crop disease recognition model;
[0009] S4: Based on the trained crop disease recognition model, the crop images are processed to complete the crop disease recognition.
[0010] The beneficial effects of the present invention are as follows: by combining dynamic grouping and multi-level channel rearrangement technology, the present invention realizes a lightweight design of the crop disease recognition model, which can effectively reduce the computational complexity and parameter amount of the neural network model, significantly shorten the training time, and at the same time can realize efficient and accurate disease detection on mobile terminals or embedded devices with limited computing resources.
[0011] Furthermore: the crop disease recognition model includes an inverse residual module, a first dynamic group recognition module, a second dynamic group recognition module and a classifier connected in sequence;
[0012] The input training set data of the inverse residual module is fused with the output data of the residual module through a skip connection and used as the input data of the first dynamic group recognition module;
[0013] The input data of the first dynamic group identification module is fused with the output data of the first dynamic group identification module through a jump connection and serves as the input data of the second dynamic group identification module;
[0014] The input data of the second dynamic group identification module is fused with the output data of the second dynamic group identification module through a skip connection and serves as the input data of the classifier.
[0015] The beneficial effect of the above further scheme is that through the cascade and jump connections between modules, the feature extraction and generalization capabilities of the crop disease recognition model can be enhanced, the input features can be fully utilized, and the disease recognition ability can be improved.
[0016] Furthermore: the first dynamic group identification module and the second dynamic group identification module have the same structure, both comprising a dynamic group convolution submodule, a conditional batch normalization submodule and a multi-level channel rearrangement submodule connected in sequence;
[0017] The inverse residual module is used to extract features of the crop disease image to obtain a feature map;
[0018] The dynamic group convolution submodule is used to adaptively adjust the number of groups of the group convolution according to the feature map, and perform a convolution operation to obtain a feature map after dynamic group convolution;
[0019] The conditional batch normalization submodule is used to normalize the feature map after convolution;
[0020] The multi-level channel rearrangement submodule is used to perform multi-level channel rearrangement on the feature map after dynamic group convolution, and output the multi-level channel rearranged feature map;
[0021] The classifier is used to integrate the feature maps of the multi-level channel re-shots input into the classifier and output the crop disease recognition results.
[0022] The beneficial effects of the above further scheme are: through the inverse residual module and dynamic group recognition module, adaptive convolution feature extraction can be achieved, and the conditional batch normalization submodule is used to normalize the data, and the multi-level channel rearrangement submodule is used to optimize feature fusion, so that the crop disease recognition model can perform fast and accurate crop disease recognition.
[0023] Furthermore: the inverse residual module includes a 1x1 first convolutional layer, a 3x3 depthwise separable convolution, and a 1x1 second convolutional layer connected in sequence;
[0024] The 1x1 first convolutional layer is used to expand the number of input channels to a high dimension;
[0025] The 3x3 depthwise separable convolution is used to perform a convolution operation on each channel and extract spatial information;
[0026] The 1x1 second convolutional layer is used to compress the number of channels back to the dimension of the initial input channels.
[0027] The beneficial effects of the above further scheme are: the inverse residual module expands the feature dimension through the 1x1 first convolutional layer, extracts spatial information through the 3x3 depth-separable convolution, and compresses the number of channels through the 1x1 second convolutional layer, which can improve the depth and breadth of feature extraction, reduce the computational cost and the number of parameters, and enhance the generalization ability of the crop disease recognition model.
[0028] Furthermore, the dynamic group convolution submodule adaptively adjusts the number of group convolutions, and the specific expression of the method is as follows:
[0029]
[0030] Among them, X is the input feature map, G(X) is the number of groups of group convolution, G min is the minimum number of groups, G max is the maximum number of groups, α is the adjustment coefficient, σ 2 (X) is the global variance of the input feature map, is the upper limit of the input feature variance, is the lower limit of the input feature variance, C in is the number of input channels, is the global variance of the cth channel, H is the height of the input feature map, W is the width of the input feature map, i and j are the indexes of the input feature map, c is the sequence number of the channel, μ c is the mean of the cth channel.
[0031] The dynamic group convolution submodule performs a dynamic group convolution operation to obtain a feature map after dynamic group convolution, and its specific expression is as follows:
[0032]
[0033] Among them, Y g (i,j,c g ) is the convolution operation of the g-th group convolution, k g (X) is the convolution kernel size of the g-th group convolution, is the number of input channels of the g-th group convolution, m and n are the internal indexes used to traverse the convolution kernel, c′ is the index of the input channel, i+m-1 and j+n-1 are the translation operations of the convolution kernel on the input feature map, K g is the convolution kernel configuration of the g-th group convolution, c g is the index of the output channel of the g-th group convolution, k min is the minimum convolution kernel size, k max is the maximum convolution kernel size, σ 2 (X g ) is the variance of the g-th group convolution input features.
[0034] A further beneficial effect of the above is that by adaptively adjusting the number of groups according to the complexity of different features, redundant calculations can be reduced and the computational efficiency of the crop disease recognition model can be improved.
[0035] Furthermore, the multi-level channel rearrangement is performed on the feature map after the dynamic group convolution. The specific steps of the channel rearrangement are as follows:
[0036] A1: Perform a reshape operation based on the feature map after dynamic group convolution to obtain a matrix;
[0037] A2: Perform a transpose operation on the matrix to obtain a transposed matrix.
[0038] A3: Perform a flattening operation based on the transposed matrix to obtain a feature map with rearranged channels.
[0039] The expression of the feature map of the multi-level channel retake is as follows:
[0040] Y″(i,j,c)=Shuffle(Concat(Y′1(i,j,·),Y′2(i,j,·),…,Y′ G (i,j,·)))
[0041] =Shuffle(Concat(Shuffle(Y1(i,j,·)),…,Shuffle(Y G (i,j,·))))
[0042] Y′ g (i,j,c)=Shuffle(Y g (i,j,c g ))
[0043] Among them, Y″(i,j,c) is the feature map of the multi-level channel retake, Y′ g (i, j, c) is the feature map of the first-level channel rearrangement, Y g (i,j,c g ) is the feature map after dynamic group convolution, Shuffle is the channel rearrangement, and Concat is the connection operation.
[0044] The beneficial effect of the above further scheme is that the present invention can further improve the fusion of cross-group channel information of the crop disease recognition model through multi-level channel rearrangement, thereby enhancing the feature recognition ability of the crop disease recognition model. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a flow chart of a crop disease identification method based on adaptive dynamic grouping;
[0046] Figure 2 Schematic diagram of the process of dynamic group convolution submodule;
[0047] Figure 3 Schematic diagram of the process of channel rearrangement;
[0048] Figure 4 Schematic diagram of the process of the multi-level channel rearrangement submodule;
[0049] Figure 5 This is the overall framework diagram of the crop disease identification model. DETAILED DESCRIPTION
[0050] The specific embodiments of the present invention are described below to facilitate understanding of the present invention by those skilled in the art. However, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations utilizing the concepts of the present invention are protected.
[0051] like Figure 1 As shown, a crop disease identification method based on adaptive dynamic grouping includes the following steps:
[0052] S1: Obtain a dataset of crop disease images and perform data augmentation to obtain training set data;
[0053] S2: Establish a crop disease recognition model based on DGC dynamic group convolution and MLCS multi-level channel rearrangement;
[0054] S3: Based on the crop disease recognition model, the training set data is used for training to obtain a trained crop disease recognition model;
[0055] S4: Based on the trained crop disease recognition model, the crop images are processed to complete the crop disease recognition.
[0056] In S1, a crop disease image dataset is obtained and data enhancement is performed to obtain training set data;
[0057] Data augmentation includes: image cropping, image flipping, image rotation, image displacement, image deformation, changing image brightness, and other image operations; ensuring that no other data is added during the image enhancement process, so that it is more likely to generate image value under limited data conditions, effectively increasing the amount of data and improving the generalization ability of the model; using random cropping to appropriately process the image, and fusing multiple cropped images to improve the experimental prediction effect and solve the distortion problem of the image caused by free scaling.
[0058] In one embodiment of the present invention, a unified hyperparameter setting and data augmentation strategy are used to process a crop disease image dataset, crop the images to a size of 224x224, and perform data augmentation operations such as random horizontal flipping of the images to enhance the perspective robustness of the model; finally, the image pixel values are normalized to have a mean of 0 and a standard deviation of 1.
[0059] In S2, a crop disease recognition model is established based on DGC dynamic group convolution and MLCS multi-level channel rearrangement. The crop disease recognition model includes an inverse residual module, a first dynamic group recognition module, a second dynamic group recognition module, and a classifier connected in sequence.
[0060] Among them, the input training set data of the inverse residual module is fused with the output data of the residual module through a jump connection, and serves as the input data of the first dynamic group identification module; the input data of the first dynamic group identification module is fused with the output data of the first dynamic group identification module through a jump connection, and serves as the input data of the second dynamic group identification module; the input data of the second dynamic group identification module is fused with the output data of the second dynamic group identification module through a jump connection, and serves as the input data of the classifier; through the jump connection, the useful information in the input data of each module can be fully utilized to guide the subsequent modules to perform more complex disease feature recognition, ensuring that the key feature information is effectively captured while the network model is lightweight.
[0061] The first dynamic group identification module and the second dynamic group identification module have the same structure, both including a dynamic group convolution submodule, a conditional batch normalization submodule and a multi-level channel rearrangement submodule connected in sequence;
[0062] The inverse residual module is used to extract the features of crop disease images and obtain feature maps;
[0063] The dynamic group convolution submodule is used to adaptively adjust the number of groups in the group convolution according to the feature map, and perform the convolution operation to obtain the feature map after dynamic group convolution;
[0064] Conditional batch normalization submodule, used to normalize the feature map after convolution;
[0065] The multi-level channel rearrangement submodule is used to perform multi-level channel rearrangement on the feature map after dynamic group convolution and output the multi-level channel rearranged feature map;
[0066] The classifier is used to integrate the feature maps of the multi-level channel re-shots input into the classifier and output the crop disease recognition results.
[0067] In one embodiment of the present invention, the inverse residual module includes a 1x1 first convolutional layer, a 3x3 depthwise separable convolution, a 1x1 second convolutional layer, and a skip connection connected in sequence;
[0068] The first 1x1 convolutional layer is used to expand the number of input channels to a high dimension to obtain richer feature information, and uses ReLu6 as the activation function;
[0069] 3x3 depthwise separable convolution, which is used to perform convolution operations on each channel and extract spatial information while keeping the computational cost low;
[0070] The second 1x1 convolutional layer is used to compress the number of channels back to the dimension of the initial input channel, which can reduce the number of parameters and improve computational efficiency.
[0071] In one embodiment of the present invention, Figure 2 The figure shows a flow chart of the dynamic group convolution submodule. Unlike the traditional fixed number of groups, the dynamic group convolution submodule of the present invention can measure the diversity of the input feature map according to its variance and adaptively adjust the number of groups for group convolution to perform convolution operation.
[0072] Among them, the dynamic group convolution submodule adaptively adjusts the number of group convolutions according to the input feature map. Its specific expression is as follows:
[0073]
[0074] Among them, X is the input feature map, G(X) is the number of groups of group convolution, G min is the minimum number of groups, G max is the maximum number of groups, α is the adjustment coefficient, σ 2 (X) is the global variance of the input feature map, is the upper limit of the input feature variance, is the lower limit of the input feature variance, C in is the number of input channels, is the global variance of the cth channel, H is the height of the input feature map, W is the width of the input feature map, i and j are the indexes of the input feature map, c is the sequence number of the channel, μ c is the mean of the cth channel; when the variance of the input feature map is very small, using the minimum number of groups can reduce the amount of calculation; when the variance of the input feature map is very large, using the maximum number of groups can capture more detailed information in the feature map; the adjustment coefficient α can control the changing speed of the number of groups.
[0075] The dynamic group convolution submodule performs dynamic group convolution operations, and its specific expression is as follows:
[0076]
[0077] Among them, Y g (i,j,c g ) is the convolution operation of the g-th group convolution, k h (X) is the convolution kernel size of the g-th group convolution, is the number of input channels of the g-th group convolution, m and n are the internal indexes used to traverse the convolution kernel, c′ is the index of the input channel, i+m-1 and j+n-1 are the translation operations of the convolution kernel on the input feature map, K g is the convolution kernel configuration of the g-th group convolution, c g is the index of the output channel of the g-th group convolution, k min is the minimum convolution kernel size, k maxis the maximum convolution kernel size, σ 2 (X g ) is the variance of the g-th group convolution input features.
[0078] In one embodiment of the present invention, the conditional batch normalization submodule can normalize the feature map after convolution and introduce a nonlinear activation function ReLU function to increase the nonlinear representation capability of the model.
[0079] In one embodiment of the present invention, a multi-level channel rearrangement submodule is used to perform multi-level channel rearrangement on the feature map after the dynamic convolution operation to increase the fusion capability of feature information. Figure 3 Figure 2 shows the process flow of channel rearrangement. Channel rearrangement is performed after dynamic group convolution. The feature map after dynamic group convolution is reshaped into a matrix with g rows and n columns. The matrix is transposed and flattened to obtain the feature map of channel rearrangement, thus realizing information fusion.
[0080] like Figure 4 The figure shows the flow chart of the multi-level channel rearrangement submodule, and the specific method is as follows:
[0081] Input feature map Divided into G groups, the output feature map is The output feature map is composed of the convolution results of each group. The output feature map Y after each group convolution is g Perform the first-level channel rearrangement on Among them, Y′ g (i,j,c)=Shuffle(Y g (i,j,·)) represents the feature map Y g Information of all channels at position (i, j);
[0082] After the first level of channel reordering, all grouped feature maps Y = Concat(Y′1, Y′2, …, Y′ G ) and then rearrange the channels to obtain in
[0083] Y″(i,j,c)=Shuffle(Concat(Y′1(i,j,·),Y′2(i,j,·),…,Y′ G (i,j,·)))
[0084] =Shuffle(Concat(Shuffle(Y1(i,j,·)),…,Shuffle(Y G (i,j,·))))
[0085] Multi-level channel shuffling can improve feature fusion and enhance performance, but excessive channel reordering may lead to diminishing returns and increase computational complexity. It is possible to evaluate the performance of features after each channel reordering and determine whether to continue channel reordering based on the evaluated performance.
[0086] In S3, the crop disease recognition model is trained using the training set data to obtain a trained crop disease recognition model;
[0087] In one embodiment of the present invention, during the training of a crop disease recognition model, a cross-entropy loss function is used to measure the difference between the output label and the true label; the model parameters are updated using the Adam optimizer, the learning rate is set to 1.0e-3, the batch size during training is set to 16, the number of data loading processes is set to 4, and the total number of training rounds is 100; during the verification and testing phases, the image size is first resized to 256x256, and a 224x224 image area is cropped at the center to ensure that the cropped image contains the core content of the original image.
[0088] In S4, crop images are processed according to the trained crop disease recognition model to complete crop disease recognition. The trained crop disease recognition model can realize real-time and accurate crop disease recognition, save it, and deploy it on low-computing power devices. The stability and response speed of the model on the mobile terminal are verified, so that it can quickly identify crop diseases in actual production scenarios.
[0089] The following describes the process of the crop disease identification model:
[0090] like Figure 5As shown in the figure, it is the overall framework structure diagram of the crop disease recognition model. The input of the crop disease recognition model is the image of the crop disease dataset. First, the image of the crop disease dataset is preliminarily processed by the inverse residual module IRB for feature extraction to generate a feature representation; then, the feature representation passes through the connection operation C and enters the first dynamic group recognition module Stage 1. At the same time, after passing through a convolution layer Conv Layer, it enters the conditional batch normalization module CBN; in the first dynamic group recognition module, it includes a dynamic group convolution submodule DGC and a multi-level channel rearrangement submodule MLCS; the dynamic group convolution submodule DGC adjusts the convolution calculation method of the feature through adaptive dynamic grouping, and the multi-level channel rearrangement submodule MLCS uses channel rearrangement technology to further enhance the feature expression ability; then, the feature representation is fused with the stage output through the skip connection Skip-connection and enters the second dynamic group recognition module Stage 2 and conditional batch normalization module CBN; in the second dynamic grouping recognition module, it includes a dynamic grouping convolution submodule DGC and a multi-level channel rearrangement submodule MLCS, which use different parameters from the first dynamic grouping recognition module, such as the number of groups N1 and N2 respectively; through dynamically adjusted convolution kernel size and channel grouping, the second dynamic grouping recognition module determines whether to perform channel rearrangement again through the features output by the first dynamic grouping recognition module, and extracts and integrates features; finally, the model output is passed through the classifier to generate a prediction result Output, thereby realizing the identification of crop disease categories.
[0091] The beneficial effects of the present invention are as follows: by combining dynamic grouping and multi-level channel rearrangement technology, the present invention realizes a lightweight design of the crop disease recognition model, which can effectively reduce the computational complexity and parameter amount of the neural network model, significantly shorten the training time, and at the same time can realize efficient and accurate disease detection on mobile terminals or embedded devices with limited computing resources.
Claims
1. A crop disease identification method based on adaptive dynamic grouping, characterized in that: The following steps are involved: S1: Obtain a dataset of crop disease images and perform data augmentation to obtain training set data; S2: Establish a crop disease recognition model based on DGC dynamic group convolution and MLCS multi-level channel rearrangement; The crop disease recognition model includes an inverse residual module, a first dynamic group recognition module, a second dynamic group recognition module and a classifier connected in sequence; The input training set data of the inverse residual module is fused with the output data of the residual module through a skip connection and used as the input data of the first dynamic group recognition module; The input data of the first dynamic group identification module is fused with the output data of the first dynamic group identification module through a jump connection and serves as the input data of the second dynamic group identification module; The input data of the second dynamic group identification module is fused with the output data of the second dynamic group identification module through a skip connection and used as the input data of the classifier; The first dynamic group identification module and the second dynamic group identification module have the same structure, both comprising a dynamic group convolution submodule, a conditional batch normalization submodule, and a multi-level channel rearrangement submodule connected in sequence; The inverse residual module is used to extract features of the crop disease image to obtain a feature map; The dynamic group convolution submodule is used to adaptively adjust the number of groups of the group convolution according to the feature map, and perform a convolution operation to obtain a feature map after dynamic group convolution; The conditional batch normalization submodule is used to normalize the feature map after convolution; The multi-level channel rearrangement submodule is used to perform multi-level channel rearrangement on the feature map after dynamic group convolution, and output the multi-level channel rearranged feature map; The classifier is used to integrate the feature maps of the multi-level channel re-shots input to the classifier and output the crop disease recognition results; The dynamic group convolution submodule adaptively adjusts the number of group convolutions, and its specific expression is as follows: in, is the input feature map, is the number of groups for group convolution, is the minimum number of groups, is the maximum number of groups, is the adjustment coefficient, is the global variance of the input feature map, is the upper limit of the input feature variance, is the lower bound of the input feature variance, is the number of input channels, For the The global variance of the channels, is the height of the input feature map, is the width of the input feature map, and are the indices of the input feature maps, is the sequence number of the channel, For the The mean of the channels; The dynamic group convolution submodule performs a dynamic group convolution operation to obtain a feature map after dynamic group convolution, and its specific expression is as follows: in, is the feature map after dynamic group convolution, For the The convolution kernel size of the group convolution, For the The number of input channels for the group convolution, and Both are internal indexes used to traverse the convolution kernel. is the index of the input channel, and is the translation operation of the convolution kernel on the input feature map, For the The convolution kernel configuration of the group convolution, For the The index of the output channel of the group convolution, is the minimum convolution kernel size, is the maximum convolution kernel size, For the The variance of the input features of the group convolution; S3: Based on the crop disease recognition model, the training set data is used for training to obtain a trained crop disease recognition model; S4: Based on the trained crop disease recognition model, the crop images are processed to complete the crop disease recognition.
2. The crop disease identification method based on adaptive dynamic grouping according to claim 1, characterized in that: The inverse residual module includes a 1x1 first convolutional layer, a 3x3 depth-separable convolution, and a 1x1 second convolutional layer connected in sequence; The 1x1 first convolutional layer is used to expand the number of input channels to a high dimension; The 3x3 depthwise separable convolution is used to perform a convolution operation on each channel and extract spatial information; The 1x1 second convolutional layer is used to compress the number of channels back to the dimension of the initial input channels.
3. The crop disease identification method based on adaptive dynamic grouping according to claim 1, characterized in that: The multi-level channel rearrangement is performed on the feature map after dynamic group convolution. The specific steps of channel rearrangement are as follows: A1: Perform a reshape operation based on the feature map after dynamic group convolution to obtain a matrix; A2: Perform a transpose operation on the matrix to obtain a transposed matrix. A3: Perform a flattening operation based on the transposed matrix to obtain a feature map with rearranged channels.
4. The crop disease identification method based on adaptive dynamic grouping according to claim 3, characterized in that: The expression of the feature map of the multi-level channel retake is as follows: in, The feature map re-shot for the multi-level channels, is the feature map of the first-level channel rearrangement, is the feature map after dynamic group convolution, To rearrange the channels, For connection operation.
Citation Information
Patent Citations
Crop disease and pest identification method based on ultra-lightweight efficient convolutional neural network
CN114463651A
Multi-modal remote sensing image classification method based on model compression
CN114972885A