CN114062305B - 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 PDFInfo
- Publication number
- CN114062305B CN114062305B CN202111204576.6A CN202111204576A CN114062305B CN 114062305 B CN114062305 B CN 114062305B CN 202111204576 A CN202111204576 A CN 202111204576A CN 114062305 B CN114062305 B CN 114062305B
- 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.)
- Active
Links
- 238000002329 infrared spectrum Methods 0.000 title claims abstract description 59
- 238000000034 method Methods 0.000 title claims abstract description 31
- 238000012549 training Methods 0.000 claims abstract description 35
- 238000001228 spectrum Methods 0.000 claims abstract description 25
- 238000010606 normalization Methods 0.000 claims abstract description 19
- 230000006870 function Effects 0.000 claims description 19
- 238000004364 calculation method Methods 0.000 claims description 10
- 238000011176 pooling Methods 0.000 claims description 10
- 238000013527 convolutional neural network Methods 0.000 claims description 9
- 238000012545 processing Methods 0.000 claims description 9
- 238000010276 construction Methods 0.000 claims description 7
- 238000011478 gradient descent method Methods 0.000 claims description 7
- 230000004913 activation Effects 0.000 claims description 5
- 238000007781 pre-processing Methods 0.000 claims description 5
- 238000004497 NIR spectroscopy Methods 0.000 claims description 3
- 239000000284 extract Substances 0.000 abstract description 3
- 235000013339 cereals Nutrition 0.000 description 16
- 241000209094 Oryza Species 0.000 description 14
- 235000007164 Oryza sativa Nutrition 0.000 description 14
- 235000009566 rice Nutrition 0.000 description 14
- 241000209140 Triticum Species 0.000 description 10
- 235000021307 Triticum Nutrition 0.000 description 10
- 230000006872 improvement Effects 0.000 description 8
- 238000012360 testing method Methods 0.000 description 6
- 238000001514 detection method Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 240000008042 Zea mays Species 0.000 description 4
- 235000005824 Zea mays ssp. parviglumis Nutrition 0.000 description 4
- 235000002017 Zea mays subsp mays Nutrition 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 4
- 235000005822 corn Nutrition 0.000 description 4
- 238000010239 partial least squares discriminant analysis Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000015572 biosynthetic process Effects 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 108010044467 Isoenzymes Proteins 0.000 description 1
- 240000007594 Oryza sativa Species 0.000 description 1
- 238000009395 breeding Methods 0.000 description 1
- 230000001488 breeding effect Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000003912 environmental pollution Methods 0.000 description 1
- 230000004907 flux Effects 0.000 description 1
- 235000013305 food Nutrition 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000002203 pretreatment Methods 0.000 description 1
- 238000003908 quality control method Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 230000003595 spectral effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/17—Systems in which incident light is modified in accordance with the properties of the material investigated
- G01N21/25—Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
- G01N21/31—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
- G01N21/35—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light
- G01N21/359—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light using near infrared light
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N2021/8466—Investigation of vegetal material, e.g. leaves, plants, fruits
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Pathology (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Immunology (AREA)
- Biochemistry (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Investigating Or Analysing Materials By Optical Means (AREA)
Abstract
A single seed 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 complex, time-consuming and low precision of the single seed variety identification method In the prior art; obtaining near infrared spectrum of 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 utilizing the near infrared spectrum; carrying out 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 rapid and accurate discrimination of the authenticity of a plurality of crop varieties simultaneously, extracts the characteristics of different scales through the multi-branch convolution layer, and improves the accuracy of identifying the authenticity of the crop seeds of the varieties simultaneously by the model.
Description
Technical Field
The invention belongs to the technical field of crop authenticity identification, and relates to a single seed variety identification method and system based on near infrared spectrum and a 1D-In-Resnet network.
Background
Rice, wheat and corn are the main food crops in china. Varieties greatly affect the quality and yield of seeds and processed products of these crops. The number of rice varieties is thousands, wheat and corn varieties in the current market is numerous, the phenomenon of false adulteration occurs when the rice varieties are secondary, the quality safety of processed seeds produced by practitioners in related seed industries is damaged, and meanwhile, the grain safety in the downstream grain industry and the formation of good market order according to quality arguments are also not facilitated. In order to ensure the quality safety of seeds and grains, the formation of a good market price-based mechanism is guided, and the method is necessary for variety identification of crop seeds. However, conventional crop variety authenticity identification technologies such as methods of DNA molecular identification, isozyme identification, field identification and the like have the defects of complex operation, time-consuming detection results, sample damage, environmental pollution and hysteresis of detection results, and particularly, when a plurality of samples to be detected are more and multiple varieties are required to be distinguished simultaneously, the methods have huge workload. The large number of common rice varieties existing in the market brings difficulty to the quality control during the breeding and planting of representative high-quality rice varieties. Therefore, there is a need to develop new analytical techniques that are accurate, do not damage the sample, and can efficiently identify a large number of rice varieties at the same time.
At present, the near infrared spectrum technology is used as an emerging material component detection technology, and has the characteristics of rapidness, no damage, high sensitivity and the like. The organic components of the detection product are adopted as the principle, and the organic components among the conventional rice seeds, the wheat seeds and the corn seeds of different varieties are different in degree, so that the variety authenticity judgment of the crop seeds based on near infrared is feasible. Document Innovative and rapid analysis for rice authenticity using hand-held NIRspectrometry and chemometrics, publication No. 2019, month 2, discloses the use of a hand-held spectrometer for the authenticity verification of rice in 3 different producing areas. The publication "rice variety discrimination based on near infrared Spectrum and SIMCA and PLS-DA" of publication date 2018 discloses discrimination of 4 rice varieties by near infrared Spectroscopy in combination with SIMCA and partial least squares discriminant analysis (PLS-DA), respectively.
However, previous studies are mainly based on discrimination of few varieties, and there are few reports of simultaneous accurate spectrum discrimination of more varieties. Therefore, to meet the need of the seed and grain industries to identify variety authenticity of a large number of crops at the same time, there is also a need to develop new and more efficient analysis algorithms suitable for resolving spectral big data. Due to the rapid development of computer technology and machine learning technology, convolutional neural networks have been increasingly applied to near infrared spectrum analysis as an effective deep learning algorithm, so that simultaneous discrimination of the authenticity of a plurality of crop varieties based on near infrared spectrum big data is possible. On the basis, by further optimizing the network structure and parameters, the identification accuracy is improved, meanwhile, more varieties can be simultaneously identified than those reported by the former, and the method has wider application prospect.
Disclosure of Invention
The invention aims at designing a single seed variety identification method and a system based on a near infrared spectrum and a 1D-In-Resnet network so as to solve the problems of complex, time-consuming and low precision of the single seed 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:
acquiring a near infrared spectrum of a single seed of a crop 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, a convolution layer, a pooling layer, 3 full-connection layers and an output layer, wherein the convolution layer comprises 2 branches, a first branch is 1 convolution layer, a second branch is 2 convolution layers, BN regularization is added behind each convolution layer, outputs of the two branches are combined through a Relu activation function, output results are added with original data, the original data are flattened after pooling to the maximum extent, the full-connection layers are input, the total number of the full-connection layers is 3, the number of nodes of each layer is selected to be between 0 and 1000, and finally classification results are output;
training a 1D-In-Resnet network model by utilizing a near infrared spectrum;
and carrying out 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, near infrared spectrums of single crop seeds to be identified are obtained; carrying out normalization pretreatment on the near infrared spectrum data; training the constructed 1D-In-Resnet network model by utilizing the near infrared spectrum; carrying out 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 rapid and accurate discrimination of the authenticity of a plurality of crop varieties simultaneously, extracts the characteristics of different scales through the multi-branch convolution layer, and improves the accuracy of identifying the authenticity of the crop seeds of the varieties simultaneously by the model.
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, adopting Z-score standardization, calculating the mean value and standard deviation of each column of data of a data set, carrying out data standardization based on the mean value and standard deviation of original data, and calculating the new data= (original data-mean value)/standard deviation by the following calculation formulas:
(1)
(2)
wherein,is->No. H of individual cultivars>Data of strip spectra>For the number of varieties, ->For mean value->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: and (3) carrying out initial normalization processing on the data set before each training, adopting a random gradient descent algorithm In the training of the 1D-In-Resnet network model, and learning the parameters of the established convolutional neural network by continuously reducing the function value of the loss function, so that the training is finished when the iteration number reaches 500 epoch.
As a further improvement of the technical scheme of the invention, the formula of the loss function is as follows:
(3)
wherein,is->True value of individual samples->Is->Predicted values for each sample.
As a further improvement of the technical scheme of the invention, the random gradient descent method specifically comprises the following steps: the sample is used for learning parameters and updating in each iteration, and the formulas of the learning parameters and updating of each generation are as follows:
(4)
(5)
where t is the number of iterations,is->Parameters of the time update->For the model parameters at time t, +.>For learning rate->As a cost function->Representing a randomly selected one of the gradient directions.
A single grain variety identification system based on near infrared spectroscopy and 1D-In-reset network, 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 single crop grain to be identified and performing normalization pretreatment on near infrared spectrum data;
the network model construction module is used for constructing a 1D-In-Resnet network model, and the 1D-In-Resnet network model comprises: the system comprises an input layer, a convolution layer, a pooling layer, 3 full-connection layers and an output layer, wherein the convolution layer comprises 2 branches, a first branch is 1 convolution layer, a second branch is 2 convolution layers, BN regularization is added behind each convolution layer, outputs of the two branches are combined through a Relu activation function, output results are added with original data, the original data are flattened after pooling to the maximum extent, the full-connection layers are input, the total number of the full-connection layers is 3, the number of nodes of each layer is selected to be between 0 and 1000, and finally classification results are 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 carrying out authenticity prediction 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, adopting Z-score standardization, calculating the mean value and standard deviation of each column of data of a data set, carrying out data standardization based on the mean value and standard deviation of original data, and calculating the new data= (original data-mean value)/standard deviation by the following calculation formulas:
(1)
(2)
wherein,is->No. H of individual cultivars>Data of strip spectra>For the number of varieties, ->For mean value->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: and (3) carrying out initial normalization processing on the data set before each training, adopting a random gradient descent algorithm In the training of the 1D-In-Resnet network model, and learning the parameters of the established convolutional neural network by continuously reducing the function value of the loss function, so that the training is finished when the iteration number reaches 500 epoch.
As a further improvement of the technical scheme of the invention, the formula of the loss function is as follows:
(3)
wherein,is->True value of individual samples->Is->Predicted values for each sample.
As a further improvement of the technical scheme of the invention, the random gradient descent method specifically comprises the following steps: the sample is used for learning parameters and updating in each iteration, and the formulas of the learning parameters and updating of each generation are as follows:
(4)
(5)
where t is the number of iterations,is->Parameters of the time update->For the model parameters at time t, +.>For learning rate->As a cost function->Representing a randomly selected one of the gradient directions.
The invention has the advantages that:
(1) According to the technical scheme, near infrared spectrums of single crop seeds to be identified are obtained; carrying out normalization pretreatment on the near infrared spectrum data; training the constructed 1D-In-Resnet network model by utilizing the near infrared spectrum; carrying out 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 rapid and accurate discrimination of the authenticity of a plurality of crop varieties simultaneously, extracts the characteristics of different scales through the multi-branch convolution layer, and improves the accuracy of identifying the authenticity of the crop seeds of the varieties simultaneously by the model.
(2) The invention provides a 1D-In-Resnet network model which takes an acceptance network as an infrastructure, and is different from the acceptance network In that the model removes two branches of 1X 1 convolution and maxpooling In the acceptance network, because the two branches are used for fusing multi-channel information, and the number of spectrum data channels is 1, so that the complexity of the model is reduced. Meanwhile, in order to improve the training speed of the model, residual error elements in a Resnet network are added, and the combined result is added with the original input, so that the information loss is reduced, the prediction accuracy of the model is improved, and more accurate variety authenticity judgment is facilitated.
Drawings
FIG. 1 is a flow chart of a single grain variety identification method based on near infrared spectrum and 1D-In-Resnet network according to an embodiment of the invention;
FIG. 2 is a near infrared spectrum of rice grain according to the first embodiment of the present invention;
FIG. 3 is a diagram of a 1D-In-reset network architecture according to a first embodiment of the present invention;
fig. 4 is a confusion matrix thermodynamic diagram of spectrum discrimination results of 24 wheat varieties according to the first embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions in the embodiments of the present invention will be clearly and completely described in the following in conjunction with the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The technical scheme of the invention is further described below with reference to the attached drawings and specific embodiments:
example 1
As shown In fig. 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 seed of a crop to be identified;
the crop single seed to be identified is rice, wheat and corn single seed or progeny thereof, wherein the rice variety is conventional rice variety.
In the following, a detailed description will be given of taking wheat as an example, and Shan Zi samples of the wheat with known, full and mature varieties are collected, and 100 seeds are adopted as detection objects for each variety, and spectrum acquisition is performed in a near-infrared high-flux spectrum acquisition system. The acquisition range of the spectrometer is 1100-2500nm, and the acquisition gate width is 1ms. A spectrum was collected for each seed. A total of 2400 pieces of wheat near infrared spectrum data were obtained. 80% of each variety was randomly taken as training set and 20% as test set. The training set is used for constructing a model, and the testing set is used for verifying the prediction effect of the model. Near infrared spectra collected in the near infrared high flux spectrum collection system for 24 varieties of wheat samples are shown in fig. 2.
2. The method for carrying out normalization pretreatment on the near infrared spectrum data specifically comprises the following steps:
preprocessing the input spectrum data, adopting Z-score standardization, solving the mean value and standard deviation of each column of data of the data set, carrying out data standardization based on the mean value and standard deviation of the original data, and calculating the new data= (original data-mean value)/standard deviation by the following calculation formulas:
(1)
(2)
wherein,is->No. H of individual cultivars>Data of strip spectra>For the number of varieties, ->For mean value->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 device comprises an input layer, a convolution layer, a pooling layer, 3 full-connection layers and an output layer, wherein the convolution layer is 2 branches, the first branch is 1 multiplied by 5 multiplied by 8 convolution layers, the second branch is 2 multiplied by 1 multiplied by 5 multiplied by 8 convolution layers, BN regularization is added behind each convolution layer, outputs of the two branches are combined (localization) through a Relu activation function, an output result is added (Add) with original data, and the output result is flattened after being subjected to maximum pooling of 1 multiplied by 2 (s=1), and the output result is input into the full-connection layer. The total connection layers are 3 layers, the parameters are 500, 250 and 250 respectively, and finally the classification result is output.
As shown In fig. 3, the 1D-In-reset network model is based on an acceptance network, and is different from the acceptance network In that the model removes two branches of 1×1 convolution and maxpooling In the acceptance network, because the two branches are used for fusing multi-channel information, and the number of spectrum data channels is 1, so as to reduce the complexity of the model. Meanwhile, in order to improve the accuracy of the model, residual error elements in a Resnet network are added, and the combination result is added with the original input.
4. Training the constructed 1D-In-Resnet network model by utilizing the near infrared spectrum, and specifically comprising the following steps of:
carrying out initial normalization processing on the data set before each training, adopting a random gradient descent algorithm In the training of the 1D-In-Resnet network model, and learning the parameters of the established convolutional neural network by continuously reducing the function value of the loss function, so that the training is finished when the iteration number reaches 500 epoch;
wherein the loss functionlossThe expression formula is as follows:
(3)
wherein,is->True value of individual samples->Is->Predicted values for each sample.
The random gradient descent method adopted in the convolutional neural network model training refers to that the sample is used for learning parameters and updating in each iteration, and the learning parameters and updating of each generation can be expressed as formulas (4) and (5):
(4)
(5)
where t is the number of iterations,is->Parameters of the time update->For the model parameters at time t, +.>For learning rate->As a cost function->Representing a randomly selected one of the gradient directions.
5. And carrying out authenticity prediction recognition 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, the spectra of crop seeds to be detected are collected under the same conditions as 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 samples is obtained.
And predicting a test set sample by using the constructed 1D-In-resnet model to verify the identification effect of the model. The collection condition, pretreatment method and training set of the test set sample are the same.
In contrast, the present invention uses a conventional machine learning algorithm: the 1D-CNN network, the 1D-acceptance network and the traditional PLS-DA algorithm are used as comparison construction models to predict test set samples. Table 1 shows the parameter distributions of three neural network models.
Table 1 three neural network model parameter distributions
And comparing the predicted values and the true values of the varieties of the three model prediction test sets, and evaluating the recognition performance of the model.
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:
(6)
the Precision (PRE) calculation formula is:
(7)
the Recall (REC) calculation formula is:
(8)
the calculation formula is as follows:
(9)
wherein,the number of seeds correctly judged by the model for the target variety; />Misjudging the seeds of the target variety as the number of the seeds of the non-target variety by the model; />Misjudging the seeds of the non-target variety as the number of the seeds of the target variety by the model;TNthe number of seeds correctly judged by the model for the non-target variety; the F1 score is the harmonic mean between accuracy and recall.
Each network was trained 10 times, the average was taken and the predicted results are shown in table 2. As can be seen from Table 2, the 1D-In-reset network has higher accuracy than the crop authenticity identification of other network architectures, the accuracy is 95.35%, the accuracy is improved by 0.33% compared with 1D-acceptance, the accuracy is improved by 0.89% compared with 1D-CNN, and the accuracy is improved by 24.83% compared with PLS-DA. The F1 parameter is 95.42%, which is the largest in the 3 networks, and the model accuracy is the highest, which proves the effectiveness of the embodiment.
TABLE 2 prediction results
As shown In fig. 4, the 1D-In-resnet model outputs a confusion matrix thermodynamic diagram of 24 wheat varieties, in which small squares on the diagonal represent the correct number of classification per sample, small squares outside the diagonal represent the incorrect number of classification, and darker colors on the diagonal represent the more correct number of classification, with the maximum value of 20 per small square color and the minimum value of 0. In fig. 4, there are 11 categories (1,3,7,12,13,14,15,16,19, 20, 21) with classification accuracy of 100%,8 categories (0,4,5,6,9,10,17,22) with classification accuracy of 95%,3 categories (2,11,23) with classification accuracy of 90%, and 2 categories (8, 18) with classification accuracy of 80%.
The above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (8)
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 near infrared spectrum of a single seed of a crop to be identified, and carrying out normalization pretreatment on near infrared spectrum data, wherein the method comprises the following steps: preprocessing input near infrared spectrum data, adopting Z-score standardization, solving the mean value and standard deviation of each column of data of a data set, and carrying out data standardization based on the mean value and standard deviation of original data, wherein new data= (original data-mean value)/standard deviation;
constructing a 1D-In-Resnet network model, wherein the 1D-In-Resnet network model takes an acceptance network as an infrastructure, two branches of 1X 1 convolution and maxpooling In the acceptance network are removed, residual elements In the Resnet network are added, and a merging result is added with an original input; the 1D-In-Resnet network model comprises: the system comprises an input layer, a convolution layer, a pooling layer, 3 full-connection layers and an output layer, wherein the convolution layer comprises 2 branches, a first branch is 1 convolution layer, a second branch is 2 convolution layers, BN regularization is added behind each convolution layer, outputs of the two branches are combined through a Relu activation function, output results are added with original data, the original data are flattened after pooling to the maximum extent, the full-connection layers are input, the total number of the full-connection layers is 3, parameters of each layer are selected to be between 0 and 1000, and finally classification results are output;
training a 1D-In-Resnet network model by utilizing near infrared spectrum, wherein the method comprises the following steps: carrying out initial normalization processing on the data set before each training, adopting a random gradient descent method In the training of the 1D-In-Resnet network model, and learning the parameters of the established convolutional neural network by continuously reducing the function value of the loss function, so that the training is finished when the iteration number reaches 500 epoch;
and carrying out 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 method for identifying single grain varieties based on near infrared spectrum and 1D-In-Resnet network according to claim 1, wherein the calculation formulas of the mean and standard deviation are as follows:
(1)
(2)
wherein,is->No. H of individual cultivars>Data of strip spectra>For the number of varieties, ->For mean value->Is the standard deviation.
3. The method for identifying single grain varieties based on near infrared spectrum and 1D-In-Resnet network according to claim 2, wherein the formula of the loss function is as follows:
(3)
wherein,is->True value of individual samples->Is->Predicted values for each sample.
4. The method for identifying single grain varieties based on near infrared spectrum and 1D-In-Resnet network according to claim 3, wherein the random gradient descent method is specifically: the sample is used for learning parameters and updating in each iteration, and the formulas of the learning parameters and updating of each generation are as follows:
(4)
(5)
where t is the number of iterations,is->Parameters of the time update->For the model parameters at time t, +.>In order for the rate of learning to be high,as a cost function->Representing a randomly selected one of the gradient directions.
5. A single grain variety identification system based on near infrared spectroscopy and 1D-In-reset network, 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 single grain of the crop to be identified and carrying out normalization pretreatment on near infrared spectrum data, and the method comprises the following steps: preprocessing input near infrared spectrum data, adopting Z-score standardization, solving the mean value and standard deviation of each column of data of a data set, and carrying out data standardization based on the mean value and standard deviation of original data, wherein new data= (original data-mean value)/standard deviation;
the network model construction module is used for constructing a 1D-In-Resnet network model, the 1D-In-Resnet network model takes an acceptance network as an infrastructure, two branches of 1X 1 convolution and maxpooling In the acceptance network are removed, residual error elements In the Resnet network are added, and the combination result is added with the original input; the 1D-In-Resnet network model comprises: the system comprises an input layer, a convolution layer, a pooling layer, 3 full-connection layers and an output layer, wherein the convolution layer is 2 branches, the first branch is 1 multiplied by 5 multiplied by 8 convolution layers, the second branch is 2 multiplied by 1 multiplied by 5 multiplied by 8 convolution layers, BN regularization is added behind each convolution layer, outputs of the two branches are combined through a Relu activation function, an output result is added with original data, and then the obtained result is flattened after maximum pooling, 3 layers of full-connection layers are input, the parameters are 500, 250 and 250 respectively, and finally classification results are 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 carrying out authenticity prediction recognition on the single grain spectrum to be identified by utilizing the trained 1D-In-Resnet network model to obtain an authenticity prediction result;
the method for training the 1D-In-Resnet network model by utilizing the near infrared spectrum comprises the following steps of: and (3) carrying out initial normalization processing on the data set before each training, adopting a random gradient descent method In the training of the 1D-In-Resnet network model, and learning the parameters of the established convolutional neural network by continuously reducing the function value of the loss function, so that the training is finished when the iteration number reaches 500 epoch.
6. The system for single grain variety identification based on near infrared spectrum and 1D-In-Resnet network according to claim 5, wherein the mean and standard deviation calculation formula is as follows:
(1)
(2)
wherein,is->No. H of individual cultivars>Data of strip spectra>For the number of varieties, ->For mean value->Is the standard deviation.
7. The system for single grain variety identification based on near infrared spectrum and 1D-In-Resnet network of claim 6, wherein the formula of the loss function is as follows:
(3)
wherein,is->True value of individual samples->Is->Predicted values for each sample.
8. The single grain variety identification system based on near infrared spectrum and 1D-In-Resnet network of claim 7, wherein the random gradient descent method is specifically: the sample is used for learning parameters and updating in each iteration, and the formulas of the learning parameters and updating of each generation are as follows:
(4)
(5)
where t is the number of iterations,is->Parameters of the time update->For the model parameters at time t, +.>In order for the rate of learning to be high,as a cost function->Representing a randomly selected one of the gradient directions.
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 CN114062305A (en) | 2022-02-18 |
CN114062305B true 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) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114778485B (en) * | 2022-06-16 | 2022-09-06 | 中化现代农业有限公司 | Variety identification method and system based on near infrared spectrum and attention mechanism network |
Citations (18)
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 |
-
2021
- 2021-10-15 CN CN202111204576.6A patent/CN114062305B/en active Active
Patent Citations (18)
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)
Title |
---|
"Research on high-throughput crop authenticity identification method based on near-infrared spectroscopy and InResSpectra model ";Xiaohong Li 等;《Infrared Physics and Technology 》(第125期);全文 * |
面向训练阶段的神经网络性能分析;李景军;张宸;曹强;;计算机科学与探索(第10期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114062305A (en) | 2022-02-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105928901B (en) | A kind of near-infrared quantitative model construction method that qualitative, quantitative combines | |
CN110687072B (en) | Calibration set and verification set selection and modeling method based on spectral similarity | |
CN105630743B (en) | A kind of system of selection of spectrum wave number | |
CN101819141B (en) | Maize variety identification method based on near infrared spectrum and information processing | |
CN112924412B (en) | Single-grain rice variety authenticity distinguishing method and device based on near infrared spectrum | |
CN103048273A (en) | Fruit near infrared spectrum sorting method based on fuzzy clustering | |
CN105117734B (en) | Corn seed classification hyperspectral imagery recognition methods based on model online updating | |
CN107679569A (en) | Raman spectrum substance automatic identifying method based on adaptive hypergraph algorithm | |
CN102735642A (en) | Method for quickly and losslessly identifying virgin olive oil and olive-residue oil | |
CN104374739A (en) | Identification method for authenticity of varieties of seeds on basis of near-infrared quantitative analysis | |
CN108573105A (en) | The method for building up of soil heavy metal content detection model based on depth confidence network | |
CN114062305B (en) | Single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network | |
CN109992861A (en) | A kind of near infrared spectrum modeling method | |
CN116204831A (en) | Road-to-ground analysis method based on neural network | |
Prasher et al. | Analysis of DenseNet201 with SGD optimizer for diagnosis of multiple rice leaf diseases | |
CN108344701A (en) | Paraffin grade qualitative classification based on hyperspectral technique and quantitative homing method | |
CN104990891B (en) | A kind of seed near infrared spectrum and spectrum picture qualitative analysis model method for building up | |
CN108663334B (en) | Method for searching spectral characteristic wavelength of soil nutrient based on multi-classifier fusion | |
CN112485238B (en) | Method for identifying turmeric essential oil producing area based on Raman spectrum technology | |
CN114778485B (en) | Variety identification method and system based on near infrared spectrum and attention mechanism network | |
CN113310934A (en) | Method for quickly identifying milk cow milk mixed in camel milk and mixing proportion thereof | |
Li et al. | Research on high-throughput crop authenticity identification method based on near-infrared spectroscopy and InResSpectra model | |
CN105974058A (en) | Method for rapidly detecting potassium content of tobacco leaves based on electronic nose-artificial neural network | |
CN115630329A (en) | Edible essence classification method based on convolutional neural network | |
US11525774B2 (en) | Sensory evaluation method for spectral data of mainstream smoke |
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 |