CN115035309A - Rice disease identification method and device - Google Patents

Rice disease identification method and device Download PDF

Info

Publication number
CN115035309A
CN115035309A CN202210475699.1A CN202210475699A CN115035309A CN 115035309 A CN115035309 A CN 115035309A CN 202210475699 A CN202210475699 A CN 202210475699A CN 115035309 A CN115035309 A CN 115035309A
Authority
CN
China
Prior art keywords
disease
rice
image
sample
identification model
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
CN202210475699.1A
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.)
Jiangsu University
Research Center of Information Technology of Beijing Academy of Agriculture and Forestry Sciences
Original Assignee
Jiangsu University
Research Center of Information Technology of Beijing Academy of Agriculture and Forestry Sciences
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 Jiangsu University, Research Center of Information Technology of Beijing Academy of Agriculture and Forestry Sciences filed Critical Jiangsu University
Priority to CN202210475699.1A priority Critical patent/CN115035309A/en
Publication of CN115035309A publication Critical patent/CN115035309A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
    • G06V10/449Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters
    • G06V10/451Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters with interaction between the filter responses, e.g. cortical complex cells
    • G06V10/454Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a rice disease identification method and a device, comprising the following steps: acquiring a rice disease image to be detected of a target rice field; inputting the rice disease image to be detected into a disease identification model, and determining the target disease category output by the disease identification model; the disease identification model is constructed based on an improved lightweight neural network and is obtained by training a sample rice image with a disease category label. According to the rice disease identification method and device provided by the invention, the rice disease image is identified by using the improved lightweight neural network, the calculation complexity is reduced by reducing network parameters on the premise of not losing the identification precision, the model deployment can be carried out on equipment with low calculation power and low storage capacity, and the method and device can be widely applied to various equipment.

Description

Rice disease identification method and device
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a rice disease identification method.
Background
During the growth of rice, various diseases are often accompanied, which only results in yield reduction and causes environmental pollution due to inaccurate application, so that it is very important to find the diseases and determine the disease types as soon as possible.
At present, rice diseases are mainly identified by a Bayes classifier or a nearest neighbor classifier.
The methods all have the problem of large network parameters, increase the calculation time and complexity, and further cannot be widely applied to a mobile terminal.
Disclosure of Invention
The invention provides a rice disease identification method and device, which are used for overcoming the defect of large network parameters in the prior art and reducing the calculation complexity by reducing the network parameters on the premise of not losing the identification precision.
The invention provides a rice disease identification method, which comprises the following steps:
acquiring a rice disease image to be detected of a target rice field;
inputting the rice disease image to be detected into a disease identification model, and determining the target disease category output by the disease identification model;
the disease identification model is constructed based on an improved lightweight neural network and is obtained by training a sample rice image with a disease category label.
According to the rice disease identification method provided by the invention, the disease identification model comprises the following steps: the system comprises a first module, a second module, a third module, a fourth module, a pooling unit and a connecting unit which are connected in sequence; the second module, the third module, and the fourth module are each constructed based on a coordinate attention mechanism and a maximum pooling layer;
inputting the rice disease image to be detected into a disease identification model, and determining the target disease category output by the disease identification model, wherein the method comprises the following steps:
performing feature extraction on the rice disease image to be detected by using the first module, the second module, the third module and the fourth module which are sequentially connected to obtain a plurality of rice feature maps;
carrying out average pooling treatment on the rice characteristic graph by using the pooling unit to obtain the disease characteristics of the rice disease image to be detected;
and classifying the disease characteristics by using the connecting unit, and determining the target disease category.
According to the rice disease identification method provided by the invention, before the rice disease image to be detected of the target rice field is obtained, the method further comprises the following steps:
acquiring a plurality of sample rice images;
taking the combination of each sample rice image and the disease category label of each sample rice image as a training sample, and obtaining a plurality of training samples;
a first data set and a second data set are constructed based on a plurality of training samples.
According to the rice disease identification method provided by the invention, after the first data set is constructed, the method further comprises the following steps:
randomly combining the initial learning rate and an optimizer to obtain a plurality of parameter sets;
determining the number of neurons in a full connection layer of the connection unit according to the number of disease types in the first data set;
configuring the disease identification model by utilizing each parameter group;
and pre-training the configured disease recognition model by using the first data set.
According to the rice disease identification method provided by the invention, after the disease identification model after configuration is pre-trained by using the first data set, the method further comprises the following steps: dividing the second data set into a training set and a validation set;
inputting any training sample in the training set into a disease identification model, and obtaining a predicted disease category corresponding to any training sample in the training set output by the disease identification model;
determining evaluation parameters of the disease identification model according to the predicted disease category;
and if the evaluation parameters meet preset conditions, verifying the disease identification model by using the verification set.
According to the rice disease identification method provided by the invention, the step of acquiring a plurality of sample rice images comprises the following steps:
obtaining a plurality of sample initial images of a target rice field;
randomly rotating and/or overturning the initial images of the samples to determine a plurality of sample amplification images;
adding Gaussian noise to the sample amplification images, and determining a plurality of sample noise reduction images;
performing HSV color enhancement on the noise-reduced images of the samples to determine a plurality of sample enhanced images;
and carrying out size normalization processing on each sample enhanced image to determine a plurality of sample rice images.
The present invention also provides a rice disease recognition device, comprising:
the acquisition module is used for acquiring a rice disease image to be detected of a target rice field;
the determining module is used for inputting the rice disease image to be detected into a disease identification model and determining the target disease category output by the disease identification model; the disease identification model is constructed based on an improved lightweight neural network and is obtained by training a sample rice image with a disease category label.
The invention also provides electronic equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the program to realize the rice disease identification method.
The present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements any of the rice disease identification methods described above.
The invention also provides a computer program product comprising a computer program, wherein the computer program is used for realizing the rice disease identification method when being executed by a processor.
According to the rice disease identification method and device provided by the invention, the rice disease image is identified by using the improved lightweight neural network, the calculation complexity is reduced by reducing network parameters on the premise of not losing the identification precision, the model deployment can be carried out on equipment with low calculation power and low storage capacity, and the method and device can be widely applied to various equipment.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a rice disease identification method provided by the present invention;
FIG. 2 is a second schematic flow chart of the rice disease identification method provided by the present invention;
FIG. 3 is a schematic structural diagram of a basic unit provided by the present invention;
FIG. 4 is a schematic structural diagram of a spatial down-sampling unit provided in the present invention;
FIG. 5 is a schematic structural diagram of a disease identification model provided by the present invention;
FIG. 6 is a schematic structural diagram of a rice disease recognition device provided by the present invention;
fig. 7 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Common diseases of rice include rice blast, leaf blight, jute disease, false smut, bacterial leaf blight, bacterial leaf streak and the like. Wherein the rice blast, the rice blight, the rice stripe disease and the banded sclerotial blight are four diseases with the largest occurrence probability and the widest influence.
Farmers generally have insufficient understanding of diseases of rice and even crops, and cannot fully understand the occurrence condition of each disease and the specific characteristics of disease spots, so that the disease and the pesticide application cannot be judged in time. Therefore, excessive, insufficient or even delayed treatment of the disease may damage the soil and the environment.
At present, plant disease identification technology is researched more, for example, after image processing and feature extraction are carried out on a corn leaf disease spot image, a Bayes classifier is used for realizing disease identification; and performing Otsu image segmentation on the cucumber diseases, extracting scab characteristics, performing characteristic selection by using an attribute reduction algorithm, and performing disease identification by using a nearest neighbor classifier.
The traditional technology mostly depends on extracting color features, texture features, shape features and the like of the scab image, the process is complicated, the recognition rate is low, and the complicated processes are avoided by the image recognition of the convolutional neural network.
When the improved full convolutional neural network model is established, the full connection layer is replaced by the convolutional layer, the model complexity is high, although the parameters are reduced to some extent compared with the parameters of the traditional VGG16 model, the calculated amount is still large, and the parameter training time is long. Or a depth residual convolution neural network is adopted for disease identification. Although higher accuracy can be achieved, the scale increases as the complexity of the network structure increases.
In the practical application scene of rice disease identification, the disease identification technology based on the network structure has the problems of system capacity, algorithm accuracy, development simplicity and the like.
The existing deep convolutional neural network model generally has higher requirements on computing power and storage capacity of equipment, and model deployment on equipment with low computing power and low storage capacity is difficult. In addition, the existing rice disease image data set is too few to complete the algorithm of high-intensive calculation amount; most of rice disease images obtained in natural scenes contain complex backgrounds, leaf-shaped diseases are often shown in different positions of leaves, and due to the fact that shooting requirements are not strict, disease features are more likely to appear in any position in the images, and the like, and recognition difficulty is increased by the factors.
The following describes a rice disease identification method and apparatus provided by an embodiment of the present invention with reference to fig. 1 to 7.
Fig. 1 is a schematic flow chart of a rice disease identification method provided by the present invention, as shown in fig. 1, including but not limited to the following steps:
first, in step S1, a rice disease image to be detected in a target rice field is obtained.
Wherein, the diseases in the rice disease image to be detected are the disease types which can be identified by the disease identification model.
Specifically, the rice disease to be detected is an RGB three-channel image obtained by performing image enhancement, noise reduction and size normalization on an image shot by a camera or called from an image library, is suitable for a rice disease image obtained in a natural scene, is close to an actual application scene, and has strong practicability.
Further, in step S2, inputting the rice disease image to be detected into a disease identification model, and determining a target disease category output by the disease identification model; the disease identification model is constructed based on an improved lightweight neural network and is obtained by training a sample rice image with a disease category label.
Among them, the lightweight neural network may be a shuffle netv2 network, and the improved shuffle netv2 network may include a Coordinate Attention mechanism (CA).
The disease type which can be identified by the disease identification model is determined by the number of neurons in the full junction layer. For example, the disease types of the disease type labels of all the sample rice images are 5, and when the disease identification model is trained, the number of neurons in the connection layer needs to be set to 5.
According to the rice disease identification method provided by the invention, the rice disease image is identified by using the improved lightweight neural network, the calculation complexity is reduced by reducing network parameters on the premise of not losing the identification precision, the model deployment can be carried out on equipment with low calculation power and low storage capacity, and the method can be widely applied to various equipment.
In the same growth period of rice, the types and positions of diseases are different, and in different production periods, the characteristics of the same type of diseases, such as shapes and colors, are also different, so that the characteristics of rice diseases are variable, the disease association degree is high, the disease complexity is high, and a rice image data set with a large enough size is not available in the market to support deep learning.
By adopting the process of training and identifying the traditional deep learning network model, the calculated amount and the modeling workload can be increased, the identification speed is reduced, and aiming at the problems, the invention provides the rice disease identification method based on the coordinate attention mechanism and the lightweight model.
Optionally, the obtaining a plurality of sample rice images comprises:
obtaining a plurality of sample initial images of a target rice field;
randomly rotating and/or overturning the initial images of the samples to determine a plurality of sample amplification images;
adding Gaussian noise to the sample amplification images, and determining a plurality of sample noise reduction images;
performing HSV color enhancement on the noise-reduced images of the samples to determine a plurality of sample enhanced images;
and carrying out size normalization processing on each sample enhanced image to determine a plurality of sample rice images.
Optionally, before acquiring the rice disease image to be detected in the target rice field, the method further includes:
acquiring a plurality of sample rice images;
taking the combination of each sample rice image and the disease category label of each sample rice image as a training sample, and obtaining a plurality of training samples;
a first data set and a second data set are constructed based on a plurality of training samples.
First, an existing rice image is acquired, including: the UCI data set, the plantaVillage data set and the network search image are used as sample initial images.
The initial sample image needs to be shot under natural illumination, and comprises different disease categories such as rice blast, rice blight, rice stripe disease, sheath blight and the like, rice disease images and healthy rice images of different growth periods of diseases of the same type, and healthy rice images, wherein the initial sample image is required to carry an accurate disease category label, and the label of the healthy rice image is healthy.
Further, the initial image of the sample is preprocessed, which comprises: the sample initial image is randomly rotated by 90 degrees, 180 degrees and 270 degrees, and the sample initial image is horizontally and vertically turned over to realize physical amplification, so that a plurality of sample amplification images can be obtained.
Gaussian noise is randomly added to the sample amplification image to obtain a plurality of sample noise reduction images, and interference generated by the noise in the sample amplification image can be effectively reduced.
The Hue (Hue, H), Saturation (S), and lightness (Value, V) of the sample noise-reduced image are multiplied by coefficients 0.9, 1.1, and 1.2, respectively, to obtain a plurality of sample-enhanced images.
Through the pretreatment of the sample rice image, the data diversity is increased, and further the model generalization capability is improved.
All sample enhancement images were normalized to a 224 x 224 three channel image.
The training samples corresponding to the healthy rice and each disease are divided into two parts, wherein one part is a first data set, and the other part is a second data set.
According to the rice disease identification method provided by the invention, the problem that the disease identification model cannot extract enough characteristic information under the condition of a small sample data set is solved by using a data enhancement technology, the dependence on a huge data image is reduced, and the influence of too few data images on an algorithm is effectively reduced.
Optionally, the disease identification model includes: the system comprises a first module, a second module, a third module, a fourth module, a pooling unit and a connecting unit which are connected in sequence; the second module, the third module, and the fourth module are each constructed based on a coordinate attention mechanism and a maximum pooling layer;
inputting the rice disease image to be detected into a disease identification model, and determining the target disease category output by the disease identification model, wherein the method comprises the following steps:
performing feature extraction on the rice disease image to be detected by using the first module, the second module, the third module and the fourth module which are sequentially connected to obtain a plurality of rice feature maps;
carrying out average pooling treatment on the rice characteristic graph by using the pooling unit to obtain the disease characteristics of the rice disease image to be detected;
and classifying the disease characteristics by using the connecting unit, and determining the target disease category.
The pooling unit may include a global pooling layer and the connection unit may include a full connection layer.
Fig. 5 is a schematic structural diagram of the disease identification model provided by the present invention, as shown in fig. 5, including: the system comprises an input layer, a first module, a second module, a third module, a fourth module, a convolutional layer, a global pooling layer, a full-connection layer and an output layer which are sequentially connected;
the general structure of the improved ShuffleNet V2 convolutional neural network is shown in FIG. 3, which is divided into 4 modules composed of the above two units.
The first module comprises 1 convolution layer with convolution kernel of 3 multiplied by 3 and step length of 2 and a maximum Pooling (Max-Pooling) layer with 3 multiplied by 3 and step length of 2, and the three-channel rice disease image to be detected with the size of 224 multiplied by 224 and input into the disease identification model is subjected to convolution operation to obtain 24 characteristic maps of 56 multiplied by 56.
The second module comprises 1 spatial down-sampling unit and 3 basic units with attention mechanisms, the feature map output by the first module is sent to the second module, and 48 28-28 feature maps are output.
The third module comprises 1 spatial down-sampling unit and 7 basic units with attention mechanisms, the feature map output by the second module is sent to the third module, and 96 14 multiplied by 14 feature maps are output.
The fourth module sends the feature map output by the third module into the fourth module by 1 spatial down-sampling unit and 3 basic units with attention mechanism, and outputs 192 feature maps of 7 × 7.
And (3) convolving the feature map output by the fourth module by the convolutional layer with the number of convolution kernels of 1024 and the size of 1 multiplied by 1, and finally outputting the target disease category from the output layer as an identification result through global average pooling and a full connection layer.
Fig. 3 is a schematic structural diagram of a basic unit provided by the present invention, as shown in fig. 3, a characteristic channel of the basic unit is divided into two branches after being input, and the right branch includes a coordinate attention machine, a 1 × 1 convolutional layer, a 3 × 3 deep convolutional layer, and a 1 × 1 convolutional layer which are connected in sequence; the left branch is unchanged. After convolution the two branches are connected in series and the channels are recombined so that the number of channels is constant.
In the right branch, the first 1 × 1 convolutional layer and the 3 × 3 deep convolutional layer include a normalization function and a Relu activation function therebetween, the 3 × 3 deep convolutional layer and the second 1 × 1 convolutional layer include a normalization function therebetween, and the second 1 × 1 convolutional layer is connected in series with the left branch through the normalization function and the Relu activation function.
In the right branch, the coordinate attention mechanism first embeds the coordinate information into the feature map. Specifically, for an input disease feature map X, the height is H, the width is W, the number of channels is C, and feature extraction is performed on each channel by using an adaptive average pooling layer along the horizontal X coordinate direction and the vertical Y direction, respectively.
Thus, the expression for the output component of the c-th channel with height h is:
Figure BDA0003625430170000101
wherein the content of the first and second substances,
Figure BDA0003625430170000102
representing the component of the output of the c channel with the height h after the average pooling of the X axis; w represents the width of the disease feature map X; x is the number of c And (h, j) represents a component with coordinates (h, j) and a channel c in the input disease characteristic diagram, h represents an abscissa, and j represents an ordinate.
Similarly, the output expression of the c-th channel with the width w is:
Figure BDA0003625430170000103
wherein the content of the first and second substances,
Figure BDA0003625430170000104
representing the component of the output of the c channel with the width w after Y-axis average pooling; h represents the height of the disease characteristic diagram X; x is the number of c And (i, w) represents the components of coordinates (i, w) and a channel c in the input disease characteristic diagram, i represents an abscissa, and w represents an ordinate.
The coordinate attention mechanism splices the generated feature maps and then convolves them by 1 × 1 1 And reducing the dimension of the channel, and simultaneously generating an intermediate feature map with spatial information in the vertical direction and the horizontal direction.
Dividing the intermediate feature map into two feature maps along the space direction, and respectively using two 1 × 1 convolutions F h And F w The channel number is converted and activated by a sigmoid activation function, and the result is as follows:
Figure BDA0003625430170000105
wherein, g h And g w Respectively representing attention weight characteristics of coordinates on X and Y coordinate axes; z is a radical of h Representing the output of the feature map after average pooling on the X axis; z is a radical of w The output of the feature map after Y-axis average pooling is shown.
The final output of the coordinate attention module may be expressed as:
Figure BDA0003625430170000111
wherein x is c (i, j) and y c (i, j) respectively representing the value of the coordinate (i, j) in the input characteristic diagram and the output characteristic diagram of the channel c;
Figure BDA0003625430170000112
attention weight representing the X-axis (i, j) coordinate of the c-th channel;
Figure BDA0003625430170000113
the attention weight of the c-th channel Y-axis (i, j) coordinate is indicated.
A coordinate attention mechanism is introduced into each basic unit of the disease identification model, the relationship and the position information among channels are considered, cross-channel information can be captured, direction and position sensitive information is contained, a disease area can be accurately positioned and identified, interference of background information is effectively reduced, the disease identification model is flexible and light in weight, and the disease identification model can be easily inserted into the mobile network to improve feature representation performance.
Based on the ShuffleNet V2 convolutional neural network model, a spatial down-sampling unit of the improved convolutional neural network can be built. Fig. 4 is a schematic structural diagram of the spatial down-sampling unit provided in the present invention, as shown in fig. 4, the right branch inputs the feature channel into the 1 × 1 convolutional layer, the 3 × 3 max pooling layer with step size of 2, and the 1 × 1 convolutional layer which are connected in sequence; and the left branch inputs the characteristic channel through a 3 × 3 maximum pooling layer and a 1 × 1 convolution layer which are sequentially connected and have the step length of 2, after convolution, the two branches are connected in series and channel recombination is carried out, and the number of the channels is twice of the input number.
In the right branch, the first 1 × 1 convolutional layer and the 3 × 3 deep convolutional layer include a normalization function and a Relu activation function therebetween, the 3 × 3 deep convolutional layer and the second 1 × 1 convolutional layer include a normalization function therebetween, and the second 1 × 1 convolutional layer is connected in series with the left branch through the normalization function and the Relu activation function. In the left branch, the 3 × 3 depth convolution layer and the 1 × 1 convolution layer include a normalization function in between, and the 1 × 1 convolution layer is connected in series with the right branch by the normalization function and the Relu activation function.
The depth convolution layer is replaced by the 3 multiplied by 3 maximum pooling layer in the spatial down-sampling unit, so that the complex background interference information can be eliminated to a certain extent, and the network performance is improved.
In addition, the nonlinear relation among all layers of the disease identification model can be increased by adopting the Relu activation function, and a complex neural network task is completed. After the data set import model is trained and optimized, the model can be transplanted to a mobile terminal, and practical deployment of the model is completed.
According to the rice disease identification method provided by the invention, by adding the maximum pooling and coordinate attention mechanism in the disease identification model, the interference of information such as a complex background and the like can be effectively reduced, the excessive sensitivity of the model to a characteristic position is reduced, and the identification speed and accuracy are improved while the model is light.
Optionally, after constructing the first data set, further comprising:
randomly combining the initial learning rate and the optimizer to obtain a plurality of parameter sets;
determining the number of neurons in a full connection layer of the connection unit according to the number of disease types in the first data set;
configuring the disease identification model by utilizing each parameter group;
and pre-training the configured disease recognition model by using the first data set.
In deep learning, a large number of high-quality labeled training samples are needed. The actual collection is affected by manpower and material resources, and the requirements are often not met.
And classifying and pre-training the ImageNet big data set in a transfer learning mode to solve the problems, transferring the parameters obtained by training into a disease identification model, training and finely adjusting the parameters to enable the model to be suitable for identification of rice disease types. In the transfer learning, the front layers of the network parameters are fixed, and the last layer is finely adjusted to solve the problem of model overfitting caused by a small data set, and the verification is carried out on a verification set to obtain better accuracy.
Specifically, the number of iterations, a plurality of initial learning rates, and a plurality of optimizers are set. Dropout is also set to avoid overfitting during the training process. By randomly combining the initial learning rate and the optimizer, a plurality of different sets of parameters can be obtained. The optimizer may be SGD or Adam. And setting the number of neurons of the full connection layer of the disease identification model according to the types of the diseases, wherein the number of the neurons is consistent with the number of the types of the pests in the first data set.
Further, the disease identification models are configured by using each parameter set, and a plurality of configured disease identification models are obtained. And pre-training each configured disease identification model by utilizing the first data set, determining a disease identification model with the highest identification accuracy in all the disease identification models, and obtaining a target parameter group of the model.
And adjusting parameters of the configured disease recognition model by using the target parameter group, and completing pre-training.
According to the rice disease identification method provided by the invention, the convergence rate of the disease identification model is accelerated and the identification accuracy of the disease identification model is improved through transfer learning pre-training.
Optionally, after the pre-training of the configured disease recognition model by using the first data set, the method further includes: dividing the second data set into a training set and a validation set;
inputting any training sample in the training set into a disease identification model, and obtaining a predicted disease category corresponding to any training sample in the training set output by the disease identification model;
determining evaluation parameters of the disease identification model according to the predicted disease category;
and if the evaluation parameters meet preset conditions, verifying the disease identification model by using the verification set.
And equally dividing five training samples corresponding to the healthy rice and each disease in the second data set into five parts, and performing analysis according to the following steps of 4: the proportion of 1 is divided into a training set and a verification set, and a disease identification model is trained in a five-fold cross verification mode.
The Batch size (Batch size) of the training samples is set to be 100, the iteration number (Epoch) is set to be 200, a Stochastic gradient descent optimization (SGD) optimization model is adopted, and the initial learning rate is set to be 0.1.
In order to verify the accuracy of the disease identification model and the lightweight of the network model, three indexes of identification error rate, the number of network parameters and floating point operations (FLOPs) are selected as evaluation parameters to evaluate the model. The preset conditions are standard conditions of the disease identification model on the identification error rate, the number of network parameters and the FLOPs, and in practical application, the preset conditions can be flexibly configured according to requirements on the precision and the complexity of the model.
The formula of the calculation method for identifying the error rate Err is as follows:
Figure BDA0003625430170000141
wherein N is E The number of prediction errors of the disease identification model; n is a radical of T Is the total number of samples of the second data set.
The number of network parameters can measure the size of the model, and the number of parameters for one layer of convolution and depth convolution is calculated as follows:
Figure BDA0003625430170000142
wherein, Param Conv Parameters representing standard convolution; param DWConv Parameters representing a depth convolution; k w Represents the width of the convolution kernel; k is h Represents the height of the convolution kernel; c represents the number of input channels; n represents the number of convolution kernels.
FLOPs are used to measure the computational complexity of an algorithm or model. The calculation formula of the Flops of convolution and depth convolution is as follows:
Figure BDA0003625430170000143
among them, FLOPs Conv Flops representing convolution; FLOPs DWConv Flops representing a deep convolution; k h Represents the height of the convolution kernel; k w Represents the width of the convolution kernel; c represents the number of input channels; n represents the number of convolution kernels; h o Representing the height of the output feature map; w is a group of o Representing the width of the output feature map.
According to the rice disease identification method provided by the invention, the evaluation parameters are controlled within a preset range, so that the disease identification precision of the disease identification model is improved, and the parameter number and the calculation cost of the model are effectively controlled.
Fig. 2 is a second schematic flow chart of the rice disease identification method provided by the present invention, as shown in fig. 2, including:
firstly, collecting rice disease images and preprocessing the rice disease images;
further, constructing and pre-training an improved convolutional neural network model;
further, retraining the characteristics learned by pre-training to a disease recognition model;
further, training a disease recognition model;
further, classifying the diseases by using a disease identification model;
further, optimizing a disease identification model;
further, the disease identification model is transplanted to the mobile terminal.
According to the rice disease identification method provided by the invention, the calculation complexity can be reduced by reducing network parameters on the premise of not losing identification precision, and the deep learning model can be ensured to normally operate at a mobile terminal.
The rice disease recognition device provided by the present invention is described below, and the rice disease recognition device described below and the rice disease recognition method described above may be referred to in correspondence with each other.
Fig. 6 is a schematic structural diagram of a rice disease recognition device provided by the present invention, as shown in fig. 6, including:
the acquiring module 601 is used for acquiring a rice disease image to be detected of a target rice field;
a determining module 602, configured to input the to-be-detected rice disease image into a disease identification model, and determine a target disease category output by the disease identification model;
the disease identification model is constructed based on an improved lightweight neural network and is obtained by training a sample rice image with a disease category label.
First, the obtaining module 601 obtains a rice disease image to be detected in a target rice field.
Wherein, the diseases in the rice disease image to be detected are the disease types which can be identified by the disease identification model.
Specifically, the rice disease to be detected is an RGB three-channel image obtained by performing image enhancement, noise reduction and size normalization on an image shot by a camera or called from an image library, is suitable for a rice disease image obtained in a natural scene, is close to an actual application scene, and has strong practicability.
Further, the determining module 602 inputs the rice disease image to be detected into a disease identification model, and determines a target disease category output by the disease identification model; the disease identification model is constructed based on an improved lightweight neural network and is obtained by training a sample rice image with a disease category label.
Among them, the lightweight neural network may be a shuffle netv2 network, and the improved shuffle netv2 network may include a Coordinate Attention mechanism (CA).
The disease type which can be identified by the disease identification model is determined by the number of neurons in the full junction layer. For example, the disease types of the disease type labels of all the sample rice images are 5, and when the disease identification model is trained, the number of neurons in the connection layer needs to be set to 5.
The rice disease recognition device provided by the invention utilizes the improved lightweight neural network to recognize rice disease images, reduces the calculation complexity by reducing network parameters on the premise of not losing recognition precision, can perform model deployment on equipment with low calculation power and low storage capacity, and can be widely applied to various equipment.
Fig. 7 is a schematic structural diagram of an electronic device provided in the present invention, and as shown in fig. 7, the electronic device may include: a processor (processor)710, a communication interface (communication interface)720, a memory (memory)730, and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other via the communication bus 740. Processor 710 may invoke logic instructions in memory 730 to perform a rice disease identification method comprising: acquiring a rice disease image to be detected of a target rice field; inputting the rice disease image to be detected into a disease identification model, and determining the target disease category output by the disease identification model; the disease identification model is constructed based on an improved lightweight neural network and is obtained by training a sample rice image with a disease category label.
In addition, the logic instructions in the memory 730 can be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, when the computer program is executed by a processor, a computer can execute the rice disease identification method provided by the above methods, the method includes: acquiring a rice disease image to be detected of a target rice field; inputting the rice disease image to be detected into a disease identification model, and determining the target disease category output by the disease identification model; the disease identification model is constructed based on an improved lightweight neural network and is obtained by training a sample rice image with a disease category label.
In still another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to execute the method for identifying rice diseases provided by the above methods, the method including: acquiring a rice disease image to be detected of a target rice field; inputting the rice disease image to be detected into a disease identification model, and determining the target disease category output by the disease identification model; the disease identification model is constructed based on an improved lightweight neural network and is obtained by training a sample rice image with a disease category label.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A rice disease identification method is characterized by comprising the following steps:
acquiring a rice disease image to be detected of a target rice field;
inputting the rice disease image to be detected into a disease identification model, and determining the target disease category output by the disease identification model;
the disease identification model is constructed based on an improved lightweight neural network and is obtained by training a sample rice image with a disease category label.
2. The rice disease identification method according to claim 1, wherein the disease identification model comprises: the system comprises a first module, a second module, a third module, a fourth module, a pooling unit and a connecting unit which are connected in sequence; the second module, the third module, and the fourth module are each constructed based on a coordinate attention mechanism and a maximum pooling layer;
inputting the rice disease image to be detected into a disease identification model, and determining the target disease category output by the disease identification model, wherein the method comprises the following steps:
performing feature extraction on the rice disease image to be detected by using the first module, the second module, the third module and the fourth module which are sequentially connected to obtain a plurality of rice feature maps;
carrying out average pooling treatment on the rice characteristic graph by using the pooling unit to obtain the disease characteristics of the rice disease image to be detected;
and classifying the disease characteristics by using the connecting unit, and determining the target disease category.
3. The rice disease identification method according to claim 2, further comprising, before acquiring the image of the rice disease to be detected in the target rice field:
acquiring a plurality of sample rice images;
taking the combination of each sample rice image and the disease category label of each sample rice image as a training sample, and obtaining a plurality of training samples;
a first data set and a second data set are constructed based on a plurality of training samples.
4. The rice disease identification method according to claim 3, further comprising, after constructing the first data set:
randomly combining the initial learning rate and the optimizer to obtain a plurality of parameter sets;
determining the number of neurons in a full connection layer of the connection unit according to the number of disease types in the first data set;
configuring the disease identification model by utilizing each parameter group;
and pre-training the configured disease recognition model by using the first data set.
5. The method for identifying rice diseases according to claim 4, further comprising, after the pre-training of the disease identification model after the configuration using the first data set:
dividing the second data set into a training set and a validation set;
inputting any training sample in the training set into a disease identification model, and obtaining a predicted disease category corresponding to any training sample in the training set output by the disease identification model;
determining evaluation parameters of the disease identification model according to the predicted disease category;
and if the evaluation parameters meet preset conditions, verifying the disease identification model by using the verification set.
6. The rice disease identification method according to claim 3, wherein the acquiring a plurality of sample rice images comprises:
obtaining a plurality of sample initial images of a target rice field;
randomly rotating and/or overturning each sample initial image to determine a plurality of sample amplification images;
adding Gaussian noise to the multiple sample amplification images, and determining multiple sample noise reduction images;
performing HSV color enhancement on the noise-reduced images of the samples to determine a plurality of sample enhanced images;
and carrying out size normalization processing on each sample enhanced image to determine a plurality of sample rice images.
7. A rice disease recognition device, comprising:
the acquisition module is used for acquiring a rice disease image to be detected of a target rice field;
the determining module is used for inputting the rice disease image to be detected into a disease identification model and determining the target disease category output by the disease identification model; the disease identification model is constructed based on an improved lightweight neural network and is obtained by training a sample rice image with a disease category label.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the processor executes the program to implement the rice disease identification method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the rice disease identification method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, wherein the computer program when executed by a processor implements the rice disease identification method according to any one of claims 1 to 6.
CN202210475699.1A 2022-04-29 2022-04-29 Rice disease identification method and device Pending CN115035309A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210475699.1A CN115035309A (en) 2022-04-29 2022-04-29 Rice disease identification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210475699.1A CN115035309A (en) 2022-04-29 2022-04-29 Rice disease identification method and device

Publications (1)

Publication Number Publication Date
CN115035309A true CN115035309A (en) 2022-09-09

Family

ID=83118721

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210475699.1A Pending CN115035309A (en) 2022-04-29 2022-04-29 Rice disease identification method and device

Country Status (1)

Country Link
CN (1) CN115035309A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117197655A (en) * 2023-08-01 2023-12-08 北京市农林科学院智能装备技术研究中心 Rice leaf roller hazard degree prediction method, device, electronic equipment and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117197655A (en) * 2023-08-01 2023-12-08 北京市农林科学院智能装备技术研究中心 Rice leaf roller hazard degree prediction method, device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
Altaheri et al. Date fruit classification for robotic harvesting in a natural environment using deep learning
Ghaderizadeh et al. Hyperspectral image classification using a hybrid 3D-2D convolutional neural networks
US10628705B2 (en) Combining convolution and deconvolution for object detection
Durmuş et al. Disease detection on the leaves of the tomato plants by using deep learning
CN110148120B (en) Intelligent disease identification method and system based on CNN and transfer learning
CN111178197B (en) Mass R-CNN and Soft-NMS fusion based group-fed adherent pig example segmentation method
Sladojevic et al. Deep neural networks based recognition of plant diseases by leaf image classification
CN108491765A (en) A kind of classifying identification method and system of vegetables image
CN109033978B (en) Error correction strategy-based CNN-SVM hybrid model gesture recognition method
CN112529146B (en) Neural network model training method and device
Reddy et al. Resnet-based modified red deer optimization with DLCNN classifier for plant disease identification and classification
CN112861718A (en) Lightweight feature fusion crowd counting method and system
Li et al. Multi-scale sparse network with cross-attention mechanism for image-based butterflies fine-grained classification
CN110705600A (en) Cross-correlation entropy based multi-depth learning model fusion method, terminal device and readable storage medium
CN113435355A (en) Multi-target cow identity identification method and system
CN113435254A (en) Sentinel second image-based farmland deep learning extraction method
CN112380917A (en) A unmanned aerial vehicle for crops plant diseases and insect pests detect
Li et al. Maize leaf disease identification based on WG-MARNet
Haque et al. Image-based identification of maydis leaf blight disease of maize (Zea mays) using deep learning
CN115035309A (en) Rice disease identification method and device
Mitra et al. A smart agriculture framework to automatically track the spread of plant diseases using mask region-based convolutional neural network
CN111353577B (en) Multi-task-based cascade combination model optimization method and device and terminal equipment
CN111860601A (en) Method and device for predicting large fungus species
Wakhare et al. Using Image Processing and Deep Learning Techniques Detect and Identify Pomegranate Leaf Diseases
CN113673340B (en) Pest type image identification method and system

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