Progressive crop disease classification and grading method and system based on comparison feature library
By constructing a progressive crop disease classification and grading method of the comparative feature library and combining with deep learning models, the problems of low efficiency and low accuracy in the existing technology are solved, efficient and accurate grading of crop disease diagnosis is achieved, and precise disease management is supported in intelligent agriculture.
Patent Information
- Application Number
- CN202510847445.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-06-24
AI Technical Summary
The existing technology has low efficiency, great subjective impact on crop diseases, difficult to adapt to the needs of large-scale farmland management, insufficient multi-dimensional feature discrimination ability, lack of systematic feature comparison mechanism, and difficulty in decoupling and coordinated optimization of tasks, resulting in low diagnostic accuracy.
Using a progressive crop disease classification and grading method based on the contrasting feature library, three independent feature libraries are constructed, crop classification, disease classification and disease classification, and features are extracted using deep learning models, and global to local similarity calculation and weighted similarity score sorting are carried out, and the analysis is gradually refined to obtain the final diagnostic results.
It improves the accuracy and efficiency of crop disease diagnosis, reduces cross-category interference, enhances the pertinence and reliability of feature matching, improves the accuracy of multi-dimensional feature fusion, optimizes feature spatial distribution, and supports intelligent agriculture and sustainable disease management.
Smart Images

Figure CN120356018A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of crop disease identification, and particularly to a progressive crop disease classification and grading method and system based on a contrast feature library. Background Art
[0002] The timely and accurate diagnosis of crop diseases is a key technical link in modern agricultural production systems, and its diagnosis efficiency and accuracy directly affect the food security guarantee ability. The traditional manual inspection mode relies on agricultural technicians to identify by visually observing characteristics such as the morphology and color changes of leaf disease spots. This method has the following significant limitations: 1. Low efficiency: A skilled agricultural technician can only complete the disease screening of 3 - 5 hectares of farmland per day on average; 2. The diagnostic accuracy is significantly affected by subjective experience; 3. It is difficult to meet the needs of large-scale intensive farmland management.
[0003] With the rapid development of computer vision and deep learning technologies, image-based intelligent diagnosis methods have gradually become a research hotspot. Existing algorithms mainly extract disease spot features through convolutional neural networks (CNNs) for classification and recognition, and have made certain progress on standard datasets. For example, ResNet-50 achieves a classification accuracy of 92.4% on the PlantVillage dataset. However, these methods still face multiple challenges in practical applications: 1. Insufficient multi-dimensional feature discrimination ability: Disease symptoms have significant polymorphism. For example, cucumber downy mildew and bacterial angular leaf spot both show angular disease spots on leaves, and traditional CNN models are difficult to effectively distinguish the subtle differences. At the same time, factors such as environmental light changes (light intensity fluctuation > 30%) and leaf overlap occlusion (occlusion rate > 40%) will lead to distorted feature extraction.
[0004] 2. Lack of construction of a contrast feature library: Existing methods mostly rely on end-to-end classification models and lack a systematic feature contrast mechanism. For example, in the task of grading northern leaf blight of corn, the difference in the area ratio of disease spots of different severities (mild < 10%, moderate 10 - 30%, severe > 30%) requires precise feature matching, but existing models often ignore the contrast learning between features, resulting in a grading accuracy of only 78.6%.
[0005] 3. Difficulty in task decoupling and collaborative optimization: Most current studies treat crop classification, disease identification, and severity grading as independent tasks and lack an effective multi-task collaboration mechanism. For example, in the diagnosis of rice blast, variety differences (such as indica rice and japonica rice) will significantly affect the morphological characteristics of disease spots, but existing models fail to make full use of the prior information of crop categories, resulting in a 22.3% decrease in the cross-variety diagnosis accuracy. Summary of the Invention
[0006] The objective of the present invention is to provide a progressive crop disease classification and grading method and system based on a contrast feature library to solve the above technical problems.
[0007] To achieve the above objective, the present invention provides a progressive crop disease classification and grading method based on a contrast feature library, including the following steps: S1. Collect crop images containing multiple crop categories, multiple disease types, and multiple disease severities, and perform preprocessing. Then, label the disease types and disease severities of the preprocessed crop images to obtain a crop dataset composed of a crop classification dataset, a crop disease classification dataset, and a crop disease grading dataset. Divide the crop dataset into a training set and a contrast set, and store the contrast set in a contrast library; S2. Use the crop classification dataset, crop disease classification dataset, and crop disease grading dataset in the training set to train deep learning models respectively to obtain a crop classification model, a crop disease model, and a disease grading model; S3. Use the crop classification model, crop disease model, and disease grading model trained in step S2 to extract crop category features, crop disease category features, and crop disease grading features in the crop classification dataset, crop disease classification dataset, and crop disease grading dataset in the contrast set respectively to constitute a contrast feature library; At the same time, input the crop images to be graded into the crop classification model, crop disease model, and disease grading model in sequence for feature extraction; S4. Compare the features extracted from the crop images to be graded with the corresponding crop category features, crop disease category features, and crop disease grading features in the contrast feature library from global to local, calculate the weighted similarity scores, then sort the similarity scores, and respectively select the contrast feature library labels with the highest similarity scores in the crop category features, crop disease category features, and crop disease grading features as the corresponding classification results; S5. Progressively integrate the corresponding classification results to obtain the final crop disease grading diagnosis result.
[0008] Preferably, the preprocessing described in step S1 includes denoising, cropping, adjusting brightness and contrast to obtain crop images with a size of 224×224 ; And in step S1, experts grade the diseases by marking the size of the lesions in labelme.
[0009] Preferably, the deep learning model described in step S2 is a ViT-B / 16 network model; The ViT-B / 16 network model processes crop images with a size of 224×224 Divide it into patches of size 16×16, and then perform linear projection on each patch: (1); In the formula, represents the intermediate feature output after processing; represents the operation of dividing the input crop image into patches of size 16×16 and mapping them to the feature space through linear projection; Then add positional encoding and send it into the Transformer for feature extraction: (2); (3); In the formula, represents the global feature representation output after being processed by the Transformer module; represents the Transformer module; represents the positional encoding; represents the classification result output by passing through the fully connected layer for processing; represents the CLS token feature.
[0010] Preferably, in the training process described in step S2, the total loss function includes a contrast loss function and a classification loss function, and their expressions are as follows: (4); (5); (6); In the formula, , and respectively represent the total loss, contrast loss, and classification loss; and both represent hyperparameters; represents the number of samples; and respectively represent the feature representations of the th positive sample and the th positive sample; represents the temperature parameter; represents the th negative sample's feature representation; represents the one-hot encoding of the true label; represents the predicted class probability.
[0011] Preferably, in step S4, the calculation expression of the weighted similarity score is as follows: (7); Wherein, , and respectively represent the final similarity scores of crop classification, crop disease classification, and crop disease grading; and respectively represent the weight coefficients of global features and local features; and respectively represent the global features of the crop image to be graded and the crop image in the comparison feature library; and respectively represent the local features of the crop image to be graded and the crop image in the comparison feature library.
[0012] Preferably, step S5 specifically includes the following steps: S51. Set the crop category with the highest similarity score as : (8); Wherein, represents the operation function of calculating the similarity score between the crop category features of the crop image to be graded and the crop image in the comparison feature library, sorting the similarity scores, and finally selecting the crop category with the highest similarity score; S52. Take as prior knowledge and set the disease type with the highest similarity score as : (9); Wherein, represents the operation function of calculating the similarity score between the crop disease category features of the crop image to be graded and the crop image in the comparison feature library with as prior knowledge, sorting the similarity scores, and finally selecting the crop disease category feature with the highest similarity score; S53. Set the crop disease grading with the highest similarity score as : (10); Wherein, represents the operation function of calculating the similarity score between the crop disease grading features of the crop image to be graded and the crop image in the comparison feature library, sorting the similarity scores, and finally selecting the crop disease grading feature with the highest similarity score; S54. Integrate , and , the final crop disease grading diagnosis result is obtained: (11); Wherein, represents the final crop disease grading diagnosis result obtained after integrating , and ; represents the splicing operation.
[0013] Preferably, after step S5, it further includes evaluating the final crop disease grading diagnosis result using the accuracy rate index: (12); Wherein, represents the evaluation accuracy rate; , , and respectively represent the number of samples of true positive, false positive, true negative and false negative.
[0014] A system for a progressive crop disease classification and grading method based on a contrast feature library, comprising: A data collection and preprocessing module for collecting crop images and performing preprocessing; A crop image annotation module for annotating the disease type and disease severity of the preprocessed crop images; A model training module for training deep learning models respectively using the crop classification data set, crop disease classification data set and crop disease grading data set in the training set to obtain a crop classification model, a crop disease model and a disease grading model; A feature extraction module for respectively extracting crop category features, crop disease category features and crop disease grading features in the crop classification data set, crop disease classification data set and crop disease grading data set in the contrast set using the crop classification model, crop disease model and disease grading model to constitute a contrast feature library; At the same time, input the crop images to be graded into the crop classification model, crop disease model and disease grading model in sequence for feature extraction; A multi-scale feature contrast module for globally to locally contrast the extracted features with the corresponding crop category features, crop disease category features and crop disease grading features in the contrast feature library, calculating weighted similarity scores, and then sorting the similarity scores, and respectively selecting the contrast feature library labels with the highest similarity scores in the crop category features, crop disease category features and crop disease grading features as the corresponding classification results; A progressive integration module for progressively integrating the corresponding classification results to obtain the final crop disease grading diagnosis result; A model evaluation module for evaluating the accuracy of the final classification and grading results of crop diseases.
[0015] Therefore, the present invention adopts the above-mentioned progressive crop disease classification and grading method and system based on a contrast feature library, and the beneficial effects are as follows: 1. Progressive decision-making mechanism improves accuracy: Adopting a three-stage progressive decision-making process of "crop classification → disease classification → disease grading", each step narrows the scope based on the previous result (e.g., disease classification depends on the prior of crop categories), gradually refines the analysis, reduces cross-category interference, and improves the overall accuracy of classification and grading; 2. Dedicated feature library enhances pertinence: Construct three independent contrast feature libraries for crop information, disease information, and grading information, and store the deep features (global CLS token feature + local patch feature) of the corresponding tasks respectively, providing accurate feature matching for different scenarios, and improving the contrast efficiency and reliability; 3. Multi-scale feature fusion optimizes representation: Combining global features (CLS token, overall semantics) and local features (patch feature matrix, lesion details), not only retaining the overall semantic information of the image but also capturing the local features of the disease, and the multi-dimensional feature fusion makes the model's representation of crop diseases more comprehensive, improving the accuracy of similarity calculation; 4. Joint loss function optimizes the feature space: Through the joint optimization of contrast loss and classification loss, forcing similar features to gather and dissimilar features to separate, while ensuring classification discriminability, the dual constraints optimize the distribution of the feature space, enhancing the discrimination ability and generalization of features.
[0016] In summary, the present invention, by integrating a contrast feature library and deep learning, helps to optimize disease prevention and control strategies, guide the precise application of pesticides, reduce environmental pollution, lower the risk of crop drug resistance, and provide strong technical support for intelligent agriculture and sustainable disease management.
[0017] Next, through the accompanying drawings and embodiments, the technical solutions of the present invention will be further described in detail. Description of the Drawings
[0018] Figure 1 It is a flowchart of a progressive crop disease classification and grading method based on a contrast feature library according to the present invention; Figure 2 It is a framework diagram of a progressive crop disease classification and grading method based on a contrast feature library according to the present invention; Figure 3 It is a flowchart of a deep learning model of a progressive crop disease classification and grading method based on a contrast feature library according to the present invention; Figure 4 It is a flowchart of a test example according to the present invention. Detailed implementation mode
[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear and understandable, the following further details the embodiments of the present invention in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention, and are not used to limit the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative work belong to the scope of protection of this application. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions from beginning to end.
[0020] It should be noted that the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or server that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0021] The following further details the implementation mode of the present invention in conjunction with the accompanying drawings.
[0022] As Figures 1 - 3 shown, a progressive crop disease classification and grading method based on a contrast feature library includes the following steps: S1. Collect crop images containing multiple crop categories, multiple disease types and multiple disease severities and perform preprocessing (in this embodiment, crop images are obtained by integrating published dataset resources such as PlantVillage, Corn LeafInfection, etc., and crop images can also be collected on site), then label the disease types and disease severities of the preprocessed crop images to obtain a crop dataset composed of a crop classification dataset, a crop disease classification dataset and a crop disease grading dataset, divide the crop dataset into a training set and a comparison set, and store the comparison set in the comparison library; The preprocessing described in step S1 includes denoising, cropping, adjusting brightness and contrast to obtain a crop image with a size of 224×224 ; And in step S1, experts grade the diseases by annotating the size of the lesions in labelme.
[0023] In this embodiment, the crop category dataset contains 432,938 images under 59 crop categories. The crop disease category dataset is based on the crop category dataset and contains 432,938 images under 373 disease categories. The crop disease grading dataset contains 432,938 images for discriminating the severity of diseases, which are divided into four categories: healthy, slight, moderate, and severe.
[0024] S2. Use the crop classification dataset, crop disease classification dataset, and crop disease grading dataset in the training set to train the deep learning model respectively to obtain a crop classification model, a crop disease model, and a disease grading model. The deep learning model described in step S2 is a ViT-B / 16 network model. The ViT-B / 16 network model divides a crop image of size 224×224 into patches of size 16×16, and then performs a linear projection on each patch: (1); In the formula, represents the intermediate feature output after processing; represents the operation of dividing the input crop image into patches of size 16×16 and mapping them to the feature space through linear projection; Then, add positional encoding and send it into the Transformer for feature extraction: (2); (3); In the formula, represents the global feature representation output after being processed by the Transformer module; represents the Transformer module; represents the positional encoding, which is used to maintain the position information; represents the classification result output by passing through the fully connected layer for processing; represents the CLS token feature.
[0025] In the training process described in step S2, the total loss function includes a contrastive loss function and a classification loss function. The contrastive loss makes similar features closer in the feature space and dissimilar features farther apart in the feature space. The classification loss then assists the network to correctly focus on the corresponding information (crop, crop disease, disease grading level) on the crop image, and its expression is as follows: (4); (5); (6); Wherein, 、 and respectively represent the total loss, the contrast loss, and the classification loss; and both represent hyperparameters to balance the loss terms; represents the number of samples; and respectively represent the th positive sample and the th positive sample's feature representation; represents the temperature parameter; represents the th negative sample's feature representation; represents the one-hot encoding of the true label; represents the predicted class probability.
[0026] The above design enables the ViT-B / 16 network model to not only learn to distinguish the features of different classes but also optimize the feature space through contrastive learning when performing crop classification, disease classification, and disease grading tasks.
[0027] S3. Use the crop classification model, crop disease model, and disease grading model trained in step S2 to extract the crop category features, crop disease category features, and crop disease grading features in the crop classification dataset, crop disease classification dataset, and crop disease grading dataset in the contrast set respectively to form a contrast feature library; At the same time, input the crop images to be graded into the crop classification model, crop disease model, and disease grading model in sequence for feature extraction; S4. Globally to locally compare the features extracted from the crop images to be graded with the corresponding crop category features, crop disease category features, and crop disease grading features in the contrast feature library, calculate the weighted similarity scores, then sort the similarity scores, and respectively select the contrast feature library labels with the highest similarity scores in the crop category features, crop disease category features, and crop disease grading features as the corresponding classification results; In step S4, the calculation expression of the weighted similarity score is as follows: (7); Wherein, 、 and respectively represent the final similarity scores of crop classification, crop disease classification, and crop disease grading; and respectively represent the weight coefficients of the global feature and the local feature; and respectively represent the global features of the crop image to be classified and the crop images in the contrast feature library; and respectively represent the local features of the crop image to be classified and the crop images in the contrast feature library. Through the similarity calculation method from global to local, combined with weighted summation, the final classification result is obtained, ensuring that the model can fully consider the contributions of global and local features to the classification task.
[0028] S5. Gradually integrate the corresponding classification results to obtain the final crop disease grading diagnosis result.
[0029] Step S5 specifically includes the following steps: S51. Set the crop category with the highest similarity score as : (8); In the formula, represents the operation function of calculating the similarity score between the crop category features of the crop image to be classified and the crop category features of the crop images in the contrast feature library, then sorting the similarity scores, and finally selecting the crop category with the highest similarity score; S52. Take as prior knowledge, and set the disease type with the highest similarity score as : (9); In the formula, represents taking as prior knowledge, calculating the similarity score between the crop disease category features of the crop image to be classified and the crop disease category features of the crop images in the contrast feature library, then sorting the similarity scores, and finally selecting the crop disease category feature with the highest similarity score; S53. Set the crop disease grading with the highest similarity score as : (10); In the formula, represents the operation function of calculating the similarity score between the crop disease grading features of the crop image to be classified and the crop disease grading features of the crop images in the contrast feature library, then sorting the similarity scores, and finally selecting the crop disease grading feature with the highest similarity score; S54. Integrate , and to obtain the final crop disease grading diagnosis result: (11); In the formula, represents the final crop disease grading diagnosis result obtained by integrating , and ; represents the splicing operation.
[0030] Preferably, after step S5, it further includes evaluating the final crop disease grading diagnosis result using an accuracy rate index: (12); In the formula, represents the evaluation accuracy rate; , , and respectively represent the number of samples of true positive, false positive, true negative, and false negative.
[0031] Test case As Figure 4 shown, in this test case, there are about 10,000 test pictures in total, including 18 kinds of crops, 63 kinds of diseases, and 4 disease levels. The severity of crop diseases is evaluated for each picture, and its evaluation result is compared with the true label, and the evaluation accuracy rate of each level is calculated. Specifically, the test is divided into 4 stages. In the first stage, the crop category is classified; in the second stage, the crop disease category is classified; in the third stage, the severity of the crop disease is judged; in the fourth stage, the results obtained in the previous three stages are integrated to further refine and generate the final crop disease severity grading result; the severity is divided into four levels: healthy, mild, moderate, and severe.
[0032] A system for a progressive crop disease classification and grading method based on a contrast feature library, including: A data collection and preprocessing module, used to collect crop images and perform preprocessing; A crop image annotation module, used to annotate the disease type and disease severity of the preprocessed crop images; A model training module, used to train deep learning models respectively using the crop classification data set, crop disease classification data set, and crop disease grading data set in the training set to obtain a crop classification model, a crop disease model, and a disease grading model; A feature extraction module, used to extract crop category features, crop disease category features, and crop disease grading features in the crop classification data set, crop disease classification data set, and crop disease grading data set in the contrast set respectively using the crop classification model, crop disease model, and disease grading model to constitute a contrast feature library; Meanwhile, the crop images to be graded are sequentially input into the crop classification model, the crop disease model, and the disease grading model for feature extraction; The multi-scale feature comparison module is used to perform global-to-local comparisons of the extracted features with the corresponding crop category features, crop disease category features, and crop disease grading features in the comparison feature library, calculate the weighted similarity scores, sort the similarity scores, and respectively select the comparison feature library labels with the highest similarity scores among the crop category features, crop disease category features, and crop disease grading features as the corresponding classification results; The progressive integration module is used to progressively integrate the corresponding classification results to obtain the final crop disease grading diagnosis result; The model evaluation module is used to evaluate the accuracy of the final crop disease grading diagnosis result.
[0033] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that they can still modify or equivalently replace the technical solutions of the present invention, and these modifications or equivalent replacements cannot make the modified technical solutions deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A progressive crop disease classification and grading method based on a contrast feature library, characterized in that: Including the following steps: S1. Collect crop images containing multiple crop categories, multiple disease types, and multiple disease severities, and perform preprocessing. Then, label the disease types and disease severities of the preprocessed crop images to obtain a crop dataset composed of a crop classification dataset, a crop disease classification dataset, and a crop disease grading dataset. Divide the crop dataset into a training set and a comparison set, and store the comparison set in a comparison library; S2. Use the crop classification dataset, crop disease classification dataset, and crop disease grading dataset in the training set to train deep learning models respectively to obtain a crop classification model, a crop disease model, and a disease grading model; S3. Use the crop classification model, crop disease model, and disease grading model trained in step S2 to extract the crop category features, crop disease category features, and crop disease grading features in the crop classification dataset, crop disease classification dataset, and crop disease grading dataset in the comparison set respectively to form a comparison feature library; At the same time, input the crop images to be graded into the crop classification model, crop disease model, and disease grading model in sequence for feature extraction; S4. Compare the features extracted from the crop images to be graded with the corresponding crop category features, crop disease category features, and crop disease grading features in the comparison feature library globally and locally, calculate the weighted similarity scores, and then sort the similarity scores. Select the labels of the comparison feature library with the highest similarity scores in the crop category features, crop disease category features, and crop disease grading features respectively as the corresponding classification results; S5. Gradually integrate the corresponding classification results to obtain the final crop disease grading diagnosis result.
2. The progressive crop disease classification and grading method based on a comparison feature library according to claim 1, wherein: The preprocessing described in step S1 includes denoising, cropping, adjusting brightness and contrast to obtain a crop image with a size of 224×224 ; And in step S1, experts grade the diseases by labeling the size of the lesions in labelme.
3. The progressive crop disease classification and grading method based on a contrast feature library according to claim 2, wherein: The deep learning model described in step S2 is a ViT-B / 16 network model; The ViT-B / 16 network model divides a crop image of size 224×224 into patches of size 16×16, and then performs a linear projection on each patch: (1); In the formula, represents the intermediate feature output after processing; represents the operation of dividing the input crop image into 16×16-sized patches and mapping them to the feature space through linear projection. Then add positional encoding and send it into the Transformer for feature extraction: (2); (3); Wherein, represents the global feature representation output after being processed by the Transformer module; represents the Transformer module; represents the position encoding; represents the classification result output after processing through the fully connected layer ; represents the CLS token feature.
4. The progressive crop disease classification and grading method based on a contrast feature library according to claim 3, characterized in that: In the training process described in step S2, the total loss function includes a contrast loss function and a classification loss function, and its expression is as follows: (4); (5); (6); In the formula, , and represent the total loss, contrastive loss, and classification loss respectively; and both represent hyperparameters; represents the number of samples; and represent the feature representations of the -th positive sample and the -th positive sample respectively; represents the temperature parameter; represents the feature representation of the -th negative sample; represents the one-hot encoding of the true label; represents the predicted class probability.
5. The progressive crop disease classification and grading method based on a contrast feature library according to claim 4, wherein: In step S4, the calculation expression of the weighted similarity score is as follows: (7); In the formula, , and respectively represent the final similarity scores of crop classification, crop disease classification, and crop disease grading; and respectively represent the weight coefficients of global features and local features; and respectively represent the global features of the crop image to be graded and the crop image in the comparison feature library; and respectively represent the local features of the crop image to be graded and the crop image in the comparison feature library.
6. The progressive crop disease classification and grading method based on a comparison feature library according to claim 5, wherein: Step S5 specifically includes the following steps: S51. Set the crop category with the highest similarity score as : (8); In the formula, represents an operation function that calculates the similarity scores between the crop category features of the crop images to be classified and the crop category features of the crop images in the comparison feature library, then sorts the similarity scores, and finally selects the crop category with the highest similarity score. S52. Set as prior knowledge, and set the disease type with the highest similarity score as : (9); In the formula, represents an operation function that calculates the similarity scores between the crop disease category features of the crop images to be classified and the crop disease category features of the crop images in the comparison feature library using as prior knowledge, sorts the similarity scores, and finally selects the crop disease category feature with the highest similarity score. S53. Set the crop disease grading with the highest similarity score as : (10); In the formula, represents an operation function that calculates the similarity scores between the crop disease grading features of the crop images to be graded and the crop disease grading features of the crop images in the comparison feature library, then sorts the similarity scores, and finally selects the crop disease grading feature with the highest similarity score. S54. Integration , and to obtain the final crop disease grading diagnosis result: (11); In the formula, represents the final crop disease grading diagnosis result obtained by integrating , and ; represents the splicing operation.
7. The progressive crop disease classification and grading method based on a contrast feature library according to claim 6, characterized in that: After step S5, it also includes evaluating the final crop disease grading diagnosis result using an accuracy metric: (12); Wherein, represents the evaluation accuracy rate; , , and respectively represent the number of samples of true positive, false positive, true negative and false negative.
8. The system of the progressive crop disease classification and grading method based on the contrast feature library according to claim 7 above, characterized in that: Including: A data collection and preprocessing module for collecting crop images and performing preprocessing; A crop image annotation module for annotating the disease types and disease severities of the preprocessed crop images; A model training module for using the crop classification dataset, crop disease classification dataset, and crop disease grading dataset in the training set to train deep learning models respectively to obtain a crop classification model, a crop disease model, and a disease grading model; A feature extraction module for using the crop classification model, crop disease model, and disease grading model to extract the crop category features, crop disease category features, and crop disease grading features in the crop classification dataset, crop disease classification dataset, and crop disease grading dataset in the comparison set respectively to form a comparison feature library; Meanwhile, the crop images to be graded are sequentially input into the crop classification model, the crop disease model, and the disease grading model for feature extraction; The multi-scale feature comparison module is used to perform global-to-local comparisons of the extracted features with the corresponding crop category features, crop disease category features, and crop disease grading features in the comparison feature library, calculate the weighted similarity scores, sort the similarity scores, and respectively select the comparison feature library labels with the highest similarity scores among the crop category features, crop disease category features, and crop disease grading features as the corresponding classification results; The progressive integration module is used to progressively integrate the corresponding classification results to obtain the final crop disease grading diagnosis result; The model evaluation module is used to evaluate the accuracy of the final crop disease grading diagnosis result.
Citation Information
Patent Citations
Cereal grain crop disease grading method and system based on prompt-driven large model
CN119540759A
Visual detection method for crops planted in agricultural greenhouse
CN119723566A
Crop disease, disease severity and pests detection using convolution neural network and automatic notification system to increase agricultural productivity
IN201921032163A