CN116704237A - Plant species identification method and device, storage medium and electronic equipment - Google Patents

Plant species identification method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116704237A
CN116704237A CN202310511450.6A CN202310511450A CN116704237A CN 116704237 A CN116704237 A CN 116704237A CN 202310511450 A CN202310511450 A CN 202310511450A CN 116704237 A CN116704237 A CN 116704237A
Authority
CN
China
Prior art keywords
plant
characteristic data
initial
sample
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310511450.6A
Other languages
Chinese (zh)
Inventor
严浦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Financial Technology Co Ltd
Original Assignee
Bank of China Financial Technology 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 Bank of China Financial Technology Co Ltd filed Critical Bank of China Financial Technology Co Ltd
Priority to CN202310511450.6A priority Critical patent/CN116704237A/en
Publication of CN116704237A publication Critical patent/CN116704237A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30181Earth observation
    • G06T2207/30188Vegetation; Agriculture

Landscapes

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

Abstract

The application discloses a plant species identification method, a plant species identification device, a storage medium and electronic equipment, wherein the method comprises the following steps: determining plant characteristic data of a plant to be identified; inputting the plant characteristic data into a plant type recognition model to obtain the plant type of the plant to be recognized, which is output by the plant type recognition model; the plant species identification model is constructed based on a neural network model and an Adaboost model. The method and the device provided by the application improve the efficiency and the accuracy of identifying the plant species.

Description

Plant species identification method and device, storage medium and electronic equipment
Technical Field
The application relates to the technical field of machine learning, in particular to a plant species identification method, a plant species identification device, a storage medium and electronic equipment.
Background
With the progress of the age, the agricultural development mainly advances towards two directions, namely a precise agricultural direction and an intelligent agricultural direction, and the effective identification of various plant types is a key step of the two directions in the agricultural development, and is also an important research subject of agricultural scientists.
At present, plant types are mainly identified by a manual observation method, a large amount of manpower and material resources are consumed by the identification method, the identification efficiency is low, an identification result is associated with the observation experience of an observer, and an error exists in the identification result.
Therefore, how to improve the identification efficiency and the identification accuracy of plant species is a technical problem to be solved in the industry.
Disclosure of Invention
The application provides a plant species identification method, a plant species identification device, a storage medium and electronic equipment, which are used for solving the technical problems of how to improve the identification efficiency and the identification accuracy of plant species in the prior art.
In a first aspect, the present application provides a plant species identification method, comprising:
determining plant characteristic data of a plant to be identified;
inputting the plant characteristic data into a plant type recognition model to obtain the plant type of the plant to be recognized, which is output by the plant type recognition model;
the plant species identification model is constructed based on a neural network model and an Adaboost model.
In some embodiments, the plant species identification model is constructed based on the steps of:
constructing an initial plant species identification model based on the Adaboost model; the weak classifier of the Adaboost model is determined based on a neural network model;
Respectively assigning initial weights to the weak classifiers;
training the initial plant species identification model based on plant characteristic data of a plurality of sample plants and plant species corresponding to each sample plant;
and updating the initial weight of each weak classifier based on the training result to obtain the plant species identification model.
In some embodiments, the plant characteristic data is determined based on the steps of:
determining first initial plant characteristic data for the sample plant based on the plant image of the sample plant;
measuring the morphology of the sample plant, determining second initial plant characteristic data for the sample plant;
and determining plant characteristic data of the plant species corresponding to the sample plant based on the contribution degree of the first initial plant characteristic data and the second initial plant characteristic data to plant species identification.
In some embodiments, the determining first initial plant characteristic data for the sample plant based on the plant image of the sample plant comprises:
acquiring a gray level image of the plant image;
performing binarization processing on the gray level image to determine a plant area in the plant image;
And determining the fractal dimension of the sample plant based on the area proportion of the plant area in the plant image, so as to obtain the first initial plant characteristic data.
In some embodiments, the determining first initial plant characteristic data for the sample plant based on the plant image of the sample plant comprises:
acquiring a red component value, a green component value and a blue component value of the plant image;
determining hue, intensity, and saturation of the plant image based on the red component value, green component value, blue component value, and HSI model;
determining an L value, an a value, and a b value of the plant image based on the red component value, the green component value, the blue component value, and the Lab model;
and obtaining the first initial plant characteristic data based on the red component value, the green component value, the blue component value, the hue, the intensity, the saturation, the L value, the a value, and the b value.
In some embodiments, the determining the first initial plant characteristic data of the sample plant based on the plant image of the sample plant further comprises:
determining the area of the sample plant based on the number of pixel points occupied by the plant area in the plant image;
Determining a perimeter of the sample plant based on the edge location of the plant area;
determining a circularity of the sample plant based on the ratio of the area and the perimeter;
and obtaining the first initial plant characteristic data based on the area, the perimeter and the circularity.
In some embodiments, the determining plant characteristic data of the plant species corresponding to the sample plant based on the contribution of the first initial plant characteristic data and the second initial plant characteristic data to plant species identification comprises:
the first initial plant characteristic data and the second initial plant characteristic data with contribution degree larger than or equal to a preset threshold value are used as plant characteristic data of plant types corresponding to the sample plants;
or, based on the contribution degree, performing descending order arrangement on the first initial plant characteristic data and the second initial plant characteristic data, and taking the initial plant characteristic data with the arrangement sequence number smaller than the preset sequence number as the plant characteristic data of the plant type corresponding to the sample plant.
In a second aspect, the present application provides a plant species identification device comprising:
the determining module is used for determining plant characteristic data of the plants to be identified;
The identification module is used for inputting the plant characteristic data into a plant type identification model to obtain the plant type of the plant to be identified, which is output by the plant type identification model;
the plant species identification model is constructed based on a neural network model and an Adaboost model.
In a third aspect, the present application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method described above.
In a fourth aspect, the application provides an electronic device comprising a memory in which a computer program is stored and a processor arranged to implement the above-mentioned method when the program is executed by the computer program.
According to the plant type identification method, the plant type identification device, the storage medium and the electronic equipment, the plant type of the plant to be identified is automatically identified through the plant type identification model, a large amount of manpower and material resources are not required to be consumed, and the identification efficiency of the plant type is improved; the plant species identification model is built through the neural network model and the Adaboost model, and the plant species identification model with high prediction accuracy can be obtained through training under the condition that the plant characteristic data of sample plants are less, so that the accuracy of plant identification is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the application or the technical solutions of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the application, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a plant species identification method according to an embodiment of the present application;
FIG. 2 is a flow chart of a plant species identification method according to another embodiment of the present application;
FIG. 3 is a schematic view showing a plant species identification device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like herein are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those steps or modules that are expressly listed or inherent to such process, method, article, or apparatus.
The plant type identification method provided by the embodiment of the application is suitable for the terminal. The terminal may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to servers, smartphones, tablets, laptop and desktop computers, and the like.
Fig. 1 is a flow chart of a plant species identification method according to an embodiment of the application, as shown in fig. 1, the method includes a step 110 and a step 120. The method flow steps are only one possible implementation of the application.
Step 110, determining plant characteristic data of the plant to be identified.
Specifically, the execution main body of the plant type identification method provided by the embodiment of the application is a plant type identification device, and the device can be a hardware device independently arranged in a terminal or a software program running in the terminal. For example, when the terminal is a mobile phone, the plant species identification device may be embodied as an application program such as identification software in the mobile phone.
The plant to be identified is a plant to be subjected to plant species identification. The plant can be rice, cotton, tea, etc. The plant characteristic data is used to determine the type of plant and may include, for example, plant height, fractal dimension, and color component values. The plant species of the plant to be identified may be determined from plant characteristic data of the plant to be identified.
For example, the user wants to identify the plant species of plant a, then plant a is the plant to be identified. Plant characteristic data for plant a may include plant a height, fractal dimension, and color component values, among others.
Step 120, inputting plant characteristic data into a plant type recognition model to obtain plant types of plants to be recognized, which are output by the plant type recognition model; the plant species identification model is constructed based on a neural network model and an Adaboost model.
Specifically, the plant species recognition model is a model that recognizes the plant species of the plant to be recognized. The plant type recognition model can receive plant characteristic data of plants to be recognized, decode the plant characteristic data of the plants to be recognized, obtain probability that the plants to be recognized belong to various plant types, and predict plant types of the plants to be recognized according to the probability.
The plant species identification model of the embodiment of the application is constructed according to a neural network model and an Adaboost model.
The Adaboost model is sensitive to abnormal samples, and the abnormal samples can obtain higher weight in the iterative process of model training, so that the prediction accuracy of the final plant species recognition model is affected.
Therefore, when the plant characteristic data of the sample plant is small, the Adaboost model is easily affected by the abnormal data, resulting in low prediction accuracy of the obtained plant species identification model. Wherein plant characteristic data of the sample plant is used for model training.
In order to improve the prediction accuracy of the plant species recognition model, the embodiment of the application combines the neural network model and the Adaboost model to construct the plant species recognition model.
The iterative process of the weight of the Adaboost model is optimized through the neural network model, and the plant species identification model with high prediction accuracy can be obtained through training under the condition that the plant characteristic data of the sample plant is less. The neural network model may be a multi-layer perceptron (Multilaver Perceptron, MLP) model, among others.
According to the plant type identification method provided by the embodiment of the application, the plant type of the plant to be identified is automatically identified through the plant type identification model, so that a large amount of manpower and material resources are not required to be consumed, and the identification efficiency of the plant type is improved; the plant species identification model is built through the neural network model and the Adaboost model, and the plant species identification model with high prediction accuracy can be obtained through training under the condition that the plant characteristic data of sample plants are less, so that the accuracy of plant identification is improved.
It should be noted that each embodiment of the present application may be freely combined, exchanged in order, or separately executed, and does not need to rely on or rely on a fixed execution sequence.
In some embodiments, the plant species identification model is constructed based on the following steps:
constructing an initial plant species identification model based on the Adaboost model; the weak classifier of the Adaboost model is determined based on a neural network model;
Respectively assigning initial weights to the weak classifiers;
training an initial plant species identification model based on plant characteristic data of a plurality of sample plants and plant species corresponding to each sample plant;
and updating the initial weight of each weak classifier based on the training result to obtain a plant species identification model.
Specifically, a plurality of weak classifiers are involved in the Adaboost model, which is typically a classification regression tree (Classification And Regression Tree, CART).
In order to improve the accuracy of prediction of the plant species identification model, the embodiment of the application replaces the classification regression tree with a neural network model to construct an initial plant species identification model. And respectively assigning initial weights to the neural network models serving as weak classifiers.
Plant characteristic data of a plurality of sample plants are obtained, plant characteristic data of each sample plant and plant types corresponding to each sample plant are stored in a correlated mode, then an initial plant type recognition model is trained according to the plant characteristic data of the plurality of sample plants and the plant types corresponding to each sample plant, and initial weights of all weak classifiers are continuously updated in the training process until a plant type recognition model with high prediction accuracy is obtained.
For example, plant characteristic data of a plurality of sample plants and plant species corresponding to each sample plant may be trained by invoking an initial plant species identification model through a Python code. The initial plant species identification model may be trained and validated by ten fold cross validation.
The training results of the initial plant species identification model may be presented in the form of accuracy, precision, receiver operating characteristics (receiver operating characteristic curve, ROC curves) and the like.
The method can also be used for optimizing parameters of the initial plant species identification model in advance through a grid search method and a Bayesian optimization algorithm, and then the algorithm with better precision is used as a final parameter optimization method according to training results.
According to the plant type recognition method provided by the embodiment of the application, the plant type recognition model is constructed through the neural network model and the Adaboost model, so that the influence of an abnormal sample on the prediction accuracy of the plant type recognition model can be reduced, the plant type recognition model with high prediction accuracy can be obtained through training under the condition that the plant characteristic data of the sample plant is less, and the accuracy of plant recognition is improved.
In some embodiments, the plant characterization data is determined based on the steps of:
determining first initial plant characteristic data of the sample plant based on the plant image of the sample plant;
measuring the morphology of the sample plant to determine second initial plant characteristic data for the sample plant;
and determining plant characteristic data of the plant species corresponding to the sample plant based on the contribution degree of the first initial plant characteristic data and the second initial plant characteristic data to the plant species identification.
Specifically, the plant characteristic data in the embodiment of the application are screened from a plurality of initial plant characteristic data.
And analyzing the plant image by acquiring a plant image of the sample plant to obtain first initial plant characteristic data of the sample plant. The first initial plant characteristic data may include fractal dimension, color component values, hue, intensity, saturation, and circularity, etc. data that may be obtained from plant images.
The photographing conditions of the plant images of the respective sample plants are the same, for example, the photographing angles are the same and the photographing distances are the same.
The sample plant may also be measured by a plant measuring instrument, and second initial plant characteristic data of the sample plant may be obtained from the measurement data. The second initial plant characteristic data may include plant height, plant side view and projected area, etc. data that may be measured by the instrument.
The initial plant characteristic data includes first initial plant characteristic data and second initial plant characteristic data. The initial plant characteristic data can be subjected to data cleaning and data standardization processing. The specific treatment method is as follows:
(a) Missing value processing: the embodiment of the application directly deletes the data containing the missing value because the missing value is less and the complement of the missing value can have a certain influence on the identification of the plant species because the embodiment of the application is the initial plant characteristic data acquired through the plant image and the plant measuring instrument.
(b) Outlier processing: the initial plant characteristic data is outlier deleted by the 3σ criterion.
(c) And (3) standardization treatment: and (5) carrying out standardization treatment on the initial plant characteristic data. The standardized formula isWherein x is i Representing the ith initial plant profile, +.>Mean value s representing the i-th initial plant characteristic data i The standard deviation of the ith initial plant characterization data is shown.
Because various initial plant feature data are obtained in the embodiment of the present application, and some plant features exist in plant features corresponding to the initial plant feature data, the initial plant feature data corresponding to some initial plant features do not have the capability of identifying plant types, i.e. the contribution degree of some initial plant feature data to plant type identification is low. The contribution degree of the initial plant characteristic data is associated with the plant species identification capability of the initial plant characteristic data, and the stronger the plant species identification capability is, the higher the contribution degree is.
The initial plant characteristic data can be screened, the initial plant characteristic data with strong plant type recognition capability is used as plant characteristic data of plant types corresponding to sample plants, and the interference factors and the calculation amount of a plant type recognition model can be reduced.
Random forests are a feature selection algorithm that automatically calculates the importance of various initial plant feature data for plant species identification, with fewer initial plant feature data scenarios. The importance, namely the contribution degree, of various initial plant characteristic data to plant species identification can be calculated through a random forest algorithm.
The contribution degree of various initial plant characteristic data to plant species identification can be calculated according to a random forest algorithm in the embedding method, and plant characteristic data of plant species corresponding to the sample plant is determined according to the contribution degree of various initial plant characteristic data.
For example, 26 initial plant characteristic data of a sample plant are obtained, the 26 initial plant characteristic data belonging to high-dimensional data. In the dimension reduction process of the random forest algorithm, noise is added to any initial plant characteristic data in the random forest model, and then the importance of the initial plant characteristic data for plant type identification is judged according to whether the prediction accuracy of the random forest model has obvious descending trend.
Plant characteristic data of a plant species corresponding to the sample plant may be determined based on the magnitude of the contribution of the initial plant characteristic data. Wherein the initial plant characteristic data/group is one of the initial plant characteristic data.
For example, the first initial plant characteristic data and the second initial plant characteristic data having a contribution degree greater than or equal to a preset threshold value may be used as plant characteristic data of a plant species corresponding to the sample plant.
Plant characteristic data of a plant species corresponding to the sample plant may also be determined based on the magnitude of the contribution and the number of initial plant characteristic data.
For example, the first initial plant feature data and the second initial plant feature data are arranged in a descending order based on the contribution degree, and the initial plant feature data with the arrangement sequence number smaller than the preset sequence number are used as plant feature data of plant types corresponding to the sample plants.
The preset sequence number may be set according to an actual scene, for example, may be set to ten, and nine kinds of initial plant characteristic data are selected as plant characteristic data of plant types corresponding to the sample plants. Wherein, the arrangement sequence number of the nine initial plant characteristic data is less than ten.
According to the plant type identification method provided by the embodiment of the application, the plant characteristic data of the plant type corresponding to the sample plant is determined through the contribution degree, so that the interference factors can be reduced, and the plant type identification efficiency can be improved.
In some embodiments, determining first initial plant characteristic data for the sample plant based on the plant image of the sample plant comprises:
acquiring a gray level image of a plant image;
binarization processing is carried out on the gray level image, and a plant area in the plant image is determined;
and determining the fractal dimension of the sample plant based on the area ratio of the plant area in the plant image, thereby obtaining first initial plant characteristic data.
Specifically, the plant image in the embodiment of the application is an RGB image, and the plant image can be subjected to graying treatment to obtain a gray image, so that the calculated amount of data is reduced.
The color for each pixel in an RGB image is determined by three color components of Red (Red, R), green (G), and Blue (B), and the three color components each occupy 1 byte, with a variation range of 0 to 255 for each color component. The gray image is a special color image, and the pixel point variation range is 0-255, so that the gray image is much less calculated than the RGB image in the image processing process.
The graying process is a process of converting the original R, G and B three channels into one channel (converting from three luminance values to one luminance value).
After the gray level image is obtained, binarization processing can be carried out on the gray level image through an Ojin threshold segmentation algorithm (an Ostu segmentation algorithm), a binary image corresponding to the gray level image is obtained, and a plant area and a background area in the binary image are segmented.
In order to make the plant information in the segmented binary image more accurate, the segmented binary image may be subjected to a closed operation process and then an open operation process. The holes and the like in the binary image are filled after the binary image is subjected to closed operation treatment, and the shape characteristics of the represented plant area are more in accordance with the actual shape characteristics of plants. After the binary image is processed by open operation, burrs at the edge of the plant area and tiny particles outside the plant area can be removed. After the binary image is processed, the pixel points of the plant area and the background area in the binary image are clearer.
The first initial plant characteristic data includes a fractal dimension, and the fractal dimension of the sample plant may be determined based on the area ratio of the plant area in the plant image.
For example, the pixels of the plant area and the background area in the processed binary image are very clear, and the grid box number in the binary image can be calculated relatively easily, so that the fractal dimension of the sample plant can be calculated by a box counting dimension method, and the fractal dimension is taken as texture feature data of the sample plant.
The specific algorithm of the box-counting dimension method is as follows:
for example, the byte size that can be stored in the processed binary image is m×m×l, where L is the gray scale of the binary image, M is the number of pixel points, and typically l=256.
An R x R grid is selected on the binary image plane for division, wherein R is the number of grid boundaries, and therefore the division unit of the binary image on the gray level is (R x L)/M.
The maximum u and minimum b values of the pixels are selected in the (i, j) th R x R grid of the binary image. The number of frames to be covered between the maximum and minimum pixels, n (i, j), is calculated as follows:
the sum N of the number of frames covered by each grid box is expressed as:
calculating fractal dimension D of plant area in binary image 1 The method comprises the following steps:
alternatively, two fractal dimensions of the sample plant under the gray image and the binary image may be calculated according to the box-counting dimension method.
The influence of the pixel ratio and the resolution can be eliminated by calculating the fractal dimension according to the binary image, the defect of information deletion during calculating the color image can be overcome, and the accuracy of the calculated fractal dimension is high.
According to the plant type recognition method provided by the embodiment of the application, the fractal dimension of the sample plant is calculated by processing the plant image, and the fractal dimension is used as the texture characteristic parameter of the sample plant, so that the texture characteristic can be dataized, and the accuracy of plant type recognition is improved.
In some embodiments, determining first initial plant characteristic data for the sample plant based on the plant image of the sample plant comprises:
acquiring a red component value, a green component value and a blue component value of a plant image;
determining hue, brightness, and saturation of the plant image based on the red component value, the green component value, the blue component value, and the HSI model;
determining an L value, an a value, and a b value of the plant image based on the red component value, the green component value, the blue component value, and the Lab model;
based on the red component value, the green component value, the blue component value, the hue, the intensity, the saturation, the L value, the a value, and the b value, first initial plant characteristic data is obtained.
Specifically, the first initial plant characteristic data includes red component value, green component value, blue component value, hue, intensity, saturation, L value, a value and b value, and the nine kinds of color characteristic data of the plant image can be obtained through an RGB model, an HIS model and a Lab model in the following specific ways:
(a) Acquiring RGB color characterization data
The original image of the plant image is an RGB image, and a reshape function can be called by Python to obtain a red component value R, a green component value G and a blue component value B of the plant image. The red component value, the green component value, and the blue component value are taken as RGB color characteristic data of the plant image.
(b) Acquiring HSI color feature data
On the basis of acquiring RGB color characteristic data, the embodiment of the application further acquires the Hue (Hue, H), intensity (I) and Saturation (S) of the plant image through the HSI model. Wherein hue is used to characterize a color feature; saturation is used to characterize the purity of the color; the intensity is used to characterize the illumination intensity. The numerical value of H, the numerical value of I and the numerical value of S are taken as HSI color characteristic data of the plant image.
The conversion formula for converting from the RGB model to the HSI model is as follows:
wherein, the liquid crystal display device comprises a liquid crystal display device,
(c) Obtaining Lab color characteristic data
On the basis of obtaining RGB color characteristic data, the embodiment of the application obtains the L value, the a value and the b value L of the plant image through the Lab model. L represents luminance (luminance). a is used to characterize the range from magenta to green and b is used to characterize the range from yellow to blue.
The conversion formula for converting from the RGB model to the Lab model is as follows:
according to the plant type identification method provided by the embodiment of the application, nine kinds of color characteristic data of the plant image are obtained through the RGB model, the HIS model and the Lab model, so that the obtained color characteristic data is more comprehensive, and the accuracy of plant type identification is improved.
In some embodiments, determining the first initial plant characteristic data for the sample plant based on the plant image of the sample plant further comprises:
determining the area of the sample plant based on the number of pixel points occupied by the plant area in the plant image;
determining a perimeter of the sample plant based on the edge position of the plant area;
determining the circularity of the sample plant based on the ratio of the area to the perimeter;
based on the area, circumference and circularity, first initial plant feature data is obtained.
Specifically, the first initial plant characteristic data includes area, circumference, and circularity, which may be obtained according to the following manner:
(a) Acquisition of area A of sample plant in plant image
The area is the size of the plant area in the plant image. The number of pixels in the plant area can be counted to determine the area of the sample plant. Since plants may be irregularly distributed in the plant area, the area may be divided into a projection area, a convex polygon area, a filling area, and the like, so that the projection area, the convex polygon area, the filling area, and the like of the sample plant in the plant image may be acquired.
(b) Obtaining perimeter C of sample plant in plant image
The perimeter is the edge length of the plant area in the plant image. The shortest length of the outer boundaries of all pixels comprising the plant area can be calculated to obtain the perimeter of the sample plant.
(c) Obtaining the circularity E of a plant region in a plant image
The circularity E can be used to characterize the complexity of the edge shape of a plant area. When E is 1, the plant area is circular; the larger the value of 1-E, the more irregular the shape of the plant area, the larger the gap from the circle, and the more complex the shape of the edges of the plant area.
Optionally, the first initial plant characteristic data may further comprise a shortest radius and a longest radius of a center of gravity of the plant area in the plant image.
The binary image of the sample image can be obtained, the barycenter of the plant area is determined by calling a regionoprops function through Python, the farthest and nearest distances between the barycenter and the boundary of the plant area are calculated, the farthest distance between the barycenter and the boundary of the plant area is taken as the longest radius, and the nearest distance between the barycenter and the boundary of the plant area is taken as the shortest radius.
According to the plant type identification method provided by the embodiment of the application, the first initial plant characteristic data is acquired from multiple aspects, the acquired first initial plant characteristic data is more comprehensive, and the accuracy of plant type identification is improved.
In some embodiments, fig. 2 is a schematic flow chart of a plant species identification method according to another embodiment of the present application, as shown in fig. 2, the method includes:
step 210, acquiring a colored plant image.
Color plant images of a plurality of sample plants are acquired.
Step 220, acquiring a gray level image and a binary image corresponding to the plant image.
Step 230, obtaining initial plant characteristic data.
And analyzing the plant image to obtain the area, perimeter and circularity of the sample plant. And acquiring nine color features of the plant image according to the colored plant image and the RGB model, the HSI model and the Lab model. And obtaining the fractal dimension of the sample plant according to the gray level image and the binary image, and taking the fractal dimension as the texture characteristic parameter of the sample plant. The height of the plant, the side view and the projection area of the plant and the like are obtained according to the plant measuring instrument. These features are all acquired as initial plant feature data for the sample plant.
Step 240, obtaining plant characteristic data of plant types corresponding to the sample plants.
And calculating contribution degrees of various initial plant characteristic data to plant species identification through a random forest algorithm so as to screen the initial plant characteristic data and obtain plant characteristic data of plant species corresponding to the sample plants.
And 250, constructing a plant type identification model, and determining the plant type of the plant to be identified.
And constructing a plant type recognition model according to the MLP model, the Adaboost model, the plant characteristic data of a plurality of sample plants and plant types corresponding to the sample plants.
Inputting the plant characteristic data into the plant type recognition model to obtain the plant type of the plant to be recognized, which is output by the plant type recognition model.
The plant species identification method provided by the embodiment of the application has the following beneficial effects:
(a) The fractal dimension is used as texture feature data, the fractal dimension can be calculated from plant images of all sample plants, and the texture features of all sample plants can be dataized. The prediction accuracy of the plant species recognition model can be effectively improved through the texture feature data of the plant image.
(b) The initial plant characteristic data are screened, contribution degrees of various initial plant characteristic data to plant type identification are calculated by using a random forest algorithm, and plant characteristic data of plant types corresponding to sample plants are determined according to the contribution degrees. The MLP model and the Adaboost model are combined to construct a plant species identification model, so that the identification efficiency and the identification accuracy of plant species identification are improved.
(c) The embodiment of the application has wide applicability and is suitable for identifying plant types of various plants, such as rice, cotton, tea and other plants.
The plant species identification device provided in the embodiment of the present application will be described below, and the plant species identification device described below and the plant species identification method described above may be referred to correspondingly to each other.
Fig. 3 is a schematic structural view of a plant species identification device according to an embodiment of the present application, and as shown in fig. 3, the device includes a determining module 310 and an identification module 320.
A determining module 310 for determining plant characteristic data of a plant to be identified;
the identifying module 320 is configured to input plant characteristic data into the plant type identifying model, and obtain a plant type of the plant to be identified output by the plant type identifying model;
the plant species identification model is constructed based on a neural network model and an Adaboost model.
In particular, according to an embodiment of the present application, any of the determining module and the identifying module may be combined in one module to be implemented, or any of the modules may be split into a plurality of modules.
Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module.
According to embodiments of the application, at least one of the determination module and the identification module may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or in hardware or firmware, such as any other reasonable way of integrating or packaging the circuit, or in any one of or a suitable combination of three of software, hardware and firmware.
Alternatively, at least one of the determination module and the identification module may be at least partially implemented as a computer program module which, when executed, may perform the respective functions.
According to the plant type identification device provided by the embodiment of the application, the plant type of the plant to be identified is automatically identified through the plant type identification model, so that a large amount of manpower and material resources are not required to be consumed, and the identification efficiency of the plant type is improved; the plant species identification model is built through the neural network model and the Adaboost model, and the plant species identification model with high prediction accuracy can be obtained through training under the condition that the plant characteristic data of sample plants are less, so that the accuracy of plant identification is improved.
In some embodiments, the identification module includes a building sub-module to:
constructing an initial plant species identification model based on the Adaboost model; the weak classifier of the Adaboost model is determined based on a neural network model; respectively assigning initial weights to the weak classifiers; training an initial plant species identification model based on plant characteristic data of a plurality of sample plants and plant species corresponding to each sample plant; and updating the initial weight of each weak classifier based on the training result to obtain a plant species identification model.
In some embodiments, the identification module further comprises a sample submodule for:
determining first initial plant characteristic data of the sample plant based on the plant image of the sample plant; measuring the morphology of the sample plant to determine second initial plant characteristic data for the sample plant; and determining plant characteristic data of the plant species corresponding to the sample plant based on the contribution degree of the first initial plant characteristic data and the second initial plant characteristic data to the plant species identification.
In some embodiments, the sample submodule is specifically configured to:
acquiring a gray level image of a plant image; binarization processing is carried out on the gray level image, and a plant area in the plant image is determined; and determining the fractal dimension of the sample plant based on the area ratio of the plant area in the plant image, thereby obtaining first initial plant characteristic data.
In some embodiments, the sample sub-module is further specifically configured to:
acquiring a red component value, a green component value and a blue component value of a plant image;
determining hue, brightness, and saturation of the plant image based on the red component value, the green component value, the blue component value, and the HSI model;
determining an L value, an a value, and a b value of the plant image based on the red component value, the green component value, the blue component value, and the Lab model;
the first initial plant characteristic data is obtained based on the red component value, the green component value, the blue component value, the hue, the brightness, the saturation, the L value, the a value, and the b value.
In some embodiments, the sample sub-module is further specifically configured to:
determining the area of the sample plant based on the number of pixel points occupied by the plant area in the plant image; determining a perimeter of the sample plant based on the edge position of the plant area; determining the circularity of the sample plant based on the ratio of the area to the perimeter; based on the area, circumference and circularity, first initial plant feature data is obtained.
In some embodiments, the sample submodule is further to:
the first initial plant characteristic data and the second initial plant characteristic data with contribution degree larger than or equal to a preset threshold value are used as plant characteristic data of plant types corresponding to sample plants; or, based on the contribution degree, the first initial plant characteristic data and the second initial plant characteristic data are arranged in a descending order, and the initial plant characteristic data with the arrangement sequence number smaller than the preset sequence number are used as plant characteristic data of plant types corresponding to the sample plants.
It should be noted that, the plant species identification device provided by the embodiment of the present application can implement all the method steps implemented by the above plant species identification method embodiment, and can achieve the same technical effects, and the same parts and beneficial effects as those of the method embodiment in the present embodiment are not described in detail herein.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application, as shown in fig. 4, the electronic device may include: processor (Processor) 410, communication interface (Communications Interface) 420, memory (Memory) 430, and communication bus (Communications Bus) 440, wherein Processor 410, communication interface 420, memory 430 complete communication with each other via communication bus 440. The processor 410 may invoke logic commands in the memory 430 to perform a plant species identification method comprising:
determining plant characteristic data of a plant to be identified; inputting plant characteristic data into a plant type recognition model to obtain plant types of plants to be recognized, which are output by the plant type recognition model; the plant species identification model is constructed based on a neural network model and an Adaboost model.
In addition, the logic commands in the memory described above may be implemented in the form of software functional modules and stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in the form of a software product stored in a storage medium, comprising several commands for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The processor in the electronic device provided by the embodiment of the application can call the logic instruction in the memory to realize the method, and the specific implementation mode is consistent with the implementation mode of the method, and the same beneficial effects can be achieved, and the detailed description is omitted here.
Embodiments of the present application also provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the methods provided by the above embodiments.
The specific embodiment is consistent with the foregoing method embodiment, and the same beneficial effects can be achieved, and will not be described herein.
The embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, implements a method as described above.
The apparatus embodiments described above are merely illustrative, wherein the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method for identifying plant species, comprising:
determining plant characteristic data of a plant to be identified;
inputting the plant characteristic data into a plant type recognition model to obtain the plant type of the plant to be recognized, which is output by the plant type recognition model;
the plant species identification model is constructed based on a neural network model and an Adaboost model.
2. The plant species identification method as claimed in claim 1, wherein the plant species identification model is constructed based on the steps of:
constructing an initial plant species identification model based on the Adaboost model; the weak classifier of the Adaboost model is determined based on a neural network model;
Respectively assigning initial weights to the weak classifiers;
training the initial plant species identification model based on plant characteristic data of a plurality of sample plants and plant species corresponding to each sample plant;
and updating the initial weight of each weak classifier based on the training result to obtain the plant species identification model.
3. The plant species identification method of claim 2 wherein the plant characteristic data is determined based on the steps of:
determining first initial plant characteristic data for the sample plant based on the plant image of the sample plant;
measuring the morphology of the sample plant, determining second initial plant characteristic data for the sample plant;
and determining plant characteristic data of the plant species corresponding to the sample plant based on the contribution degree of the first initial plant characteristic data and the second initial plant characteristic data to plant species identification.
4. A plant species identification method as claimed in claim 3 wherein the determining first initial plant characteristic data of the sample plant based on the plant image of the sample plant comprises:
acquiring a gray level image of the plant image;
Performing binarization processing on the gray level image to determine a plant area in the plant image;
and determining the fractal dimension of the sample plant based on the area proportion of the plant area in the plant image, so as to obtain the first initial plant characteristic data.
5. A plant species identification method as claimed in claim 3 wherein the determining first initial plant characteristic data of the sample plant based on the plant image of the sample plant comprises:
acquiring a red component value, a green component value and a blue component value of the plant image;
determining hue, intensity, and saturation of the plant image based on the red component value, green component value, blue component value, and HSI model;
determining an L value, an a value, and a b value of the plant image based on the red component value, the green component value, the blue component value, and the Lab model;
and obtaining the first initial plant characteristic data based on the red component value, the green component value, the blue component value, the hue, the intensity, the saturation, the L value, the a value, and the b value.
6. The plant species identification method of claim 4 wherein the determining first initial plant characteristic data for the sample plant based on the plant image of the sample plant further comprises:
Determining the area of the sample plant based on the number of pixel points occupied by the plant area in the plant image;
determining a perimeter of the sample plant based on the edge location of the plant area;
determining a circularity of the sample plant based on the ratio of the area and the perimeter;
and obtaining the first initial plant characteristic data based on the area, the perimeter and the circularity.
7. The plant species identification method as claimed in claim 3, wherein the determining plant feature data of the plant species corresponding to the sample plant based on the contribution degree of the first initial plant feature data and the second initial plant feature data to plant species identification comprises:
taking the first initial plant characteristic data and the second initial plant characteristic data with contribution degree larger than or equal to a preset threshold value as plant characteristic data of the sample plant;
or, based on the contribution degree, performing descending order arrangement on the first initial plant characteristic data and the second initial plant characteristic data, and taking the initial plant characteristic data with the arrangement sequence number smaller than the preset sequence number as the plant characteristic data of the plant type corresponding to the sample plant.
8. A plant species identification device, comprising:
the determining module is used for determining plant characteristic data of the plants to be identified;
the identification module is used for inputting the plant characteristic data into a plant type identification model to obtain the plant type of the plant to be identified, which is output by the plant type identification model;
the plant species identification model is constructed based on a neural network model and an Adaboost model.
9. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the plant species identification method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to perform the plant species identification method of any one of claims 1 to 7 by means of the computer program.
CN202310511450.6A 2023-05-08 2023-05-08 Plant species identification method and device, storage medium and electronic equipment Pending CN116704237A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310511450.6A CN116704237A (en) 2023-05-08 2023-05-08 Plant species identification method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310511450.6A CN116704237A (en) 2023-05-08 2023-05-08 Plant species identification method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116704237A true CN116704237A (en) 2023-09-05

Family

ID=87834786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310511450.6A Pending CN116704237A (en) 2023-05-08 2023-05-08 Plant species identification method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116704237A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117496196A (en) * 2023-11-03 2024-02-02 廊坊市园林绿化事务中心 Garden plant maintenance monitoring method, system, equipment and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117496196A (en) * 2023-11-03 2024-02-02 廊坊市园林绿化事务中心 Garden plant maintenance monitoring method, system, equipment and medium

Similar Documents

Publication Publication Date Title
CN109325954B (en) Image segmentation method and device and electronic equipment
CN111461165A (en) Image recognition method, recognition model training method, related device and equipment
CN108765423B (en) Convolutional neural network training method and device
US11501428B2 (en) Method, apparatus and system for detecting fundus image based on machine learning
CN108280455B (en) Human body key point detection method and apparatus, electronic device, program, and medium
JP2020522077A (en) Acquisition of image features
CN110070101A (en) Floristic recognition methods and device, storage medium, computer equipment
EA004910B1 (en) Method and apparatus for determining regions of interest in images and for image transmission
CN106934794A (en) Information processor, information processing method and inspection system
CN108257121A (en) The newer method, apparatus of product defects detection model, storage medium and terminal device
CN108182421A (en) Methods of video segmentation and device
CN108229485A (en) For testing the method and apparatus of user interface
CN116704237A (en) Plant species identification method and device, storage medium and electronic equipment
CN112101386B (en) Text detection method, device, computer equipment and storage medium
US20210213615A1 (en) Method and system for performing image classification for object recognition
CN113283405A (en) Mask detection method and device, computer equipment and storage medium
CN113609984A (en) Pointer instrument reading identification method and device and electronic equipment
CN111310531B (en) Image classification method, device, computer equipment and storage medium
CN111008953A (en) Method and device for controlling quality of digital pathological image
CN109661671A (en) Improvement using boundary bitmap to image classification
CN111738310B (en) Material classification method, device, electronic equipment and storage medium
CN115294405B (en) Method, device, equipment and medium for constructing crop disease classification model
CN112364916A (en) Image classification method based on transfer learning, related equipment and storage medium
CN115760854A (en) Deep learning-based power equipment defect detection method and device and electronic equipment
CN113609994A (en) Processing method and device for remote sensing image and server

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