CN113688787A - Peanut leaf disease identification method - Google Patents

Peanut leaf disease identification method Download PDF

Info

Publication number
CN113688787A
CN113688787A CN202111075342.6A CN202111075342A CN113688787A CN 113688787 A CN113688787 A CN 113688787A CN 202111075342 A CN202111075342 A CN 202111075342A CN 113688787 A CN113688787 A CN 113688787A
Authority
CN
China
Prior art keywords
model
layer
peanut
peanut leaf
leaf disease
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111075342.6A
Other languages
Chinese (zh)
Inventor
员玉良
冯强
徐鹏飞
王东伟
张振豪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Agricultural University
Original Assignee
Qingdao Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Agricultural University filed Critical Qingdao Agricultural University
Priority to CN202111075342.6A priority Critical patent/CN113688787A/en
Publication of CN113688787A publication Critical patent/CN113688787A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a peanut leaf disease identification method, aiming at the problem that overfitting is easily caused by the huge difference of the number of different types of samples in a data set, the data set is balanced through a data optimization processing algorithm, and the overfitting problem is avoided while the training quality is improved. On the basis of the lightweight convolutional neural network model, extracting the peanut leaf disease characteristics by migrating the convolutional layer of the original lightweight convolutional neural network, adding the normalization layer, the global average pooling layer, the flattening layer, the full-link layer and the classification layer again to construct a peanut leaf disease identification model, and completing the deployment on the embedded equipment. The invention can be finally deployed on embedded equipment, thereby realizing portable online diagnosis, does not need computer support, can independently run and analyze the model, realizes online instant diagnosis in the field, improves the diagnosis efficiency, preempts the diagnosis and treatment of peanut plant diseases and insect pests, and has very important significance for promoting agricultural sustainable and high-quality and high-efficiency development.

Description

Peanut leaf disease identification method
Technical Field
The invention belongs to the field of peanut leaf disease identification diagnosis and pattern recognition.
Background
The peanuts have high economic value, are the first major oil crops in China, and the yield of the peanuts accounts for more than half of the total yield of the oil crops. However, frequent foliar diseases severely restrict flower production and quality. The agricultural production mode of China is in the upgrading and transforming period, and the application of each new technology in the field of agricultural production will certainly promote the upgrading and progress of the agricultural operation mode of China. Because the peanut leaves are exposed in the air for a long time, the peanut leaves are inevitably influenced by adverse factors, and the pathological changes of the leaves are induced, so that the yield is reduced. Under the traditional plant leaf disease diagnosis mode, the method is limited by the professional knowledge level of the growers, only can carry out rough diagnosis by virtue of experience, has great blindness and subjectivity, causes waste of manpower and material resources, is very easy to cause misjudgment, delays the best pesticide application time and enlarges loss.
With the deepening and widening of the research depth and the research breadth in the field of agricultural intellectualization, researchers also take the relevant research on plant leaf disease identification to provide a theoretical research basis for the intellectualized detection and diagnosis of plant leaf diseases, but identification models mentioned in the theoretical research generally have the defects of large occupied space, incapability of quantification and incapability of deployment and operation of embedded mobile terminal equipment with low calculation power and low storage power, so that the research and development of portable leaf disease diagnosis equipment are limited. For example, the invention with the application number of 202010165554.2 provides a low-cost tomato leaf disease identification method based on a lightweight deep neural network, and training identification is carried out by constructing an improved residual neural network identification model. According to the method, only according to an original model structure, a residual error network has the problem that quantification cannot be realized, and further the method cannot be deployed on low-computation-power embedded equipment; the required terminal equipment parameters are as follows: the model of the processor is I5-8400, the frequency of the processor is 2.80GHz, and the model of the display card is Gtx1060, so that the model finally runs on a computer with certain configuration, the requirement on hardware cost is high, the model cannot be applied to embedded mobile-end equipment with low computing power and low storage power, namely the model part of the mobile-end equipment cannot be realized, and the disease diagnosis of the peanut leaf part cannot be carried out in the actual production environment in the current peanut planting production link.
In view of the above, it is an object of the present invention to provide a method and an apparatus for quickly, conveniently and intelligently identifying a disease in peanut leaves.
Disclosure of Invention
In order to solve the defects that the diagnosis efficiency of leaf diseases is low and the diagnosis of the leaf diseases of peanuts cannot be carried out in the actual production environment in the current peanut planting production link, the peanut leaf disease identification method capable of being operated on portable equipment is provided, and the following scheme is adopted:
a peanut leaf disease identification method comprises the following steps:
a, acquiring a picture of the single-leaf disease of the peanut on line;
b, calling the trained and deployed model file to identify the type of the leaf disease;
the training and deploying process of the model file in the step B comprises the following steps:
step B1, establishing a peanut leaf disease data set;
step B2, optimizing data;
in data set D { [ M ]1,M2,M3,····Mi][N1,N2N3,····Nj]TNumber of retrieved samples Nmax NmaxIs marked as NymaxAnd is marked with NymaxCorresponding kind MxWherein M isiIs the number of classes (i e [1,5 ]]),NiTo correspond to MiThe number of samples of (a); selecting NymaxAs a molecule, with NiCalculating a scale factor C for the denominatori,
Figure BDA0003262073990000021
Further get the scaling factor C ═ C1,C2···CiAnd upsampling the rare samples according to a proportionality constant to obtain a formula: n is a radical ofi'=Ni×Ci(i∈[1,5]) Then by a scaling factor CiIs measured by up-sampling as follows
Figure BDA0003262073990000022
Figure BDA0003262073990000023
B3. Construction of models
Extracting the lesion features of the peanut leaf by taking a convolutional layer of a lightweight convolutional neural network as a feature extractor, constructing a sequential network model in a linear superposition mode, adding a classifier after the convolutional layer on the basis of transferring the lightweight convolutional neural network convolutional layer, wherein the classifier comprises a normalization layer, a global average pooling layer, a flattening layer, a Dropout layer and an L2 regularization constraint layer, linearly superposing the reconstructed classifier and the transferred convolutional layer, and connecting the output of the feature extractor to the classifier, wherein the L2 regularization constraint formula is
Figure BDA0003262073990000024
Wherein E isinRepresenting the error of a training sample without a regularization term, wherein lambda is a regularization parameter, and w is weight;
B4. model training
B5. The model evaluation module is used for verifying and evaluating the obtained model by using the confusion matrix;
B6. and the model quantization module is used for obtaining a network branch structure and the weight file, and converting the network branch structure and the weight file by a quantization tool to obtain a light deployable model file.
Further, in the step B3, when the hyper-parameter is set, the learning rate η and the first-order matrix estimation exponential decay rate β are set using the dynamic decay learning rate1Second order matrix estimation exponential decay rate beta2Ambiguity factor ε, one-time decay valueParameters, optimizing the algorithm by adaptive moment estimation, wherein the network weight is updated by the following formula in the optimization algorithm:
mt=β1mt-1+(1-β1)gt
vt=β2vt-1+(1-β2)gt 2
Figure BDA0003262073990000031
Figure BDA0003262073990000032
Figure BDA0003262073990000033
wherein the content of the first and second substances,
Figure BDA0003262073990000034
representing the decreasing gradient of an arithmetic function, thetatParameter representing loss th round, J (theta)t) Represents the loss function, mtRepresents the gradient gtFirst moment of (v)tDenotes gtThe second order moment of (a) is,
Figure BDA0003262073990000035
is mtThe correction of the offset of (2) is carried out,
Figure BDA0003262073990000036
is v istThe updated learning rate:
Figure BDA0003262073990000037
automatic decay updating of the learning rate is achieved.
Further, the step B1 includes: and cutting and classifying the original image, uniformly scaling the original image to 224 multiplied by 224 pixels, and classifying diseases to obtain original data sets under different disease classifications.
Further, the step B4 includes: and when the model is trained, a learning rate exponential decay algorithm is adopted, the initial learning rate is set to be 0.0001, the neuron inactivation rate is set to be 0.2, the iteration times are set to be 50, the first moment estimation beta 1 is 0.9, and the second moment estimation beta 2 is 0.999, so that the model is trained and stored.
Further, the step B5 is evaluated by the following indexes:
Figure BDA0003262073990000038
formula section (next section),
Figure BDA0003262073990000039
Where P is the precision rate, R is the recall rate, Acc is the precision rate, TP is the number of positive samples predicted to be positive, TN is the number of negative samples predicted to be negative, FN is the number of positive samples mispredicted to be negative, and FP is the number of negative samples mispredicted to be positive.
Compared with the prior art, the invention has the following advantages and positive effects:
the invention provides a peanut leaf disease identification method capable of running on portable equipment, and provides a targeted model optimization method aiming at the problems that the portable equipment is insufficient in low computational power and a small data set is easy to overfit, so that the complexity of data operation is reduced, the feasibility of running a model on the low computational power equipment is improved, and a peanut leaf disease identification model suitable for running on the low computational power equipment is constructed. Aiming at the problem that the number difference of different types of samples in a data set is huge, so that overfitting is easily caused, the data set is balanced through a data optimization processing algorithm, and the overfitting problem is avoided while the training quality is improved. On the basis of the lightweight convolutional neural network model, extracting the peanut leaf disease characteristics by migrating the convolutional layer of the original lightweight convolutional neural network, adding the normalization layer, the global average pooling layer, the flattening layer, the full-connection layer and the Softmax classification layer again to construct a peanut leaf disease identification model, and completing the deployment on the embedded equipment. The single-leaf image of the peanut plant can be acquired through the camera and automatically stored in the internal storage of the device, and after the corresponding image is selected in software, the disease types are automatically classified, so that the disease can be rapidly detected on line.
The method for identifying the peanut leaf diseases can be finally deployed on embedded equipment, so that portable online diagnosis is realized, computer support is not needed, the model can be independently operated and analyzed, online instant diagnosis on the field is realized, the diagnosis efficiency is improved, the method preempts diagnosis and treatment of peanut diseases and insect pests, and the method has very important significance for promoting agricultural sustainable and high-quality efficient development.
Drawings
FIG. 1 is a general flow diagram of the present invention;
FIG. 2 is a data set building flow diagram;
FIG. 3 is a block diagram of a lightweight convolutional neural network;
in the figure: 301. an input layer; 302 convolutional layer (feature extractor); 303. a Softmax layer;
FIG. 4 is a block diagram of a peanut leaf disease identification network model structure of the present application;
FIG. 5 is a graph of accuracy variation during training of three lightweight convolutional neural networks;
FIG. 6 is a graph of the variation of the loss values during the training of three lightweight convolutional neural networks. (ii) a
FIG. 7 is a self-constructed peanut leaf disease dataset showing various diseases and healthy leaves.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
In the following description, specific details are set forth in order to provide a thorough understanding of the present invention. The invention can be implemented in a number of ways different from those described herein and similar generalizations can be made by those skilled in the art without departing from the spirit of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
In a first embodiment, referring to fig. 1, the embodiment provides a peanut leaf disease identification method, which includes a peanut leaf disease identification network training method and a peanut leaf disease identification network identification method.
The peanut leaf disease identification network training method comprises the following steps.
Firstly, establishing a data set, referring to fig. 7, acquiring a peanut leaf disease image in a natural state, establishing an original data set, obtaining the original data set of the peanut leaf disease in a single-leaf state by effectively cutting the image in the original data set and zooming to 224 × 224 pixels, and further classifying to obtain data sets of different disease types.
The image sample of the self-built peanut data set is from a special test field (37 degrees 31 '47' N,121 degrees 24 '41' E) of agricultural plant protection station in cigarette stage city of Shandong province of China and a special test field (36 degrees 19 '11' N,120 degrees 23 '45' E) of Xifuzhen street peanut planting field in city sunny region of Qingdao city of Shandong province of China, the acquisition time is from 2009 to 2021 year, and OLYMPUS IMAGING CORP.C70WZ camera (CCD camera, the main parameters are set with f/45 of aperture value, 1/100 seconds of exposure time, 11 millimeters of focal length, 3072X 2304 pixels of resolution), SONY DSC-HX30V camera (CMOS sensor camera, the main parameters are set with f/32 of aperture value, 1/500 seconds of exposure time, 4 millimeters of focal length, 4896X 2752 pixels of resolution) and Canon EOS Kiss X5 (digital camera, the main parameters are set with f/5.6 of aperture value, 1/100 seconds of exposure time, Focal length 55 mm, resolution 5184 x 3456 pixels) and the raw data set contains a large number of diseased peanut leaves and distant photographs of healthy peanut leaves. And after the image is obtained, manually dividing the image according to the disease type, and manually cutting the image by using a screenshot tool according to the size of the leaves in the image to obtain a single-leaf state image. The data set contained a. brown spot, b. black spot, e. net spot, general mosaic d. four diseased leaves and c. healthy leaves. After cutting, a total of 536 inequalities of each type of leaf 116 are obtained. The images of various leaf diseases are shown in fig. 7.
Second, data processing
Traditional data processing only accomplishes the amplification of data sets, thereby achieving data enhancement. The method aims at peanut leaf disease identification, whether the distribution proportion of different diseases in an original data set is balanced or not seriously influences the performance of the network, overfitting is easy to occur to small sample data, and therefore characteristic learning of small samples is omitted, the network is mistakenly identified to the small samples, and efficiency is low. Therefore, before data enhancement and capacity expansion are carried out on the data set, data are optimized, and the generalization capability of the network is enhanced.
When the maximum and minimum proportion of the number of samples in the original data set is larger, the data balance is realized by modifying the form of the sampling mode. The method comprises the following specific steps:
1) and (3) coarse removal: and the disease types of partial leaf images in the original data set obtained by cutting cannot be clearly distinguished by naked eyes, and partial images are too fuzzy, so that the rough removing treatment is carried out on partial samples with poor quality in the original data set.
2) And (3) retrieval: in the original data set D { [ M ]1,M2,M3,····Mi][N1,N2N3,····Nj]TNumber of retrieved samples Nmax NmaxIs marked as NymaxAnd is marked with NymaxCorresponding kind Mx. Wherein M isiIs the number of classes (i e [1,5 ]]),NiTo correspond to MiThe number of samples.
3) Calculating a proportionality constant C: selecting NymaxAs a molecule, with NiCalculating a scale factor C for the denominatori,
Figure BDA0003262073990000061
4) And (3) upsampling: from (1.1) the scale factor C ═ C1,C2···CiAnd upsampling the rare samples by different means according to a proportionality constant to obtain the following formula:
Ni'=Ni×Ci(i∈[1,5]) (4.2)
the optimized equalization of data is realized by a segmented complex upsampling mode, and then a scale factor C is usediTakes different up-sampling measures:
Figure BDA0003262073990000062
5) and (3) outputting: to obtain D { [ M { [1,M2,M3,····Mi][N1′,N2′,N3′,····Nj′]TAnd outputting the equalized data.
Based on the data optimization processing algorithm and the image processing algorithm, the equalization operation of the original data set is realized by adopting various image processing algorithms such as rotation, enhancement, mirror image, symmetry and the like, and the finally used data set is obtained. And randomly drawing 1/10 as a test set of the model, and dividing the rest into a training set and a verification set according to a 4:1 ratio. According to the method and the device, the data set with the small sample number is amplified through a data optimization processing algorithm, so that the problem of data distribution inclination is avoided due to the distribution of balanced data sets, the accuracy of the initial stage of network training can be effectively improved after data processing is balanced, and the training time is saved.
Referring to the above method, in the self-established peanut leaf disease data set D { [ M1 black spot, M2 brown spot, M3 healthy leaf, M4 mosaic, M5 net spot ] [ N1 ═ 138, N2 ═ 266, N3 ═ 536, N4 ═ 116, N5 ═ 159] T }, there are only N4 ═ 116, and the healthy leaf 536 with the largest number of mosaic is selected, so according to the above data processing method, N3max is taken as 536, so the proportionality constant C1 ═ 536/138 is 3 (rounded down), so N1 ═ N1 × C1 ═ 138 × 3 ═ 414, N2 ═ N2 × 2 ═ 266 ═ N × 4 ═ N × 8653 ═ C4 ═ 138 × 863 ═ 36464, and N3646 ═ 7 ═ N × 847 ═ 364773 ═ 36159 is again processed.
Because the data set is relatively small, the problem of network overfitting is easily caused. In order to avoid the overfitting problem, the equalized data set is subjected to enhancement processing, the amplification task of the data set is completed through three measures of rotation, mirror image and brightness adjustment, 9692 pictures are selected and coarsely amplified in total, and all the pictures are uniformly processed into 224 pixels in size, wherein the 224 pixels comprise 1656 black spots, 2128 brown spots, 2144 healthy leaves, 1856 common mosaic diseases and 1908 net blotch diseases.
The amplified data set is further divided into two data sets according to the ratio of 9:1, wherein one data set is a training and verifying data set and comprises 8723 leaf images, the other data set is a testing set and comprises 969 photos, and the testing set does not participate in the network training learning process and only can be used for testing the final network performance. The training and verification test set is further divided into a training set and a verification set according to the ratio of 4:1, wherein the training set comprises 6978 leaf photos and the verification set comprises 1745 leaf photos. Table 1 shows the distribution of the original and data-equalized, enhanced data sets.
Table 1 shows the distribution of the peanut leaf disease data sets before and after data enhancement
Figure BDA0003262073990000071
Thirdly, a model building module
Referring to fig. 3, aiming at the characteristics of small difference and high similarity of diseased leaves for peanut leaf disease identification and small data calculation capacity of terminal deployment equipment, a lightweight convolutional neural network which has the advantages of minimum data volume, high classification accuracy and quantitative deployment is selected to construct a peanut leaf disease identification model under the existing Keras framework. Taking the convolution layers of three lightweight convolutional neural networks (MobileNet V2, Xception and NasNetMobile) as a feature extractor, extracting the special diagnosis of the peanut leaf lesion. And constructing a sequential network model by adopting a linear superposition mode, and adding a brand new classifier after the migrated lightweight convolutional neural network convolutional layer. The parameters of the lightweight network are compared with those of the traditional deep convolution network in part as follows: it can be seen from the graph 2 that the number of lightweight network parameters is greatly reduced, thereby avoiding the requirement for high computational power.
TABLE 2 comparison of various network parameters
Figure BDA0003262073990000081
Considering the problem of small computational power of finally deployed hardware, on the basis of selecting a lightweight convolution network, as shown in fig. 4, the classifier includes a normalization layer, a global average pooling layer and a flattening layer to reduce the computational complexity of data, and strategies such as Dropout and L2 regularization constraint are introduced to prevent the over-fitting problem of the network, so that a peanut leaf disease classification model is finally constructed. The reconstructed classifier contains a global average pooling layer, a flattening layer, a full connection layer FC and a Softmax classification layer, as well as a Dropout layer and an L2 regularization constraint layer. The reconstructed model classifier is linearly superposed with the migrated convolutional layer, and the input and output set values of the layers are set at each network level, namely the input and output size of each layer is modified, the hyper-parameters contained in each layer are set, the output of the feature extractor, namely the convolutional layer, is ensured to be connected to the classifier, and the organic connection of feature extraction and classified output is realized. The traditional model classifier is only formed by a single Softmax layer generally, more data reduction and over-fitting prevention network levels are added to the classifier, the operation complexity of the model is greatly reduced, and the generalization performance of the network is improved, so that later-stage deployment and analysis are performed.
Multiple verification is carried out, wherein the added normalization layer can effectively improve the convergence speed of the model and save training time, the global average pooling layer and the flattening layer can reduce the data dimension from 3D to 1D, the complexity of data operation is further greatly reduced, the added Dropout layer can set the random inactivation rate of the neurons, the purpose of preventing over-fitting is achieved, the L2 regularization constraint strategy is introduced to effectively inhibit the over-fitting problem of the network, the generalization capability and universality of the model are improved, and finally the Softmax layer gives the optimal classification decision. The L2 canonical constraint formula is as follows:
Figure BDA0003262073990000091
in the formula EinAnd representing the error of the training sample without the regularization term, wherein lambda is a regularization parameter, w is a weight, and different constraint parameters are updated by adjusting the weight.
Then carrying out hyper-ginsengSetting number, selecting initial learning rate, batch size, iteration number and other hyper-parameters, assigning adaptive moment estimation (Adam) optimization algorithm, adopting dynamic attenuation learning rate, setting learning rate eta and first-order matrix estimation exponential attenuation rate beta1Second order matrix estimation exponential decay rate beta2The fuzzy factor epsilon, the single attenuation value and other parameters, and the network weight is updated by the following formula in the optimization algorithm.
mt=β1mt-1+(1-β1)gt (1)
vt=β2vt-1+(1-β2)gt 2 (2)
Figure BDA0003262073990000092
Figure BDA0003262073990000093
Figure BDA0003262073990000094
Wherein the content of the first and second substances,
Figure BDA0003262073990000095
representing the decreasing gradient of an arithmetic function, thetatParameter representing loss th round, J (theta)t) Represents the loss function, mtRepresents the gradient gtFirst moment of (v)tDenotes gtThe second order moment of (a) is,
Figure BDA0003262073990000096
is mtThe correction of the offset of (2) is carried out,
Figure BDA0003262073990000097
is v istIt can be seen from the above formula that equations (1) and (2) perform a moving average calculation on the gradient and the square of the gradient, i.e., update the first moment and the second momentMoment, equations (3) and (4) update the bias corrections of the first moment and the second moment, respectively, and finally, the parameter update is given by equation (5), wherein the updated learning rate:
Figure BDA0003262073990000098
automatic decay updating of the learning rate is achieved.
Fourth, model training
And training and verifying the constructed model, and evaluating the performance of the original model obtained by training by using the standard defined in the model evaluation module. After the model evaluation passes, the original model is converted into a lightweight deployable model file using a TensorFlow Lite quantification tool.
By adopting the method, the test set data is subjected to predictive analysis, and parameters such as identification accuracy and the like are calculated. Firstly, three lightweight peanut leaf disease models constructed by the method are used for training, as can be seen from fig. 5 and 6, the three lightweight convolutional neural networks provided by the method all achieve convergence in 40 training periods, and a peanut leaf disease recognition model based on a NasNetMobile network is slow in convergence but still stable in the training period model. Through training, the performance of 3 models for identifying peanut leaf diseases is obtained, and is shown in tables 3, 4 and 5.
TABLE 3 MobileNet V2 PRF values for each disease classification
Figure BDA0003262073990000101
TABLE 4 PRF values for each disease classification of Xception
Figure BDA0003262073990000102
TABLE 5 PRF values for each disease classification of NasNetMobile
Figure BDA0003262073990000103
The Macro _ P, Macro _ R, Macro _ F values were calculated for the three networks compared. As shown in table 6.
TABLE 6 Macro values for the three models
Figure BDA0003262073990000111
As shown by the data in Table 4, the three lightweight convolutional neural network models have higher parameter standards for peanut leaf disease identification, wherein the Macro _ P value, the Macro _ R value and the Macro _ F1 value both exceed 0.980 and 0.981. The method has high classification accuracy.
Fifth, model evaluation
The resulting model is validated and evaluated using a confusion matrix. There are the following variable definitions in the precision evaluation criteria format confusion matrix: TP: number of positive samples predicted to be positive, TN: predict negative samples as negative number, FN: mispredict positive samples to a negative number, FP: the negative samples are mispredicted to a positive number, and the evaluation index is then defined as follows:
precision (Precision):
Figure BDA0003262073990000112
recall (Recall):
Figure BDA0003262073990000113
accuracy (Accuracy):
Figure BDA0003262073990000114
the overall evaluation index (F1-Sccore), weighted harmonic mean of Precision and Recall, is defined as follows:
Figure BDA0003262073990000115
taking alpha in the formula as 1, the most common comprehensive evaluation index F is obtained1
Figure BDA0003262073990000116
And (4) according to the evaluation standard, performing prediction classification on the test set sample by using the obtained model, and calculating the numerical values to finish model evaluation.
By adopting the method, the test set data is subjected to predictive analysis, and parameters such as identification accuracy and the like are calculated. The three lightweight peanut leaf disease models constructed based on the migration learning mode are used for training, as can be seen from fig. 5 and 6, under the conditions of the same learning rate, an optimizer and the like, before and after a data optimization processing algorithm is established, when the size difference of data sets is nearly 3 times, accuracy change curves of MobileNet V2 and nasNebile are basically overlapped at the later learning stage, accuracy curves of Xception before and after equalization are greatly improved, and accuracy and loss parameters are better during initial training of Xception and MobileNet V2 after the data optimization processing algorithm is introduced.
And sixthly, the model quantization module obtains the network branch structure and the weight file, and the deployable model file after the weight is reduced is obtained through the conversion of a quantization tool.
The peanut leaf disease identification network identification method comprises the following steps: and identifying the single-leaf disease picture of the peanut, identifying the type of the leaf disease by adopting the model file which is trained and deployed, and realizing off-line identification and diagnosis on the embedded equipment. After a single-leaf peanut leaf disease image is obtained, the obtained image is uniformly zoomed to 224 multiplied by 224 pixel size through an image processing algorithm, then the image enters an input layer of a network and is subjected to model matching preprocessing, after the preprocessing is completed, normalization operation is carried out on the image through a normalization layer, disease leaf characteristics of the normalized image are extracted through a migrated lightweight convolution neural network convolution layer, multiple normalization and convolution operations are carried out, and leaf detail characteristics are extracted; and after the leaf disease feature information is obtained, outputting the features by the feature extractor, sending the features into a classifier, performing data dimensionality reduction, and finally outputting the classification result predicted by Softmax to obtain the final peanut leaf disease identification result.
According to the method, on the basis of self-building of the peanut leaf disease data set, the original data set is equalized, and then data enhancement processing is carried out, so that the purpose of data set amplification is achieved. Three lightweight convolutional neural networks are used as basic networks, peanut leaf disease detection and identification models are respectively constructed, comparison tests are sequentially carried out, obtained experimental data are measured according to objective evaluation standards, the comprehensive performance of the networks is analyzed, finally the models are quantized and then deployed in low-cost portable embedded equipment, corresponding software is developed, an interactive interface is built, the models can be conveniently used in an actual production environment, and leaf diseases can be screened on site.
In a second embodiment, the present invention provides a portable device for identifying diseases on peanut leaves.
In the prior art, plant disease detection is carried out through a neural network, most of service terminals still only stay on a PC (personal computer), and the method cannot be conveniently applied to an actual production environment. According to the method, the model is deployed on the embedded platform, portable equipment development is completed, and field identification of peanut diseases is achieved.
The image acquisition device comprises a controller module, an image acquisition module, a display module and a power supply module. The control module comprises embedded operating system equipment capable of realizing network deployment, is used for identifying and classifying input images and is used for storing model files and a peanut leaf disease data database; the image acquisition module is connected to the control module, and the high-definition camera is used for acquiring peanut leaf images; the display module is connected to the controller module and used for realizing software interaction and data display functions; the power module is connected to the controller module and uses a lithium battery to supply power to the portable device.
The Raspberry Pi is selected as a control module, and main configuration parameters are as follows: RAM: 4GB (DDR 4); a CPU: 1.5GHz (Crotex A-72), the camera adopts chip OV5647, 500 ten thousand pixels. The touch screen adopts a 3.5Inch RPi resistance touch screen and an SPI interface. The Raspberry Pi 4B has installed therein an operating system Raspberry 10 (Buster).
The whole device is small in size and can be held by hands. The display module interface is divided into a left part and a right part, the right half part is provided with a touch key which is a camera opening button, a photographing button and a detection button, and the left half part is a display area. After a camera button is pressed and opened, external camera equipment is called by software, a pop-up window displays a real-time picture so as to adjust a focusing position, after a blade is aligned, a photographing button is pressed, automatic photographing is carried out, the progress of the camera equipment is stored and finished, photographed pictures are named in a digital increasing mode and stored under a designated SD card path, the pictures are automatically or manually designated, finally, a detection button is pressed, the type (or health) of diseases suffered by the blade can be checked on an interface after two seconds, and recommended medication can be output below the blade.
In the actual production field, the plant disease leaf images can be directly acquired through the back camera, online identification can be directly performed after the disease images are acquired, and after a moment, the identification results and corresponding recommended guiding medicines are pushed out through the software interface. Through actual field tests, the peanut leaf disease identification device can shoot 237 diseased peanut leaves at the scene at random by using the example which can be involved in the invention, wherein the diseased peanut leaves comprise the 4 diseased peanut leaves and the healthy peanut leaves, the device accurately classifies 203 leaves online, incorrectly classifies 34 leaves online, and the average correct identification rate reaches 85.65%. Has certain practicability and accuracy.
The above description is only a preferred embodiment of the present invention, and not intended to limit the present invention in other forms, and any person skilled in the art may apply the above modifications or changes to the equivalent embodiments with equivalent changes, without departing from the technical spirit of the present invention, and any simple modification, equivalent change and change made to the above embodiments according to the technical spirit of the present invention still belong to the protection scope of the technical spirit of the present invention.

Claims (5)

1. A peanut leaf disease identification method is characterized by comprising the following steps:
a, acquiring a picture of the single-leaf disease of the peanut on line;
b, calling the trained and deployed model file to identify the type of the leaf disease;
the training and deploying process of the model file in the step B comprises the following steps:
step B1, establishing a peanut leaf disease data set;
step B2, optimizing data;
in data set D { [ M ]1,M2,M3,····Mi][N1,N2N3,····Nj]TNumber of retrieved samples Nmax NmaxIs marked as NymaxAnd is marked with NymaxCorresponding kind MxWherein M isiIs the number of classes (i e [1,5 ]]),NiTo correspond to MiThe number of samples of (a); selecting NymaxAs a molecule, with NiCalculating a scale factor C for the denominatori,
Figure FDA0003262073980000011
Further get the scaling factor C ═ C1,C2···CiAnd upsampling the rare samples according to a proportionality constant to obtain a formula: n is a radical ofi'=Ni×Ci(i∈[1,5]) Then by a scaling factor CiIs measured by up-sampling as follows
Figure FDA0003262073980000012
Figure FDA0003262073980000013
B3. Construction of models
Extracting the lesion features of the peanut leaf by taking the convolution layer of the lightweight convolutional neural network as a feature extractor, constructing a sequential network model in a linear superposition mode, and adding a classifier after the convolution layer again on the basis of transferring the lightweight convolutional neural network convolution layer, wherein the classifier comprises a normalization layer, a global average pooling layer, a flattening layer and Dropout layers and L2 regularization constraint layers, the reconstructed classifier and the migrated convolutional layers are linearly superposed, the hyper-parameters contained in each layer are set at each network level, the output of the feature extractor is connected to the classifier, wherein the L2 regularization constraint formula is
Figure FDA0003262073980000014
Wherein E isinRepresenting the error of a training sample without a regularization term, wherein lambda is a regularization parameter, and w is weight;
B4. model training
B5. The model evaluation module is used for verifying and evaluating the obtained model by using the confusion matrix;
B6. and the model quantization module is used for obtaining a network branch structure and the weight file, and converting the network branch structure and the weight file by a quantization tool to obtain a light deployable model file.
2. The method for identifying peanut leaf diseases according to claim 1, wherein in the step B3, when the hyper-parameter is set, a dynamic fading learning rate is used, and a learning rate η and a first-order matrix estimation exponential fading rate β are set1Second order matrix estimation exponential decay rate beta2Fuzzy factor epsilon and single attenuation value parameters, and optimizing the algorithm through adaptive moment estimation, wherein the network weight is updated by the following formula in the optimization algorithm:
mt=β1mt-1+(1-β1)gt
vt=β2vt-1+(1-β2)gt 2
Figure FDA0003262073980000021
Figure FDA0003262073980000022
Figure FDA0003262073980000023
wherein the content of the first and second substances,
Figure FDA0003262073980000024
representing the decreasing gradient of an arithmetic function, thetatParameter representing loss th round, J (theta)t) Represents the loss function, mtRepresents the gradient gtFirst moment of (v)tDenotes gtThe second order moment of (a) is,
Figure FDA0003262073980000025
is mtThe correction of the offset of (2) is carried out,
Figure FDA0003262073980000026
is v istThe updated learning rate:
Figure FDA0003262073980000027
automatic decay updating of the learning rate is achieved.
3. The method for identifying peanut leaf diseases according to claim 1, wherein the step B1 includes: and cutting and classifying the original image, uniformly scaling the original image to 224 multiplied by 224 pixels, and classifying diseases to obtain original data sets under different disease classifications.
4. The method for identifying peanut leaf diseases according to claim 1, wherein the step B4 includes: and when the model is trained, a learning rate exponential decay algorithm is adopted, the initial learning rate is set to be 0.0001, the neuron inactivation rate is set to be 0.2, the iteration times are set to be 50, the first moment estimation beta 1 is 0.9, and the second moment estimation beta 2 is 0.999, so that the model is trained and stored.
5. The method for identifying peanut leaf diseases according to claim 1, wherein the evaluation in the step B5 is performed through the following indexes:
Figure FDA0003262073980000028
where P is the precision rate, R is the recall rate, Acc is the precision rate, TP is the number of positive samples predicted to be positive, TN is the number of negative samples predicted to be negative, FN is the number of positive samples mispredicted to be negative, and FP is the number of negative samples mispredicted to be positive.
CN202111075342.6A 2021-09-14 2021-09-14 Peanut leaf disease identification method Pending CN113688787A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111075342.6A CN113688787A (en) 2021-09-14 2021-09-14 Peanut leaf disease identification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111075342.6A CN113688787A (en) 2021-09-14 2021-09-14 Peanut leaf disease identification method

Publications (1)

Publication Number Publication Date
CN113688787A true CN113688787A (en) 2021-11-23

Family

ID=78586522

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111075342.6A Pending CN113688787A (en) 2021-09-14 2021-09-14 Peanut leaf disease identification method

Country Status (1)

Country Link
CN (1) CN113688787A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114463860A (en) * 2021-12-14 2022-05-10 浙江大华技术股份有限公司 Training method of detection model, in-vivo detection method and related device
CN116168223A (en) * 2023-04-20 2023-05-26 华南农业大学 Multi-mode-based peanut leaf spot disease grade detection method
CN117237334A (en) * 2023-11-09 2023-12-15 江西联益光学有限公司 Deep learning-based method for detecting stray light of mobile phone lens

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086799A (en) * 2018-07-04 2018-12-25 江苏大学 A kind of crop leaf disease recognition method based on improvement convolutional neural networks model AlexNet
CN109345476A (en) * 2018-09-19 2019-02-15 南昌工程学院 High spectrum image super resolution ratio reconstruction method and device based on depth residual error network
CN110378383A (en) * 2019-06-19 2019-10-25 江苏大学 A kind of picture classification method based on Keras frame and deep neural network
CN111222545A (en) * 2019-12-24 2020-06-02 西安电子科技大学 Image classification method based on linear programming incremental learning
CN113158754A (en) * 2021-02-04 2021-07-23 安徽农业大学 Tomato disease image identification method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086799A (en) * 2018-07-04 2018-12-25 江苏大学 A kind of crop leaf disease recognition method based on improvement convolutional neural networks model AlexNet
CN109345476A (en) * 2018-09-19 2019-02-15 南昌工程学院 High spectrum image super resolution ratio reconstruction method and device based on depth residual error network
CN110378383A (en) * 2019-06-19 2019-10-25 江苏大学 A kind of picture classification method based on Keras frame and deep neural network
CN111222545A (en) * 2019-12-24 2020-06-02 西安电子科技大学 Image classification method based on linear programming incremental learning
CN113158754A (en) * 2021-02-04 2021-07-23 安徽农业大学 Tomato disease image identification method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114463860A (en) * 2021-12-14 2022-05-10 浙江大华技术股份有限公司 Training method of detection model, in-vivo detection method and related device
CN114463860B (en) * 2021-12-14 2023-05-23 浙江大华技术股份有限公司 Training method of detection model, living body detection method and related device
CN116168223A (en) * 2023-04-20 2023-05-26 华南农业大学 Multi-mode-based peanut leaf spot disease grade detection method
CN117237334A (en) * 2023-11-09 2023-12-15 江西联益光学有限公司 Deep learning-based method for detecting stray light of mobile phone lens
CN117237334B (en) * 2023-11-09 2024-03-26 江西联益光学有限公司 Deep learning-based method for detecting stray light of mobile phone lens

Similar Documents

Publication Publication Date Title
CN108764372B (en) Construction method and device, mobile terminal, the readable storage medium storing program for executing of data set
CN110728224B (en) Remote sensing image classification method based on attention mechanism depth Contourlet network
CN113688787A (en) Peanut leaf disease identification method
CN111696101A (en) Light-weight solanaceae disease identification method based on SE-Inception
CN115644823B (en) Dynamic prediction and individualized intervention system for rehabilitation effect
Shi et al. Amur tiger stripes: Individual identification based on deep convolutional neural network
CN113298058A (en) Water quality prediction inversion method and system based on hyperspectral image of unmanned aerial vehicle
CN112699941B (en) Plant disease severity image classification method, device, equipment and storage medium
CN114359727A (en) Tea disease identification method and system based on lightweight optimization Yolo v4
CN110689523A (en) Personalized image information evaluation method based on meta-learning and information data processing terminal
WO2023236319A1 (en) Convolutional neural network deployment and optimization method for microcontroller
CN109118487A (en) Bone age assessment method based on non-down sampling contourlet transform and convolutional neural networks
CN112749675A (en) Potato disease identification method based on convolutional neural network
CN110096976A (en) Human behavior micro-Doppler classification method based on sparse migration network
CN112668486A (en) Method, device and carrier for identifying facial expressions of pre-activated residual depth separable convolutional network
CN117010971B (en) Intelligent health risk providing method and system based on portrait identification
Kiratiratanapruk et al. Automatic detection of rice disease in images of various leaf sizes
Yang et al. Rapid image detection and recognition of rice false smut based on mobile smart devices with anti-light features from cloud database
CN114049935A (en) HER2 image classification system based on multi-convolution neural network
CN117315380A (en) Deep learning-based pneumonia CT image classification method and system
CN111445024A (en) Medical image recognition training method
CN115457366A (en) Chinese herbal medicine multi-label recognition model based on graph convolution neural network
Li et al. Early drought plant stress detection with bi-directional long-term memory networks
CN115064207A (en) Spatial proteomics deep learning prediction method for protein subcellular localization
CN114548251A (en) Small sample garbage image classification method based on regularization correlation network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination