Spectral feature model construction method, device, electronic device and storage medium
By screening the feature wavelengths that directly correlate the model effect and building a spectral feature model, the problem of feature wavelength selection in the existing technology is solved, and efficient and streamlined spectral feature model construction and fast matching effect are achieved.
Patent Information
- Application Number
- CN202111509440.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2041-12-10
AI Technical Summary
In the prior art, the characteristic wavelength selection method of the spectral characteristic model is not directly related to the model effect, resulting in poor model performance.
Through the initial screening process, random sampling process, optimized screening process and model construction process, the characteristic wavelengths of the directly correlate the model effect are selected and the spectral feature model is constructed. The specific steps include screening wavelength points based on the regression coefficient and the determination coefficient, and constructing the model through multivariate linear regression.
The original spectral data is simplified, the modeling efficiency and simplification of the model are improved, the prediction performance of the model is accurate, and the characteristic spectrum can be quickly matched with the substance to be detected.
Smart Images

Figure CN114372229B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of chemometrics, and in particular to a method, device, electronic device and storage medium for constructing a spectral feature model. Background Art
[0002] In recent years, spectral technology has been widely used due to its advantages such as fast, non-destructive and pollution-free. Spectroscopic technology will generate massive amounts of data in its application, and the hot issues such as how to screen characteristic wavelengths and how to establish spectral characteristic models have also received special attention.
[0003] In order to simplify the model and improve its performance, it is necessary to adopt a characteristic wavelength selection method and use the characteristic wavelength to establish the model. However, the current characteristic wavelength selection method has the problem that the characteristic wavelength is not directly related to the spectral characteristic model.
[0004] The present invention provides a method, device, electronic device and storage medium for constructing a spectral characteristic model, which are used to screen characteristic wavelengths directly related to model effects and solve the problem of characteristic wavelength selection in the spectral modeling process.
[0005] The present invention provides a method for constructing a spectral feature model, comprising: an initial screening process, selecting wavelength points of a preset first screening ratio from the preset wavelength point set based on a regression coefficient of an actual measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to a concentration value, to obtain a first wavelength point set; selecting wavelength points of a preset second screening ratio from the preset wavelength point set based on a determination coefficient of an absorbance prediction value of each preset wavelength point in the preset wavelength point set with respect to an actual measured absorbance value, to obtain a second wavelength point set; taking the union of the first wavelength point set and the second wavelength point set, to obtain a third wavelength point set;
[0006] A random sampling process, randomly selecting the same preset sampling number of wavelength points from the third wavelength point set multiple times to obtain multiple fourth wavelength point subsets to form a fourth wavelength point set;
[0007] Optimizing the screening process, screening the fourth wavelength point subsets with a preset third screening ratio based on the root mean square error corresponding to each of the fourth wavelength point subsets, to obtain a fifth wavelength point set;
[0008] The model building process is to filter the wavelength points of the fifth wavelength point set with a preset fourth screening ratio based on the frequency of occurrence of the wavelength points to obtain a sixth wavelength point set; the wavelength points in the sixth wavelength point set and the corresponding regression coefficients are input into the multivariate linear regression equation to obtain a spectral feature model.
[0009] According to a spectral feature model construction method provided by the present invention, before the initial screening process, the method further includes:
[0010] The regression coefficient solution process inputs the spectral data of the same substance at different concentration values into the regression coefficient solution equation to obtain the regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value.
[0011] According to a spectral feature model construction method provided by the present invention, after the regression coefficient solution process, the method further includes:
[0012] A determination coefficient solution process, constructing a univariate linear regression equation based on the regression coefficient of the measured absorbance value of each preset wavelength point with respect to the concentration value, and obtaining the absorbance prediction value of each preset wavelength point at different concentration values based on the univariate linear regression equation;
[0013] The measured absorbance value and the predicted absorbance value of each preset wavelength point at different concentration values are input into a determination coefficient solving equation to obtain the determination coefficient of each preset wavelength point in the preset wavelength point set.
[0014] According to a method for constructing a spectral feature model provided by the present invention, the method further comprises:
[0015] The initial screening process is repeatedly executed based on different preset first screening ratios and / or different preset second screening ratios, and / or the random sampling process is repeatedly executed based on different preset sampling quantities.
[0016] According to a spectral feature model construction method provided by the present invention, the regression coefficient solution equation is: Among them, x i represents the concentration value of the i-th sample,
[0017] Represents the average value of sample concentration, y i represents the measured absorbance value of the i-th sample, It represents the average value of the measured absorbance values.
[0018] According to a spectral feature model construction method provided by the present invention, the determination coefficient solution equation is: Among them, y i represents the measured absorbance value of the i-th sample, represents the average value of the measured absorbance. Represents the predicted absorbance value of the i-th sample.
[0019] According to a method for constructing a spectral feature model provided by the present invention, the method further includes: solving the root mean square error corresponding to each of the fourth wavelength point subsets based on a root mean square error formula, and the root mean square error formula is: Among them, y i represents the measured absorbance value of the i-th sample, represents the predicted absorbance value of the i-th sample, and n represents the number of samples.
[0020] The present invention also provides a spectral feature model construction device, comprising: an initial screening module, for selecting wavelength points of a preset first screening ratio from the preset wavelength point set based on the regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value, to obtain a first wavelength point set; for selecting wavelength points of a preset second screening ratio from the preset wavelength point set based on the determination coefficient of the predicted absorbance value of each preset wavelength point in the preset wavelength point set with respect to the measured absorbance value, to obtain a second wavelength point set; and for taking the union of the first wavelength point set and the second wavelength point set, to obtain a third wavelength point set;
[0021] A random sampling module, used for randomly sampling the same preset sampling number of wavelength points from the third wavelength point set multiple times to obtain multiple fourth wavelength point subsets to form a fourth wavelength point set;
[0022] an optimization screening module, configured to screen the fourth wavelength point subsets with a preset third screening ratio based on the root mean square error corresponding to each of the fourth wavelength point subsets, to obtain a fifth wavelength point set;
[0023] The model building module is used to screen the wavelength points of the fifth wavelength point set with a preset fourth screening ratio based on the frequency of occurrence of the wavelength points to obtain a sixth wavelength point set; the wavelength points in the sixth wavelength point set and the corresponding regression coefficients are input into a multivariate linear regression equation to obtain a spectral feature model.
[0024] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned spectral feature model construction methods are implemented.
[0025] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described methods for constructing a spectral feature model.
[0026] The spectral characteristic model construction method, device, electronic device and storage medium provided by the present invention achieve a substantial simplification of original spectral data through a characteristic wavelength screening method based on the common characterization of correlation coefficient and determination coefficient; and the spectral characteristic model based on characteristic wavelength is constructed by using a multivariate linear regression strategy, which has the advantages of high modeling efficiency, simple and practical model and accurate model prediction performance, and is conducive to the rapid matching of characteristic spectra with substances to be detected. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 This is one of the flow charts of the method for constructing a spectral feature model provided by the present invention;
[0029] Figure 2 This is the second flow chart of the method for constructing a spectral feature model provided by the present invention;
[0030] Figure 3 It is a schematic diagram of the root mean square error distribution of the model under different wavelength point screening ratios and different sampling numbers provided by the present invention;
[0031] Figure 4 It is a characteristic wavelength distribution diagram screened out in the process of constructing the spectral characteristic model provided by the present invention;
[0032] Figure 5 It is a characteristic wavelength distribution diagram screened by the VISSA method in the prior art;
[0033] Figure 6 It is a characteristic wavelength distribution diagram screened by the CARS method in the prior art;
[0034] Figure 7 It is a structural schematic diagram of the spectral characteristic model building device provided by the present invention;
[0035] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] Figure 1 This is one of the flow charts of the method for constructing a spectral feature model provided by the present invention, such as Figure 1 As shown, the method includes:
[0038] S110, initial screening process, based on the regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value, selecting wavelength points of a preset first screening ratio from the preset wavelength point set to obtain a first wavelength point set; based on the determination coefficient of the predicted absorbance value of each preset wavelength point in the preset wavelength point set with respect to the measured absorbance value, selecting wavelength points of a preset second screening ratio from the preset wavelength point set to obtain a second wavelength point set; taking the union of the first wavelength point set and the second wavelength point set to obtain a third wavelength point set;
[0039] S120, random sampling process, randomly sampling the same preset sampling number of wavelength points from the third wavelength point set multiple times to obtain multiple fourth wavelength point subsets to form a fourth wavelength point set;
[0040] S130, optimizing the screening process, screening the fourth wavelength point subsets with a preset third screening ratio based on the root mean square error corresponding to each of the fourth wavelength point subsets, to obtain a fifth wavelength point set;
[0041] S140, model building process, based on the frequency of occurrence of wavelength points, the wavelength points of the fifth wavelength point set with a preset fourth screening ratio are screened to obtain a sixth wavelength point set; the wavelength points in the sixth wavelength point set and the corresponding regression coefficients are input into a multivariate linear regression equation to obtain a spectral feature model.
[0042] Absorbance is a term in physics and chemistry. It refers to the logarithm to the base 10 (i.e., lg(I0 / I1)) of the ratio of the incident light intensity before the light passes through a solution or a substance to the transmitted light intensity after the light passes through the solution or a certain substance (I0 / I1), where I0 is the incident light intensity and I1 is the transmitted light intensity. Factors that affect it include solvent, concentration, temperature, etc. At the same time, for the same substance at the same concentration and at the same temperature, the absorbance values corresponding to different wavelength points are also different. The preset wavelength point set refers to a set of several wavelength points pre-selected from the spectrum of the substance to be tested.
[0043] The absorbance value of the same substance under different concentration conditions is measured, and then based on the preset wavelength point set, the absorbance value of each wavelength point under different concentration conditions is selected to construct a univariate linear regression equation y=a+bx of the absorbance value with respect to the concentration value, where x represents the concentration value, y represents the absorbance value, a is a constant term, and b represents the regression coefficient. The absorbance value of each wavelength point under different concentrations is substituted into the above regression equation to obtain the regression coefficient and arrange each regression coefficient in order from large to small, select multiple regression coefficients at the front of the arrangement according to the preset first screening ratio, and use the wavelength points corresponding to the screened regression coefficients as the first wavelength point set.
[0044] Substitute the different concentration values of each preset wavelength point into the obtained univariate linear regression equation to obtain multiple corresponding absorbance prediction values, obtain the determination coefficient based on the absorbance prediction value and the absorbance actual measurement value, and arrange the determination coefficients in order from large to small, select the top multiple determination coefficients in the arrangement according to the preset second screening ratio, and use the wavelength points corresponding to the selected determination coefficients as the second wavelength point set. Among them, the determination coefficient, also known as the goodness of fit, indicates that the variation of the dependent variable can be explained according to the variation of the independent variable, and in the present invention, it is used to indicate the fitting between the absorbance prediction value and the absorbance actual measurement value.
[0045] It should be noted that in the present invention, there is no necessary correlation between the preset first screening ratio and the preset second screening ratio, and the two may be equal or unequal. The union of the obtained first wavelength point set and the second wavelength point set is obtained to obtain the third wavelength point set.
[0046] Wavelength point sampling is performed from the third wavelength point set using a random sampling method. The random sampling method may use a Monte Carlo sampling method. The number of wavelength points in the fourth wavelength point subset is the preset sampling number. The preset sampling number may be set to N. N may take multiple values such as 20, 25, 30, 35, 40, etc. After multiple samplings, a fourth wavelength point set consisting of multiple wavelength point subsets is finally obtained.
[0047] The root mean square error is used to measure the deviation between the observed value and the true value. In the present invention, the root mean square error is used to characterize the deviation between the predicted absorbance value and the measured absorbance value. The root mean square errors corresponding to each fourth wavelength point subset are obtained and arranged in order from small to large. The fourth wavelength point subset at the front of the arrangement is selected according to the preset third screening ratio as the fifth wavelength point set.
[0048] According to the frequency of occurrence of each wavelength point in the fifth wavelength point set, each wavelength point is arranged in order from high frequency to low frequency, and the front wavelength point in the arrangement is selected according to the preset fourth screening ratio to obtain a sixth wavelength point set; the wavelength points in the sixth wavelength point set and the regression coefficients corresponding to each wavelength point are input into the multivariate linear regression equation to obtain a spectral feature model.
[0049] The spectral characteristic model construction method provided by the present invention realizes a substantial simplification of the original spectral data through a characteristic wavelength screening method based on the common characterization of the correlation coefficient and the determination coefficient; and the spectral characteristic model based on the characteristic wavelength is constructed by using a multivariate linear regression strategy, which has the advantages of high modeling efficiency, simple and practical model, and accurate model prediction performance, and is conducive to the rapid matching of the characteristic spectrum with the substance to be detected.
[0050] According to the spectral feature model construction method provided by the present invention, in the present invention, before the initial screening process, the method further includes: a regression coefficient solution process, inputting the spectral data of the same substance at different concentration values into the regression coefficient solution equation to obtain the regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value; the regression coefficient solution equation is: Among them, x i represents the concentration value of the i-th sample, Represents the average value of sample concentration, y i represents the measured absorbance value of the i-th sample, It represents the average value of the measured absorbance values.
[0051] It should be noted that given a data matrix X and an absorbance measured value matrix y, where X contains n samples and p wavelength points, and y contains n×1 columns of data, each wavelength point corresponds to a univariate linear regression equation, so p linear regression equations are established for p wavelength points:
[0052] Based on the above, we can get the linear regression equation: i =a+bx i , where y i represents the measured absorbance value corresponding to the i-th sample, a represents the intercept, b represents the linear regression coefficient, and x i Represents the concentration value corresponding to the i-th sample. The linear regression coefficient and intercept can be solved using the following equations: in, and is the average of x and y. The linear regression coefficient b represents the relationship between the wavelength point and the concentration in the spectrum. A larger b value indicates that the absorbance value at this wavelength point in the spectrum will fluctuate greatly due to changes in concentration.
[0053] The spectral characteristic model construction method provided by the present invention constructs a univariate linear relationship between the concentration value of the substance to be tested and the absorbance value and obtains the linear regression coefficient between the two, and realizes the screening of wavelength points based on the regression coefficient, and locks the absorbance characteristic peak of the substance to be tested based on the obtained wavelength point. Based on this, the initial screening of the characteristic wavelength of the substance to be tested is realized, which is conducive to the subsequent accurate construction of the spectral characteristic model.
[0054] According to the spectral feature model construction method provided by the present invention, in the present invention, after the regression coefficient solving process, the method further includes: a determination coefficient solving process, constructing a univariate linear regression equation based on the regression coefficient of the measured absorbance value of each preset wavelength point with respect to the concentration value, and obtaining the absorbance prediction value of each preset wavelength point at different concentration values based on the univariate linear regression equation; inputting the measured absorbance value and the predicted absorbance value of each preset wavelength point at different concentration values into the determination coefficient solving equation, and obtaining the determination coefficient of each preset wavelength point in the preset wavelength point set; the determination coefficient solving equation is: Among them, y i represents the measured absorbance value of the i-th sample, represents the average value of the measured absorbance. Represents the predicted absorbance value of the i-th sample.
[0055] It should be noted that the coefficient of determination (R 2 ) is the ratio of the regression sum of squares to the total sum of squares, and the coefficient of determination R 2 It indicates the degree of fit between the true value and the predicted value. The closer the determination coefficient is to 1, the better the correlation is. In the present invention, the determination correlation coefficient is used as one of the criteria for selecting the characteristic wavelength.
[0056] The spectral characteristic model construction method provided by the present invention determines the degree of fit between the absorbance prediction value and the absorbance measured value under different regression coefficients based on the determination coefficient, and selects the wavelength point with a large degree of fit as the characteristic wavelength according to the size of the determination coefficient. Based on this, the selection basis of the characteristic wavelength can be improved, the reliability of the characteristic wavelength selection process can be ensured, and finally the reliable construction of the spectral characteristic model can be guaranteed.
[0057] According to the spectral feature model construction method provided by the present invention, in the present invention, the method also includes: repeating the initial screening process based on different preset first screening ratios and / or different preset second screening ratios, and / or repeating the random sampling process based on different preset sampling quantities.
[0058] It should be noted that in the process of selecting the first wavelength point set and the second wavelength point set, different screening ratios will affect the subsequent construction of the spectral feature model. If the screening ratio is too small, the obtained characteristic wavelength will have a low characterization ability for the spectrum of the substance to be measured and cannot accurately characterize the information to be measured; and if the screening ratio is too large, the screening process itself will be time-consuming and not conducive to the rapid construction of the subsequent model, thus losing the value of the screening process itself. Based on this, it is necessary to select a suitable screening ratio, so the initial screening process is repeated based on different preset first screening ratios and / or different preset second screening ratios to seek a suitable first screening ratio and second screening ratio.
[0059] Based on the above, it can be concluded by analogy that: in the random sampling process, the selection of the sampling number will affect the subsequent spectral model construction process. A preset sampling number that is too large or too small will cause the same problem as above, so the random sampling process is repeated based on different preset sampling numbers to find a suitable preset sampling number.
[0060] The spectral characteristic model construction method provided by the present invention repeatedly executes the initial screening process for different preset first screening ratios and second screening ratios to obtain a reasonable screening ratio, and repeatedly executes the random sampling process based on different preset sampling quantities to obtain a reasonable preset sampling quantity; based on the above process, the obtained characteristic wavelength can be highly representative of the spectrum of the substance to be tested, while ensuring that the spectral characteristic model can still be quickly constructed.
[0061] According to the spectral feature model construction method provided by the present invention, in the present invention, the method further includes: solving the root mean square error corresponding to each of the fourth wavelength point subsets based on the root mean square error formula, and the root mean square error formula is: Among them, y i represents the measured absorbance value of the i-th sample, represents the predicted absorbance value of the i-th sample, and n represents the number of samples.
[0062] It should be noted that the root mean square error is a measure of the difference between the estimator and the estimated quantity. In the present invention, the root mean square error is used to verify the characterization ability of the selected characteristic wavelength set for the spectrum of the substance to be measured. The smaller the root mean square error, the stronger the characterization ability of the characteristic wavelength set for the spectrum of the substance to be measured.
[0063] The spectral characteristic model construction method provided by the present invention solves the root mean square error corresponding to each fourth wavelength point subset through the root mean square error formula, and based on this, the subset with smaller root mean square error is selected as the preferred subset for the subsequent spectral model construction process. Based on this, the characterization ability of the selected characteristic wavelength for the spectrum of the substance to be measured is further improved, and the accuracy and reliability of the spectral characteristic model are further improved.
[0064] Figure 2 This is the second flow chart of the method for constructing a spectral feature model provided by the present invention. Figure 2 As shown, the method includes:
[0065] Step 1, based on the correlation coefficient between the measured absorbance value and the concentration value at the wavelength point and the determination coefficient between the predicted absorbance value and the measured absorbance value, the variables in the data set are screened to obtain the first characteristic variable; the variable here represents the aforementioned wavelength point.
[0066] Step 2, sampling the first characteristic variable using the Monte Carlo sampling method, obtaining multiple variable subsets after multiple samplings, and establishing multiple linear regression equations of absorbance values with respect to multiple characteristic variables based on the variables in each variable subset and the correlation coefficients corresponding to each variable;
[0067] Solve the root mean square error of each multivariate linear regression equation, and arrange them in order from small to large root mean square errors, select the top 10% of multivariate linear regression equations with smaller root mean square errors, and statistically analyze the frequency of occurrence of each characteristic variable in the screened multivariate linear regression equations. Arrange them in order from large to small based on the size of the frequency of occurrence, and use the characteristic variable with higher frequency as the second characteristic variable according to the preset screening ratio.
[0068] Step 3, input the second characteristic variable and the corresponding correlation coefficient into the multiple linear regression equation to obtain the spectral characteristic model.
[0069] The spectral characteristic model construction method provided by the present invention realizes a substantial simplification of the original spectral data through a characteristic wavelength screening method based on the common characterization of the correlation coefficient and the determination coefficient; and the spectral characteristic model based on the characteristic wavelength is constructed by using a multivariate linear regression strategy, which has the advantages of high modeling efficiency, simple and practical model, and accurate model prediction performance, and is conducive to the rapid matching of the characteristic spectrum with the substance to be detected.
[0070] The detailed process of constructing the spectral characteristic model in the present invention is described by taking the total sugar content in tobacco as the substance to be tested, as follows:
[0071] The near-infrared (NIR) diffuse reflectance spectra of 90 samples were measured by FT-NIR spectrometer (Matrix-I, Bruker, Germany) in the wavelength range of 4000 cm -1 ~10000cm -1 , resolution 4cm -1 The total sugar content (%, w / w) was determined by continuous flow analyzer. The total sugar concentration ranged from 10.59% to 41.63%. The data set was divided into 68 modeling set samples for model building and 22 test set samples for model performance verification based on the concentration from high to low.
[0072] First, a suitable wavelength point screening ratio α and sampling number N are selected. In the embodiment of the present invention, the first screening ratio is preset to be equal to the second screening ratio, both of which are equal to the screening ratio α. The method for selecting characteristic wavelengths in the present invention is run 20 times. Figure 3 : is a schematic diagram of the root mean square error distribution of the model under different wavelength point screening ratios and different sampling numbers provided by the present invention, such as Figure 3 As shown in the figure, it shows that the prediction ability of total sugar is different under different wavelength point screening ratios and sampling numbers, where the ratio range of α is 0.05-0.2, with an interval of 0.05, and the corresponding sampling number N under each wavelength point screening ratio α is 20, 25, 30, 35 and 40 from left to right. Figure 3 It can be seen that when α is 0.05, the prediction root mean square error RMSEP of the model is generally high. The main reason is that the insufficient number of characteristic wavelengths leads to poor modeling prediction performance. When α is 0.2 and N is 40, the prediction root mean square error RMSEP is the lowest, and the corresponding standard deviation is small. Therefore, the spectral feature model constructed when the wavelength point screening ratio α is 0.2 and the sampling number N is 40 has the best prediction effect.
[0073] The effects of the present invention are compared with those of the prior art, wherein the prior art includes a spatial iterative shrinkage screening variable method VISSA, a competitive adaptive reweighted sampling method CARS, and a full spectrum partial least squares algorithm PLS. Figure 4 is a characteristic wavelength distribution diagram selected in the process of constructing the spectral characteristic model provided by the present invention, such as Figure 4 As shown, the characteristic wavelength of 4580-4900cm is used in the present invention. -1 This band is the combined frequency absorption of OH stretching vibration and bending vibration, 5500-5800cm -1 It is the first harmonic absorption of CH, 6700-6900cm -1 It is the single frequency absorption of OH stretching vibration. VISSA is a variable selection method based on the combination of model cluster analysis and weighted binary matrix sampling. Figure 5 This is the characteristic wavelength distribution diagram screened by the VISSA method in the prior art. Figure 4 and Figure 5 It can be seen that the VISSA method selected a total of 338 characteristic wavelengths, and the characteristic wavelengths selected by the VISSA method include 8000-10000cm -1 This band is the double frequency absorption of CH and OH, and its signal is weak, so the prediction performance of the spectral feature model constructed based on the VISSA method is slightly worse than that of the spectral feature model constructed in the present invention. CARS is a strategy for selecting feature variables based on correlation coefficients. Figure 6 This is the characteristic wavelength distribution diagram screened by the CARS method in the prior art. Figure 4 and Figure 6 It can be seen that the CARS method selects 50 characteristic wavelengths, and the characteristic wavelengths selected by the CARS method do not include the characteristic band of OH single frequency absorption (6800-7000cm -1 ), thus resulting in the prediction performance of the spectral feature model constructed based on the CARS method being slightly worse than that of the spectral feature model constructed in the present invention.
[0074] By screening the characteristic wavelengths, the spectral characteristic model is further established. Compared with the prior art, the RMSEP index of the present invention is significantly better than that of the prior art model. Specifically, in the prior art model, the RMSEP index of the VISSA model, CARS model, and PLS model are 0.6542%, 0.7041%, and 0.8107%, respectively, and the determination coefficient R 2 Compared with the above models, the RMSEP of the present invention is the smallest, which is 0.4399%. 2 The highest is 0.9976. The above results show that the variable screening method proposed in the present invention is significantly better than other methods, and the modeling results are more accurate and reliable.
[0075] Figure 7 is a schematic diagram of the structure of the spectral feature model building device provided by the present invention, such as Figure 7 As shown, the device comprises:
[0076] The initial screening module 710 is used to select wavelength points of a preset first screening ratio from the preset wavelength point set based on the regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value, to obtain a first wavelength point set; select wavelength points of a preset second screening ratio from the preset wavelength point set based on the determination coefficient of the predicted absorbance value of each preset wavelength point in the preset wavelength point set with respect to the measured absorbance value, to obtain a second wavelength point set; and take the union of the first wavelength point set and the second wavelength point set to obtain a third wavelength point set;
[0077] A random sampling module 720, configured to randomly select a preset number of wavelength points from the third wavelength point set multiple times to obtain multiple fourth wavelength point subsets to form a fourth wavelength point set;
[0078] An optimization screening module 730 is used to screen the fourth wavelength point subsets with a preset third screening ratio based on the root mean square error corresponding to each of the fourth wavelength point subsets to obtain a fifth wavelength point set;
[0079] The model building module 740 is used to filter the wavelength points of the fifth wavelength point set with a preset fourth screening ratio based on the frequency of occurrence of the wavelength points to obtain a sixth wavelength point set; the wavelength points in the sixth wavelength point set and the corresponding regression coefficients are input into the multivariate linear regression equation to obtain a spectral feature model.
[0080] The spectral characteristic model construction device provided by the present invention realizes a substantial simplification of the original spectral data through a characteristic wavelength screening method based on the common characterization of the correlation coefficient and the determination coefficient; and the spectral characteristic model based on the characteristic wavelength is constructed by using a multivariate linear regression strategy, which has the advantages of high modeling efficiency, simple and easy-to-use model, and accurate model prediction performance, and is conducive to the rapid matching of the characteristic spectrum with the substance to be detected.
[0081] According to the spectral feature model construction device provided by the present invention, in the present invention, the device further includes: a regression coefficient solving module, which is used to input the spectral data of the same substance at different concentration values into the regression coefficient solving equation to obtain the regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value; the regression coefficient solving equation is: Among them, x i represents the concentration value of the i-th sample, Represents the average value of sample concentration, y i represents the measured absorbance value of the i-th sample, It represents the average value of the measured absorbance values.
[0082] The spectral characteristic model construction device provided by the present invention constructs a univariate linear relationship between the concentration value of the substance to be tested and the absorbance value and obtains the linear regression coefficient between the two, and realizes the screening of wavelength points based on the regression coefficient, and locks the absorbance characteristic peak of the substance to be tested based on the obtained wavelength point. Based on this, the initial screening of the characteristic wavelength of the substance to be tested is realized, which is conducive to the subsequent accurate construction of the spectral characteristic model.
[0083] According to the spectral feature model construction device provided by the present invention, in the present invention, the device further includes: a determination coefficient solving module, which is used to construct a univariate linear regression equation based on the regression coefficient of the measured absorbance value of each preset wavelength point with respect to the concentration value, and obtain the absorbance prediction value of each preset wavelength point at different concentration values based on the univariate linear regression equation;
[0084] The measured absorbance value and the predicted absorbance value of each preset wavelength point at different concentration values are input into the determination coefficient solving equation to obtain the determination coefficient of each preset wavelength point in the preset wavelength point set; the determination coefficient solving equation is: Among them, y i represents the measured absorbance value of the i-th sample, represents the average value of the measured absorbance. Represents the predicted absorbance value of the i-th sample.
[0085] The spectral characteristic model construction device provided by the present invention determines the degree of fit between the absorbance prediction value and the absorbance measured value under different regression coefficients based on the determination coefficient, and selects the wavelength point with a large degree of fit as the characteristic wavelength according to the size of the determination coefficient. Based on this, the selection basis of the characteristic wavelength can be improved, the reliability of the characteristic wavelength selection process can be ensured, and finally the reliable construction of the spectral characteristic model can be guaranteed.
[0086] According to the spectral feature model building device provided by the present invention, in the present invention, the device also includes: a repeated execution module, used to repeatedly execute the initial screening process based on different preset first screening ratios and / or different preset second screening ratios, and / or, repeatedly execute the random sampling process based on different preset sampling quantities.
[0087] The spectral characteristic model construction device provided by the present invention repeatedly executes the initial screening process for different preset first screening ratios and second screening ratios to obtain a reasonable screening ratio, and repeatedly executes the random sampling process based on different preset sampling quantities to obtain a reasonable preset sampling quantity; based on the above process, the obtained characteristic wavelength can be highly representative of the spectrum of the substance to be tested, that is, under the premise of characterization capability, it is ensured that the spectral characteristic model can still be quickly constructed.
[0088] According to the spectral feature model construction device provided by the present invention, in the present invention, the device further includes: a solution module, which is used to solve the root mean square error corresponding to each of the fourth wavelength point subsets based on the root mean square error formula, and the root mean square error formula is: Among them, y i represents the measured absorbance value of the i-th sample, represents the predicted absorbance value of the i-th sample, and n represents the number of samples.
[0089] The spectral characteristic model building device provided by the present invention solves the root mean square error corresponding to each fourth wavelength point subset through the root mean square error formula, and uses this as a basis to select the subset with smaller root mean square error as the preferred subset for the subsequent spectral model building process. Based on this, the characterization ability of the screened characteristic wavelength for the spectrum of the substance to be measured is further improved, and the accuracy and reliability of the spectral characteristic model are further improved.
[0090] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the spectral feature model construction method, which includes: an initial screening process, based on the regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value, selecting wavelength points of a preset first screening ratio from the preset wavelength point set to obtain a first wavelength point set; based on the determination coefficient of the predicted absorbance value of each preset wavelength point in the preset wavelength point set with respect to the measured absorbance value, selecting wavelength points of a preset second screening ratio from the preset wavelength point set to obtain a second wavelength point set; taking the union of the first wavelength point set and the second wavelength point set to obtain a third wavelength point set;
[0091] A random sampling process, randomly selecting the same preset sampling number of wavelength points from the third wavelength point set multiple times to obtain multiple fourth wavelength point subsets to form a fourth wavelength point set;
[0092] Optimizing the screening process, screening the fourth wavelength point subsets with a preset third screening ratio based on the root mean square error corresponding to each of the fourth wavelength point subsets, to obtain a fifth wavelength point set;
[0093] The model building process is to filter the wavelength points of the fifth wavelength point set with a preset fourth screening ratio based on the frequency of occurrence of the wavelength points to obtain a sixth wavelength point set; the wavelength points in the sixth wavelength point set and the corresponding regression coefficients are input into the multivariate linear regression equation to obtain a spectral feature model.
[0094] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0095] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer can execute the spectral feature model construction method provided by the above methods, the method comprising: an initial screening process, based on the regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value, selecting wavelength points of a preset first screening ratio from the preset wavelength point set to obtain a first wavelength point set; based on the determination coefficient of the predicted absorbance value of each preset wavelength point in the preset wavelength point set with respect to the measured absorbance value, selecting wavelength points of a preset second screening ratio from the preset wavelength point set to obtain a second wavelength point set; taking the union of the first wavelength point set and the second wavelength point set to obtain a third wavelength point set;
[0096] A random sampling process, randomly selecting the same preset sampling number of wavelength points from the third wavelength point set multiple times to obtain multiple fourth wavelength point subsets to form a fourth wavelength point set;
[0097] Optimizing the screening process, screening the fourth wavelength point subsets with a preset third screening ratio based on the root mean square error corresponding to each of the fourth wavelength point subsets, to obtain a fifth wavelength point set;
[0098] The model building process is to filter the wavelength points of the fifth wavelength point set with a preset fourth screening ratio based on the frequency of occurrence of the wavelength points to obtain a sixth wavelength point set; the wavelength points in the sixth wavelength point set and the corresponding regression coefficients are input into the multivariate linear regression equation to obtain a spectral feature model.
[0099] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the processor executes the above-mentioned spectral feature model construction method, the method comprising: an initial screening process, based on the regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value, selecting wavelength points of a preset first screening ratio from the preset wavelength point set to obtain a first wavelength point set; based on the determination coefficient of the absorbance predicted value of each preset wavelength point in the preset wavelength point set with respect to the measured absorbance value, selecting wavelength points of a preset second screening ratio from the preset wavelength point set to obtain a second wavelength point set; taking the union of the first wavelength point set and the second wavelength point set to obtain a third wavelength point set;
[0100] A random sampling process, randomly selecting the same preset sampling number of wavelength points from the third wavelength point set multiple times to obtain multiple fourth wavelength point subsets to form a fourth wavelength point set;
[0101] Optimizing the screening process, screening the fourth wavelength point subsets with a preset third screening ratio based on the root mean square error corresponding to each of the fourth wavelength point subsets, to obtain a fifth wavelength point set;
[0102] The model building process is to filter the wavelength points of the fifth wavelength point set with a preset fourth screening ratio based on the frequency of occurrence of the wavelength points to obtain a sixth wavelength point set; the wavelength points in the sixth wavelength point set and the corresponding regression coefficients are input into the multivariate linear regression equation to obtain a spectral feature model.
[0103] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing a spectral feature model, characterized in that: include: An initial screening process, based on a regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value, select wavelength points of a preset first screening ratio from the preset wavelength point set to obtain a first wavelength point set; Based on the determination coefficient of the absorbance prediction value of each preset wavelength point in the preset wavelength point set with respect to the absorbance measured value, wavelength points of a preset second screening ratio are selected from the preset wavelength point set to obtain a second wavelength point set; taking the union of the first wavelength point set and the second wavelength point set to obtain a third wavelength point set; A random sampling process, randomly selecting the same preset sampling number of wavelength points from the third wavelength point set multiple times to obtain multiple fourth wavelength point subsets to form a fourth wavelength point set; Optimizing the screening process, screening the fourth wavelength point subsets with a preset third screening ratio based on the root mean square error corresponding to each of the fourth wavelength point subsets, to obtain a fifth wavelength point set; A model building process, screening wavelength points of a preset fourth screening ratio in the fifth wavelength point set based on the occurrence frequency of the wavelength points, to obtain a sixth wavelength point set; The wavelength points in the sixth wavelength point set and the corresponding regression coefficients are input into a multivariate linear regression equation to obtain a spectral feature model.
2. The method for constructing a spectral feature model according to claim 1, characterized in that: Prior to the initial screening process, the method further includes: The regression coefficient solution process inputs the spectral data of the same substance at different concentration values into the regression coefficient solution equation to obtain the regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value.
3. The method for constructing a spectral feature model according to claim 2, characterized in that: After the regression coefficient solution process, the method further includes: A determination coefficient solution process, constructing a univariate linear regression equation based on the regression coefficient of the measured absorbance value of each preset wavelength point with respect to the concentration value, and obtaining the absorbance prediction value of each preset wavelength point at different concentration values based on the univariate linear regression equation; The measured absorbance value and the predicted absorbance value of each preset wavelength point at different concentration values are input into a determination coefficient solving equation to obtain the determination coefficient of each preset wavelength point in the preset wavelength point set.
4. The method for constructing a spectral feature model according to claim 1, characterized in that: The method further comprises: The initial screening process is repeatedly executed based on different preset first screening ratios and / or different preset second screening ratios, and / or the random sampling process is repeatedly executed based on different preset sampling quantities.
5. The method for constructing a spectral feature model according to claim 2, characterized in that: The regression coefficient solution equation is: Among them, x i represents the concentration value of the i-th sample, Represents the average value of sample concentration, y i represents the measured absorbance value of the i-th sample, It represents the average value of the measured absorbance values.
6. The method for constructing a spectral feature model according to claim 3, characterized in that: The coefficient of determination solution equation is: Among them, y i represents the measured absorbance value of the i-th sample, represents the average value of the measured absorbance. Represents the predicted absorbance value of the i-th sample.
7. The method for constructing a spectral feature model according to claim 1, characterized in that: The method further includes: solving the root mean square error corresponding to each of the fourth wavelength point subsets based on a root mean square error formula, wherein the root mean square error formula is: Among them, y i represents the measured absorbance value of the i-th sample, represents the predicted absorbance value of the i-th sample, and n represents the number of samples.
8. A spectral feature model construction device, characterized in that: include: An initial screening module, configured to select wavelength points of a preset first screening ratio from the preset wavelength point set based on a regression coefficient of the measured absorbance value of each preset wavelength point in the preset wavelength point set with respect to the concentration value, to obtain a first wavelength point set; Based on the determination coefficient of the absorbance prediction value of each preset wavelength point in the preset wavelength point set with respect to the absorbance measured value, wavelength points of a preset second screening ratio are selected from the preset wavelength point set to obtain a second wavelength point set; taking the union of the first wavelength point set and the second wavelength point set to obtain a third wavelength point set; A random sampling module, used for randomly sampling the same preset sampling number of wavelength points from the third wavelength point set multiple times to obtain multiple fourth wavelength point subsets to form a fourth wavelength point set; an optimization screening module, configured to screen the fourth wavelength point subsets with a preset third screening ratio based on the root mean square error corresponding to each of the fourth wavelength point subsets, to obtain a fifth wavelength point set; A model building module, used for screening wavelength points of a preset fourth screening ratio in the fifth wavelength point set based on the occurrence frequency of the wavelength points, to obtain a sixth wavelength point set; The wavelength points in the sixth wavelength point set and the corresponding regression coefficients are input into a multivariate linear regression equation to obtain a spectral feature model.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the spectral feature model construction method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the spectral feature model construction method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Near infrared spectrum information extraction method based on canonical correlation coefficients
CN105891147A
A method and device for measuring a trace metal ion concentration
CN106918567A