CN114062305A - Single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network - Google Patents

Single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network Download PDF

Info

Publication number
CN114062305A
CN114062305A CN202111204576.6A CN202111204576A CN114062305A CN 114062305 A CN114062305 A CN 114062305A CN 202111204576 A CN202111204576 A CN 202111204576A CN 114062305 A CN114062305 A CN 114062305A
Authority
CN
China
Prior art keywords
near infrared
infrared spectrum
resnet network
data
network 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.)
Granted
Application number
CN202111204576.6A
Other languages
Chinese (zh)
Other versions
CN114062305B (en
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.)
Hefei Institutes of Physical Science of CAS
Original Assignee
Hefei Institutes of Physical Science of CAS
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 Hefei Institutes of Physical Science of CAS filed Critical Hefei Institutes of Physical Science of CAS
Priority to CN202111204576.6A priority Critical patent/CN114062305B/en
Publication of CN114062305A publication Critical patent/CN114062305A/en
Application granted granted Critical
Publication of CN114062305B publication Critical patent/CN114062305B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • G01N21/31Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
    • G01N21/35Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light
    • G01N21/359Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light using near infrared light
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • 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

Landscapes

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

Abstract

A single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network belongs to the technical field of crop authenticity identification, and solves the problems of complexity, time consumption and low precision of the single grain variety identification method In the prior art; obtaining the near infrared spectrum of a single crop seed to be identified; carrying out normalization pretreatment on the near infrared spectrum data; training the constructed 1D-In-Resnet network model by using the near infrared spectrum; performing variety authenticity identification on the single grain spectrum of the crop to be classified through the trained 1D-In-Resnet network model to obtain a variety authenticity prediction result; the method can realize quick and accurate judgment of the authenticity of a plurality of crop varieties simultaneously, and extracts the characteristics of different scales through the multi-branch convolution layer, thereby improving the accuracy of the model for identifying the authenticity of crop grains of a plurality of varieties simultaneously.

Description

Single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network
Technical Field
The invention belongs to the technical field of crop authenticity identification, and relates to a single grain variety identification method and system based on near infrared spectrum and a 1D-In-Resnet network.
Background
Rice, wheat and corn are the major food crops in china. The variety greatly affects the quality and yield of the seeds and their processed products of these crops. At present, the rice varieties in the market are thousands of and the wheat and corn varieties are also numerous, so that the phenomena of inferior quality and adulteration occur sometimes, the quality safety of seeds produced and processed by practitioners in related seed industries is damaged, and the grain safety and the good market order according to quality quotations in downstream grain industries are not facilitated. In order to ensure the quality safety of seeds and grains and guide the formation of good markets according to a quality and price mechanism, the variety identification of crop seeds is very necessary. However, the traditional crop variety authenticity identification techniques such as DNA molecule identification, isoenzyme identification, field identification and the like have the disadvantages of complex operation, time-consuming detection results, sample damage, environmental pollution and hysteretic detection results, and especially, the methods have huge workload when a plurality of samples to be detected are available and the authenticity of a plurality of varieties needs to be distinguished simultaneously. According to the notification of 2016 agricultural leading varieties and major-pushing technology in agricultural rural areas, more than 30 rice varieties are mainly pushed in the same year; on the other hand, according to the data of the national rice data center, 572 rice varieties approved only in 2020 are available. A large number of common rice varieties exist in the market, which brings difficulty to the breeding and quality control of representative high-quality rice varieties during planting. Therefore, there is a need to develop a new analysis technique that is accurate, does not damage the sample, and can efficiently identify a large number of rice varieties simultaneously.
At present, the near infrared spectrum technology is used as a novel material component detection technology and has the characteristics of high speed, no damage, high sensitivity and the like. The principle of detecting the organic components of the product is adopted, and the organic components of the conventional rice seeds, the conventional wheat seeds and the conventional corn seeds of different varieties have different degrees of difference, so that the variety authenticity judgment of crop seeds based on near infrared is feasible. The Innovative and rapid analysis for rice authentication and chemimetrics, published in 2.2019, discloses the use of a hand-held spectrometer for the authenticity identification of rice from 3 different origins. A document 'Rice variety identification based on near infrared spectroscopy, SIMCA and PLS-DA' published in 2018 discloses that a near infrared spectroscopy technology is adopted to respectively combine with SIMCA and a partial least squares discriminant analysis method (PLS-DA) to identify 4 Rice varieties.
However, the previous research is mainly based on the discrimination of a few varieties, and there are few research reports on the simultaneous accurate spectral discrimination of more varieties. Therefore, in order to meet the requirement of the seed and grain industry for simultaneously identifying the variety authenticity of a large number of crops, a new and more effective analysis algorithm suitable for analyzing the spectrum big data needs to be developed. Due to the rapid development of computer technology and machine learning technology, the convolutional neural network has been gradually applied to near infrared spectrum analysis as an effective deep learning algorithm, so that the simultaneous discrimination of the authenticity of a plurality of crop varieties based on near infrared spectrum big data becomes possible. On the basis, by further optimizing the network structure and parameters, the identification accuracy is improved, and meanwhile, more varieties and types can be simultaneously distinguished than those reported by the predecessors, so that the method has a wider application prospect.
Disclosure of Invention
The invention aims to design a single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network, so as to solve the problems of complexity, time consumption and low precision of the single grain variety identification method In the prior art.
The invention solves the technical problems through the following technical scheme:
the single grain variety identification method based on the near infrared spectrum and the 1D-In-Resnet network comprises the following steps of:
acquiring a near infrared spectrum of a single crop seed to be identified, and carrying out normalization pretreatment on near infrared spectrum data;
constructing a 1D-In-Resnet network model, wherein the 1D-In-Resnet network model comprises the following steps: the system comprises an input layer, convolution layers, a pooling layer, 3 full-connection layers and an output layer, wherein the convolution layers are 2 branches, the number of the first branch is 1 convolution layer, the number of the second branch is 2 convolution layers, BN regularization is added behind each convolution layer, the outputs of the two branches are merged through a Relu activation function, the output result is added with original data, the output result is flattened after maximum pooling, the input full-connection layers are input, the number of the full-connection layers is 3, the number of nodes of each layer is selected from 0-1000, and finally a classification result is output;
training a 1D-In-Resnet network model by using a near infrared spectrum;
and performing authenticity prediction and identification on the single grain spectrum to be identified by using the trained 1D-In-Resnet network model to obtain an authenticity prediction result.
According to the technical scheme, the near infrared spectrum of a single crop grain to be identified is obtained; carrying out normalization pretreatment on the near infrared spectrum data; training the constructed 1D-In-Resnet network model by using the near infrared spectrum; performing variety authenticity identification on the single grain spectrum of the crop to be classified through the trained 1D-In-Resnet network model to obtain a variety authenticity prediction result; the method can realize quick and accurate judgment of the authenticity of a plurality of crop varieties simultaneously, and extracts the characteristics of different scales through the multi-branch convolution layer, thereby improving the accuracy of the model for identifying the authenticity of crop grains of a plurality of varieties simultaneously.
As a further improvement of the technical scheme of the invention, the method for carrying out normalization pretreatment on the near infrared spectrum data comprises the following steps:
preprocessing input near infrared spectrum data, standardizing by adopting Z-score, solving the mean value and standard deviation of each line of data of a data set, and standardizing the data based on the mean value and standard deviation of original data, wherein new data is (original data-mean value)/standard deviation, and the calculation formula of the mean value and the standard deviation is as follows:
Figure BDA0003306321240000031
Figure BDA0003306321240000032
wherein the content of the first and second substances,
Figure BDA0003306321240000033
is the jth spectral data of the ith variety, N is the number of varieties, mu(i)Is a mean value, σ(j)Is the standard deviation.
As a further improvement of the technical scheme of the invention, the method for training the 1D-In-Resnet network model by utilizing the near infrared spectrum comprises the following steps: the initial normalization processing is carried out on the data set before each training, a random gradient descent algorithm is adopted In the training of the 1D-In-Resnet network model, and the parameters of the established convolutional neural network are learned by continuously reducing the function value of the loss function, so that the training is finished when the iteration times reach 500 epoch.
As a further improvement of the technical solution of the present invention, the formula of the loss function is as follows:
Figure BDA0003306321240000034
wherein, yiY _ predicted for the true value of the ith sampleiPredicted for the ith sample.
As a further improvement of the technical scheme of the invention, the random gradient descent method specifically comprises the following steps: and using the samples to carry out learning parameters and updating in each iteration, wherein the learning parameters and the updating formula of each generation are as follows:
Wt+1=Wttgt (4)
Figure BDA0003306321240000035
where t is the number of iterations, gtFor the updated parameter at time t, WtIs the model parameter at time t, ηtFor learning rate, J (W) is a cost function, isRepresenting a randomly selected one of the gradient directions.
Single grain variety identification system based on near infrared spectrum and 1D-In-Resnet network includes: the system comprises a near infrared spectrum acquisition and normalization processing module, a network model construction module and a network model training and prediction module;
the near infrared spectrum acquisition and normalization processing module is used for acquiring the near infrared spectrum of the crop single grain to be identified and carrying out normalization pretreatment on the near infrared spectrum data;
the network model building module is used for building a 1D-In-Resnet network model, and the 1D-In-Resnet network model comprises: the system comprises an input layer, convolution layers, a pooling layer, 3 full-connection layers and an output layer, wherein the convolution layers are 2 branches, the number of the first branch is 1 convolution layer, the number of the second branch is 2 convolution layers, BN regularization is added behind each convolution layer, the outputs of the two branches are merged through a Relu activation function, the output result is added with original data, the output result is flattened after maximum pooling, the input full-connection layers are input, the number of the full-connection layers is 3, the number of nodes of each layer is selected from 0-1000, and finally a classification result is output;
the network model training and predicting module is used for training the 1D-In-Resnet network model by utilizing the near infrared spectrum, and performing authenticity prediction and recognition on the single grain spectrum to be identified by utilizing the trained 1D-In-Resnet network model to obtain an authenticity prediction result.
As a further improvement of the technical scheme of the invention, the method for carrying out normalization pretreatment on the near infrared spectrum data comprises the following steps:
preprocessing input near infrared spectrum data, standardizing by adopting Z-score, solving the mean value and standard deviation of each line of data of a data set, and standardizing the data based on the mean value and standard deviation of original data, wherein new data is (original data-mean value)/standard deviation, and the calculation formula of the mean value and the standard deviation is as follows:
Figure BDA0003306321240000041
Figure BDA0003306321240000042
wherein the content of the first and second substances,
Figure BDA0003306321240000043
is the jth spectral data of the ith variety, N is the number of varieties, mu(i)Is a mean value, σ(j)Is the standard deviation.
As a further improvement of the technical scheme of the invention, the method for training the 1D-In-Resnet network model by utilizing the near infrared spectrum comprises the following steps: the initial normalization processing is carried out on the data set before each training, a random gradient descent algorithm is adopted In the training of the 1D-In-Resnet network model, and the parameters of the established convolutional neural network are learned by continuously reducing the function value of the loss function, so that the training is finished when the iteration times reach 500 epoch.
As a further improvement of the technical solution of the present invention, the formula of the loss function is as follows:
Figure BDA0003306321240000044
wherein, yiY _ predicted for the true value of the ith sampleiPredicted for the ith sample.
As a further improvement of the technical scheme of the invention, the random gradient descent method specifically comprises the following steps: and using the samples to carry out learning parameters and updating in each iteration, wherein the learning parameters and the updating formula of each generation are as follows:
Wt+1=Wttgt (4)
Figure BDA0003306321240000045
where t is the number of iterations, gtFor the updated parameter at time t, WtIs the model parameter at time t, ηtFor learning rate, J (W) is a cost function, isRepresenting a randomly selected one of the gradient directions.
The invention has the advantages that:
(1) according to the technical scheme, the near infrared spectrum of a single crop grain to be identified is obtained; carrying out normalization pretreatment on the near infrared spectrum data; training the constructed 1D-In-Resnet network model by using the near infrared spectrum; performing variety authenticity identification on the single grain spectrum of the crop to be classified through the trained 1D-In-Resnet network model to obtain a variety authenticity prediction result; the method can realize quick and accurate judgment of the authenticity of a plurality of crop varieties simultaneously, and extracts the characteristics of different scales through the multi-branch convolution layer, thereby improving the accuracy of the model for identifying the authenticity of crop grains of a plurality of varieties simultaneously.
(2) The invention provides a 1D-In-Resnet network model which takes an acceptance network as a basic framework, and is different from the acceptance network In that the model eliminates two branches of 1 x 1 volume and maxporoling In the acceptance network, because the two branches are used for fusing multi-channel information and the number of spectral data channels is 1, the two branches are eliminated In order to reduce the complexity of the model. Meanwhile, in order to improve the training speed of the model, residual error elements in the Resnet network are added, the combined result is added with the original input, the information loss is reduced, the prediction accuracy of the model is improved, and the method is favorable for realizing more accurate variety authenticity judgment.
Drawings
FIG. 1 is a flowchart of a single grain variety identification method based on near infrared spectroscopy and a 1D-In-Resnet network according to a first embodiment of the present invention;
FIG. 2 is a near infrared spectrum of rice kernels according to a first embodiment of the present invention;
FIG. 3 is a diagram of a 1D-In-resnet network architecture according to a first embodiment of the present invention;
fig. 4 is a confusion matrix thermodynamic diagram of the spectrum discrimination result of the 24 wheat varieties according to the first embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The technical scheme of the invention is further described by combining the drawings and the specific embodiments in the specification:
example one
As shown In figure 1, the single grain variety identification method based on the near infrared spectrum and the 1D-In-Resnet network comprises the following steps:
1. acquiring a near infrared spectrum of a single crop seed to be identified;
the single grain of the crop to be identified is the single grain seed of rice, wheat and corn or the filial generation thereof, wherein the rice variety is a conventional rice variety.
Taking wheat as an example for detailed description, 24 mature, full and complete wheat single-grain samples with known variety types are collected, 100 seeds are adopted by each variety as detection objects, and spectrum collection is carried out in a near-infrared high-flux spectrum collection system. The collection range of the spectrometer is 1100-2500nm, and the collection gate width is 1 ms. Spectra were collected once per seed. 2400 wheat near infrared spectrum data are obtained. Randomly taking 80% of each variety as a training set and 20% as a testing set. The training set is used for constructing the model, and the testing set is used for verifying the prediction effect of the model. The near infrared spectra of the wheat samples of 24 varieties collected in the near infrared high-throughput spectrum collection system are shown in fig. 2.
2. The method specifically comprises the following steps of carrying out normalization pretreatment on near infrared spectrum data:
preprocessing input spectral data, standardizing by adopting Z-score, calculating the mean value and standard deviation of each line of data of a data set, and standardizing the data based on the mean value and standard deviation of original data, wherein new data is (original data-mean value)/standard deviation, and the mean value and standard deviation calculation formula is as follows:
Figure BDA0003306321240000061
Figure BDA0003306321240000062
wherein the content of the first and second substances,
Figure BDA0003306321240000063
is the jth spectral data of the ith variety, N is the number of varieties, mu(i)Is a mean value, σ(j)Is the standard deviation.
3. Construction of 1D-In-Resnet network model
The construction of the 1D-In-Resnet network model comprises the following steps: the multi-branch intelligent network node comprises an input layer, convolution layers, a pooling layer, 3 full-connection layers and an output layer, wherein the convolution layers are 2 branches, the first branch is 1 multiplied by 5 multiplied by 8 convolution layers, the second branch is 2 multiplied by 5 multiplied by 8 convolution layers, BN regularization is added behind each convolution layer, outputs of the two branches are merged (conversion) through a Relu activation function, an output result and original data are added (Add), the output result and the original data are maximally pooled and then flattened through 1 multiplied by 2(s is 1), and the output result is input into the full-connection layers. The total connection layer has 3 layers, the parameters are respectively 500, 250 and 250, and finally, the classification result is output.
As shown In fig. 3, the proposed 1D-In-Resnet network model uses an initiation network as a basic architecture, and is different from the initiation network In that two branches, namely 1 × 1 convolution and maxporoling, In the initiation network are removed, because the two branches are used for fusing multi-channel information, and the number of spectral data channels is 1, so that the model complexity is reduced. Meanwhile, in order to improve the accuracy of the model, residual error elements in the Resnet network are added, and the combined result is added to the original input.
4. The constructed 1D-In-Resnet network model is trained by utilizing the near infrared spectrum, and the method specifically comprises the following steps:
performing initial normalization processing on a data set before each training, learning the parameters of the established convolutional neural network by continuously reducing the function value of a loss function by adopting a random gradient descent algorithm In the training of the 1D-In-Resnet network model, and finishing the training when the iteration times reach 500 epoch;
wherein the loss function loss is expressed as follows:
Figure BDA0003306321240000071
wherein, yiY _ predicted for the true value of the ith sampleiPredicted for the ith sample.
The stochastic gradient descent method adopted during the training of the convolutional neural network model refers to that the samples are used for learning parameters and updating in each iteration, and the learning parameters and the updating of each generation can be expressed as formulas (4) and (5):
Wt+1=Wttgt (4)
Figure BDA0003306321240000072
where t is the number of iterations, gtFor the updated parameter at time t, WtIs the model parameter at time t, ηtFor learning rate, J (W) is a cost function, isRepresenting a randomly selected one of the gradient directions.
5. And performing authenticity prediction and identification on the single grain spectrum of the crop to be identified by using the trained 1D-In-Resnet network model to obtain a crop authenticity prediction result. During prediction, spectra of crop grains to be detected are acquired under the same conditions as those in the step 1, the spectra are preprocessed by the method in the step 2, and the preprocessed spectra are predicted by the model constructed in the step 3-4, so that the category attribution of the sample is obtained.
And predicting a test set sample by using the constructed 1D-In-resnet model so as to verify the identification effect of the model. The collection condition, the preprocessing method and the training set of the test set sample are the same.
By contrast, the present invention uses a common machine learning algorithm: and the 1D-CNN network, the 1D-inclusion network and the traditional PLS-DA algorithm are used as comparative construction models to predict the test set samples. Table 1 shows the parameter distribution of three neural network models.
TABLE 1 distribution of three neural network model parameters
Figure BDA0003306321240000081
And comparing the predicted values and the true values of the three types of model prediction test set varieties, and evaluating the recognition performance of the models.
The recognition performance of the model is evaluated by Accuracy (ACC), Precision (PRE), Recall (REC) and F1 scores, and the calculation formula is as follows:
the Accuracy (ACC) calculation formula is:
Figure BDA0003306321240000082
the accuracy ratio (PRE) is calculated as:
Figure BDA0003306321240000083
the recall Ratio (REC) is calculated by the formula:
Figure BDA0003306321240000084
f1 is calculated as:
Figure BDA0003306321240000085
wherein TP is the number of target variety grains correctly judged by the model; FN is the number of seeds of the target variety which are wrongly judged as non-target variety by the model; FP is the number of seeds of the non-target variety which are judged by the model as seeds of the target variety; TN is the number of seeds of non-target variety correctly judged by the model; the F1 score is a harmonic mean between accuracy and recall.
Each network was trained 10 times, the results averaged and the predicted results are shown in table 2. As can be seen from Table 2, the 1D-In-resnet network has higher accuracy compared with the authenticity identification of crops of other network architectures, and the accuracy is 95.35%, 0.33% higher than that of 1D-initiation, 0.89% higher than that of 1D-CNN and 24.83% higher than that of PLS-DA. The F1 parameter is 95.42%, which is the largest among 3 networks, and the model accuracy is the highest, thus proving the effectiveness of the embodiment.
TABLE 2 prediction results
Network ACC PRE REC F1
1D-In-resnet 95.35% 95.42% 95.42% 95.42%
1D-Inception 95.02% 94.79% 94.79% 94.79%
1D-CNN 94.46% 94.58% 94.58% 94.58%
PLS-DA 70.52% 70% 70% 70%
As shown In FIG. 4, the 1D-In-resnet model outputs a confusion matrix thermodynamic diagram of 24 wheat varieties, wherein the small squares on the diagonal line represent the number of correct classifications for each sample, the small squares outside the diagonal line represent the number of incorrect classifications, the darker the color of the small squares on the diagonal line represents the greater the number of correct classifications, the maximum value of the color of each small square is 20, and the minimum value is 0. In fig. 4, there are 11 categories ( categories 1,3,7,12,13,14,15,16,19, 20, 21) with a classification accuracy of 100%, 8 categories (categories 0,4,5,6,9,10,17, 22) with a classification accuracy of 95%, 3 categories (categories 2,11, 23) with a classification accuracy of 90%, and 2 categories (categories 8, 18) with a classification accuracy of 80%.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. The single grain variety identification method based on the near infrared spectrum and the 1D-In-Resnet network is characterized by comprising the following steps of:
acquiring a near infrared spectrum of a single crop seed to be identified, and carrying out normalization pretreatment on near infrared spectrum data;
constructing a 1D-In-Resnet network model, wherein the 1D-In-Resnet network model comprises the following steps: the method comprises the steps of inputting a layer, a convolution layer, a pooling layer, 3 full-connection layers and an outputting layer, wherein the convolution layer comprises 2 branches, 1 convolution layer of a first branch and 2 convolution layers of a second branch, BN regularization is added behind each convolution layer, the outputs of the two branches are merged through a Relu activation function, the output result is added with original data, the merged layers are flattened after maximum pooling, the input full-connection layers are input, the number of the full-connection layers is 3, parameters of each layer are selected from 0-1000, and finally a classification result is output;
training a 1D-In-Resnet network model by using a near infrared spectrum;
and performing authenticity prediction and identification on the single grain spectrum to be identified by using the trained 1D-In-Resnet network model to obtain an authenticity prediction result.
2. The single grain variety identification method based on the near infrared spectrum and the 1D-In-Resnet network according to claim 1, wherein the method for performing normalization pretreatment on the near infrared spectrum data comprises the following steps:
preprocessing input near infrared spectrum data, standardizing by adopting Z-score, solving the mean value and standard deviation of each line of data of a data set, and standardizing the data based on the mean value and standard deviation of original data, wherein new data is (original data-mean value)/standard deviation, and the calculation formula of the mean value and the standard deviation is as follows:
Figure FDA0003306321230000011
Figure FDA0003306321230000012
wherein the content of the first and second substances,
Figure FDA0003306321230000013
is the jth spectral data of the ith variety, N is the number of varieties, mu(i)Is a mean value, σ(j)Is the standard deviation.
3. The method for identifying the single grain variety based on the near infrared spectrum and the 1D-In-Resnet network as claimed In claim 2, wherein the method for training the 1D-In-Resnet network model by using the near infrared spectrum comprises the following steps: the initial normalization processing is carried out on the data set before each training, a random gradient descent algorithm is adopted In the training of the 1D-In-Resnet network model, and the parameters of the established convolutional neural network are learned by continuously reducing the function value of the loss function, so that the training is finished when the iteration times reach 500 epoch.
4. The method for identifying a single grain variety based on near infrared spectroscopy and a 1D-In-Resnet network according to claim 3, wherein the loss function has the following formula:
Figure FDA0003306321230000021
wherein, yiIs the ith sampleTrue value, y _ predictediPredicted for the ith sample.
5. The single grain variety identification method based on the near infrared spectrum and the 1D-In-Resnet network according to claim 4, wherein the random gradient descent method specifically comprises the following steps: and using the samples to carry out learning parameters and updating in each iteration, wherein the learning parameters and the updating formula of each generation are as follows:
Wt+1=Wttgt (4)
Figure FDA0003306321230000022
where t is the number of iterations, gtFor the updated parameter at time t, WtIs the model parameter at time t, ηtFor learning rate, J (W) is a cost function, isRepresenting a randomly selected one of the gradient directions.
6. Single grain variety identification system based on near infrared spectrum and 1D-In-Resnet network, characterized by comprising: the system comprises a near infrared spectrum acquisition and normalization processing module, a network model construction module and a network model training and prediction module;
the near infrared spectrum acquisition and normalization processing module is used for acquiring the near infrared spectrum of the crop single grain to be identified and carrying out normalization pretreatment on the near infrared spectrum data;
the network model building module is used for building a 1D-In-Resnet network model, and the 1D-In-Resnet network model comprises: the system comprises an input layer, convolution layers, a pooling layer, 3 full-connection layers and an output layer, wherein the convolution layers are 2 branches, the first branch is 1 × 5 × 8 convolution layer, the second branch is 2 × 5 × 8 convolution layers, BN regularization is added behind each convolution layer, the output of the two branches is merged through a Relu activation function, the output result is added with original data, the output result is flattened after being maximally pooled by 1 × 2(s ═ 1), the input is performed on the full-connection layers, the full-connection layers are 3 layers in total, the parameters are 500, 250 and 250 respectively, and finally, a classification result is output;
the network model training and predicting module is used for training the 1D-In-Resnet network model by utilizing the near infrared spectrum, and performing authenticity prediction and recognition on the single grain spectrum to be identified by utilizing the trained 1D-In-Resnet network model to obtain an authenticity prediction result.
7. The single grain variety identification system based on near infrared spectroscopy and 1D-In-Resnet network according to claim 6, wherein the method for normalizing and preprocessing the near infrared spectroscopy data comprises:
preprocessing input near infrared spectrum data, standardizing by adopting Z-score, solving the mean value and standard deviation of each line of data of a data set, and standardizing the data based on the mean value and standard deviation of original data, wherein new data is (original data-mean value)/standard deviation, and the calculation formula of the mean value and the standard deviation is as follows:
Figure FDA0003306321230000031
Figure FDA0003306321230000032
wherein the content of the first and second substances,
Figure FDA0003306321230000033
is the jth spectral data of the ith variety, N is the number of varieties, mu(i)Is a mean value, σ(j)Is the standard deviation.
8. The single grain variety identification system based on the near infrared spectrum and the 1D-In-Resnet network according to claim 7, wherein the method for training the 1D-In-Resnet network model by using the near infrared spectrum comprises the following steps: the initial normalization processing is carried out on the data set before each training, a random gradient descent algorithm is adopted In the training of the 1D-In-Resnet network model, and the parameters of the established convolutional neural network are learned by continuously reducing the function value of the loss function, so that the training is finished when the iteration times reach 500 epoch.
9. The single grain variety authentication system based on near infrared spectroscopy and 1D-In-Resnet network as claimed In claim 8, wherein the loss function is formulated as follows:
Figure FDA0003306321230000034
wherein, yiY _ predicted for the true value of the ith sampleiPredicted for the ith sample.
10. The single grain variety identification system based on the near infrared spectrum and the 1D-In-Resnet network according to claim 9, wherein the random gradient descent method specifically comprises: and using the samples to carry out learning parameters and updating in each iteration, wherein the learning parameters and the updating formula of each generation are as follows:
Wt+1=Wttgt (4)
Figure FDA0003306321230000035
where t is the number of iterations, gtFor the updated parameter at time t, WtIs the model parameter at time t, ηtFor learning rate, J (W) is a cost function, isRepresenting a randomly selected one of the gradient directions.
CN202111204576.6A 2021-10-15 2021-10-15 Single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network Active CN114062305B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111204576.6A CN114062305B (en) 2021-10-15 2021-10-15 Single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111204576.6A CN114062305B (en) 2021-10-15 2021-10-15 Single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network

Publications (2)

Publication Number Publication Date
CN114062305A true CN114062305A (en) 2022-02-18
CN114062305B CN114062305B (en) 2024-01-26

Family

ID=80234741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111204576.6A Active CN114062305B (en) 2021-10-15 2021-10-15 Single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network

Country Status (1)

Country Link
CN (1) CN114062305B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114778485A (en) * 2022-06-16 2022-07-22 中化现代农业有限公司 Variety identification method and system based on near infrared spectrum and attention mechanism network

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102179375A (en) * 2011-03-09 2011-09-14 中国科学院合肥物质科学研究院 Nondestructive detecting and screening method based on near-infrared for crop single-grain components
KR20170055753A (en) * 2015-11-12 2017-05-22 대한민국(농촌진흥청장) Method for discriminating the cultivar of forage seeds using near-infrared spectroscopy
CN107037001A (en) * 2017-06-15 2017-08-11 中国科学院半导体研究所 A kind of corn monoploid seed discrimination method based on near-infrared spectrum technique
CN107478598A (en) * 2017-09-01 2017-12-15 广东省智能制造研究所 A kind of near-infrared spectral analytical method based on one-dimensional convolutional neural networks
CN109064462A (en) * 2018-08-06 2018-12-21 长沙理工大学 A kind of detection method of surface flaw of steel rail based on deep learning
CN109253983A (en) * 2018-11-30 2019-01-22 上海海洋大学 The method of Rapid identification and detection parvalbumin based on middle infrared spectrum and nerual network technique
CN109470648A (en) * 2018-11-21 2019-03-15 中国科学院合肥物质科学研究院 A kind of single grain crop unsound grain quick nondestructive determination method
CN109883990A (en) * 2019-02-28 2019-06-14 吉林大学 A kind of medicinal fungi near-infrared spectral analytical method
CN110567889A (en) * 2019-09-12 2019-12-13 中国计量大学 Nondestructive testing method for water content of fresh cocoons based on spectral imaging and deep learning technology
CN110705372A (en) * 2019-09-10 2020-01-17 中国科学院上海技术物理研究所 LIBS multi-component quantitative inversion method based on deep learning convolutional neural network
CN110717368A (en) * 2018-07-13 2020-01-21 北京服装学院 Qualitative classification method for textiles
CN111220958A (en) * 2019-12-10 2020-06-02 西安宁远电子电工技术有限公司 Radar target Doppler image classification and identification method based on one-dimensional convolutional neural network
CN111507319A (en) * 2020-07-01 2020-08-07 南京信息工程大学 Crop disease identification method based on deep fusion convolution network model
CN111797930A (en) * 2020-07-07 2020-10-20 四川长虹电器股份有限公司 Fabric material near infrared spectrum identification and identification method based on twin network
CN112098361A (en) * 2020-08-20 2020-12-18 苏州浩旸华智能科技有限公司 Corn seed identification method based on near infrared spectrum
CN112924412A (en) * 2021-01-22 2021-06-08 中国科学院合肥物质科学研究院 Single-grain rice variety authenticity distinguishing method and device based on near infrared spectrum
CN113378971A (en) * 2021-06-28 2021-09-10 燕山大学 Near infrared spectrum classification model training method and system and classification method and system
CN113406030A (en) * 2021-08-04 2021-09-17 石河子大学 Hami melon pesticide residue identification method based on convolutional neural network

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102179375A (en) * 2011-03-09 2011-09-14 中国科学院合肥物质科学研究院 Nondestructive detecting and screening method based on near-infrared for crop single-grain components
KR20170055753A (en) * 2015-11-12 2017-05-22 대한민국(농촌진흥청장) Method for discriminating the cultivar of forage seeds using near-infrared spectroscopy
CN107037001A (en) * 2017-06-15 2017-08-11 中国科学院半导体研究所 A kind of corn monoploid seed discrimination method based on near-infrared spectrum technique
CN107478598A (en) * 2017-09-01 2017-12-15 广东省智能制造研究所 A kind of near-infrared spectral analytical method based on one-dimensional convolutional neural networks
CN110717368A (en) * 2018-07-13 2020-01-21 北京服装学院 Qualitative classification method for textiles
CN109064462A (en) * 2018-08-06 2018-12-21 长沙理工大学 A kind of detection method of surface flaw of steel rail based on deep learning
CN109470648A (en) * 2018-11-21 2019-03-15 中国科学院合肥物质科学研究院 A kind of single grain crop unsound grain quick nondestructive determination method
CN109253983A (en) * 2018-11-30 2019-01-22 上海海洋大学 The method of Rapid identification and detection parvalbumin based on middle infrared spectrum and nerual network technique
CN109883990A (en) * 2019-02-28 2019-06-14 吉林大学 A kind of medicinal fungi near-infrared spectral analytical method
CN110705372A (en) * 2019-09-10 2020-01-17 中国科学院上海技术物理研究所 LIBS multi-component quantitative inversion method based on deep learning convolutional neural network
CN110567889A (en) * 2019-09-12 2019-12-13 中国计量大学 Nondestructive testing method for water content of fresh cocoons based on spectral imaging and deep learning technology
CN111220958A (en) * 2019-12-10 2020-06-02 西安宁远电子电工技术有限公司 Radar target Doppler image classification and identification method based on one-dimensional convolutional neural network
CN111507319A (en) * 2020-07-01 2020-08-07 南京信息工程大学 Crop disease identification method based on deep fusion convolution network model
CN111797930A (en) * 2020-07-07 2020-10-20 四川长虹电器股份有限公司 Fabric material near infrared spectrum identification and identification method based on twin network
CN112098361A (en) * 2020-08-20 2020-12-18 苏州浩旸华智能科技有限公司 Corn seed identification method based on near infrared spectrum
CN112924412A (en) * 2021-01-22 2021-06-08 中国科学院合肥物质科学研究院 Single-grain rice variety authenticity distinguishing method and device based on near infrared spectrum
CN113378971A (en) * 2021-06-28 2021-09-10 燕山大学 Near infrared spectrum classification model training method and system and classification method and system
CN113406030A (en) * 2021-08-04 2021-09-17 石河子大学 Hami melon pesticide residue identification method based on convolutional neural network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
XIAOHONG LI 等: ""Research on high-throughput crop authenticity identification method based on near-infrared spectroscopy and InResSpectra model "", 《INFRARED PHYSICS AND TECHNOLOGY 》, no. 125 *
李景军;张宸;曹强;: "面向训练阶段的神经网络性能分析", 计算机科学与探索, no. 10 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114778485A (en) * 2022-06-16 2022-07-22 中化现代农业有限公司 Variety identification method and system based on near infrared spectrum and attention mechanism network

Also Published As

Publication number Publication date
CN114062305B (en) 2024-01-26

Similar Documents

Publication Publication Date Title
TU et al. Selection for high quality pepper seeds by machine vision and classifiers
CN109470648B (en) Rapid nondestructive determination method for imperfect grains of single-grain crops
CN112924412B (en) Single-grain rice variety authenticity distinguishing method and device based on near infrared spectrum
CN101819141B (en) Maize variety identification method based on near infrared spectrum and information processing
CN111914728B (en) Hyperspectral remote sensing image semi-supervised classification method and device and storage medium
CN111126471A (en) Microseism event detection method and system
CN105117734B (en) Corn seed classification hyperspectral imagery recognition methods based on model online updating
CN112756759B (en) Spot welding robot workstation fault judgment method
CN112700325A (en) Method for predicting online credit return customers based on Stacking ensemble learning
CN103048273A (en) Fruit near infrared spectrum sorting method based on fuzzy clustering
CN116204831A (en) Road-to-ground analysis method based on neural network
CN111539657A (en) Typical electricity consumption industry load characteristic classification and synthesis method combined with user daily electricity consumption curve
CN114062305A (en) Single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network
CN111693487A (en) Fruit sugar degree detection method and system based on genetic algorithm and extreme learning machine
CN111309577A (en) Spark-oriented batch processing application execution time prediction model construction method
CN104990891B (en) A kind of seed near infrared spectrum and spectrum picture qualitative analysis model method for building up
Balasubramaniyan et al. Color contour texture based peanut classification using deep spread spectral features classification model for assortment identification
McDonald et al. Images, features, or feature distributions? A comparison of inputs for training convolutional neural networks to classify lentil and field pea milling fractions
CN114778485B (en) Variety identification method and system based on near infrared spectrum and attention mechanism network
CN113608223A (en) Single-station Doppler weather radar strong precipitation estimation method based on double-branch double-stage depth model
CN113310934A (en) Method for quickly identifying milk cow milk mixed in camel milk and mixing proportion thereof
CN108663334A (en) The method for finding soil nutrient spectral signature wavelength based on multiple Classifiers Combination
CN108344701A (en) Paraffin grade qualitative classification based on hyperspectral technique and quantitative homing method
Li et al. Research on high-throughput crop authenticity identification method based on near-infrared spectroscopy and InResSpectra model
CN116738172A (en) Large-scale mixed exposure data analysis method based on machine learning

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
GR01 Patent grant
GR01 Patent grant