Lightweight wheat disease image recognition method used under complex background of intelligent terminal

By using the knowledge distillation technology of ResNeSt50 and RepGhostNet models in wheat disease recognition, combined with optimizer and activation function, the accuracy problem of wheat disease image recognition in complex background is solved, and efficient and accurate recognition on mobile devices is achieved, and nature is overcome Identify problems of low efficiency and high cost in the environment.

CN119314044AActive Publication Date: 2025-01-14HENAN AGRICULTURAL UNIVERSITY
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411355090.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-14
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

The prior art is difficult to achieve high-precision wheat disease image recognition in complex backgrounds, especially under complex backgrounds and uneven lighting conditions under natural environments, and the effectiveness of lightweight models is limited.

Method used

The ResNeSt50 model is used as the teacher model, combined with the improved RepGhostNet as the student model, a lightweight wheat disease recognition model is constructed through knowledge distillation strategy, and the model training is carried out using the AdamW optimizer and LeakyReLU activation function, combined with the cosine annealing algorithm and the class equilibrium loss strategy. , using masking generation distillation strategy to improve the robustness and accuracy of the model.

Benefits of technology

It realizes high-precision wheat disease recognition in complex contexts, and the model is flexibly deployed on mobile devices, which improves recognition speed and accuracy, overcomes the problems of high deployment costs and low efficiency, and has good comprehensive performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119314044A_ABST
    Figure CN119314044A_ABST
Patent Text Reader

Abstract

The invention relates to a lightweight wheat disease image recognition method for an intelligent terminal under a complex background. Compared with the prior art, the defect that the lightweight design of wheat disease image recognition under the complex background is difficult to realize is overcome. The method comprises the following steps: acquiring a wheat disease image data set; constructing a lightweight wheat disease identification model; training a lightweight wheat disease recognition model; obtaining a to-be-identified wheat disease image; and identifying the wheat disease image. According to the method, high-precision disease degree identification can be realized while flexible deployment is performed on mobile equipment, the model structure is compressed, the model is optimized by using Leaky ReLU and AdamW optimizers, the response speed of the model is improved, the feature extraction result of the high-complexity model is learned by adopting a knowledge distillation mode, the accuracy of the model is improved, and the accuracy of the model is improved. Finally, the wheat disease degree can be efficiently and accurately identified on the mobile equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of wheat disease image recognition, and in particular to a lightweight wheat disease image recognition method for a complex background of an intelligent terminal. Background Art

[0002] With the advancement of artificial intelligence, digital image processing and machine learning methods have been widely used in the classification and severity assessment of crop diseases. Artificial intelligence technology has the characteristics of low operating requirements, cost-effectiveness, high efficiency and strong versatility, which has promoted the research and development of RGB images in the agricultural field.

[0003] In recent years, deep learning, as a new branch of machine learning, has made significant progress in crop disease recognition, target detection, severity assessment, etc. However, in the field of high-precision severity assessment, it is often inclined to use highly complex convolutional network structures for estimation, or use image segmentation technology to extract vegetation and disease areas before estimation to avoid the influence of complex backgrounds. Although these technologies have promoted the development of crop disease severity monitoring to a certain extent, there are still many problems to be overcome in model deployment, which brings huge challenges to its practical application.

[0004] For lightweight models that are easy to deploy, they are often used for disease severity detection under simple backgrounds due to accuracy issues. However, their effectiveness cannot be fully verified in natural environments due to their complex backgrounds and uneven lighting.

[0005] Therefore, how to design a high-precision and lightweight wheat disease image recognition method under complex backgrounds has become a technical problem that needs to be solved urgently. Summary of the invention

[0006] The purpose of the present invention is to solve the defect in the prior art that it is difficult to achieve lightweight design of wheat disease image recognition under complex background, and to provide a lightweight wheat disease image recognition method under complex background for smart terminals to solve the above problem.

[0007] In order to achieve the above object, the technical solution of the present invention is as follows:

[0008] A lightweight wheat disease image recognition method for a complex background of an intelligent terminal comprises the following steps:

[0009] Obtain wheat disease image dataset: Obtain wheat images taken by smart terminals at different times, weather, environments, and growth stages, including images of healthy wheat and wheat with artificial inoculation of diseases, to form a wheat fusarium disease image set, and perform expansion and enhancement preprocessing operations;

[0010] Constructing a lightweight wheat disease recognition model: Using the ResNeSt50 model as the teacher model and the improved RepGhostNet as the student model, a lightweight wheat disease recognition model was constructed;

[0011] Training of lightweight wheat disease recognition model: Based on the preprocessed wheat disease image set, the lightweight wheat disease recognition model is trained using the knowledge distillation strategy;

[0012] Acquisition of wheat disease images to be identified: Acquisition of wheat disease images to be identified and preprocessing;

[0013] Recognition of wheat disease images: The preprocessed wheat disease images to be identified are input into the trained lightweight wheat disease detection model to obtain the wheat disease image recognition results.

[0014] The construction of lightweight wheat disease recognition model includes the following steps:

[0015] The lightweight wheat disease recognition model is set to include a teacher model and a student model. The teacher model uses the ResNeSt50 model, and the student model uses RepGhostNet as the framework. A feature map output is added at the end of the feature extraction layer of the teacher model and the student model, and the feature maps of RepGhostNet and ResNeSt50 are output respectively. The output of ResNeSt50 is used as a reference for the student model learning during the distillation process, and the output of RepGhostNet is used to generate the feature map of the teacher model and calculate the distillation loss.

[0016] Set up the teacher model;

[0017] The teacher model is used to guide the training of the student model. ResNeSt50 is composed of a stacked ResNeSt Block structure. The input feature map is divided into K main groups, and then each main group is divided into R sub-groups. After convolution processing, the sub-groups are fed into the Split-Attention Block calculation unit for weighted operation, and finally concatenated through Concatenate to merge all the main groups.

[0018] Set up the student model;

[0019] RepGhostNet is set up to consist of multiple RepGhost Bottlenecks, divided into 5 stages, with a dense convolution layer using 16 channels to process the input data and a normal 1×1 convolution and average pooling stack to predict the final output;

[0020] RepGhost Bottleneck is divided into 5 groups. Except for the last Bottleneck, the last Bottleneck of each group has stride=2.

[0021] Remove the RepGhost-Bottleneck module from the first layer of stage2 of RepGhosNet, and remove the RepGhost-Bottleneck modules from the second and third layers of stage4 of RepGhosNet;

[0022] The LeakyReLU function is used as the activation function f(x), and its expression is as follows:

[0023]

[0024] Among them, x is the input feature data, and α is a positive number close to 0.

[0025] The training of the lightweight wheat disease recognition model includes the following steps:

[0026] Setting the optimizer:

[0027] AdamW is used as the optimizer of the lightweight wheat disease recognition model, and the cosine annealing algorithm is used to adjust the learning rate and class balance loss strategy to balance the impact caused by the uneven number of images with different disease degrees. The cosine annealing algorithm is used to calculate the loss value of the training process to optimize the model.

[0028] AdamW is set to accelerate gradient descent through two momentum parameters β1 and β2. In terms of weight decay, AdamW adds an additional L2 regularization to separate weight decay from gradient update, so that weight decay is only used for weight parameters, not directly for gradient update, to avoid the influence of bias parameters. The specific calculation method is as follows:

[0029] m t =β1m t-1 +(1-β1)g t

[0030]

[0031] Where t is the number of training steps, β1 and β2 are manually adjusted momentum parameters, g represents the gradient, m and v are the first-order and second-order momentum estimates, respectively, and m t and v t Represents the results of two momentum deviation corrections, θ represents the parameter, γ is the learning rate, λ is the weight decay coefficient, and ∈ is a constant close to 0 to avoid the denominator being 0;

[0032] Train the teacher model:

[0033] During the teacher model training process, the preprocessed disease image size was adjusted to 244×244×3, the initial learning rate was set to 0.001, the momentum was 0.937, and the weight decay was 0.0005. The training process was carried out for a total of 100 iterations. The warm-up phase was enabled during the training process, and the minimum warm-up learning rate was 1×10 -6 , the warm-up rate is 5%, and the specific training process is as follows:

[0034] The input layer reads the image data, converts it into a feature array structure for initialization, and then submits the data to the feature extraction layer;

[0035] The feature extraction layer extracts high-dimensional disease features by performing a large number of convolution operations on the feature data. This layer is composed of multiple ResNeSt Block stacks. After the feature image is input into the ResNeSt Block, the feature grouping is first performed. The input feature image is first divided into K main groups, and then each main group is further divided into R sub-groups; secondly, for each sub-group, feature extraction is performed through an operation unit composed of multiple convolution operations to obtain high-dimensional features; then, the SplitAttention module is used to perform weighted operations on the R feature sub-groups to summarize the feature data, and then the Concatenate operation is used to summarize the K main groups; finally, the SE attention module is used to perform weighted operations on each feature channel of the feature data to obtain the output feature map T;

[0036] The output layer performs downsampling operation on the obtained high-dimensional disease feature image through simple convolution operation to obtain the classification result, and calculates the classification loss L through the classification result;

[0037] Finally, the ResNeSt50 model is updated by the classification loss L, and then the next batch of training is carried out to obtain a teacher model that can accurately identify the degree of wheat disease;

[0038] Train the student model:

[0039] The trained teacher model is activated in prediction mode to extract features from the input preprocessed wheat disease image, and the feature map T obtained by the feature extraction layer is output as the target image of the distillation process;

[0040] The student model is enabled in training mode to process the input image and output the feature map S obtained by the feature extraction layer and the disease severity classification result of the student model;

[0041] Calculate the classification loss L of the model based on the classification results of the student model original ;

[0042] According to the feature maps T and S of the teacher model and the student model, the distillation loss L of the masked generative distillation is obtained dis ;

[0043] The distillation loss L generated by masking distillation dis and classification loss L original , perform feature distillation to calculate the total loss L of model training all ;

[0044] Characteristic distillation process:

[0045] Use T l ∈R C×H×W and S l ∈R C×H×W represents the lth wheat disease characteristic map of the teacher and the student, where l=1,..,L,

[0046] Set the lth random mask to cover the lth feature of the student, which is expressed as:

[0047]

[0048] Generate Student Wheat Disease Characteristic Map Mask

[0049] Among them, l represents the lth wheat disease feature map, i and j represent the length and width of each feature channel of the teacher feature map, R i,j is a random number between 0 and 1 that follows a uniform distribution, λ is a hyperparameter representing the mask ratio, and C, H, and W represent the shape of the feature map;

[0050] Use the lth wheat disease feature map mask to cover the lth student's wheat disease feature map, and use the left pixels to generate the teacher's wheat disease feature map:

[0051]

[0052] Generate the teacher model feature map through the student feature map, and use a small number of disease features extracted by the student model to generate the results of the teacher model;

[0053] Specifically, a 1×1 convolution adaptation layer f is used align Adapt the student features S to the feature dimensions of the teacher features T; mask the adapted student features in a point-by-point manner to obtain F; and use the convolution structure to It consists of two convolutional layers W l1 、w l2 and a projection layer with an activation layer ReLU to generate the teacher feature map;

[0054] The overall distillation loss of the masked generation distillation method is calculated as follows:

[0055]

[0056] The distillation loss L is calculated by point-by-point subtraction. dis , where L represents the total number of feature images used for distillation, C, H, W represent the shape of the feature map, S and T represent the features of the student and teacher, respectively. represents the projection layer, L dis represents the distillation loss of training, Mask the wheat disease characteristics map for students;

[0057] The total loss is calculated as follows:

[0058] L all =L original +α·L dis

[0059] The total loss L of the training process is calculated by weighted operation all , where L original is the original loss of the model in all tasks, and α is the hyperparameter for balancing the loss value;

[0060] Then use the total loss L all To update the student model RepGhostNet, use the updated model for experimental training, and obtain the disease severity of wheat in wheat disease images.

[0061] Beneficial Effects

[0062] The lightweight wheat disease image recognition method for the complex background of the intelligent terminal of the present invention can be flexibly deployed on the mobile device and realize high-precision disease degree recognition while comparing with the prior art. The model structure is compressed and the model is optimized by using the LeakyReLU and AdamW optimizers, thereby improving the response speed of the model. At the same time, the feature extraction results of the high-complexity model are learned by the knowledge distillation method, thereby improving the accuracy and robustness of the model, and finally realizing efficient and accurate recognition of the degree of wheat disease on the mobile device.

[0063] The present invention applies deep learning methods to wheat disease grade detection under natural conditions, adopts a lightweight deep learning method, and uses mobile devices to perform detection under different natural environmental conditions, effectively overcoming the problems of low efficiency and high experience requirements of manual detection, as well as the problem of high deployment costs.

[0064] The present invention uses the RepGhostNet model as the basic model for improvement. Among many lightweight convolutional structures, this model has both good classification effect and high classification efficiency, and has the best overall performance. At the same time, by simplifying the model structure and using the LeakyReLU and AdamW optimizer methods to improve the basic model to obtain SlimRepGhostNet, the overall performance of the model is further improved.

[0065] The present invention adopts a masked generation distillation strategy to train the improved SlimRepGhostNet. By masking the random pixels of the student features and forcing it to generate the complete features of the teacher model through a simple block, the lightweight model training result can obtain an accuracy comparable to that of a high-complexity model, enabling the model to adapt to image detection tasks in complex natural environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 is a method sequence diagram of the present invention;

[0067] Figure 2 To simplify the model structure diagram of the improved SlimRepGhostNet;

[0068] Figure 3 Process diagram of the distillation strategy for masking generation;

[0069] Figure 4 A comparison chart of the classification capabilities of the model before and after improvement is shown. DETAILED DESCRIPTION

[0070] In order to have a further understanding and recognition of the structural features and the effects achieved by the present invention, a preferred embodiment and accompanying drawings are used for detailed description as follows:

[0071] like Figure 1 As shown, the lightweight wheat disease image recognition method for a complex background of an intelligent terminal according to the present invention comprises the following steps:

[0072] The first step is to obtain a wheat disease image dataset: obtain wheat images taken by smart terminals at different times, weather, environments, and growth stages, including images of healthy wheat and wheat artificially inoculated with diseases, to form a wheat fusarium disease image set. For the collected wheat images, the disease levels are labeled according to the standards of the General Administration of Quality Supervision, Inspection and Quarantine. The labeled data are enhanced using a combination enhancement method to perform non-repetitive combination operations on the images to expand the dataset in order to simulate complex images in a real agricultural environment. The enhanced wheat images are divided into a training set, a validation set, and a test set in a ratio of 6:2:2, which are used for model training, model generalization evaluation, and model performance evaluation, respectively.

[0073] The second step is to build a lightweight wheat disease recognition model: use the ResNeSt50 model as the teacher model and the improved RepGhostNet as the student model to build a lightweight wheat disease recognition model.

[0074] The Split-Attention module in ResNeSt50 integrates the cross-channel attention mechanism while keeping the ResNet architecture simple without introducing additional computational costs. This approach not only makes ResNeSt50 highly accurate, but also very suitable as a teacher model in masked generative distillation.

[0075] The RepGhost module in the RepGhostNet model achieves efficient hardware utilization through re-parameterization technology, avoiding the additional computing cost brought by the traditional concat operation, thereby improving computing efficiency and achieving fewer parameters and shorter delays on mobile devices while maintaining high accuracy. It is very suitable for deployment on mobile smart devices with limited hardware resources and is very suitable as a student model.

[0076] (1) The lightweight wheat disease recognition model is set up to include a teacher model and a student model. The teacher model adopts the ResNeSt50 model and the student model adopts the RepGhostNet framework. A feature map output is added at the end of the feature extraction layer of the teacher model and the student model, and the feature maps of ResNeSt50 and RepGhostNet are output respectively. The output of ResNeSt50 is used as a reference for the student model learning during the distillation process, and the output of RepGhostNet is used to generate the feature map of the teacher model and calculate the distillation loss.

[0077] (2) Setting the teacher model;

[0078] The teacher model is used to guide the training of the student model. ResNeSt50 is composed of a stacked ResNeSt Block structure. The input feature map is divided into K main groups, and then each main group is divided into R sub-groups. After convolution processing, the sub-groups are fed into the Split-Attention Block calculation unit for weighted calculation, and finally concatenated through Concatenate to merge all the main groups.

[0079] (3) Setting up the student model;

[0080] RepGhostNet is set up to consist of multiple RepGhost Bottlenecks, divided into 5 stages, with a dense convolution layer using 16 channels to process the input data and a normal 1×1 convolution and average pooling stack to predict the final output;

[0081] RepGhost Bottleneck is divided into 5 groups. Except for the last Bottleneck, the last Bottleneck of each group has stride=2.

[0082] Remove the RepGhost-Bottleneck module from the first layer of stage2 of RepGhosNet, and remove the RepGhost-Bottleneck modules from the second and third layers of stage4 of RepGhosNet; Figure 2 Shows the structure of the simplified SlimRepGhostNet model.

[0083] The LeakyReLU function is used as the activation function f(x), and its expression is as follows:

[0084]

[0085] Among them, x is the input feature data, and α is a positive number close to 0.

[0086] The third step is to train the lightweight wheat disease recognition model: Based on the preprocessed wheat disease image set, the knowledge distillation strategy is used to train the lightweight wheat disease recognition model. The traditional deep learning model has high accuracy but large model parameters and high complexity. Although the lightweight model has a fast recognition speed, the model accuracy is generally not high. Therefore, the knowledge distillation strategy is used to let the lightweight model learn the features learned by the high-precision model, thereby improving the accuracy of the model without significantly affecting the model recognition speed. The masked generation distillation strategy used first randomly masks the student's feature pixels, and then uses the masked features through a simple module to generate the teacher's complete features, thereby improving the student's representation ability. Since random pixels are used in each iteration, all pixels will be used during the training process, which means that the features learned by the student model RepGhostNet will be more robust and its representation ability will be improved, thereby improving the model's recognition ability. Figure 3 The process of generating distillation for masking.

[0087] (1) Set the optimizer:

[0088] AdamW is used as the optimizer of the lightweight wheat disease recognition model, and the cosine annealing algorithm is used to adjust the learning rate and class balance loss strategy to balance the impact caused by the uneven number of images with different disease degrees. The cosine annealing algorithm is used to calculate the loss value of the training process to optimize the model.

[0089] AdamW is set to accelerate gradient descent through two momentum parameters β1 and β2. In terms of weight decay, AdamW adds an additional L2 regularization to separate weight decay from gradient update, so that weight decay is only used for weight parameters, not directly for gradient update, to avoid the influence of bias parameters. The specific calculation method is as follows:

[0090] m t =β1m t-1 +(1-β1)g t

[0091]

[0092] Where t is the number of training steps, β1 and β2 are manually adjusted momentum parameters, g represents the gradient, m and v are the first-order and second-order momentum estimates, respectively, and m t and v t Represents the result of two momentum deviation corrections, θ represents the parameter, γ is the learning rate, λ is the weight decay coefficient, and ∈ is a constant close to 0 to avoid the denominator being 0.

[0093] (2) Training the teacher model:

[0094] During the teacher model training process, the preprocessed disease image size was adjusted to 244×244×3, the initial learning rate was set to 0.001, the momentum was 0.937, and the weight decay was 0.0005. The training process was carried out for a total of 100 iterations. The warm-up phase was enabled during the training process, and the minimum warm-up learning rate was 1×10 -6 , the warm-up rate is 5%, and the specific training process is as follows:

[0095] The input layer reads the image data, converts it into a feature array structure for initialization, and then submits the data to the feature extraction layer;

[0096] The feature extraction layer extracts high-dimensional disease features by performing a large number of convolution operations on the feature data. This layer is composed of multiple ResNeSt Block stacks. After the feature image is input into the ResNeSt Block, the feature grouping is first performed. The input feature image is first divided into K main groups, and then each main group is further divided into R sub-groups; secondly, for each sub-group, feature extraction is performed through an operation unit composed of multiple convolution operations to obtain high-dimensional features; then, the SplitAttention module is used to perform weighted operations on the R feature sub-groups to summarize the feature data, and then the Concatenate operation is used to summarize the K main groups; finally, the SE attention module is used to perform weighted operations on each feature channel of the feature data to obtain the output feature map T;

[0097] The output layer performs downsampling operation on the obtained high-dimensional disease feature image through simple convolution operation to obtain the classification result, and calculates the classification loss L through the classification result;

[0098] Finally, the ResNeSt50 model is updated by the classification loss L, and then the next batch of training is carried out to obtain a teacher model that can identify the degree of wheat disease with high accuracy.

[0099] (3) Training the student model:

[0100] The trained teacher model is activated in prediction mode to extract features from the input preprocessed wheat disease image, and the feature map T obtained by the feature extraction layer is output as the target image of the distillation process;

[0101] The student model is enabled in training mode to process the input image and output the feature map S obtained by the feature extraction layer and the disease severity classification result of the model;

[0102] Calculate the classification loss L of the model based on the classification results of the student model original ;

[0103] According to the feature maps T and S of the teacher model and the student model, the distillation loss L of the masked generative distillation is obtained dis ;

[0104] The distillation loss L generated by masking distillation dis and classification loss L original , perform feature distillation to calculate the total loss L of model training all .

[0105] (4) Characteristic distillation process:

[0106] A1) Use T l ∈R C×H×W and S l ∈R C×H×W represents the lth wheat disease characteristic map of the teacher and the student, where l=1,..,L,

[0107] Set the lth random mask to cover the lth feature of the student, which is expressed as:

[0108]

[0109] Generate Student Wheat Disease Characteristic Map Mask

[0110] Among them, l represents the lth wheat disease feature map, i and j represent the length and width of each feature channel of the teacher feature map, R i,jis a random number between 0 and 1 that follows a uniform distribution, λ is a hyperparameter representing the mask ratio, and C, H, and W represent the shape of the feature map;

[0111] A2) Use the lth wheat disease feature map mask to cover the lth student's wheat disease feature map, and use the left pixels to generate the teacher's wheat disease feature map:

[0112]

[0113] Generate the teacher model feature map through the student feature map, and use a small number of disease features extracted by the student model to generate the results of the teacher model;

[0114] Specifically, a 1×1 convolution adaptation layer f is used align Adapt the student features S to the feature dimensions of the teacher features T; mask the adapted student features in a point-by-point manner to obtain F; and use the convolution structure to It consists of two convolutional layers W l1 , W l2 and a projection layer with an activation layer ReLU to generate the teacher feature map;

[0115] A3) The overall distillation loss of the masked generation distillation method is calculated as follows:

[0116]

[0117] The distillation loss L is calculated by point-by-point subtraction. dis , where L represents the total number of feature images used for distillation, C, H, W represent the shape of the feature map, S and T represent the features of the student and teacher, respectively. represents the projection layer, L dis represents the distillation loss of training, Mask the wheat disease characteristics map for students;

[0118] The total loss is calculated as follows:

[0119] L all =L original +α·L dis

[0120] The total loss L of the training process is calculated by weighted operation all , where L original is the original loss of the model in all tasks, and α is the hyperparameter for balancing the loss value;

[0121] Then use the total loss L all To update the student model SlimRepGhostNet, use the updated model for experimental training, and obtain a lightweight wheat disease recognition model.

[0122] The fourth step is to obtain the wheat disease image to be identified: obtain the wheat disease image to be detected and preprocess it.

[0123] Step 5: Recognition of wheat disease images: Input the preprocessed wheat disease images into the trained lightweight wheat disease recognition model to obtain the wheat disease image recognition results.

[0124] In order to more clearly explore the model classification effect of RepGhostNet before and after improvement, we reduce the output of RepGhostNet and the improved model MGD-SlimRepGhost to two-dimensional space to visualize the classification results of the model.

[0125] Figure 4 (a) and Figure 4 (b) t-SNE graphs of the original RepGhostNet and the improved MGD-SlimRepGhostNet. Figure 4 It can be seen from (a) that the internal distribution of wheat fusarium scaly before improvement was relatively scattered, and there were many overlapping and confusing phenomena in the categories, and the clustering effect was relatively poor. Figure 4 As can be seen from (b), the internal distribution of each grade of wheat fusarium head blight in the improved model is relatively tight, and the grades are clearly distinguished, and the category overlap and confusion phenomenon are also significantly improved, indicating that the improved model can better identify the difference of wheat fusarium head blight images with different severity, thereby better realizing the diagnosis of the severity of wheat fusarium head blight. Compared with the original RepGhostNet model, the improved model MGD-SlimRepGhostNet of the present invention has a greatly improved model performance.

[0126] Table 1 compares the performance of the two models on seven commonly used evaluation indicators. MGD-SlimRepGhostNet outperforms the original RepGhostNet in all indicators. As can be seen from Table 1, compared with the original RepGhostNet, the improved MGD-SlimRepGhostNet has been significantly improved in all indicators. Its accuracy has increased by 4.29%, precision has increased by 6.43%, recall has increased by 6.13%, F1 score has increased by 6.31%, and FPS has increased by 21.17. At the same time, the number of parameters and complexity of the model have also been reduced. These improvements show that the improved model has significantly improved its ability to identify the severity of wheat single ear diseases.

[0127] Table 1

[0128]

[0129] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.

Claims

1. A lightweight wheat disease image recognition method for complex background of intelligent terminal, characterized in that: The following steps are involved: 11) Obtain wheat disease image dataset: obtain wheat images taken by smart terminals at different times, weather, environments and growth stages, including images of healthy wheat and wheat with artificial inoculation of diseases, to form a wheat fusarium disease image set, and perform expansion and enhancement preprocessing operations; 12) Construct a lightweight wheat disease recognition model: Use the ResNeSt50 model as the teacher model and the improved RepGhostNet as the student model to construct a lightweight wheat disease recognition model; 13) Training of lightweight wheat disease recognition model: Based on the preprocessed wheat disease image set, the lightweight wheat disease recognition model is trained using the knowledge distillation strategy; 14) Acquiring the wheat disease image to be identified: acquiring the wheat disease image to be identified and performing preprocessing; 15) Recognition of wheat disease images: The preprocessed wheat disease images to be identified are input into the trained lightweight wheat disease detection model to obtain the wheat disease image recognition results.

2. According to claim 1, a lightweight wheat disease image recognition method for a complex background of an intelligent terminal is characterized in that: The construction of lightweight wheat disease recognition model includes the following steps: 21) The lightweight wheat disease recognition model is set to include a teacher model and a student model, wherein the teacher model adopts the ResNeSt50 model and the student model adopts the RepGhostNet framework; a feature map output is added at the end of the feature extraction layer of the teacher model and the student model, and the feature maps of RepGhostNet and ResNeSt50 are output respectively, wherein the output of ResNeSt50 is used as a reference for the student model learning during the distillation process, and the output of RepGhostNet is used to generate the feature map of the teacher model and calculate the distillation loss; 22) Set up the teacher model; The teacher model is used to guide the training of the student model. ResNeSt50 is composed of a stacked ResNeSt Block structure. The input feature map is divided into K main groups, and then each main group is divided into R sub-groups. After convolution processing, the sub-groups are fed into the Split-Attention Block calculation unit for weighted operation, and finally concatenated through Concatenate to merge all the main groups. 23) Set up student model; RepGhostNet is set up to consist of multiple RepGhost Bottlenecks, divided into 5 stages, with a dense convolution layer using 16 channels to process the input data and a normal 1×1 convolution and average pooling stack to predict the final output; RepGhost Bottleneck is divided into 5 groups. Except for the last Bottleneck, the last Bottleneck of each group has stride=2. Remove the RepGhost-Bottleneck module from the first layer of stage2 of RepGhosNet, and remove the RepGhost-Bottleneck modules from the second and third layers of stage4 of RepGhosNet; The LeakyReLU function is used as the activation function f(x), and its expression is as follows: Among them, x is the input feature data, and α is a positive number close to 0.

3. The method for detecting lightweight wheat disease images under complex background of intelligent terminal according to claim 1, characterized in that: The training of the lightweight wheat disease recognition model includes the following steps: 31) Set the optimizer: AdamW is used as the optimizer of the lightweight wheat disease recognition model, and the cosine annealing algorithm is used to adjust the learning rate and class balance loss strategy to balance the impact caused by the uneven number of images with different disease degrees. The cosine annealing algorithm is used to calculate the loss value of the training process to optimize the model. AdamW is set to accelerate gradient descent through two momentum parameters β1 and β2. In terms of weight decay, AdamW adds an additional L2 regularization to separate weight decay from gradient update, so that weight decay is only used for weight parameters, not directly for gradient update, to avoid the influence of bias parameters. The specific calculation method is as follows: m t =β1m t-1 +(1-β1)g t Where t is the number of training steps, β1 and β2 are manually adjusted momentum parameters, g represents the gradient, m and v are the first-order and second-order momentum estimates, respectively, and m t and v t Represents the results of two momentum deviation corrections, θ represents the parameter, γ is the learning rate, λ is the weight decay coefficient, and ∈ is a constant close to 0 to avoid the denominator being 0; 32) Train the teacher model: During the teacher model training process, the preprocessed disease image size was adjusted to 244×244×3, the initial learning rate was set to 0.001, the momentum was 0.937, and the weight decay was 0.0005. The training process was carried out for a total of 100 iterations. The warm-up phase was enabled during the training process, and the minimum warm-up learning rate was 1×10 -6 , the warm-up rate is 5%, and the specific training process is as follows: The input layer reads the image data, converts it into a feature array structure for initialization, and then submits the data to the feature extraction layer; The feature extraction layer extracts high-dimensional disease features by performing a large number of convolution operations on the feature data. This layer is composed of multiple ResNeSt Block stacks. After the feature image is input into the ResNeSt Block, the feature grouping is first performed. The input feature image is first divided into K main groups, and then each main group is further divided into R sub-groups; secondly, for each sub-group, feature extraction is performed through an operation unit composed of multiple convolution operations to obtain high-dimensional features; then, the SplitAttention module is used to perform weighted operations on the R feature sub-groups to summarize the feature data, and then the Concatenate operation is used to summarize the K main groups; finally, the SE attention module is used to perform weighted operations on each feature channel of the feature data to obtain the output feature map T; The output layer performs downsampling operation on the obtained high-dimensional disease feature image through simple convolution operation to obtain the classification result, and calculates the classification loss L through the classification result; Finally, the ResNeSt50 model is updated by the classification loss L, and then the next batch of training is carried out to obtain a teacher model that can accurately identify the degree of wheat disease; 33) Train the student model: The trained teacher model is activated in prediction mode to extract features from the input preprocessed wheat disease image, and the feature map T obtained by the feature extraction layer is output as the target image of the distillation process; The student model is enabled in training mode to process the input image and output the feature map S obtained by the feature extraction layer and the disease severity classification result of the student model; Calculate the classification loss L of the model based on the classification results of the student model original ; According to the feature maps T and S of the teacher model and the student model, the distillation loss L of the masked generative distillation is obtained dis ; The distillation loss L generated by masking distillation dis and classification loss L original , perform feature distillation to calculate the total loss L of model training all ; 34) Characteristic distillation process: 341) Use T l ∈R C×H×W and S l ∈R C×H×W represents the lth wheat disease characteristic map of the teacher and the student, where l=1,..,L, Set the lth random mask to cover the lth feature of the student, which is expressed as: Generate Student Wheat Disease Characteristic Map Mask Among them, l represents the lth wheat disease feature map, i and j represent the length and width of each feature channel of the teacher feature map, R i,j is a random number between 0 and 1 that follows a uniform distribution, λ is a hyperparameter representing the mask ratio, and C, H, and W represent the shape of the feature map; 342) Use the lth wheat disease feature map mask to cover the lth student's wheat disease feature map, and use the left pixels to generate the teacher's wheat disease feature map: Generate the teacher model feature map through the student feature map, and use a small number of disease features extracted by the student model to generate the results of the teacher model; Specifically, a 1×1 convolution adaptation layer f is used align Adapt the student features S to the feature dimensions of the teacher features T; mask the adapted student features in a point-by-point manner to obtain F; and use the convolution structure to It consists of two convolutional layers W l1 , W l2 and a projection layer with an activation layer ReLU to generate the teacher feature map; 343) The overall distillation loss of the masked generation distillation method is calculated as follows: The distillation loss L is calculated by point-by-point subtraction. dis , where L represents the total number of feature images used for distillation, C, H, W represent the shape of the feature map, S and T represent the features of the student and teacher, respectively. represents the projection layer, L dis represents the distillation loss of training, Mask the wheat disease characteristics map for students; The total loss is calculated as follows: L all =L original +α·L dis The total loss L of the training process is calculated by weighted operation all , where L original is the original loss of the model in all tasks, and α is the hyperparameter for balancing the loss value; Then use the total loss L all To update the student model RepGhostNet, use the updated model for experimental training, and obtain the disease severity of wheat in wheat disease images.

Citation Information

Patent Citations

  • Lightweight apple leaf disease identification method based on knowledge distillation

    CN113610163A

  • Unsupervised single-view ship depth estimation method

    CN114332186A

  • Potato disease identification method based on improved YOLO V5 network model

    CN114677673A

  • Radar image intelligent identification method and system based on embedded platform

    CN114821346A

  • Image recognition network fusing CNN (Convolutional Neural Network) and Transform model

    CN116977822A