Crop disease and pest recognition device based on small sample learning
Through the LitePlantProto model architecture, combined with the multi-scale feature fusion and feature enhancement technology of CSASFF and LEAM modules, the limitations of feature extraction and measurement methods in the recognition of pests and diseases in small sample crops are solved, and the recognition accuracy and generalization ability are significantly improved. Crop pest identification tasks in different scenarios.
Patent Information
- Application Number
- CN202410908794.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-11-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has insufficient feature extraction capability and limitations of similarity measurement methods in the identification of pests and diseases of small samples of crops, resulting in low recognition accuracy and high data labeling cost, which increases the difficulty of data acquisition.
A crop pest and disease recognition device based on small sample learning is proposed, using the LitePlantProto model architecture, including the CSASFF module and the LEAM module, and through ShuffleNetV2-x2 as backbone, the network Conv1 to Stage4 are retained, and the global pooling layer and the fully connected layer are removed. The CSASFF module is introduced for multi-scale feature fusion, and the key channel and spatial information of the features are enhanced through the DBCAM and ESAM modules, and the training is combined with transfer learning and cross-entropy loss function.
The recognition accuracy was improved on the PlantVillage, PlantDoc and IP102 datasets, especially in the small sample settings, showing good generalization ability and cross-domain adaptability, and significantly improving the accuracy of disease and pest identification.
Smart Images

Figure CN118887535A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and in particular to a crop disease and insect pest identification device based on small sample learning. Background Art
[0002] The agricultural economy occupies an extremely important position in my country's economic system. Pests and diseases often cause irreversible damage to the quality and yield of crops, directly affecting the development of the agricultural economy. If pests and diseases can be accurately identified and timely intervened in the early stages of crop planting and production, crop losses will be greatly reduced. Therefore, accurate and efficient diagnosis of crop pests and diseases, effective blocking of pest and disease spread, and increasing crop yields have become a crucial means of control for crop pests and diseases.
[0003] In recent years, deep learning has developed rapidly. Thanks to the intelligence of deep learning models and the input of large-scale data samples, deep learning models with clever network structure design can often accurately identify image features, thus effectively solving the challenges faced by traditional machine learning. With the continuous efforts of various research teams in the field of computer vision, the depth and structure of the model are continuously increasing and improving, thereby greatly improving the recognition accuracy of the model. Although relevant research has used deep learning models to identify crop pests and diseases, labeling crop data is time-consuming and labor-intensive, and the labeling process is quite complicated. More importantly, the cost of expert labeling data is extremely high, which further increases the difficulty of data acquisition. In addition, the mismatch between scarce data and complex model structure often easily leads to overfitting. Therefore, how to accurately identify crop pests and diseases with a small number of samples has become the focus of current research.
[0004] The task of crop pest and disease identification based on small sample learning still faces many challenges and has great practical value. At present, there is room for improvement in the feature representation ability of feature extractors in this field, and the similarity measurement method also has certain limitations. In response to these difficulties, a crop pest and disease identification device based on small sample learning is proposed to improve the accuracy of small sample crop pest and disease identification, thereby opening up new horizons for the development of this field and providing innovative solutions and methods. Summary of the invention
[0005] The present invention provides a crop disease and insect pest identification device based on small sample learning, which improves the accuracy of small sample crop disease and insect pest identification, thereby opening up new horizons for the development of this field and providing innovative solutions and methods.
[0006] In order to solve the above technical problems, the present invention provides a crop pest and disease identification device based on small sample learning, including a model architecture of LitePlantProto, the model architecture of LitePlantProto includes a CSASFF module and a LEAM module, and the LEAM module includes a DBCAM module and an ESAM module;
[0007] LitePlantProto uses ShuffleNetV2-x2 as the backbone, retains the network's Conv1 to Stage 4, removes the global pooling layer and fully connected layer after Stage 4, and applies the CSASFF module to perform multi-scale feature fusion on the output features of Stage 2, Stage 3, and Stage 4 of the backbone. The multi-scale fusion feature formula is:
[0008] Y=CSASFF(F stage2 ,F stage3 ,F stage4 ) (1)
[0009] Where Y represents the multi-scale fusion feature, F stage2 、F stage3 and F stage4 Represents the characteristics of the backbone output at different stages;
[0010] LitePlantProto connects the LEAM module after the CSASFF module, and works in coordination with the DBCAM module and the ESAM module in the LEAM module.
[0011] Preferably, the CSASFF module includes a fusion weight learning stage and an adaptive mutual fusion stage;
[0012] In the fusion weight learning stage, the fusion weight shown in formula (2) is calculated for each scale feature:
[0013]
[0014] Among them, a ij 、b ij and c ij They represent the spatial feature fusion weights of the three input features respectively. The subscripts i and j are used to represent the pixel positions of the two-dimensional image. and It means that the Softmax activation function is used to activate a ij 、b ij and c ij The control parameters obtained after the action and the calculation formula of the feature fusion weight map are:
[0015] α=Softmax(W4Concat(W1x1,W2x2,W3x3)) (3)
[0016] Among them, α represents the 3-channel weight map learned jointly by the three input features. These channels correspond to the fusion weights of the three input features. W1, W2 and W3 represent the parameters required to align the channels and spatial dimensions of x1, x2 and x3 respectively. Concat represents the cascade operation. W4 represents the parameters required for further dimensionality reduction of the cascaded features. The Softmax activation function is used to ensure that the weight value is limited to [0, 1]. After obtaining the corresponding fusion weight of each feature, the fusion process shown in formula (4) is performed.
[0017] y=α 0~1 x1+α 1~2 ·x2+α 2~3 ·x3 (4)
[0018] Among them, α 0~1 , α 1~2 and α 2~3 They respectively represent the three channel vectors of the feature fusion weight map α. The number of these channel vectors is consistent with the number of features, ensuring the precise integration of spatial features.
[0019] Preferably, the DBCAM module is intended to enhance the key channel information of the feature. The DBCAM module includes two branches: global average pooling GAP and global maximum pooling GMP. First, feature I is processed by GAP and GMP to obtain I avg ∈R C×1×1 with I max ∈R C×1×1 , after the shared 1D convolution extraction, the vector P is obtained gap ∈R C×1×1 With P gmp ∈R C×1×1 Then, these two vectors are input into the Sigmoid activation function for further processing. Sigmoid can impose numerical constraints on them to simulate the probability distribution. The output after the activation function mapping is β gap and β gmp , which represent the global and local attention feature maps respectively, and then multiply them with the original input features to obtain the global enhanced feature F gap_aug ∈R C×H×W and local enhancement feature F gmp_aug ∈R C×H×W ,Finally, the two are combined to enhance the key channel information of the features;
[0020] The ESAM module is used to enhance the key spatial information of the feature. Assuming that the input feature is I∈R C×H×W, use GAP to aggregate the spatial features of I and obtain the pooled vector P∈R C×1×1 To ensure the alignment with I in the spatial dimension, ESAM expands P in the spatial dimension. Then, the ESAM module cascades P and I to fuse the information of the two and obtains the fused feature I Fused ∈R 2C ×H×W In order to achieve channel dimension reduction without increasing the number of model parameters, the ESAM module uses a 1×1 deep convolution compression I Fused The channel information of the adaptive spatial fusion weight A∈R 1×H×W , the data in A represents the importance of the corresponding position pixel in I, and finally A and I are multiplied element by element to obtain the spatial enhancement feature F spatial_aug ,In the above process, the ESAM module highlights the important areas of the image and ,suppresses the interference of irrelevant areas.
[0021] Preferably, the training module selects ImageNet as a pre-training data set for the model backbone, and the training method of the training module includes:
[0022] S1: pre-trained model import;
[0023] Considering that transfer learning can obtain better initialization parameters and provide rich prior knowledge for the model, the model adopts the strategy of transfer learning and assigns initialization parameters to ShuffleNetV2 by importing the model weights pre-trained on ImageNet;
[0024] S2: Retrain the network;
[0025] Define the support set S = {(x i ,y i )|i=1,…,CK,y i ∈{1,…,C}} and the query set Q={(x i ,y i )|i=1,…,CN,y i ∈{1,…,C}}, input S and Q into the LitePlantProto model containing pre-trained weights respectively;
[0026] After LitePlantProto feature extraction, the feature representation E is obtained. S and E Q ; Then, the cluster center C of each class in the support set is obtained by calculating the mean S ; Then, using Euclidean distance as the similarity measure, calculate C S and E QSimilarity measurement matrix; Finally, based on the similarity measurement matrix, loss calculation and category prediction are performed to minimize the loss function E of the model, where the cross entropy loss function is used as the loss function of the experiment, and the loss function formula is:
[0027]
[0028] Where W represents the weight matrix of the convolutional layer in the model, n represents the number of training samples, i represents the index subscript of the training sample, C and c represent the number of categories and category index respectively, and y ic represents the sign function, which takes 1 when the training samples i and c are the same, and takes 0 when they are different. ic Represents the probability that the true category of training sample i is c; the Adam optimizer is used, which integrates the first-order moment estimate and the second-order moment estimate of the gradient to accurately calculate the step size to be updated.
[0029] Compared with the related art, the crop pest identification device based on small sample learning provided by the present invention has the following beneficial effects:
[0030] The present invention provides a crop pest and disease identification device based on small sample learning. By constructing the model architecture of LitePlantProto, the model adopts a lightweight backbone network, introduces adaptive spatial features to fuse and aggregate multi-scale features, and avoids feature redundancy and mutual interference between multi-scale features. In addition, the present invention proposes a lightweight and efficient attention module to further mine the saliency information of the image from the channel and spatial dimensions. The experimental results show that compared with the most advanced model in the current field, the average recognition accuracy of the model in the PlantVillage dataset 10-shot setting is improved by 0.41%, and the average recognition accuracy in the PlantDoc dataset 5-shot and 10-shot settings is improved by 4.03% and 2.47% respectively. The overall average recognition accuracy on the IP102 dataset is improved by 1.46%, and at the same time, it shows strong generalization ability on the locally collected dataset. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a schematic diagram of the model structure of LitePlantProto of the present invention;
[0032] Figure 2 It is a schematic diagram of the structure of the DBCAM module of the present invention;
[0033] Figure 3 It is a schematic diagram of the ESAM module structure of the present invention. DETAILED DESCRIPTION
[0034] Example, by Figure 1The present invention includes a model architecture of LitePlantProto, the model architecture of LitePlantProto includes a CSASFF module and a LEAM module, the LEAM module includes a DBCAM module and an ESAM module, LitePlantProto uses ShuffleNetV2-x2 as a backbone, retains Conv1 to Stage4 of the network, removes the global pooling layer and the fully connected layer after Stage4, LitePlantProto applies the CSASFF module to perform multi-scale feature fusion on the output features of Stage2, Stage3 and Stage4 of the backbone, and the multi-scale fusion feature formula is:
[0035] Y=CSASFF(F stage2 ,F stage3 ,F stage4 ) (1)
[0036] Where Y represents the multi-scale fusion feature, F stage2 、F stage3 and F stage4 Represents the characteristics of the backbone output at different stages;
[0037] LitePlantProto connects the LEAM module after the CSASFF module, and works in coordination with the DBCAM module and the ESAM module in the LEAM module.
[0038] In this embodiment, the LEAM module, whose full name is Lightweight and Efficient Attention Module, can deeply mine the salient information of pest and disease images in different dimensions.
[0039] ShuffleNet is a lightweight and efficient network proposed by the Megvii team, suitable for mobile devices facing computing bottlenecks. The network structure of the ShuffleNetV2 series is shown in Table 1. It can be seen from the table that ShuffleNetV2 consists of convolutional layers, maximum pooling, and fully connected layers. After the first convolutional layer and the maximum pooling layer, the features will go through three consecutive stages, each of which contains a downsampling module for feature extraction, which consists of channel shuffling operations. After three consecutive stages, a convolutional layer is connected for feature dimension mapping. Finally, a global average pooling layer and a fully connected layer are attached after this convolutional layer to complete the classification task. In summary, ShuffleNetV2 is a lightweight convolutional neural network with powerful recognition capabilities.
[0040] Table 1 ShuffleNetV2 series network structure
[0041]
[0042] The full name of the CSASFF module is Cross Scale AdaptiveSpatial Feature Fusion, which includes the fusion weight learning stage and the adaptive mutual fusion stage;
[0043] In the fusion weight learning stage, the fusion weight shown in formula (2) is calculated for each scale feature:
[0044]
[0045] Among them, a ij , b ij and c ij They represent the spatial feature fusion weights of the three input features respectively. The subscripts i and j are used to represent the pixel positions of the two-dimensional image. and It means that the Softmax activation function is used to activate a ij , b ij and c ij The control parameters obtained after the action and the calculation formula of the feature fusion weight map are:
[0046] α=Softmax(W4Concat(W1x1,W2x2,W3x3)) (3)
[0047] Among them, α represents the 3-channel weight map learned jointly by the three input features. These channels correspond to the fusion weights of the three input features. W1, W2 and W3 represent the parameters required to align the channels and spatial dimensions of x1, x2 and x3 respectively. Concat represents the cascade operation. W4 represents the parameters required for further dimensionality reduction of the cascaded features. The Softmax activation function is used to ensure that the weight value is limited to [0, 1]. After obtaining the corresponding fusion weight of each feature, the fusion process shown in formula (4) is performed.
[0048] y=α 0~1 x1+α 1~2 ·x2+α 2~3 ·x3 (4)
[0049] Among them, α 0~1 , α 1~2 and α 2~3 They respectively represent the three channel vectors of the feature fusion weight map α. The number of these channel vectors is consistent with the number of features, ensuring the precise integration of spatial features.
[0050] The full name of DBCAM module is Dual Branch Channel Attention Module, which aims to enhance the key channel information of features, such as Figure 2 As shown in the figure, the DBCAM module contains two branches: global average pooling GAP and global maximum pooling GMP. First, feature I is processed by GAP and GMP to obtain I avg ∈R C×1×1 with I max ∈R C ×1×1 , after the shared 1D convolution extraction, the vector P is obtained gap ∈R C×1×1 With P gmp ∈R C×1×1 Then, these two vectors are input into the Sigmoid activation function for further processing. Sigmoid can impose numerical constraints on them to simulate the probability distribution. The output after the activation function mapping is β gap and β gmp , which represent the global and local attention feature maps respectively, and then multiply them with the original input features to obtain the global enhanced feature F gap_aug ∈R C×H×W and local enhancement feature F gmp_aug ∈R C×H×W ,Finally, the two are combined to enhance the key channel information of the features;
[0051] The ESAM module stands for Efficient Spatial Attention Module, which is used to enhance the key spatial information of features, such as Figure 3 As shown, assuming that the input feature is I∈R C×H×W , use GAP to aggregate the spatial features of I and obtain the pooled vector P∈R C×1×1 To ensure the alignment with I in the spatial dimension, ESAM expands P in the spatial dimension. Then, the ESAM module cascades P and I to fuse the information of the two and obtains the fused feature I Fused ∈R 2C×H×W In order to achieve channel dimension reduction without increasing the number of model parameters, the ESAM module uses a 1×1 deep convolution compression I Fused The channel information of the adaptive spatial fusion weight A∈R 1×H×W , the data in A represents the importance of the corresponding position pixel in I, and finally A and I are multiplied element by element to obtain the spatial enhancement feature F spatial_aug ,In the above process, the ESAM module highlights the important areas of the image and ,suppresses the interference of irrelevant areas.
[0052] The training module selects ImageNet as the pre-training dataset for the model backbone. The training methods of the training module include:
[0053] S1: pre-trained model import;
[0054] Considering that transfer learning can obtain better initialization parameters and provide rich prior knowledge for the model, the model adopts the strategy of transfer learning and assigns initialization parameters to ShuffleNetV2 by importing the model weights pre-trained on ImageNet;
[0055] S2: Retrain the network;
[0056] Define the support set S = {(x i ,y i )|i=1,…,CK,y i ∈{1,…,C}} and the query set Q={(x i ,y i )|i=1,…,CN,y i ∈{1,…,C}}, input S and Q into the LitePlantProto model containing pre-trained weights respectively;
[0057] After LitePlantProto feature extraction, the feature representation E is obtained. S and E Q ; Then, the cluster center C of each class in the support set is obtained by calculating the mean S ; Then, using Euclidean distance as the similarity measure, calculate C S and E Q Similarity measurement matrix; Finally, based on the similarity measurement matrix, loss calculation and category prediction are performed to minimize the loss function E of the model, where the cross entropy loss function is used as the loss function of the experiment, and the loss function formula is:
[0058]
[0059] Where W represents the weight matrix of the convolutional layer in the model, n represents the number of training samples, i represents the index subscript of the training sample, C and c represent the number of categories and category index respectively, and y ic represents the sign function, which takes 1 when the training samples i and c are the same, and takes 0 when they are different. ic Represents the probability that the true category of training sample i is c; the Adam optimizer is used, which integrates the first-order moment estimate and the second-order moment estimate of the gradient to accurately calculate the step size to be updated.
[0060] Among them, ImageNet is a public data set, and the test data uses the public plant disease data set PlantVillage, the commonly used data set PlantDoc for plant disease detection, the insect pest data set IP102, and the corn and rice data sets collected by the local laboratory. Since the number of samples in the locally collected data set is small, and the PlantVillage data set covers a wide range of crop diseases and has a similar domain distribution to the local collected data set, the rich prior knowledge in the similar domain can help the model achieve results in the new domain. Therefore, the present invention selects PlantVillage as the meta-training data set in the relevant experiments of the locally collected data set.
[0061] The experiment of the present invention uses accuracy as an evaluation index, which represents the ratio of the number of correctly identified samples to the total number of samples. The specific calculation formula is shown in formula (6).
[0062]
[0063] TP stands for true positive examples, which refers to the number of samples that are positive in both actual and predicted judgments. Similarly, TN stands for true negative examples, which refers to the number of samples that are negative in both actual and predicted judgments. FP stands for false positive examples, which refers to the number of samples that are actually negative examples but are mistakenly judged as positive examples in predictions. Finally, FN stands for false negative examples, which refers to the number of samples that are actually positive examples but are mistakenly judged as negative examples in predictions.
[0064] The effectiveness of the modules proposed in this paper is analyzed through ablation experiments, with a focus on the effectiveness analysis of the CSASFF module, the DBCAM module in the LEAM module, and the ESAM module. The ablation experiment uses ShuffleNetV2 pre-trained on ImageNet as the Baseline and PlantVillage as the experimental dataset. Different models are constructed under the same experimental settings to test the recognition accuracy under 5-shot, 10-shot, and 20-shot settings.
[0065] Table 2 Ablation experiment results on the PlantVillage dataset
[0066]
[0067]
[0068] As shown in Table 2, the recognition accuracy of the model using the CSASFF module is significantly improved compared with the model without the CSASFF module under the three classification standards of 5-shot, 10-shot and 20-shot settings. The reasons are speculated as follows. First, the adaptive fusion weight in the CSASFF module flexibly adjusts the weight of multi-scale features in the fusion process. For features that are highly related to disease information, the CSASFF module can give them a larger fusion weight to ensure that the model can focus on the core information related to the disease. Second, for information that is not related to the disease, the CSASFF module implements information filtering by reducing its corresponding fusion weight. This fusion strategy effectively improves the efficiency of the model in aggregating detailed information and semantic information, thereby improving the recognition performance of the model.
[0069] To further verify the superiority of the CSASFF module over the traditional feature fusion method in improving model recognition performance, Table 3 lists the comparative experimental results of the CSASFF module and the traditional feature fusion method under the Data-Split-1 division standard in 5-shot, 10-shot and 20-shot. The ADD operation adds the outputs of the three network stages after spatial and channel alignment, while the CONCAT operation concatenates the aligned outputs of the three network stages according to the channel, and then performs channel dimension reduction through 1×1 convolution to restore the feature shape.
[0070] Table 3 Comparative experimental results of CSASFF and traditional feature fusion methods
[0071]
[0072]
[0073] It can be observed from Table 3 that the model using the CSASFF module can achieve the highest recognition accuracy under the three K value settings. At the same time, regardless of the feature fusion method used, the model has improved recognition accuracy compared with the baseline, which shows that by fusing deep and shallow features, the model can better utilize image detail information and semantic information, thereby improving the accuracy of pest and disease image recognition.
[0074] (2) LEAM module effectiveness analysis
[0075] As shown in Table 2, the recognition accuracy of the model using the DBCAM module is significantly improved compared with the model without the CSASFF module under the 5-shot, 10-shot and 20-shot settings of the three division standards. The reasons are speculated as follows. In the DBCAM module, GAP enables the model to retain the overall features of the image, thereby fully understanding the overall structure of the image, while GMP retains the local detail information in the image by extracting significant features. In addition, by adopting shared 1-dimensional convolution, the DBCAM module further enhances its local feature mapping ability, allowing the model to more accurately locate key features when identifying pest and disease images. Under the action of the DBCAM module, the model pays more attention to the significant features in the channel dimension, thereby improving the recognition ability of pests and diseases. The recognition accuracy of the model using the ESAM module is significantly improved compared with the model without the ESAM module under the 5-shot, 10-shot and 20-shot settings of the three division standards. The reasons are speculated as follows. The ESAM module retains the global information of the image by aggregating the overall features. In addition, according to the importance of different regions, the spatial feature fusion weights adaptively generated by the ESAM module can automatically enhance the key pixels in the feature space. The ESAM module assigns higher weights to the pest and disease areas of the image and lower weights to non-critical areas. This strategy enhances the features of the pest and disease areas, allowing the model to pay more attention to the key information of pests and diseases, thereby achieving greater improvement in the model's pest and disease identification.
[0076] Taking the 10-shot setting under Data-Split-1 as an example, Table 4 shows the comparative experimental results of the LEAM module and the mainstream attention module in terms of recognition accuracy, number of parameters, and FLOPs in the inference scenario.
[0077] As can be seen from Table 4, compared with mainstream attention modules, the LEAM module ranks first with a recognition accuracy of 87.80%. In terms of parameter volume and FLOPs, the LEAM module is only slightly higher than the ECA and significantly lower than other attention modules, but in terms of recognition accuracy, the LEAM module has achieved a significant improvement of 1.43% compared to the ECA, which means that the LEAM module does not introduce too much computational load while achieving higher recognition accuracy. The experimental results verify that the LEAM module proposed in this chapter is a lightweight and efficient attention module.
[0078] Table 4 Comparative experimental results of LEAM and mainstream attention modules
[0079]
[0080] (3) Model parameter quantity and FLOPs analysis
[0081] This section focuses on analyzing the number of parameters and FLOPs of LitePlantProto in the inference scenario. As shown in Table 5, the parameter increment and FLOPs of the DBCAM module and the ESAM module in the LEAM module are only slightly improved compared with the Baseline. Although adding the CSASFF module to the model will significantly increase the model parameter increment and FLOPs, overall, LitePlantProto still has a strong lightweight feature.
[0082] Table 5 Analysis of model parameters and FLOPs in this chapter
[0083]
[0084]
[0085] The recognition performance of LitePlantProto is compared with that of mainstream models on the PlantVillage dataset. Table 6 shows the comparative experimental results of LitePlantProto and mainstream models under different experimental settings.
[0086] Table 6 Experimental results of comparison with mainstream models on the PlantVillage dataset
[0087]
[0088]
[0089] As shown in Table 6, LitePlantProto achieves excellent recognition accuracy under various partitioning criteria of the PlantVillage public dataset. Taking Data-Split-1 as the partitioning criterion, the recognition accuracy of LitePlantProto under three K value settings is 85.40%, 88.20% and 92.80% respectively. Among them, the recognition accuracy of this model is improved by 0.60% and 0.20% under 5-shot and 10-shot settings respectively, and decreased by 2.24% under 20-shot settings compared with the most advanced TC-Loss model under this partitioning criterion. Taking Data-Split-2 as the partitioning criterion, the recognition accuracy of LitePlantProto under three K value settings is 92.64%, 95.49% and 97.12% respectively. Among them, the recognition accuracy of this model is 1.43% lower than that of the most advanced PEAM model under this division standard at 5-shot, and it is 0.16% and 1.09% higher at 10-shot and 20-shot respectively. Taking Data-Split-3 as the division standard, the recognition accuracy of LitePlantProto under three K value settings is 91.20%, 94.00% and 95.33% respectively. Among them, the recognition accuracy of this model is 0.63% lower than that of the most advanced PEAM model under this division standard at 5-shot, and it is 0.88% and 1.60% higher at 10-shot and 20-shot respectively.
[0090] In summary, LitePlantProto performs well on the PlantVillage public dataset. According to three different classification criteria, LitePlantProto achieves the highest recognition accuracy in most experimental settings. Although it does not achieve the optimal performance in a few experimental settings, the overall performance is still impressive, which verifies the advancement and effectiveness of the model.
[0091] Table 7 Comparative experimental results with mainstream models on the PlantDoc dataset
[0092]
[0093] Performance of LitePlantProto on the PlantDoc dataset. As shown in Table 7, with PlantDoc-Split-1 as the division standard, the recognition accuracy of LitePlantProto under three K value settings is 63.20%, 74.79% and 76.79% respectively. Among them, the recognition accuracy of this model, compared with the TC-Loss model, is improved by 5.84% and 4.02% under 5-shot and 10-shot settings, respectively, and is reduced by 0.54% under 20-shot. With PlantDoc-Split-2 as the division standard, the recognition accuracy of this model is 55.34%, 62.99% and 70.42% under the same K value setting. Compared with the TC-Loss model, the recognition accuracy of this model is improved by 2.21% and 0.91% under 5-shot and 10-shot settings, respectively, and is reduced by 1.80% under 20-shot settings, and there is still room for improvement. The above experimental results show that LitePlantProto not only performs well in simple environments, but also has excellent performance in more complex pest and disease identification scenarios.
[0094] Table 8 Experimental results of comparison with mainstream models on IP102 dataset
[0095]
[0096] Evaluate the performance of LitePlantProto on the IP102 dataset. Table 8 clearly shows the experimental results of LitePlantProto compared with mainstream models on the IP102 dataset. It can be seen from the table that compared with PlantVillage and PlantDoc, the recognition accuracy of each model on the IP102 dataset is significantly lower, which is because the image scenes of this dataset are more complex and diverse. The experimental results show that compared with the mainstream models in the field of small sample crop image recognition, LitePlantProto has achieved the highest recognition accuracy under the 5-shot, 10-shot and 20-shot settings, which is better than other mainstream models and shows excellent small sample pest recognition capabilities.
[0097] Locally collected rice and corn datasets are used to evaluate the cross-domain recognition ability of the model.
[0098] As shown in Tables 9 and 10, when LitePlantProto was trained under the three PV-Setting division standards, it still showed a high recognition accuracy even when facing a local data set with a more complex background. This experimental result strongly confirms that LitePlantProto has excellent cross-domain recognition capabilities, which fully demonstrates that it can adapt to crop pest and disease recognition tasks in different scenarios. In addition, the experiments in this section were carried out based on data sets collected in the field, which provides a new reference benchmark for subsequent research work.
[0099] Table 9 Experimental results on the local corn dataset
[0100]
[0101]
[0102] Table 10 Experimental results on the local rice dataset
[0103]
[0104] Working principle: The model used in this invention uses the pre-trained ShuffleNetV2 on ImageNet as the backbone. Considering the limitations of traditional feature fusion methods, this chapter constructs the CSASFF module for multi-scale feature fusion. This module reduces feature redundancy while avoiding mutual interference between features of different scales. In addition, this chapter enhances the salient features of the image from the two dimensions of channel and space, and proposes a lightweight and efficient attention module LEAM module. The DBCAM module in the LEAM module constructs a global average pooling branch and a global maximum pooling branch, which enhances the key information of the channel by capturing the global features and local salient features of the image. The ESAM module in the LEAM module aggregates the overall information of the image and uses cascades and deep convolutions to adaptively generate spatial fusion weights. In the experimental part, the ablation experiments related to the proposed module and the comparative experiments of the model with other mainstream models are introduced, and cross-domain recognition experiments on locally collected data sets are carried out. The experimental results verify that the model is effective in identifying small sample crop pests and diseases, and is superior to other mainstream models.
Claims
1. A crop pest and disease identification device based on small sample learning, Features: Including the model architecture of LitePlantProto, the model architecture of LitePlantProto includes CSASFF module and LEAM module, and the LEAM module includes DBCAM module and ESAM module; LitePlantProto uses ShuffleNetV2-x2 as the backbone, retains the network's Conv1 to Stage 4, removes the global pooling layer and fully connected layer after Stage 4, and applies the CSASFF module to perform multi-scale feature fusion on the output features of Stage 2, Stage 3, and Stage 4 of the backbone. The multi-scale fusion feature formula is: Y=CSASFF(F stage2 ,F stage3 ,F stage4 ) (1) Where Y represents the multi-scale fusion feature, F stage2 、F stage3 and F stage4 Represents the characteristics of the backbone output at different stages; LitePlantProto connects the LEAM module after the CSASFF module, and works in coordination with the DBCAM module and the ESAM module in the LEAM module.
2. According to claim 1, a device for identifying crop diseases and insect pests based on small sample learning, It is characterized in that The CSASFF module includes a fusion weight learning stage and an adaptive mutual fusion stage; In the fusion weight learning stage, the fusion weight shown in formula (2) is calculated for each scale feature: Among them, a ij 、b ij and c ij They represent the spatial feature fusion weights of the three input features respectively. The subscripts i and j are used to represent the pixel positions of the two-dimensional image. and It means that the Softmax activation function is used to activate a ij 、b ij and c ij The control parameters obtained after the action and the calculation formula of the feature fusion weight map are: α=Softmax(W 4 Concat(W 1 x 1 ,W 2 x 2 ,W 3 x 3 )) (3) Among them, α represents the 3-channel weight map learned jointly by the three input features. These channels correspond to the fusion weights of the three input features, respectively. 1 , W 2 and W 3 Respectively represent alignment x 1 、x 2 and x 3 The parameters required for the channel and spatial dimensions, Concat represents the cascade operation, W 4 represents the parameters required for further dimensionality reduction of the cascaded features. The Softmax activation function is used to ensure that the weight value is limited to [0, 1]. After obtaining the corresponding fusion weight of each feature, the fusion process shown in formula (4) is performed. y=a 0~1 ·x 1 +a 1~2 ·x 2 +a 2~3 ·x 3 (4) Among them, α 0~1 , α 1~2 and α 2~3 They respectively represent the three channel vectors of the feature fusion weight map α. The number of these channel vectors is consistent with the number of features, ensuring the precise integration of spatial features.
3. According to claim 1, a device for identifying crop diseases and insect pests based on small sample learning, It is characterized in that The DBCAM module is designed to enhance the key channel information of the feature. The DBCAM module contains two branches: global average pooling GAP and global maximum pooling GMP. First, feature I is processed by GAP and GMP to obtain I avg ∈R C×1×1 with I max ∈R C×1×1 , after the shared 1D convolution extraction, the vector P is obtained gap ∈R C×1×1 With P gmp ∈R C×1×1 Then, these two vectors are input into the Sigmoid activation function for further processing. Sigmoid can impose numerical constraints on them to simulate the probability distribution. The output after the activation function mapping is β gap and β gmp , which represent the global and local attention feature maps respectively, and then multiply them with the original input features to obtain the global enhanced feature F gap_aug ∈R C×H×W and local enhancement feature F gmp_aug ∈R C ×H×W ,Finally, the two are combined to enhance the key channel information of the features; The ESAM module is used to enhance the key spatial information of the feature. Assuming that the input feature is I∈R C×H×W , use GAP to aggregate the spatial features of I and obtain the pooled vector P∈R C×1×1 To ensure the alignment with I in the spatial dimension, ESAM expands P in the spatial dimension. Then, the ESAM module cascades P and I to fuse the information of the two and obtains the fused feature I Fused ∈R 2C×H×W In order to achieve channel dimension reduction without increasing the number of model parameters, the ESAM module uses a 1×1 deep convolution compression I Fused The channel information of the adaptive spatial fusion weight A∈R 1×H×W , the data in A represents the importance of the corresponding position pixel in I, and finally A and I are multiplied element by element to obtain the spatial enhancement feature F spatial_aug ,In the above process, the ESAM module highlights the important areas of the image and ,suppresses the interference of irrelevant areas.
4. The crop pest and disease identification device based on small sample learning according to claim 1, It is characterized in that The training module selects ImageNet as the pre-training dataset for the model backbone. The training methods of the training module include: S1: pre-trained model import; Considering that transfer learning can obtain better initialization parameters and provide rich prior knowledge for the model, the model adopts the strategy of transfer learning and assigns initialization parameters to ShuffleNetV2 by importing the model weights pre-trained on ImageNet; S2: Retrain the network; Define the support set S = {(x i ,y i )|i=1,…,CK,y i ∈{1,…,C}} and the query set Q={(x i ,y i )|i=1,…,CN,y i ∈{1,…,C}}, input S and Q into the LitePlantProto model containing pre-trained weights respectively; After LitePlantProto feature extraction, the feature representation E is obtained. S and E Q ; Then, the cluster center C of each class in the support set is obtained by calculating the mean S ; Then, using Euclidean distance as the similarity measure, calculate C S and E Q Similarity measurement matrix; Finally, based on the similarity measurement matrix, loss calculation and category prediction are performed to minimize the loss function E of the model, where the cross entropy loss function is used as the loss function of the experiment, and the loss function formula is: Where W represents the weight matrix of the convolutional layer in the model, n represents the number of training samples, i represents the index subscript of the training sample, C and c represent the number of categories and category index respectively, and y ic represents the sign function, which takes 1 when the training samples i and c are the same, and takes 0 when they are different. ic Represents the probability that the true category of training sample i is c; the Adam optimizer is used, which integrates the first-order moment estimate and the second-order moment estimate of the gradient to accurately calculate the step size to be updated.
