CN109522924A - A kind of broad-leaf forest wood recognition method based on single photo - Google Patents

A kind of broad-leaf forest wood recognition method based on single photo Download PDF

Info

Publication number
CN109522924A
CN109522924A CN201811137730.0A CN201811137730A CN109522924A CN 109522924 A CN109522924 A CN 109522924A CN 201811137730 A CN201811137730 A CN 201811137730A CN 109522924 A CN109522924 A CN 109522924A
Authority
CN
China
Prior art keywords
image
layer
output
network
value
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
CN201811137730.0A
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.)
Zhejiang A&F University ZAFU
Original Assignee
Zhejiang A&F University ZAFU
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 Zhejiang A&F University ZAFU filed Critical Zhejiang A&F University ZAFU
Priority to CN201811137730.0A priority Critical patent/CN109522924A/en
Publication of CN109522924A publication Critical patent/CN109522924A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • 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)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)

Abstract

The broad-leaf forest wood recognition method based on single photo that the invention discloses a kind of, comprising the following steps: S1 collects the image of variety classes trees, establishes tree species image data set, and data set is divided into training set, verifying collection and test set;S2 adjusts image size: every picture in tree species image data set is adjusted to the identical image of size;S3 designs a convolutional neural networks, carries out the training of network with above-mentioned training set image, and with the accuracy rate of test set image measurement network;S4 selects one broad-leaf forest wood recognition system of accuracy rate highest convolutional neural networks model construction, is identified by inputting a tree species image, to obtain the result of identification.Method of the invention can reduce artificial intervention, recognition accuracy is higher with autonomous learning tree species feature using depth convolutional neural networks;Can by one at any angle broad-leaf forest tree species image identified, simple and flexible and practical.

Description

Broad-leaved forest tree species identification method based on single photo
Technical Field
The invention relates to a broad-leaved forest tree species identification method, in particular to a broad-leaved forest tree species identification method based on a single photo.
Background
Broad-leaved forest is the largest component of economic forest in China, the varieties of the formed trees are various, the trees can be used for producing wood, oil, dry fruit, fresh products, industrial raw materials, medicinal materials and other special by-products, and the development of the Chinese economy is driven to a certain extent. Therefore, it is necessary to deepen the knowledge of the species of broad-leaved forest trees. However, in the face of such a wide variety of hardwood forest species, the skilled person has not been able to make an accurate identification, let alone most people are inexperienced. At the moment, the method for identifying the broad-leaved forest tree species based on the single photo reduces the manual participation to a certain extent, and is more convenient and faster to identify.
So far, a plurality of tree species identification methods based on images are proposed. Most of them require manual feature screening and then classifier training. This is a time-consuming and labor-intensive process that requires not only considerable experience by researchers, but also extensive experimentation to verify.
In the prior art, manual intervention is not needed in tree feature selection, and a deep neural network is directly used for autonomously learning features so as to update a classifier. However, the method can only identify the leaf images of the tree species, the method is not high in flexibility, and the experimental samples are not easy to obtain.
Zheng-Ying, Chunjiang and the like provide a plant identification method in a plant leaf identification method based on multi-feature dimension reduction, the method utilizes the Hu invariant moment, the gray level co-occurrence matrix, the local binary pattern, the Gabor filter and other technologies to respectively and manually extract the shape and texture features of the plant leaf to obtain high-dimensional feature parameters, then adopts the existing dimension reduction technology to reduce the dimension of the features, and finally trains the data after the dimension reduction by using the traditional machine learning classification method. The method is based on the identification of the tree species of the plant leaves, cannot identify the tree species through the overall picture of the plant, is low in implementation efficiency, and requires considerable experience of researchers for extracting and screening the features. The prior art also provides a tree species identification method based on wood near infrared spectrum data, and the data are classified through a traditional machine learning algorithm. But also has the defects of difficult acquisition of near infrared spectrum data of different tree species, higher cost and the like.
The invention patent with publication number CN107239514A provides a plant identification method and system based on a convolutional neural network, wherein the method comprises the following steps: classifying and marking the same kind of plants in the collected plant images to obtain a plant database; inputting the plant images in the plant database into a convolutional neural network, and training the convolutional neural network to obtain a feature matching model; receiving an image to be recognized, extracting an image characteristic value of the image to be recognized by using the characteristic matching model, calculating the similarity between the image characteristic value and plants in the plant database, and judging the classification of the plants to which the image to be recognized belongs according to the similarity. The convolutional neural network in the method sequentially comprises an input layer, a convolutional operation layer and an output layer. The method does not define any edges or contours; explicit feature sampling is avoided by using convolutional neural networks, learning is implicitly performed from the training data. The convolutional neural network is obviously different from other classifiers based on the neural network, and the feature extraction function is fused into the multilayer perceptron through structural reorganization and weight reduction. It can directly process grayscale pictures and can be directly used to process image-based classification. The method has the defects that network layers are too few, the model cannot learn more abstract high-level features containing more semantic information, the method only comprises one full-connection layer and is only suitable for processing small-scale data sets, and once plant data are increased, the model is easy to be under-fitted to cause accuracy reduction.
Disclosure of Invention
The purpose of the invention is as follows: in order to overcome the defects in the prior art, the invention provides a broad-leaved forest tree species identification method based on a single photo. The method is simple, flexible and practical by identifying the broad-leaved forest tree species image at any angle; the image data set for the experiment is also easier to obtain; meanwhile, the recognition rate is greatly improved.
The technical scheme is as follows: in order to achieve the purpose, the broad-leaved forest tree species identification method based on a single photo comprises the following steps:
s1, collecting images of different kinds of trees, establishing a tree species image data set, and dividing the tree species image data set into a training set, a verification set and a test set;
s2 resize the image: adjusting each picture in the tree species image data set into an image with the same size;
s3, designing a convolution neural network, training the network by using the training set image, and testing the accuracy of the network by using the test set image after training;
s4, constructing a broad-leaved forest tree species identification system by using the trained convolutional neural network, and identifying by inputting a tree species image so as to obtain an identification result.
Further, in step S1, the tree types in the tree type image data set are at least two types, and each tree image has at least 10000 sheets.
Further, the tree species image data set is randomly divided into a training set, a verification set and a test set, wherein the proportion of the training set, the verification set and the test set is 5-9: 0.5-2.5.
Further, in the step S2, the size of each image is modified to be x × y pixels of a fixed size; where x represents the width of the image, y represents the height of the image, and x ═ y.
Furthermore, the convolutional neural network HCNN has 11 layers in total, and specifically comprises the following network structure,
inputting an image with a size of x × y × z, wherein x represents a width of the image, y represents a height of the image, and x ═ y, z represents the number of channels of the image,
convolutional layer C1: using u1F is1×F1The xz convolution kernel performs a convolution operation with a step size of S1×S1The convolution operation adopts a 'VALID' form that 0 is not complemented when the image boundary is exceeded, a RelU nonlinear activation function is used after convolution, and the result output after convolution is as follows: w1×W1×u1
Where W is the size of the input layer, i.e., W ═ x ═ y,is a rounded up symbol;
pooling layer P2: output W of C1 layer1×W1×u1As input, S is used2×S2The step size of (2) is subjected to maximum pooling, and the result after the maximum pooling is W2×W2×u1
Wherein, W1Is the output size of the C1 layer,is a rounded-down symbol;
convolutional layer C3: using u2F is2×F2×u1The convolution kernel of (a) performs a convolution operation with a step size of S3×S3The convolution operation adopts a 'SAME' form of complementing 0 when the boundary of the image is exceeded, a ReLU nonlinear activation function is used after the convolution, and the output result after the convolution is as follows: w3×W3×u2
Wherein, W2Is the output size of the C2 layer,is a rounded up symbol;
pooling layer P4: output W of C3 layer3×W3×u2As input, S is used4×S4The step size of (2) is subjected to maximum pooling, and the result after the maximum pooling is W4×W4×u2
Wherein, W3Is the output size of the C3 layer,to round the symbol downwards
Convolutional layer C5: using u3F is3×F3×u2The convolution kernel of (a) performs a convolution operation with a step size of S5×S5The convolution operation adopts a 'SAME' form of complementing 0 when the boundary of the image is exceeded, a RelU nonlinear activation function is used after the convolution, and the output result after the convolution is as follows: w5×W5×u3
Wherein, W4The output size of the P4 layer,is a rounded up symbol;
pooling layer P6: output W of C5 layer5×W5×u3As input, S is used6×S6The step size of (2) is subjected to maximum pooling, and the result after the maximum pooling is W6×W6×u3
Wherein, W5Is the output size of the C5 layer,to round the symbol downwards
Full connectivity layer FC7: output W of P6 layer6×W6×u3As an input, W is shared after P6 level calculation6×W6X u3 pixels, expressing the value of each pixel as a neuron, and making the output of FC7 layer be n1A neuron, wherein the value of each neuron is calculated by the formula:
where z is the value of each neuron, xiSetting the value of each neuron of the upper layer, wherein l is the number of output neurons of the upper layer, w is a weight parameter, b is a bias value, the initial value of w is initialized by adopting truncated Gaussian distribution, and the initial value of b is set to be 0;
full connectivity layer FC8: output n of FC7 layer1Each neuron as input and having output n2Each neuron calculates in the same way as in the full link layer FC 7;
full connectivity layer FC9: output n of FC8 layer2Each neuron as input and let output n3Each neuron calculates in the same way as in the full link layer FC 7;
output layer Output: output n of FC8 layer3Taking each neuron as an input, and enabling the output to be n neurons, wherein the calculation method of each neuron is the same as that in the full connection layer FC 7;
wherein the value of n is equal to the number of species of broad-leaved forest tree species, and n1>n2>n3>n。
Further, the method for training the convolutional neural network in step S3 is as follows: firstly, defining a real type label for each tree species, sequentially inputting images in a training set into a convolutional neural network, calculating the convolutional neural network to obtain a prediction label, evaluating the difference between the real label value and the prediction label value obtained by network calculation by using a cross entropy function, representing the difference by using a loss value, then optimizing the convolutional neural network by using a gradient descent method, continuously inputting each image in the training set into the convolutional neural network and calculating the loss value once, updating unknown parameters in the network once when the convolutional neural network calculates each image by using a gradient descent method, calculating the accuracy of a network model by using a verification set after updating the network every time, and finally stopping the training of the network when the loss value is small enough and tends to be stable.
Further, in step S3, cross entropy is used as a loss function of the network for evaluating a difference between a real value and a predicted value of the image, and the formula of the cross entropy is as follows:
where loss is a loss function, m represents the number of samples of a training input, n represents a total of n classes, yjiA tag that represents the true category of the content,represents the predicted class label, i represents the ith tree, i ranges from 1 to n, j represents the jth sample, j ranges from 1 to m,
in the training process, a gradient descent method is used for continuously optimizing and reducing the loss value, all training picture samples are input into the network to be the updating of the network, when the network is updated for a times or the loss value is lower than b, the training of the network is stopped, wherein a is more than 1000, and b is less than 0.1.
Further, in step S3, after the convolutional neural network is updated each time, each picture in the verification set is sequentially input into the network to obtain a calculation result of each picture, and then the accuracy of the model in the verification set is calculated, where a calculation formula of the accuracy is as follows:
wherein accuracy is the accuracy, t is the total number of images in the verification set, r is the number of images predicted correctly by the model,
and selecting the best network model by comparing the accuracy.
Further, in step S3, the formula of the gradient descent method is as follows:
where θ represents the updated parameter value, θ represents the parameter to be updated in the model, α represents the learning rate, J (θ) represents the loss function,
further, in step S4, when constructing the hardwood forest tree species identification system, the result output by the convolutional neural network needs to be processed by a softmax classifier to obtain a final result, and finally a vector of n rows is output, where the size of n is equal to the number of species of hardwood forest tree species, the value of each row of the vector represents the probability that the image belongs to the species represented by the row, the final output result of the hardwood forest tree species identification system is the tree species with the maximum probability value,
the formula of the softmax function in the softmax classifier is as follows:
wherein x isiValue representing the ith neuron of the output layer, softmax (x)i) Indicating the probability that the image belongs to the tree represented by the ith row.
Has the advantages that:
compared with the prior art, the invention has the advantages that:
1. the method of the invention can autonomously learn the tree species characteristics by utilizing the deep convolutional neural network, thereby reducing manual intervention. Under the condition that the tree species sample data set is enough, the retraining neural network has higher recognition accuracy compared with the method adopting a pre-training model;
2. the method provided by the invention is simple, flexible and practical by identifying the broad-leaved forest tree species image at any angle.
3. The convolutional neural network designed by the invention has 11 layers in total, and specifically comprises an Input layer Input, a convolutional layer C1, a pooling layer P2, a convolutional layer C3, a pooling layer P4, a convolutional layer C5, a pooling layer P6, a full-connection layer FC7, a full-connection layer FC8, a full-connection layer FC9 and an Output layer Output.
4. According to the method, the convolutional neural network is trained through images in the tree species image set, the accuracy of calculation of the convolutional neural network is evaluated through a cross entropy function in the training process, parameters in the convolutional neural network are continuously updated through a gradient descent method, and the convolutional neural network is optimized, so that the convolutional neural network can accurately identify the tree species.
5. In the method, after the parameters of the convolutional neural network model are updated every time in the training process, each picture in the verification set is sequentially input into the network to obtain the calculation result of each picture, then the accuracy of the model on the verification set is calculated, the quality of the model after the super parameters are adjusted every time is determined by observing the change condition of the accuracy of the model on the verification set, and the model with the highest accuracy in the experimental process is selected to establish the broadleaf forest tree species identification system.
6. According to the method, the result output by the convolutional neural network is processed by the softmax classifier to obtain a final result, the probability that the picture to be detected belongs to each tree species is calculated through the softmax function, the final output result is the tree species with the maximum probability value, the identification accuracy is further improved, and the output result is clear.
Drawings
FIG. 1 is a flow chart of a method of the present invention;
FIG. 2 is a network architecture diagram of the convolutional neural network of the present invention;
FIG. 3 is an image of a tree species to be tested;
FIG. 4 shows the result of the hardwood forest species identification system.
Detailed Description
The present invention will be further described with reference to the accompanying drawings.
Example one
In the broad-leaved forest tree species identification method based on a single photo, the deep convolutional neural network is utilized to autonomously learn the tree species characteristics, the neural network is retrained under the condition that the tree species sample data set is enough, the neural network is continuously optimized in the training, the neural network is tested after each optimization, and the convolutional neural network with the highest accuracy is selected to establish a broad-leaved forest tree species identification system, which specifically comprises the following steps:
s1, collecting images of different kinds of trees, establishing a tree image data set, and dividing the data set into a training set, a verification set and a test set;
s2 resize the image: adjusting each picture in the tree species image data set into an image with the same size;
s3, designing a convolutional neural network HCNN, training the convolutional neural network by using the training set image, and testing the accuracy of the convolutional neural network by using the test set image after training;
s4, constructing a broad-leaved forest tree species recognition system by using the trained convolutional neural network, and recognizing by inputting a tree species image so as to obtain a recognition result.
Example two
According to the identification method of broad-leaved forest tree species based on a single photo, based on the first embodiment, in order to ensure the identification accuracy, a large number of tree images need to be collected, the tree images can be directly shot in a natural scene in an artificial mode, and image data of related tree species can be obtained through batch crawling on the network by compiling a crawler program. The tree types in the tree species image data set are at least two types, and each tree image is at least 10000. And then randomly dividing the images in the tree seed image data set into a training set, a verification set and a test set, wherein the proportion of the training set, the verification set and the test set is 5-9: 0.5-2.5.
EXAMPLE III
In the method for identifying hardwood forest tree species based on a single photo in the embodiment, based on the second embodiment, before the image is input into the convolutional neural network, preprocessing is required to be performed on the image, specifically, the size of each image is modified into x × y pixels with fixed size; where x represents the width of the image, y represents the height of the image, and x ═ y. The size of the image is not limited, and the size of each picture is ensured to be consistent.
Example four
In the method for identifying broad-leaved forest tree species based on a single photo in the embodiment three, the convolutional neural network HCNN in the method has 11 layers in total, and specifically comprises the following network structure,
inputting an image with a size of x × y × z, wherein x represents a width of the image, y represents a height of the image, and x ═ y, z represents the number of channels of the image,
convolutional layer C1: using u1F is1×F1The xz convolution kernel performs a convolution operation with a step size of S1×S1Wherein the convolution operation adopts a 'VALID' form of not complementing 0 when exceeding the image boundary, and RelU non-line is used after convolutionAnd (3) performing a sexual activation function, wherein the result after convolution is output as: w1×W1×u1
Where W is the size of the input layer, i.e., W ═ x ═ y,is a rounded up symbol;
pooling layer P2: output W of C1 layer1×W1×u1As input, S is used2×S2The step size of (2) is subjected to maximum pooling, and the result after the maximum pooling is W2×W2×u1
Wherein, W1Is the output size of the C1 layer,is a rounded-down symbol;
convolutional layer C3: using u2F is2×F2×u1The convolution kernel of (a) performs a convolution operation with a step size of S3×S3The convolution operation adopts a 'SAME' form of complementing 0 when the boundary of the image is exceeded, a ReLU nonlinear activation function is used after the convolution, and the output result after the convolution is as follows: w3×W3×u2
Wherein, W2Is the output size of the C2 layer,is a rounded up symbol;
pooling layer P4: output W of C3 layer3×W3×u2As input, S is used4×S4The step size of (2) is subjected to maximum pooling, and the result after the maximum pooling is W4×W4×u2
Wherein, W3Is the output size of the C3 layer,to round the symbol downwards
Convolutional layer C5: using u3F is3×F3×u2The convolution kernel of (a) performs a convolution operation with a step size of S5×S5The convolution operation adopts a 'SAME' form of complementing 0 when the boundary of the image is exceeded, a RelU nonlinear activation function is used after the convolution, and the output result after the convolution is as follows: w5×W5×u3
Wherein, W4The output size of the P4 layer,is a rounded up symbol;
pooling layer P6: output W of C5 layer5×W5×u3As input, S is used6×S6The step size of (2) is subjected to maximum pooling, and the result after the maximum pooling is W6×W6×u3
Wherein, W5Is the output size of the C5 layer,to round the symbol downwards
Full connectivity layer FC7: output W of P6 layer6×W6×u3As an input, W is shared after P6 level calculation6×W6X u3 pixels, expressing the value of each pixel as a neuron, and making the output of FC7 layer be n1A neuron, wherein the value of each neuron is calculated by the formula:
where z is the value of each neuron, xiSetting the value of each neuron of the upper layer, wherein l is the number of output neurons of the upper layer, w is a weight parameter, b is a bias value, the initial value of w is initialized by adopting truncated Gaussian distribution, and the initial value of b is set to be 0;
full connectivity layer FC8: output n of FC7 layer1Each neuron as input and having output n2Each neuron calculates in the same way as in the full link layer FC 7;
full connectivity layer FC9: output n of FC8 layer2Each neuron as input and let output n3Each neuron calculates in the same way as in the full link layer FC 7;
output layer Output: output n of FC8 layer3Taking each neuron as an input, and enabling the output to be n neurons, wherein the calculation method of each neuron is the same as that in the full connection layer FC 7;
wherein the value of n is equal to the number of species of broad-leaved forest tree species, and n1>n2>n3>n。
EXAMPLE five
In the method for identifying broad-leaved forest tree species based on a single photo in the embodiment, based on the fourth embodiment, the method for training the convolutional neural network hcn comprises the following steps: firstly, defining a real type label for each tree species, sequentially inputting images in a training set into a convolutional neural network, calculating the convolutional neural network to obtain a prediction label, evaluating the difference between the real label value and the prediction label value obtained by network calculation by using a cross entropy function, representing the difference by using a loss value, then optimizing the convolutional neural network by using a gradient descent method, continuously inputting each image in the training set into the convolutional neural network and calculating the loss value once, updating unknown parameters in the network once when the convolutional neural network calculates each image by using a gradient descent method, calculating the accuracy of a network model by using a verification set after updating the network every time, and finally stopping the training of the network when the loss value is small enough and tends to be stable.
EXAMPLE six
In the broad-leaved forest tree species identification method based on a single photo in the embodiment, based on the fifth embodiment, cross entropy is used as a loss function of a convolutional neural network HCNN in a training process of the network, and is used for evaluating a difference between a real value and a predicted value of an image, and a formula of the cross entropy is as follows:
where loss represents the loss function, m represents the number of samples of a training input, n represents a total of n classes, yjiA tag that represents the true category of the content,represents the predicted class label, i represents the ith tree, i ranges from 1 to n, j represents the jth sample, and j ranges from 1 to m.
EXAMPLE seven
In the broad-leaved forest tree species identification method based on a single photo in the embodiment, based on the sixth embodiment, in the training process, a gradient descent method is used for continuously optimizing and reducing the loss value, all training picture samples are input into the network to update the network once, when the network is updated for a times or the loss value is lower than b, the training of the network is stopped, wherein a and b meet the conditions: a is more than 1000, b is less than 0.1, after each network update, each picture in the verification set is sequentially input into the network to obtain the calculation result of each picture, and then the accuracy of the model on the verification set is calculated, wherein the calculation formula of the accuracy is as follows:
wherein accuracy is the accuracy, t is the total number of images in the verification set, r is the number of images predicted correctly by the model,
and (3) selecting the best network model by comparing the accuracy, namely completing the training of the convolutional neural network, sequentially inputting each picture of the test set into the network after the training is completed to obtain the calculation result of each picture, dividing the number of the images which are predicted to be correct by the total number of the images of the test set to obtain the accuracy of the convolutional neural network on the test set, and verifying the accuracy again by using the test set after the training to ensure the reliability of the convolutional neural network.
Example eight
According to the seventh embodiment, when a picture is input into the convolutional neural network to calculate the loss value, the loss value needs to be continuously calculated once for each picture in the training set by using a gradient descent method, and the gradient descent method updates unknown parameters in the network once when each picture is calculated, namely w, b in each fully-connected layer in the convolutional neural network. Finally, the training of the network is stopped when the loss value is small enough and tends to be stable.
The formula of the gradient descent method is as follows:
where θ denotes the value of the parameter after update, θ denotes the parameter for which the model needs to be updated, α denotes the learning rate, J (θ) denotes the loss function, i.e., loss in the foregoing, and the value of the learning rate is determined empirically.
Example nine
In the broad-leaved forest tree species identification method based on a single photo in this embodiment, based on the eighth embodiment, when the broad-leaved forest tree species identification system is constructed by using the convolutional neural network model with the highest accuracy, in order to obtain a final identification result, n neurons Output by an Output layer Output in the convolutional neural network need to be processed by using a softmax classifier, finally, a vector of n rows is Output, the size of n is equal to the number of the seeds, the value of each row of the vector represents the probability that an image belongs to the tree species represented by the row, the final Output result of the broad-leaved forest tree species identification system is the tree species with the largest probability value,
the formula of the softmax function in the softmax classifier is as follows:
wherein,xivalue representing the ith neuron of the output layer, softmax (x)i) Indicating the probability that the image belongs to the tree represented by the ith row.
Example ten
The invention provides a broad-leaved forest tree species identification method based on a single photo, which comprises the following steps of:
collecting pictures to establish broad-leaved forest tree species image data sets, dividing the data sets into a training set, a verification set and a test set, wherein the species of the broad-leaved forest tree species image data sets are at least two, the maximum species number is not limited, and each tree image is at least 10000 (including data enhanced images);
sampling an input image, and adjusting the size of the image: adjusting each picture in the tree species image data set into an image with the same size;
designing a convolutional neural network HCNN, wherein the convolutional neural network HCNN has 11 layers in total, and specifically comprises an Input layer Input, a convolutional layer C1, a pooling layer P2, a convolutional layer C3, a pooling layer P4, a convolutional layer C5, a pooling layer P6, a full connection layer FC7, a full connection layer FC8, a full connection layer FC9 and an Output layer Output;
training the network by using the training set image and testing the accuracy of the network by using the test set image;
and selecting a convolutional neural network model with the highest accuracy rate to construct a broad-leaved forest tree species identification system, and identifying by inputting a tree species image so as to obtain an identification result.
The samples used for the image dataset of tree species in this example were 10 common hardwood species, including: camphor tree, southern magnolia, cypress, plum blossom, weeping willow, elm, apricot tree, sweet osmanthus tree, ailanthus and acacia. The image data of each tree is enhanced to 10000 pieces. The ratio of the number of pictures in the training set, the verification set and the test set is 8:1: 1.
Secondly, preprocessing the tree species image, wherein the length and the width of the tree species image are required to be adjusted to be 256X256 pixels with fixed size because the size of the pictures in the tree species image data set is different;
and (3) autonomously designing a convolutional neural network (HCNN), and utilizing the training set image to train the network and testing the accuracy of the network by using the testing set image. The HCNN network structure has 11 layers in total, and the structure diagram is shown in fig. 2, in which:
input layer Input for inputting 256 × 256 × 3 images (three channels because of RGB images);
convolution layer C1, using 108 13 × 13 × 3 convolution kernels to perform convolution operation, where the step size stride is 5 × 5, and the convolution operation adopts "VALID" form, so that the result output after convolution is 49 × 49 × 108;
pooling layer P2 output of C1 layer (note that RelU nonlinear activation function is used after each convolution operation, and will not be described again) is used as input, maximum pooling of 2 × 2 is used, step size is 2 × 2, and the result output is 24 × 24 × 108;
convolution layer C3, using 256 convolution kernels of 7 × 7 × 108 to perform convolution operation with step size of 1 × 1, wherein the convolution operation is in "SAME" form, so that the result output after convolution is 24 × 24 × 256;
pooling layer P4 using the output of C3 layer as input, maximal pooling of 2 × 2, step size of 2 × 2, resulting in an output of 12 × 12 × 256;
convolution layer C5, using 320 convolution kernels of 3 × 3 × 256 to perform convolution operation with step size of 1 × 1, wherein the convolution operation is in "SAME" form, so that the result output after convolution is 12 × 12 × 320;
pooling layer P6 using the output of C5 layer as input, maximal pooling of 2 × 2, step size of 2 × 2, resulting in output of 6 × 6 × 320;
the full connection layer FC7 takes the output of the P6 layer as input, after the P6 layer operation, the total number of 6X6X320 is 11520 neurons, and 8192 neurons are output;
the full connection layer FC8 inputs 8192 neurons and outputs 4096 neurons;
the full connection layer FC9 inputs 4096 neurons and outputs 2048 neurons;
and an Output layer Output inputs 2048 neurons and outputs 10 neurons.
A true category label is defined for each tree type, and initially there is a true category label for each picture. The category label is a vector of n rows, n is the number of tree species, in this example, 10 trees are in total, and the category label is a vector of 10 rows, for example: the camphor tree is [1,0,0,0,0,0, 0], the images in the training set are sequentially input into the convolutional neural network, the convolutional neural network calculates the values of 10 neurons when each image is input into the convolutional neural network, the values of the 10 neurons form a predicted category label, and then cross entropy is used as a loss function of the network for evaluating the difference between the real value and the predicted value of the image, and the formula of the cross entropy is as follows:
wherein m represents the number of samples input in one training, n represents n classes in total, yjiA tag that represents the true category of the content,represents the predicted class label, i represents the ith tree, i ranges from 1 to n, j represents the jth sample, j ranges from 1 to m,
all training picture samples are input into the network to be the updating of the network once, when the network is updated for a times or the loss value is lower than b, the training of the network is stopped, the value of a is determined according to the data volume, the more the data volume is, the larger the value of a needs to be, and the text is set to 10000. The smaller the Loss value, the better the effect of network convergence, and the value of b is set to 0.001.
When a picture is input into the convolutional neural network to obtain a loss value, a gradient descent method is used for continuously reducing the loss value, the loss value needs to be continuously calculated for each picture in a training set, and the gradient descent method updates unknown parameters in the network once when each picture is calculated, namely w and b in each fully-connected layer in the convolutional neural network. The formula of the gradient descent method is as follows:
in the formula, theta represents the updated parameter value, theta represents the parameter required to be updated by the model, α represents the learning rate, J (theta) represents the loss function, in the example, the learning rate α takes on the value of 0.001, the learning rate ranges from 0 to 1,
after each network update, each picture in the verification set is sequentially input into the network to obtain the calculation result of each picture, then the accuracy of the model on the verification set is calculated,
the calculation formula of the accuracy is as follows:
wherein accuracy is the accuracy, t is the total number of images in the verification set, r is the number of images predicted correctly by the model,
and (3) selecting the best network model by comparing the accuracy, namely completing the training of the convolutional neural network, sequentially inputting each picture of the test set into the network after the training is completed to obtain the calculation result of each picture, dividing the number of the images which are predicted to be correct by the total number of the images of the test set to obtain the accuracy of the convolutional neural network on the test set, and verifying the accuracy again by using the test set after the training to ensure the reliability of the convolutional neural network.
Constructing a broad-leaved forest tree species recognition system by using a trained network, processing 10 neurons Output by an Output layer Output in a convolutional neural network by using a softmax classifier in order to obtain a final recognition result, finally outputting a vector of 10 rows, wherein the value of each row of the vector represents the probability that an image belongs to the tree species represented by the row, the final Output result of the broad-leaved forest tree species recognition system is the tree species with the maximum probability value,
the formula of the softmax function in the softmax classifier is as follows:
wherein x isiValue representing the ith neuron of the output layer, softmax (x)i) Indicating the probability that the image belongs to the tree represented by the ith row.
Finally, a single tree image is input into the broad-leaved forest tree species identification system to check the output identification result, the system operation example is shown in fig. 3 and 4, fig. 3 is the tree species image to be detected, and fig. 4 is the system operation result.
The above description is only of the preferred embodiments of the present invention, and it should be noted that: it will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the principles of the invention and these are intended to be within the scope of the invention.

Claims (10)

1. A broad-leaved forest tree species identification method based on a single photo is characterized by comprising the following steps:
s1, collecting images of different kinds of trees, establishing a tree species image data set, and dividing the tree species image data set into a training set, a verification set and a test set;
s2 resize the image: adjusting each picture in the tree species image data set into an image with the same size;
s3, designing a convolution neural network, training the network by using the training set image, and testing the accuracy of the network by using the test set image after training;
s4, constructing a broad-leaved forest tree species identification system by using the trained convolutional neural network, and identifying by inputting a tree species image so as to obtain an identification result.
2. The method for identifying hardwood species based on a single photograph as recited in claim 1 wherein in step S1, the tree species in the tree species image data set are at least two species, and each tree image is at least 10000.
3. The method for identifying broad-leaved forest tree species based on a single photo as claimed in claim 1 or 2, wherein the tree species image data set is randomly divided into a training set, a verification set and a test set, wherein the ratio of the training set, the verification set and the test set is 5-9: 0.5-2.5.
4. The method for identifying hardwood forest species based on single photo as claimed in claim 1, characterized in that in step S2, the size of each image is modified to fixed size x y pixels; where x represents the width of the image, y represents the height of the image, and x ═ y.
5. The method for identifying hardwood forest species based on single photo as claimed in claim 1 wherein the convolutional neural network HCNN has a total of 11 layers, specifically comprising the following network structure,
inputting an image with a size of x × y × z, wherein x represents a width of the image, y represents a height of the image, and x ═ y, z represents the number of channels of the image,
convolutional layer C1: using u1F is1×F1The xz convolution kernel performs a convolution operation with a step size of S1×S1The convolution operation adopts a 'VALID' form that 0 is not complemented when the image boundary is exceeded, a RelU nonlinear activation function is used after convolution, and the result output after convolution is as follows: w1×W1×u1
Where W is the size of the input layer, i.e., W ═ x ═ y,is a rounded up symbol;
pooling layer P2: output W of C1 layer1×W1×u1As input, S is used2×S2The step size of (2) is subjected to maximum pooling, and the result after the maximum pooling is W2×W2×u1
Wherein, W1Is the output size of the C1 layer,is a rounded-down symbol;
convolutional layer C3: using u2F is2×F2×u1The convolution kernel of (a) performs a convolution operation with a step size of S3×S3The convolution operation adopts a 'SAME' form of complementing 0 when the boundary of the image is exceeded, a ReLU nonlinear activation function is used after the convolution, and the output result after the convolution is as follows: w3×W3×u2
Wherein, W2Is the output size of the C2 layer,is a rounded up symbol;
pooling layer P4: output W of C3 layer3×W3×u2As input, S is used4×S4The step size of (2) is subjected to maximum pooling, and the result after the maximum pooling is W4×W4×u2
Wherein, W3Is the output size of the C3 layer,to round the symbol downwards
Convolutional layer C5: using u3F is3×F3×u2The convolution kernel of (a) performs a convolution operation with a step size of S5×S5The convolution operation adopts a 'SAME' form of complementing 0 when the boundary of the image is exceeded, a RelU nonlinear activation function is used after the convolution, and the output result after the convolution is as follows: w5×W5×u3
Wherein, W4The output size of the P4 layer,is a rounded up symbol;
pooling layer P6: output W of C5 layer5×W5×u3As input, S is used6×S6The step size of (2) is subjected to maximum pooling, and the result after the maximum pooling is W6×W6×u3
Wherein, W5Is the output size of the C5 layer,to round the symbol downwards
Full connectivity layer FC7: output W of P6 layer6×W6×u3As an input, W is shared after P6 level calculation6×W6X u3 pixels, expressing the value of each pixel as a neuron, and making the output of FC7 layer be n1A neuron, wherein the value of each neuron is calculated by the formula:
where z is the value of each neuron, xiSetting the value of each neuron of the upper layer, wherein l is the number of output neurons of the upper layer, w is a weight parameter, b is a bias value, the initial value of w is initialized by adopting truncated Gaussian distribution, and the initial value of b is set to be 0;
full connectivity layer FC8: output n of FC7 layer1Each neuron as input and having output n2Each neuron calculates in the same way as in the full link layer FC 7;
full connectivity layer FC9: output n of FC8 layer2Each neuron as input and let output n3Each neuron calculates in the same way as in the full link layer FC 7;
output layer Output: output n of FC8 layer3Taking each neuron as an input, and enabling the output to be n neurons, wherein the calculation method of each neuron is the same as that in the full connection layer FC 7;
wherein the value of n is equal to the number of species of broad-leaved forest tree species, and n1>n2>n3>n。
6. The method for identifying hardwood forest species based on single photo in claim 5 wherein the method for training convolutional neural network in step S3 is: firstly, defining a real type label for each tree species, sequentially inputting images in a training set into a convolutional neural network, calculating the convolutional neural network to obtain a prediction label, evaluating the difference between the real label value and the prediction label value obtained by network calculation by using a cross entropy function, representing the difference by using a loss value, then optimizing the convolutional neural network by using a gradient descent method, continuously inputting each image in the training set into the convolutional neural network and calculating the loss value once, updating unknown parameters in the network once when the convolutional neural network calculates each image by using a gradient descent method, calculating the accuracy of a network model by using a verification set after updating the network every time, and finally stopping the training of the network when the loss value is small enough and tends to be stable.
7. The method for identifying hardwood forest species based on single photo in claim 6 wherein in step S3, cross entropy is used as a loss function of the network for evaluating the difference between the real value and the predicted value of the image, the formula of the cross entropy is as follows:
where loss is a loss function, m represents the number of samples of a training input, n represents a total of n classes, yjiA tag that represents the true category of the content,represents the predicted class label, i represents the ith tree, i ranges from 1 to n, j represents the jth sample, j ranges from 1 to m,
in the training process, a gradient descent method is used for continuously optimizing and reducing the loss value, all training picture samples are input into the network to be the updating of the network, when the network is updated for a times or the loss value is lower than b, the training of the network is stopped, wherein a is greater than 1000, and b is less than 0.1.
8. The method for identifying hardwood forest species based on single photo in claim 7 wherein in step S3, after the convolutional neural network is updated each time, each image in the validation set is sequentially inputted into the network to obtain the calculation result of each image, and then the accuracy of the model on the validation set is calculated, the calculation formula of the accuracy is as follows:
wherein accuracy is the accuracy, t is the total number of images in the verification set, r is the number of images predicted correctly by the model,
and selecting the best network model by comparing the accuracy.
9. The method for identifying hardwood forest species based on single photo in accordance with any one of claims 6-8, characterized in that in step S3, the formula of gradient descent method is as follows:
in the formula, θ represents the updated parameter value, θ represents the parameter to be updated in the model, α represents the learning rate, and J (θ) represents the loss function.
10. The method for identifying hardwood forest species based on single photo as claimed in claim 5, wherein in step S4, it is necessary to process the result outputted from the convolutional neural network with softmax classifier to obtain the final result, and finally output a vector with n rows, where n is equal to the number of species of hardwood forest species, the value of each row of the vector represents the probability that the image belongs to the species represented by the row, and the final output result of hardwood forest species identification system is the species with the largest probability value, and the formula of softmax function in softmax classifier is as follows:
wherein x isiValue representing the ith neuron of the output layer, softmax (x)i) Indicating the probability that the image belongs to the tree represented by the ith row.
CN201811137730.0A 2018-09-28 2018-09-28 A kind of broad-leaf forest wood recognition method based on single photo Pending CN109522924A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811137730.0A CN109522924A (en) 2018-09-28 2018-09-28 A kind of broad-leaf forest wood recognition method based on single photo

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811137730.0A CN109522924A (en) 2018-09-28 2018-09-28 A kind of broad-leaf forest wood recognition method based on single photo

Publications (1)

Publication Number Publication Date
CN109522924A true CN109522924A (en) 2019-03-26

Family

ID=65769836

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811137730.0A Pending CN109522924A (en) 2018-09-28 2018-09-28 A kind of broad-leaf forest wood recognition method based on single photo

Country Status (1)

Country Link
CN (1) CN109522924A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110119691A (en) * 2019-04-19 2019-08-13 华南理工大学 A kind of portrait localization method that based on local 2D pattern and not bending moment is searched
CN110569764A (en) * 2019-08-28 2019-12-13 北京工业大学 mobile phone model identification method based on convolutional neural network
CN110728197A (en) * 2019-09-19 2020-01-24 中山大学 Single-tree-level tree species identification method based on deep learning
CN110942448A (en) * 2019-10-30 2020-03-31 江苏大学 Quantitative phase image identification method based on convolutional neural network
CN111179335A (en) * 2019-12-28 2020-05-19 东北林业大学 Standing tree measuring method based on binocular vision
CN111414971A (en) * 2020-03-27 2020-07-14 南京工业大学 Finished product tea type and grade identification method based on convolutional neural network
CN111626370A (en) * 2020-05-29 2020-09-04 展讯通信(上海)有限公司 Neural network-based hollow-out identification method and device, storage medium and terminal
CN111898680A (en) * 2020-07-31 2020-11-06 陈艳 Biological identification method based on material inspection multi-view morphological image and deep learning
CN112215082A (en) * 2020-09-17 2021-01-12 广东技术师范大学 Plant leaf image identification method
CN112418266A (en) * 2020-10-15 2021-02-26 南昌大学 Pile foundation integrity classification and identification method based on convolutional neural network
CN112684158A (en) * 2020-03-13 2021-04-20 中国林业科学研究院林业新技术研究所 On-site identification method and device for common tree species of historic building wood members
CN112861699A (en) * 2021-02-03 2021-05-28 湖南大学 Method for estimating height of human body in any posture based on single depth image and multi-stage neural network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354534A (en) * 2015-09-29 2016-02-24 南京林业大学 Tree species classification method based on multi-source simultaneous high-resolution remote sensing data
CN107871136A (en) * 2017-03-22 2018-04-03 中山大学 The image-recognizing method of convolutional neural networks based on openness random pool
CN107958257A (en) * 2017-10-11 2018-04-24 华南理工大学 A kind of Chinese traditional medicinal materials recognition method based on deep neural network
CN207473623U (en) * 2017-11-08 2018-06-08 江西省科学院 A kind of remote sensing system for urban green space wood recognition

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354534A (en) * 2015-09-29 2016-02-24 南京林业大学 Tree species classification method based on multi-source simultaneous high-resolution remote sensing data
CN107871136A (en) * 2017-03-22 2018-04-03 中山大学 The image-recognizing method of convolutional neural networks based on openness random pool
CN107958257A (en) * 2017-10-11 2018-04-24 华南理工大学 A kind of Chinese traditional medicinal materials recognition method based on deep neural network
CN207473623U (en) * 2017-11-08 2018-06-08 江西省科学院 A kind of remote sensing system for urban green space wood recognition

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张顺 等: "深度卷积神经网络的发展及其在计算机视觉领域的应用", 《计算机学报》 *
赵鹏超 等: "基于卷积神经网络和树叶纹理的树种识别研究", 《森林工程》 *

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110119691B (en) * 2019-04-19 2021-07-20 华南理工大学 Portrait positioning method based on local two-dimensional mode and invariant moment search
CN110119691A (en) * 2019-04-19 2019-08-13 华南理工大学 A kind of portrait localization method that based on local 2D pattern and not bending moment is searched
CN110569764A (en) * 2019-08-28 2019-12-13 北京工业大学 mobile phone model identification method based on convolutional neural network
CN110569764B (en) * 2019-08-28 2023-12-22 北京工业大学 Mobile phone model identification method based on convolutional neural network
CN110728197A (en) * 2019-09-19 2020-01-24 中山大学 Single-tree-level tree species identification method based on deep learning
CN110728197B (en) * 2019-09-19 2023-04-18 中山大学 Single-tree-level tree species identification method based on deep learning
CN110942448A (en) * 2019-10-30 2020-03-31 江苏大学 Quantitative phase image identification method based on convolutional neural network
CN111179335A (en) * 2019-12-28 2020-05-19 东北林业大学 Standing tree measuring method based on binocular vision
CN112684158A (en) * 2020-03-13 2021-04-20 中国林业科学研究院林业新技术研究所 On-site identification method and device for common tree species of historic building wood members
CN112684158B (en) * 2020-03-13 2023-03-21 中国林业科学研究院林业新技术研究所 On-site identification method and device for common tree species of historic building wood members
CN111414971B (en) * 2020-03-27 2023-05-02 南京工业大学 Convolutional neural network-based finished tea variety and grade identification method
CN111414971A (en) * 2020-03-27 2020-07-14 南京工业大学 Finished product tea type and grade identification method based on convolutional neural network
CN111626370B (en) * 2020-05-29 2022-07-12 展讯通信(上海)有限公司 Neural network-based hollow-out identification method and device, storage medium and terminal
CN111626370A (en) * 2020-05-29 2020-09-04 展讯通信(上海)有限公司 Neural network-based hollow-out identification method and device, storage medium and terminal
CN111898680A (en) * 2020-07-31 2020-11-06 陈艳 Biological identification method based on material inspection multi-view morphological image and deep learning
CN112215082A (en) * 2020-09-17 2021-01-12 广东技术师范大学 Plant leaf image identification method
CN112418266A (en) * 2020-10-15 2021-02-26 南昌大学 Pile foundation integrity classification and identification method based on convolutional neural network
CN112861699A (en) * 2021-02-03 2021-05-28 湖南大学 Method for estimating height of human body in any posture based on single depth image and multi-stage neural network

Similar Documents

Publication Publication Date Title
CN109522924A (en) A kind of broad-leaf forest wood recognition method based on single photo
CN107016405B (en) A kind of pest image classification method based on classification prediction convolutional neural networks
CN105488536B (en) A kind of agricultural pests image-recognizing method based on multiple features depth learning technology
Yu et al. Leaf spot attention network for apple leaf disease identification
CN110348399B (en) Hyperspectral intelligent classification method based on prototype learning mechanism and multidimensional residual error network
Akshai et al. Plant disease classification using deep learning
CN105701480B (en) A kind of Video Semantic Analysis method
CN107169504B (en) A kind of hand-written character recognition method based on extension Non-linear Kernel residual error network
CN109272500B (en) Fabric classification method based on adaptive convolutional neural network
WO2018052587A1 (en) Method and system for cell image segmentation using multi-stage convolutional neural networks
CN107977671A (en) A kind of tongue picture sorting technique based on multitask convolutional neural networks
CN109190643A (en) Based on the recognition methods of convolutional neural networks Chinese medicine and electronic equipment
CN107451565B (en) Semi-supervised small sample deep learning image mode classification and identification method
CN106446942A (en) Crop disease identification method based on incremental learning
CN106485259B (en) A kind of image classification method based on high constraint high dispersive principal component analysis network
CN109344891A (en) A kind of high-spectrum remote sensing data classification method based on deep neural network
CN110479636B (en) Method and device for automatically sorting tobacco leaves based on neural network
Nguyen et al. Flower species identification using deep convolutional neural networks
CN107832797B (en) Multispectral image classification method based on depth fusion residual error network
CN110197205A (en) A kind of image-recognizing method of multiple features source residual error network
CN107665352A (en) A kind of pearl sorting technique based on multichannel residual error network
CN113222959B (en) Fresh jujube wormhole detection method based on hyperspectral image convolutional neural network
CN111178177A (en) Cucumber disease identification method based on convolutional neural network
CN109740656A (en) A kind of ore method for separating based on convolutional neural networks
CN116630960B (en) Corn disease identification method based on texture-color multi-scale residual shrinkage 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190326