CN113267466A - Fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization - Google Patents
Fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization Download PDFInfo
- Publication number
- CN113267466A CN113267466A CN202110361802.5A CN202110361802A CN113267466A CN 113267466 A CN113267466 A CN 113267466A CN 202110361802 A CN202110361802 A CN 202110361802A CN 113267466 A CN113267466 A CN 113267466A
- Authority
- CN
- China
- Prior art keywords
- acidity
- wavelength
- data matrix
- fruit
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 230000003595 spectral effect Effects 0.000 title claims abstract description 27
- 238000009659 non-destructive testing Methods 0.000 title claims abstract description 23
- 238000005457 optimization Methods 0.000 title claims abstract description 19
- RFSUNEUAIZKAJO-ARQDHWQXSA-N Fructose Chemical compound OC[C@H]1O[C@](O)(CO)[C@@H](O)[C@@H]1O RFSUNEUAIZKAJO-ARQDHWQXSA-N 0.000 title claims abstract description 11
- 229930091371 Fructose Natural products 0.000 title claims abstract description 11
- 229960002737 fructose Drugs 0.000 title claims abstract description 11
- 239000011159 matrix material Substances 0.000 claims abstract description 85
- 235000013399 edible fruits Nutrition 0.000 claims abstract description 59
- 238000001228 spectrum Methods 0.000 claims abstract description 34
- 238000005070 sampling Methods 0.000 claims abstract description 10
- 230000003044 adaptive effect Effects 0.000 claims abstract description 5
- 230000002860 competitive effect Effects 0.000 claims abstract description 5
- 238000007781 pre-processing Methods 0.000 claims abstract description 4
- 238000012216 screening Methods 0.000 claims abstract description 4
- 238000002329 infrared spectrum Methods 0.000 claims description 16
- 238000000862 absorption spectrum Methods 0.000 claims description 12
- 239000002253 acid Substances 0.000 claims description 4
- 239000013307 optical fiber Substances 0.000 claims description 3
- 238000012937 correction Methods 0.000 abstract description 14
- 238000001514 detection method Methods 0.000 abstract description 13
- 241000220225 Malus Species 0.000 description 12
- 235000021016 apples Nutrition 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 230000007547 defect Effects 0.000 description 4
- 238000011156 evaluation Methods 0.000 description 4
- 239000000203 mixture Substances 0.000 description 4
- 238000010606 normalization Methods 0.000 description 4
- 244000144730 Amygdalus persica Species 0.000 description 3
- 235000006040 Prunus persica var persica Nutrition 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 3
- JLQUFIHWVLZVTJ-UHFFFAOYSA-N carbosulfan Chemical compound CCCCN(CCCC)SN(C)C(=O)OC1=CC=CC2=C1OC(C)(C)C2 JLQUFIHWVLZVTJ-UHFFFAOYSA-N 0.000 description 3
- 230000001066 destructive effect Effects 0.000 description 3
- 239000000126 substance Substances 0.000 description 3
- 101000596041 Homo sapiens Plastin-1 Proteins 0.000 description 2
- 238000004497 NIR spectroscopy Methods 0.000 description 2
- 102100035181 Plastin-1 Human genes 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 2
- 235000011389 fruit/vegetable juice Nutrition 0.000 description 2
- 238000009499 grossing Methods 0.000 description 2
- 238000012417 linear regression Methods 0.000 description 2
- 239000007788 liquid Substances 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000003756 stirring Methods 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 101000596046 Homo sapiens Plastin-2 Proteins 0.000 description 1
- 102100035182 Plastin-2 Human genes 0.000 description 1
- XUIMIQQOPSSXEZ-UHFFFAOYSA-N Silicon Chemical compound [Si] XUIMIQQOPSSXEZ-UHFFFAOYSA-N 0.000 description 1
- 238000002835 absorbance Methods 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000002790 cross-validation Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 239000001257 hydrogen Substances 0.000 description 1
- 229910052739 hydrogen Inorganic materials 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012628 principal component regression Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000002310 reflectometry Methods 0.000 description 1
- 229910052710 silicon Inorganic materials 0.000 description 1
- 239000010703 silicon Substances 0.000 description 1
- 230000003746 surface roughness Effects 0.000 description 1
- 238000001931 thermography Methods 0.000 description 1
- 229910021642 ultra pure water Inorganic materials 0.000 description 1
- 239000012498 ultrapure water Substances 0.000 description 1
Images
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/01—Arrangements or apparatus for facilitating the optical investigation
-
- 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/01—Arrangements or apparatus for facilitating the optical investigation
- G01N2021/0106—General arrangement of respective parts
- G01N2021/0112—Apparatus in one mechanical, optical or electronic block
Landscapes
- Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Biochemistry (AREA)
- General Health & Medical Sciences (AREA)
- General Physics & Mathematics (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Investigating Or Analysing Materials By Optical Means (AREA)
Abstract
The invention discloses a fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization, which comprises the following steps: 1, collecting fruit sample spectrum and measuring data of sugar degree and acidity; 2, preprocessing the collected spectrum; 3, selecting wavelengths for the preprocessed spectrum based on the data of the sugar degree and the acidity respectively by using a competitive adaptive re-weighting sampling algorithm CARS; 4 integrating and screening the data matrix of the characteristic wave length of the sugar degree and the acidity based on a wave length optimization method to obtain an optimized wave length data matrix; and 5, establishing a Partial Least Squares (PLS) model by using the correction set according to the optimized wavelength data matrix and the data of the sugar degree and the acidity, and evaluating the model result by using the prediction set. The invention optimizes the wavelength which is simultaneously effective for the sugar content and acidity prediction, and the prediction model established based on the optimized wavelength has high detection efficiency, high precision and strong practicability, and provides important reference for realizing the simultaneous rapid nondestructive detection of the sugar content and the acidity of the fruit.
Description
Technical Field
The embodiment of the invention relates to the technical field of rapid nondestructive testing of internal quality of fruits, in particular to a nondestructive testing method for sugar degree and acidity of fruits based on spectral wavelength optimization.
Background
The internal quality of fruit affects the buying desire of consumers, and the most important indexes for measuring the internal quality are sugar degree and acidity. The traditional measuring methods for the sugar degree and the acidity of the fruit are destructive, and a large amount of manpower, material resources and financial resources are consumed.
The near infrared spectrum technology is applied to the aspect of detecting the internal quality of the fruit by the advantage of rapidness and no damage. The near infrared spectrum of the fruit sample contains the molecular structure information of the chemical composition, and the composition content and the property parameters are also closely related to the molecular structure information. The reflection signal of the fruit sample received by the near infrared spectrum detection device contains diffuse reflection information of carbon-hydrogen bonds, carbon-oxygen bonds and the like on near infrared light in a sample molecular structure, and the chemical composition content of the sample is reflected. And the received diffuse reflection spectrum information is inverted, mathematical modeling is established, and the prediction of the sugar degree and the acidity of the fruit can be realized.
Patent application No. 201910206242 discloses a fruit sweetness nondestructive testing method, which predicts the sweetness of fruit by infrared thermography characteristic map, and belongs to the research in the image field. Patent application No. 201910503479 discloses a fruit maturity detection device and a maturity evaluation method, wherein a linear regression equation is established by calculating the voltage ratio of a silicon photocell through a single chip microcomputer, so that the fruit maturity is determined, and the research in the electromechanical field is focused. Patent application No. 200610155208 discloses a fruit maturity prediction method, which adopts multivariate linear regression, principal component regression, least square regression and artificial neural network to respectively establish single-component prediction model for three indexes of firmness, sugar degree and acidity of fruit sample; patent application No. 201710117277 discloses a method for detecting internal quality of fruits by near infrared spectroscopy and a special detection system, wherein a single-component partial least square prediction model is established in the aspect of detecting the internal quality of fruits by near infrared spectroscopy, and a detection object is apple brix, so that the method is large in limitation; patent application No. 201510697123 discloses a near infrared spectrum-based Hanfu apple quality nondestructive testing method, which respectively establishes a single-component partial least square prediction model of Hanfu apple sugar degree, acidity and texture. All three of the above patents relate to the use of partial least squares to build a predictive model, but a single component predictive model, PLS1 model, is built. Prediction of only one component at a time is achieved, which is the biggest disadvantage of the PLS1 method. Patent application No. 201710271814 discloses a real-time non-destructive detection method for sugar degree and acidity of peaches, which establishes a BP neural network and predicts the sugar degree and acidity of peaches at the same time. The average absolute percentage error of the model established by the method for acidity is 4.79%, the prediction precision is higher, and the average absolute percentage error for sugar degree is 7.55%, the prediction precision is lower. Therefore, the BP neural network detection method cannot realize high-precision prediction of the sugar degree and the acidity of the peaches at the same time.
Disclosure of Invention
The invention aims to solve the defects of the prior art, provides a fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization, and aims to establish a prediction model by optimizing the wavelength which is effective for predicting the sugar degree and acidity simultaneously, so that the simultaneous rapid nondestructive testing of the sugar degree and the acidity of the fruit is realized, the model testing efficiency and the practicability are improved, and the testing cost is saved.
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention discloses a fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization, which is characterized by comprising the following steps of:
step one, collecting fruit sample data and forming a labeled sample set; the marked sample set consists of two parts, namely original near infrared spectrum data of the fruit sample and actual sugar degree and acidity data of the fruit;
secondly, preprocessing the original near infrared spectrum data of the fruit sample to obtain preprocessed spectrum data;
thirdly, performing characteristic wavelength selection on the preprocessed spectral data based on the sugar content and the acidity data respectively by using a competitive adaptive reweighting sampling algorithm to obtain a sugar content characteristic wavelength data matrix and an acidity characteristic wavelength data matrix;
integrating and screening the data matrix of the characteristic wavelength of the sugar degree and the data matrix of the characteristic wavelength of the acidity based on a wavelength optimization method, thereby obtaining an optimized wavelength data matrix which is effective for predicting the sugar degree and the acidity simultaneously;
and step five, establishing a Partial Least Squares (PLS) model by taking the optimized wavelength data matrix as input and the data of the sugar degree and the acidity as output, thereby realizing high-precision nondestructive testing of the sugar degree and the acidity of the fruit at the same time.
The fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization is also characterized in that the first step comprises the following steps:
step 1.1, collecting original near infrared spectrum data of a fruit sample:
selecting fruit samples, and numbering and marking four positions of each fruit sample uniformly distributed on the equator in sequence;
collecting near-infrared diffuse reflection spectrums of all mark point areas of a fruit sample by using a spectrometer and an optical fiber sampling accessory;
converting the collected near-infrared diffuse reflection spectrum into an absorbance spectrum, and using the absorbance spectrum as original near-infrared spectrum data of the fruit sample;
step 1.2, collecting a sample label:
and (3) determining the actual sugar degree and acidity data of the fruits in each mark point area by using the fruit and sugar acid all-in-one machine.
The fourth step is carried out according to the following processes:
step 4.1, enabling the modeling wavelength data matrix A to be a union set of the brix characteristic wavelength data matrix and the acidity characteristic wavelength data matrix;
step 4.2, defining a variable i;
step 4.3, establishing a partial least squares PLS model according to the modeling wavelength data matrix A, and calculating the total error E of the partial least squares PLS model0;
Step 4.4, defining an error threshold value as E, and satisfying that E is less than E0;
Step 4.5, initializing i to 1;
step 4.6, delete ith wavelength variable lambda from modeling wavelength data matrix AiTo obtain the ith timeUpdated modeled wavelength data matrix Ai(ii) a According to the model-building wavelength data matrix A after the ith updateiEstablishing an ith Partial Least Squares (PLS) model, and calculating the total error E of the ith Partial Least Squares (PLS) modeli;
And 4.7, after i +1 is assigned to i, returning to the step 4.6 to execute until i is equal to k, thereby obtaining a set { E) consisting of the total errors of the partial least squares PLS models1,E2,···,EkK represents the number of wavelength variables in the modeling wavelength data matrix A; from the set { E1,E2,···,EkPicking out minimum value Ep;
Step 4.8, judge EpIf E is true, if yes, the minimum value E is setpCorresponding wavelength variable lambdapDeleting the data matrix A from the modeling wavelength data matrix A so as to obtain an updated modeling wavelength data matrix, assigning the updated modeling wavelength data matrix to the A, and then returning to the step 4.5 to continue executing until the A is empty; otherwise, the algorithm terminates and a preferred wavelength data matrix is obtained that is effective for both brix and acidity predictions.
The total error of the partial least squares PLS model is calculated by using the following formula (1):
in the formula (1), E is the total error of the partial least squares PLS model,andthe prediction decision coefficient for sugar degree and the prediction decision coefficient for acidity of the partial least squares PLS model are shown separately.
The partial least squares PLS prediction model can be expressed as: and Y is AX + B, wherein X is an input spectrum data matrix, Y is a prediction value matrix of the model, A is a regression coefficient matrix, and B is a fitting residual error matrix.
Compared with the prior art, the invention has the beneficial effects that:
1. compared with the traditional destructive fruit sugar degree and acidity detection method, the fruit sugar degree and acidity nondestructive detection method based on spectral wavelength optimization has the advantages of rapidness, no damage, economy, environmental protection and the like. Based on the prediction model established in the five steps, the simultaneous correction of the two components of the sugar degree and the acidity of the fruit by one model is realized, and the method has extremely high feasibility. In the process of establishing a prediction model, a wavelength optimization method is used for selecting spectral characteristic wavelengths, the defect that a PLS2 method cannot simultaneously correct two components at high precision is overcome, and the established model is high in prediction precision, high in detection speed and strong in practicability, so that the simultaneous quick nondestructive high-precision detection of the sugar degree and the acidity of the fruit is realized.
2. The wavelength optimization method integrates and effectively screens characteristic variables selected by a competitive adaptive re-weighting sampling algorithm CARS on the basis of the sugar degree and acidity data of the preprocessed spectrum, overcomes the defect that the traditional method can only select the characteristic variables on the basis of one component, simultaneously effectively predicts the sugar degree and the acidity by the selected characteristic wavelengths, and plays an important role in the establishment process of a rapid nondestructive fruit sugar degree and acidity detection model.
Drawings
FIG. 1 is a flow chart of the non-destructive testing method for sugar content and acidity of fruit based on spectral wavelength;
FIG. 1a is a flow chart of a preferred method of spectral wavelength of the present invention;
FIG. 2 is a graph of the original near infrared absorbance spectrum of the golden commander apple referenced in an embodiment of the present invention;
FIG. 3 is a near infrared absorbance spectrum of a preprocessed golden Shuaishuai apple according to an embodiment of the present disclosure;
FIG. 4 is a characteristic wavelength selected by the wavelength optimization method according to the embodiment of the present invention;
FIG. 5a is a scatter plot of the measured and predicted values of the sugar content of golden handsaw apples obtained in the embodiment of the present invention;
fig. 5b is a scatter plot of the measured value and the predicted value of the acidity of the golden marshal apples obtained in the embodiment of the present invention.
Detailed Description
Taking golden marshal apples as an embodiment, as shown in fig. 1, a fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization comprises the following steps:
the method comprises the following steps of collecting fruit sample data, forming a labeled sample set, and carrying out model training by using the labeled sample. The marked sample set consists of two parts, namely (a) fruit sample spectral characteristics, namely original near infrared spectrum data of the sample, and (b) a sample label, namely an actual quality index of the sample with the acquired spectrum, namely actual sugar degree and acidity data of the fruit;
a. and collecting original near infrared spectrum data of the fruit sample.
Selecting 31 'golden commander' apples purchased from a supermarket and having no surface damage and defects, and sequentially numbering and marking four positions of each apple sample uniformly distributed on the equator; the near infrared diffuse reflection spectrum of each mark point area of the sample is collected by an optical fiber sampling accessory by using a USB4000 type spectrometer (Ocean optics INC. USA), and 124 pieces of spectrum data are obtained. The spectrum collection range is 346-1046nm, and the resolution is 2 nm. And (3) using spectrometer matched spectrum acquisition software OceanView, wherein the integration time in the software is set to be 30ms, and the average frequency of spectrum acquisition is set to be 5. And converting the collected near infrared diffuse reflection spectrum into an absorbance spectrum according to a formula A ═ lg (1/R), and taking the absorbance spectrum as the original near infrared spectrum data of the fruit sample, wherein R is the reflectivity and A is the absorbance. The obtained near infrared absorbance spectrum is shown in FIG. 2.
b. And (6) collecting a sample label. And measuring the data of the sugar degree and the acidity of the fruits in each marking point area by using a chemical method to obtain a sample label.
The measurement of sugar degree and acidity was carried out using an apple sugar ACID all-in-one machine (model: PAL-BX/ACID 5; Atago Co., Tokyo, Japan). Sampling a piece of pulp with the diameter of about 2cm in the mark point area, extruding 2-3 drops of juice to drop on an instrument, and reading the reading of the instrument to obtain the sugar degree of the mark point area; 1g of juice was again extruded into the beaker, and ultrapure water was added until the mass of the mixed liquid in the beaker became 51 g. Stirring with stirring rod, dropping 1ml of the mixture liquid with dropper onto the instrument, reading the indication of the instrument to obtain the acidity of the mark point. Repeating the above operations for multiple times, and taking readings repeatedly appearing for three times as the sugar degree and the acidity of the mark point.
Preprocessing the acquired original near infrared spectrum data of the fruit sample to obtain preprocessed spectrum data;
a. rejecting abnormal spectra
Firstly, abnormal data is removed, 110 pieces of sample data are reserved, and a modeling sample set is formed. Noise at both ends of the spectral line was rejected and a spectrum in the wavelength range of 475-. The sample spectral data matrix is modeled as follows:
wherein the columns represent samples, respectively with the symbol S1、S2、S3、…、S110Represents; the rows represent wavelength variables, respectively with the symbol W1、W2、W3、…、W2335And (4) showing.
b. Absorbance spectrum pretreatment
Vector normalization processing is carried out on the absorbance spectrum, and spectrum change caused by small optical path difference is corrected. For a spectrum w, the vector normalization algorithm is:whereinm is the number of wavelength points, k is 1,2, …, m.
With S1The sample number is given as an example,then there isNamely S1W corresponding to number sample1Is 0.0319. The above calculation is performed for each element to obtain a normalized spectral data matrix as follows:
secondly, Savitzky-Golay convolution smoothing with the size of a cubic polynomial window of 5 is adopted for the normalized spectrum, so that random errors superposed in the spectrum signals are eliminated, and the signal-to-noise ratio is improved. For a sample spectrum w, the average smoothed value at wavelength k is:wherein h isiFor the smoothing factor, there is h-2=-3,h-1=12,h0=17,h1=12,h2-3; h is a normalization factor, and H is a normalization factor,
with S1Sample number, for example, for a third wavelength variable W3After being smoothed by Savitzky-Golay convolution, the surface roughness of the film isNamely S1W corresponding to number sample3Is 0.0321. The above calculation is performed for each element to obtain a Savitzky-Golay convolution smoothed spectral data matrix.
The preprocessed near-infrared absorbance spectrum is shown in fig. 3, and the preprocessed spectrum data matrix is as follows:
c. sample division to obtain correction set and prediction set
And dividing the sample set by using an SPXY method.
And SPXY simultaneously considers the spectrum characteristics of the samples and the physicochemical properties of the sugar degree and the acidity of the samples, and carries out sample set division by calculating the Euclidean distance between every two sample variables. Firstly, selecting two samples with the farthest Euclidean distance to enter a correction set, then calculating the Euclidean distance from each remaining sample to each known sample in the correction set, putting the sample to be selected with the largest minimum distance into the correction set, and so on until the required number of samples is found. The method has the advantage of ensuring that the samples in the correction set are uniformly distributed according to the spatial distance.
In the method, the proportion of dividing the correction set samples into the prediction set samples is 4: 1, i.e. the correction set contains 88 samples and the prediction set contains 22 samples. The data of the sample concentration and acidity are shown in table 1.
TABLE 1 statistics of sample sugar concentration and acidity content
After the sample is divided, the spectrum data matrix of the correction set is as follows:
the predicted collection spectral data matrix is:
can see S1、S3、S4、…、S110The 88 samples are selected as the correction set, and the remaining 22 samples S2、S11、S15、…、S109Is selected as the prediction set.
And step three, selecting characteristic wavelengths by utilizing a competitive adaptive re-weighting sampling algorithm (CARS).
And the CARS randomly extracts a part of samples from the correction set for modeling in a random sampling mode, reserves wavelength points with larger regression coefficient absolute value weight in the model as a new subset, and then establishes the model again based on the new subset. And through multiple calculations, selecting the wavelength in the subset with the minimum cross validation root mean square error as a characteristic wavelength set.
In the method, characteristic wavelength selection is carried out on the preprocessed spectral data based on the sugar content and the acidity data respectively to obtain a sugar content characteristic wavelength data matrix and an acidity characteristic wavelength data matrix.
The data matrix of the characteristic wave length of the sugar degree obtained by the step comprises 158 characteristic variables, and the data matrix of the characteristic wave length of the acidity comprises 95 characteristic variables. Wherein the data matrix of the characteristic wavelength of the sugar degree is as follows:
it can be seen that W20、W21、W32、…、W2326The number wavelength variable is selected.
The acidity characteristic wavelength data matrix is:
it can be seen that W3、W9、W15、…、W2334The number wavelength variable is selected.
And step four, as shown in fig. 1a, integrating and screening the data matrix of the characteristic wavelength of the sugar degree and the data matrix of the characteristic wavelength of the acidity based on a wavelength optimization method, thereby obtaining an optimal wavelength data matrix which is effective for predicting the sugar degree and the acidity simultaneously. Specifically, the method comprises the following steps:
step 4.1, making the modeling wavelength data matrix a be a union of the brix characteristic wavelength data matrix and the acidity characteristic wavelength data matrix, and after merging, making the modeling wavelength data matrix a contain 240 characteristic variables, namely:
step 4.2, defining a variable i;
step 4.3, establishing a partial least squares PLS model according to the modeling wavelength data matrix A, and calculating the total error E of the partial least squares PLS model0;
The total error of the partial least squares PLS model is calculated by using the following formula (1):
in the formula (1), E is the total error of the partial least squares PLS model,andthe prediction decision coefficient for sugar degree and the prediction decision coefficient for acidity of the partial least squares PLS model are shown separately.
The partial least squares PLS prediction model can be expressed as: y ═ AX + B. Wherein X is an input spectrum data matrix, Y is a prediction value matrix of the model, A is a regression coefficient matrix, and B is a fitting residual error matrix.
Step 4.4, defining an error threshold value as E, and satisfying that E is less than E0;
Step 4.5, initializing i to 1;
step 4.6, delete ith wavelength variable lambda from modeling wavelength data matrix AiObtaining the model-building wavelength data matrix A after the ith updatingi(ii) a According to the model-building wavelength data matrix A after the ith updateiEstablishing an ith Partial Least Squares (PLS) model, and calculating the total error E of the ith Partial Least Squares (PLS) modeli;
And 4.7, assigning i +1 to i, returning to the step 4.6 to execute until i is equal to k, and thus obtaining a set of total errors of the partial least squares PLS modelsE1,E2,···,EkK represents the number of wavelength variables in the modeling wavelength data matrix A; from the set { E1,E2,···,EkPicking out minimum value Ep;
Step 4.8, judge EpIf E is true, if yes, the minimum value E is setpCorresponding wavelength variable lambdapDeleting the data matrix A from the modeling wavelength data matrix A so as to obtain an updated modeling wavelength data matrix, assigning the updated modeling wavelength data matrix to the A, and then returning to the step 4.5 to continue executing until the A is empty; otherwise, the algorithm terminates and a preferred wavelength data matrix is obtained that is effective for both brix and acidity predictions.
The preferred wavelength data matrix obtained by this step contains 118 wavelength variables, the distribution of which is shown in fig. 4. The preferred wavelength data matrix is represented as follows:
it can be seen that W3、W9、…、W21、…、W2334The number wavelength variable is the preferred wavelength.
Among these, preferred wavelengths are the concepts defined by the present invention itself.
And step five, taking the optimized wavelength data matrix as input, taking the data of the sugar degree and the acidity as output, and establishing a Partial Least Squares (PLS) model, thereby realizing high-precision nondestructive testing of the sugar degree and the acidity of the fruit at the same time.
The partial least squares model may be specifically expressed as:
in specific implementation, the step is divided into two parts of model establishment and model evaluation;
a. model building
Training the model using the correction set data; inputting the predicted spectrum data into the trained model to obtain a predicted samplePredicted value y of sugar degree and aciditybrixAnd yacidity. The specific calculation method is as follows:
ybrix=-230.2767×x1+(-223.9252)×x2+…+(-77.8512)×x118+11.0072
yacidity=81.2130×x1+93.4722×x2+…+179.9066×x118+0.3537
wherein xi(1. ltoreq. i.ltoreq.118), i.e. preferred wavelength spectrum data, ybrixAnd yacidityOutput for sugar and acidity respectively.
b. Model evaluation
The model predicted values for the sample brix and acidity are compared to the measured brix and acidity values, respectively. The evaluation method comprises the steps of dividing the root mean square error RMSEC and the determination coefficient of a correction setRoot Mean Square Error (RMSEP) of prediction set, coefficient of determinationAnd relative analytical error RPD. The prediction results of the built model are shown in table 2.
TABLE 2 model prediction results
As can be seen from Table 2, the model determines the coefficients for the prediction of the data brix of the prediction set0.9780, relative analytical error RPD 6.7477; determining coefficients for prediction of data acidity in prediction setAt 0.9695, the relative analytical error RPD was 5.7246.
The results show that the spectral-based wavelength is preferredThe nondestructive testing method for the sugar degree and the acidity of the fruit realizes the simultaneous high-precision nondestructive testing of the sugar degree and the acidity, the characteristic wavelength obtained by the wavelength optimization method is effective for the prediction of the sugar degree and the acidity simultaneously, and the coefficient is determinedThe relative analysis errors RPD are all larger than 5, and the overall stability of the model is good. Scatter diagrams of the measured values and the predicted values of the sugar degree and the acidity of the golden marshal apples are respectively shown in fig. 5a and fig. 5 b.
Claims (5)
1. A fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization is characterized by comprising the following steps:
step one, collecting fruit sample data and forming a labeled sample set; the marked sample set consists of two parts, namely original near infrared spectrum data of the fruit sample and actual sugar degree and acidity data of the fruit;
secondly, preprocessing the original near infrared spectrum data of the fruit sample to obtain preprocessed spectrum data;
thirdly, performing characteristic wavelength selection on the preprocessed spectral data based on the sugar content and the acidity data respectively by using a competitive adaptive reweighting sampling algorithm to obtain a sugar content characteristic wavelength data matrix and an acidity characteristic wavelength data matrix;
integrating and screening the data matrix of the characteristic wavelength of the sugar degree and the data matrix of the characteristic wavelength of the acidity based on a wavelength optimization method, thereby obtaining an optimized wavelength data matrix which is effective for predicting the sugar degree and the acidity simultaneously;
and step five, establishing a Partial Least Squares (PLS) model by taking the optimized wavelength data matrix as input and the data of the sugar degree and the acidity as output, thereby realizing high-precision nondestructive testing of the sugar degree and the acidity of the fruit at the same time.
2. The method for nondestructive testing of sweetness and acidity of fruit based on spectral wavelength preference of claim 1, wherein said first step comprises the steps of:
step 1.1, collecting original near infrared spectrum data of a fruit sample:
selecting fruit samples, and numbering and marking four positions of each fruit sample uniformly distributed on the equator in sequence;
collecting near-infrared diffuse reflection spectrums of all mark point areas of a fruit sample by using a spectrometer and an optical fiber sampling accessory;
converting the collected near-infrared diffuse reflection spectrum into an absorbance spectrum, and using the absorbance spectrum as original near-infrared spectrum data of the fruit sample;
step 1.2, collecting a sample label:
and (3) determining the actual sugar degree and acidity data of the fruits in each mark point area by using the fruit and sugar acid all-in-one machine.
3. The fruit brix and acidity nondestructive testing method based on spectral wavelength optimization according to claim 1, wherein said step four is performed as follows:
step 4.1, enabling the modeling wavelength data matrix A to be a union set of the brix characteristic wavelength data matrix and the acidity characteristic wavelength data matrix;
step 4.2, defining a variable i;
step 4.3, establishing a partial least squares PLS model according to the modeling wavelength data matrix A, and calculating the total error E of the partial least squares PLS model0;
Step 4.4, defining an error threshold value as E, and satisfying that E is less than E0;
Step 4.5, initializing i to 1;
step 4.6, delete ith wavelength variable lambda from modeling wavelength data matrix AiObtaining the model-building wavelength data matrix A after the ith updatingi(ii) a According to the model-building wavelength data matrix A after the ith updateiEstablishing an ith Partial Least Squares (PLS) model, and calculating the total error E of the ith Partial Least Squares (PLS) modeli;
And 4.7, after the value of i +1 is assigned to i, returning to the step 4.6 to execute until i is equal to k, thereby obtaining the minimum two of the deviation valuesSet of gross error components by PLS model { E1,E2,…,EkK represents the number of wavelength variables in the modeling wavelength data matrix A; from the set { E1,E2,…,EkPicking out minimum value Ep;
Step 4.8, judge EpIf E is true, if yes, the minimum value E is setpCorresponding wavelength variable lambdapDeleting the data matrix A from the modeling wavelength data matrix A so as to obtain an updated modeling wavelength data matrix, assigning the updated modeling wavelength data matrix to the A, and then returning to the step 4.5 to continue executing until the A is empty; otherwise, the algorithm terminates and a preferred wavelength data matrix is obtained that is effective for both brix and acidity predictions.
4. The method for nondestructive testing of sweetness and acidity of fruit based on spectral wavelength preference of claim 3, wherein the total error of the partial least squares PLS model is calculated by using formula (1):
5. The spectral wavelength-based preferred fruit brix and acidity nondestructive testing method of claim 3, wherein:
the partial least squares PLS prediction model can be expressed as: and Y is AX + B, wherein X is an input spectrum data matrix, Y is a prediction value matrix of the model, A is a regression coefficient matrix, and B is a fitting residual error matrix.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110361802.5A CN113267466B (en) | 2021-04-02 | 2021-04-02 | Fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110361802.5A CN113267466B (en) | 2021-04-02 | 2021-04-02 | Fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113267466A true CN113267466A (en) | 2021-08-17 |
CN113267466B CN113267466B (en) | 2023-02-03 |
Family
ID=77228426
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110361802.5A Active CN113267466B (en) | 2021-04-02 | 2021-04-02 | Fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113267466B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114018836A (en) * | 2021-09-27 | 2022-02-08 | 中国科学院合肥物质科学研究院 | Sugar degree detection method and system |
CN115326747A (en) * | 2022-08-08 | 2022-11-11 | 江西绿萌科技控股有限公司 | Method for detecting fruit surface rot by short-wave near infrared |
CN116008208A (en) * | 2023-03-27 | 2023-04-25 | 山东省科学院海洋仪器仪表研究所 | Seawater nitrate concentration characteristic spectrum band selection method |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1987456A (en) * | 2006-12-14 | 2007-06-27 | 浙江大学 | Predicting method for fruit maturity |
US20100297291A1 (en) * | 2007-09-21 | 2010-11-25 | Suntory Holdings Limited | Visible/near-infrared spectrum analyzing method and grape fermenting method |
CN102305772A (en) * | 2011-07-29 | 2012-01-04 | 江苏大学 | Method for screening characteristic wavelength of near infrared spectrum features based on heredity kernel partial least square method |
CN103344600A (en) * | 2013-06-28 | 2013-10-09 | 中国农业大学 | Characteristic wavelength selecting method for near infrared spectrum in ant colony optimization algorithm |
CN105806803A (en) * | 2016-03-15 | 2016-07-27 | 潘涛 | Multi-index collaborative analysis wavelength combination and selection method thereof |
WO2016139335A1 (en) * | 2015-03-04 | 2016-09-09 | Université Libre de Bruxelles | Method for determining the degree of phosphorylation and the degree of glycosylation of a protein in a protein sample |
CN106769970A (en) * | 2016-12-07 | 2017-05-31 | 甘肃萃英大农科技有限公司 | A kind of method of the kind, pol and acidity of Fast nondestructive evaluation apple |
GB201706666D0 (en) * | 2017-04-27 | 2017-06-14 | Protea Ltd | Spectroscopic analysis |
US20170199952A1 (en) * | 2014-06-26 | 2017-07-13 | Jeju National University Industry-Academic Cooperation Foundation | Method of predicting sugar content and acidity of fruit using multivariate statistical analysis of ft-ir spectrum data |
CN110726694A (en) * | 2019-10-22 | 2020-01-24 | 常州大学 | Characteristic wavelength selection method and system of spectral variable gradient integrated genetic algorithm |
CN111027025A (en) * | 2019-12-11 | 2020-04-17 | 华北电力大学(保定) | Method for screening infrared spectrum characteristic wavelength to predict wine quality parameters |
-
2021
- 2021-04-02 CN CN202110361802.5A patent/CN113267466B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1987456A (en) * | 2006-12-14 | 2007-06-27 | 浙江大学 | Predicting method for fruit maturity |
US20100297291A1 (en) * | 2007-09-21 | 2010-11-25 | Suntory Holdings Limited | Visible/near-infrared spectrum analyzing method and grape fermenting method |
CN102305772A (en) * | 2011-07-29 | 2012-01-04 | 江苏大学 | Method for screening characteristic wavelength of near infrared spectrum features based on heredity kernel partial least square method |
CN103344600A (en) * | 2013-06-28 | 2013-10-09 | 中国农业大学 | Characteristic wavelength selecting method for near infrared spectrum in ant colony optimization algorithm |
US20170199952A1 (en) * | 2014-06-26 | 2017-07-13 | Jeju National University Industry-Academic Cooperation Foundation | Method of predicting sugar content and acidity of fruit using multivariate statistical analysis of ft-ir spectrum data |
WO2016139335A1 (en) * | 2015-03-04 | 2016-09-09 | Université Libre de Bruxelles | Method for determining the degree of phosphorylation and the degree of glycosylation of a protein in a protein sample |
CN105806803A (en) * | 2016-03-15 | 2016-07-27 | 潘涛 | Multi-index collaborative analysis wavelength combination and selection method thereof |
CN106769970A (en) * | 2016-12-07 | 2017-05-31 | 甘肃萃英大农科技有限公司 | A kind of method of the kind, pol and acidity of Fast nondestructive evaluation apple |
GB201706666D0 (en) * | 2017-04-27 | 2017-06-14 | Protea Ltd | Spectroscopic analysis |
CN110726694A (en) * | 2019-10-22 | 2020-01-24 | 常州大学 | Characteristic wavelength selection method and system of spectral variable gradient integrated genetic algorithm |
CN111027025A (en) * | 2019-12-11 | 2020-04-17 | 华北电力大学(保定) | Method for screening infrared spectrum characteristic wavelength to predict wine quality parameters |
Non-Patent Citations (6)
Title |
---|
HONGBIN PU ET AL: "Soluble Solids Content and pH Prediction and Maturity Discrimination of Lychee Fruits Using Visible and Near Infrared Hyperspectral Imaging", 《FOOD ANAL.METHODS》 * |
XUAN WEI ET AL: "Modeling for SSC and firmness detection of persimmon based on NIR hyperspectral imaging by sample partitioning and variables selection", 《INFRARED PHYSICS & TECHNOLOGY》 * |
刘燕德等: "近红外漫反射用于检测苹果糖度及有效酸度的研究", 《光谱学与光谱分析》 * |
罗明英等: "基于关键变量的OPLS预测方法", 《华东理工大学学报(自然科学版)》 * |
许锋等: "基于MCCV-CARS-RF建立红提糖度和酸度的可见-近红外光谱无损检测方法", 《食品科学》 * |
陈晓辉等: "基于iPLS和CARS数据融合技术的波长选择算法", 《计算机工程与应用》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114018836A (en) * | 2021-09-27 | 2022-02-08 | 中国科学院合肥物质科学研究院 | Sugar degree detection method and system |
CN114018836B (en) * | 2021-09-27 | 2024-04-26 | 中国科学院合肥物质科学研究院 | Sugar degree detection method and system |
CN115326747A (en) * | 2022-08-08 | 2022-11-11 | 江西绿萌科技控股有限公司 | Method for detecting fruit surface rot by short-wave near infrared |
CN116008208A (en) * | 2023-03-27 | 2023-04-25 | 山东省科学院海洋仪器仪表研究所 | Seawater nitrate concentration characteristic spectrum band selection method |
Also Published As
Publication number | Publication date |
---|---|
CN113267466B (en) | 2023-02-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113267466B (en) | Fruit sugar degree and acidity nondestructive testing method based on spectral wavelength optimization | |
Liu et al. | Nondestructive measurement of soluble solid content of navel orange fruit by visible–NIR spectrometric technique with PLSR and PCA-BPNN | |
Zou et al. | Selection of the efficient wavelength regions in FT-NIR spectroscopy for determination of SSC of ‘Fuji’apple based on BiPLS and FiPLS models | |
Larraín et al. | A multipurpose portable instrument for determining ripeness in wine grapes using NIR spectroscopy | |
Xiaobo et al. | Use of FT-NIR spectrometry in non-invasive measurements of soluble solid contents (SSC) of ‘Fuji’apple based on different PLS models | |
JP5441703B2 (en) | Visible / Near-Infrared Spectroscopy and Grape Brewing Method | |
Jha et al. | Non-destructive prediction of quality of intact apple using near infrared spectroscopy | |
CN111855608B (en) | Near-infrared nondestructive detection method for apple acidity based on fusion characteristic wavelength selection algorithm | |
CN107817223A (en) | The construction method of quick nondestructive real-time estimate oil property model and its application | |
CN107703097B (en) | Method for constructing model for rapidly predicting crude oil property by using near-infrared spectrometer | |
CN107271382A (en) | A kind of different growing rape leaf SPAD value remote sensing estimation methods | |
CN111965140B (en) | Wavelength point recombination method based on characteristic peak | |
CN101825567A (en) | Screening method for near infrared spectrum wavelength and Raman spectrum wavelength | |
CN113607656A (en) | Leaf chlorophyll content monitoring method and system based on hyperspectral imaging | |
Xu et al. | Nondestructive detection of internal flavor in ‘Shatian’pomelo fruit based on visible/near infrared spectroscopy | |
CN107860743A (en) | Utilize the method and its application of the model of reflective near infrared fibre-optical probe structure fast prediction oil property | |
CN111999258B (en) | Spectral baseline correction-oriented weighting modeling local optimization method | |
CN114414521A (en) | Milk main component measuring method based on infrared multispectral sensor | |
CN107271389B (en) | A kind of spectral signature variable fast matching method based on index extreme value | |
Chen et al. | Prediction of apple internal qualities using hyperspectral imaging techniques | |
Purwanto et al. | Non destructive prediction of pH in mango fruit cv. Gedong Gincu using NIR spectroscopy | |
CN112881333B (en) | Near infrared spectrum wavelength screening method based on improved immune genetic algorithm | |
CN109459408A (en) | A kind of Near-Infrared Quantitative Analysis method based on sparse regression LAR algorithm | |
CN112595706A (en) | Laser-induced breakdown spectroscopy variable selection method and system | |
CN114018836B (en) | Sugar degree detection method and system |
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 |