Summary of the invention
The object of the invention is to provide a kind of near infrared universal model detection method of utilizing the close fruit quality index of light physical property, solve in existing near infrared detection technology and can only set up near-infrared model for a class fruit, without ripe many kinds universal model, cause thus the foundation of model and maintenance cost is high, work efficiency is relatively low technical matters; Also solve existing nir instrument due to itself cover wavelength points limited, cause built-in model limited amount, the scope of application is relatively limited to, applicability is poor technical barrier.
For solving the problems of the technologies described above, the present invention adopts following technical scheme:
A near infrared universal model detection method for the close many kinds fruit quality of smooth physical property index, is characterized in that: comprises the foundation of near infrared universal model and utilizes near infrared universal model to measure fruit internal quality two large divisions,
First, the foundation of near infrared universal model, specifically comprises the steps:
Step 1, material are prepared: the fruit to be measured of preparing many kinds that light physical property is close, described smooth physical property is close refers to that storeroom has similar physicochemical property, the Euclidean distance of the near infrared original spectrum of any two kinds of fruit wherein after spectrum normalization is not more than 0.2, and total kind number of fruit is 2~6 classes.The selection of the material that described smooth physical property is close is extremely important, close close physical property and the chemical property of referring to of described smooth physical property, make storeroom near infrared original spectrum after spectrum normalization, Euclidean distance is not more than 0.2, Euclidean distance can represent the similarity degree between signal, Euclidean distance is less, and spectrum similarity degree is higher.According to the Euclidean distance between prior art calculation sample, concrete steps are as follows:
1, in each kind, choose the sample of sufficient amount, gather its original near infrared spectrum;
2, select representative wave band: should avoid the wave band that noise is larger, the fruit variety the present invention relates to is chosen 780~920nm wave band;
3, calculate standard spectrum: calculate the averaged spectrum of each material, as the standard spectrum of this kind fruit;
4, spectrum normalized: respectively each material is carried out to spectrum normalized, the ultimate principle formula of spectrum normalized is: X=(A-
)/(A
max-A
min); Wherein, X is the value after spectrum normalized, the absorbance that A is original spectrum,
for the absorbance of standard spectrum, A
maxfor maximum absorbance value, A
minfor minimum absorbance;
5, calculate the Euclidean distance of any two kind fruit: computing formula is D
mn=
wherein, m and n represent respectively fruit m and fruit n, and total wavelength that p is near infrared spectrum is counted, Xmi represents the value that the near infrared spectrum of fruit m is ordered at i after spectrum normalized, and Xni represents the value that the near infrared spectrum of fruit n is ordered at i after spectrum normalized.
Step 2, choose modeling sample: in the fruit to be measured from each kind, choose at random at least 30 samples as calibration set sample, at least 10 samples are as checking collection sample, and calibration set sample and checking integrates the number ratio of sample as 3:1.
Step 3, gather the original near infrared spectrum of all calibration set samples and checking collection sample.
Step 4, utilize all actual quality index values that gathered the fruit of spectrum of chemical determination.
Step 5, the near infrared spectrum collecting in step 3 is carried out to pre-service, use Chemical Measurement software to carry out successively scatter correction, reduce noise and eliminate the processing of integral time all spectrum.
Step 6, extract the characteristic wavelength of each kind fruit: with Chemical Measurement software, the spectrum of all kinds of fruit is processed respectively, employing Chemical Measurement algorithm for example moving window partial least square method is MWPLS method, the characteristic wavelength while extracting the independent modeling of such fruit.
Step 7, extract the common features wavelength coverage of all kind fruit: after the characteristic wavelength for the treatment of each kind fruit extracts, compare, choose can cover all characteristic wavelengths wave band as common features wavelength coverage.
Step 8, from common features wavelength, extract common features wavelength points: use chemical strength algorithm if successive projection algorithm is SPA algorithm, extract the common features wavelength points in this wavelength.
Step 9, set up near infrared universal model: the common features wavelength points that step 8 is obtained is as modeling wavelength, and the quality index values in step 4, as standard value, utilizes the pretreated near infrared spectrum of step 5 to set up near infrared universal model.
The check of step 10, the accuracy of near infrared universal model: respectively by near infrared spectrum and the actual quality index values substitution near infrared universal model of checking collection sample, carry out the check of near infrared universal model accuracy, according to predictor calculation prediction standard deviation RMSEP, if its value meets requirement of experiment, representative model is feasible; Otherwise repeating step five~step 10, until meet the demands.
Second portion, utilizes near infrared universal model to measure fruit quality index, and concrete steps are as follows:
Steps A, near infrared universal model is imported in corresponding near infrared spectrometer, adjust the associated quad time.
Step B, utilize this near infrared spectrometer collection to remain the original near infrared spectrum of all testing samples, instrument can be input to the original near infrared spectrum obtaining in model, draws quality index values, until that all fruit is measured is complete.
In the present invention, the fruit that in step 1, light physical property is close can be apple, three kinds of peach and pears, it has close physics, chemical property, as being all ball-type shape, sizableness, skin is thin, moisture and soluble solid content are close, and there is fruit stone, soluble sugar is all by sucrose, glucose, fructose and sorbierite form, due near infrared spectrum reflection is the higher information of chemical composition content in material, as being water and soluble solid etc. in fruit, therefore there is consistance in three's near infrared spectrum, the Euclidean distance of pears and apple is 0.124, the Euclidean distance of pears and peach is 0.150, the Euclidean distance of apple and peach is 0.071, the requirement of the satisfied near infrared universal model the present invention relates to material.
As the preferred technical solution of the present invention, the described index of quality can be pol index, acidity index or degree of ripeness index.
As present invention further optimization technical scheme, in described step 3, the concrete grammar of near infrared spectra collection is: adopt K-BA100R type portable near infrared spectrometer, be equipped with collecting fiber annex, adopt CCD detecting device, after sample is placed to room temperature, on each sample equator, in uniform 4 sample area, carry out spectra collection, be respectively 100ms integral time when apple, pears and peach spectra collection, 90ms and 60ms, spectral range 500nm~1010nm, resolution 2nm.
As present invention further optimization technical scheme, in described step 4, while measuring actual quality index values,
1) if the index of quality is pol index, its assay method is: on fruit sample equator, the centre in equally distributed four spectra collection regions takes after the crowded juice of square of 20mm*20mm*10mm, adopts the content of refractometer mensuration fruit internal soluble solid as actual pol index;
2) if the index of quality is acidity index, its assay method is: with pH potential method, carry out acidity assaying, on fruit sample equator, pulp 25g is got at uniform four regional center positions, the water of smashing 80 ℃ of rear use to pieces is transferred in 250mL volumetric flask, carry out 30min boiling water bath, then take out and be cooled to room temperature, after filtering, constant volume forms test solution, draw test solution 50mL, be placed in beaker, add 50mL water to mix, with the NaOH solution of 0.05mol/L, be titrated to terminal, in this process, with pH meter, monitor the pH value of test solution, the vs volume volume that record consumes, finally calculate total acid content,
3) if the index of quality is degree of ripeness index, its assay method is: sample respectively according to above-mentioned actual acidity index with the assay method of actual pol index and measure pol and acidity, then calculate sugar-acid ratio, in order to mark degree of ripeness.Sugar-acid ratio is larger, illustrates that degree of ripeness is higher.
As present invention further optimization technical scheme, in described step 5, the pretreated concrete grammar of spectrum is: the pretreated concrete grammar of spectrum is to utilize Chemical Measurement software, uses successively cubic polynomial SG smoothing method and the second derivative method that SNV, window size are 25 to carry out pre-service to spectrum; Because scattering medium existence between fruit is different, cause sample different to scattering of light degree, use SNV to proofread and correct, improve spectral quality, make the difference being caused by scattering between spectrum reduce simultaneously; There is certain noise in spectrum two, can affect modeling effect, uses cubic polynomial item formula, and the SG that window size is 25 smoothly eliminates spectrum high frequency noise, improves spectral quality; In addition,, in order to guarantee the accuracy of actual measurement, different fruit, has different integral time, as being respectively 100ms the integral time of apple, pears, peach, 90ms, 60ms,, and can make different integral time spectrum drift about, use second derivative to eliminate.
As present invention further optimization technical scheme, in described step 6, adopting moving window partial least square method is that MWPLS algorithm carries out respectively the extraction of characteristic wavelength to apple, peach and pears, and window size is respectively 20,25 and 30.
As present invention further optimization technical scheme, to state in step 8, the characteristic wavelength point of extraction has 5, is respectively 840nm, 850nm, 860nm, 886nm, 900nm.
As present invention further optimization technical scheme, in described step 9, use Chemical Measurement software to set up near infrared PLS model or use Chemical Measurement software to set up near infrared MLR model as IBM SPSS Statistics 20 softwares as TQ 9.0 softwares, as modeling result when setting up near infrared MLR model is: Y=10.433+22996.898 λ
840-24482.457 λ
850-4599.339 λ
860+ 208314.677 λ
886-89204.98 λ
900; Wherein, in formula, λ
840, λ
850, λ
860, λ
886, λ
900for the near infrared spectrum medium wavelength point after pre-service is the absorbance at 840nm, 850nm, 860nm, 886nm, 900nm place.
Compared with prior art, technical advantage of the present invention is:
1, disposable modeling, reduction model are set up and maintenance cost
The present invention has set up and has been applicable to the near infrared universal model that a plurality of kind fruit quality indexs detect, in modeling process, by second derivative, eliminate the impact of integral time, in the characteristic wavelength of each kind, filter out common features wavelength, then with SPA algorithm, further extract characteristic wavelength point, disposable foundation can detect the near infrared universal model of multiple types fruit pol, there is extremely strong feasibility, overcome the drawback that variety classes fruit in existing Near Infrared Spectroscopy Detection Technology must carry out classification and Detection, with a model, both can complete the detection of a plurality of index of quality of various fruits, greatly reduce modeling cost and model maintenance cost.
2, mensuration accuracy rate is high
The present invention checks the validity of this method by a large amount of experiments, comprise the general near infrared pol detection model of having set up apple, peach and pears three, result is as shown in table 1, and from common features wavelength, 840~918 nm choose 840nm, 850nm, 860nm, 886nm, five characteristic wavelength points of 900nm, set up PLS model, the Rc=0.98 of model, total REMSEP=0.38, the RMSEP of prediction apple, peach, pears is respectively 0.42,0.32 and 0.41; With the Rc=0.96 of MLR model, total RMSEP=0.38, the RMSEP of prediction apple, peach, pears is respectively 0.44,0.31 and 0.40, and both all have good precision of prediction.
3, Model Practical is strong
In modeling process, use second derivative to eliminate the impact of sample integral time, model can detect with different integral time when reality is used; Use MWPLS in conjunction with SPA algorithm, optimize common features wavelength points, greatly reduce the complexity of model, greatly improved the practicality of model, meet practical application request, near infrared universal model can apply on easy nir instrument.
Embodiment
Below in conjunction with specific embodiment, content of the present invention is further explained, wherein, the embodiment 1 the present invention relates to and embodiment 2 all select the representative extremely strong fruit of three classes: Fuji apple, honey peach and abundance of water pears, its common feature is: ball-type shape, sizableness, skin is thin, moisture and soluble solid content are close, and there is fruit stone, principal ingredient-soluble sugar of three is all by sucrose, glucose, fructose and D-sorbite form, three's near infrared spectrum has certain similarity, the Euclidean distance of pears and apple is 0.124, the Euclidean distance of pears and peach is 0.150, the Euclidean distance of apple and peach is 0.071, for setting up universal model, established theoretical foundation.The present invention is applicable to the mensuration of the close fruit quality of all smooth physical property, described smooth physical property is close refers to that close physics and chemistry character, storeroom near infrared spectrum shape similarity are higher, the Euclidean distance of the near infrared original spectrum of any two kinds of fruit wherein after spectrum normalization is not more than 0.2, the quantity of kind is 2~6 classes, as small watermelon and muskmelon, orange and oranges and tangerines; The described index of quality is pol index, hardness number, acidity index or degree of ripeness index, because the near infrared universal model method for building up of all satisfactory different types of fruits or the index of quality in the present invention is basically identical, so do not enumerate in content of the present invention.This pol of sentencing mensuration Fuji apple, honey peach and three kinds of fruit of abundance of water pears is example, introduces in detail content of the present invention.
1 materials and methods
1.1 instruments and sample
The K-BA100R type portable near infrared spectrometer of the Japanese Kubota of experiment employing Co., Ltd., is equipped with collecting fiber annex, adopts CCD detecting device; The PAL-1 type handheld digital saccharimeter of Japan Atago company, reading result is Brix degree (Brix), possesses automatic temperature control function.
Each 40 of red fuji apple, honey peach and abundance of water pears, totally 120 samples, all purchased from wholesale market, Beijing.
1.2 spectra collections and standard value are measured
Sample is placed to after room temperature, on uniform 4 regions, each sample equator (90 °, interval), carries out spectra collection, the principle according to spectral energy value in rated energy scope, and the best total of points time of apple, pears and peach is respectively 100ms, 90ms and 60ms.Spectral range is 500nm-1010nm, resolution 2nm, totally 256 data points.After spectra collection completes, the square of getting the high about 20mm * 20mm * 10mm of length and width at pickup area center squeezes juice and measures pol value.As shown in Figure 1, be the original spectrum of the Fuji apple that relates in the embodiment of the present invention, abundance of water pears, honey peach, wavelength coverage is 700~1010nm as can be seen from Figure, can find out that their original spectrums are closely similar.
1.3 Chemical Measurement softwares
MWPLS, SPA program realize in Matlab R2012a (The mathworks Inc., Natick, MA, USA), and preprocessing procedures and PLS model are realized in TQ 9.0 (Thermo Nicolet Co., USA).MLR model is realized in IBM SPSS Statistics 20.
1.4 statistical study
Use Kennard-Stone algorithm to carry out calibration set and the division of verifying collection to sample, K-S algorithm is that the minimax Euclidean distance based between original spectrum is chosen representative sample composition calibration set.Due to the original spectrum of apple, peach, pears in this experiment, there is some difference and overlap, and as Fig. 1, can not unify to use K-S algorithm, can only to apple, peach, pears, carry out K-S division respectively, thereby guarantee the harmony of three kinds of fruit calibration sets.Set calibration set and verify that the ratio integrating is as 3:1, statistics is as shown in table 1.
2 results and discussion
2.1 spectrum pre-service
First use standard normal variable conversion (standard normal variate transformation, SNV), be used for eliminating the impact on NIR diffuse transmission spectrum of solid particle size, surface scattering and change in optical path length.Adopt afterwards cubic polynomial Savitzky-Golay level and smooth, window size is 25, to eliminate the high frequency noise in spectrum.
2.2 eliminate impact integral time
Due to the difference of near infrared light transmission capacity on different fruit, different fruit has the different acquired integrated time.As shown in Figure 1, because the integral time of peach is the shortest, its absorbance is higher than apple and pears, and because the integral time of apple, pears is close, causes its spectrum to occur overlapping, thereby must eliminate the impact of integral time, could set up universal model.
Same apple is used in this research, same position, integral time is within the scope of 50ms-150ms, at interval of 10ms, carry out experiment of single factor one time, the poor spectrum of asking every spectrum and averaged spectrum, except the larger part of noise, is nearly all straight line, only can cause the upper and lower translation of spectrum therefore different integral time, through first order derivative or second derivative processing, just can eliminate the impact of integral time.Because second derivative can also be eliminated horizontal spectral drift, amplify near infrared region signal intensity.Therefore select second derivative to process.Fig. 2 is that the original spectrum of three kinds of fruit carries out pretreated spectrogram, can find out and have better consistance.
The selection of 2.3 generic features wavelength
In fruit, soluble solid is generally comprised of soluble sugar and acid, and acid content very low (0.1%) in apple, peach, pears does not almost have effective information near infrared spectrum, and therefore, soluble solid principal ingredient is soluble sugar.In apple, peach, pears, main soluble sugar is all fructose, glucose sugar, sucrose and sorbierite, and it is feasible therefore seeking generic features wavelength.
Moving window partial least square method (MWPLS), can optimize between block of information, promotes the predictive ability of PLS model.Adopt MWPLS algorithm to carry out respectively the selection of characteristic wavelength to apple, peach, pears herein, window size is respectively 20,25 and 30, and result is as table 3.
Using minimum RMSEP as selection standard, and the characteristic interval of selecting apple, peach, pears is respectively 880nm~918nm, and 852nm~900nm and 840nm~898nm therefrom can find out the similarity of three's characteristic interval.In order to improve the robustness of model, choose that 840nm~918nm is interval sets up PLS model for generic features wavelength herein.
Because MWPLS cannot eliminate the redundant information of selected wave band, and selected 840nm~918nm interval covered the characteristic interval of apple, peach, pears, so in this wave band, has bulk redundancy information.And successive projection algorithm can make the collinearity between variable reach minimum, redundant information is eliminated.On 840nm~918nm interval, use SPA algorithm herein, to optimize characteristic interval, reduced model.Fig. 3 and Fig. 4 are the selection result figure of the SPA characteristic wavelength point that the present invention relates to, and what wherein Fig. 3 represented is have minimum sandards error and remain unchanged while selecting 5 points, and Fig. 4 represents is selected 5 positions in spectrum; Fig. 4 result shows, selecting wavelength points is 5, is respectively 840nm, 850nm, 860nm, 886nm, 900nm.
The Establishment and evaluation of 2.4 universal models
General PLS model selection common features wavelength 840~918 nm set up a model, model Rc=0.98, and total REMSEP=0.38, the RMSEP of prediction apple, peach, pears is respectively 0.42,0.36 and 0.37;
Then from common features wavelength, choose 840nm, 850nm, 860nm, 886nm, five characteristic wavelength point modelings of 900nm, model Rc=0.98, total REMSEP=0.38, the RMSEP of prediction apple, peach, pears be respectively 0.42,0.41 and 0.32, PLS model result as shown in Figure 5;
As shown in Figure 6, use set up MLR model at these 5, modeling result is:
Y=10.433+22996.898λ
840-24482.457λ
850-4599.339λ
860+208314.677λ
886-89204.98λ
900
Wherein, in formula, λ
840, λ
850, λ
860, λ
886, λ
900in step 4, wavelength points is the value at 840nm, 850nm, 860nm, 886nm, 900nm place.Its R
2=0.96, RMSEC=0.48, RMSEC=0.38.
Result shows, three models all have good precision of prediction, and the RMSEP value of three kinds of fruit is all less than to 0.5, close with kubota instrument single variety fruit forecast result of model.After the preferred wave point of SPA, greatly reduced variable number, model is simplified, and the application of model is improved.
3 utilize near infrared universal model to measure fruit pol
Steps A, near infrared universal model is imported in corresponding near infrared spectrometer, adjust the associated quad time;
Step B, utilize this near infrared spectrometer collection to remain the near infrared spectrum of all testing samples, and utilize built-in near infrared universal model automatically to export pol value, until that all fruit is measured is complete.