A method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning
Through multi-task learning combined with image recognition and feature reconstruction tasks, a Citrus aurantium plant diseases and insect pests identification model is constructed, which solves the problems of low identification accuracy and over-fitting in traditional methods, achieves higher identification accuracy and generalization ability, and is suitable for Pest and disease management in citrus aurantium cultivation.
Patent Information
- Application Number
- CN202111514958.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-12-10
AI Technical Summary
Traditional citrus aurantium pest identification methods rely on manual observation and single-task learning, resulting in low recognition accuracy and over-fitting. They are unable to effectively respond to the timely discovery and prevention of citrus aurantium pests and diseases, which limits the development of the citrus aurantium cultivation industry.
A method based on multi-task learning was used to build a Citrus aurantium plant diseases and insect pests identification model through a hard parameter sharing mechanism. The network model was optimized by combining image recognition and feature reconstruction tasks to improve the identification accuracy.
It improves the accuracy of identification of diseases and pests of Citrus aurantium, reduces the risk of model over-fitting, enhances the generalization ability, and is suitable for pest management of Citrus aurantium cultivation industry.
Smart Images

Figure CN114266965B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of identification of diseases and pests of Citrus aurantium, and in particular to a method for identifying diseases and pests of Citrus aurantium based on multi-task learning. Background Art
[0002] Citrus aurantium is the dried immature fruit of Citrus aurantium L. and its cultivated varieties. As an important Chinese herbal medicine, it has various pharmacological effects such as treating food stagnation, inhibiting gastrointestinal motility, increasing blood pressure and strengthening the heart, anti-ulcer, anti-shock, and anti-analgesia. It is also an important raw material for the herbal medicine market and clinical applications. Therefore, the healthy and stable development of Citrus aurantium cultivation has important practical significance in medicine and agriculture. The key to the stable development of Citrus aurantium cultivation lies in the quality guarantee of Citrus aurantium. In each growth cycle of Citrus aurantium, due to the biological properties of Citrus aurantium itself and the seasonal changes of the external environment, Citrus aurantium is not only prone to fruit and branch diseases, but also easy to become a delicious meal for a variety of pests. If Citrus aurantium diseases and pests are transmitted and spread in large quantities, it will seriously threaten the quality of Citrus aurantium, and thus greatly restrict the development of Citrus aurantium cultivation. Therefore, the timely discovery and treatment of Citrus aurantium diseases and pests are crucial. However, it is better to teach people how to fish than to give them fish. It is too late to mend the fold after the sheep have been lost. The fundamental solution to the problem is to popularize the basic knowledge of disease and pest control among rural growers, let them enjoy the dividends brought by the rapid development of the Internet, and teach them the skills to obtain information using the high-speed and developed Internet.
[0003] Traditional identification and management of Citrus aurantium pests and diseases completely rely on manual observation experience, which requires diagnostic personnel to have a high level of professionalism and rich experience. However, compared with professionals, Citrus aurantium cultivation and maintenance personnel have limited professionalism. If they encounter pests and diseases, they cannot make timely and effective judgments, which leads to the spread of pests and diseases, resulting in the expansion of the infected area of Citrus aurantium cultivation, affecting the yield and quality of Citrus aurantium. Image recognition technology has been developed for many years, but some traditional planting industries have not yet enjoyed the huge benefits brought by image recognition technology. This shows that the rapid development of information technology and the backward planting production methods in some remote areas of my country are important contradictions that restrict their economic development.
[0004] Image recognition technology has been widely used in all aspects of people's lives. Today's image recognition technology is also very mature and can achieve very high recognition rates and accuracy. In theory, image recognition technology should also be applied to the identification of agricultural planting related categories. In the field of pest and disease identification, domestic and foreign experts and scholars have conducted a lot of research, mainly focusing on two aspects: the first is the traditional machine learning method; the second is the deep learning method. Traditional machine learning methods mainly focus on feature extraction and selection, such as extracting the edge features of pest and disease scars. This type of method usually requires complex feature engineering, low recognition accuracy, and difficulty in identifying pests and diseases with complex backgrounds. The deep learning method combines the advantages of deep networks, trains the model to learn the deep features of pest and disease images, and performs better than traditional methods. Deep Convolutional Neural Network (DCNN) is currently the hottest deep learning research field. It has obvious performance advantages in the field of recognition and classification, but the training model has a huge overhead and cost, and requires a large data set as support to achieve better recognition results.
[0005] Since the yield of Citrus aurantium is relatively low compared to other crops and people are not very familiar with it, there are few studies on the identification of diseases and pests of Citrus aurantium at home and abroad. Existing work focuses more on the identification of diseases and pests of citrus. Although Citrus aurantium and citrus have many similarities, there are still some differences in the main categories of diseases and pests and the way they occur. Therefore, the study of the identification method of diseases and pests of Citrus aurantium is of great significance and application prospects.
[0006] Previous methods for identifying crop diseases and pests were mostly based on single-task learning. However, since the yield of Citrus aurantium is relatively low compared to other crops and people are not very familiar with it, there are relatively few image datasets of Citrus aurantium diseases and pests collected. Due to the limitation of the number of images in the dataset, under the single-task learning method, the trained network model often suffers from overfitting, which leads to the inability to achieve high classification performance on the test set. Summary of the invention
[0007] In view of the defects existing in the prior art, the purpose of the present invention is to provide a method for identifying diseases and pests of Citrus aurantium based on multi-task learning. Based on the idea of multi-task learning, the recognition model is optimized by multi-task coordination to obtain a better network model for disease and pest recognition, thereby improving the recognition accuracy.
[0008] In order to achieve the above object, the specific technical solution adopted by the present invention is as follows:
[0009] A method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning, specifically comprising the following steps:
[0010] Step 1, using the Citrus aurantium pest and disease dataset as training data, extracting features from the training data through several pre-training models, and adding a fully connected layer to perform classification training on the extracted feature vectors;
[0011] Step 2: Compare and analyze the classification performance and generalization ability of all pre-trained models on the Citrus aurantium pest and disease dataset, and select the pre-trained model with the best generalization ability to build a backbone shared network;
[0012] Step 3, using the hard parameter sharing mechanism in multi-task learning, constructing a first branch task network for classification of Citrus aurantium pests and diseases and a second branch task network for feature reconstruction, the input of the trunk shared network is training data, and the feature vector of the training data is output to the first branch task network and the second branch task network; setting the structure and loss function of the first branch task network and the second branch task network;
[0013] Step 4, training and optimizing the first branch task network and the second branch task network, and saving the Fructus Aurantii Immaturus pest and disease recognition model composed of the trunk shared network, the first branch task network and the second branch task network;
[0014] Step 5: input the image of the Citrus aurantium pests and diseases into the Citrus aurantium pests and diseases recognition model to obtain the recognition result.
[0015] Preferably, the pre-trained model in step 2 includes 4 densely connected blocks, and each densely connected block is connected together through a transition layer.
[0016] Preferably, in step 2, the backbone sharing network is connected to a global average pooling layer and a fully connected layer at the feature output layer of the pre-trained model.
[0017] Preferably, setting the structure and loss function of the first branch task network in step 3 specifically refers to:
[0018] The first branch task network is set to have a 20-dimensional fully connected layer, and the classification loss is calculated through the output of the SoRmax layer. The cross entropy is used as the loss function during the network training process.
[0019] Preferably, setting the structure and loss function of the second branch task network in step 3 specifically refers to:
[0020] The second branch task network is set to contain four fully connected layers, and then connected to a full local average pooling layer to complete feature reconstruction. The mean square error is used as the loss function during the network training process.
[0021] Preferably, in step 4, the first branch task network and the second branch task network are jointly optimized, and the weights are updated during the gradient back propagation process. The final loss of the Citrus aurantium pest and disease recognition model is expressed as follows:
[0022] L total =αL cls +βL feature , where L cls and L feature They represent the loss functions of the classification task and feature reconstruction task of Citrus aurantium pests and diseases, respectively, and α and β are the corresponding two task weights.
[0023] Preferably, the preferred value of α is 1.8, and the preferred value of β is 0.2.
[0024] Preferably, the models in step 1 and step 4 are trained using the same hyperparameters.
[0025] The beneficial effect of the present invention is that based on the idea of multi-task learning, the recognition model is optimized through multi-task coordination to obtain a better pest and disease recognition network model, thereby improving the recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 It is a flow chart of a method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning of the present invention;
[0028] Figure 2 It is a schematic diagram of the identification model of Citrus aurantium pests and diseases. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the scope of protection of the present invention.
[0030] In deep learning, multi-task learning is divided into hard parameter sharing mechanism and soft parameter sharing mechanism according to the different ways of sharing parameters of the hidden layer of the deep network. The hard parameter sharing mechanism is achieved by sharing the hidden layer between all tasks while retaining the output layer of several specific tasks. This method can reduce the risk of model overfitting to a certain extent. When more tasks are learned at the same time, the generalization ability of the model will be stronger. Therefore, the hard parameter sharing mechanism in multi-task learning is more common in practical applications. In the soft parameter sharing mechanism, each task has its own parameters and model, and it encourages the similarity of model parameters by regularizing the distance between model parameters, such as using L2 distance for regularization. The effectiveness of multi-task learning is caused by a variety of working mechanisms, including implicit data augmentation, attention mechanism, eavesdropping, representation bias, regularization, etc.
[0031] like Figure 1 As shown, the present invention proposes a method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning, which uses two tasks, image recognition and image reconstruction, to train a recognition network, specifically comprising the following steps:
[0032] Step 1, using the Citrus aurantium pest and disease dataset as training data, extracting features from the training data through several pre-training models, and adding a fully connected layer to perform classification training on the extracted feature vectors;
[0033] You can choose the commonly used VGG16, InceptionV3, and DenseNet121 pre-training models to remove the bottleneck layer and perform feature extraction on the input Citrus aurantium pest and disease dataset.
[0034] Step 2: Compare and analyze the classification performance and generalization ability of all pre-trained models on the Citrus aurantium pest and disease dataset, and select the pre-trained model with the best generalization ability to build a backbone shared network;
[0035] By connecting the feature vector as input again to the global average pooling layer, and then connecting a 20-dimensional fully connected layer, and using the Softmax activation function for classification, through model training, the classification accuracy of the three pre-trained network structures on the data set was compared and analyzed, and finally the DenseNet121 pre-trained model with better generalization ability was selected as the feature extraction part of the backbone shared network for Citrus aurantium pests and diseases in the multi-task Citrus aurantium pests and diseases recognition model, and then connecting the global average pooling layer to the feature output layer to reduce the spatial parameters and make the model more robust, and finally connecting a 1024-dimensional fully connected layer.
[0036] The DenseNet network structure model contains a total of 4 densely connected blocks, and each densely connected block is connected together through a transition layer. A densely connected block is a module containing many layers. Each layer in a densely connected block is connected to all previous layers and serves as the input of the next layer. The feature map of each layer has the same size, and dense connections are used between layers. For a network with L layers, DenseNet contains a total of L(L+1) / 2 connections.
[0037] The input of the model is x0, the output of the first layer is x1, H l (*) is a non-linear transformation function, which is a combination of operations that may include a series of batch normalization, activation function (ReLU), pooling and convolution (Conv) operations. The relationship between the l-1 layer and the l layer is shown in formula (1). l-1 ] represents the concatenation of the outputs from layer 0 to layer l-1 in a dense block.
[0038] x l =H l ([x0, x1, ..., x l-1 ]) (1)
[0039] In addition, the dense connections between layers within the densely connected blocks in the DenseNet network structure also help the propagation of information and gradients in the network, thereby training deeper convolutional neural networks and solving the gradient disappearance problem of deep networks.
[0040] The transition connection layer is mainly used to connect two adjacent densely connected blocks and reduce the size of the feature map. The transition layer includes a 1×1 convolution and a 2×2 average pooling. In addition, the transition layer can play the role of compressing the model, thereby improving the statistical efficiency of the network.
[0041] Step 3, using the hard parameter sharing mechanism in multi-task learning, constructing a first branch task network for classification of Citrus aurantium pests and diseases and a second branch task network for feature reconstruction, the input of the trunk shared network is training data, and the feature vector of the training data is output to the first branch task network and the second branch task network; setting the structure and loss function of the first branch task network and the second branch task network;
[0042] The present invention adopts the common hard parameter sharing mechanism in multi-task learning and designs a Figure 2The multi-task deep network model for identification of Citrus aurantium pests and diseases shown in the figure. The model constructed by the present invention comprises three parts, namely a backbone sharing network, a first branch task network for classification of Citrus aurantium pests and diseases, and a second branch task network for feature reconstruction, and the complementary characteristics between the two tasks are used to improve the accuracy of identification of Citrus aurantium pests and diseases.
[0043] The backbone shared network is shared by two single-task networks: classification of Citrus aurantium pests and diseases and feature reconstruction. The input of this part of the network is the constructed Citrus aurantium pests and diseases image dataset, and then the output result is used as the input of the subsequent two tasks through the backbone shared network.
[0044] The network for the classification of diseases and pests of Citrus aurantium is connected to a 20-dimensional fully connected layer, and then the classification loss is calculated through the output of the Softmax layer. The cross entropy is used as the loss function during network training, and the specific definition is shown in formula (2).
[0045]
[0046] Among them, N is the number of categories in the data set, y ic is a flag variable whose value can be 0 or 1. If the identified pest category is the same as the category of sample i in the dataset, it is 1, otherwise it is 0. ic is the predicted probability that sample i belongs to the true category c.
[0047] The feature reconstruction task includes a fully connected layer with 256, 218, 256, and 1024 neurons, and then connected to a full local average pooling layer to complete the feature reconstruction. The mean square error is used as the loss function during network training, defined as formula (3).
[0048]
[0049] Where n is the number of samples in the pest and disease dataset. and i are the predicted and actual values of the features, respectively.
[0050] Step 4, training and optimizing the first branch task network and the second branch task network, and saving the Fructus Aurantii Immaturus pest and disease recognition model composed of the trunk shared network, the first branch task network and the second branch task network;
[0051] The first branch task network and the second branch task network are jointly optimized, and the weights are updated during the gradient back propagation process. The final loss of the Citrus aurantium pest and disease recognition model is expressed as follows:
[0052] L total =αL cls +βL feature , where L cls and Lfeature They represent the loss functions of the classification task and feature reconstruction task of Citrus aurantium pests and diseases, respectively, and α and β are the corresponding weights of the two tasks. Through multiple trainings, it was found that the classification accuracy can be best when α is 1.8 and β is 0.2.
[0053] Step 5: input the image of the Citrus aurantium pests and diseases into the Citrus aurantium pests and diseases recognition model to obtain the recognition result.
[0054] Preferably, the models in step 1 and step 4 are trained with the same hyperparameters. Some main parameter settings are as follows: All model networks in the experiment use the Adam algorithm as the optimization algorithm, set the training batch size (Batch Size) to 32, and the initial learning rate is 0.0001. For multi-task models, since there is a problem of inconsistent learning between tasks in multi-task learning, the weights of multi-task losses are manually adjusted many times to obtain the best task learning effect. The initial weight values of the two tasks are set to 1, and the sum of the weights is 2. Through multiple experimental results comparison, the loss weight of the classification task of Citrus aurantium pests and diseases is finally set to 1.8, and the weight of the feature reconstruction task is 0.2 to obtain the best results. The comparison of the models is based on their performance on the test set.
[0055] Verify the results
[0056] In order to verify the effectiveness of the method proposed in the present invention in the identification of diseases and pests of Citrus aurantium, the images of diseases and pests are first preprocessed. Due to the different sources of Citrus aurantium disease and pest data sets, the image data will be affected by different factors such as image size and illumination differences. In order to reduce the impact of these factors on later image feature extraction, image recognition and other work, it is necessary to preprocess the original images in the Citrus aurantium data set. First, read the image from the data set and decode it to obtain the three-dimensional matrix corresponding to the image, then use the bilinear interpolation method to adjust the image size and set it to 224x224, and finally normalize the image. Limited by the number of data sets, the Citrus aurantium data set is randomly divided according to the ratio of training set: test set = 8:2. The training set data is 1627 pictures and the test set data is 406 pictures.
[0057] Citrus aurantium pests and diseases images can be collected on the Internet through crawler scripts written in Python, obtained from Citrus aurantium related books, and collected in Citrus aurantium planting areas through camera equipment. Then the collected data are manually reviewed and screened, and images that are not Citrus aurantium pests and diseases and images with poor quality are cleaned up. Finally, the Citrus aurantium pests and diseases images after screening are classified, and finally a Citrus aurantium pests and diseases dataset (referred to as Citrus20) containing 2 major categories and 20 minor categories with a total of 2033 images is constructed. The detailed information of the Citrus aurantium pests and diseases dataset collected is shown in Table 1.
[0058] Table 1 Dataset details table
[0059] Name of diseases and pests of Citrus aurantium category Number of pictures / pieces Scale insects 0 54 Ulcers 1 394 Leafminer 2 182 anthrax 3 244 Sooty disease 4 118 Scab 5 187 Psoralea 6 184 Red Spider 7 37 Ceroplastes rubrum 8 28 Potassium deficiency 9 21 Iron deficiency 10 24 Zinc deficiency 11 29 Magnesium deficiency 12 19 Foot rot 13 52 aphid 14 54 Brown alternating beetle 15 33 Yellow thorn moth 16 28 Xanthelasma 17 89 Huanglongbing 18 238 Black spiny whitefly 19 18
[0060] (1) Comparative experiment on generalization ability of pre-trained models
[0061] In order to compare the generalization ability of VGG16, InceptionV3 and DenseNet121 pre-trained models on the constructed Citrus20 dataset, a basic model generalization ability comparison experiment was conducted on the Citrus20 dataset, and the experimental results are shown in Table 2. As can be seen from Table 2, on the Citrus20 dataset, for the classification accuracy of the test set, the DenseNet121 pre-trained model has better generalization ability than the VGG16 and InceptionV3 pre-trained models. Therefore, the DenseNet121 pre-trained model is used as the backbone shared benchmark network of the Citrus aurantium pest and disease recognition model.
[0062] Table 2 Experimental evaluation results of Citrus20 basic pre-training model
[0063] Model Test set classification accuracy Run time (s / Batch Size) VGG16 0.7414 624 InceptionV3 0.7488 193 DenseNet121 0.8251 383
[0064] (2) Comparative experiment between single-task and multi-task models
[0065] In order to verify whether the performance of the multi-task learning model is improved compared with that of a single task, on the Citrus20 dataset, the DenseNet121 pre-trained model was first used as a benchmark to construct a single-task network model ST-DenseNet121 for classification of Citrus aurantium pests and diseases. The network structure and hyperparameter settings were the same as the Citrus aurantium pests and diseases classification task in the multi-task recognition model proposed in the present invention. Then, fine-tuning classification models of Citrus aurantium pests and diseases images based on pre-trained VGG16 and InceptionV3, ST-VGG16 and ST-InceptionV3, and models of other papers were constructed, and compared with the multi-task recognition model MT-CNN proposed in the present invention. The experimental results are shown in Table 3.
[0066] Table 3 Experimental evaluation results of single-task training model and multi-task training model
[0067] Model Test set classification accuracy Run time (s / Batch Size) ST-VGG16 0.7562 428 ST-InceptionV3 0.7783 190 Simplified DenseNet 0.8414 165 BridgeNet-19 0.8462 310 ST-DenseNet121 0.8399 380 MT-CNN 0.8522 383
[0068] It can be seen from the experimental results in Table 3 that on the Citrus20 dataset, compared with the training results of a single task, the multi-task recognition model MT-CNN proposed in the present invention can effectively improve the classification accuracy, which further illustrates that multiple tasks can increase the constraints on the underlying feature extraction by sharing a feature extraction network, and different tasks can better improve the generalization performance of the model by balancing and restricting each other. Although the multi-task network model is more time-consuming than a single task, it shows obvious performance advantages.
[0069] In summary, the method for identifying diseases and pests of Citrus aurantium based on multi-task learning of the present invention combines the collaborative optimization method of multi-task learning, combines the image reconstruction task with the task of identifying diseases and pests of Citrus aurantium, and jointly conducts model training, which can increase the constraints on the underlying feature extraction. By balancing and restricting different tasks with each other, the generalization performance of the model can be better improved.
[0070] With the above-mentioned ideal embodiments of the present invention as inspiration, through the above-mentioned description, those skilled in the art can make various changes and modifications without departing from the technical concept of the present invention. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning, characterized in that: The specific steps include: Step 1, using the Citrus aurantium pest and disease dataset as training data, extracting features from the training data through several pre-training models, and adding a fully connected layer to perform classification training on the extracted feature vectors; Step 2: Compare and analyze the classification performance and generalization ability of all pre-trained models on the Citrus aurantium pest and disease dataset, and select the pre-trained model with the best generalization ability to build a backbone shared network; Step 3, using the hard parameter sharing mechanism in multi-task learning, constructing a first branch task network for classification of Citrus aurantium pests and diseases and a second branch task network for feature reconstruction, the input of the trunk shared network is training data, and the feature vector of the training data is output to the first branch task network and the second branch task network; setting the structure and loss function of the first branch task network and the second branch task network; Step 4, training and optimizing the first branch task network and the second branch task network, and saving the Fructus Aurantii Immaturus pest and disease recognition model composed of the trunk shared network, the first branch task network and the second branch task network; Step 5: input the image of the Citrus aurantium pests and diseases into the Citrus aurantium pests and diseases recognition model to obtain the recognition result.
2. The method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning according to claim 1, characterized in that: The pre-trained model in step 2 consists of 4 densely connected blocks, each of which is connected together through a transition layer.
3. The method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning according to claim 2, characterized in that: In step 2, the backbone shared network is connected to the feature output layer of the pre-trained model with a global average pooling layer and a fully connected layer.
4. The method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning according to claim 1, characterized in that: The structure and loss function of the first branch task network set in step 3 specifically refer to: The first branch task network is set to have a 20-dimensional fully connected layer, and the classification loss is calculated through the output of the Softmax layer. The cross entropy is used as the loss function during the network training process.
5. The method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning according to claim 4, characterized in that: The structure and loss function of the second branch task network set in step 3 specifically refer to: The second branch task network is set to contain four fully connected layers, and then connected to a full local average pooling layer to complete feature reconstruction. The mean square error is used as the loss function during the network training process.
6. The method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning according to claim 5, characterized in that: In step 4, the first branch task network and the second branch task network are jointly optimized, and the weights are updated during the gradient back propagation process. The final loss of the Citrus aurantium pest and disease recognition model is expressed as follows: ,in and They represent the loss functions of the classification task and feature reconstruction task of Citrus aurantium pests and diseases, and are the corresponding weights of the two tasks.
7. The method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning according to claim 6, characterized in that: The value of is 1.8, The value of is 0.
2.
8. The method for identifying diseases and insect pests of Citrus aurantium based on multi-task learning according to claim 1, characterized in that: The models in step 1 and step 4 are trained with the same hyperparameters.
