WO2020181706A1 - 植物种类的识别方法及装置 - Google Patents

植物种类的识别方法及装置 Download PDF

Info

Publication number
WO2020181706A1
WO2020181706A1 PCT/CN2019/097891 CN2019097891W WO2020181706A1 WO 2020181706 A1 WO2020181706 A1 WO 2020181706A1 CN 2019097891 W CN2019097891 W CN 2019097891W WO 2020181706 A1 WO2020181706 A1 WO 2020181706A1
Authority
WO
WIPO (PCT)
Prior art keywords
preset
plant
resolution
image
positions
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.)
Ceased
Application number
PCT/CN2019/097891
Other languages
English (en)
French (fr)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2020181706A1 publication Critical patent/WO2020181706A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/02Agriculture; Fishing; Forestry; Mining

Definitions

  • This application relates to the technical field of plant species identification, and in particular to a method and device for plant species identification.
  • Atractylodes which belongs to the genus Atractylodes of the Atractylaceae, and the two plants have different medicinal effects, but the appearance is very similar.
  • atractylodes japonicus affect the efficacy of atractylodes japonicus.
  • the present application provides a method and device for identifying plant species, which helps to improve the accuracy of plant species identification.
  • a method for identifying plant species including:
  • a plurality of corresponding plant sample sub-images of a second preset resolution are respectively acquired at a plurality of preset positions of the plant sample image of the first preset resolution, wherein the second preset resolution is smaller than the The first preset resolution, the plurality of preset positions are different, one of the plurality of preset positions is the center position of the plant sample image of the first preset resolution, and the other presets
  • the plant sample sub-images of the second preset resolution corresponding to the positions do not overlap each other and can be combined into a complete plant sample image of the first preset resolution;
  • the plant image to be recognized is received, and the type of the plant image to be recognized is recognized by using the trained model.
  • a plant species identification device which is characterized in that it comprises:
  • the sample resolution processing module is used to perform resolution preprocessing on the plant sample image to obtain the plant sample image of the first preset resolution
  • the sample block processing module is configured to obtain corresponding multiple plant sample sub-images of the second preset resolution at multiple preset positions of the plant sample image of the first preset resolution, wherein the The second preset resolution is smaller than the first preset resolution, the plurality of preset positions are different from each other, and one of the plurality of preset positions is a plant sample image of the first preset resolution
  • the plant sample sub-images of the second preset resolution corresponding to other preset positions do not overlap each other and can be combined into a complete plant sample image of the first preset resolution;
  • the sample set establishment module is configured to use the plurality of plant sample sub-images of the second preset resolution corresponding to the plurality of preset positions to respectively establish the training samples corresponding to the plurality of preset positions Set and the test sample set;
  • the model training module is used to train multiple ResNet50 convolutional neural network models using the training sample sets corresponding to the multiple preset positions, until each trained model corresponding to the multiple preset positions recognizes the corresponding The recognition result of the test sample set meets a preset training termination condition;
  • the image recognition module is used to receive the plant image to be recognized, and use the trained model to recognize the type of the plant image to be recognized.
  • a computer non-volatile readable storage medium on which computer readable instructions are stored, and when the program is executed by a processor, the following steps are implemented:
  • a plurality of corresponding plant sample sub-images of a second preset resolution are respectively acquired at a plurality of preset positions of the plant sample image of the first preset resolution, wherein the second preset resolution is smaller than the The first preset resolution, the plurality of preset positions are different, one of the plurality of preset positions is the center position of the plant sample image of the first preset resolution, and the other presets
  • the plant sample sub-images of the second preset resolution corresponding to the positions do not overlap each other and can be combined into a complete plant sample image of the first preset resolution;
  • the plant image to be recognized is received, and the type of the plant image to be recognized is recognized by using the trained model.
  • a computer device including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor.
  • the processor implements The following steps:
  • a plurality of corresponding plant sample sub-images of a second preset resolution are respectively acquired at a plurality of preset positions of the plant sample image of the first preset resolution, wherein the second preset resolution is smaller than the The first preset resolution, the plurality of preset positions are different, one of the plurality of preset positions is the center position of the plant sample image of the first preset resolution, and the other presets
  • the plant sample sub-images of the second preset resolution corresponding to the positions do not overlap each other and can be combined into a complete plant sample image of the first preset resolution;
  • the plant image to be recognized is received, and the type of the plant image to be recognized is recognized by using the trained model.
  • the plant species identification method and device process the resolution of the plant sample image, and after the plant sample image is divided into blocks according to the preset position, it is established with each
  • the training sample set and test sample set corresponding to the preset position are used to train the corresponding ResNet50 model with the training sample set corresponding to each preset position, so that the trained model can achieve the recognition effect of the test sample set at the corresponding position
  • the classification of the new plant image to be recognized is realized through the trained model.
  • this application only needs to take images of the plants to be identified, and the types of plants can be identified through models, which improves the efficiency of identifying plant species and saves money.
  • the labor cost is reduced, and the deep convolutional neural network model using ResNet50 structure also has high accuracy for the recognition of complex images.
  • Fig. 1 shows a schematic flowchart of a method for identifying plant species provided by an embodiment of the present application
  • Figure 2 shows a schematic flow chart of another method for identifying plant species provided by an embodiment of the present application
  • Fig. 3 shows a block diagram of a plant sample image provided by a specific embodiment of the present application
  • FIG. 4 shows a schematic structural diagram of a plant species identification device provided by an embodiment of the present application
  • Figure 5 shows a schematic structural diagram of another plant species identification device provided by an embodiment of the present application.
  • Fig. 6 shows a schematic diagram of the physical structure of a computer device provided by an embodiment of the present application.
  • a method for identifying plant species includes:
  • Step 101 Perform resolution preprocessing on a plant sample image to obtain a plant sample image with a first preset resolution.
  • the plant sample image may include atractylodes lanceolata sample image and Atractylodes lanceolata sample image.
  • Step 102 Acquire corresponding multiple plant sample sub-images of a second preset resolution at multiple preset positions of the plant sample image of the first preset resolution, wherein the second preset resolution is smaller than the first
  • the preset resolution, multiple preset positions are different, one of the multiple preset positions is the center position of the plant sample image with the first preset resolution, and the other preset positions correspond to the second preset resolution
  • the plant sample sub-images do not overlap each other and can be combined into a complete plant sample image of the first preset resolution.
  • the image information corresponding to different positions of the sample image may be quite different.
  • the bottom of the image may contain more plants.
  • the top of the image may contain more plant leaf images, and the root characteristics of plants are quite different from the leaf characteristics of plants. Therefore, in order to obtain a more accurate classification result, this embodiment performs more detailed analysis on different parts of plants.
  • Specific modeling analysis after processing the resolution of the plant sample image to the first preset resolution, the image is divided into blocks according to the preset position, and each plant sample image is divided into blocks according to multiple preset positions Then, a complete plant sample image can be divided into multiple plant sample image blocks, where each preset position corresponds to one image block. And in order to preserve the complete image features, the image blocks obtained after the block processing can completely cover the original plant sample image with the first preset resolution.
  • Step 103 Using a plurality of plant sample sub-images of a second preset resolution corresponding to a plurality of preset positions, respectively establish a training sample set and a test sample set corresponding to the plurality of preset positions.
  • the image block corresponding to each preset position is used to establish a training sample set and a test sample set corresponding to the preset position. For example, preset 5 positions in the sample image, which are marked as position 1, position 2, position 3, position 4, and position 5. After the plant sample image is divided into blocks, the image blocks corresponding to the 5 positions are obtained. The image blocks corresponding to positions 1, 2, 3, 4, and 5 establish the training sample set of positions 1, 2, 3, 4, and 5 and the test sample set of positions 1, 2, 3, 4, and 5. Generally speaking, training samples The number of images in the set is greater than the number of images in the test sample set.
  • the number of images in the training sample set can be preset to 2000, and the number of images in the test sample set is preset to 300.
  • the training sample Both the set and the test sample set contain samples of Atractylodes Rhizome and Atractylodes Rhizome sample image blocks corresponding to preset positions.
  • Step 104 Train multiple ResNet50 convolutional neural network models with training sample sets corresponding to multiple preset positions respectively, until each trained model corresponding to multiple preset positions recognizes the recognition result of the corresponding test sample set Meet the preset training termination conditions.
  • a ResNet50 convolutional neural network model corresponding to each preset location is established, and the training sample set corresponding to each preset location is used to train the corresponding preset location Model. For example, use the training sample set corresponding to position 1 to train the model in position 1.
  • test sample set to test the model to verify the classification effect of the model on the sample images in the test sample set. If the classification effect of the model does not reach the preset training termination condition after one training, adjust the relevant training parameters of the model and continue Use the test sample set to train the model until the preset training termination condition is met.
  • Step 105 Receive the plant image to be recognized, and use the trained model to recognize the type of plant image to be recognized.
  • the trained model can be used to classify the plant image to be recognized. Specifically, after obtaining multiple image blocks of the plant image to be recognized according to the preset position, the plant to be recognized can be obtained through the corresponding trained model Identify the plant species corresponding to the image. In the embodiment of the present application, after inputting the plant image to be recognized into the model, the probability that the image is an Atractylodes lancea image and the probability that the image is an Atractylodes macrocephala image can be obtained.
  • a training sample set and a test sample corresponding to each preset position are established
  • the training sample set corresponding to each preset position is used to train the corresponding ResNet50 model, so that the trained model can recognize the test sample set at the corresponding position after reaching the preset training termination condition.
  • the latter model classifies the new plant image to be recognized.
  • the method includes:
  • Step 201 If the resolution of the plant sample image is greater than the first preset resolution, down-sampling is performed on the plant sample image to obtain a plant sample image of the first preset resolution.
  • the ResNet50 convolutional neural network model used in the embodiments of this application requires an image with a resolution of 720 ⁇ 540 for training. Therefore, the preset resolution is 720 ⁇ 540 to ensure the clarity of the image so that the plant sample image can be processed For further processing, in this embodiment of the application, the first preset resolution is set to 1440 ⁇ 1080.
  • the image should be down-sampled to reduce it to the first preset resolution, so that the resolution of all the plant sample images is unified, and the subsequent image segmentation is convenient Processing and other operations and the establishment of training sample sets and test sample sets.
  • the ResNet50 model includes a 50-layer convolutional layer and a 1-layer fully connected layer that are sequentially connected, where the 50-layer convolutional layer is divided into 5 blocks, and the 5 blocks are respectively denoted as conv1, conv2_x, conv3_x, conv4_x, conv5_x, conv1 includes a convolutional layer with a 7 ⁇ 7 convolution kernel, conv2_x includes a convolution layer with a 3 ⁇ 3 convolution kernel and 3 bottleneck building blocks; conv3_x includes 4 bottleneck building blocks; conv4_x includes 6 bottleneck building blocks; conv5_x includes 3 bottleneck building blocks, and each bottleneck building block includes 3 layers of convolution kernels as 3 ⁇ 3 convolutional layers.
  • ResNet50 is a deep convolutional neural network structure, which uses residual connection to increase the depth of the network structure and improve the recognition accuracy. Using this network structure can achieve accurate classification of complex images. Specifically, it includes 50 layers of convolutional layer and 1 layer of fully connected layer (or called up-sampling layer).
  • conv1 consists of a single convolution kernel of 7 ⁇ 7 fully convolutional layers
  • conv2_x consists of a 3 ⁇ 3 convolution
  • the convolutional layer of the convolution kernel and 3 bottleneck building blocks are composed of a total of 10 layers (each bottleneck building block contains a convolution kernel of 1 ⁇ 1, a convolution layer with 64 channels, and a convolution kernel of 3 ⁇ 3, a convolutional layer with 64 channels, and a convolutional layer with a convolution kernel of 1 ⁇ 1 and 256 channels);
  • conv3_x is composed of 4 bottleneck building blocks and a total of 12 layers (each bottleneck building block It contains a convolution kernel of 1 ⁇ 1, a convolutional layer with 128 channels, a convolution kernel of 3 ⁇ 3, a convolutional layer with 128 channels, and a convolution kernel of 1 ⁇ 1 , A convolutional layer with 512 channels);
  • conv4_x is composed of 6 bottleneck building blocks and a total of 18 layers (each bottleneck
  • Step 202 If the resolution of the plant sample image is less than the first preset resolution, perform an up-sampling process on the plant sample image to obtain a plant sample image of the first preset resolution.
  • the resolution of the plant sample image is less than the first preset resolution
  • the resolution of the image should also be adjusted to the first preset resolution.
  • the up-sampling process can be used to perform bilinear on the original image. Interpolate and upsample to the first preset resolution.
  • Step 203 Acquire corresponding multiple plant sample sub-images of a second preset resolution at multiple preset positions of the plant sample image of the first preset resolution, wherein the second preset resolution is smaller than the first The preset resolution, multiple preset positions are different, one of the multiple preset positions is the center position of the plant sample image of the first preset resolution, and the other plant samples of the second preset resolution The sub-images do not overlap each other.
  • the embodiment of the present application performs block processing on the plant sample image, and obtains multiple plant sample sub-images with a resolution of 720 ⁇ 540 corresponding to multiple preset positions according to each plant sample image with a first preset resolution.
  • the multiple preset positions include the center position of the plant sample image.
  • the plant sample image corresponding to the center position may overlap with plant sample images corresponding to other positions, but the plant sample images corresponding to other positions do not overlap each other and other positions
  • the corresponding plant sample sub-image should include the entire plant sample image, so that the training sample set and the test sample set can be established based on the divided plant sample image, so that each pixel in the image is used as a training sample to avoid loss of image Feature information, and because the central position of the image is usually the part where the key feature information for distinguishing plant species is relatively concentrated, extracting the image at the central position separately for training will help improve the recognition accuracy of the model.
  • Step 204 normalize the RGB value of each pixel of the plant sample sub-images with the second preset resolution ratio, and the RGB value normalization processing formula is:
  • N is the maximum component value of the RGB channel
  • x and y are the R, G, and B of any pixel corresponding to the original and normalized second preset resolution plant sample sub-image.
  • the component value of a channel is the maximum component value of the RGB channel
  • x and y are the R, G, and B of any pixel corresponding to the original and normalized second preset resolution plant sample sub-image.
  • Step 205 Use the plurality of plant sample sub-images of the second preset resolution corresponding to the plurality of preset positions after the normalization of the RGB values, to respectively establish training sample sets and test samples corresponding to the plurality of preset positions set.
  • a corresponding training sample set and a test sample set are established according to the plant sample image with a resolution of 720 ⁇ 540 corresponding to each preset position.
  • 5 training sample sets corresponding to preset positions and 5 corresponding test sample sets are respectively established.
  • Each training sample set includes 2000 images of the same position of different samples, and each test sample The set includes 300 images of the same position of samples different from the training sample set.
  • Step 206 Use training sample sets corresponding to a plurality of preset positions to train corresponding models according to a preset learning rate.
  • the model is trained according to a preset learning rate using a training sample set, for example, a training sample set corresponding to position 1 is used to train a model corresponding to position 1 at a learning rate of 0.01.
  • different learning rates can be set for models corresponding to different positions, or the same learning rate can be set, which is not limited here.
  • Step 207 If the accuracy of the trained model to identify the corresponding test sample set is less than the preset accuracy and/or the recall rate is less than the preset recall rate, then the preset learning rate is reduced, and the reduced preset learning rate is continued The model is trained until the accuracy rate of the trained model identifying the corresponding test sample set is greater than or equal to the preset accuracy rate and the recall rate is greater than or equal to the preset recall rate.
  • the model After training the model according to the preset learning rate, use the trained model to test the corresponding test sample set. If the recognition accuracy and recall rate of the model are greater than or equal to the preset accuracy and recall rates, then the model After the training is completed, the model can be further used to classify the plant images to be recognized. If the recognition accuracy of the model is less than the preset accuracy and the recall rate is less than the preset recall rate, you need to continue to train the model. Use a learning rate lower than the original preset learning rate for training, thereby improving the recognition accuracy and recall rate of the model until the corresponding presets are reached.
  • the preset learning rate is 0.01
  • the preset accuracy and recall rates are both 90%.
  • the recognition accuracy and/or recall rate of the model is less than 90%, the model will be trained 1000 times with a learning rate of 0.001.
  • Each pass contains 30 plant sample images randomly selected from the training sample set, and then test the recognition of the trained model If the accuracy and recall rates still do not meet the preset conditions, you can reduce the learning rate again to continue learning.
  • the model corresponding to each preset position can use the same initial learning rate, or different initial learning rates can be set separately, and the preset accuracy and recall rate corresponding to each model can be the same or can be Different, for example, the accuracy rate and recall rate corresponding to the center position are set to 95%, and the accuracy rate and recall rate corresponding to other positions are set to 90%. Test the classification accuracy and recall of each model separately, until the classification accuracy and recall of each model after training reach the corresponding preset.
  • Step 208 Perform resolution preprocessing on the received plant image to be recognized, so that the resolution of the plant image to be recognized is consistent with the first preset resolution;
  • Step 209 Acquire corresponding multiple plant sub-images to be recognized at multiple preset positions of the processed plant image to be recognized, wherein the resolution of any one of the multiple plant images to be recognized and the first 2.
  • the preset resolution is consistent;
  • Step 210 Perform normalization processing on the RGB value of each pixel of the plant sub-image to be identified corresponding to a plurality of preset positions according to the RGB value normalization processing formula;
  • Step 211 Input the plant sub-images to be identified corresponding to the multiple preset positions after the normalization of the RGB values into the corresponding trained model to obtain the to-be-identified plant sub-images corresponding to the multiple preset positions respectively. Multiple recognition results of plant sub-images.
  • the classification of the plant image to be recognized can be realized.
  • the processing procedure is similar to that of the plant sample image.
  • the resolution of the image is first processed to the first preset resolution, and then the image is divided into blocks according to multiple preset positions.
  • the images to be recognized corresponding to 5 preset positions are input into the corresponding models respectively, and the recognition results of the images to be recognized corresponding to the 5 preset positions are obtained respectively.
  • Step 212 Perform a weighted sum calculation on the multiple recognition results according to the preset weights corresponding to the multiple preset positions to obtain the recognition result of the image to be recognized, where the plant sub-image at the center position corresponds to the The preset weight is greater than the preset weight corresponding to the plant sub-images to be identified at other locations.
  • the recognition result is weighted and calculated according to the corresponding preset weight to obtain the final recognition result of the image to be recognized.
  • the central location may contain more key feature information, which should be used as the main reference factor to determine the final recognition result. Therefore, its corresponding weight should be higher than the corresponding weights at other locations to obtain more accurate recognition results.
  • the weight corresponding to the center position in the 5 preset positions is set to 0.4, and the weight corresponding to the remaining 4 positions is set to 0.15 respectively.
  • the recognition result at the center position is that the image corresponding to the center position is atractylodes
  • the probability is 80%
  • the probability of Atractylodes macrocephala is 10%
  • the recognition results of the remaining 4 positions are 40%, 90%, 80%, 80% of the corresponding image
  • the probability of Atractylodes macrocephala is 80%, 20%, 30%. , 20%.
  • the type of plant image to be recognized can be determined according to the 75.5% probability of atractylodes and 26.5% probability of atractylodes.
  • a rule can be set as follows: if the probability of the recognition result of the first type of plant is greater than or equal to the first preset probability and the probability of the second type of plant is less than the second preset probability, determine the plant corresponding to the plant image to be recognized
  • the species is the first kind of plant. For example, the first preset probability is 70% and the second preset probability is 30%, then it can be determined that the type corresponding to the above-mentioned plant image to be recognized is atractylodes. If the recognition result is that the probability of atractylodes is 60% and the probability of atractylodes is 40%, then manual judgment can be involved or continue to judge whether the image is another plant image.
  • the recognition result is that the probability of atractylodes is 60% and the probability of atractylodes is 40%, it is determined that the image is atractylodes image.
  • a piece of plant sample image is processed into blocks to obtain multiple plant sample images corresponding to multiple preset positions, thereby establishing training sample sets and test samples corresponding to different preset positions
  • the training sample set corresponding to each preset position is used to train the corresponding classification model, so that the recognition accuracy and recall rate of each classification model for the corresponding training sample set meet the corresponding preset conditions, and the final It can be used as a model for classifying plant images to be recognized.
  • the plant image to be recognized is received, the plant image to be recognized is divided into blocks according to the preset position and then input into the corresponding classification model, so as to determine the final plant image to be recognized according to the recognition result of each classification model The classification results.
  • the embodiments of this application help solve the problem of low efficiency caused by artificial recognition of plant species in the prior art, and separately train classification models corresponding to different preset positions, and integrate the recognition results of multiple classification models to determine the final
  • the classification result of the image to be recognized improves the accuracy and efficiency of recognition.
  • an embodiment of the present application provides a plant species identification device.
  • the device includes: a sample resolution processing module 41, a sample block processing module 42, and a sample Set building module 43, model training module 44, and image recognition module 45.
  • the sample resolution processing module 41 is configured to perform resolution preprocessing on the plant sample image to obtain a plant sample image of the first preset resolution
  • the sample block processing module 42 is configured to obtain corresponding multiple plant sample sub-images of the second preset resolution at multiple preset positions of the plant sample image of the first preset resolution.
  • the resolution is smaller than the first preset resolution, and the multiple preset positions are different.
  • One of the multiple preset positions is the center position of the plant sample image with the first preset resolution, and the other preset positions correspond to The plant sample sub-images of the second preset resolution do not overlap each other and can be combined into a complete plant sample image of the first preset resolution;
  • the sample set establishment module 43 is configured to use a plurality of plant sample sub-images of a second preset resolution corresponding to a plurality of preset positions to respectively establish a training sample set and a test sample set corresponding to the plurality of preset positions;
  • the model training module 44 is used to train multiple ResNet50 convolutional neural network models using training sample sets corresponding to multiple preset positions, until each trained model corresponding to multiple preset positions recognizes a corresponding test sample The recognition result of the set meets the preset training termination condition;
  • the image recognition module 45 is used to receive the plant image to be recognized, and use the trained model to recognize the type of the plant image to be recognized.
  • the sample resolution processing module 41 specifically includes: a sample down-sampling unit 411 and a sample up-sampling unit 412.
  • the sample down-sampling unit 411 is configured to perform down-sampling processing on the plant sample image if the resolution of the plant sample image is greater than the first preset resolution to obtain a plant sample image of the first preset resolution;
  • the sample up-sampling unit 412 is configured to perform an up-sampling process on the plant sample image if the resolution of the plant sample image is less than the first preset resolution to obtain a plant sample image of the first preset resolution.
  • the device further includes: an RGB value normalization module 46.
  • the RGB value normalization module 46 is configured to obtain corresponding multiple plant sample sub-images of the second preset resolution at multiple preset positions of the plant sample image of the first preset resolution, and then according to the RGB value
  • the normalization processing formula is to normalize the RGB value of each pixel of a plurality of plant sample sub-images with a second preset resolution.
  • the RGB value normalization processing formula is:
  • N is the maximum component value of the RGB channel
  • x and y are the R, G, and B of any pixel corresponding to the original and normalized second preset resolution plant sample sub-image.
  • the sample set establishment module 43 is specifically configured to use the plurality of plant sample sub-images of the second preset resolution corresponding to the plurality of preset positions after the normalization of the RGB values to establish the respective sub-images corresponding to the plurality of preset positions Training sample set and test sample set.
  • the image recognition module 45 specifically includes: an image resolution processing unit 451, an image block unit 452, an image RGB value normalization unit 453, an image recognition unit 454, and a recognition result Calculating unit 455.
  • the image resolution processing unit 451 is configured to perform resolution preprocessing on the received plant image to be recognized, so that the resolution of the plant image to be recognized is consistent with the first preset resolution;
  • the image segmentation unit 452 is configured to obtain corresponding multiple plant images to be recognized at multiple preset positions of the processed plant images to be recognized, where any one of the multiple plant images to be recognized The resolution is consistent with the second preset resolution;
  • the image RGB value normalization unit 453 is configured to perform normalization processing on the RGB value of each pixel of the plant sub-image to be identified corresponding to a plurality of preset positions according to the RGB value normalization processing formula;
  • the image recognition unit 454 is configured to input the sub-images of plants to be recognized corresponding to the multiple preset positions after the normalization of the RGB values into the corresponding trained model, and obtain the sub-images corresponding to the multiple preset positions. Multiple recognition results of the plant sub-images to be recognized;
  • the recognition result calculation unit 455 is configured to perform a weighted sum calculation on the multiple recognition results according to the preset weights corresponding to the multiple preset positions to obtain the recognition result of the image to be recognized.
  • the preset weights corresponding to the plant sub-images are greater than the preset weights corresponding to the plant sub-images to be identified at other locations.
  • the model training module 44 specifically includes: a first model training unit 441 and a second model training unit 442.
  • the first model training unit 441 is configured to use training sample sets corresponding to multiple preset positions to train the corresponding model according to the preset learning rate;
  • the second model training unit 442 is configured to reduce the preset learning rate if the accuracy of the trained model to identify the corresponding test sample set is less than the preset accuracy rate and/or the recall rate is less than the preset recall rate, and according to the reduced Continue to train the model until the accuracy rate of the trained model identifying the corresponding test sample set is greater than or equal to the preset accuracy rate and the recall rate is greater than or equal to the preset recall rate.
  • the network structure of the model includes 50 layers of convolutional layers and 1 layer of fully connected layers that are sequentially connected, where the 50 layers of convolutional layers are divided into 5 blocks, and the 5 blocks are respectively denoted as conv1, conv2_x, conv3_x, conv4_x, conv5_x, conv1 includes a convolutional layer with a 7 ⁇ 7 convolution kernel, conv2_x includes a convolutional layer with a 3 ⁇ 3 convolution kernel and 3 bottleneck building blocks; conv3_x includes 4 bottleneck constructions Block; conv4_x includes 6 bottleneck building blocks; conv5_x includes 3 bottleneck building blocks, and each bottleneck building block includes 3 convolutional layers with a 3 ⁇ 3 convolution kernel.
  • an embodiment of the present application also provides a computer non-volatile readable storage medium, on which computer readable instructions are stored, and the computer readable instructions are processed
  • the following steps are implemented when the device is executed: the resolution preprocessing of the plant sample image is performed to obtain the plant sample image of the first preset resolution; the corresponding plant sample images of the first preset resolution are obtained at multiple preset positions.
  • a plurality of plant sample sub-images of a second preset resolution wherein the second preset resolution is less than the first preset resolution, the plurality of preset positions are different, and one of the plurality of preset positions is the first At the center position of a plant sample image of a preset resolution, the plant sample sub-images of the second preset resolution corresponding to other preset positions do not overlap each other and can be combined into a complete plant sample image of the first preset resolution ;
  • the corresponding training sample set trains multiple ResNet50 convolutional neural network models, until the recognition result of the test sample set corresponding to the model identification corresponding to multiple preset positions meets the preset training termination condition; receive the to-be-identified Plant images, and use the trained model to recognize the
  • the technical solution of this application can be embodied in the form of a software product.
  • the software product can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.), including several
  • the instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute the methods described in each implementation scenario of this application.
  • the computer device includes: a processor 51, The memory 52 and computer-readable instructions stored on the memory 52 and capable of running on the processor, wherein the memory 52 and the processor 51 are both set on the bus 53 and the processor 51 implements the following steps when the processor 51 executes the program: Resolution preprocessing to obtain a plant sample image of a first preset resolution; obtain a plurality of corresponding plant samples of a second preset resolution at a plurality of preset positions of the plant sample image of the first preset resolution A sub-image, wherein the second preset resolution is smaller than the first preset resolution, the multiple preset positions are different, and one of the multiple preset positions is the center position of the plant sample image with the first preset resolution Where, the plant sample sub-images of the second preset resolution corresponding to other preset positions do not overlap each other and can be combined
  • the computer device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, and so on.
  • the user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, and the like.
  • the network interface can optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.
  • the memory may also include an operating system and a network communication module.
  • the operating system is a program that manages the hardware and software resources of computer equipment, and supports the operation of information processing programs and other software and/or programs.
  • the network communication module is used to realize the communication between the various components in the memory and the communication with other hardware and software in the physical device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Business, Economics & Management (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Animal Husbandry (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Agronomy & Crop Science (AREA)
  • Evolutionary Biology (AREA)
  • Marine Sciences & Fisheries (AREA)
  • Mining & Mineral Resources (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Economics (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Image Analysis (AREA)

Abstract

本申请公开了一种植物种类的识别方法及装置,该方法包括:对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;在第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像;利用与多个预设位置对应的多个第二预设分辨率的植物样本子图像,分别建立与多个预设位置对应的训练样本集和测试样本集;分别利用与多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与多个预设位置对应的模型识别对应的测试样本集的识别结果满足预设训练终止条件;接收待识别的植物图像,并利用训练好的模型对待识别的植物图像的种类进行识别。

Description

植物种类的识别方法及装置
本申请要求与2019年3月12日提交中国专利局、申请号为201910185074.X、申请名称为“植物种类的识别方法及装置、存储介质、计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及植物种类的识别技术领域,尤其是涉及到一种植物种类的识别方法及装置。
背景技术
如何识别植物种类是广大种植者的需求,在种植过程中,种植者需要去除其他种类植株,只在种植区域内保留所需种类植株。比如在苍术的种植过程中,经常会混入与苍术同属菊科苍术属的白术,两种植物的药效不同,但是外形十分相似,在苍术的种植过程中,需要去除白术和其他植株,防止白术或其他植株混入苍术中影响苍术药效。
在现有技术中,需要经验丰富的人仔细观察进行区分,从而保留苍术。但因为苍术是一种高需求量的药材,人工分类速度较慢并且对人员经验要求较高,经验不足的工作人员对苍术和白术的识别准确率很难保证,影响种植的苍术品质。
发明内容
有鉴于此,本申请提供了一种植物种类的识别方法及装置,有助于提高植物种类的识别准确率。
根据本申请的一个方面,提供了一种植物种类的识别方法,包括:
对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;
在所述第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,所述第二预设分辨率小于所述第一预设分辨率,所述多个预设位置各不相同,所述多个预设位置中的一个为所述第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的所述第二预设分辨率的植物样本子图像互不重叠且可组合成完整的所述第一预设分辨率的植物样本图像;
利用与所述多个预设位置对应的多个所述第二预设分辨率的植物样本子图像,分别建立与所述多个预设位置对应的所述训练样本集和所述测试样本集;
分别利用与所述多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与所述多个预设位置对应的模型识别对应的所述测试样本集的识别结果满足预设训练终止条件;
接收待识别的植物图像,并利用训练好的所述模型对所述待识别的植物图像的种类进行识别。
根据本申请的另一方面,提供了一种植物种类的识别装置,其特征在于,包括:
样本分辨率处理模块,用于对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;
样本分块处理模块,用于在所述第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,所述第二预设分辨率小于所述第一预设分辨率,所述多个预设位置各不相同,所述多个预设位置中的一个为所述第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的所述第二预设分辨率的植物样本子图像互不重叠且可组合成完整的所述第一预设分辨率的植物样本图像;
样本集建立模块,用于利用与所述多个预设位置对应的多个所述第二预设分辨率的植物样本子图像,分别建立与所述多个预设位置对应的所述训练样本集和所述测试样本集;
模型训练模块,用于分别利用与所述多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与所述多个预设位置对应的模型识别对应的所述测试样本集的识别结果满足预设训练终止条件;
图像识别模块,用于接收待识别的植物图像,并利用训练好的所述模型对所述待识别的植物图像的种类进行识别。
依据本申请又一个方面,提供了一种计算机非易失性可读存储介质,其上存储有计算机可读指令,所述程序被处理器执行时实现以下步骤:
对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;
在所述第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,所述第二预设分辨率小于所述第一预设分辨率,所述多个预设位置各不相同,所述多个预设位置中的一个为所述第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的所述第二预设分辨率的植物样本子图像互不重叠且可组合成完整的所述第一预设分辨率的植物样本图像;
利用与所述多个预设位置对应的多个所述第二预设分辨率的植物样本子图像,分别建立与所述多个预设位置对应的所述训练样本集和所述测试样本集;
分别利用与所述多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与所述多个预设位置对应的模型识别对应的所述测试样本集的识别结果满足预设训练终止条件;
接收待识别的植物图像,并利用训练好的所述模型对所述待识别的植物图像的种类进行识别。
依据本申请再一个方面,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;
在所述第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,所述第二预设分辨率小于所述第一预设分辨率,所述多个预设位置各不相同,所述多个预设位置中的一个为所述第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的所述第二预设分辨率的植物样本子图像互不重叠且可组合成完整的所述第一预设分辨率的植物样本图像;
利用与所述多个预设位置对应的多个所述第二预设分辨率的植物样本子图像,分别建立与所述多个预设位置对应的所述训练样本集和所述测试样本集;
分别利用与所述多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与所述多个预设位置对应的模型识别对应的所述测试样本集的识别结果满足预设训练终止条件;
接收待识别的植物图像,并利用训练好的所述模型对所述待识别的植物图像的种类进行识别。
借由上述技术方案,本申请提供的一种植物种类的识别方法及装置,通过对植物样本图像的分辨率进行处理,并按照预设位置对植物样本图像进行分块处理后,建立与每个预设位置对应的训练样本集以及测试样本集,从而利用与每个预设位置对应的训练样本集对相应的ResNet50模型进行训练,使得训练后的模型对相应位置的测试样本集的识别效果达到预设训练终止条件后,实现了通过训练后的模型对新的待识别的植物图像的分类。本申请与现有技术中依靠有经验的技术人员对植物进行人工分类相比,只需拍摄待识别植物的图像,即可通过模型对植物的种类进行识别,提高了植物种类的识别效率,节约了人力成本,并且采用ResNet50结构的深度卷积神经网络模型对于复杂图像的识别也具有较高的准确性。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1示出了本申请实施例提供的一种植物种类的识别方法的流程示意图;
图2示出了本申请实施例提供的另一种植物种类的识别方法的流程示意图;
图3示出了本申请一个具体实施例提供的一种植物样本图像的分块示意图;
图4示出了本申请实施例提供的一种植物种类的识别装置的结构示意图;
图5示出了本申请实施例提供的另一种植物种类的识别装置的结构示意图;
图6示出了本申请实施例提供的一种计算机设备的实体结构示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
在本实施例中提供了一种植物种类的识别方法,如图1所示,该方法包括:
步骤101,对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像。
本申请的实施例以区分苍术图像和白术图像为例进行解释,本申请的实施例仅作为举例说明,本领域技术人员可以将苍术图像、白术图像替换为其他的一种或多种植物图像,在此不做限定。
在上述实施例中,植物样本图像可以包括苍术样本图像和白术样本图像,得到植物样本图像后,为了方便利用样本图像训练分类模型,提高训练效率,需要对样本图像的分辨率进行归一化,将样本图像的大小统一化,具体可以将全部的植物样本图像处理为第一预设分辨率的图像。
步骤102,在第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,第二预设分辨率小于第一预设分辨率,多个预 设位置各不相同,多个预设位置中的一个为第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的第二预设分辨率的植物样本子图像互不重叠且可组合成完整的第一预设分辨率的植物样本图像。
由于拍摄植物样本图像时,通常是将拍摄焦点对准植物的中心点处进行拍摄,因而拍摄得到的样本图像的不同位置对应的图像信息可能有较大差别,比如图像的底部可能包含较多植物的根部图像,图像的顶部可能包含较多植物的叶子图像,而植物的根部特征与植物的叶子特征的差别较大,因此为了得到更准确的分类结果,本实施例对植株的不同部位进行更具体的建模分析,将植物样本图像的分辨率处理为第一预设分辨率后,按照预设位置对图像进行分块处理,每一张植物样本图像按照多个预设位置进行分块处理后,一张完整的植物样本图像可以分成多个植物样本图像块,其中,每个预设位置对应一个图像块。并且为了保留完整的图像特征,分块处理后得到的图像块能够完整覆盖原有的第一预设分辨率的植物样本图像。
步骤103,利用与多个预设位置对应的多个第二预设分辨率的植物样本子图像,分别建立与多个预设位置对应的训练样本集和测试样本集。
对每张植物样本图像进行分块处理后,利用与每个预设位置对应的图像块建立与该预设位置对应的训练样本集以及测试样本集。例如,在样本图像中预设5个位置,分别标为位置1、位置2、位置3、位置4、位置5,将植物样本图像分块处理后分别得到5个位置对应的图像块,分别利用位置1、2、3、4、5对应的图像块建立位置1、2、3、4、5的训练样本集和位置1、2、3、4、5的测试样本集,一般来说训练样本集中的图像数量大于测试样本集的图像数量,本实施例中可以将训练样本集中的图像数量预设为2000张,测试样本集中的图像数量预设为300张,在本实施例中,训练样本集以及测试样本集都包含有对应预设位置的苍术样本图像块和白术样本图像块。
步骤104,分别利用与多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与多个预设位置对应的模型识别对应的测试样本集的识别结果满足预设训练终止条件。
为了对每个特定的预设位置的图像进行准确识别,分别建立与每个预设位置对应的ResNet50卷积神经网络模型,并利用与每个预设位置对应的训练样本集训练对应预设位置的模型。例如,利用与位置1对应的训练样本集对位置1的模型进行训练。
利用测试样本集对模型进行测试,以验证模型对测试样本集中的样本图像的分类效果,如果经过一次训练后模型的分类效果没有达到预设训练终止条件,则调整模型的相关训练参数后,继续利用测试样本集对模型进行训练,直至满足预设训练终止条件为止。
步骤105,接收待识别的植物图像,并利用训练好的模型对待识别的植物图像的种类进行识别。
模型训练成功后,就可以利用训练好的模型对待识别的植物图像进行分类,具体可以按照预设位置获取待识别的植物图像的多个图像块后,通过相应的训练好的模型对待识别的植物图像对应的植物种类进行识别。本申请的实施例中,向模型输入待识别的植物图像后,可以得出该图像为苍术图像的概率和该图像为白术图像的概率。
通过应用本实施例的技术方案,通过对植物样本图像的分辨率进行处理,并按照预设位置对植物样本图像进行分块处理后,建立与每个预设位置对应的训练样本集以及测试样本集,从而利用与每个预设位置对应的训练样本集对相应的ResNet50模型进行训练,使得训练后的模型对相应位置的测试样本集的识别效果达到预设训练终止条件后,实现了通过训练后的模型对新的待识别的植物图像的分类。本申请与现有技术中依靠有经验的技术人 员对植物进行人工分类相比,只需拍摄待识别植物的图像,即可通过模型对植物的种类进行识别,提高了植物种类的识别效率,节约了人力成本。
进一步的,作为上述实施例具体实施方式的细化和扩展,为了完整说明本实施例的具体实施过程,提供了另一种植物种类的识别方法,如图2所示,该方法包括:
步骤201,若植物样本图像的分辨率大于第一预设分辨率,则对植物样本图像进行降采样处理,得到第一预设分辨率的植物样本图像。
本申请实施例采用的ResNet50卷积神经网络模型需要输入分辨率为720×540的图像进行训练,因此对于的预设分辨率为720×540,保证图像的清晰度,以便可以对植物样本图像进行进一步的处理,本申请实施例中,将第一预设分辨率设置为1440×1080。
若植物样本图像的分辨率大于第一预设分辨率,应对图像进行降采样处理使其下降到第一预设分辨率,使全部的植物样本图像的分辨率得到统一,方便后续的图像分块处理等操作以及建立训练样本集和测试样本集。
在本实施例中,具体地,ResNet50模型包括依次连接的50层卷积层和1层全连接层,其中,50层卷积层分为5个块,5个块分别表示为conv1,conv2_x,conv3_x,conv4_x,conv5_x,conv1包括一个卷积核为7×7的卷积层,conv2_x包括一个卷积核为3×3的卷积层和3个瓶颈构建块;conv3_x包括4个瓶颈构建块;conv4_x包括6个瓶颈构建块;conv5_x包括3个瓶颈构建块,每个瓶颈构建快包括3层卷积核为3×3的卷积层。
ResNet50是一种深度卷积神经网络结构,该网络结构采用残差连接的方式,增加网络结构的深度的同时提高了识别准确性。采用该网络结构可以实现对复杂图像的准确分类。具体包括50层卷积层和1层全连接层(或叫做上采样层),具体地,conv1由一个单一的卷积核为7×7的全卷积层组成;conv2_x由一个3×3卷积核的卷积层和3个瓶颈构建块共计10层组成(每个瓶颈构建块分别包含一层卷积核为1×1、通道数为64的卷积层、一层卷积核为3×3、通道数为64的卷积层、以及一层卷积核为1×1、通道数为256的卷积层);conv3_x由4个瓶颈构建块共计12层组成(每个瓶颈构建块分别包含一层卷积核为1×1、通道数为128的卷积层、一层卷积核为3×3、通道数为128的卷积层、以及一层卷积核为1×1、通道数为512的卷积层);conv4_x由6个瓶颈构建块共计18层组成(每个瓶颈构建块分别包含一层卷积核为1×1、通道数为256的卷积层、一层卷积核为3×3、通道数为256的卷积层、以及一层卷积核为1×1、通道数为1024的卷积层);conv5_x由3个瓶颈构建块共计9层组成(每个瓶颈构建块分别包含一层卷积核为1×1、通道数为512的卷积层、一层卷积核为3×3、通道数为512的卷积层、以及一层卷积核为1×1、通道数为2048的卷积层);本申请实施例中最后经过一个2维的全连接层得到对于2种分类类别(苍术和白术)的预测结果。当然,本领域技术人员可以根据实际需要根据植物样本图像中包含的植物类别的数量调整类别数量,在此仅作为举例说明。
步骤202,若植物样本图像的分辨率小于第一预设分辨率,则对植物样本图像进行升采样处理,得到第一预设分辨率的植物样本图像。
如果植物样本图像的分辨率小于第一预设分辨率,也应将该图像的分辨率调整为第一预设分辨率大小,具体可以采用升采样处理方式,对原有的图像进行双线性插值上采样至第一预设分辨率。
需要说明的是,对图像进行升采样处理可能会对图像的性能造成一定程度的损失,因此,优选分辨率大于或等于的第一预设分辨率的图像作为样本图像。
步骤203,在第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,第二预设分辨率小于第一预设分辨率,多个预 设位置各不相同,多个预设位置中的一个为第一预设分辨率的植物样本图像的的中心位置处,其他的第二预设分辨率的植物样本子图像互不重叠。
本申请的实施例将植物样本图像进行分块处理,根据每张第一预设分辨率的植物样本图像得到与多个预设位置对应的多张分辨率为720×540的植物样本子图像,其中,多个预设位置包括植物样本图像的中心位置,中心位置对应的植物样本图像可以与其他位置对应的植物样本图像有重叠的部分,但是其他位置对应的植物样本图像互相不重叠而且其他位置对应的植物样本子图像应包括整个植物样本图像,以便根据分块后的植物样本图像建立训练样本集和测试样本集,以便将图像中的每个像素点都作为训练的样本,以免损失图像的特征信息,并且由于图像的中心位置处通常是区分植物种类的关键特征信息较为集中的部分,将中心位置处的图像单独提取出来从而进行训练,有助于提升模型的识别准确性。
例如,根据1440×1080分辨率的植物样本图像得到5个720×540分辨率的植物样本图像块。具体分块方式如图3所示,其中分块1的中心与1440×1080分辨率的植物样本图像的中心重合,分块2的左上角的像素点与1440×1080分辨率的植物样本图像的最上角的像素点重合,相似的得到分块3、4、5。
步骤204,按照RGB值归一化处理公式,将多个第二预设分别率的植物样本子图像的每个像素点的RGB值进行归一化处理,RGB值归一化处理公式为:
Figure PCTCN2019097891-appb-000001
其中,N为RGB通道的最大分量值,x和y分别为原有的和归一化处理后的第二预设分辨率的植物样本子图像对应的任一像素点的R、G、B任一通道的分量值。
在建立训练样本集和测试样本集之前,还需要利用上述RGB值归一化处理公式对分块后得到的植物样本图像进行RGB值归一化处理,使样本图像的每个像素点在R、G、B三通道上的分量值由原来的[0,255]变换到[-1,1]之间,使数据分布更加均匀,从而有助于加速模型的训练过程。其中,N取255。
步骤205,利用RGB值归一化处理后的与多个预设位置对应的多个第二预设分辨率的植物样本子图像,分别建立与多个预设位置对应的训练样本集和测试样本集。
植物样本图像经过RGB值归一化处理处理后,根据与每个预设位置对应的720×540分辨率的植物样本图像建立相应的训练样本集以及测试样本集。在本申请的实施例中,分别建立5个与预设位置对应的训练样本集和5个对应的测试样本集,每个训练样本集中包括2000张不同样本的相同位置的图像,每个测试样本集中包括300张与训练样本集不同的样本的相同位置的图像。
步骤206,分别利用与多个预设位置对应的训练样本集,按照预设学习率训练对应的模型。
按照预先设定的学习率对模型利用训练样本集对模型进行训练,例如按照0.01的学习率利用位置1对应的训练样本集训练位置1对应的模型。其中,对于不同位置对应的模型可以设置不同的学习率也可以设置相同的学习率,在此不做限定。
步骤207,若训练后的模型识别对应的测试样本集的准确率小于预设准确率和/或召回率小于预设召回率,则降低预设学习率,并按照降低后的预设学习率继续训练模型直至训练后的模型识别对应的测试样本集的准确率大于或等于预设准确率且召回率大于或等于预设召回率为止。
按照预设学习率对模型进行训练后,利用训练好的模型对相应的测试样本集进行测试,如果模型的识别准确率和召回率分别大于或等于预设的准确率和召回率,则该模型完 成训练,可以进一步利用该模型对待识别的植物图像进行分类,而如果模型的识别准确率小于预设准确率以及召回率小于预设召回率中满足任何一个,则需要继续对模型进行训练,具体应用比原来的预设学习率更低的学习率进行训练,从而提高模型的识别准确率和召回率直至分别达到对应的预设为止。
例如,假设预设学习率为0.01,预设准确率和召回率都为90%,先使用0.01的学习率训练模型3000遍,每遍包含训练样本集中随机抽取的30张植物样本图像,如果训练后的模型识别准确率和/或召回率小于90%,则再使用0.001的学习率训练模型1000遍,每遍包含训练样本集中随机抽取的30张植物样本图像,再测试训练后的模型的识别准确率和召回率,如果仍然不满足预设条件,可以再次降低学习率继续学习。
另外,需要说明的是,与每个预设位置对应的模型可以采用相同的初始学习率,也可以分别设置不同的初始学习率,每个模型对应的预设准确率和召回率可以相同也可以不同,例如中心位置对应的准确率和召回率设置为95%,其他位置对应的准确率和召回率设置为90%。分别测试每个模型的分类准确率和召回率,直到训练后的每个模型的分类准确率和召回率都达到对应的预设为止。
步骤208,对接收到的待识别的植物图像进行分辨率预处理,以使待识别的植物图像的分辨率与第一预设分辨率一致;
步骤209,在处理后的待识别的植物图像的多个预设位置处分别获取对应的多个待识别的植物子图像,其中,多个待识别的植物图像中的任一个的分辨率与第二预设分辨率一致;
步骤210,按照RGB值归一化处理公式,分别对与多个预设位置对应的待识别的植物子图像的每个像素点的RGB值进行归一化处理;
步骤211,分别将RGB值归一化处理后的与多个预设位置对应的待识别的植物子图像输入至对应的训练好的模型中,得到分别与多个预设位置对应的待识别的植物子图像的多个识别结果。
在上述步骤208至步骤211中,模型训练完成后,可以实现对待识别的植物图像的分类。具体地,接收到待识别的植物图像后,与植物样本图像的处理过程相似,先将图像的分辨率处理为第一预设分辨率,然后按照多个预设位置对图像进行分块处理,得到与每个预设位置对应的待识别植物图像,再对每张待识别的植物图像的每个像素点的RGB值进行归一化处理,最后分别将每个预设位置对应的待识别图像输入至对应的模型中得到与每个预设位置对应的识别结果。
例如,将与5个预设位置的对应的待识别图像分别输入至对应的模型中,分别得到与5个预设位置对应的待识别图像的识别结果。
步骤212,按照与多个预设位置对应的预设权重,对多个识别结果进行加权求和计算,得到待识别的图像的识别结果,其中,中心位置处的待识别的植物子图像对应的预设权重大于其他位置处的待识别的植物子图像对应的预设权重。
分别得到与每个预设位置对应的识别结果后,按照相应的预设权重将识别结果进行加权求和计算得到待识别的图像的最终识别结果。其中,中心位置处可能包含的关键特征信息较多,应作为确定最终识别结果的主要参考因素,因此其对应的权重应高于其他位置处对应的权重,从而得到更准确的识别结果。
例如,5个预设位置中中心位置处对应的权重设为0.4,其余4个位置对应的权重分别设为0.15,假设中心位置处的识别结果为中心位置对应的图像为苍术的概率是80%,白术概率是10%,其余4个位置的识别结果为对应的图像为苍术的概率分别为40%、90%、80%、 80%;为白术的概率分别为80%、20%、30%、20%。那么该待识别的植物图像为苍术的概率为80%*0.4+40%*0.15+90%*0.15+80%*0.15+80%*0.15=75.5%,该图像为白术的概率为10%*0.4+80%*0.15+20%*0.15+30%*0.15+20%*0.15=26.5%。那么可以根据苍术概率75.5%和白术概率26.5%确定待识别的植物图像的种类。
具体地,可以设置规定为:若识别结果为第一种类植物的概率大于或等于第一预设概率且第二种类植物的概率小于第二预设概率,则确定待识别的植物图像对应的植物种类为第一种类植物。例如第一预设概率为70%,第二预设概率为30%,那么可以判定上述的待识别的植物图像对应的种类为苍术。而如果识别结果为苍术概率60%,白术概率40%,则可以介入人工判断或继续判断该图像是否为其他植物图像。
另外,也可以比较两种植物识别结果的植物种类对应的概率大小,将概率大的植物种类确定为待识别的植物图像的种类。例如识别结果为苍术概率60%,白术概率40%,则判定该图像为苍术图像。
通过应用本实施例的技术方案,将一张植物样本图像进行分块处理得到与多个预设位置对应的多块植物样本图像,从而建立与不同的预设位置对应的训练样本集和测试样本集,进而分别利用与每个预设位置对应的训练样本集训练相应的分类模型,使每个分类模型对相应的训练样本集的识别准确率和召回率都满足对应的预设条件,得到最终可以用于对待识别的植物图像进行分类的模型。当接收到待识别的植物图像时,将待识别的植物图像按照预设位置分块处理后,分别输入至对应的分类模型中,从而根据每个分类模型的识别结果确定最终的待识别植物图像的分类结果。本申请的实施例有助于解决现有技术中依靠人工进行植物种类识别导致的效率低下的问题,并且分别训练与不同预设位置对应的分类模型,综合多个分类模型的识别结果确定最终的待识别图像的分类结果,提高了识别的准确性和识别效率。
进一步的,作为图1方法的具体实现,本申请实施例提供了一种植物种类的识别装置,如图4所示,该装置包括:样本分辨率处理模块41、样本分块处理模块42、样本集建立模块43、模型训练模块44、图像识别模块45。
样本分辨率处理模块41,用于对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;
样本分块处理模块42,用于在第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,第二预设分辨率小于第一预设分辨率,多个预设位置各不相同,多个预设位置中的一个为第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的第二预设分辨率的植物样本子图像互不重叠且可组合成完整的第一预设分辨率的植物样本图像;
样本集建立模块43,用于利用与多个预设位置对应的多个第二预设分辨率的植物样本子图像,分别建立与多个预设位置对应的训练样本集和测试样本集;
模型训练模块44,用于分别利用与多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与多个预设位置对应的模型识别对应的测试样本集的识别结果满足预设训练终止条件;
图像识别模块45,用于接收待识别的植物图像,并利用训练好的模型对待识别的植物图像的种类进行识别。
在具体的应用场景中,如图5所示,样本分辨率处理模块41,具体包括:样本降采样单元411、样本升采样单元412。
样本降采样单元411,用于若植物样本图像的分辨率大于第一预设分辨率,则对植物样本图像进行降采样处理,得到第一预设分辨率的植物样本图像;
样本升采样单元412,用于若植物样本图像的分辨率小于第一预设分辨率,则对植物样本图像进行升采样处理,得到第一预设分辨率的植物样本图像。
在具体的应用场景中,如图5所示,该装置还包括:RGB值归一化模块46。
RGB值归一化模块46,用于在第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像之后,按照RGB值归一化处理公式,将多个第二预设分别率的植物样本子图像的每个像素点的RGB值进行归一化处理,RGB值归一化处理公式为:
Figure PCTCN2019097891-appb-000002
其中,N为RGB通道的最大分量值,x和y分别为原有的和归一化处理后的第二预设分辨率的植物样本子图像对应的任一像素点的R、G、B任一通道的分量值;
样本集建立模块43,具体用于利用RGB值归一化处理后的与多个预设位置对应的多个第二预设分辨率的植物样本子图像,分别建立与多个预设位置对应的训练样本集和测试样本集。
在具体的应用场景中,如图5所示,图像识别模块45,具体包括:图像分辨率处理单元451、图像分块单元452、图像RGB值归一化单元453、图像识别单元454、识别结果计算单元455。
图像分辨率处理单元451,用于对接收到的待识别的植物图像进行分辨率预处理,以使待识别的植物图像的分辨率与第一预设分辨率一致;
图像分块单元452,用于在处理后的待识别的植物图像的多个预设位置处分别获取对应的多个待识别的植物图像,其中,多个待识别的植物图像中的任一个的分辨率与第二预设分辨率一致;
图像RGB值归一化单元453,用于按照RGB值归一化处理公式,分别对与多个预设位置对应的待识别的植物子图像的每个像素点的RGB值进行归一化处理;
图像识别单元454,用于分别将RGB值归一化处理后的与多个预设位置对应的待识别的植物子图像输入至对应的训练好的模型中,得到分别与多个预设位置对应的待识别的植物子图像的多个识别结果;
识别结果计算单元455,用于按照与多个预设位置对应的预设权重,对多个识别结果进行加权求和计算,得到待识别的图像的识别结果,其中,中心位置处的待识别的植物子图像对应的预设权重大于其他位置处的待识别的植物子图像对应的预设权重。
在具体的应用场景中,如图5所示,模型训练模块44,具体包括:第一模型训练单元441、第二模型训练单元442。
第一模型训练单元441,用于分别利用与多个预设位置对应的训练样本集,按照预设学习率训练对应的模型;
第二模型训练单元442,用于若训练后的模型识别对应的测试样本集的准确率小于预设准确率和/或召回率小于预设召回率,则降低预设学习率,并按照降低后的预设学习率继续训练模型直至训练后的模型识别对应的测试样本集的准确率大于或等于预设准确率且召回率大于或等于预设召回率为止。
在上述实施例中,具体地,模型的网络结构包括依次连接的50层卷积层和1层全连接层,其中,50层卷积层分为5个块,5个块分别表示为conv1,conv2_x,conv3_x,conv4_x,conv5_x,conv1包括一个卷积核为7×7的卷积层,conv2_x包括一个卷积核为3×3的卷积层和3个瓶颈构建块;conv3_x包括4个瓶颈构建块;conv4_x包括6个瓶颈构建块;conv5_x包括3个瓶颈构建块,每个瓶颈构建快包括3层卷积核为3×3的卷积层。
需要说明的是,本申请实施例提供的一种植物种类的识别装置所涉及各功能单元的其他相应描述,可以参考图1和图2中的对应描述,在此不再赘述。
基于上述如图1和图2所示方法,相应的,本申请实施例还提供了一种计算机非易失性可读存储介质,其上存储有计算机可读指令,该计算机可读指令被处理器执行时实现以下步骤:对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;在第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,第二预设分辨率小于第一预设分辨率,多个预设位置各不相同,多个预设位置中的一个为第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的第二预设分辨率的植物样本子图像互不重叠且可组合成完整的第一预设分辨率的植物样本图像;利用与多个预设位置对应的多个第二预设分辨率的植物样本子图像,分别建立与多个预设位置对应的训练样本集和测试样本集;分别利用与多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与多个预设位置对应的模型识别对应的测试样本集的识别结果满足预设训练终止条件;接收待识别的植物图像,并利用训练好的模型对待识别的植物图像的种类进行识别。
基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施场景所述的方法。
基于上述如图1所示方法和如图4所示装置的实施例,本申请实施例还提供了一种计算机设备的实体结构图,如图6所示,该计算机设备包括:处理器51、存储器52、及存储在存储器52上并可在处理器上运行的计算机可读指令,其中存储器52和处理器51均设置在总线53上处理器51执行程序时实现以下步骤:对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;在第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,第二预设分辨率小于第一预设分辨率,多个预设位置各不相同,多个预设位置中的一个为第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的第二预设分辨率的植物样本子图像互不重叠且可组合成完整的第一预设分辨率的植物样本图像;利用与多个预设位置对应的多个第二 预设分辨率的植物样本子图像,分别建立与多个预设位置对应的训练样本集和测试样本集;分别利用与多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与多个预设位置对应的模型识别对应的测试样本集的识别结果满足预设训练终止条件;接收待识别的植物图像,并利用训练好的模型对待识别的植物图像的种类进行识别。该计算机设备还包括:总线53,被配置为耦接处理器51及存储器52。
可选地,该计算机设备还可以包括用户接口、网络接口、摄像头、射频(Radio Frequency,RF)电路,传感器、音频电路、WI-FI模块等等。用户接口可以包括显示屏(Display)、输入单元比如键盘(Keyboard)等,可选用户接口还可以包括USB接口、读卡器接口等。网络接口可选的可以包括标准的有线接口、无线接口(如蓝牙接口、WI-FI接口)等。
存储器中还可以包括操作系统、网络通信模块。操作系统是管理计算机设备硬件和软件资源的程序,支持信息处理程序以及其它软件和/或程序的运行。网络通信模块用于实现存储器内部各组件之间的通信,以及与该实体设备中其它硬件和软件之间通信。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本申请可以借助软件加必要的通用硬件平台的方式来实现,也可以通过硬件实现通过应用本实施例的技术方案。

Claims (20)

  1. 一种植物种类的识别方法,其特征在于,包括:
    对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;
    在所述第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,所述第二预设分辨率小于所述第一预设分辨率,所述多个预设位置各不相同,所述多个预设位置中的一个为所述第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的所述第二预设分辨率的植物样本子图像互不重叠且可组合成完整的所述第一预设分辨率的植物样本图像;
    利用与所述多个预设位置对应的多个所述第二预设分辨率的植物样本子图像,分别建立与所述多个预设位置对应的所述训练样本集和所述测试样本集;
    分别利用与所述多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与所述多个预设位置对应的模型识别对应的所述测试样本集的识别结果满足预设训练终止条件;
    接收待识别的植物图像,并利用训练好的所述模型对所述待识别的植物图像的种类进行识别。
  2. 根据权利要求1所述的方法,其特征在于,所述分别利用与所述多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与所述多个预设位置对应的模型识别对应的所述测试样本集的识别结果满足预设训练终止条件,具体包括:
    分别利用与所述多个预设位置对应的训练样本集,按照预设学习率训练对应的所述模型;
    若训练后的所述模型识别对应的所述测试样本集的准确率小于所述预设准确率和/或召回率小于所述预设召回率,则降低所述预设学习率,并按照降低后的预设学习率继续训练所述模型直至训练后的所述模型识别对应的所述测试样本集的准确率大于或等于所述预设准确率且召回率大于或等于所述预设召回率为止。
  3. 根据权利要求1所述的方法,其特征在于,所述模型的网络结构包括依次连接的50层卷积层和1层全连接层,其中,50层卷积层分为5个块,5个块分别表示为conv1,conv2_x,conv3_x,conv4_x,conv5_x,conv1包括一个卷积核为7×7的卷积层,conv2_x包括一个卷积核为3×3的卷积层和3个瓶颈构建块;conv3_x包括4个瓶颈构建块;conv4_x包括6个瓶颈构建块;conv5_x包括3个瓶颈构建块,每个瓶颈构建快包括3层卷积核为3×3的卷积层。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像,具体包括:
    若所述植物样本图像的分辨率大于所述第一预设分辨率,则对所述植物样本图像进行降采样处理,得到所述第一预设分辨率的植物样本图像;
    若所述植物样本图像的分辨率小于所述第一预设分辨率,则对所述植物样本图像进行升采样处理,得到所述第一预设分辨率的植物样本图像。
  5. 根据权利要求4所述的方法,其特征在于,所述在所述第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本图像之后,所述 方法还包括:
    按照RGB值归一化处理公式,将多个所述第二预设分别率的植物样本子图像的每个像素点的RGB值进行归一化处理,所述RGB值归一化处理公式为:
    Figure PCTCN2019097891-appb-100001
    其中,N为RGB通道的最大分量值,x和y分别为原有的和归一化处理后的所述第二预设分辨率的植物样本子图像对应的任一像素点的R、G、B任一通道的分量值;
    利用与所述多个预设位置对应的多个所述第二预设分辨率的植物样本子图像,分别建立与所述多个预设位置对应的所述训练样本集和所述测试样本集,具体包括:
    利用RGB值归一化处理后的与所述多个预设位置对应的多个所述第二预设分辨率的植物样本图像,分别建立与所述多个预设位置对应的所述训练样本集和所述测试样本集。
  6. 根据权利要求5所述的方法,其特征在于,所述接收待识别的植物图像,并利用所述训练好的模型对所述待识别的植物图像的种类进行识别,具体包括:
    对接收到的所述待识别的植物图像进行分辨率预处理,以使所述待识别的植物图像的分辨率与所述第一预设分辨率一致;
    在处理后的所述待识别的植物图像的所述多个预设位置处分别获取对应的多个待识别的植物子图像,其中,所述多个待识别的植物子图像中的任一个的分辨率与所述第二预设分辨率一致;
    按照所述RGB值归一化处理公式,分别对与所述多个预设位置对应的待识别的植物子图像的每个像素点的RGB值进行归一化处理;
    分别将RGB值归一化处理后的与所述多个预设位置对应的待识别的植物子图像输入至对应的所述训练好的模型中,得到分别与所述多个预设位置对应的待识别的植物子图像的多个识别结果;
    按照与所述多个预设位置对应的预设权重,对所述多个识别结果进行加权求和计算,得到所述待识别的图像的识别结果,其中,所述中心位置处的所述待识别的植物子图像对应的预设权重大于其他位置处的所述待识别的植物子图像对应的预设权重。
  7. 一种植物种类的识别装置,其特征在于,包括:
    样本分辨率处理模块,用于对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;
    样本分块处理模块,用于在所述第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,所述第二预设分辨率小于所述第一预设分辨率,所述多个预设位置各不相同,所述多个预设位置中的一个为所述第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的所述第二预设分辨率的植物样本子图像互不重叠且可组合成完整的所述第一预设分辨率的植物样本图像;
    样本集建立模块,用于利用与所述多个预设位置对应的多个所述第二预设分辨率的植物样本子图像,分别建立与所述多个预设位置对应的所述训练样本集和所述测试样本集;
    模型训练模块,用于分别利用与所述多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与所述多个预设位置对应的模型识别对应的所述测试样本集的识别结果满足预设训练终止条件;
    图像识别模块,用于接收待识别的植物图像,并利用训练好的所述模型对所述待识别 的植物图像的种类进行识别。
  8. 根据权利要求7所述的装置,其特征在于,所述模型训练模块具体包括:
    第一模型训练单元,用于分别利用与所述多个预设位置对应的训练样本集,按照预设学习率训练对应的所述模型;
    第二模型训练单元,用于若训练后的所述模型识别对应的所述测试样本集的准确率小于所述预设准确率和/或召回率小于所述预设召回率,则降低所述预设学习率,并按照降低后的预设学习率继续训练所述模型直至训练后的所述模型识别对应的所述测试样本集的准确率大于或等于所述预设准确率且召回率大于或等于所述预设召回率为止。
  9. 根据权利要求7所述的装置,其特征在于,所述模型的网络结构包括依次连接的50层卷积层和1层全连接层,其中,50层卷积层分为5个块,5个块分别表示为conv1,conv2_x,conv3_x,conv4_x,conv5_x,conv1包括一个卷积核为7×7的卷积层,conv2_x包括一个卷积核为3×3的卷积层和3个瓶颈构建块;conv3_x包括4个瓶颈构建块;conv4_x包括6个瓶颈构建块;conv5_x包括3个瓶颈构建块,每个瓶颈构建快包括3层卷积核为3×3的卷积层。
  10. 根据权利要求7至9中任一项所述的装置,其特征在于,所述样本分辨率处理模块,具体包括:
    样本降采样单元,用于若所述植物样本图像的分辨率大于所述第一预设分辨率,则对所述植物样本图像进行降采样处理,得到所述第一预设分辨率的植物样本图像;
    样本升采样单元,用于若所述植物样本图像的分辨率小于所述第一预设分辨率,则对所述植物样本图像进行升采样处理,得到所述第一预设分辨率的植物样本图像。
  11. 根据权利要求10所述的装置,其特征在于,还包括:
    RGB值归一化模块,用于在所述第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本图像之后,按照RGB值归一化处理公式,将多个所述第二预设分别率的植物样本子图像的每个像素点的RGB值进行归一化处理,所述RGB值归一化处理公式为:
    Figure PCTCN2019097891-appb-100002
    其中,N为RGB通道的最大分量值,x和y分别为原有的和归一化处理后的所述第二预设分辨率的植物样本子图像对应的任一像素点的R、G、B任一通道的分量值;
    所述样本集建立模块43,具体用于利用RGB值归一化处理后的与所述多个预设位置对应的多个所述第二预设分辨率的植物样本图像,分别建立与所述多个预设位置对应的所述训练样本集和所述测试样本集。
  12. 根据权利要求11所述的装置,其特征在于,所述图像识别模块,具体包括:
    图像分辨率处理单元,用于对接收到的所述待识别的植物图像进行分辨率预处理,以使所述待识别的植物图像的分辨率与所述第一预设分辨率一致;
    图像分块单元,用于在处理后的所述待识别的植物图像的所述多个预设位置处分别获取对应的多个待识别的植物子图像,其中,所述多个待识别的植物子图像中的任一个的分辨率与所述第二预设分辨率一致;
    图像RGB值归一化单元,用于按照所述RGB值归一化处理公式,分别对与所述多个预设位置对应的待识别的植物子图像的每个像素点的RGB值进行归一化处理;
    图像识别单元,用于分别将RGB值归一化处理后的与所述多个预设位置对应的待识别的植物子图像输入至对应的所述训练好的模型中,得到分别与所述多个预设位置对应的待识别的植物子图像的多个识别结果;
    识别结果计算单元,用于按照与所述多个预设位置对应的预设权重,对所述多个识别结果进行加权求和计算,得到所述待识别的图像的识别结果,其中,所述中心位置处的所述待识别的植物子图像对应的预设权重大于其他位置处的所述待识别的植物子图像对应的预设权重。
  13. 一种计算机非易失性可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现植物种类的识别方法,包括:
    对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;
    在所述第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,所述第二预设分辨率小于所述第一预设分辨率,所述多个预设位置各不相同,所述多个预设位置中的一个为所述第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的所述第二预设分辨率的植物样本子图像互不重叠且可组合成完整的所述第一预设分辨率的植物样本图像;
    利用与所述多个预设位置对应的多个所述第二预设分辨率的植物样本子图像,分别建立与所述多个预设位置对应的所述训练样本集和所述测试样本集;
    分别利用与所述多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与所述多个预设位置对应的模型识别对应的所述测试样本集的识别结果满足预设训练终止条件;
    接收待识别的植物图像,并利用训练好的所述模型对所述待识别的植物图像的种类进行识别。
  14. 根据权利要求13所述的计算机非易失性可读存储介质,其特征在于,所述计算机可读指令被处理器执行时实现所述分别利用与所述多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与所述多个预设位置对应的模型识别对应的所述测试样本集的识别结果满足预设训练终止条件,具体包括:
    分别利用与所述多个预设位置对应的训练样本集,按照预设学习率训练对应的所述模型;
    若训练后的所述模型识别对应的所述测试样本集的准确率小于所述预设准确率和/或召回率小于所述预设召回率,则降低所述预设学习率,并按照降低后的预设学习率继续训练所述模型直至训练后的所述模型识别对应的所述测试样本集的准确率大于或等于所述预设准确率且召回率大于或等于所述预设召回率为止。
  15. 根据权利要求13所述的计算机非易失性可读存储介质,其特征在于,所述计算机可读指令被处理器执行时实现所述执行所述模型的网络结构包括依次连接的50层卷积层和1层全连接层,其中,50层卷积层分为5个块,5个块分别表示为conv1,conv2_x,conv3_x,conv4_x,conv5_x,conv1包括一个卷积核为7×7的卷积层,conv2_x包括一个卷积核为3×3的卷积层和3个瓶颈构建块;conv3_x包括4个瓶颈构建块;conv4_x包括6个瓶颈构建块;conv5_x包括3个瓶颈构建块,每个瓶颈构建快包括3层卷积核为3×3的卷积层。
  16. 根据权利要求13至15中任一项所述的计算机非易失性可读存储介质,其特征在于,所述计算机可读指令被处理器执行时实现所述对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像,具体包括:
    若所述植物样本图像的分辨率大于所述第一预设分辨率,则对所述植物样本图像进行降采样处理,得到所述第一预设分辨率的植物样本图像;
    若所述植物样本图像的分辨率小于所述第一预设分辨率,则对所述植物样本图像进行升采样处理,得到所述第一预设分辨率的植物样本图像。
  17. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现植物种类的识别方法,包括:
    对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像;
    在所述第一预设分辨率的植物样本图像的多个预设位置处分别获取对应的多个第二预设分辨率的植物样本子图像,其中,所述第二预设分辨率小于所述第一预设分辨率,所述多个预设位置各不相同,所述多个预设位置中的一个为所述第一预设分辨率的植物样本图像的中心位置处,其他预设位置对应的所述第二预设分辨率的植物样本子图像互不重叠且可组合成完整的所述第一预设分辨率的植物样本图像;
    利用与所述多个预设位置对应的多个所述第二预设分辨率的植物样本子图像,分别建立与所述多个预设位置对应的所述训练样本集和所述测试样本集;
    分别利用与所述多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与所述多个预设位置对应的模型识别对应的所述测试样本集的识别结果满足预设训练终止条件;
    接收待识别的植物图像,并利用训练好的所述模型对所述待识别的植物图像的种类进行识别。
  18. 根据权利要求17所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时实现所述分别利用与所述多个预设位置对应的训练样本集训练多个ResNet50卷积神经网络模型,直至每个训练好的与所述多个预设位置对应的模型识别对应的所述测试样本集的识别结果满足预设训练终止条件,具体包括:
    分别利用与所述多个预设位置对应的训练样本集,按照预设学习率训练对应的所述模型;
    若训练后的所述模型识别对应的所述测试样本集的准确率小于所述预设准确率和/或召回率小于所述预设召回率,则降低所述预设学习率,并按照降低后的预设学习率继续训练所述模型直至训练后的所述模型识别对应的所述测试样本集的准确率大于或等于所述预设准确率且召回率大于或等于所述预设召回率为止。
  19. 根据权利要求17所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时实现所述执行所述模型的网络结构包括依次连接的50层卷积层和1层全连接层,其中,50层卷积层分为5个块,5个块分别表示为conv1,conv2_x,conv3_x,conv4_x,conv5_x,conv1包括一个卷积核为7×7的卷积层,conv2_x包括一个卷积核为3×3的卷积层和3个瓶颈构建块;conv3_x包括4个瓶颈构建块;conv4_x包括6个瓶颈构建块;conv5_x包括3个瓶颈构建块,每个瓶颈构建快包括3层卷积核为3×3的卷积层。
  20. 根据权利要求17至19中任一项所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时实现所述对植物样本图像进行分辨率预处理,得到第一预设分辨率的植物样本图像,具体包括:
    若所述植物样本图像的分辨率大于所述第一预设分辨率,则对所述植物样本图像进行降采样处理,得到所述第一预设分辨率的植物样本图像;
    若所述植物样本图像的分辨率小于所述第一预设分辨率,则对所述植物样本图像进行升采样处理,得到所述第一预设分辨率的植物样本图像。
PCT/CN2019/097891 2019-03-12 2019-07-26 植物种类的识别方法及装置 Ceased WO2020181706A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910185074.XA CN110059715A (zh) 2019-03-12 2019-03-12 植物种类的识别方法及装置、存储介质、计算机设备
CN201910185074.X 2019-03-12

Publications (1)

Publication Number Publication Date
WO2020181706A1 true WO2020181706A1 (zh) 2020-09-17

Family

ID=67316775

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/097891 Ceased WO2020181706A1 (zh) 2019-03-12 2019-07-26 植物种类的识别方法及装置

Country Status (2)

Country Link
CN (1) CN110059715A (zh)
WO (1) WO2020181706A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113807449A (zh) * 2021-09-23 2021-12-17 合肥工业大学 一种沉积岩类别识别方法、装置、电子设备和存储介质
WO2024131589A1 (zh) * 2022-12-22 2024-06-27 杭州睿胜软件有限公司 植物物种确定方法、装置及计算机可读存储介质
CN118644737A (zh) * 2024-07-23 2024-09-13 浙江农林大学 一种香榧种类识别方法、电子设备和可读存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110852341B (zh) * 2019-09-23 2024-12-13 平安科技(深圳)有限公司 基于深度学习的白术检测方法、及其相关设备
CN111488939A (zh) * 2020-04-15 2020-08-04 天津美腾科技股份有限公司 模型训练方法、分类方法、装置及设备
CN111523457B (zh) * 2020-04-22 2023-09-12 七海行(深圳)科技有限公司 一种杂草识别方法及杂草处理设备
CN111783667A (zh) * 2020-07-02 2020-10-16 南阳理工学院 一种中医药识别系统及其使用方法
CN114092382A (zh) * 2020-08-07 2022-02-25 富泰华工业(深圳)有限公司 产品瑕疵标记装置和方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916382A (zh) * 2010-07-30 2010-12-15 广州中医药大学 一种植物叶片的图像识别方法
US20130136312A1 (en) * 2011-11-24 2013-05-30 Shih-Mu TSENG Method and system for recognizing plant diseases and recording medium
CN107145879A (zh) * 2017-06-23 2017-09-08 依通(北京)科技有限公司 一种植物种类自动识别方法及系统
CN107527069A (zh) * 2017-08-22 2017-12-29 京东方科技集团股份有限公司 图像处理方法、装置、电子设备及计算机可读介质
CN108520247A (zh) * 2018-04-16 2018-09-11 腾讯科技(深圳)有限公司 对图像中的对象节点的识别方法、装置、终端及可读介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106156775B (zh) * 2015-03-31 2020-04-03 日本电气株式会社 基于视频的人体特征提取方法、人体识别方法和装置
CN107832807B (zh) * 2017-12-07 2020-08-07 上海联影医疗科技有限公司 一种图像处理方法和系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916382A (zh) * 2010-07-30 2010-12-15 广州中医药大学 一种植物叶片的图像识别方法
US20130136312A1 (en) * 2011-11-24 2013-05-30 Shih-Mu TSENG Method and system for recognizing plant diseases and recording medium
CN107145879A (zh) * 2017-06-23 2017-09-08 依通(北京)科技有限公司 一种植物种类自动识别方法及系统
CN107527069A (zh) * 2017-08-22 2017-12-29 京东方科技集团股份有限公司 图像处理方法、装置、电子设备及计算机可读介质
CN108520247A (zh) * 2018-04-16 2018-09-11 腾讯科技(深圳)有限公司 对图像中的对象节点的识别方法、装置、终端及可读介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
KIM, EAL ET AL.: "Deep Convolution and Up-Convolution Network for Plant Segmentation", 2018 INTERNATIONAL CONFERENCE ON ELECTRONICS, INFORMATION, AND COMMUNICATION (ICEIC), 27 January 2018 (2018-01-27), XP033343170, DOI: 20191113165400Y *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113807449A (zh) * 2021-09-23 2021-12-17 合肥工业大学 一种沉积岩类别识别方法、装置、电子设备和存储介质
WO2024131589A1 (zh) * 2022-12-22 2024-06-27 杭州睿胜软件有限公司 植物物种确定方法、装置及计算机可读存储介质
CN118644737A (zh) * 2024-07-23 2024-09-13 浙江农林大学 一种香榧种类识别方法、电子设备和可读存储介质

Also Published As

Publication number Publication date
CN110059715A (zh) 2019-07-26

Similar Documents

Publication Publication Date Title
WO2020181706A1 (zh) 植物种类的识别方法及装置
CN110070101B (zh) 植物种类的识别方法及装置、存储介质、计算机设备
CN110516576B (zh) 基于深度神经网络的近红外活体人脸识别方法
US20240320966A1 (en) Method and device for data processing
CN110136809B (zh) 一种医疗图像处理方法、装置、电子医疗设备和存储介质
CN107194158A (zh) 一种基于图像识别的疾病辅助诊断方法
JP2022528128A (ja) 肌質測定方法、肌質等級分類方法、肌質測定装置、電子機器及び記憶媒体
WO2020006961A1 (zh) 用于提取图像的方法和装置
JP2021531571A (ja) 証明書画像抽出方法及び端末機器
CN114399480B (zh) 蔬菜叶片病害严重程度检测方法及装置
CN109815960A (zh) 基于深度学习的翻拍图像识别方法、装置、设备及介质
WO2019100282A1 (zh) 一种人脸肤色识别方法、装置和智能终端
CN108154105A (zh) 水下生物检测与识别方法、装置、服务器及终端设备
CN111666890A (zh) 脊柱变形人群识别方法、装置、计算机设备及存储介质
CN111935479A (zh) 一种目标图像确定方法、装置、计算机设备及存储介质
WO2021114818A1 (zh) 基于傅里叶变换的oct图像质量评估方法、系统及装置
CN108734673A (zh) 去网纹系统训练方法、去网纹方法、装置、设备及介质
CN110298829A (zh) 一种舌诊方法、装置、系统、计算机设备和存储介质
CN115620384A (zh) 模型训练方法、眼底图像预测方法及装置
CN113436081B (zh) 数据处理方法、图像增强方法及其模型训练方法
CN114663726A (zh) 目标类别检测模型的训练方法、目标检测方法及电子设备
CN115375548A (zh) 一种超分辨率的遥感图像生成方法、系统、设备和介质
CN116665092B (zh) 基于ia-yolov7的污水悬浮物识别方法及系统
CN116824419B (zh) 一种着装特征识别方法、识别模型的训练方法及装置
CN111144407A (zh) 一种目标检测方法、系统、装置及可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19918652

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19918652

Country of ref document: EP

Kind code of ref document: A1