Disclosure of Invention
The invention aims to provide a method for detecting the quality of silage soybeans based on a near infrared spectrum, which aims to solve the technical problems in the prior art, can greatly improve the detection efficiency of the feeding quality of the silage soybeans and the accuracy of a detection result, has a simple, high-efficiency and green detection process, and fills the blank of near infrared detection of the quality of silage soybean plants.
In order to achieve the purpose, the invention provides the following scheme: the invention provides a method for detecting the quality of ensiled soybeans based on near infrared spectrum, which comprises the following steps:
s1, collecting overground plant parts of different varieties of silage type soybeans in different growth periods, treating the collected plants, drying the plants at a preset temperature to constant weight, and crushing the plants to be used as samples to be detected;
s2, performing physical and chemical index measurement on the sample to be measured collected in the step S1, and dividing physical and chemical index measurement results of the sample to be measured into a calibration set and a verification set;
s3, performing near infrared spectrum scanning on the sample to be detected collected in the step S1 to obtain a corresponding light absorption value;
s4, preprocessing the light absorption value obtained in the step S3;
s5, respectively constructing silage soybean quality prediction models with different physicochemical indexes by adopting a Partial Least Squares (PLS) method based on the light absorption value and the physicochemical index measurement result after the calibration set data preprocessing;
s6, verifying the silage soybean quality prediction models with different physicochemical indexes based on the verification set, and acquiring the optimal silage soybean quality prediction models corresponding to the physicochemical indexes based on the verification result;
and S7, respectively inputting the light absorption values of the near infrared spectrum scanning of the ensiled soybeans to be detected into the optimal ensiled soybean quality prediction models corresponding to the physical and chemical indexes to finish the ensiled soybean quality detection.
Preferably, in the step S1, the different growth periods include full bloom period, early stage of grain swelling, and middle stage of grain swelling; the treatment modes of the plants in each growth period are respectively as follows: the whole plant is sampled in the full-bloom stage and the initial stage of the seed blowing, and the plant after pod removal treatment is sampled in the middle stage of the seed blowing.
Preferably, in step S2, the physicochemical indexes include crude protein CP, neutral detergent fiber NDF, and acidic detergent fiber ADF.
Preferably, in step S2, the physicochemical index is measured according to national standard or industry standard.
Preferably, in the step S3, the spectral range of the near infrared spectrum scan is 900-1700 nm.
Preferably, in step S4, the data preprocessing includes: first order derivation NW1stSecond order derivation NW2ndThe standard normal variable transformation method SNV and the detrending algorithm DE-trending are combined.
Preferably, in step S5, the silage soybean quality prediction model for each of the physicochemical indexes includes a NW-based model1st、NW1st+DE-trending、NW1st+DE-trending+SNV、NW2nd+ DE-trending + SNV four data preprocessing modes PLS model.
Preferably, the silage soybean quality prediction model corresponding to each physical and chemical index adopts NW1stAnd + DE-ending + SNV data preprocessing mode.
Preferably, in step S6, the index for verifying the silage soybean quality prediction models with different physicochemical indexes includes a determination coefficient R2Root mean square error RMSE value.
The invention discloses the following technical effects:
the method adopts a national standard method to measure the physicochemical indexes of the silage soybean, carries out near infrared spectrum scanning on a silage soybean sample to be measured, constructs a silage soybean quality prediction model by using a partial least square method based on the correlation between the variation rule of the light absorption value of the near infrared spectrum and the physicochemical index value of the feed soybean, optimizes the silage soybean quality prediction model based on the decision coefficient and the root mean square error, and inputs the light absorption value of the near infrared spectrum of the sample to be measured into the optimal silage soybean quality prediction model to realize the rapid and accurate detection of the silage soybean quality, thereby greatly improving the detection efficiency of the silage soybean quality and the accuracy of the detection result, having simple, efficient and green detection process and filling the blank of the near infrared detection of the silage soybean plant quality.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the 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.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, the present embodiment provides a method for detecting quality of ensiled soybeans based on near infrared spectroscopy, including the following steps:
s1, collecting overground plant parts of different varieties of silage type soybeans in different growth periods, treating the collected plants, drying the plants at a preset temperature to constant weight, and crushing the plants to be used as samples to be detected;
in this example, 25 soybean varieties were sampled at full bloom stage, initial stage of kernel swelling, and middle stage of kernel swelling, and the plants at each growth stage were treated in the following manners: the full plant is sampled in full-bloom stage and initial stage of kernel blowing, the plant after pod removing treatment is sampled in middle stage of kernel blowing, and the specific soybean variety is shown in table 1:
TABLE 1
After the plants were sampled in the three sampling periods and different treatment modes in table 1, the sample plants were dried at 65 ℃ to constant weight, crushed and tested, and 57 samples were collected in total.
S2, performing physical and chemical index measurement on the sample to be measured collected in the step S1, and dividing physical and chemical index measurement results of the sample to be measured into a calibration set and a verification set;
the physical and chemical indexes comprise three main silage quality indexes of CP (Crude Protein), NDF (Neutral Detergent Fiber) and ADF (Acid Detergent Fiber); and the physicochemical indexes of each sample are repeatedly detected for three times according to national standards or industrial standards, and the physicochemical indexes of 57 samples to be detected are measured to obtain 171 chemical values in total so as to ensure the accuracy of data acquisition.
The CP is detected according to a detection method GB/T6432-.
S3, performing near infrared spectrum scanning on the sample to be detected collected in the step S1 to obtain a corresponding light absorption value;
in the near infrared spectrum scanning process, samples are directly and uniformly stacked by hands in a natural sample loading mode, each sample to be detected is scanned after three times of rotation scanning and three times of repacking respectively under the same environmental condition, and the near infrared spectrum is collected in an averaging mode so as to overcome the nonuniformity of the samples and collect 171 spectra in total; wherein, repacking is to get powder from the sample again, and the weight is flat and the thickness is consistent.
The scan parameters were as follows: a near infrared spectrum imager (DA7250, Perten, Sweden) is utilized, the spectral range is 900-1700nm, the wavelength precision is less than 0.3nm, the spectral resolution is 7nm, the diode spacing (pixel spacing) is 3.1 nm/pixel, the detector is InGaAs, and the electric temperature control cold treatment is carried out on 256 pixels. The rotary cup with the sample can be driven, and the computer and the near infrared imaging system acquisition software are used for controlling the system to operate. In order to ensure the consistency of the obtained spectrum, the detection temperature is 15-25 ℃, the thickness of the sample is 5mm, and the humidity range is 30-70%.
S4, preprocessing the light absorption value obtained in the step S3; the data preprocessing comprises the following steps: first order derivation NW1stSecond order derivation NW2ndOne or more of SNV (Standard Normal variant transformation) and DE-trending combined pretreatment methods.
S5, respectively constructing silage soybean quality prediction models with different physicochemical indexes by adopting a Partial Least Squares (PLS) method based on the light absorption value after calibration set data preprocessing and the physicochemical index measurement result;
the method specifically comprises the following steps: and (3) constructing a silage soybean quality prediction model by using a partial least square method based on the good correlation between the change rule of the light absorption value of the spectrum after data preprocessing and the increase of the quality index value of the feeding soybean.
The partial least squares method is a mathematical optimization technique that minimizes the sum of the squares of the errors by minimizing the sum of the squares of the errors to find the best functional match for a set of data, and using the simplest method to find some absolute unknowable true values.
The silage soybean quality prediction model corresponding to each physical and chemical index comprises a model based on NW1st、NW1st+DE-trending、NW1st+DE-trending+SNV、NW2nd+ DE-trending + SNV.
And S6, verifying the silage soybean quality prediction models with different physicochemical indexes based on the verification set, verifying the accuracy of the feeding soybean quality prediction models, and acquiring an optimal silage soybean quality prediction model based on the verification result.
Model evaluation indexes: respectively by determining the coefficient R2And evaluating the calibration effect and the prediction capability of the model by the Root Mean Square Error (RMSE) value. R2The closer to 1, the more remarkable the regression effect is, and the closer to 0 the RMSE is, the better the stability and the prediction capability of the model are.
In this embodiment, the basic statistical data of the crude protein content, the NDF content, and the ADF content in 57 samples to be tested are shown in tables 2, 3, and 4, respectively:
TABLE 2
Average (%)
|
Maximum value (%)
|
Minimum value (%)
|
Standard deviation of
|
16.21
|
22.79
|
11.21
|
2.04 |
TABLE 3
Average (%)
|
Maximum value (%)
|
Minimum value (%)
|
Standard deviation of
|
51.25
|
63.48
|
41.02
|
5.02 |
TABLE 4
Average (%)
|
Maximum value (%)
|
Minimum value (%)
|
Standard deviation of
|
33.88
|
42.51
|
25.00
|
4.51 |
The original spectrum of the near-infrared scanning of 57 samples to be measured is shown in fig. 2, the spectrum after first-order derivation pretreatment is shown in fig. 3, the spectrum after trend-removing algorithm pretreatment is shown in fig. 4, the spectrum after standard normal variable transformation pretreatment is shown in fig. 5, and the curve of the treated spectrum is smoother than that of the original spectrum.
In this embodiment, the results of the physicochemical index measurements of 57 samples to be measured are divided into calibration sets and verification sets, wherein the coefficients of the calibration sets and the verification sets are represented as RC 2、RP 2The root mean square error is expressed as RMSEC, RMSEP, respectively. The determination coefficients and the root mean square error calculation results of the silage soybean quality prediction model based on various physicochemical indexes of different spectrum pretreatment methods are shown in table 5:
TABLE 5
As can be seen from table 5 and fig. 2 to 5, NW was used1stThe three spectrum preprocessing methods of + DE-trending + SNV are combined, the obtained silage soybean quality prediction model has the best effect, and the silage soybean quality prediction model is subjected to NW1stBy the three spectrum preprocessing methods of + DE-trending + SNV, an original spectrum curve becomes smooth, and the noise, baseline drift and collinearity phenomena of the curve are eliminated well.
The accuracy of the chemical values and the representativeness of the samples are the basis for establishing accurate models, so that the relative deviation is calculated according to the national standard algorithm, and the determination of the appropriate one of the three chemical values is that if the three chemical values do not differ much (i.e. the standard deviation is less than 20%), the average is taken, if the difference is large (i.e. the standard deviation is greater than or equal to 20%), the value with the smallest relative deviation is taken. Two chemical values were determined as the average of two similar results. In the embodiment, three groups of values and two groups of values are taken as representatives and are respectively calculated and then are brought into the database for comparative analysis, and the model is further verified.
For crude protein content, three sets of value calibration sets and random cross validation set R in the spectral data of the samples from the gavage soybean plants were compared by PLS calibration and validation models for three sets of values and two sets of values20.97 and 0.96, respectively, calibration set of two sets of values and random cross-validation set R20.96 and 0.95, respectively, while the RMSE in the calibration set was 0.50 in three sets of values, 0.49 in two sets of values, and 0.56 and 0.55 in the random cross-validation set, respectively. Through the crude protein content model, the average value of two close chemical numerical results is analyzed to be the true value, the model effect is slightly good after calculation, and the distribution curve of the predicted value of the crude protein content and the reference value is shown in fig. 6, wherein fig. 6(a) is a three-group value model, and fig. 6(b) is a two-group value model.
For NDF content, calibration set of three sets of values and R for random cross validation set20.90 and 0.88, respectively, R for the calibration set and random cross-validation set of the two sets of values20.90 and 0.89 respectively. RMSE of 1.58 for the three sets of values in the calibration set<1.74 for both sets of values; while the RMSE for the three sets of values in the validation set was 1.72<The distribution graph of the predicted value of NDF content and the reference value is shown in fig. 7, wherein fig. 7(a) is a three-set model and fig. 7(b) is a two-set model; as can be seen from FIG. 7, the NDF model for the three sets of values performed well.
Calibration and validation set R of three sets of values for ADF content2Calibration and verification sets R of two sets of values, 0.95 and 0.94, respectively20.94 and 0.93, respectively. RMSE of 1.04 for the three sets of values in the calibration set<1.10 of the two sets of values; while the RMSE for the three sets of values in the validation set was 1.13<FIG. 8 is a graph showing a distribution of predicted ADF content and reference values for 1.20 of the two sets of values, wherein FIG. 8(a) is a three-set model and FIG. 8(b) is a two-set model; as can be seen from FIG. 8, the ADF model for the three sets of values works well.
Statistical data shows that the model difference between the three groups of values and the two groups of values is not obvious, and the accuracy of measuring chemical values is verified. And in the later stage, along with the increase of the sample amount, the calibration model is corrected, the newly added sample is subjected to chemical test, near-infrared scanning and pretreatment, and the near-infrared detection value is subjected to model prediction and verification according to the steps.
And S7, respectively inputting the light absorption values of the near infrared spectrum scanning of the ensiled soybeans to be detected into the optimal ensiled soybean quality prediction models corresponding to the physical and chemical indexes to finish the ensiled soybean quality detection.
And (4) for the silage soybeans to be detected, processing the plants according to the step S1, drying and crushing the plants, performing infrared spectrum scanning to obtain corresponding light absorption values, preprocessing the light absorption values according to the step S4, and inputting the preprocessed light absorption values into optimal silage soybean quality prediction models corresponding to various physicochemical indexes to finish silage soybean quality detection.
The invention has the following technical effects:
the method adopts a national standard method to measure the physicochemical indexes of the silage soybean, carries out near infrared spectrum scanning on a silage soybean sample to be measured, constructs a silage soybean quality prediction model by using a partial least square method based on the correlation between the variation rule of the light absorption value of the near infrared spectrum and the physicochemical index value of the feed soybean, optimizes the silage soybean quality prediction model based on the decision coefficient and the root mean square error, and inputs the light absorption value of the near infrared spectrum of the sample to be measured into the optimal silage soybean quality prediction model to realize the rapid and accurate detection of the silage soybean quality, thereby greatly improving the detection efficiency of the silage soybean quality and the accuracy of the detection result, having simple, efficient and green detection process and filling the blank of the near infrared detection of the silage soybean plant quality.
The above-described embodiments are merely illustrative of the preferred embodiments of the present invention, and do not limit the scope of the present invention, and various modifications and improvements of the technical solutions of the present invention can be made by those skilled in the art without departing from the spirit of the present invention, and the technical solutions of the present invention are within the scope of the present invention defined by the claims.