Crop disease fine-grained identification method based on MDFC-ResNet neural network

文档序号:749675 发布日期:2021-04-23 浏览:9次 中文

阅读说明:本技术 一种基于MDFC-ResNet神经网络的农作物病害细粒度识别方法 (Crop disease fine-grained identification method based on MDFC-ResNet neural network ) 是由 胡伟健 李灵芳 樊杰 李宝山 张万锴 于 2020-12-28 设计创作,主要内容包括:一种基于MDFC-ResNet神经网络的农作物病害细粒度识别方法,属于人工智能技术领域,为了解决了传统的农作物病害识别方法中存在细粒度病害识别准确率低、普适性差等问题。对采集的农作物图片进行预处理以适于模型训练;优化传统的ResNet-50神经网络得到改进的MDFC-ResNet神经网络:对ResNet-50神经网络的初始化器与优化器进行优化,为模型选出最优的初始化器与优化器,让模型更加适应数据集;采用训练好的改进的MDFC-ResNet神经网络对多种农作物病害进行细粒度识别。本发明主要用于农作物病害进行细粒度识别。(A crop disease fine-grained identification method based on an MDFC-ResNet neural network belongs to the technical field of artificial intelligence and aims to solve the problems of low fine-grained disease identification accuracy, poor universality and the like in the traditional crop disease identification method. Preprocessing the collected crop pictures to be suitable for model training; optimizing the traditional ResNet-50 neural network results in an improved MDFC-ResNet neural network: optimizing an initializer and an optimizer of the ResNet-50 neural network, and selecting the optimal initializer and the optimal optimizer for the model to make the model more adaptive to the data set; and (3) performing fine-grained identification on various crop diseases by adopting a trained improved MDFC-ResNet neural network. The invention is mainly used for fine-grained identification of crop diseases.)

1. A crop disease fine-grained identification method based on an MDFC-ResNet neural network is characterized by comprising the following implementation processes:

step one, data preprocessing: preprocessing the collected crop pictures to be suitable for model training, and specifically comprises the following steps:

the first step, data enhancement: data enhancement is used for eliminating the difference of the number of pictures among various categories, each category corresponds to the health state of a specific crop or the degree of a certain disease, and the sample is expanded by using a data enhancement technology for the category with the smaller number of pictures;

step two, data normalization: normalizing the size of the pictures to be used for uniformly acquiring the size of the pictures of the crops, and uniformly normalizing the pictures of the data set after data enhancement into 224 pixels multiplied by 224 pixels before model training;

thirdly, SVD compresses the picture: the SVD compressed picture is used for improving the picture quality, extracting important information from the original picture and removing noise in the picture;

step two, optimizing an initializer and an optimizer of the traditional ResNet-50 neural network to select the optimal initializer and optimizer for the model to obtain the optimized ResNet-50 neural network;

training the optimized MDFC-ResNet neural network by taking a training set in a data set obtained after data preprocessing as the input of a model and taking a crop disease recognition result corresponding to a crop picture in the data set as the output of the model so as to obtain a final trained MDFC-ResNet neural network, namely obtaining a model for performing fine-grained recognition on multiple crop diseases;

and step three, performing fine-grained identification on various crop diseases by adopting the trained MDFC-ResNet neural network.

2. The method for identifying the crop disease fine granularity based on the MDFC-ResNet neural network is characterized in that in the step one, a data set is divided into a training set and a verification set according to the ratio of 4:1, and a small part is reserved as a test set; the training set, the verification set and the test set exist independently and do not have intersection.

3. The method for identifying the fine grain of the crop diseases based on the MDFC-ResNet neural network as claimed in claim 1 or 2, wherein in the second step, the training set is used as an input of a training model, the validation set is input to the validation model, an output result of the training model is input to the validation model, and the validation model gives a judgment whether the training model meets expectations or not: if so, saving the model, inputting the test set into the saving model, and outputting the test accuracy by the saving model, otherwise, adjusting the parameters of the training model, and judging through the verification model until the test accuracy is in accordance with the expectation.

4. The method for identifying the fine granularity of the crop diseases based on the MDFC-ResNet neural network as claimed in claim 3, wherein in the third step, the process of identifying the fine granularity of the crop diseases by adopting the improved MDFC-ResNet neural network comprises the following steps:

the method specifically comprises the following steps: in a first dimension, namely a species identification dimension, carrying out species identification on crop leaves to obtain a matrix distribution result of the species dimension identification; in a second dimension, namely a coarse grain disease identification dimension, performing coarse grain disease identification on crop leaves to obtain a matrix distribution result of coarse grain disease identification; performing fine-grained disease identification on the crop leaves in a third dimension, namely a fine-grained disease identification dimension, and obtaining a matrix distribution result of the fine-grained disease identification;

and after the three dimensions, a compensation layer is established, the compensation layer receives the recognition probability distribution matrixes from the three dimensions, and the probability distribution matrixes of the species to which the compensation layer belongs and the probability distribution matrixes of the coarse-grained diseases are used as feedback data to compensate the obtained probability distribution matrixes of the fine-grained diseases, so that the recognition result of the fine-grained diseases is improved.

5. The method for identifying the crop disease fine granularity based on the MDFC-ResNet neural network as claimed in claim 4, wherein the relationship between the three dimensions and the compensation layer is specifically as follows:

in the first dimension, carrying out species identification on the crop leaves to obtain a matrix distribution result of the species dimension identification; in the second dimension, carrying out coarse grain disease identification on crop leaves to obtain a matrix distribution result of the coarse grain disease identification; carrying out fine-grained disease identification on the crop leaves in a third dimension to obtain a matrix distribution result of the fine-grained disease identification; and after the three dimensions, a compensation layer is established, the compensation layer receives the recognition probability distribution matrixes from the three dimensions, and compensates the probability distribution matrixes of the obtained fine-grained diseases by using the probability distribution matrixes of the species to which the compensation layer belongs and the probability distribution matrixes of the obtained coarse-grained diseases as feedback data, so that the recognition result of the fine-grained diseases is improved.

6. The method for identifying the crop diseases based on the MDFC-ResNet neural network as claimed in claim 5, wherein in the first step of the first step, each category corresponds to the health state of a specific crop or the degree of a certain disease, the categories 0-59 are classified into 60 categories, and the specific categories are shown in the following table:

7. the method for identifying the crop disease fine granularity based on the MDFC-ResNet neural network as claimed in claim 6, wherein the formula of the compensation layer is as follows:

in the formula, alpha and beta respectively represent the weight of a matrix identified by species dimension and the weight of a matrix identified by coarse-grained diseases,

three matrixes on the right side of the equation respectively represent a matrix for species dimension identification, a matrix for coarse-grained disease identification and a matrix for fine-grained disease identification;

Xirepresenting plant species, i having a value of 0-9, YjRepresenting the coarse particle size disease of the plant, and j takes the value of 0-35; z represents a disease of thickness of the plant.

Technical Field

The invention belongs to the technical field of artificial intelligence, relates to a crop disease fine-grained identification method, and particularly relates to an MDFC-ResNet neural network based on a deep residual error network.

Background

Crop diseases have great negative influence on agricultural yield, and how to quickly and accurately identify the crop diseases becomes a problem to be solved urgently in order to recover agricultural loss. Most of traditional crop disease identification adopts a manual mode, farmers mainly diagnose and identify crop diseases in the field, the traditional crop disease identification depends on the experience of the farmers on the crop diseases, and the traditional crop disease identification also has the problems of strong personal subjective factors, low identification efficiency, high identification error rate and the like. In recent years, machine learning and deep learning are gradually applied to crop disease identification, and good effects are obtained. In the machine learning method, the characteristics of data need to be identified and processed by experts in related fields and then are sent into a model for learning; and the deep learning model can extract feature information required for classification from the data set by itself. The feature information extracted by the traditional machine learning is very limited compared with deep learning, so that the identification of crop diseases by adopting a deep learning technology is one of the hot problems of current research.

However, through analysis of the existing crop disease identification method, the existing method has certain limitations on crop types and neural networks, is difficult to play a guiding role in actual agricultural production and life, and is specifically represented as follows:

1. the traditional manual identification mode is too dependent on the experience of people on crop diseases, is very easily influenced by personal subjective factors, and has a series of problems of low identification efficiency, high identification error rate and the like.

2. In machine learning, the characteristics in the data are identified and processed by experts in the related field and then are sent into a model for learning; and the deep learning model can extract feature information required for classification from the data set by itself. The feature information extracted by the conventional machine learning is very limited compared to the deep learning.

3. In terms of crop types, the existing deep learning methods generally identify very single crop types (such as tomatoes and cucumbers), and few methods which support multiple crops and multiple disease types and have high universality are available.

4. The current crop disease identification focuses on coarse-grained disease identification, namely only distinguishing the types of diseases suffered by crops, but cannot clearly identify the fine-grained degree of the diseases suffered by the crops, namely the severity degree of the diseases suffered by the crops. In actual production life, the identification of the degree of crop diseases is extremely important, the degree of the crop diseases directly determines the treatment scheme and the type and level of the pesticide used for the crops, and the wrong pesticide using mode not only is difficult to treat the crop diseases, but also influences the safety of crop eaters and damages the surrounding ecological environment.

5. In terms of neural networks, the existing methods mostly focus on shallow neural network models such as AlexNet and VGG, and although good identification effect is achieved on coarse-grained diseases, the results are not ideal on more complex fine-grained disease identification. However, the recognition accuracy is expected to be further improved with the increase in the number of layers.

Disclosure of Invention

The technical problem to be solved by the invention is as follows:

the invention provides a crop disease fine-grained identification method based on an MDFC-ResNet neural network, aiming at solving the problems of low fine-grained disease identification accuracy, poor universality and the like in the traditional crop disease identification method.

The technical scheme adopted by the invention for solving the technical problems is as follows:

a crop disease fine-grained identification method based on an MDFC-ResNet neural network is realized by the following steps:

step one, data preprocessing: preprocessing the collected crop pictures to be suitable for model training, and specifically comprises the following steps:

the first step, data enhancement: data enhancement is used for eliminating the difference of the number of pictures among various categories, each category corresponds to the health state of a specific crop or the degree of a certain disease, and a sample is expanded by using a data enhancement technology (horizontal turning and rotation) on the category with less pictures;

step two, data normalization: normalizing the size of the pictures to be used for uniformly acquiring the size of the pictures of the crops, and uniformly normalizing the pictures of the data set after data enhancement into 224 pixels multiplied by 224 pixels before model training;

thirdly, SVD compresses the picture: the SVD compressed picture is used for improving the picture quality, extracting important information from the original picture and removing noise in the picture;

step two, optimizing an initializer and an optimizer of the traditional ResNet-50 neural network to select the optimal initializer and optimizer for the model to obtain the optimized ResNet-50 neural network;

training the optimized MDFC-ResNet neural network by taking a training set in a data set obtained after data preprocessing as the input of a model and taking a crop disease recognition result corresponding to a crop picture in the data set as the output of the model so as to obtain a final trained MDFC-ResNet neural network, namely obtaining a model for performing fine-grained recognition on multiple crop diseases;

and step three, performing fine-grained identification on various crop diseases by adopting the trained MDFC-ResNet neural network.

Further, in the first step, dividing the data set into a training set and a verification set according to the ratio of 4:1, and reserving a small part as a test set; the training set, the verification set and the test set exist independently and do not have intersection.

Further, in the second step, the training set is used as the input of the training model, the validation set is input to the validation model, the output result of the training model is input to the validation model, and the validation model provides the judgment whether the training model meets the expectation: if so, saving the model, inputting the test set into the saving model, and outputting the test accuracy by the saving model, otherwise, adjusting the parameters of the training model, and judging through the verification model until the test accuracy is in accordance with the expectation.

Further, in the third step, the process of performing fine-grained identification on various crop diseases by adopting the improved MDFC-ResNet neural network comprises the following steps:

the method specifically comprises the following steps: in a first dimension, namely a species identification dimension, carrying out species identification on crop leaves to obtain a matrix distribution result of the species dimension identification; in a second dimension, namely a coarse grain disease identification dimension, performing coarse grain disease identification on crop leaves to obtain a matrix distribution result of coarse grain disease identification; performing fine-grained disease identification on the crop leaves in a third dimension, namely a fine-grained disease identification dimension, and obtaining a matrix distribution result of the fine-grained disease identification;

and after the three dimensions, a compensation layer is established, the compensation layer receives the recognition probability distribution matrixes from the three dimensions, and the probability distribution matrixes of the species to which the compensation layer belongs and the probability distribution matrixes of the coarse-grained diseases are used as feedback data to compensate the obtained probability distribution matrixes of the fine-grained diseases, so that the recognition result of the fine-grained diseases is improved.

Further, the relationship between the three dimensions and the compensation layer is specifically as follows:

in a first dimension (species identification dimension), carrying out species identification on crop leaves to obtain a matrix distribution result of the species dimension identification; in a second dimension (coarse grain disease identification dimension), performing coarse grain disease identification on crop leaves to obtain a matrix distribution result of the coarse grain disease identification; and (4) carrying out fine-grained disease identification on the crop leaves in a third dimension (a fine-grained disease identification dimension) to obtain a matrix distribution result of the fine-grained disease identification. And after the three dimensions, a compensation layer is established, the compensation layer receives the recognition probability distribution matrixes from the three dimensions, and compensates the probability distribution matrixes of the obtained fine-grained diseases by using the probability distribution matrixes of the species to which the compensation layer belongs and the probability distribution matrixes of the obtained coarse-grained diseases as feedback data, so that the recognition result of the fine-grained diseases is improved.

Further, in the first step of step one, each category corresponds to the health status or the degree of a certain disease of a specific crop, and categories 0 to 59 are classified into 60 categories, and the specific categories are shown in table 1.

Further, the formula of the compensation layer is as follows:

in the formula, alpha and beta respectively represent the weight of a matrix identified by species dimension and the weight of a matrix identified by coarse-grained diseases,

three matrixes on the right side of the equation respectively represent a matrix for species dimension identification, a matrix for coarse-grained disease identification and a matrix for fine-grained disease identification;

Xirepresenting plant species, i having a value of 0-9, YjRepresenting the coarse particle size disease of the plant, and j takes the value of 0-35; z represents a disease of thickness of the plant.

The invention has the following beneficial technical effects:

the invention carries out fine-grained identification on various crop diseases through reasonable algorithm improvement and data preprocessing. The invention adopts the MDFC-ResNet neural network to carry out fine-grained identification on crop diseases. The invention firstly carries out some processing on the data set: data enhancement, picture size normalization and SVD image compression, and aims to facilitate later model training and improve final accuracy. And optimizing the initializer and the optimizer of the ResNet-50 neural network, so as to select the optimal initializer and the optimal optimizer for the model and enable the model to be more suitable for the data set. And finally, carrying out fine-grained identification on various crop diseases by adopting an MDFC-ResNet neural network. Compared with the traditional crop disease identification, the method provided by the invention can be used for identifying the crop diseases with finer granularity. In actual production and life, the degree of diseases suffered by crops is different, and the adopted treatment scheme, the dosage and the like are different. The method realizes finer-grained identification of crop diseases, and has more guiding significance in the aspects of crop disease treatment, pesticide consumption reduction, crop protection, natural environment protection and the like.

The MDFC-ResNet neural network takes the adjusted depth residual error network as a basic model, constructs a multi-dimensional residual error neural network model from three dimensions of species, coarse grain diseases and fine grain diseases, and introduces a compensation layer. And the compensation layer receives the recognition probability distribution matrixes from the three dimensions, compensates the probability distribution matrixes of the species to which the recognition probability distribution matrixes belong and the probability distribution matrixes of the coarse-grained diseases as feedback data to obtain the probability distribution matrixes of the fine-grained diseases, and obtains a final recognition result.

Drawings

FIG. 1 is a flow chart of the present invention;

FIG. 2 is a schematic diagram of data enhancement of the present invention;

FIG. 3 is a schematic view of an SVD of the present invention;

FIG. 4 is a schematic diagram of fine-grained identification of various crop diseases by the MDFC-ResNet neural network of the invention. In the figure, CONV is a convolution layer, BatchNorm is a BN layer, ReLu is an activation function, MaxPoint is a pooling layer, Convolitional block (50) is an Identity residual block of a ResNet-50 neural network, Identity block (50) is a convolution residual block of the ResNet-50 neural network, Softmax is a classifier, and Identity block (34) is a convolution residual block of a ResNet-34 neural network

FIG. 5 is a schematic diagram of the MDFC-ResNet neural network compensation layer of the present invention.

Detailed Description

The method for identifying the fine grain size of the crop disease based on the MDFC-ResNet neural network is further described with reference to the accompanying drawings and the specific implementation mode.

The first embodiment is as follows: as shown in fig. 1, the flow chart for identifying the fine granularity of crop diseases comprises the following operation steps:

step one, data preprocessing comprises the following three steps: the first step of data enhancement is to solve the problem of difference in the number of various types of pictures, each type corresponds to the health state of a specific crop or the degree of a certain disease, and the specific type is shown in table 1; augmenting the samples by using data enhancement techniques (horizontal flipping and rotation) for classes with a smaller number of pictures; the second step of data normalization is to solve the problem of picture size, and uniformly normalize the pictures of the data set into 224 pixels × 224 pixels before the experiment; and thirdly, SVD (singular value decomposition) picture compression is used for solving the picture quality problem, extracting important information from the original picture and removing noise in the picture.

TABLE 1

Some processing (data enhancement, picture size normalization and SVD image compression) is performed on the data set as shown in fig. 2 and 3. The method expands the category of less than 1000 pictures in the data set to 1000 pictures, and simultaneously removes the noise of the pictures and reduces the dimensionality of the pictures.

In the first step, dividing a data set into a training set and a verification set according to the ratio of 4:1, and reserving a small part as a test set; the training set, the verification set and the test set exist independently and do not have intersection.

And step two, optimizing the traditional ResNet-50 neural network, and optimizing an initializer and an optimizer of the ResNet-50 neural network, so as to select the optimal initializer and optimizer for the model and enable the model to be more suitable for the data set.

In the second step, the training set is used as the input of the training model, the verification set is input to the verification model, the output result of the training model is input to the verification model, and the verification model provides the judgment whether the training model meets the expectation: if so, saving the model, inputting the test set into the saving model, and outputting the test accuracy by the saving model, otherwise, adjusting the parameters of the training model, and judging through the verification model until the test accuracy is in accordance with the expectation.

And thirdly, performing fine-grained identification on various crop diseases by adopting an MDFC-ResNet neural network.

In the third step, the process of carrying out fine-grained identification on various crop diseases by adopting the improved MDFC-ResNet neural network comprises the following steps:

the method specifically comprises the following steps: in a first dimension, namely a species identification dimension, carrying out species identification on crop leaves to obtain a matrix distribution result of the species dimension identification; in a second dimension, namely a coarse grain disease identification dimension, performing coarse grain disease identification on crop leaves to obtain a matrix distribution result of coarse grain disease identification; performing fine-grained disease identification on the crop leaves in a third dimension, namely a fine-grained disease identification dimension, and obtaining a matrix distribution result of the fine-grained disease identification;

and after the three dimensions, a compensation layer is established, the compensation layer receives the recognition probability distribution matrixes from the three dimensions, and the probability distribution matrixes of the species to which the compensation layer belongs and the probability distribution matrixes of the coarse-grained diseases are used as feedback data to compensate the obtained probability distribution matrixes of the fine-grained diseases, so that the recognition result of the fine-grained diseases is improved.

The relationship between the three dimensions and the compensation layer is specifically as follows:

in a first dimension (species identification dimension), carrying out species identification on crop leaves to obtain a matrix distribution result of the species dimension identification; in a second dimension (coarse grain disease identification dimension), performing coarse grain disease identification on crop leaves to obtain a matrix distribution result of the coarse grain disease identification; and (4) carrying out fine-grained disease identification on the crop leaves in a third dimension (a fine-grained disease identification dimension) to obtain a matrix distribution result of the fine-grained disease identification. And after the three dimensions, a compensation layer is established, the compensation layer receives the recognition probability distribution matrixes from the three dimensions, and compensates the probability distribution matrixes of the obtained fine-grained diseases by using the probability distribution matrixes of the species to which the compensation layer belongs and the probability distribution matrixes of the obtained coarse-grained diseases as feedback data, so that the recognition result of the fine-grained diseases is improved.

The formula of the compensation layer is as follows:

in the formula, alpha and beta respectively represent the weight of a matrix identified by species dimension and the weight of a matrix identified by coarse-grained diseases,

three matrixes on the right side of the equation respectively represent a matrix for species dimension identification, a matrix for coarse-grained disease identification and a matrix for fine-grained disease identification;

Xirepresenting plant species, i having a value of 0-9, YjRepresenting the coarse particle size disease of the plant, and j takes the value of 0-35; z represents a disease of thickness of the plant.

The materials are divided into 0-9 species and 10 species, the coarse-grained diseases are respectively 0-35 types and 36 types, and the 0-59 types are the fine-grained diseases and 60 types. The identification process is to identify the species which is one of the ten species, then identify the coarse-grained diseases, and finally identify the fine-grained diseases, and the identification process is the process of identifying one disease. Specifically, it is identified which species, such as apple or grape, the diseased leaves belong to, and which type of coarse-grained disease, such as apple scab, is identified. Then identifying fine-grained diseases, such as common apple scab or serious apple scab. And then correcting the finally identified fine-grained diseases through the identification results of the species and the coarse-grained classes. For example, the identification of species and coarse-grained diseases is accurate, but the identification result of the fine-grained diseases is not practical, and the identification result of the fine-grained diseases is corrected through the identification result of the species and the coarse-grained diseases.

Example (b):

as shown in fig. 4 and 5, a specific identification process and a "compensation" process of the compensation layer.

In a first dimension (species identification dimension), carrying out species identification on crop leaves to obtain a matrix distribution result of the species dimension identification; in a second dimension (coarse grain disease identification dimension), performing coarse grain disease identification on crop leaves to obtain a matrix distribution result of the coarse grain disease identification; and (4) carrying out fine-grained disease identification on the crop leaves in a third dimension (a fine-grained disease identification dimension) to obtain a matrix distribution result of the fine-grained disease identification. And after the three dimensions, a compensation layer is established, the compensation layer receives the recognition probability distribution matrixes from the three dimensions, and compensates the probability distribution matrixes of the obtained fine-grained diseases by using the probability distribution matrixes of the species to which the compensation layer belongs and the probability distribution matrixes of the obtained coarse-grained diseases as feedback data, so that the recognition result of the fine-grained diseases is improved.

Under the same conditions, the comparison result of the MDFC-ResNet neural network and the traditional neural network is shown in Table 2, and the recognition result of the MDFC-ResNet neural network is superior to that of other traditional neural network models. The training set accuracy of the MDFC-ResNet neural network can reach 93.96%, the verification set accuracy is 89.82%, and the test set accuracy is 85.22%.

TABLE 2

Model (model) VGG-19 AlexNet ResNet-50 MDFC-ResNet
Training set accuracy (%) 92.86 85.52 88.65 93.96
Verification set accuracy (%) 89.74 85.70 86.79 89.82
Test set accuracy (%) 80.19 83.10 82.04 85.22

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种特高压瓷质绝缘子串铁帽温度曲线拼接方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!