A plant disease identification method, system and storage medium based on unsupervised category incremental learning
By generating synthetic samples through the SimSiam model and hybrid replay algorithm, the problem of real-time updating and optimization of deep learning models in plant disease detection is solved, and efficient and accurate disease identification is achieved in unsupervised scenarios, reducing data labeling costs and improving classification accuracy.
Patent Information
- Application Number
- CN202411311373.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-09-20
AI Technical Summary
Existing deep learning models cannot meet the needs of real-time updating and optimization in plant disease detection, and the category incremental learning strategy fails when new category data is unlabeled, resulting in catastrophic forgetting problems.
A method based on unsupervised category incremental learning was adopted. The SimSiam model and hybrid replay algorithm were used to generate synthetic samples. Multi-stage training was performed by constructing a loss function using the two neural network branches of the SimSiam model and negative cosine similarity. The model performance was evaluated using the KNN algorithm to achieve plant disease recognition in unsupervised scenarios.
It achieves autonomous and continuous updating and optimization of plant disease detection models, improves classification accuracy and robustness, reduces classification errors, and lowers data annotation costs.
Smart Images

Figure CN119206341B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of plant disease identification, and in particular to a plant disease identification method, system and storage medium based on unsupervised category incremental learning. Background Art
[0002] Plant leaves infected with diseases often develop diverse and complex lesions. Therefore, visible light image-based plant disease detection typically uses leaf disease images as test samples for disease identification and diagnosis. However, in practical applications of plant disease diagnosis, new diagnostic requirements sometimes arise.
[0003] In practical applications, traditional deep learning models require professional annotation of plant disease images, resulting in the majority of plant disease images being unlabeled. Traditional incremental learning strategies fail when new categories of data lack label annotations, necessitating an unsupervised incremental learning approach for plant disease image classification.
[0004] Currently, in the field of plant disease detection, there is little research on unsupervised incremental category learning, and no systematic approach has yet been established. Most existing methods use clustering-based algorithms to generate pseudo-labels for newly added categories. This algorithm requires that the number of newly added categories for each task remains constant throughout the incremental learning process, and that all newly added data belong to new categories. Traditional deep learning model updating methods use old category data together with new category data to retrain the model. This update method cannot meet the application requirements of real-time updating and optimization and has poor timeliness. If only new category data is used to update model parameters, there will be a problem of catastrophic forgetting, that is, the model completely forgets the previously learned plant disease characteristics. Therefore, there is an urgent need for a category incremental learning strategy for plant disease detection that enables the model to retain old knowledge while absorbing new knowledge. Summary of the Invention
[0005] The technical problems to be solved by the present invention are:
[0006] Existing deep learning models cannot meet the application requirements of real-time updating and optimization of models, have poor timeliness, and have the problem that the category incremental learning strategy will fail when there is no label annotation in the new category data.
[0007] The present invention is to solve the above technical problems using the following technical solutions:
[0008] The present invention provides a plant disease identification method based on unsupervised category incremental learning, comprising the following steps:
[0009] S1. Collect plant disease image datasets and divide the datasets into multiple stages of category sets according to categories;
[0010] S2, using a hybrid replay algorithm to interpolate between the image of the current task and a random image uniformly sampled and selected from the cache of old category data to generate a synthetic sample;
[0011] S3. Construct a SimSiam model, which includes two identical neural network branches that share parameters. Each branch includes a feature extraction module, a projection head, and a prediction head. Input two randomly enhanced views of the synthetic sample into the SimSiam model for training, construct a loss function based on the negative cosine similarity of the two network branches, and train the SimSiam model in multiple stages.
[0012] S4. Randomly select a portion of data from the training set as the memory data set, input the memory data set and the test set into the SimSiam network to extract features, calculate the distance between the image features of the memory data set and the image features of each test set, find the K samples with the closest distance, generate the corresponding feature labels, and evaluate the model performance;
[0013] S5. Use the trained SimSiam model to classify plant diseases.
[0014] Furthermore, in S1, the dataset is divided into category sets of multiple stages by category. Specifically, the dataset is equally divided into multiple incremental tasks by category.
[0015] Furthermore, in S1, the dataset is divided into multiple stage category sets by category. Specifically, half of the total number of categories is used as the initial tasks, and the remaining categories are equally divided into multiple tasks.
[0016] Furthermore, the generation process of synthetic samples in S2 is:
[0017]
[0018] Where λ is the interpolation coefficient, is a synthetic sample, xj, M ~M represents the sample selected from the buffer M using uniform sampling, and xi,t represents the current task.
[0019] Furthermore, the method for obtaining the two randomly enhanced views of the synthetic sample in S3 is to adopt two different data enhancement methods, including randomly adopting rotation, noise addition, scaling or flipping methods to obtain two data enhanced images.
[0020] Furthermore, during the model training process in S3, a stop gradient mechanism is introduced. That is, during the training process, the gradient is calculated only for one branch, while the stop gradient mechanism is used for the other branch without parameter update. The loss function constructed is:
[0021]
[0022] in, is the cosine similarity, and The features are obtained by mapping the prediction heads for the two branches respectively. and They are the branch vectors obtained by the extraction module for the two branches respectively.
[0023] Furthermore, in S4, the distance between the image feature of the memory dataset and each image feature of the test set is calculated, including calculating the Euclidean distance, Manhattan distance, Chebyshev distance or Mahalanobis distance between the image feature of the memory dataset and each image feature of the test set.
[0024] The present invention provides a plant disease identification system based on unsupervised category incremental learning. The system has a program module corresponding to the steps of the method described in any of the above technical solutions, and executes the steps in the above plant disease identification method based on unsupervised category incremental learning during operation.
[0025] The present invention provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to implement the steps of the plant disease identification method based on unsupervised category incremental learning described in any one of the above technical solutions when called by a processor.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] The present invention discloses a plant disease recognition method based on unsupervised category incremental learning. Based on collected plant disease leaf images, the SimSiam model is used to extract image features of plant diseases in an unsupervised scenario, thereby solving the time-consuming and costly problem of labeling a large number of disease images. In combination with a hybrid replay algorithm, random interpolation is used to generate synthetic samples of new category data, so that the model continuously adapts to unlabeled new category data during training, realizes autonomous and continuous updating and optimization of the plant disease detection model, meets the diagnosis requirements of newly added disease categories, and can further improve the accuracy and robustness of classification, and reduce classification errors caused by data changes.
[0028] The SimSiam model of the present invention simplifies the framework of contrastive learning, reduces the reliance on large-scale negative sample comparison or complex data augmentation strategies, and learns image feature representation by maximizing the similarity between different enhanced views of the same image without using negative samples, thus achieving efficient and accurate unsupervised image feature extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 Images from part of the PlantVillage dataset;
[0030] Figure 2 This is a flow chart of a plant disease identification method based on unsupervised category incremental learning in an embodiment of the present invention;
[0031] Figure 3 Schematic diagram of the hybrid playback process in an embodiment of the present invention;
[0032] Figure 4 4 is an overall workflow diagram in an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the present invention, exemplary embodiments or examples of the present invention will be described below with reference to the accompanying drawings. Obviously, the described embodiments or examples are only some of the embodiments or examples of the present invention, and not all of them. Based on the embodiments or examples of the present invention, all other embodiments or examples obtained by those skilled in the art without creative work should fall within the scope of protection of the present invention.
[0034] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0035] Combine Figure 2 and Figure 4 As shown, the present invention provides a plant disease identification method based on unsupervised category incremental learning, comprising the following steps:
[0036] S1. Collect plant disease image datasets and divide the datasets into multiple stages of category sets according to categories;
[0037] S2, using a hybrid replay algorithm to interpolate between the image of the current task and a random image uniformly sampled and selected from the cache of old category data to generate a synthetic sample;
[0038] S3. Construct a SimSiam model, which includes two identical neural network branches that share parameters. Each branch includes a feature extraction module, a projection head, and a prediction head. Input two randomly enhanced views of the synthetic sample into the SimSiam model for training, construct a loss function based on the negative cosine similarity of the two network branches, and train the SimSiam model in multiple stages.
[0039] S4. Randomly select a portion of data from the training set as the memory data set, input the memory data set and the test set into the SimSiam network to extract features, calculate the distance between the image features of the memory data set and the image features of each test set, find the K samples with the closest distance, generate the corresponding feature labels, and evaluate the model performance;
[0040] S5. Use the trained SimSiam model to classify plant diseases.
[0041] The goal of the incremental learning method of the present invention is to train the model to learn new categories in new tasks in multiple stages. Specifically, given a data set with a category set C, it is divided into T incremental tasks using incremental learning. Each incremental task contains a category set Ci (1≤i≤T), and there is no overlap between the categories of the incremental tasks. The predicted categories of the model at any stage 1≤t≤T are all the learned categories Each category set Ci(1≤i≤T) is not annotated with any labels.
[0042] SimSiam models include:
[0043] (1) Siamese network structure: It contains two identical neural network branches, which share parameters and process images with different enhancements respectively.
[0044] (2) Feature extraction module (ResNet18): Residual network ResNet18 is used as the feature extraction network.
[0045] (3) Projection head (Projection MLP): The projection head is a multi-layer perceptron (MLP) structure. The output of each branch passes through a projection head to map the features to a lower-dimensional space.
[0046] (4) Prediction head (Prediction MLP): The SimSiam model is different from other contrastive learning methods in that an additional prediction head is added to one of the branches. The role of the prediction head is to help the network better learn meaningful representations.
[0047] (5) Stop-Gradient Mechanism: During training, SimSiam only calculates the gradient for one branch and uses the “stop-gradient” technique for the other branch, i.e., it does not update its parameters. The “stop-gradient” mechanism is believed to prevent network collapse and ensure that the network can learn stable representations.
[0048] Preferably, the data set is divided into category sets of multiple stages according to categories. Specifically, the data set is evenly divided into T incremental tasks according to categories.
[0049] Preferably, the data set is divided into multiple stages of category sets by category. Specifically, half of the total number of categories are used as initial tasks, and the remaining categories are evenly divided into T tasks.
[0050] Preferably, in S2, the image of the current task (xi,t)∈Ct is interpolated with a random image uniformly sampled and selected from the cache of the old category data to generate a synthetic sample like Figure 3 As shown, specifically:
[0051]
[0052] Where λ is the interpolation coefficient, is a synthetic sample, xj, M ~M represents the sample selected from the buffer M using uniform sampling, and xi,t represents the current task. Synthetic sample It includes information about both new category data and old category data, allowing the model to continuously adapt to new tasks and new unlabeled data during training.
[0053] Preferably, the method for obtaining the two randomly enhanced views of the synthetic sample in S3 is to use two different data enhancement methods, including randomly using random rotation, noise addition, scaling or flipping to obtain two data enhanced images. and
[0054] Preferably, during the model training process in S3, the synthetic samples Two data augmented images and Input the two branches of the SimSiam network respectively, and pass through the same encoder, i.e. the ResNet18 network of the feature extraction module, to obtain two feature vectors By extracting features through ResNet18, we can obtain vectors with large receptive field and small dimension. After two MLP mappings of the projection head and the prediction head, we get Similarly get The introduction of the stop gradient mechanism means that during the training process, the gradient is calculated only for one branch, while the stop gradient mechanism is used for the other branch without updating the parameters to prevent the network from collapsing and ensure that the network can learn stable representations. The SimSiam network is trained by maximizing the similarity of the outputs of the two branches. The loss function constructed is:
[0055]
[0056] in, is the cosine similarity, and The features are obtained by mapping the prediction heads for the two branches respectively. and They are the branch vectors obtained by the extraction module for the two branches respectively.
[0057] Preferably, calculating the distance between the image feature of the memory dataset and each image feature of the test dataset in S4 includes calculating the Euclidean distance, Manhattan distance, Chebyshev distance, or Mahalanobis distance between the image feature of the memory dataset and each image feature of the test dataset. These distance metrics are used to measure the degree of difference between different feature dimensions.
[0058] In this implementation, based on the KNN algorithm, a portion of data is randomly selected from the training set as the memory data set, and the memory data set and the test set are input into the SimSiam network to extract features. For the image features P(x1, x2, ..., x n ), calculate its correlation with the image features Q(y1,y2,...,y n )’s Euclidean distance d(P,Q):
[0059]
[0060] where x1, x2, ..., x n and y1,y2,...,y n It is a feature vector in n-dimensional space; find the K samples with the closest distance and generate the corresponding feature labels to complete the evaluation of model performance.
[0061] Example 1
[0062] The dataset constructed in this example is from PlantVillage. The PlantVillage dataset contains 14 crops, 38 categories, and 54,305 images. Considering the design of the subsequent category incremental learning task, 30 plant disease categories were selected from the PlantVillage dataset, referred to as PlantVillage30, as shown in Table 1 and Figure 1 shown.
[0063] Table 1
[0064]
[0065]
[0066] In this embodiment, the incremental learning method divides the PlantVillage30 dataset into 5 tasks, each with 6 categories, and learns the model in sequence. When the model completes the training of task t (1≤t≤5), the predicted category of the model at any stage 1≤t≤T is all the categories that have been learned. The model uses the KNN algorithm to evaluate the performance of the trained model on the validation set corresponding to task t. The validation set contains all the learned categories. Validation samples.
[0067] The performance evaluation indicators of the model in this embodiment are mainly divided into two parts: accuracy and forgetting rate. The accuracy is evaluated by the average accuracy and performance degradation rate, and the forgetting rate is evaluated by the average forgetting rate, as shown in Table 2.
[0068] Table 2
[0069]
[0070] After training on the five tasks, the model achieved an average accuracy of 75.36% and an average forgetting rate of 6.87%, indicating that the proposed method has a strong ability to learn new disease categories while retaining knowledge of old disease categories.
[0071] (1) Promote the development of smart agriculture. This invention promotes the development of smart agriculture. By real-time monitoring and identification of plant diseases, farmers can manage crops more accurately and improve crop yield and quality.
[0072] (2) Improve agricultural production efficiency. The present invention can automatically identify and classify plant diseases, reducing the need for manual intervention and improving agricultural production efficiency. Farmers can more quickly understand the disease situation and take timely measures to prevent and control it, reducing the impact of diseases on crop growth and ensuring the healthy growth of crops.
[0073] (3) Reduce agricultural production costs. Unsupervised incremental learning methods reduce the cost of data annotation and improve the accuracy of disease identification, thereby reducing the cost of pest control in agricultural production. This helps farmers improve economic benefits and increase income.
[0074] The plant disease identification method (algorithm) based on unsupervised category incremental learning proposed in the present invention is the underlying technical core of the present invention, and various products can be derived based on the algorithm.
[0075] Based on the method proposed in the present invention, a plant disease identification system based on unsupervised category incremental learning is developed using a programming language. The system has program modules corresponding to the steps of the above-mentioned technical solution, and executes the steps in the above-mentioned plant disease identification method based on unsupervised category incremental learning during operation.
[0076] The developed system (software) is stored on a computer-readable storage medium as a computer program. When called by a processor, the computer program is configured to implement the steps of the plant disease identification method based on unsupervised incremental learning. This materializes the present invention on a carrier, becoming a computer program product.
[0077] Various implementations of the systems and techniques described herein can be realized in digital electronic circuitry, integrated circuitry, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0078] The computer programs (also referred to as programs, software, software applications, or code) of the present invention include machine instructions for a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., a magnetic disk, an optical disk, a memory, a programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0079] Although the present invention is disclosed as above, the scope of protection disclosed by the present invention is not limited thereto. Those skilled in the art of the present invention may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the scope of protection of the present invention.
Claims
1. A plant disease identification method based on unsupervised category incremental learning, characterized in that: The steps include: S1. Collect plant disease image datasets and divide the datasets into multiple stages of category sets according to categories; S2, using a hybrid replay algorithm to interpolate between the image of the current task and a random image uniformly sampled and selected from the cache of old category data to generate a synthetic sample; S3. Construct a SimSiam model, which includes two identical neural network branches that share parameters. Each branch includes a feature extraction module, a projection head, and a prediction head. Input two randomly enhanced views of the synthetic sample into the SimSiam model for training, construct a loss function based on the negative cosine similarity of the two network branches, and train the SimSiam model in multiple stages. S4. Randomly select a portion of data from the training set as the memory data set, input the memory data set and the test set into the SimSiam network to extract features, calculate the distance between the image features of the memory data set and the image features of each test set, find the K samples with the closest distance, generate the corresponding feature labels, and evaluate the model performance; S5. Use the trained SimSiam model to classify plant diseases.
2. The plant disease identification method based on unsupervised category incremental learning according to claim 1, characterized in that: In S1, the dataset is divided into multiple stage category sets by category. Specifically, the dataset is equally divided into multiple incremental tasks by category.
3. The plant disease identification method based on unsupervised category incremental learning according to claim 1, characterized in that: In S1, the dataset is divided into multiple stages of category sets by category. Specifically, half of the total number of categories are used as initial tasks, and the remaining categories are equally divided into multiple tasks.
4. The plant disease identification method based on unsupervised category incremental learning according to claim 2 or 3, characterized in that: The generation process of synthetic samples in S2 is: Where λ is the interpolation coefficient, is a synthetic sample, xj, M ~M represents the sample selected from the buffer M using uniform sampling, and xi,t represents the current task.
5. The plant disease identification method based on unsupervised category incremental learning according to claim 4, characterized in that: The method for obtaining the two randomly enhanced views of the synthetic sample in S3 is to use two different data enhancement methods, including randomly rotating, adding noise, scaling or flipping to obtain two data enhanced images.
6. The plant disease identification method based on unsupervised category incremental learning according to claim 1, characterized in that: During the model training process in S3, a stop gradient mechanism is introduced. That is, during the training process, the gradient is calculated for only one branch, while the stop gradient mechanism is used for the other branch without parameter update. The loss function constructed is: in, is the cosine similarity, and The features are obtained by mapping the prediction heads for the two branches respectively. and They are the branch vectors obtained by the extraction module for the two branches respectively.
7. The plant disease identification method based on unsupervised category incremental learning according to claim 5 or 6, characterized in that: In S4, the distance between the image feature of the memory dataset and the image feature of each test set is calculated, including calculating the Euclidean distance, Manhattan distance, Chebyshev distance or Mahalanobis distance between the image feature of the memory dataset and the image feature of each test set.
8. A plant disease identification system based on unsupervised category incremental learning, characterized in that: The system has a program module corresponding to the steps of the method described in any one of claims 1 to 7, and executes the steps of the plant disease identification method based on unsupervised category incremental learning when running.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is configured to implement the steps of the plant disease identification method based on unsupervised category incremental learning according to any one of claims 1 to 7 when called by a processor.
Citation Information
Patent Citations
A fine-grained classification method for crop diseases based on Swin-Transformer
CN114937021A
Comparative learning-based unsupervised pre-training-fine tuning type radar target identification method
CN115047423A