Citrus disease grade identification method, device, storage medium and apparatus
By combining the K-means algorithm and transfer learning, citrus images are preprocessed and feature recognized, which solves the problems of insufficient granularity and insufficient training images in the existing citrus disease grade recognition model, and achieves higher recognition accuracy and precise determination of the disease degree.
Patent Information
- Application Number
- CN202310127580.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-02-15
AI Technical Summary
The existing citrus disease grade recognition model lacks fine-grained image processing and an insufficient number of training images, resulting in the network model being insensitive to fine-grained features, low recognition accuracy, or overfitting.
The K-means algorithm was used to preprocess the citrus images. Combined with the preset transfer learning disease grade recognition model, the parameters and weights of the VGG-16 network model were transferred to the NC-ResNet50 model for training. The model was improved using the ImageNet dataset, and fine-tuned and normalized to identify and count the diseased area to determine the disease severity.
The accuracy and recognition rate of citrus disease identification have been improved, the problem of low recognition accuracy or overfitting caused by low sensitivity of fine-grained features has been solved, and the accuracy of disease identification has been improved.
Smart Images

Figure CN116778205B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a citrus disease grade identification method, device, storage medium and apparatus. 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, so as to effectively help fruit farmers prevent the spread of citrus diseases in time.
[0003] Although there are model calculation methods for identifying the grade of citrus diseases 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 the network model to fine-grained features, thereby affecting the 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 citrus disease grade identification method, device, storage medium and apparatus, which aims to solve the technical problems of low recognition accuracy or overfitting caused by low sensitivity of the network model to fine-grained features due to insufficient granularity of the model 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 citrus disease grade identification method, which comprises the following steps:
[0007] The obtained citrus image is preprocessed based on the K-means algorithm to obtain a processed image;
[0008] The processed image is subjected to disease feature identification based on a preset disease grade identification model of transfer learning, and a citrus disease image is determined according to the feature identification result, wherein the preset disease grade identification model of transfer learning is a model obtained by transferring the model parameters and parameter weights of a VGG-16 network model to an NC-ResNet50 model, and the transferred model is trained to obtain the model;
[0009] The disease area in the citrus disease image is counted, and the degree of citrus disease is determined according to the counting result.
[0010] Optionally, the step of preprocessing the acquired citrus image based on the K-means algorithm to obtain a processed image includes:
[0011] The obtained citrus images are segmented based on the K-means algorithm to obtain a pixel data set;
[0012] The citrus image is segmented according to the pixel similarity corresponding to the pixel point data set, and an image containing key disease features is extracted from the segmented image.
[0013] Optionally, before the step of performing disease feature recognition on the processed image using the preset transfer learning-based disease grade recognition model and determining the citrus disease image according to the feature recognition result, the step further includes:
[0014] The ImageNet image dataset is used as the source dataset for migration training;
[0015] Train the improved VGG-16 model based on the ImageNet source dataset to obtain a pre-trained model;
[0016] A disease grade recognition model for preset transfer learning is constructed based on the parameters and weights corresponding to the pre-trained model and the ResNet50 model.
[0017] Optionally, the step of constructing a disease grade recognition model for preset transfer learning based on the parameters and weights corresponding to the pre-trained model and the ResNet50 model includes:
[0018] Migrating the parameters and weights of the pre-trained model to the ResNet50 model for initialization to obtain an improved ResNet50 model;
[0019] Normalizing the outputs of the conv3 and conv5 layers of the improved ResNet50 model, and inputting the normalized results output by the improved ResNet50 model into the RoI layer and the fully connected layer for training to obtain a trained NC-ResNet50 model;
[0020] The network parameters corresponding to the trained NC-ResNet50 model are fine-tuned to obtain a preset transfer learning disease grade recognition model.
[0021] Optionally, the step of normalizing the outputs of the conv3 layer and the conv5 layer of the improved ResNet50 model includes:
[0022] Normalizing the tensors in the conv3 and conv5 layers of the improved ResNet50 model, and normalizing all pixels in the merged feature maps of the conv3 and conv5 layers;
[0023] The normalized form of each tensor is as follows:
[0024]
[0025]
[0026] represents the normalized O, O represents the element pixel vector, and c represents the number of channels in the RoI.
[0027] Optionally, the step of counting the diseased area in the citrus disease image and determining the extent of the citrus disease according to the statistical result includes:
[0028] Perform disease classification on citrus disease images based on the preset transfer learning disease grade recognition model to obtain disease categories;
[0029] Classifying the citrus disease images according to the disease categories to obtain a set of citrus disease images of each disease type;
[0030] The diseased area in the citrus disease image collection of each disease type is counted, and the degree of citrus disease is determined based on the statistical results.
[0031] Optionally, the step of counting the diseased areas in the citrus disease image set of each disease type and determining the extent of the citrus disease based on the statistical results further includes:
[0032] Get the total number of pixels in the diseased area;
[0033] determining the disease degree of a single leaf according to the total number of pixels and the total number of pixels of the entire leaf area;
[0034] The disease severity of single leaves in the citrus disease image collection of each disease type is counted, and the citrus disease severity level is determined based on the disease severity statistical results.
[0035] In addition, to achieve the above-mentioned purpose, the present invention also proposes a citrus disease level identification device, which includes a memory, a processor, and a citrus disease level identification program stored on the memory and runnable on the processor, and the citrus disease level identification program is configured to implement the steps of citrus disease level identification as described above.
[0036] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a citrus disease level identification program is stored. When the citrus disease level identification program is executed by a processor, the steps of the citrus disease level identification method described above are implemented.
[0037] In addition, to achieve the above-mentioned purpose, the present invention also proposes a citrus disease grade identification device, the citrus disease grade identification device comprising:
[0038] An image preprocessing module is used to preprocess the acquired citrus images based on the K-means algorithm to obtain processed images;
[0039] A disease image recognition module is used to identify disease features in the processed image based on a preset transfer learning disease grade recognition model, and to determine the citrus disease image based on the feature recognition results. The preset transfer learning disease grade recognition model is a model obtained by migrating the model parameters and parameter weights of the VGG-16 network model to the NC-ResNet50 model, and training the migrated model.
[0040] The disease degree determination module is used to count the diseased area in the citrus disease image and determine the citrus disease degree according to the statistical results.
[0041] The present invention preprocesses the acquired citrus image based on the K-means algorithm to obtain a processed image; performs disease feature recognition on the processed image based on a preset transfer learning disease level recognition model, and determines the citrus disease image according to the feature recognition result, wherein the preset transfer learning disease level recognition model is a model obtained by migrating model parameters and parameter weights of a VGG-16 network model to an NC-ResNet50 model, and the migrated model is trained to obtain a model; the disease area in the citrus disease image is counted, and the degree of citrus disease is determined according to the statistical result. Since the present invention pre-processes the acquired citrus images through the K-means algorithm, identifies disease features of the citrus images according to the migrated model, and determines the citrus disease images according to the feature recognition results, thereby further determining the degree of disease, compared with the prior art in which the image processing is not fine-grained enough and there is a limitation of insufficient number of training images, resulting in low recognition accuracy or overfitting due to the low sensitivity of the network model to fine-grained features, the present invention solves the problem of low recognition accuracy or overfitting caused by the low sensitivity of the citrus plant disease degree grading recognition model to fine-grained features, thereby improving the disease recognition rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 2 is a schematic diagram of the structure of a citrus disease grade identification device in the hardware operating environment involved in an embodiment of the present invention;
[0043] Figure 2 This is a flow chart of the first embodiment of the method for identifying citrus disease grades according to the present invention;
[0044] Figure 3 This is a schematic diagram of image segmentation in the second embodiment of the method for identifying citrus disease levels of the present invention;
[0045] Figure 4 This is a schematic plan view of the VGG-16 model of the second embodiment of the citrus disease grade identification method of the present invention;
[0046] Figure 5 This is a schematic diagram of a Huanglongbing sample dataset according to the second embodiment of the citrus disease grade identification method of the present invention;
[0047] Figure 6 This is a schematic diagram of the model accuracy curve change of the second embodiment of the citrus disease grade identification method of the present invention;
[0048] Figure 7 This is a schematic diagram of the change of the model loss value curve of the second embodiment of the citrus disease grade identification method of the present invention;
[0049] Figure 8 Schematic diagram of the confusion matrix of different disease grade identification models of the second embodiment of the citrus disease grade identification method of the present invention;
[0050] Figure 9 This is a structural block diagram of the first embodiment of the citrus disease grade identification device of the present invention.
[0051] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0052] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0053] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a citrus disease grade identification device in the hardware operating environment involved in an embodiment of the present invention.
[0054] like Figure 1As shown, the citrus disease grade identification device 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. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), and optionally the user interface 1003 may also include a standard wired interface and a wireless interface. The wired interface of the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface and 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 stable memory (NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0055] Those skilled in the art will understand that Figure 1 The structure shown in does not constitute a limitation to the citrus disease grade identification device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0056] like Figure 1 As shown, the memory 1005 identified as a computer storage medium may include an operating system, a network communication module, a user interface module, and a citrus disease grade identification program.
[0057] exist Figure 1 In the citrus disease level identification device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the user device; the citrus disease level identification device calls the citrus disease level identification program stored in the memory 1005 through the processor 1001, and executes the citrus disease level identification method provided by the embodiment of the present invention.
[0058] Based on the above hardware structure, an embodiment of the citrus disease grade identification method of the present invention is proposed.
[0059] Reference Figure 2 , Figure 2 This is a flow chart of the first embodiment of the method for identifying the disease grade of citrus according to the present invention, which provides the first embodiment of the method for identifying the disease grade of citrus according to the present invention.
[0060] In this embodiment, the citrus disease grade identification method includes the following steps:
[0061] Step S10: Preprocess the acquired citrus image based on the K-means algorithm to obtain a processed image.
[0062] It should be noted that the execution subject of the present embodiment can be a device for identifying the grade of citrus diseases, such as a computer, a notebook, a computer, a tablet, and the like, and can also be other devices for identifying the grade of citrus diseases with the same or similar functions. The present embodiment does not limit this. The above computer will be taken as an example to describe the present embodiment and the following embodiments.
[0063] It can be understood that the citrus image can refer to an image of a citrus plant that needs to be identified for disease, and the image includes a leaf image with a disease spot and a normal leaf image. In order to accurately identify the leaf image with a disease spot, the disease image needs to be selected from the citrus image before disease identification, and therefore the plant image needs to be preprocessed to accurately identify the disease image.
[0064] It should be understood that the citrus plant to be identified includes but is not limited to plants of orange, sugar orange, and emperor mandarin, which are widely cultivated crops with high economic value, and can also be daily cultivated plants. The present embodiment does not limit this.
[0065] Further, the step S10 further includes: performing pixel point segmentation on the acquired citrus image based on the K-means algorithm to obtain a pixel point data set; segmenting the citrus image according to the pixel similarity corresponding to the pixel point data set, and extracting an image containing key disease characteristics from the segmented image.
[0066] It should be noted that the present scheme uses the K-means algorithm to segment and preprocess the image, which takes the pixel points of the image as a data set, and then divides the image 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 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 tasks. For unsupervised image clustering problems, the image is often divided into regions with different feature meanings according to 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.
[0067] Due to the presence of many interference factors in fine-grained classification scenarios, the accuracy of the model classification results is low. Image segmentation technology is used to pre-process the diseased images to remove the influence of negative interference factors in the diseased images, thereby improving the accuracy of the diseased images. The main purpose of image segmentation is to extract the information data required by scientific researchers based on the features in the image, accurately locate the features and measure the parameters of the target image obtained by image segmentation, and make full use of the segmented image to facilitate the implementation of advanced image processing technologies such as target detection, image classification and image analysis. In the problem of unsupervised clustering of sample images, the target image is usually divided into meaningful areas with different target feature information based on the familiarity of the feature information of adjacent areas in the target image, thereby realizing the conversion between the unsupervised clustering problem and the image segmentation problem.
[0068] It is understandable that in order to improve the accuracy of the disease grade recognition model of citrus disease images, this solution needs to adopt an accurate and fast unsupervised clustering image segmentation technology to preprocess the disease image dataset, help improve the quality of citrus disease images, and use deep convolutional neural networks to improve the sensitivity of citrus disease image features, thereby increasing the performance of citrus disease images in sensitive features. The K-Means algorithm can segment the target image into non-overlapping pixel clusters based on image features such as color, spatial information, and brightness level, thereby enhancing citrus disease features and removing interference caused by negative factors. This solution uses the K-Means algorithm to perform image segmentation on citrus disease target images, extract and filter disease features and negative interference factors in citrus disease images, and it is particularly important to extract accurate disease location information from real citrus diseases.
[0069] It should be understood that it is difficult to extract key features from the graphic features of citrus disease in a complex background, while it is relatively simple to extract disease features from citrus disease graphics in a simple background. Therefore, this solution helps to enhance the ability to distinguish citrus disease features and improve the training process of deep convolutional neural networks by using unsupervised clustering images, and ultimately improve the recognition accuracy of the algorithm model. For further explanation, this embodiment uses citrus canker as an example. The target image segmentation is based on K-means unsupervised clustering image segmentation. After the original citrus canker image features are segmented, the diseased parts of the citrus canker image are marked with the same color, and other parts of the original citrus canker image are marked with different colors. Then, the disease pixel distribution and the proportion of leaf area are used to finally achieve disease level classification.
[0070] Step S20: performing disease feature recognition on the processed image based on a preset disease grade recognition model based on transfer learning, and determining the citrus 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 a VGG-16 network model to an NC-ResNet50 model, and the model is obtained by training the migrated model.
[0071] It should be noted that the preset disease grade recognition model based on transfer learning can be a model for disease grade recognition obtained by model transfer learning, and the preset disease grade recognition model based on transfer learning is a model obtained by migrating model parameters and parameter weights of a VGG-16 network model to an NC-ResNet50 model, and the model is obtained by training the migrated model.
[0072] It can be understood 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. In the present scheme, a VGG-16 network model is used as a basic model for transfer learning, and a VGG-16 model plane diagram is as shown in Figure 4 To train a better classification recognition network model, a large amount of data set is needed. VGG-16 is pre-trained based on an ImageNet data set, and the data set type has a total of 1000 categories, and the number of images is as high as 1000,000. In the process of transfer learning, the citrus disease image is first inputted into 5 convolutional layers and pooling layers, then reduced to 1x256 by using a full connection layer FC-4096-1, and then a nonlinear activation function ReLU is used, wherein the ReLU activation function has two advantages: one is simple calculation, and the other is that it can make the model converge quickly, and its formula is as follows:
[0073]
[0074] wherein f ReLU represents a nonlinear activation function, and t represents an independent variable of the activation function.
[0075] After the image passes through the activation function ReLU, it enters the Dropout layer. In each training process, part of the neurons will temporarily set the target weight to zero according to the corresponding probability, which can help to reduce the cooperative adaptation between neurons, thereby reducing the coupling between neurons and preventing overfitting behavior in the network model. Then the image enters the full connection FC-4096-2 to reduce the target vector to 1x3. Finally, the Softmax function is used to calculate the final classification probability, and the model calculation formula is as follows:
[0076]
[0077] where v r represents the rth component in the vector; p r represents the classification probability of the rth component; k represents the component number;
[0078] Then, the newly generated fully connected layer is used to replace the original target network fully connected layer to obtain a new model, and finally the weight parameters trained by the new model are migrated to the target network.
[0079] It is understandable that in this solution, due to the small size of the dataset of citrus disease grade images, it is difficult for the model to achieve the ideal accuracy and generalization ability. Therefore, the use of transfer learning technology can achieve the small dataset classification task of citrus disease grade. In order to solve the accuracy and generalization ability of the model, this solution uses the transfer learning method of fine-tuning the source model, adjusts the weights and parameters of the learning model for training, and at the same time, for the standardization of the data model, standardizes and normalizes the dataset, and performs global average pooling before the fully connected layer, so as to achieve the purpose of optimizing the model. Normalization (Normalization), for the sample dataset, during gradient optimization, normalizes the data of the target dataset to make the variance and mean more stable, thereby making the model converge faster. Global mean pooling mainly uses dimensionality reduction to reduce the number of model parameters, ultimately achieving the effect of increasing training speed.
[0080] It should be understood that the disease level recognition model based on the preset transfer learning performs disease feature recognition on the processed image, and determines the citrus disease image based on the feature recognition result.
[0081] In the specific implementation, the processed citrus image is subjected to feature extraction through the convolution module in the disease grade recognition model of the preset transfer learning, and the obtained features are input into the connection layer, a feature map is generated according to the output result of the connection layer, the feature map is analyzed according to the regional convolutional neural network, the analysis result is input into the fully connected layer, and the output result of the fully connected layer is input into the classification layer for disease feature recognition, and the citrus disease image is determined according to the feature recognition result.
[0082] Furthermore, before step S20, it also includes: using the ImageNet image dataset as a source dataset for migration training; training the improved VGG-16 model based on the ImageNet source dataset to obtain a pre-trained model; and constructing a preset transfer learning disease grade recognition model based on the parameters and weights corresponding to the pre-trained model and the ResNet50 model.
[0083] It should be noted that during the transfer training process, considering that the source and target datasets need to have a certain degree of similarity, this solution uses the ImageNet image dataset as the source dataset for transfer training. This solution uses the VGG-16 network model as the basic model for transfer learning. In order to train a good classification and recognition network model, a large dataset is required. VGG-16 is pre-trained based on the ImageNet dataset. The dataset has a total of 1,000 types and over 1 million images. It is a high-quality, large-scale dataset. The ImageNet image dataset has SIFT features (scale-invariant features), so even after the image is scaled, rotated, and brightness adjusted, it can still guarantee good recognition results. This solution uses this dataset for pre-training, which not only enables the model to achieve better recognition accuracy during the actual training process, but also allows the trained model to have stronger generalization capabilities.
[0084] It is understandable that the improved VGG-16 model is trained based on the ImageNet source data set to obtain a pre-trained model. The pre-trained model may refer to a pre-trained model derived by training the ImageNet source data using the improved VGG-16 model and terminating the training after convergence.
[0085] It should be understood that a preset transfer learning disease grade recognition model is constructed based on the parameters and weights corresponding to the pre-trained model and the ResNet50 model.
[0086] Step S30: Counting the diseased area in the citrus disease image, and determining the degree of citrus disease based on the statistical results.
[0087] It should be noted that the disease extent of the citrus plant is determined by the area of the diseased spot, and the area of the diseased spot may be an area determined based on the pixels of the diseased spot in the diseased image.
[0088] It is understandable that the characteristics of lesions of different disease types will also be different. Therefore, by counting the area of lesions of different disease types, we can achieve accurate statistics of the disease extent of citrus plants of each disease type.
[0089] Furthermore, the step S30 also includes: performing disease classification on the citrus disease images based on the preset transfer learning disease level recognition model to obtain the disease category; classifying the citrus disease images according to the disease category to obtain a set of citrus disease images of each disease type; and statistically analyzing the disease area in the set of citrus disease images of each disease type, and determining the degree of citrus disease based on the statistical results.
[0090] It should be noted that the disease type includes the disease type corresponding to citrus plants. Different citrus plants correspond to different disease types, and the manifestation characteristics are also different. The disease type is usually determined by the characteristics of the lesions on the leaves. For example, if the plant is citrus, the disease type corresponding to citrus is determined by identifying the characteristics of the lesions on the citrus leaves. The disease types may include Huanglongbing, black spot disease, ulcer disease, scab disease, etc.
[0091] By comparing the lesion features contained in the citrus disease image with the lesion features in the citrus disease image in the lesion feature library, the disease category corresponding to the lesion features contained in the citrus disease image can be determined, thereby determining the disease category corresponding to the plant, so as to ensure accurate pest control operations in the later stage, thereby increasing yield and reducing plant losses caused by diseases.
[0092] It can be understood that by identifying the disease type of the lesions in the citrus disease images containing disease characteristics, determining the disease category corresponding to the disease image, and classifying the citrus disease images according to the identified disease category, a set of citrus disease images of each disease type is obtained, so as to facilitate the later statistics based on the disease degree of each disease type.
[0093] In a specific implementation, the disease type of citrus disease images is identified based on the preset transfer learning disease level recognition model to obtain the disease category; the citrus disease images are classified according to the disease category to obtain a set of citrus disease images of each disease type; the lesion area in the set of citrus disease images of each disease type is counted, and the degree of citrus disease is determined based on the statistical results.
[0094] Furthermore, the step of counting the diseased area in the citrus disease image set of each disease type and determining the degree of citrus disease based on the statistical results also includes: obtaining the total number of pixels in the diseased area; determining the degree of disease of a single leaf based on the total number of pixels and the total number of pixels in the entire leaf area; counting the degree of disease of a single leaf in the citrus disease image set of each disease type, and determining the citrus disease degree level based on the statistical results of the disease degree.
[0095] It should be noted that according to the different levels of damage, the healthy, mild, moderate and severe citrus leaves are numbered, and samples of citrus leaves with different degrees of damage are collected for processing. The citrus leaves are simulated and reconstructed and data is collected. Finally, the disease level of the citrus leaves after being infected is divided into four levels. This experiment will use citrus leaves of different levels as research objects, and grade the citrus leaves corresponding to the standards. According to the color of the citrus leaves and the number of lesions, the citrus diseases are divided into four gradients, among which (1) the complete leaves are healthy, (2) less than 25% are mild, (3) 25%-50% are moderate diseases, and (4) more than 50% are severe diseases. The calculation formula for the proportion of citrus diseases is as follows:
[0096]
[0097] Where S represents the total area of intact diseased citrus leaves; S1 represents the area of diseased citrus areas;
[0098]
[0099] Where M represents the number of pixel values of the complete citrus leaf; M1 represents the number of pixel values of the citrus diseased area.
[0100] It is understood that depending on the severity of citrus disease, the disease grade is assessed as follows: Based on the condition of the citrus leaves, the disease grade is calculated using the same grading criteria for each leaf, using the same severity as the diseased leaves. The citrus disease grade classification is shown in Table 1 below:
[0101] Table 1 Disease grade classification standards
[0102] Disease level Level Assessment Grading standards Grading basis Level 1 healthy N=0 Proportion of diseased area Level 2 Mild 0<N<0.25 Proportion of diseased area Level 3 Moderate 0.25<N<0.5 Proportion of diseased area Level 4 severe 0.5≤N≤1 Proportion of diseased area
[0103] The embodiment obtains a processed image by preprocessing the obtained citrus image based on a K-means algorithm; performs disease feature recognition on the processed image based on a preset disease level recognition model of transfer learning, and determines a citrus disease image according to the 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 a VGG-16 network model to an NC-ResNet50 model, and the model is trained to obtain a trained model; the disease area in the citrus disease image is counted, and the citrus disease degree is determined according to the counting result. Since the K-means algorithm is used to preprocess the obtained citrus image, the disease feature of the citrus image is recognized according to the migrated model, and the citrus disease image is determined according to the feature recognition result, so that the disease degree is further determined. Compared with the prior art, the granularity of the picture processing is not enough, and the number of training images is insufficient, which leads to low recognition accuracy 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 recognition accuracy or overfitting of the citrus plant disease degree classification recognition model due to low sensitivity of the network model to fine-grained features, and improves the disease recognition rate.
[0104] Based on the above Figure 2 The second embodiment of the citrus disease level recognition method of the present application is proposed based on the first embodiment shown in the above
[0105] In the embodiment, the step of constructing a preset disease level recognition model of transfer learning based on the parameters and weights corresponding to the pre-trained model and the ResNet50 model includes: migrating the parameters and weights of the pre-trained model to the ResNet50 model for initialization processing to obtain an improved ResNet50 model; normalizing the outputs of the conv3 layer and the conv5 layer of the improved ResNet50 model, and inputting the standardization result output by the improved ResNet50 model to the RoI layer and the full connection layer for training to obtain a trained NC-ResNet50 model; fine-tuning the network parameters corresponding to the trained NC-ResNet50 model to obtain the preset disease level recognition model of transfer learning.
[0106] It should be noted that since ResNet50 belongs to the CNN model, fine-tuning, layer connection and reordering strategies can be used, so that the transfer learning method can be used for classification of small-scale citrus disease data sets to effectively improve the model performance. For further description of the NC-ResNet50 network model in the present scheme, reference is made to Figure 3The schematic diagram of the overall structure of the NC-ResNet50 network model shows that the model has five convolutional layers and three fully connected layers. The conv5 layer is the topmost convolutional layer, which contains a 3×3 kernel function with a stride of 1. It outputs a 256-pixel image of size 13×13, which serves as the input for the RPN to generate object proposals. The outputs of the conv3 and conv5 layers of the ResNet50 model are then normalized and fed into the RoI pooling layer. Fine-tuning all convolutional layers achieves optimal performance for identical object retrieval. To balance time consumption and efficiency, this solution fine-tunes the weights of all layers, except the first two convolutional layers. During fine-tuning, the RPN and detector are trained simultaneously using multi-tasks. By using these strategies, the weights of the convolutional features and the RPN proposals can be adjusted to accommodate identical feature retrieval.
[0107] It should be understood that for further explanation, reference is made to Figure 4 The schematic diagram of the ResNet50 network model shown in the figure shows that normalization is used to combine conv3 and conv5 feature vectors with different scales. Because simply connecting them will lead to poor performance, in CNN, deeper layers have smaller scaling values, while shallower layers have larger scaling values. Due to the obvious differences in large-scale data, it is difficult for subsequent layers to adjust weights. If the tensors of the conv3 and conv5 layers of the ResNet50 model are directly connected, the "large" features in the conv5 layer will cover the "small" features in the conv3 layer, and may output "large" features while ignoring "small" features. Therefore, these two tensors need to be normalized. Normalization is applied to the tensors in the conv3 and conv5 layers to normalize all pixels in the merged feature maps of the conv3 and conv5 layers. This is finally achieved through normalization, which can effectively improve the recognition performance of the model.
[0108] Furthermore, the step of normalizing the outputs of the conv3 layer and the conv5 layer of the improved ResNet50 model includes: normalizing the tensors in the conv3 layer and the conv5 layer of the improved ResNet50 model, and normalizing all pixels in the merged feature map of the conv3 layer and the conv5 layer;
[0109] The normalized form of each tensor is as follows:
[0110]
[0111]
[0112] represents the normalized O, O represents the element pixel vector, and c represents the number of channels in the RoI.
[0113] Wherein, the model scale factor and the pool tensor are shown as follows.
[0114]
[0115] γ represents a scale factor; z i The pool tensor of the RoI; i represents the i-th tensor;
[0116] γ i The training process of updating and O by using back propagation and chain rule is shown as follows:
[0117]
[0118]
[0119]
[0120] l represents the number of layers; wherein ZZ∈[Z1,Z1,Z1...Z n ] T
[0121] It should be noted that for the citrus disease degree grading identification model based on transfer learning, the features learned by the pre-training model have a positive effect on the citrus disease degree grading, and fine-tuning the entire network is beneficial to network training, so the scheme adopts the form of feature extraction and fine-tuning combination for transfer learning. The transfer training process is shown in the transfer training schematic diagram, wherein the transfer training process can be divided into the following steps: Figure 3
[0122] Step one: train the improved VGG-16 model by using the ImageNet source data, end the training after convergence, export the pre-training model and save the parameter weight as the initialization parameter of the network.
[0123] Step two: initialize the ResNet50 model migrated by using the parameters and weights of the pre-training model in step one, and obtain the improved ResNet50 model;
[0124] Step three: normalize the outputs of the conv3 layer and the conv5 layer of the improved ResNet50 model, and input the standardization result output by the improved ResNet50 model into the RoI layer and the fully connected layer for training, and obtain the trained NC-ResNet50 model;
[0125] Step four: fine-tune the network parameters corresponding to the trained NC-ResNet50 model to avoid overfitting phenomenon caused by small data volume, and improve the high-level semantic extraction ability of the model.
[0126] It is understandable that during model training, to improve model accuracy, this solution uniformly sets the model input size to 32 and the citrus disease image size to 224×224 pixels. To determine the optimal model hyperparameters (momentum factor m and learning rate α), the model momentum factor is set to different momentum gradient types of 0.30, 0.60, and 0.90, respectively. The momentum factor size is adjusted based on the accuracy of the pre-trained model, and the momentum factor with the best accuracy is selected as the momentum parameter for this solution's model. Based on the optimal momentum factor, three different types of learning rates are set to 0.01, 0.001, and 0.0001, respectively, to determine the optimal model hyperparameters. To compare the recognition performance of the improved NC-ResNet50, it is first necessary to select the optimal hyperparameters for four models (AlexNet, InceptionV3, VGG-16, and ResNet50). Automatic hyperparameter selection algorithms often require higher computational costs, so each model's optimization parameters are manually adjusted. The optimized model above is compared with the improved model on the original data set to test their accuracy respectively.
[0127] The disease severity of citrus diseases is an important indicator of the extent of citrus disease. In the process of deep learning research, in order to obtain a high-precision convolutional neural network classification model, large-scale, high-quality datasets are usually required for model training. Generally speaking, the proportion of datasets of different types of disease images needs to be relatively balanced. The larger the scale and quality of the dataset, the better the data performance obtained by deep learning network training. Therefore, during deep learning training, the number of datasets for each type of citrus disease image must reach at least a certain scale. In the process of deep learning image recognition and classification tasks, image dataset samples are a very important foundation. Enriching and expanding the types and quality of datasets can greatly improve the accuracy and generalization ability of deep learning network models.
[0128] Under the condition of a relatively balanced number of data samples for each category of citrus disease, the larger the data sample size, the better the performance of the trained model. Data samples are particularly influential in fine-grained image classification tasks, and a rich sample image base can significantly improve model recognition performance. Therefore, to ensure model performance, the number of samples for each citrus disease severity category should be as large as possible. However, due to factors such as the uncontrollable severity of disease, large seasonal variations, high labor costs, and long time spans, collecting a large number of sample images of citrus disease severity is relatively difficult. Therefore, in this study of citrus disease severity classification, the target dataset can be composed of a citrus disease image library composed of two parts: a publicly available online dataset (Plant Village) and a self-built dataset (sourced from orchards in Jiuwu Town, Lingchuan County, Guilin City). The datasets include four categories: publicly available datasets (Huanglongbing and Black Spot) and self-built datasets (Canker and Scab). Since Chapter 3 of this paper only performs target detection tasks on the four types of data sets and does not classify the severity of their diseases, in order to perform more fine-grained identification and classification of citrus diseases, this scheme re-divides the disease levels of citrus disease images based on Chapter 3.
[0129] Citrus diseases are restricted by different environmental factors under natural conditions. In order to simulate images of different citrus disease levels in natural environments, this scheme adopts data enhancement to perform data enhancement on the citrus disease dataset in different complex environments. The enhancement types mainly include the following categories: horizontal and vertical flipping of images; color balance; Gaussian blurring to add noise interference; brightness enhancement; sunny and rainy days, etc. The statistics of the number of citrus disease image enhancement datasets are shown in Table 2 below.
[0130] Table 2 Dataset preprocessing statistics
[0131]
[0132] The citrus disease severity data set is calculated according to the formula and formula The dataset images were preliminarily divided, and then some special citrus disease samples were reclassified through manual re-examination classification methods to ensure the accuracy of the dataset classification. Taking Huanglongbing as an example, the schematic diagram of the Huanglongbing sample dataset is as follows: Figure 5 shown.
[0133] This solution further divides each category of the citrus disease image dataset into mild, moderate, and severe categories. As the number of diseased citrus images increases, the number of sample images in each subcategory decreases, resulting in insufficient dataset size and reduced model training performance. Therefore, this solution first pre-trains the target network model using publicly available dataset images (ImageNet). Then, using transfer learning, the weights and parameters of the pre-trained model are reused to address the performance degradation caused by insufficient dataset sample images.
[0134] It should be understood that before outputting the trained model, in order to verify the transfer learning method proposed in this scheme and the impact of fine-tuning on the recognition performance of the NC-ResNet50 model, this scheme uses momentum factors m (0.3, 0.6, 0.9) and learning rates α (0.01, 0.001, 0.0001) to design comparative experiments. According to the impact of the model momentum gradient and convergence speed on the model accuracy, the optimal momentum factor and learning rate are selected as the final model hyperparameters. The learning rate defaults to 0.01. The experimental results are shown in Table 3.
[0135] Table 3 Accuracy of NC-ResNet50 model under different momentum factors
[0136] Momentum factor (m) Training set accuracy (%) Test set accuracy (%) Validation set accuracy (%) 0.3 86.60 86.40 86.70 0.6 88.30 86.50 86.20 0.9 86.50 84.04 85.07
[0137] From the prediction experimental results, it can be seen that the NC-ResNet50 model has the highest accuracy when the momentum factor m = 0.6. When the momentum factor is 0.6, the optimal learning rate is selected according to the experimental results in Table 4.
[0138] Table 4 Accuracy of NC-ResNet50 model under different learning rates
[0139] Learning rate (α) Training set accuracy (%) Test set accuracy (%) Validation set accuracy (%) 0.001 88.43 87.04 86.42 0.0001 87.62 86.70 86.20
[0140] From the experimental data in Table 4, when the learning rate is 0.001, the model has the best accuracy, so the model hyperparameters (momentum factor and learning rate) are set to 0.6 and 0.001 respectively. In order to compare the performance of the improved NC-ResNet50 network model and the other four types (AlexNet, InceptionV3, VGG-16, ResNet50) trained in the transfer learning mode, this scheme makes the experiment more representative, and the total average value of three experiments is taken as the final experimental result. In the transfer learning process, there are three training strategies: (1) Shallow Strategy, which fine-tunes the weights and parameters of the fully connected layer, and the remaining layers act as feature extractors. (2) Deep Strategy, which requires fine-tuning the weights and parameters of all layers of the model. The purpose of these two strategies is to enable the deep convolutional neural network model to extract more key features related to the target task from the pre-trained model. (3) From-Scratch Strategy, which starts training from randomly configured weights. Among the three training strategies, the deep strategy is superior to the shallow learning strategy and the from-scratch learning strategy. Therefore, the transfer learning training strategy in this paper adopts the deep strategy. The total average accuracy rate of the classification of citrus diseases by the five deep convolutional neural networks in the transfer learning mode is shown in Table 5:
[0141] Table 5 Comparison of recognition accuracy of different models
[0142]
[0143] From Table 5, among them, the AlexNet network uses the grouping convolution method in the training process, and the different disease features of the image dataset are calculated separately, resulting in the model convolution kernel being unable to perform convolution transport with all the features of the disease image, thus the model has poor generalization ability and low accuracy, and the average accuracy of the model is only 82.94%; The applicability of the InceptionV3 network model to the multi-scale features of citrus disease images is not fully realized, resulting in an average accuracy of the model network of only 82.47%; The VGG-16 network model is difficult to optimize due to the insufficient number of original image datasets for training, and the parameter quantity is relatively large, resulting in an average recognition rate of 82.88%; The ResNet50 model can achieve good accuracy with fewer parameters, and the average recognition rate of the model is 83.17%; Among the four original models, ResNet50 performs better, so it is selected as the basis for optimization model, and the improved NC-ResNet50 recognition rate is the highest among the five models, with an average recognition rate of 85.45%. The model accuracy curve change diagram is shown in Figure 6 .
[0144] To further analyze the performance of the improved model and other comparison models, NC-ResNet50, AlexNet, InceptionV3, VGG-16, and ResNet50 were selected to verify the comparative experimental results of the total average accuracy, total average recall, and harmonic mean of the total accuracy and recall rates of their models. The experimental results are shown in Table 6 below.
[0145] Table 6 Comparison of different network experiments
[0146]
[0147] The experimental results show that the total average recall rate, total precision rate and harmonic mean of total recall rate of the improved NC-ResNet50 model perform better than those of the other four models, thus verifying that the improved model is more suitable for the application of citrus disease grade classification.
[0148] In the process of preparing the citrus image disease dataset, the model training process is controlled by changing the momentum factor and learning rate of the hyperparameters, and then the impact of the hyperparameters on the accuracy and generalization ability of the network model is studied. In order to prevent overfitting in model training, early-stopping technology can be used to reduce the performance impact caused by model overfitting.
[0149] During the training process, the model momentum factor is set to 0.6, the learning rate is set to 0.001, the number of iteration samples is 256, and the number of model training iterations is 100. Figure 7 The loss values of different network models in the training process change with the number of iterations. After the model reaches 40 rounds, the loss value gradually stabilizes. Figure 7 It can be seen that the NC-ResNet50 model converges faster and the loss value training process is stable. Figure 6 From the accuracy, we can see that the NC-ResNet50 model has the highest accuracy. Combined with Table 6, we can see that the model's total average accuracy, total average recall, and harmonic mean of total accuracy and total recall are all the highest, which are 85.45%, 87.24%, and 87.62% respectively. Figure 6 and Figure 7 It can be seen that the NC-ResNet50 model has the best performance among the five models, which reflects the correctness of the method used in this paper to improve the model.
[0150] In a specific implementation, in order to further evaluate the generalization ability of the model on the test set. In this experiment, the classification and detection results of the confusion matrix are used as one of the indicators of the citrus disease validation set images. After obtaining the optimal model through the above method, the model output is verified, and the recognition accuracy and misjudgment rate of each disease degree category are verified. The trained optimal model is used to recognize the test set of citrus samples, and the average accuracy of each type of disease is as shown in the confusion matrix of the different disease level recognition model. Figure 8 The experiment selects Huanglongbing disease pictures (0 represents mild Huanglongbing, 1 represents moderate Huanglongbing, and 2 represents severe Huanglongbing), Canker disease pictures (3 represents mild Canker, 4 represents moderate Canker, and 5 represents severe Canker), healthy leaves (6 represents healthy leaves), Scab disease pictures (7 represents mild Scab, 8 represents moderate Scab, and 9 represents severe Scab), and Black Spot disease pictures (10 represents mild Black Spot, 11 represents moderate Black Spot, and 12 represents severe Black Spot). Different level citrus disease images are used to test the total average accuracy of the four models. The darker the diagonal line, the better the recognition effect of the model. The other positions of the diagonal line represent the error rate of the model.
[0151] The present scheme mainly studies the disease level recognition scene of citrus diseases. Through transfer learning, image segmentation, convolution batch normalization processing mode and different image retrieval strategies, the original backbone model ResNet50 is improved, and the NC-ResNet50 model based on the recognition ability is proposed. The model can effectively identify small sample and low resolution image features by connecting and normalizing the shallow convolution layer and deep convolution layer in RPN. Through the batch convolution layer mode, the fine-tuning time required during model training can also be shortened, thereby improving the model generalization ability and recognition rate accuracy. In order to further improve the model recognition rate in the citrus disease level scene due to the insufficient size of the data set, the transfer learning and unsupervised clustering image segmentation method are used to pre-train and enhance the representation ability of the image sample of the citrus disease image, and finally improve the problem of model performance decline caused by insufficient samples. According to the experimental results of the above model, the improved model has better generalization ability and the total average recognition rate is improved by 2.28%. The final average accuracy is 85.45%. The experimental results can prove the correctness of the method, which can meet the disease recognition demand in the actual orchard and prevent different levels of citrus diseases in time. At the same time, it also provides theory and reference for the application of deep learning in disease level direction, so the output model of the experiment is used for actual recognition.
[0152] The embodiment pre-processes the obtained citrus image based on a K-means algorithm to obtain a processed image; performs disease feature recognition on the processed image based on a preset disease level recognition model of transfer learning, determines a citrus disease image according to the feature recognition result, the preset disease level recognition model of transfer learning is a model obtained by transferring model parameters and parameter weights of a VGG-16 network model to an NC-ResNet50 model, and the model is obtained by training the transferred model; counts the disease area in the citrus disease image, and determines the citrus disease degree according to the counting result. Since the K-means algorithm is used to pre-process the obtained citrus image, the disease feature recognition is performed on the citrus image according to the transferred model, and the citrus disease image is determined according to the feature recognition result, so that 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 recognition accuracy 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 recognition accuracy or overfitting of the citrus plant disease degree classification recognition model due to low sensitivity of the network model to fine-grained features, and improves the disease recognition rate.
[0153] In addition, to achieve the above object, the present application further provides a citrus disease level recognition device, which comprises a memory, a processor and a citrus disease level recognition program stored in the memory and executable on the processor, and the citrus disease level recognition program is configured to implement the steps of the citrus disease level recognition method as described above.
[0154] In addition, to achieve the above object, the present application further provides a storage medium, which stores a citrus disease level recognition program, and the citrus disease level recognition program implements the steps of the citrus disease level recognition method as described above when executed by a processor.
[0155] Reference Figure 9 , Figure 9 The structure block diagram of the first embodiment of the citrus disease level recognition device of the present application is shown in the figure.
[0156] As Figure 9 shown, the citrus disease level recognition device provided by the embodiment of the present application comprises:
[0157] An image pre-processing module 10 is configured to pre-process the obtained citrus image based on a K-means algorithm to obtain a processed image;
[0158] a disease image recognition module 20 for identifying disease features on the processed image based on a preset transfer learning disease grade recognition model, and determining a citrus disease image based on the feature recognition results, wherein the preset transfer learning disease grade recognition model is a model obtained by migrating model parameters and parameter weights of a VGG-16 network model to an NC-ResNet50 model and training the migrated model;
[0159] The disease degree determination module 30 is used to collect statistics on the diseased area in the citrus disease image and determine the citrus disease degree according to the statistical results.
[0160] In this embodiment, the acquired citrus image is preprocessed based on the K-means algorithm to obtain a processed image; the disease features of the processed image are identified based on a preset transfer learning disease level recognition model, and the citrus disease image is determined according to the feature recognition result. The preset transfer learning disease level recognition model is a model obtained by migrating the model parameters and parameter weights of the VGG-16 network model to the NC-ResNet50 model, and the migrated model is trained to obtain a model; the disease area in the citrus disease image is counted, and the degree of citrus disease is determined according to the statistical results. Since the present invention pre-processes the acquired citrus images through the K-means algorithm, identifies disease features of the citrus images according to the migrated model, and determines the citrus disease images according to the feature recognition results, thereby further determining the degree of disease, compared with the prior art in which the image processing is not fine-grained enough and there is a limitation of insufficient number of training images, resulting in low recognition accuracy or overfitting due to the low sensitivity of the network model to fine-grained features, the present invention solves the problem of low recognition accuracy or overfitting caused by the low sensitivity of the citrus plant disease degree grading recognition model to fine-grained features, thereby improving the disease recognition rate.
[0161] Furthermore, the image preprocessing module 10 is also used to perform pixel segmentation on the acquired citrus image based on the K-means algorithm to obtain a pixel data set; segment the citrus image according to the pixel similarity corresponding to the pixel data set, and extract an image containing key disease features from the segmented image.
[0162] Furthermore, the citrus disease grade identification device also includes a model training module, which is used to use the ImageNet image dataset as the source dataset for migration training; train the improved VGG-16 model based on the ImageNet source dataset to obtain a pre-trained model; and construct a preset transfer learning disease grade identification model based on the parameters and weights corresponding to the pre-trained model and the ResNet50 model.
[0163] Further, the model training module is further configured to migrate parameters and weights of the pre-trained model to a ResNet50 model for initialization processing to obtain an improved ResNet50 model; normalize outputs of a conv3 layer and a conv5 layer of the improved ResNet50 model, and input a standardization result output by the improved ResNet50 model to a RoI layer and a fully connected layer for training to obtain a trained NC-ResNet50 model; and fine-tune network parameters corresponding to the trained NC-ResNet50 model to obtain a preset migration learning disease grade identification model.
[0164] Further, the disease image recognition module 20 is further configured to normalize tensors in the conv3 layer and the conv5 layer of the improved ResNet50 model, and standardize all pixels in the combined feature mapping of the conv3 layer and the conv5 layer.
[0165] Each normalized tensor is in the following form:
[0166]
[0167]
[0168] wherein O represents an element pixel vector, and c represents a channel number in the RoI.
[0169] Further, the disease degree determination module 30 is further configured to perform disease class recognition on the citrus disease image based on the preset migration learning disease grade identification model to obtain a disease class; classify the citrus disease image according to the disease class to obtain a citrus disease image set of each disease type; count disease areas in the citrus disease image set of each disease type, and determine a citrus disease degree according to a counting result.
[0170] Further, the disease degree determination module 30 is further configured to obtain a total amount of pixels of a disease area; determine a single-leaf disease degree according to the total amount of pixels and a total amount of pixels of an entire leaf area; count single-leaf disease degrees in the citrus disease image set of each disease type, and determine a citrus disease degree grade according to a disease degree counting result.
[0171] It should be understood that the above is only for illustration, 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 as needed, and the present application does not limit this.
[0172] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of the embodiment scheme, and no limitation is made here.
[0173] In addition, for technical details not fully described in this embodiment, please refer to the citrus disease grade identification method provided in any embodiment of the present invention, and will not be repeated here.
[0174] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0175] The serial numbers of the embodiments of the present invention are for descriptive purposes only and do not represent superiority or inferiority of the embodiments. In a unit claim that enumerates several means, several of these means may be embodied by the same item of hardware. The use of the terms first, second, and third, etc., does not denote any order; these terms should be interpreted as designations.
[0176] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, or of course by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0177] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for identifying citrus disease grades, characterized in that: The citrus disease grade identification method comprises: The acquired citrus images are preprocessed based on the K-means algorithm to obtain processed images; Performing disease feature recognition on the processed image based on a preset transfer learning disease grade recognition model, and determining a citrus disease image based on the feature recognition result, wherein the preset transfer learning disease grade recognition model is a model obtained by migrating model parameters and parameter weights of a VGG-16 network model to an NC-ResNet50 model, and training the migrated model; Counting the diseased area in the citrus disease image, and determining the extent of the citrus disease according to the statistical results; Before the step of performing disease feature recognition on the processed image by the disease grade recognition model based on the preset transfer learning and determining the citrus disease image according to the feature recognition result, the method further includes: The ImageNet image dataset is used as the source dataset for migration training; Train the improved VGG-16 model based on the ImageNet source dataset to obtain a pre-trained model; Migrating the parameters and weights of the pre-trained model to the ResNet50 model for initialization to obtain an improved ResNet50 model; Normalizing the outputs of the conv3 and conv5 layers of the improved ResNet50 model, and inputting the normalized results output by the improved ResNet50 model into the RoI layer and the fully connected layer for training to obtain a trained NC-ResNet50 model; The network parameters corresponding to the trained NC-ResNet50 model are fine-tuned to obtain a preset transfer learning disease grade recognition model.
2. The method for identifying citrus disease grades according to claim 1, wherein: The step of preprocessing the acquired citrus image based on the K-means algorithm to obtain the processed image includes: The obtained citrus images are segmented based on the K-means algorithm to obtain a pixel data set; The citrus image is segmented according to the pixel similarity corresponding to the pixel point data set, and an image containing key disease features is extracted from the segmented image.
3. The method for identifying citrus disease grades according to claim 1, wherein: The step of normalizing the outputs of the conv3 layer and the conv5 layer of the improved ResNet50 model includes: Normalizing the tensors in the conv3 and conv5 layers of the improved ResNet50 model, and normalizing all pixels in the merged feature maps of the conv3 and conv5 layers; The normalized form of each tensor is as follows: represents the normalized O, O represents the element pixel vector, and c represents the number of channels in the RoI.
4. The method for identifying citrus disease grades according to claim 1, wherein: The step of counting the diseased area in the citrus disease image and determining the extent of the citrus disease according to the statistical result includes: Perform disease classification on citrus disease images based on the preset transfer learning disease grade recognition model to obtain disease categories; Classifying the citrus disease images according to the disease categories to obtain a set of citrus disease images of each disease type; The diseased area in the citrus disease image collection of each disease type is counted, and the degree of citrus disease is determined based on the statistical results.
5. The method for identifying citrus disease grades according to claim 4, wherein: The step of counting the diseased areas in the citrus disease image set of each disease type and determining the degree of citrus disease according to the statistical results further includes: Get the total number of pixels in the diseased area; determining the disease degree of a single leaf according to the total number of pixels and the total number of pixels of the entire leaf area; The disease severity of single leaves in the citrus disease image collection of each disease type is counted, and the citrus disease severity level is determined based on the disease severity statistical results.
6. A citrus disease grade identification device, characterized in that: The citrus disease level identification device includes: a memory, a processor, and a citrus disease level identification program stored in the memory and executable on the processor. When the citrus disease level identification program is executed by the processor, the citrus disease level identification method according to any one of claims 1 to 5 is implemented.
7. A storage medium, characterized in that: The storage medium stores a citrus disease level identification program, which, when executed by a processor, implements the citrus disease level identification method according to any one of claims 1 to 5.
8. A citrus disease grade identification device, characterized in that: The citrus disease grade identification device comprises: An image preprocessing module is used to preprocess the acquired citrus images based on the K-means algorithm to obtain processed images; A disease image recognition module is used to identify disease features in the processed image based on a preset transfer learning disease grade recognition model, and to determine the citrus disease image based on the feature recognition results. The preset transfer learning disease grade recognition model is a model obtained by migrating the model parameters and parameter weights of the VGG-16 network model to the NC-ResNet50 model, and training the migrated model. a disease extent determination module, configured to perform statistics on the diseased area in the citrus disease image and determine the extent of the citrus disease based on the statistical results; Before the step of performing disease feature recognition on the processed image by the disease grade recognition model based on the preset transfer learning and determining the citrus disease image according to the feature recognition result, the method further includes: The ImageNet image dataset is used as the source dataset for migration training; Train the improved VGG-16 model based on the ImageNet source dataset to obtain a pre-trained model; Migrating the parameters and weights of the pre-trained model to the ResNet50 model for initialization to obtain an improved ResNet50 model; Normalizing the outputs of the conv3 and conv5 layers of the improved ResNet50 model, and inputting the normalized results output by the improved ResNet50 model into the RoI layer and the fully connected layer for training to obtain a trained NC-ResNet50 model; The network parameters corresponding to the trained NC-ResNet50 model are fine-tuned to obtain a preset transfer learning disease grade recognition model.
Citation Information
Patent Citations
Citrus disease degree identification method and device, equipment and storage medium
CN114897051A