CN110837823A - Method for generating seed variety identification model, identification method and device - Google Patents

Method for generating seed variety identification model, identification method and device Download PDF

Info

Publication number
CN110837823A
CN110837823A CN201911298813.2A CN201911298813A CN110837823A CN 110837823 A CN110837823 A CN 110837823A CN 201911298813 A CN201911298813 A CN 201911298813A CN 110837823 A CN110837823 A CN 110837823A
Authority
CN
China
Prior art keywords
seed
sample
light source
variety
hyperspectral
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
CN201911298813.2A
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.)
South China Agricultural University
Original Assignee
South China Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by South China Agricultural University filed Critical South China Agricultural University
Priority to CN201911298813.2A priority Critical patent/CN110837823A/en
Publication of CN110837823A publication Critical patent/CN110837823A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • G06V20/188Vegetation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/55Specular reflectivity
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition
    • G06V10/12Details of acquisition arrangements; Constructional details thereof
    • G06V10/14Optical characteristics of the device performing the acquisition or on the illumination arrangements
    • G06V10/145Illumination specially adapted for pattern recognition, e.g. using gratings
    • 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
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N2021/8466Investigation of vegetal material, e.g. leaves, plants, fruits
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10032Satellite or aerial image; Remote sensing
    • G06T2207/10036Multispectral image; Hyperspectral image
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • G06V20/194Terrestrial scenes using hyperspectral data, i.e. more or other wavelengths than RGB
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/68Food, e.g. fruit or vegetables

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biochemistry (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Data Mining & Analysis (AREA)
  • Analytical Chemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

The invention provides a generation method, an identification method and a device of a seed variety identification model, wherein the method comprises the following steps: collecting hyperspectral images of a plurality of sample seeds of at least one variety under a plurality of light source wavelengths respectively; extracting the seed outline of each sample seed in a hyperspectral image collected under each light source wavelength; calculating the average spectral reflectivity of unit pixels in each seed contour of each sample seed; generating a training sample according to the average spectral reflectivity of the unit pixel of each sample seed corresponding to all the light source wavelengths; and training an initial classification model by using training samples corresponding to all the sample seeds to obtain an identification model of the variety seeds. By utilizing the trained model, the variety of the seed can be detected quickly and nondestructively.

Description

Method for generating seed variety identification model, identification method and device
Technical Field
The invention relates to the fields of hyperspectral imaging, computer vision and machine learning, in particular to a generation method, an identification method and an identification device of a seed variety identification model.
Background
The purity and the authenticity of the variety are one of important indexes of the quality of crop seeds, and methods for identifying the yield and the quality of crops, the purity of the variety and the authenticity of the seeds directly influence the quality of the crops and the authenticity of the variety currently have different crops by using an attitude identification method, an electrophoresis method, a physiological biochemical method and a DNA molecular marker method.
In the prior art, the morphological identification method requires an inspector to have abundant experience, to be familiar with the characteristics of the variety to be detected, and to be able to distinguish whether the variant strain is genetic variation or variation caused by environmental influence. At present, the main parents of some crops are frequently used in a centralized way, so that the genetic difference among bred varieties is smaller and smaller, and the morphological character inspection is more and more difficult.
The electrophoresis method has high threshold, complex operation, high requirement on enzyme extraction and strict electrophoresis conditions, influences the accuracy of the identification result due to improper selection of isozyme, variation of isozyme activity along with the storage and germination processes of seeds and other factors, and is difficult to popularize in a large range due to volatile and alive enzymes.
Disclosure of Invention
The invention provides a generation method, an identification method and a device of a seed variety identification model, which are used for improving the speed, convenience and accuracy of seed variety identification.
In order to achieve the purpose, the invention adopts the following technical scheme:
according to an aspect of the embodiments of the present invention, there is provided a method for generating a seed variety identification model, including:
respectively collecting hyperspectral images of a plurality of sample seeds of at least one variety under a plurality of light source wavelengths;
extracting the seed outline of each sample seed in a hyperspectral image collected under each light source wavelength;
calculating the average spectral reflectivity of unit pixels in each seed contour of each sample seed;
generating a training sample according to the average spectral reflectivity of unit pixels of each sample seed corresponding to all the light source wavelengths and corresponding variety information;
and training the initial classification model by using the training samples corresponding to all the sample seeds to obtain the identification model of each variety of seeds.
In some embodiments, acquiring hyperspectral images of a plurality of at least one variety of sample seeds at a plurality of light source wavelengths, respectively, comprises:
and collecting hyperspectral images of a plurality of sample seeds of at least one variety at set wavelength intervals within a set light source wavelength range.
In some embodiments, acquiring hyperspectral images of a plurality of at least one variety of sample seeds at a plurality of light source wavelengths, respectively, comprises:
and shooting a plurality of sample seeds of at least one variety under each light source wavelength to obtain a corresponding hyperspectral image.
In some embodiments, extracting a seed profile in a hyperspectral image of each of the sample seeds acquired at each of the light source wavelengths comprises:
selecting a hyperspectral image with clear seed outline from the hyperspectral images shot under the wavelengths of the light sources, and segmenting and extracting the seed outline of each sample seed from the selected hyperspectral image by utilizing a snake segmentation algorithm; and mapping the extracted various sub-outlines to images under the other light source wavelengths by using a snake algorithm to obtain the seed outlines of the sample seeds in the hyperspectral images shot under the other light source wavelengths.
In some embodiments, the set light source wavelength range includes 400nm to 720 nm.
In some embodiments, calculating the average spectral reflectance per pixel within each seed contour for each of the sample seeds comprises:
respectively collecting hyperspectral images of the standard white board under the plurality of light source wavelengths, and collecting black frame images;
calculating the ratio of the gray value of the corresponding pixel point position in the hyperspectral image acquired by subtracting the black frame image from the hyperspectral image acquired under the same light source wavelength and the hyperspectral image acquired by subtracting the black frame image from the hyperspectral image of the standard white board acquired under the corresponding light source wavelength to obtain the spectral reflectivity of each pixel point in each seed contour of each sample seed;
and respectively averaging the spectral reflectances of all the pixel points in each seed contour of each sample seed to obtain the average spectral reflectivity of the unit pixel in each seed contour of each sample seed.
In some embodiments, generating a training sample based on the average spectral reflectance per pixel for all the light source wavelengths and corresponding variety information for each of the sample seeds comprises:
smoothing a curve formed by the average spectral reflectivity of the unit pixels of each sample seed corresponding to all the light source wavelengths and calculating a first derivative to obtain a processing result of calculating the first derivative after smoothing the average spectral reflectivity of the unit pixels of each sample seed corresponding to all the light source wavelengths;
and obtaining a processing result of a first derivative and corresponding variety information according to the smoothed average spectral reflectivity of the unit pixel of each sample seed corresponding to all the light source wavelengths, and then generating a training sample.
According to another aspect of the embodiments of the present invention, there is provided a method for identifying a variety of a seed, which is identified by the method described in the above embodiments.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for identifying a seed variety, comprising a memory, a processor and a computer program stored in the memory and operable on the processor, wherein the processor executes the computer program to implement the method of the embodiments.
In some embodiments, the authentication device further comprises:
the LED annular light source is annularly arranged around the lens of the hyperspectral camera and used for providing a light source for uniformly irradiating the sample seeds;
the hyperspectral camera is used for shooting a hyperspectral image of the sample seed under the condition that the light source irradiates the sample seed.
According to the generation method, the identification method and the device of the seed variety identification model, the seed profile is extracted, the average reflectivity of single seeds is calculated through the profile, the reliability and the accuracy of data are improved, the automatic extraction of the average spectral information of the seeds can be used for variety identification through the trained seed classification model, a large amount of labor cost and high-threshold professional knowledge requirements are not needed, meanwhile, the variety identification of the seeds is faster and more convenient, and the nondestructive detection is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a schematic flow chart of a method for generating a seed variety identification model according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an apparatus for a seed variety identification model according to an embodiment of the present invention;
FIG. 3 is a schematic representation of a hyperspectral image of a sample seed according to an embodiment of the invention;
FIG. 4 is a graph of the average spectrum of a single seed according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating the first derivative of the average spectrum of the single seed after smoothing, according to an embodiment of the present invention.
FIG. 6 is a diagram illustrating the accuracy of the training set and the test set of the SVM model according to the different wavelength selection algorithms based on the first derivative of the spectrum according to one embodiment of the present invention.
Description of the symbols:
1: a hyperspectral camera; 2: an LED annular light source; 3: an adjusting handle; 4: a connecting member; 5: a computer; 6: an object stage.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
Fig. 1 is a schematic flow chart of a method for generating a seed variety identification model according to an embodiment of the present invention. As shown in fig. 1, the method for generating a seed variety identification model according to some embodiments may include the following steps S110 to S150.
Specific embodiments of steps S110 to S150 will be described in detail below.
Step S110: and respectively collecting hyperspectral images of a plurality of sample seeds of at least one variety under a plurality of light source wavelengths.
In the step S110, collecting hyperspectral images of a plurality of sample seeds of at least one variety at a set wavelength interval within a set light source wavelength range; a plurality of sample seeds of at least one variety are shot under each light source wavelength, and a corresponding hyperspectral image can be obtained. Wherein, the light source adopts LED annular light source. The type of the sample seed may be a crop plant, an ornamental plant, or the like, and the crop plant may be, for example, corn, cotton, soybean, or the like. The ornamental plant may be flos Chrysanthemi, scindapsus aureus and poplar. The variety of the seed may include one or more of eleven melon seeds (caja queen, emerald ocean, ruby ocean, red meat Sha white, white meat Sha white, Langchao A710, white jade 2000, Su Mi Long, milk honey king, Meiqi, Meihua). The wavelength of the visible light may be 400nm to 720nm, and the plurality of light source wavelengths may be wavelengths obtained by filtering the visible light through a filter.
Specifically, the hyperspectral image has a spectral resolution of 10-2Spectral images in the range of the order of λ. And respectively acquiring hyperspectral images of a plurality of sample seeds of at least one variety under a plurality of light source wavelengths through a hyperspectral image imaging device. Wherein, the hyperspectral imager can be gazing the hyperspectral imager of liquid crystal, include wherein: hyperspectral camera, light source, etc.
Shooting a plurality of sample seeds of at least one variety in a set light source wavelength range, and obtaining a plurality of hyperspectral images of the plurality of sample seeds of at least one variety in a set wavelength interval. Setting the wavelength range of a light source to be 400nm-720nm and setting the wavelength interval to be 1nm, so that the hyperspectral imaging device respectively shoots hyperspectral images of at least one variety of sample seeds at the wavelengths of 400nm, 401nm, 402nm, … … nm, 718nm, 719nm and 720nm, and 321 hyperspectral images are obtained in total. Alternatively, the set wavelength interval may be 4nm, that is, the resolution may be set to 4nm, and 81 wavelengths in total, 81 hyperspectral images may be obtained.
In other embodiments, a hyperspectral image of a sample seed is collected at set wavelength intervals within a set light source wavelength range; and shooting each sample seed under each light source wavelength to obtain a plurality of corresponding hyperspectral images.
Specifically, the wavelength range of the light source can be 400nm-720nm, and hyperspectral images of one sample seed can be collected at intervals of 1nm or 4 nm; and shooting each sample seed under each light source wavelength to obtain a plurality of corresponding hyperspectral images.
Step S120: and extracting the seed contour of each sample seed in the hyperspectral image collected under each light source wavelength.
In step S120, extracting a seed contour in a hyperspectral image of each of the sample seeds collected at each of the light source wavelengths includes: selecting a hyperspectral image with clear seed outline from the hyperspectral images shot under the wavelengths of the light sources, and segmenting and extracting the seed outline of each sample seed from the selected hyperspectral images by utilizing a snake algorithm; and mapping the extracted various sub-outlines to images under the wavelengths of other light sources by using a snake algorithm to obtain the seed outlines of the sample seeds in the hyperspectral images shot under the wavelengths of the other light sources.
The hyperspectral image with clear seed outline is a hyperspectral image shot under one light source wavelength, and the definition can meet the requirement of extracting the seed outline, for example, the hyperspectral image can be the clearest hyperspectral image. And carrying out snake image segmentation on the clear hyperspectral image to extract the outline of the single seed, and then mapping the outline to the imaging under other wavelengths to obtain the outline of the seed in other hyperspectral images.
The method for extracting the contour can be a Snake algorithm, a threshold segmentation method, wavelet transformation and the like. Extracting a seed contour of each sample seed in a hyperspectral image acquired under each light source wavelength through a Snake algorithm; the method can effectively utilize local and overall information to realize accurate boundary positioning and keep linear smoothness. The Snake algorithm for extracting the seed outline is to extract the outline of a single seed in a hyperspectral image of a plurality of at least one variety of sample seeds collected under a light source wavelength by utilizing the process that different forces act on a curve, the sample seed outline in the collected hyperspectral image is taken as a target outline, the force moves to the target outline with the minimum energy until the distance between the sample seed outline and the target outline is minimum, and therefore the sample seed outline is segmented.
The Snake model is a deformable parameter curve and a corresponding energy function, a minimized energy target function is taken as a target, the deformation of the parameter curve is controlled, and a closed curve with minimum energy is a target contour. The deformation of the Snake model is controlled by a number of different forces acting simultaneously on the model, each force producing a portion of energy that is expressed as an independent energy term of the energy function of the active contour model. The sample seed contour in the collected hyperspectral image is taken as a target contour, so that an initial curve is firstly placed near the sample seed by the Snake model, the force is moved to the target contour with the minimum energy, and the curve is deformed in the image and continuously approaches the target contour until the distance between the curve and the target contour is minimum. At the moment, the energy reaches the minimum, the force reaches the equilibrium state, and meanwhile, the speed is zero, so that the curve stops moving; thereby causing the sample seed contours to be segmented.
Step S130: calculating the average spectral reflectance per pixel within each seed contour of each of the sample seeds.
In this step S130, specifically, the hyperspectral images of the standard white board may be collected at the plurality of light source wavelengths, respectively, and the images of the black frames may be collected; calculating the ratio of the gray value of the corresponding pixel point position in the hyperspectral image acquired by subtracting the black frame image from the hyperspectral image acquired under the same light source wavelength and the hyperspectral image acquired by subtracting the black frame image from the hyperspectral image of the standard white board acquired under the corresponding light source wavelength to obtain the spectral reflectivity of each pixel point in each seed contour of each sample seed; and respectively averaging the spectral reflectances of all the pixel points in each seed contour of each sample seed to obtain the average spectral reflectivity of the unit pixel in each seed contour of each sample seed.
The calculation formula of the reflectivity I can be expressed as
Figure BDA0002321336500000061
Wherein R israwDenotes the seed spectrum, RblackSpectrum representing a black frame hyperspectral image, RwhiteRepresenting the spectrum of a standard whiteboard.
The outline area of a single seed can be extracted by using an open operation and a close operation. The opening operation can remove noise and eliminate small objects; separating the object at the fine points; the boundaries of larger objects are smoothed without significantly changing the object area. The closed operation can eliminate small voids (referred to as black areas); smoothing the contour of the object; closing (connecting) narrow intermittent points and gullies; filling the contour line fracture.
Specifically, images of the base plate are taken at the plurality of light source wavelengths, respectively; the bottom plate and the bottom plate used for placing the sample seeds in the hyperspectral image of the shot sample seeds are the same, and the bottom plate can be a blackboard and the like.
The hyperspectral images of a plurality of seeds can be obtained through each hyperspectral image; under the same light source wavelength, acquiring a pixel gray value corresponding to a pixel point of a sample seed in a seed contour region in a corresponding hyperspectral image; under the same light source wavelength, obtaining the pixel gray value of the bottom plate image without the sample seeds at the pixel point; and the reflectivity of the pixel point is determined according to the ratio of the pixel gray value of the seed at the pixel point minus the pixel gray value of the black frame to the pixel gray value of the white board minus the gray value of the black frame.
And respectively averaging the spectral reflectances of all the pixel points in each seed contour of each sample seed to obtain the average spectral reflectivity of the unit pixel in each seed contour of each sample seed. Calculating the average value of the reflectivity of all pixel points in the contour region, namely the average reflectivity of one seed; .
Step S140: and generating a training sample according to the average spectral reflectivity of the unit pixel of each sample seed corresponding to all the light source wavelengths and corresponding variety information.
In this step S140, a training sample is generated according to the average spectral reflectance per pixel of each sample seed corresponding to all the light source wavelengths and the corresponding variety information, and specifically, the method may include: smoothing a curve formed by the average spectral reflectivity of the unit pixels of each sample seed corresponding to all the light source wavelengths and calculating a first derivative to obtain a processing result of calculating the first derivative after smoothing the average spectral reflectivity of the unit pixels of each sample seed corresponding to all the light source wavelengths; and obtaining a processing result of a first derivative and corresponding variety information according to the smoothed average spectral reflectivity of the unit pixel of each sample seed corresponding to all the light source wavelengths, and then generating a training sample.
The training sample is divided into a training set and a test set, the training sample is normalized to enable the data range in the training sample to be [0, 1], the training sample is divided into the training set and the test set uniformly according to a certain proportion, and the proportion of the training set to the test set can be 7:3, or the ratio thereof may also be 6: and 4, only ensuring that the data in the training set is not less than the test set.
And performing smooth noise reduction pretreatment on a curve formed by the average spectral reflectivity of unit pixels of each sample seed corresponding to all the light source wavelengths by using a polynomial smoothing algorithm, and solving a first derivative of the curve formed by the average spectral reflectivity, wherein the size of a parameter window adopted by the polynomial smoothing algorithm is 5, and the number of terms is 3.
And performing first derivative calculation on the data obtained after smoothing the curve formed by the average spectral reflectivity of the unit pixels of each sample seed corresponding to all the light source wavelengths by using a first derivative pair smoothing algorithm.
And normalizing the processed result according to the smoothing and first derivative processing of the average spectral reflectivity of the unit pixel of each sample seed corresponding to all the light source wavelengths, and generating a training sample according to the normalized average spectral reflectivity. Forming a plurality of characteristic data (or called characteristic vectors) by utilizing the average reflectivity of each sample seed corresponding to all wavelengths; adding a seed variety label for each characteristic data to form training sample data; the multiple seeds may obtain multiple sample data and form a training sample set.
Step S150: and training the initial classification model by using the training samples corresponding to all the sample seeds to obtain the identification model of each variety of seeds.
This step S150, specifically, may include the steps of: s151, building a Support Vector Machine (SVM) classification model; s152, training the SVM model by using the training samples, and obtaining the parameter with the best classification result according to a grid search algorithm; s153, classifying the training samples according to the trained model, and evaluating the model; and S154, obtaining the identification model of the trained variety seeds.
In the above steps, the support vector machine classification model is a generalized linear classifier for binary classification of data in a supervised learning manner, and is to divide the sample by finding a hyperplane, wherein the division principle is to maximize the interval, and finally convert the interval into a convex quadratic programming problem for solving.
In step S152, the grid search algorithm is to generate a "grid" after listing all possible combination results by arranging and combining the possible values of the parameters. Each combination was then used for training in an SVM classification model and performance was evaluated using cross-validation. After all parameter combinations are tried by the fitting function, a proper classifier is returned, the optimal parameter combination is automatically adjusted, and the optimal parameter value is finally obtained.
In some embodiments, the set light source wavelength range includes 400nm to 720 nm.
After the hyperspectral image of the sample seed is collected, the content of chlorophyll contained in the surface of the sample seed in the hyperspectral image needs to be identified and judged. Chlorophyll responds differently at different wavelengths, and is more sensitive in the red and blue-violet bands, since it absorbs mainly red and blue-violet light. The maximum sensitivity area of the plant to the spectrum is 400 nm-700 nm, because the spectrum is the effective energy area of photosynthesis. Therefore, when the sample seed is photographed using the light source, the wavelength range of the light source should be close to this range. And the wavelength range of the light source is set to be 400nm-720 nm.
According to another aspect of the embodiments of the present invention, there is provided a method for identifying a variety of a seed, which is identified by the method described in the above embodiments.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for identifying a seed variety, comprising a memory, a processor and a computer program stored in the memory and operable on the processor, wherein the processor implements the steps of the method of the above embodiments when executing the program.
Specifically, the computer can control the exposure time, the resolution, the pixel size and the shooting interval of each wavelength when the sample seed is collected and shot by operating software; the process enables the time and wavelength interval to be controlled more accurately, and visual errors and time delay are avoided.
In some embodiments, the authentication device of various embodiments may further comprise:
the LED annular light source is annularly arranged around the lens of the hyperspectral camera and used for providing a light source for uniformly irradiating the sample seeds;
the hyperspectral camera is used for shooting a hyperspectral image of the sample seed under the condition that the light source irradiates the sample seed.
The light irradiating the sample when the sample image is collected is reflected to a lens of a high spectrum camera, is collected by the lens and is irradiated to a light splitting element through the slit enhanced collimation, and is dispersed according to the spectrum in the vertical direction through the light splitting element. And imaging on an image sensor after passing through a light splitting element to obtain a spectral image. Moreover, the LED light source is a cold light source, and the measured object cannot be heated, so that the seeds are inactivated.
Referring to fig. 2, the device for the seed variety identification model may specifically include a hyperspectral camera 1, an LED ring light source 2, an adjusting handle 3, a connecting member 4, a computer 5, an object stage 6, and the like. The hyperspectral camera 1 can comprise a CCD (charge coupled device) lens, a filter assembly and a connecting piece 4, the filter can be used for shooting images of a measured object at different wavelengths, and the CCD lens can be used for imaging and recording the images. The height of the hyperspectral camera 1 can be changed by the adjusting handle 3 on the hyperspectral camera 1, and the focus of the hyperspectral camera aligned to the seed on the objective table 6 is found, so that the imaging of the hyperspectral camera 1 is clear. In addition, the computer 5 may be used to control the hyperspectral camera 1 to capture and process the captured hyperspectral image.
A hyperspectral image of a plurality of at least one variety of sample seeds is acquired by illuminating the plurality of at least one variety of sample seeds with an LED ring light source 2 (light emitting diode ring light source). The annular light source can provide irradiation at different angles, highlight the three-dimensional information of an object and effectively solve the problem of diagonal irradiation shadow. The LED annular light source 2 is used for vertically irradiating the sample seeds, so that more uniform illumination can be provided for the sample seeds, the high spectral image brightness of the obtained sample seeds is uniform, and the spectral error caused by dark illumination of the edge part is avoided.
In order that those skilled in the art will better understand the present invention, embodiments of the present invention will be described below with reference to specific examples.
In one embodiment, a method for generating a seed variety identification model, a method for identifying a seed variety, and an apparatus for generating a seed variety identification model include the steps of:
(1) collecting hyperspectral images of different varieties of seeds by staring a liquid crystal hyperspectral imaging device and matched software;
(2) carrying out contour detection on the seeds of each group of images according to a Snake image segmentation algorithm, and extracting average spectrum data of single seeds after contour information is obtained;
(3) performing smooth noise reduction pretreatment on the spectral data according to a polynomial smoothing algorithm, solving a first derivative of the spectral data, and dividing a spectral data set into a training set and a test set;
(4) carrying out normalization processing on the training set and the test set;
(5) building a Support Vector Machine (SVM) classification model;
(6) training the SVM model by using a training set, and obtaining a parameter with the best classification result according to a grid search algorithm;
(7) classifying the test set according to the trained model, and evaluating the model;
(8) and obtaining the trained SVM classification model.
Respectively performing hyperspectral image acquisition on a plurality of sample seeds of the same variety in the step (1), and dividing the sample seeds of different varieties into a plurality of groups; the wavelength range of a filter used in the staring liquid crystal hyperspectral imaging device is 400nm-720nm, and the shooting interval is 4 nm; the hyperspectral image of the obtained sample seed is shown in figure 3; in the step (2), extracting the seed outline of the single-seed sample in the hyperspectral images collected under each light source wavelength; calculating the average spectral reflectivity of unit pixels in each seed contour of each sample seed; wherein the average spectrum of each sample seed is shown in FIG. 4; in the step (3), the seed varieties of the samples in the training set and the testing set are known varieties; in the step (4), after the data in the training set and the test set are normalized, the data in the training set and the test set are both [0, 1 ]; wherein, the result after the average spectrum smoothing of each seed is shown in fig. 5; in the step (6), the grid search algorithm is to generate a grid after listing all possible combination results by arranging and combining the possible values of each parameter. Each combination was then trained in an SVM (support vector machine) classification model and performance was evaluated using cross-validation. After all parameter combinations are tried by the fitting function, returning to a proper classifier, automatically adjusting to the optimal parameter combination, and finally obtaining the parameter value.
FIG. 6 is a diagram illustrating the accuracy of the training set and the test set of the SVM model according to the different wavelength selection algorithms based on the first derivative of the spectrum according to one embodiment of the present invention. Referring to fig. 6, when a Principal Component Analysis (PCA) is used to perform cluster analysis on spectral data, the training set Accuracy Train _ Accuracy and the Test set Accuracy Test _ Accuracy are shown in a PCA _ SVM bar graph in fig. 6; when a continuous projection algorithm (SPA) is adopted to select the characteristic wavelength, the training set Accuracy rate Train _ Accuracy and the Test set Accuracy rate Test _ Accuracy are shown as an SPA _ SVM bar graph in FIG. 6; when Full bands are used, the training set Accuracy Train _ Accuracy and the Test set Accuracy Test _ Accuracy are shown in the Full _ SVM bar graph in fig. 6. As can be seen by comparison, the PCA and the full-wave band have higher corresponding accuracy, and the SPA has lower corresponding accuracy.
Specifically, 1) spreading the seeds on an object stage 6 of the hyperspectral imaging device, and adjusting the positions of the seeds to be in the center of imaging; 2) adjusting the height of the hyperspectral camera 1 to enable the hyperspectral camera to image clearly; 3) adjusting exposure time and resolution and starting to acquire data; 4) extracting profile information of a single seed according to a snake algorithm, performing open-close operation according to the profile information and an Opencv library, extracting the whole area, and calculating the average reflectivity of the area under each wavelength as the average reflectivity of the waveband; 5) preprocessing a data set: the spectral data has noise, the noise can be removed by preprocessing the data, the noise is reduced according to an SG smoothing algorithm (Savitzky-Golay, polynomial smoothing algorithm) and an FD algorithm (First Derivative), the parameter of the SG algorithm is that the window size is 5, and the term number is 3; 6) segmenting the data set: uniformly dividing a data set into a training set and a test set according to a 7:3 ratio by a data division algorithm in an SKlern library, and carrying out normalization processing on the data; 7) building an SVM classification model according to an SKlern library, and selecting an optimal parameter by utilizing a grid search algorithm to obtain a model with the best effect; 8) starting to train the model by utilizing the training set to obtain parameters of the model with the best effect; 9) classifying the test set according to the parameters in 8) and verifying the performance of the model; and classifying the test set according to the parameters of the model with the best effect obtained in the steps, and verifying the performance of the model.
In summary, in the method for generating the seed variety identification model according to the embodiment of the present invention, the hyperspectral images of a plurality of sample seeds of at least one variety are collected under a plurality of light source wavelengths respectively; extracting the seed outline of each sample seed in a hyperspectral image collected under each light source wavelength; calculating the average spectral reflectivity of unit pixels in each seed contour of each sample seed; generating a training sample according to the average spectral reflectivity of unit pixels of each sample seed corresponding to all the light source wavelengths and corresponding variety information; and training the initial classification model by using the training samples corresponding to all the sample seeds to obtain the identification model of each variety of seeds. By utilizing the trained model, the variety of the seed can be detected quickly and nondestructively, and the detection result has high accuracy; if small-sized equipment is integrated according to the method, the method can bring rapid, convenient and nondestructive seed variety identification for breeding researchers, seed companies and farmers who plant households, and particularly brings great convenience and avoids great loss for expensive and high-yield seeds.
In the description herein, reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. The sequence of steps involved in the various embodiments is provided to schematically illustrate the practice of the invention, and the sequence of steps is not limited and can be suitably adjusted as desired.

Claims (10)

1. A method for generating a seed variety identification model, comprising:
respectively collecting hyperspectral images of a plurality of sample seeds of at least one variety under a plurality of light source wavelengths;
extracting the seed outline of each sample seed in a hyperspectral image collected under each light source wavelength;
calculating the average spectral reflectivity of unit pixels in each seed contour of each sample seed;
generating a training sample according to the average spectral reflectivity of unit pixels of each sample seed corresponding to all the light source wavelengths and corresponding variety information;
and training the initial classification model by using the training samples corresponding to all the sample seeds to obtain the identification model of each variety of seeds.
2. The method of generating a seed variety identification model of claim 1, wherein collecting hyperspectral images of a plurality of sample seeds of at least one variety at a plurality of light source wavelengths, respectively, comprises:
and collecting hyperspectral images of a plurality of sample seeds of at least one variety at set wavelength intervals within a set light source wavelength range.
3. The method of generating a seed variety identification model of claim 1, wherein collecting hyperspectral images of a plurality of sample seeds of at least one variety at a plurality of light source wavelengths, respectively, comprises:
and shooting a plurality of sample seeds of at least one variety under each light source wavelength to obtain a corresponding hyperspectral image.
4. The method for generating the seed variety identification model according to claim 3, wherein extracting the seed contour of each sample seed in the hyperspectral images acquired at each light source wavelength comprises:
selecting a hyperspectral image with clear seed outline from the hyperspectral images shot under the wavelengths of the light sources, and segmenting and extracting the seed outline of each sample seed from the selected hyperspectral image by utilizing a snake segmentation algorithm;
and mapping the extracted various sub-outlines to images under the other light source wavelengths by using a snake algorithm to obtain the seed outlines of the sample seeds in the hyperspectral images shot under the other light source wavelengths.
5. The method of generating a seed variety discrimination model according to claim 2, wherein the set light source wavelength range includes 400nm to 720 nm.
6. The method of generating a seed variety identification model of claim 1, wherein calculating the average spectral reflectance per pixel within each seed contour for each of the sample seeds comprises:
respectively collecting hyperspectral images of the standard white board under the plurality of light source wavelengths, and collecting black frame images;
calculating the ratio of the gray value of the corresponding pixel point position in the hyperspectral image acquired by subtracting the black frame image from the hyperspectral image acquired under the same light source wavelength and the hyperspectral image acquired by subtracting the black frame image from the hyperspectral image of the standard white board acquired under the corresponding light source wavelength to obtain the spectral reflectivity of each pixel point in each seed contour of each sample seed;
and respectively averaging the spectral reflectances of all the pixel points in each seed contour of each sample seed to obtain the average spectral reflectivity of the unit pixel in each seed contour of each sample seed.
7. The method of generating a seed variety evaluation model according to claim 1, wherein generating a training sample based on the average spectral reflectance per pixel for each of the sample seeds corresponding to all the light source wavelengths and corresponding variety information comprises:
smoothing a curve formed by the average spectral reflectivity of the unit pixels of each sample seed corresponding to all the light source wavelengths and calculating a first derivative to obtain a processing result of calculating the first derivative after smoothing the average spectral reflectivity of the unit pixels of each sample seed corresponding to all the light source wavelengths;
and obtaining a processing result of a first derivative and corresponding variety information according to the smoothed average spectral reflectivity of the unit pixel of each sample seed corresponding to all the light source wavelengths, and then generating a training sample.
8. A method for identifying a seed variety, comprising:
identifying whether the seed to be identified is a seed of said variety using the identification model of any one of claims 1 to 7.
9. An apparatus for identifying a seed variety, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to perform the steps of the method of any one of claims 1 to 8.
10. The apparatus for identifying a seed variety of claim 9, further comprising:
the LED annular light source is annularly arranged around the lens of the hyperspectral camera and used for providing a light source for uniformly irradiating the sample seeds;
the hyperspectral camera is used for shooting a hyperspectral image of the sample seed under the condition that the light source irradiates the sample seed.
CN201911298813.2A 2019-12-17 2019-12-17 Method for generating seed variety identification model, identification method and device Pending CN110837823A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911298813.2A CN110837823A (en) 2019-12-17 2019-12-17 Method for generating seed variety identification model, identification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911298813.2A CN110837823A (en) 2019-12-17 2019-12-17 Method for generating seed variety identification model, identification method and device

Publications (1)

Publication Number Publication Date
CN110837823A true CN110837823A (en) 2020-02-25

Family

ID=69578691

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911298813.2A Pending CN110837823A (en) 2019-12-17 2019-12-17 Method for generating seed variety identification model, identification method and device

Country Status (1)

Country Link
CN (1) CN110837823A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111380813A (en) * 2020-03-20 2020-07-07 合肥工业大学 Portable wheat seed multi-quality nondestructive testing device and testing method
CN114136920A (en) * 2021-12-02 2022-03-04 华南农业大学 Hyperspectrum-based single-grain hybrid rice seed variety identification method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102072883A (en) * 2010-07-07 2011-05-25 北京农业智能装备技术研究中心 Device and method for detecting comprehensive quality of crop seeds
US20110125477A1 (en) * 2009-05-14 2011-05-26 Lightner Jonathan E Inverse Modeling for Characteristic Prediction from Multi-Spectral and Hyper-Spectral Remote Sensed Datasets
CN102621077A (en) * 2012-03-30 2012-08-01 江南大学 Hyper-spectral reflection image collecting system and corn seed purity nondestructive detection method based on same
CN105224960A (en) * 2015-11-04 2016-01-06 江南大学 Based on the corn seed classification hyperspectral imagery model of cognition update method of clustering algorithm
CN108734205A (en) * 2018-04-28 2018-11-02 东北电力大学 A kind of simple grain for different cultivars wheat seed pinpoints identification technology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110125477A1 (en) * 2009-05-14 2011-05-26 Lightner Jonathan E Inverse Modeling for Characteristic Prediction from Multi-Spectral and Hyper-Spectral Remote Sensed Datasets
CN102072883A (en) * 2010-07-07 2011-05-25 北京农业智能装备技术研究中心 Device and method for detecting comprehensive quality of crop seeds
CN102621077A (en) * 2012-03-30 2012-08-01 江南大学 Hyper-spectral reflection image collecting system and corn seed purity nondestructive detection method based on same
CN105224960A (en) * 2015-11-04 2016-01-06 江南大学 Based on the corn seed classification hyperspectral imagery model of cognition update method of clustering algorithm
CN108734205A (en) * 2018-04-28 2018-11-02 东北电力大学 A kind of simple grain for different cultivars wheat seed pinpoints identification technology

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
何勇 等: "基于光谱和成像技术的作物养分生理信息快速检测研究进展", 《农业工程学报》 *
孙俊 等: "基于高光谱图像的桑叶农药残留种类鉴别研究", 《农业机械学报》 *
朱秀昌 等: "《数字图像处理与图像信息》", 31 August 2016, 北京邮电大学出版社 *
杨小玲: "高光谱图像技术检测玉米种子品质研究", 《中国优秀博硕士学位论文全文数据库(博士) 农业科技辑》 *
陈功 等: "《草坪高光谱分析技术及其应用》", 31 March 2009, 云南科技出版社 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111380813A (en) * 2020-03-20 2020-07-07 合肥工业大学 Portable wheat seed multi-quality nondestructive testing device and testing method
CN111380813B (en) * 2020-03-20 2022-11-29 合肥工业大学 Portable wheat seed multi-quality nondestructive testing device and testing method
CN114136920A (en) * 2021-12-02 2022-03-04 华南农业大学 Hyperspectrum-based single-grain hybrid rice seed variety identification method

Similar Documents

Publication Publication Date Title
Perez-Sanz et al. Plant phenomics: An overview of image acquisition technologies and image data analysis algorithms
Lottes et al. Effective vision‐based classification for separating sugar beets and weeds for precision farming
Bhargava et al. Fruits and vegetables quality evaluation using computer vision: A review
Shen et al. Domain-invariant interpretable fundus image quality assessment
Barbedo et al. Identifying multiple plant diseases using digital image processing
US11454594B2 (en) Method for identifying frostbite condition of grain seeds using spectral feature wavebands of seed embryo hyperspectral images
Barbedo A review on the main challenges in automatic plant disease identification based on visible range images
Kolhar et al. Plant trait estimation and classification studies in plant phenotyping using machine vision–A review
CN108416344B (en) Method for locating and identifying eyeground color optic disk and yellow spot
Zhou et al. Disease detection of Cercospora Leaf Spot in sugar beet by robust template matching
US9058518B2 (en) Seed classification using spectral analysis to determine existence of a seed structure
Natarajan et al. Detection of disease in tomato plant using Deep Learning Techniques
Yogesh et al. Computer vision based analysis and detection of defects in fruits causes due to nutrients deficiency
CN109765194B (en) Wolfberry producing area identification method based on hyperspectral imaging technology
US20060160065A1 (en) Method for classifying plant embryos using Raman spectroscopy
Shajahan et al. Identification and counting of soybean aphids from digital images using shape classification
CN110837823A (en) Method for generating seed variety identification model, identification method and device
CN114136920A (en) Hyperspectrum-based single-grain hybrid rice seed variety identification method
Suzuki et al. Image segmentation between crop and weed using hyperspectral imaging for weed detection in soybean field
CN108664979A (en) The construction method of Maize Leaf pest and disease damage detection model based on image recognition and application
Du et al. Diagnostic model for wheat leaf conditions using image features and a support vector machine
Lili et al. Classification of herbs plant diseases via hierarchical dynamic artificial neural network after image removal using kernel regression framework
CN113283378B (en) Pig face detection method based on trapezoidal region normalized pixel difference characteristics
CN110135481B (en) Crop lesion detection method and detection device
Choi et al. Illumination-invariant vegetation detection for a vision sensor-based agricultural applications

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200225