A solanaceae disease grade identification method based on transfer learning
The K-means algorithm was used to preprocess the images of Solanaceae plants, and the improved MSS-ResNet101 model was used for transfer learning and feature recognition. This solved the problem of low sensitivity of the Solanaceae disease level identification model to fine-grained features, and improved the accuracy and efficiency of disease identification.
Patent Information
- Application Number
- CN202310131684.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-02-15
AI Technical Summary
Existing disease severity identification models for Solanaceae families suffer from insufficient fine-grained image processing and a limited number of training images. This results in low sensitivity of the network model to fine-grained features, leading to low accuracy and overfitting, which in turn affects the efficiency and accuracy of disease identification.
The K-means algorithm was used to preprocess the images of Solanaceae, and the improved MSS-ResNet101 model was used for transfer learning. A new classification layer was formed by adding a fully connected layer before the softmax classification layer. The model was trained and fine-tuned, and disease features were extracted and identified by combining multi-scale feature structure and convolutional kernel attention mechanism.
It improves the accuracy of identifying solanaceous diseases, solves the problem of low precision or overfitting caused by the low sensitivity of fine-grained features, and achieves more efficient disease severity classification identification.
Smart Images

Figure CN116612307B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a Solanaceae disease grade identification method based on transfer learning. BACKGROUND
[0002] With the development of agricultural economy, more and more plants are planted and cultivated by mechanization, but various factors will affect the growth of plants in the actual planting process, among which diseases are a great factor affecting plant growth. A large number of crops are damaged by different plant diseases every year, resulting in a large loss. Therefore, in order to ensure crop yield and plant life, it is necessary to accurately detect and identify plant diseases.
[0003] Although there are model calculation methods for Solanaceae disease grade identification in the prior art, the existing methods do not have enough granularity in processing pictures, and there is a limitation of insufficient number of training images, which leads to low precision or overfitting problem caused by low sensitivity of network model to fine-grained features, thereby affecting disease identification efficiency and easily causing data errors to result in poor accuracy.
[0004] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0005] The main purpose of the present application is to provide a Solanaceae disease grade identification method based on transfer learning, which aims to solve the technical problems of low precision or overfitting caused by low sensitivity of network model to fine-grained features due to insufficient granularity in processing pictures and limitation of insufficient number of training images in the prior art.
[0006] To achieve the above purpose, the present application provides a Solanaceae disease grade identification method based on transfer learning, which comprises the following steps:
[0007] The obtained Solanaceae images are preprocessed based on the K-means algorithm to obtain processed images;
[0008] The processed images are subjected to disease feature identification based on a preset disease grade identification model based on transfer learning, and the Solanaceae disease images are determined according to the feature identification results, wherein the preset disease grade identification model based on transfer learning is a model obtained by transferring the model parameters and parameter weights of the improved MSS-ResNet101 model to a pre-training model, and the model is obtained by training the classification layer in the transferred model, wherein the classification layer refers to a new classification layer formed by adding a fully connected layer before the softmax classification layer;
[0009] The lesion area in the Solanaceae disease image is counted, and the Solanaceae disease degree is determined according to the counting result.
[0010] Optionally, the step of pre-processing the obtained solanaceae images based on the K-means algorithm to obtain processed images comprises:
[0011] Segmenting the obtained solanaceae images based on the K-means algorithm to obtain a pixel point dataset;
[0012] Segmenting the solanaceae images based on the pixel similarity corresponding to the pixel point dataset, and extracting images containing key disease characteristics from the segmented images.
[0013] Optionally, before the step of identifying disease characteristics of the processed images based on the preset disease level recognition model based on transfer learning and determining the solanaceae disease images according to the feature recognition result, the method further comprises:
[0014] Using an ImageNet image dataset as a source dataset for transfer training;
[0015] Training the improved MSS-ResNet101 model based on the ImageNet source dataset to obtain a pre-trained model;
[0016] Constructing a preset disease level recognition model based on transfer learning based on the parameters and weights corresponding to the pre-trained model and the pre-trained model.
[0017] Optionally, the step of constructing a preset disease level recognition model based on transfer learning based on the parameters and weights corresponding to the pre-trained model and the pre-trained model comprises:
[0018] Initializing the pre-trained model by taking the parameters and weights of the pre-trained model as the initialization parameters of the network, and freezing the structure before the global average pooling layer to obtain a pre-trained model to be improved;
[0019] Adding a fully connected layer before the softmax classification layer of the pre-trained model to be improved to form a new classification layer, and modifying the network parameters corresponding to the softmax classification layer to adapt to the solanaceae disease degree grading task to obtain a target pre-trained model;
[0020] Training the new classification layer in the target pre-trained model to obtain a trained model;
[0021] Fine-tuning the network parameters corresponding to the trained model to obtain a preset disease level recognition model based on transfer learning.
[0022] Optionally, the step of identifying disease characteristics of the processed images based on the preset disease level recognition model based on transfer learning and determining the solanaceae disease images according to the feature recognition result comprises:
[0023] The preset migration learning-based disease grade identification model weakens the background in the processed image, and obtains a target image highlighting disease features;
[0024] Different scales of disease features are extracted from the target image through a multi-scale feature structure in the preset migration learning-based disease grade identification model;
[0025] The preset migration learning-based disease grade identification model is used to identify the disease features, and a solanaceous disease image is determined according to a feature identification result.
[0026] Optionally, the step of counting the disease spot area in the solanaceous disease image and determining the solanaceous disease degree according to a statistical result includes:
[0027] The preset migration learning-based disease grade identification model is used to identify the disease class of the solanaceous disease image, and a disease class is obtained;
[0028] The solanaceous disease image is classified according to the disease class, and a solanaceous disease image set of each disease type is obtained;
[0029] The disease spot area in the solanaceous disease image set of each disease type is counted, and the solanaceous disease degree is determined according to a statistical result.
[0030] Optionally, the step of counting the disease spot area in the solanaceous disease image set of each disease type and determining the solanaceous disease degree according to a statistical result further includes:
[0031] The total pixel quantity of the disease spot area region is obtained;
[0032] The single-leaf disease degree is determined according to the total pixel quantity and the total pixel quantity of the entire leaf region;
[0033] The single-leaf disease degrees in the solanaceous disease image set of each disease type are counted, and the solanaceous disease degree grade is determined according to a disease degree statistical result.
[0034] The application obtains a processed image by preprocessing the obtained solanaceae image based on a K-means algorithm; disease feature recognition is performed on the processed image based on a preset disease level recognition model of transfer learning, and a solanaceae disease image is determined according to the feature recognition result, the preset disease level recognition model of transfer learning is a model obtained by migrating model parameters and parameter weights of an improved MSS-ResNet101 model to a pre-training model, and a model obtained by training a classification layer in the migrated model, the classification layer refers to a new classification layer formed by adding a full connection layer before a softmax classification layer. The disease spot area in the solanaceae disease image is counted, and the solanaceae disease degree is determined according to the counting result. Since the K-means algorithm is used to preprocess the obtained solanaceae image, and the disease feature recognition is performed on the solanaceae image according to the migrated model, and the solanaceae disease image is determined according to the feature recognition result, the disease degree is further determined, compared with the existing technology, the fine granularity of the picture processing is not enough, and there is a limitation of insufficient training image quantity, which leads to low precision or overfitting of the network model due to low sensitivity of the network model to fine granularity characteristics, the application solves the problem of low precision or overfitting caused by low sensitivity of the solanaceae plant disease degree classification recognition model to fine granularity characteristics, and improves the disease recognition rate. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 is a structure schematic diagram of the hardware running environment of the solanaceae disease level recognition device based on transfer learning involved in the embodiment scheme of the application;
[0036] Figure 2 is a flowchart of the first embodiment of the solanaceae disease level recognition method based on transfer learning of the application;
[0037] Figure 3 is a K-means elbow method schematic diagram of the first embodiment of the solanaceae disease level recognition method based on transfer learning of the application;
[0038] Figure 4 is an image segmentation schematic diagram of the first embodiment of the solanaceae disease level recognition method based on transfer learning of the application;
[0039] Figure 5 is a transfer learning flowchart of the first embodiment of the solanaceae disease level recognition method based on transfer learning of the application;
[0040] Figure 6 is a flowchart of the second embodiment of the solanaceae disease level recognition method based on transfer learning of the application;
[0041] Figure 7 is a transfer training schematic diagram of the second embodiment of the solanaceae disease level recognition method based on transfer learning of the application;
[0042] Figure 8 This is a schematic diagram showing the comparison of the recognition rate of the validation set before and after transfer learning in the second embodiment of the solanaceous disease level identification method based on transfer learning of the present invention.
[0043] Figure 9 This is a schematic diagram illustrating the impact of different optimization algorithms on the change of loss value in the second embodiment of the solanaceous disease level identification method based on transfer learning of the present invention.
[0044] Figure 10 This is a schematic diagram of the confusion matrix for classifying the severity of tomato diseases according to the second embodiment of the solanaceous disease severity identification method based on transfer learning of the present invention.
[0045] Figure 11 This is a structural block diagram of the first embodiment of the solanaceous disease level identification device based on transfer learning of the present invention.
[0046] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0047] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0048] Reference Figure 1 , Figure 1 This is a schematic diagram of the hardware operating environment for identifying the disease level of Solanaceae family based on transfer learning, which is part of the embodiment of the present invention.
[0049] like Figure 1 As shown, the solanaceous disease level identification device based on transfer learning may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen, and optionally, it may also include a standard wired interface or a wireless interface. In this invention, the wired interface of the user interface 1003 may be a USB interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) or a non-volatile memory (NVM), such as a disk storage device. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0050] Those skilled in the art can understand that Figure 1 The structure shown in the figure does not constitute a limitation on the device for identifying Solanaceae disease grades based on transfer learning, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.
[0051] As Figure 1 As shown, the memory 1005, which is identified as a computer storage medium, can include an operating system, a network communication module, a user interface module, and a program for identifying Solanaceae disease grades based on transfer learning.
[0052] In Figure 1 In the device for identifying Solanaceae disease grades based on transfer learning, the network interface 1004 is mainly used to connect a background server and communicate data with the background server; the user interface 1003 is mainly used to connect a user device; the device for identifying Solanaceae disease grades based on transfer learning calls the program for identifying Solanaceae disease grades based on transfer learning stored in the memory 1005 through the processor 1001, and executes the method for identifying Solanaceae disease grades based on transfer learning provided by the embodiments of the present application.
[0053] Based on the above hardware structure, embodiments of the method for identifying Solanaceae disease grades based on transfer learning are proposed.
[0054] Referring to Figure 2 , Figure 2 The flowchart of the first embodiment of the method for identifying Solanaceae disease grades based on transfer learning is proposed.
[0055] In this embodiment, the method for identifying Solanaceae disease grades based on transfer learning includes the following steps:
[0056] Step S10: Preprocess the obtained Solanaceae image based on the K-means algorithm to obtain a processed image.
[0057] It should be noted that the execution subject of the present embodiment can be a device with the function of identifying Solanaceae disease grades, such as a computer, a notebook, a computer, a tablet, etc., and can also be other Solanaceae disease grade identification devices that can achieve the same or similar functions. The present embodiment does not limit this. Hereinafter, the present embodiment and each of the following embodiments will be described taking the above computer as an example.
[0058] Understandably, Solanaceae images can refer to Solanaceae images that require disease identification. These images include leaf images of the Solanaceae plant to be identified, as well as images of normal leaves. In order to accurately identify leaf images with lesions, disease images need to be screened out from the Solanaceae images before disease identification. Therefore, plant images need to be preprocessed to accurately identify disease images.
[0059] It should be understood that the plants to be identified in the Solanaceae family include, but are not limited to, tomatoes, eggplants, peppers, and potatoes. These plants are all widely cultivated crops with high economic value and can also be plants grown in daily life. This embodiment does not impose specific limitations on them.
[0060] Furthermore, step S10 also includes: performing pixel segmentation on the acquired Solanaceae image based on the K-means algorithm to obtain a pixel dataset; segmenting the Solanaceae image according to the pixel similarity corresponding to the pixel dataset, and extracting images containing key disease features from the segmented images.
[0061] It should be noted that the core idea of the K-means algorithm is to randomly select K data points as centroids from the data to be classified, then measure the similarity between the centroids and other data points using a certain method. By continuously updating the centroids, the data samples are successfully divided into K distinct clusters when the centroids no longer change. The value of K in the K-means algorithm is generally selected based on the elbow method, as shown in the example below. Figure 3 The diagram shows the K-means elbow method. Figure 3 The K value on the x-axis represents the number of categories in the data, and the K value on the y-axis represents the number of SSE The sum of squared errors (SQU) is the core metric used in the elbow method to measure clustering effectiveness, and its specific form is shown in the following formula:
[0062] ;
[0063] Where, in the formula Indicates the first i Clusters, j express The sample points, express The mean of all samples in the dataset. SSE represents the sum of squared clustering errors for all samples; its value decreases as the value of K increases, and the rate of decrease also increases. K The value decreases as it increases, and when the rate of decrease begins to level off, the corresponding K value is the optimal number of clusters.
[0064] It can be understood that the image is segmented and preprocessed by using the K-means algorithm, the pixel points of the image are taken as a data set, and the image is divided according to the similarity between the pixel points, so as to achieve the purpose of image segmentation. Image segmentation aims to extract the required information from the target image. Preprocessing the original image by using the image segmentation method can enhance the key features in the disease image and weaken the noise interference in the disease image, thereby effectively improving the recognition accuracy of the classification model. The image obtained after image segmentation preprocessing is the basis for accurate positioning of features and parameter measurement. Fully utilizing the image obtained after segmentation is helpful for the realization of image analysis, image classification and target detection and other tasks. For the unsupervised image clustering problem, the image is often divided into regions with different feature meanings by using the feature similarity of adjacent regions of the image, so as to convert the image segmentation problem into an unsupervised clustering problem and enhance the key features of the image.
[0065] It should be understood that, in order to improve the recognition effect of fine-grained image classification, the unsupervised K-means segmentation algorithm is used to preprocess the image, and the disease characteristics and interference factors in the tomato disease are preliminarily extracted and filtered. And the image processed by image segmentation is used as a new input image to extract key disease characteristics, so as to further enhance the distinguishing ability of the CNN model to disease characteristics and improve the recognition accuracy of the model. For example, taking bacterial spot disease of tomato leaves as an example, the disease image after image segmentation by using the K-means algorithm is as shown in the image segmentation diagram Figure 4 As can be seen from the figure, the key features in the disease image are enhanced to improve the recognition of fine-grained image processing.
[0066] Step S20: performing disease feature recognition on the processed image based on a preset disease grade recognition model based on transfer learning, and determining a solanaceae disease image according to the feature recognition result, wherein the preset disease grade recognition model based on transfer learning is a model obtained by migrating model parameters and parameter weights of an improved MSS-ResNet101 model to a pre-training model and training a classification layer in the migrated model, and the classification layer refers to a new classification layer formed by adding a fully connected layer before a softmax classification layer.
[0067] It should be noted that the model-based transfer learning method is to migrate the model weights and parameters pre-trained on a large source data set to a target data set with small data volume but similar to the source data set, and the migration learning process diagram is as shown in Figure 5The model migration includes two modes: one is to use a pre-trained network as a feature extractor, load all parameters of the pre-trained model except the top layer during migration, modify the number of classification categories of the top layer model classifier to adapt to the new task, then freeze the feature extraction part of the model, and train the target data domain using the top layer classifier to obtain the final target task model; the other is to fine-tune the model, and constantly update the pre-trained model migration weight or parameter by using the target task data to better adapt to the new task.
[0068] It can be understood that the preset migration learning disease grade identification model can be a model for disease grade identification obtained by model migration learning in advance, the preset migration learning disease grade identification model is a model obtained by migrating the model parameters and parameter weights of the improved MSS-ResNet101 model to a pre-trained model and training a classification layer in the migrated model, wherein the classification layer refers to adding a fully connected layer before a softmax classification layer to form a new classification layer.
[0069] It should be understood that the improved MSS-ResNet101 model is a model improved on the basis of a ResNet101 model, which is composed of four BottleNeck blocks, each block having four residual modules, and the front end and the rear end of the network each having a 7x7 convolutional layer, a maxpool layer, and an average pooling layer. The improved MSS-ResNet101 model includes a multi-scale structure Inception module replacing the 7x7 convolution in the original ResNet101 model and a residual module incorporating a convolution kernel attention mechanism, the multi-scale structure Inception module being connected to the residual module, and the residual module being connected to a global average pooling layer; the multi-scale structure Inception module is used for feature extraction of the input image, and the obtained multi-scale structure feature map is input to the residual module; the residual module is used for feature fusion of the multi-scale structure feature map according to the convolution kernel attention mechanism, and the fused feature information is input to the global average pooling layer and the Softmax layer for classification recognition. The convolution kernel attention mechanism SKNet is introduced into the residual structure of ResNet101, which can effectively help the model to capture semantic information useful for recognition tasks, suppress the influence of noise and other interference factors, highlight key areas, and enhance the expression ability of the model. The receptive field of a single-scale convolution kernel is fixed, and the extraction of feature information is limited. Therefore, the Inception multi-scale structure Inception module is embedded in the RseNet101 to enhance the richness of the feature channel, thereby obtaining better recognition effect and improving the recognition accuracy. The improved MSS-ResNet101 model is based on the ResNet101 network model, combines the multi-scale structure Inception module and the convolution kernel attention mechanism SKNet, obtains the improved multi-scale network model (Multi-Scale-SK-ResNet101, hereinafter referred to as MSS-ResNet101) incorporating the convolution kernel attention mechanism, uses the Inception module to replace the 7x7 convolution in the original ResNet101, and incorporates the convolution kernel attention mechanism in each residual module. Finally, the global average pooling layer and the Softmax layer are retained.
[0070] In a specific implementation, the processed plant image is subjected to feature extraction by a multi-scale structure Inception module in a preset transfer learning disease grade recognition model, a multi-scale structure feature map is obtained, and the multi-scale structure feature map is subjected to feature fusion according to a convolution kernel attention mechanism in a residual module, the fused feature information is input to a new classification layer for disease feature recognition, and a solanaceous disease image is determined according to a feature recognition result.
[0071] Further, before the step S20, the method further comprises: using an ImageNet image dataset as a source dataset for transfer training; training the improved MSS-ResNet101 model based on the ImageNet source dataset to obtain a pre-training model; and constructing a preset transfer learning disease grade identification model based on parameters and weights corresponding to the pre-training model and the pre-training model.
[0072] It should be noted that, in the transfer training process, considering that the source dataset and the target dataset need to have a certain similarity, the ImageNet image dataset is used as the source dataset for transfer training. The ImageNet image dataset contains a total of 1.2 million images and 1000 categories, and is a large high-quality dataset. The ImageNet image dataset has SIFT features (scale invariant transform features), so even if the image is scaled, rotated, brightness adjusted, etc., it can still ensure good recognition effect. The use of this dataset for pre-training can not only enable the model to obtain better recognition accuracy in the actual training process, but also enable the trained model to have stronger generalization ability.
[0073] It should be understood that the improved MSS-ResNet101 model is trained based on the ImageNet source dataset to obtain a pre-training model. The pre-training model can refer to a pre-training model derived by training the ImageNet source data using the improved MSS-ResNet101 model and ending the training after convergence.
[0074] It should be understood that the improved MSS-ResNet101 model is trained based on the ImageNet source dataset to obtain a pre-training model. The pre-training model can refer to a pre-training model derived by training the ImageNet source data using the improved MSS-ResNet101 model and ending the training after convergence.
[0075] Step S30: Counting the lesion area in the solanaceous disease image, and determining the solanaceous disease degree according to the counting result.
[0076] It should be noted that the lesion area of the solanaceous plant is determined by the lesion area, and the lesion area can be determined according to the lesion pixel in the disease image.
[0077] It should be understood that the lesion area of different disease types also reflects different characteristics, so the lesion area of different disease types can be counted to accurately count the disease degree of the solanaceous plant of each disease type.
[0078] Further, the step S30 further includes: performing disease class recognition on the solanaceous disease image based on the preset disease level recognition model of transfer learning to obtain a disease class; classifying the solanaceous disease image according to the disease class to obtain a solanaceous disease image set of each disease type; and performing statistics on lesion area in the solanaceous disease image set of each disease type, and determining the solanaceous disease degree according to the statistics result.
[0079] It should be noted that the disease type includes the disease type corresponding to the solanaceous plant, and the disease type corresponding to different solanaceous plants is different, and the performance characteristics are also different. The disease type is usually determined by the lesion characteristics of the leaf. For example, if the plant is tomato, the disease type corresponding to the tomato is determined by recognizing the lesion characteristics of the tomato leaf. The disease type can include bacterial spot, early blight, late blight, leaf mold, brown spot, two-spotted spider mite disease, ring spot disease, mosaic disease, yellowing and curly leaf disease, etc.
[0080] Comparing the lesion characteristics contained in the solanaceous disease image with the lesion characteristics in the solanaceous disease image in the lesion characteristic library can determine the disease class corresponding to the lesion characteristics contained in the solanaceous disease image, so as to determine the disease class corresponding to the plant, so as to ensure accurate pest control in the later stage, thereby improving the yield and reducing the loss of the plant caused by the disease.
[0081] It can be understood that by performing disease class recognition on the lesion in the solanaceous disease image containing the disease characteristics, the disease class corresponding to the disease image is determined, and the solanaceous disease image is classified according to the recognized disease class to obtain a solanaceous disease image set of each disease type, so as to facilitate the statistics of the disease degree of each disease type in the later stage.
[0082] In a specific implementation, the disease class of the solanaceous disease image is recognized based on the preset disease level recognition model of transfer learning, and the solanaceous disease image is classified according to the disease class to obtain a solanaceous disease image set of each disease type. The lesion area in the solanaceous disease image set of each disease type is counted, and the solanaceous disease degree is determined according to the statistics result.
[0083] Further, the step of counting the lesion area in the solanaceous disease image set of each disease type and determining the solanaceous disease degree according to the statistics result further includes: obtaining the total pixel amount of the lesion area; determining the single-leaf disease degree according to the total pixel amount and the total pixel amount of the whole leaf area; counting the single-leaf disease degree in the solanaceous disease image set of each disease type, and determining the solanaceous disease degree grade according to the disease degree statistics result.
[0084] It should be noted that the single-leaf disease degree can be obtained by calculating the proportion of the total pixel amount of the lesion area to the whole leaf area. The specific calculation formula is as follows:
[0085] ;
[0086] In the formula R represents the classification result of the current tomato leaf disease degree, S 病 represents the total number of pixels of the disease spot, S 总 represents the total number of pixels of the whole leaf.
[0087] It can be understood that the disease degree is calculated according to the percentage of the total area of the leaf disease spot to the total area of the leaf. In the embodiment, the solanaceous plant is taken as an example of tomato, and the specific calculation standard for the disease degree of tomato is shown in Table 1:
[0088] Table 1 Classification standard of tomato leaf disease area ratio
[0089]
[0090] In the embodiment, the obtained solanaceous image is preprocessed based on the K-means algorithm to obtain a processed image; a disease feature of the processed image is recognized based on a preset disease level recognition model of transfer learning, and a solanaceous disease image is determined according to a feature recognition result. The preset disease level recognition model of transfer learning is a model obtained by migrating model parameters and parameter weights of an improved MSS-ResNet101 model to a pre-training model, and training a classification layer in the migrated model to obtain the model. The classification layer refers to a new classification layer formed by adding a full connection layer before a softmax classification layer. The area of the disease spot in the solanaceous disease image is counted, and the disease degree of the solanaceous plant is determined according to the counting result. Since the solanaceous image is preprocessed by the K-means algorithm, and the disease feature of the solanaceous image is recognized according to the migrated model, and the solanaceous disease image is determined according to the feature recognition result, the disease degree is further determined. Compared with the prior art, the granularity of the picture processing is not enough, and there is a limitation of insufficient training images, which leads to low precision or overfitting of the network model due to low sensitivity of the network model to fine-grained features. The present application solves the problem of low precision or overfitting of the solanaceous plant disease degree classification recognition model due to low sensitivity of the network model to fine-grained features, and improves the disease recognition rate.
[0091] Referring to Figure 6 , Figure 6 is a flowchart of the second embodiment of the solanaceous disease level recognition method based on transfer learning of the present application, based on the first embodiment shown in the above Figure 2 Based on the first embodiment shown in the above
[0092] In the embodiment, the step of constructing the preset migration learning disease grade identification model based on the parameters and weights corresponding to the pre-trained model and the pre-trained model comprises: initializing the pre-trained model by taking the parameters and weights of the pre-trained model as initialization parameters of a network, freezing the structure before a global average pooling layer, and obtaining a pre-trained model to be improved; adding a fully connected layer before a softmax classification layer of the pre-trained model to be improved to constitute a new classification layer, modifying network parameters corresponding to the softmax classification layer to be suitable for the Solanaceae disease degree grading task, and obtaining a target pre-trained model; training the new classification layer in the target pre-trained model, and obtaining a trained model; fine-tuning network parameters corresponding to the trained model, and obtaining the preset migration learning disease grade identification model.
[0093] It should be noted that for the tomato disease degree grading identification model based on migration learning, the features learned by the pre-trained model have a positive effect on tomato disease degree grading, and fine-tuning the entire network is beneficial to network training, so the chapter adopts the form of feature extraction combined with fine-tuning for migration learning. The migration training process is as shown in the migration training schematic diagram. Figure 7 The migration training process can be divided into the following steps.
[0094] Step one: train the ImageNet source data by using the improved MSS-ResNet101 model, end the training after convergence, export the pre-trained model, and save the parameters and weights thereof as initialization parameters of the network.
[0095] Step two: initialize the model by using the parameters and weights of the pre-trained model in step one, freeze the structure before the global average pooling layer so that it does not participate in the update of model training, add a fully connected layer before the softmax classification layer to constitute a new classification layer, and train from scratch, and modify the softmax classification layer to 16 to be suitable for the Solanaceae plant (such as tomato) disease degree grading task.
[0096] Step three: fine-tune the trained network parameters to avoid overfitting caused by small data volume, and improve the high-level semantic extraction capability of the model.
[0097] Understandably, during model training, under the condition of a relatively balanced number of data samples for each category of tomato diseases, a larger data sample size will result in better model performance. This is especially true in fine-grained image classification tasks, where data samples have an immeasurable impact; abundant sample images can significantly improve the model's recognition performance. Therefore, to ensure model performance, the number of samples for each tomato disease severity category should be as large as possible. However, due to factors such as uncontrollable disease severity, large seasonal variations, high labor costs, and long time spans, collecting a large number of sample images of tomato disease severity is quite difficult. Therefore, in this study on the graded identification of solanaceous disease severity, the target dataset can be composed of Plant Village tomato disease samples and the Dataset of TomatoLeaves dataset, with bacterial leaf spot, late blight, leaf spot, and healthy leaves selected as the final sample data. Since the final dataset did not differentiate between the severity of diseases, this approach first divides the dataset based on the disease severity grading standards and the area ratio of diseased regions. Then, it reclassifies the citrus disease samples according to the color depth of the diseased areas through manual re-examination and classification to ensure the accuracy of the dataset classification.
[0098] It should be understood that before outputting the trained model, experiments were conducted to verify the impact of the proposed transfer learning method and fine-tuning on the recognition performance of the MSS-ResNet101 model. The accuracy comparison results on the training and validation sets are shown in Table 2. Table 2 shows that the transfer learning method improves the recognition performance on both the training and validation sets compared to the method without transfer learning. Fine-tuning based on transfer learning further enhances the model's recognition performance, ultimately achieving a recognition rate of 87.05% on the validation set. Meanwhile, according to... Figure 8 The diagram showing the comparison of recognition rates on the validation set before and after transfer learning clearly demonstrates that the transfer learning method can significantly improve the model's recognition starting point, thus verifying the effectiveness and superiority of the proposed method. Furthermore, during the model optimization process, to verify the impact of different optimization algorithms on the model's recognition performance, three different optimization algorithms were used to train the model under the same experimental conditions. The accuracy results on the training and validation sets are shown in Table 2, and the loss value variation curves are plotted as follows. Figure 9 The diagram illustrates the impact of different optimization algorithms on the change in loss value. Table 3 shows that, in terms of training accuracy, the SGDM algorithm improves by 1.79% and 0.85% compared to SGD and Adam, respectively; in terms of validation accuracy, the SGDM algorithm improves by 1.1% and 0.64% compared to SGD and Adam, respectively; and... Figure 9It can be seen that the loss value of the SGDM algorithm decreases slightly faster as a whole, and the final converged loss value is lower. Therefore, the SGDM optimization algorithm can achieve better results in terms of accuracy and convergence value. Therefore, before outputting the target model, the model is optimized by the SGDM optimization algorithm to obtain the optimal model.
[0099] Table 2 Comparison of recognition performance before and after transfer learning
[0100]
[0101] Table 3 Influence of different optimization algorithms on recognition performance
[0102]
[0103] In a specific implementation, after obtaining the optimal model through the above method, the model is output and the recognition accuracy and misjudgment rate of the model for each disease degree category are verified. The trained optimal model is used to recognize the test set of tomato samples, and the confusion matrix diagram of tomato disease degree classification recognition is as shown in Figure 10 Figure 10 It can be clearly seen that the misrecognition rate of different disease classifications is relatively high, for example: the probability of 7-level late blight being misidentified as 5-level late blight is 0.07, and the probability of being misidentified as 9-level late blight is 0.08. The reason for this may be that the training classification sample label required by the present scheme is manually labeled, and there may be errors. The present scheme aims to solve the problem of high requirement for distinguishing key features of sample images in Solanaceae plant disease degree classification recognition. First, the unsupervised K-maens segmentation method is used to enhance the disease features in the tomato disease image sample, and the improved MSS-ResNet101 model is combined with transfer learning to pre-train the ImageNet dataset to obtain the corresponding parameters and weights. Then, the classification layer is locally fine-tuned to realize the Solanaceae disease degree classification recognition task. The experimental results of the above model show that the final recognition rate of the model transfer learning method proposed in the present scheme on the validation set is 88.15%, and the SGDM optimization algorithm is more suitable for the model in the present scheme compared with SGD and Adam.
[0104] Further, the step S20 comprises:
[0105] Step S201: Based on the preset transfer learning disease level recognition model, the background in the processed image is weakened to obtain a target image highlighting disease features.
[0106] It should be noted that the preset transfer learning disease level recognition model is used to weaken the background in the processed image to obtain a target image highlighting disease features.
[0107] Step S202: Extracting disease features of different scales from the target image through the multi-scale feature structure in the preset disease grade identification model based on transfer learning.
[0108] It should be noted that the multi-scale structure Inception module in the preset disease grade identification model based on transfer learning is used to perform multi-scale feature extraction on the processed plant image to obtain a multi-scale structure feature map.
[0109] It can be understood that the Inception module expands the convolution operation between different network layers and uses convolution kernels of different sizes to extract features to obtain different receptive fields. The network structure is as shown in Figure 3 The input is first subjected to parallel convolution operation, which is 1x1 convolution, series connection of 1x1 convolution and 3x3 convolution, series connection of 1x1 convolution and 5x5 convolution, and series connection of 3x3 maximum pooling layer and 1x1 convolution. Finally, the features extracted from the four parts are spliced in the channel dimension direction to obtain a multi-scale structure feature map. Different sizes of convolution kernels can obtain various local features. Fusing the features obtained under different receptive fields can greatly enrich the feature information extracted by the model, thereby improving the recognition performance.
[0110] In a specific implementation, according to the Split operation corresponding to the convolution kernel attention mechanism SKNet in the residual structure in the preset disease grade identification model based on transfer learning, multi-path convolution is performed on the multi-scale structure feature map to obtain a feature map after convolution; according to the Fuse operation, the feature map after convolution is summed element by element to obtain a new feature map; and according to the Select operation, feature fusion is performed on the new feature map to obtain a disease feature map of different scales.
[0111] Step S203: Identifying the disease features based on the preset disease grade identification model based on transfer learning, and determining a solanaceae disease image according to the feature recognition result.
[0112] It should be noted that the disease feature map of different scales obtained by the above fusion is input into the global average pooling layer, the fully connected layer and the Softmax layer for disease feature recognition, and a solanaceae disease image is determined according to the feature recognition result.
[0113] The embodiment obtains a processed image by preprocessing the obtained solanaceae images based on a K-means algorithm; obtains a target image highlighting disease characteristics by weakening the background in the processed image based on a preset disease level recognition model of transfer learning; extracts disease characteristics of different scales from the target image through a multi-scale feature structure in the preset disease level recognition model of transfer learning; identifies the disease characteristics based on the preset disease level recognition model of transfer learning, and determines a solanaceae disease image according to a feature recognition result, wherein the preset disease level recognition model of transfer learning is a model obtained by migrating model parameters and parameter weights of an improved MSS-ResNet101 model to a pre-training model and training a classification layer in the migrated model, and the classification layer refers to a new classification layer formed by adding a fully connected layer before a softmax classification layer. The area of the disease spot in the solanaceae disease image is counted, and the solanaceae disease degree is determined according to the counting result. Since the solanaceae images obtained are preprocessed by the K-means algorithm, and the disease characteristics of the solanaceae images are identified based on the migrated model, and the solanaceae disease image is determined according to the feature recognition result, the disease degree is further determined, compared with the prior art, the granularity of the picture processing is not enough, and there is a limitation of insufficient training images, which leads to low precision or overfitting of the network model due to low sensitivity of the network model to fine-grained features, and the problem of low precision or overfitting of the solanaceae plant disease degree classification recognition model due to low sensitivity of the network model to fine-grained features is solved, and the disease recognition rate is improved.
[0114] In addition, to achieve the above object, the application further provides a solanaceae disease level recognition device based on transfer learning, which comprises a memory, a processor and a solanaceae disease level recognition program based on transfer learning stored on the memory and executable on the processor, and the solanaceae disease level recognition program based on transfer learning is configured to implement the steps of the solanaceae disease level recognition based on transfer learning as described above.
[0115] In addition, to achieve the above object, the application further provides a storage medium, which stores a solanaceae disease level recognition program based on transfer learning, and the solanaceae disease level recognition program based on transfer learning implements the steps of the solanaceae disease level recognition method based on transfer learning as described above when executed by a processor.
[0116] Reference Figure 11 , Figure 11 The structure block diagram of the first embodiment of the solanaceae disease level recognition device based on transfer learning of the application is shown in the figure.
[0117] As Figure 11As shown, the device for identifying disease grades of solanaceae based on migration learning provided by the embodiment of the present application comprises:
[0118] An image preprocessing module 10 is configured to preprocess the obtained solanaceae image based on the K-means algorithm to obtain a processed image.
[0119] A disease image identification module 20 is configured to identify disease features of the processed image based on a preset migration learning disease grade identification model, and determine a solanaceae disease image according to the feature identification result, wherein the preset migration learning disease grade identification model is a model obtained by migrating model parameters and parameter weights of an improved MSS-ResNet101 model to a pre-training model, and training a classification layer in the migrated model, wherein the classification layer refers to a new classification layer formed by adding a fully connected layer before a softmax classification layer.
[0120] A disease degree determination module 30 is configured to count the lesion area in the solanaceae disease image, and determine the disease degree of solanaceae according to the counting result.
[0121] In this embodiment, the obtained solanaceae image is preprocessed based on the K-means algorithm to obtain a processed image, the processed image is identified for disease features based on a preset migration learning disease grade identification model, and a solanaceae disease image is determined according to the feature identification result, wherein the preset migration learning disease grade identification model is a model obtained by migrating model parameters and parameter weights of an improved MSS-ResNet101 model to a pre-training model, and training a classification layer in the migrated model, wherein the classification layer refers to a new classification layer formed by adding a fully connected layer before a softmax classification layer. The lesion area in the solanaceae disease image is counted, and the disease degree of solanaceae is determined according to the counting result. Since the obtained solanaceae image is preprocessed by the K-means algorithm, the solanaceae image is identified for disease features according to the migrated model, and the solanaceae disease image is determined according to the feature identification result, so as to further determine the disease degree, compared with the insufficient fine granularity of picture processing and the limitation of insufficient training image quantity in the prior art, which leads to low precision or overfitting of the network model due to low sensitivity of the network model to fine granularity features, the present application solves the problem of low precision or overfitting caused by low sensitivity of the solanaceae plant disease degree classification recognition model to fine granularity features, and improves the disease recognition rate.
[0122] Further, the image preprocessing module 10 is further configured to segment the obtained solanaceae image based on the K-means algorithm to obtain a pixel point dataset, segment the solanaceae image according to the pixel similarity corresponding to the pixel point dataset, and extract an image containing key disease features from the segmented image.
[0123] Further, the solanaceae disease grade recognition device based on transfer learning further comprises a model training module, the model training module is used for adopting an ImageNet image dataset as a source dataset for transfer training; training the improved MSS-ResNet101 model based on the ImageNet source dataset to obtain a pre-training model; and constructing a preset disease grade recognition model based on transfer learning based on the parameters and weights corresponding to the pre-training model and the pre-training model.
[0124] Further, the model training module is further used for initializing the pre-training model by taking the parameters and weights of the pre-training model as the initialization parameters of the network, freezing the structure before the global average pooling layer, and obtaining a pre-training model to be improved; adding a fully connected layer before the softmax classification layer of the pre-training model to be improved to form a new classification layer, and modifying the network parameters corresponding to the softmax classification layer to adapt to the solanaceae disease degree grading task to obtain a target pre-training model; training the new classification layer in the target pre-training model to obtain a trained model; and fine-tuning the network parameters corresponding to the trained model to obtain a preset disease grade recognition model based on transfer learning.
[0125] Further, the disease image recognition module 20 is further used for weakening the background in the processed image based on the preset disease grade recognition model based on transfer learning to obtain a target image highlighting disease features; extracting disease features of different scales from the target image through the multi-scale feature structure in the preset disease grade recognition model based on transfer learning; and recognizing the disease features based on the preset disease grade recognition model based on transfer learning, and determining a solanaceae disease image according to the feature recognition result.
[0126] Further, the disease degree determination module 30 is further used for identifying the disease class of the solanaceae disease image based on the preset disease grade recognition model based on transfer learning to obtain a disease class; classifying the solanaceae disease image according to the disease class to obtain a solanaceae disease image set of each disease type; and statistically analyzing the disease spot area in the solanaceae disease image set of each disease type to determine the solanaceae disease degree according to the statistical result.
[0127] Further, the disease degree determination module 30 is further used for obtaining the total pixel quantity of the disease spot area region; determining the single-leaf disease degree according to the total pixel quantity and the total pixel quantity of the entire leaf region; statistically analyzing the single-leaf disease degree in the solanaceae disease image set of each disease type according to the statistical result of the disease degree to determine the solanaceae disease degree grade.
[0128] It should be understood that the above is only an example, and does not constitute any limitation on the technical solutions of the present application. In specific applications, those skilled in the art can set up according to the needs, and the present application does not limit this.
[0129] It should be noted that the above-described workflow is only illustrative and does not limit the scope of protection of the present application. In actual application, those skilled in the art can select part or all of them according to actual needs to achieve the purpose of the embodiment scheme, which is not limited here.
[0130] In addition, technical details not described in detail in this embodiment can be referred to the method for identifying disease grade of solanaceae family based on transfer learning provided by any embodiment of the present application, which will not be repeated here.
[0131] It should be noted that in this document, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or system. Without more limitations, the element defined by the sentence "includes a" does not exclude the presence of another identical element in the process, method, article or system including the element.
[0132] The above embodiment numbers of the present application are only for description, not representing the advantages and disadvantages of the embodiments. In the unit claims of several devices, several of these devices can be embodied by the same hardware item. The use of the words first, second, and third does not represent any order, and these words can be interpreted as names.
[0133] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory image (Read Only Memory image, ROM) / random access memory (Random Access Memory, RAM), a magnetic disk, an optical disk), including a plurality of instructions for making a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) execute the method described in each embodiment of the present application.
[0134] The above merely describes the preferred embodiments of the present application, and is not intended to limit the patent scope of the present application, and any equivalent structure or equivalent process conversion, or direct or indirect application in other related technical fields, which are made by using the content of the present application specification and drawings, are also included in the patent protection scope of the present application.
Claims
1. A method for identifying the severity level of Solanaceae diseases based on transfer learning, characterized in that, The method for identifying the severity level of Solanaceae diseases based on transfer learning includes: The obtained Solanaceae images are preprocessed using the K-means algorithm to obtain the processed images; Based on a pre-defined transfer learning-based disease level identification model, disease features are identified in the processed images, and the images of Solanaceae diseases are determined according to the feature identification results. The area of lesions in the images of solanaceous diseases is statistically analyzed, and the severity of solanaceous diseases is determined based on the statistical results. Before the step of the disease level identification model based on preset transfer learning performing disease feature identification on the processed image and determining the solanaceous disease image based on the feature identification results, the method further includes: The ImageNet image dataset was used as the source dataset for transfer learning training; The improved MSS-ResNet101 model is trained on the ImageNet source dataset to obtain a pre-trained model. The improved MSS-ResNet101 model is based on the ResNet101 network model and combines the multi-scale Inception module and the convolutional kernel attention mechanism SKNet to obtain an improved multi-scale network model that integrates the convolutional kernel attention mechanism. The MSS-ResNet101 model replaces the 7×7 convolution in the original ResNet101 with the Inception module and incorporates the convolutional kernel attention mechanism into each residual module, while retaining the global average pooling layer and the Softmax layer. The parameters and weights of the pre-trained model are used as the initialization parameters of the network to initialize the pre-trained model, and the structure before the global average pooling layer is frozen to obtain the pre-trained model to be improved. A fully connected layer is added before the softmax classification layer of the pre-trained model to be improved to form a new classification layer, and the network parameters corresponding to the softmax classification layer are modified to 16 to be suitable for the task of classifying the severity of solanaceous diseases, so as to obtain the target pre-trained model. Train the new classification layer in the target pre-trained model to obtain a trained model; The network parameters corresponding to the trained model are fine-tuned to obtain a disease level identification model based on preset transfer learning.
2. The method for identifying the severity level of Solanaceae diseases based on transfer learning as described in claim 1, characterized in that, The step of preprocessing the acquired Solanaceae images based on the K-means algorithm to obtain the processed images includes: The K-means algorithm is used to segment the acquired Solanaceae images into pixels to obtain a pixel dataset. The Solanaceae image is segmented based on the pixel similarity corresponding to the pixel dataset, and images containing key disease features are extracted from the segmented images.
3. The method for identifying the severity level of Solanaceae diseases based on transfer learning as described in any one of claims 1 or 2, characterized in that, The disease severity identification model based on preset transfer learning performs disease feature identification on the processed image, and determines the solanaceous disease image based on the feature identification results, including: The disease level recognition model based on preset transfer learning weakens the background in the processed image to obtain a target image that highlights the disease features. The disease features at different scales are extracted from the target image through the multi-scale feature structure in the disease level identification model based on preset transfer learning. The disease characteristics are identified based on the preset transfer learning disease level identification model, and the solanaceous disease image is determined according to the feature identification results.
4. The method for identifying the severity level of Solanaceae diseases based on transfer learning as described in claim 1, characterized in that, The step of statistically analyzing the lesion area in the images of solanaceous diseases and determining the severity of the solanaceous disease based on the statistical results includes: Based on the preset transfer learning disease level recognition model, the disease category is identified in the images of Solanaceae diseases. The images of solanaceous diseases are classified according to the disease categories to obtain a set of images of each disease type. The area of lesions in the image set of solanaceous diseases of each disease type was statistically analyzed, and the degree of solanaceous diseases was determined based on the statistical results.
5. The method for identifying the severity level of Solanaceae diseases based on transfer learning as described in claim 4, characterized in that, The step of statistically analyzing the lesion area in the image set of solanaceous diseases of various disease types and determining the severity of solanaceous diseases based on the statistical results further includes: Obtain the total number of pixels in the lesion area; The severity of disease on a single leaf is determined based on the total number of pixels and the total number of pixels in the entire leaf area. The severity of disease on individual leaves was statistically analyzed in the image set of solanaceous diseases of various disease types, and the severity level of solanaceous diseases was determined based on the statistical results.
Citation Information
Patent Citations
Pest and disease damage identification method based on transfer learning and convolutional neural network
CN112052904A
Citrus disease degree identification method and device, equipment and storage medium
CN114897051A
Corn disease degree detection method based on confidence learning and fine-grained feature extraction
CN114913425A