A method and device for predicting the content of components in a sample

Through infrared spectroscopy predicting temperature and using temperature label models, the problem of reduced detection accuracy of spectral instruments under temperature fluctuations and wide correction concentration range is solved, and the generalization ability and prediction accuracy of the model are improved.

CN115389440BActive Publication Date: 2025-02-11FOSHAN HAITIAN GAOMING FLAVORING & FOOD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110565774.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-24
Publication Date
2025-02-11
Estimated Expiration
2041-05-24

AI Technical Summary

Technical Problem

The detection accuracy of the spectrometer is reduced under temperature fluctuations and a wide correction concentration range, affecting the prediction accuracy of the model.

Method used

The sample is predicted by infrared spectroscopy and the sample component content is predicted using qualitative and quantitative models labeled by ambient temperature to reduce the impact of temperature fluctuations on model accuracy.

Benefits of technology

The generalization ability of the model is improved, the accuracy and accuracy of the prediction results are significantly improved, and the prediction accuracy deterioration problem caused by the wide correction concentration range of the global quantitative model is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115389440B_ABST
    Figure CN115389440B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of analysis and detection, and specifically relates to a method for predicting the content of a component in a sample, including accurately predicting the sample temperature based on the infrared spectrum of the sample, and then automatically assigning or establishing a classification model and a segmented quantitative model with cross-concentration segments using the predicted temperature as a label, and then predicting the content of the component in the sample through the model. The present invention also relates to a device for predicting the content of a component in a sample. The method of the present invention reduces the influence of temperature fluctuations on the accuracy of model analysis, avoids the influence of a wide correction concentration range on the degradation of the prediction accuracy of the global quantitative model, enhances the generalization ability of the model, and improves the accuracy and precision of the prediction results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of analysis and detection, and specifically relates to a method and a device for predicting the content of components in a sample. Background Art

[0002] Spectroscopy technology uses chemometric algorithms to establish a functional relationship between spectral signals and the components to be tested (i.e., analysis model), and then uses the spectral signals of the sample and the analysis model to detect the composition information of the sample in real time. The detection process is non-destructive, does not consume chemical reagents, and has a fast analysis speed, which is very popular in the food, pharmaceutical and other industries.

[0003] With the advancement of hardware technology, miniaturization and portability have become one of the main development trends of spectroscopic instruments. However, there are two main problems with spectroscopic instrument detection: on the one hand, due to the limitations of the overall architecture, it is difficult for spectroscopic instruments to have a constant temperature function, especially when using spectrometers to conduct quality monitoring of the entire production process (such as natural planting and natural fermentation). The temperature fluctuations in the outdoor field detection environment are large, and it is difficult to have constant temperature conditions for samples. Changes in spectral detection temperature will cause changes in the interaction forces between groups, thereby causing changes in spectral peak position, spectral band width, baseline drift, etc., resulting in reduced prediction accuracy of the model; on the other hand, in order to meet the analysis requirements of portable spectroscopic instruments in complex scenarios such as the field, the model used requires a wider correction concentration range, that is, the training sample concentration range should include the sample concentration of the model as much as possible, but too wide a concentration range is also prone to nonlinear response between the spectrum and the concentration, which reduces the prediction accuracy of the linear model.

[0004] At present, there are two main solutions to the problem of temperature change in spectral instrument detection: one is to perform temperature correction to eliminate the influence of temperature on the model; the other is to establish a global quantitative model with different temperature levels; however, the former method requires complex algorithms for temperature correction, and the model robustness of the latter method is poor. In addition, the global quantitative model of the latter method is mainly based on establishing a model for the entire concentration range, and does not solve the problem of inevitable degradation of prediction accuracy caused by nonlinear response due to an overly wide correction concentration range.

[0005] Therefore, there is an urgent need to reduce or eliminate the negative impact of temperature fluctuations and wide correction concentrations on model analysis accuracy, so as to enhance the generalization ability of the model, improve the application value and depth of spectral online detection in actual production, and further help enterprises improve quality and increase volume. Summary of the invention

[0006] One of the purposes of the present invention is to provide a method and device for predicting the content of a component in a sample, which predicts the detection environment temperature of the sample based on its infrared spectrum, and then adopts a qualitative model and a quantitative model with the predicted value of the sample's environment temperature as a label to predict the content of the component in the sample, thereby reducing the influence of temperature fluctuations on the accuracy of model analysis, while avoiding the problem of prediction accuracy degradation caused by the wide correction concentration range of the global quantitative model, and enhancing the generalization ability of the model.

[0007] To achieve the above object, the first aspect of the present invention relates to a method for predicting the content of a component in a sample, comprising the following steps:

[0008] (1) obtaining infrared spectra of multiple samples at the same temperature (e.g., 30° C.), calculating the first-order derivative spectra of each infrared spectrum, and determining the wavelength corresponding to the common intersection point of all the first-order derivative spectra as the target low-sensitivity wavelength; wherein the component contents of all the samples are different;

[0009] (2) obtaining infrared spectra of a single sample at different temperatures (e.g., 26.5°C, 27.5°C, 28.5°C, 29.5°C, 31.5°C, 32.5°C, 33.5°C, 34.5°C, and 36.5°C), calculating the first-order derivative spectra of each infrared spectrum, obtaining the ordinate value corresponding to the target low-sensitivity wavelength on each first-order derivative spectrum, and establishing a spectral temperature measurement equation based on the ordinate value and the corresponding temperature value; preferably, if multiple target low-sensitivity wavelengths are determined in step (1), then establishing an equation for each target low-sensitivity wavelength according to the aforementioned operation, and then selecting the equation with the best equation evaluation parameters as the spectral temperature measurement equation and selecting the corresponding target low-sensitivity wavelength;

[0010] (3) Obtaining an infrared spectrum of the sample to be tested, calculating a first-order derivative spectrum of the infrared spectrum, obtaining a vertical coordinate value corresponding to a selected target low-sensitivity wavelength on the first-order derivative spectrum, substituting the vertical coordinate value into a spectrum temperature measurement equation, and predicting the temperature T of the sample to be tested;

[0011] (4) If the database stores a qualitative model and a quantitative model of the components in the sample at temperature T, the infrared spectrum of the sample to be tested is directly substituted into the qualitative model and the quantitative model to predict the content of the components in the sample to be tested;

[0012] Otherwise, obtain a sample set P of temperature T±s stored in the database, 0.5℃≤s≤1.5℃ (for example, 1℃), the database stores the measured temperature, component content and infrared spectrum of each sample in the sample set P, calculate the projection correlation distance of each sample in the sample set P according to the formula shown below, screen out samples with a projection correlation distance greater than t, t is 2.5-10 (for example, t is 5, 5.5, 6, 6.5, 7, 7.5, 8), and retain the remaining samples; then establish a qualitative model and a quantitative model based on the component content and infrared spectrum of the remaining samples, and then substitute the infrared spectrum of the sample to be tested into the qualitative model and the quantitative model for calculation, and predict the component content of the sample to be tested;

[0013]

[0014] in,

[0015] i is the number in the order in which the samples were obtained;

[0016] PCD i is the projection correlation distance of the i-th sample;

[0017] L i is the residual between the principal component score of the ith sample and the mean score of the sample set, wherein the principal component score of the ith sample is a matrix obtained by PCA dimensionality reduction of a 1×n-order matrix constructed with the absorbance at different wavelengths in the infrared spectrum of the ith sample as column data, and the mean score of the sample set is the mean of the principal component scores of all samples in the sample set;

[0018] C is the inverse matrix of the covariance matrix of the mean score of the sample set;

[0019] L i ' is L i The transposed matrix of

[0020] PCs is the number of principal components involved in the calculation.

[0021] In some embodiments of the first aspect of the present invention, the temperature in step (1) is the median value of the temperature fluctuation range of the sample in actual application scenarios.

[0022] In some embodiments of the first aspect of the present invention, the temperature in step (1) is higher than the lowest temperature in step (2) and lower than the highest temperature in step (2).

[0023] In some embodiments of the first aspect of the present invention, the temperature in step (1) is the median or mean of all the temperatures in step (2).

[0024] In some implementations of the first aspect of the present invention, the established qualitative model and quantitative model are stored in a database with temperature T as a label.

[0025] In some embodiments of the first aspect of the present invention, the method comprises one or more of the following features:

[0026] a. The sample is a food sample or a naturally fermented sample, preferably a condiment sample, more preferably a soy sauce sample;

[0027] b. The component is a physical and chemical component contained in the sample, preferably a main component or food additive contained in the food sample (preferably a food preservative, such as benzoic acid);

[0028] c. The qualitative model is a classification model. Preferably, the number of classifications in the classification model is three;

[0029] d. The quantitative model is a segmented quantitative model with cross-concentration segments. Preferably, the segmented quantitative model includes three concentration segments and two cross-concentration segments;

[0030] More preferably, the span of each crossover concentration segment accounts for 2% to 18% of the total span of the concentration of the sample set P;

[0031] More preferably, the number of samples corresponding to each cross-concentration segment accounts for 5% to 10% of the total number of samples in the sample set P;

[0032] e. In step (1) and / or step (2), the temperature is selected in the range of 20°C to 50°C;

[0033] f. In step (2), an equation is established by a machine learning algorithm according to the ordinate value and the temperature value, preferably an equation is established by a regression algorithm;

[0034] g. In step (1), step (2) and / or step (3), the infrared spectrum is preprocessed before calculating the first-order derivative spectrum;

[0035] h. In step (4), before prediction, the infrared spectrum of the sample to be tested is subjected to mathematical preprocessing; optionally, before modeling, the infrared spectrum of the database sample is subjected to the same mathematical preprocessing.

[0036] In some embodiments of the first aspect of the present invention, the total span of concentrations of the sample set P is the total span of component contents of all samples in the sample set P.

[0037] In some embodiments of the first aspect of the present invention, the number of categories of the classification model is equal to the number of segments of the segmented quantitative model, and the boundary concentration between two adjacent categories in the classification model is contained in the crossover concentration segment corresponding to the segmented quantitative model.

[0038] In some embodiments of the first aspect of the present invention, the number of classifications in the classification model is three, and the segmented quantitative model includes three concentration segments and two cross-concentration segments; in order from low concentration to high concentration, the boundary concentrations of the first and second categories of the classification model are included in the cross-concentration segments of the first and second segments of the segmented quantitative model, and the boundary concentrations of the second and third categories of the classification model are included in the cross-concentration segments of the second and third segments of the segmented quantitative model.

[0039] In some embodiments of the first aspect of the present invention, in the classification model, the boundary concentration between the first and second categories is 0.25 g / kg, and the boundary concentration between the second and third categories is 0.59 g / kg.

[0040] In some embodiments of the first aspect of the present invention, in the segmented quantitative model with crossover concentration segments, the crossover concentration segment between the first and second segments is 0.24-0.28 g / kg, and the crossover concentration segment between the second and third segments is 0.57-0.60 g / kg.

[0041] In some embodiments of the first aspect of the present invention, the abscissa of the infrared spectrum represents the wavelength, and the ordinate represents the absorption intensity.

[0042] In some embodiments of the first aspect of the present invention, in the first derivative spectrum of the infrared spectrum, the abscissa represents the wavelength, and the ordinate represents the first derivative of the absorption intensity with respect to the wavelength.

[0043] In some implementations of the first aspect of the present invention, in step (2), a spectral temperature measurement equation is established by a multivariate linear regression algorithm.

[0044] In some embodiments of the first aspect of the present invention, in step (1), step (2) and / or step (3), the infrared spectrum is preprocessed by python, Java, Matlab, R or Julia.

[0045] In some implementations of the first aspect of the present invention, the mathematical preprocessing is: sequentially performing SG convolution smoothing (half window width is 1, polynomial coefficient is 1), standard normal transformation and detrending.

[0046] In some embodiments of the first aspect of the present invention, the detection wavelength range of the infrared spectrum is 780 to 2500 nm, preferably 900 to 1650 nm.

[0047] In some embodiments of the first aspect of the present invention, the infrared spectrum has a spectrum averaging number of 8 to 64 times, such as 16 times, 32 times, or 48 times.

[0048] In some embodiments of the first aspect of the present invention, the infrared spectrum is averaged and measured 2 to 5 times (eg, 3 times) to obtain an average spectrum.

[0049] In some embodiments of the first aspect of the present invention, the "temperature" is the ambient temperature during infrared spectroscopy detection or the ambient temperature of the sample during infrared spectroscopy detection.

[0050] The second aspect of the present invention relates to a device for predicting the content of a component in a sample, comprising a target low-sensitivity wavelength determination module, a spectrum temperature measurement equation establishment module, a temperature prediction module, a storage module, a model construction module and a component content prediction module; wherein,

[0051] The target low-sensitivity wavelength determination module is used to obtain infrared spectra of multiple samples at the same temperature (e.g., 30° C.), calculate the first-order derivative spectra of each infrared spectrum, and determine the wavelength corresponding to the common intersection point of all first-order derivative spectra as the target low-sensitivity wavelength; wherein the component contents of all samples are different;

[0052] The spectral temperature measurement equation establishment module is used to obtain the infrared spectrum of a single sample at different temperatures (for example, 26.5°C, 27.5°C, 28.5°C, 29.5°C, 31.5°C, 32.5°C, 33.5°C, 34.5°C, and 36.5°C), calculate the first-order derivative spectrum of each infrared spectrum, obtain the ordinate value corresponding to the target low-sensitivity wavelength on each first-order derivative spectrum, and establish a spectral temperature measurement equation according to the ordinate value and the corresponding temperature value; preferably, if the target low-sensitivity wavelength determination module obtains multiple target low-sensitivity wavelengths, the spectral temperature measurement equation establishment module is used to establish an equation for each target low-sensitivity wavelength according to the aforementioned operation, and then select the equation with the best equation evaluation parameters as the spectral temperature measurement equation and select the corresponding target low-sensitivity wavelength;

[0053] The temperature prediction module is used to obtain the infrared spectrum of the sample to be tested, calculate the first-order derivative spectrum of the infrared spectrum, obtain the ordinate value corresponding to the target low-sensitivity wavelength selected on the first-order derivative spectrum, substitute the ordinate value into the spectrum temperature measurement equation for calculation, and predict the temperature T of the sample to be tested;

[0054] The storage module is used to store the measured temperature, component content and infrared spectrum of the sample;

[0055] The model building module is used to obtain a sample set P of temperature T±s stored in the storage module, 0.5°C≤s≤1.5°C (for example, 1°C), calculate the projection correlation distance of each sample in the sample set P according to the formula shown below, filter out samples with a projection correlation distance greater than t, t is 2.5-10 (for example, t is 5, 5.5, 6, 6.5, 7, 7.5, 8), retain the remaining samples, and then establish a qualitative model and a quantitative model according to the component content and infrared spectrum of the remaining samples;

[0056]

[0057] in,

[0058] i is the number in the order in which the samples were obtained;

[0059] PCD i is the projection correlation distance of the i-th sample;

[0060] L i is the residual between the principal component score of the ith sample and the mean score of the sample set, wherein the principal component score of the ith sample is a matrix obtained by PCA dimensionality reduction of a 1×n-order matrix constructed with the absorbance at different wavelengths in the infrared spectrum of the ith sample as column data, and the mean score of the sample set is the mean of the principal component scores of all samples in the sample set;

[0061] C is the inverse matrix of the covariance matrix of the mean score of the sample set;

[0062] L i ' is L i The transposed matrix of

[0063] PCs is the number of principal components involved in the calculation;

[0064] The component content prediction module is used to substitute the infrared spectrum of the sample to be tested into the qualitative model and the quantitative model for calculation, so as to predict the component content of the sample to be tested.

[0065] In some embodiments of the second aspect of the present invention, the storage module is further used to store the qualitative model and / or quantitative model constructed by the model construction module and use temperature T as a label.

[0066] In some embodiments of the first aspect of the present invention, the temperature used by the target low-sensitivity wavelength determination module is a median value of a typical temperature fluctuation range of a sample in an actual application scenario.

[0067] In some implementations of the second aspect of the present invention, the temperature used by the target low-sensitivity wavelength determination module is higher than the lowest temperature used by the spectral temperature measurement equation establishment module and lower than the highest temperature used by the spectral temperature measurement equation establishment module.

[0068] In some implementations of the second aspect of the present invention, the temperature used by the target low-sensitivity wavelength determination module is the median or mean of all temperatures used by the spectral temperature measurement equation establishment module.

[0069] In some embodiments of the second aspect of the present invention, if the storage module stores a qualitative model and a quantitative model of the components in the sample at temperature T, the component content prediction module is used to directly substitute the infrared spectrum of the sample to be tested into the stored qualitative model and quantitative model to calculate and predict the component content of the sample to be tested.

[0070] In some embodiments of the second aspect of the present invention, the device includes one or more of the following:

[0071] (A) the sample is a food sample or a natural fermentation sample, preferably a condiment sample, more preferably a soy sauce sample;

[0072] (B) the component is a physical and chemical component contained in the sample, preferably a main component or food additive (e.g., food preservative, benzoic acid) contained in a food sample;

[0073] (C) the qualitative model is a classification model, and preferably, the number of classifications in the classification model is three;

[0074] (D) the quantitative model is a segmented quantitative model with intersecting concentration segments, preferably, the segmented quantitative model includes three concentration segments and two intersecting concentration segments;

[0075] More preferably, the span of each crossover concentration segment accounts for 2% to 18% of the total span of the concentration of the sample set P;

[0076] More preferably, the number of samples corresponding to each cross-concentration segment accounts for 5% to 10% of the total number of samples in the sample set P;

[0077] (E) In the target low-sensitivity wavelength determination module and / or the spectrum temperature measurement equation establishment module, the temperature selection range is 20° C. to 50° C.;

[0078] (F) a spectral temperature measurement equation establishment module is used to establish an equation according to the ordinate value and the temperature value through a machine learning algorithm, preferably through a regression algorithm;

[0079] (G) the target low-sensitivity wavelength determination module, the spectrum temperature measurement equation establishment module and / or the temperature prediction module are also used to pre-process the infrared spectrum before calculating the first-order derivative spectrum;

[0080] (H) The component content prediction module is also used to perform mathematical preprocessing on the infrared spectrum of the sample to be tested before prediction; optionally, the model building module is also used to perform the same mathematical preprocessing on the infrared spectrum of the sample before modeling.

[0081] In some embodiments of the second aspect of the present invention, the total span of concentrations of the sample set P is the total span of component contents of all samples in the sample set P.

[0082] In some embodiments of the second aspect of the present invention, the number of categories of the classification model is equal to the number of segments of the segmented quantitative model, and the boundary concentration between two adjacent categories in the classification model is contained in the crossover concentration segment corresponding to the segmented quantitative model.

[0083] In some embodiments of the second aspect of the present invention, the number of classifications in the classification model is three, and the segmented quantitative model includes three concentration segments and two cross-concentration segments; in order from low concentration to high concentration, the boundary concentrations of the first and second categories of the classification model are included in the cross-concentration segments of the first and second segments of the segmented quantitative model, and the boundary concentrations of the second and third categories of the classification model are included in the cross-concentration segments of the second and third segments of the segmented quantitative model.

[0084] In some embodiments of the second aspect of the present invention, in the classification model, the boundary concentration between the first and second categories is 0.25 g / kg, and the boundary concentration between the second and third categories is 0.59 g / kg.

[0085] In some embodiments of the second aspect of the present invention, in the segmented quantitative model with crossover concentration segments, the crossover concentration segment between the first and second segments is 0.24-0.28 g / kg, and the crossover concentration segment between the second and third segments is 0.57-0.60 g / kg.

[0086] In some implementations of the second aspect of the present invention, the spectral temperature measurement equation establishment module is used to establish the spectral temperature measurement equation through a multivariate linear regression algorithm.

[0087] In some embodiments of the second aspect of the present invention, the target low-sensitivity wavelength determination module, the spectral temperature measurement equation establishment module and / or the temperature prediction module are used to pre-process the infrared spectrum through python, Java, Matlab, R or Julia.

[0088] In some implementations of the second aspect of the present invention, the mathematical preprocessing is: SG convolution smoothing (half window width is 1, polynomial coefficient is 1), standard normal transformation and detrending in sequence.

[0089] In some embodiments of the second aspect of the present invention, the detection wavelength range of the infrared spectrum is 780 to 2500 nm, preferably 900 to 1650 nm.

[0090] In some embodiments of the second aspect of the present invention, the infrared spectrum has a spectrum averaging number of 8 to 64 times, such as 16 times, 32 times, or 48 times.

[0091] In some embodiments of the second aspect of the present invention, the infrared spectrum is averaged and measured 2 to 5 times (eg, 3 times) to obtain an average spectrum.

[0092] In some embodiments of the second aspect of the present invention, the abscissa of the infrared spectrum represents the wavelength, and the ordinate represents the absorption intensity.

[0093] In some embodiments of the second aspect of the present invention, in the first derivative spectrum of the infrared spectrum, the abscissa represents the wavelength, and the ordinate represents the first derivative of the absorption intensity with respect to the wavelength.

[0094] In some embodiments of the second aspect of the present invention, the "temperature" is the ambient temperature during infrared spectroscopy detection or the ambient temperature of the sample during infrared spectroscopy detection.

[0095] A third aspect of the present invention relates to a device for predicting the content of a component in a sample, comprising:

[0096] A memory for storing instructions;

[0097] A processor is coupled to the memory, and the processor is configured to execute the method according to the first aspect of the present invention based on instructions stored in the memory.

[0098] In some embodiments of the third aspect of the present invention, the sample is a food sample or a natural fermentation sample, preferably a condiment sample, and more preferably a soy sauce sample.

[0099] In some embodiments of the third aspect of the present invention, the component is a physical and chemical component contained in a sample, preferably a main component or a food additive (preferably a food preservative, such as benzoic acid) contained in a food sample.

[0100] A fourth aspect of the present invention relates to a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the method described in the first aspect of the present invention is implemented.

[0101] Beneficial effects achieved by the present invention:

[0102] The method or device of the present invention accurately predicts the temperature of the detection environment according to the infrared spectrum of the sample, and predicts the component content in the sample by using a qualitative model and a quantitative model that use the predicted value of the sample's ambient temperature as a label, thereby reducing the influence of temperature fluctuations on the accuracy of model analysis, while avoiding the problem of prediction accuracy degradation caused by the wide correction concentration range of the global quantitative model, and enhancing the generalization ability of the model. The present invention reduces the RMSECV predicted by the global model by about 67%. Therefore, the method or device of the present invention significantly improves the accuracy and precision of the prediction results. BRIEF DESCRIPTION OF THE DRAWINGS

[0103] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein

[0104] Figure 1 A schematic diagram of an embodiment of a method for predicting the content of a component in a sample according to the present invention;

[0105] Figure 2 A schematic diagram of an embodiment of a device for predicting the content of a component in a sample according to the present invention;

[0106] Figure 3 The infrared spectra of the six soy sauce samples in the embodiment after pretreatment are shown in FIG.

[0107] Figure 4 : is the first derivative spectrum of the infrared spectra of the 6 soy sauce samples in the embodiment;

[0108] Figure 5 is the spectral temperature measurement equation established in the embodiment;

[0109] Figure 6 Schematic diagram of the multi-classification model and the segmented quantitative model with overlapping concentration segments constructed in the embodiment. DETAILED DESCRIPTION

[0110] The embodiments of the present invention will be described clearly and completely below in conjunction with the examples. Obviously, the described examples are only some examples of the present invention, rather than all examples. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the examples in the present invention, all other examples obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention.

[0111] Figure 1 A schematic diagram of an embodiment of a method for predicting the content of a component in a sample according to the present invention;

[0112] The method comprises the following steps:

[0113] Step 101: Obtain infrared spectra of multiple samples at the same temperature, calculate the first-order derivative spectrum of each infrared spectrum, and determine the wavelength corresponding to the common intersection point of all first-order derivative spectra as the target low-sensitivity wavelength; wherein the component contents of all samples are different;

[0114] Step 102: Obtain infrared spectra of a single sample at different temperatures, calculate the first-order derivative spectra of each infrared spectrum, obtain the ordinate value corresponding to the target low-sensitivity wavelength on each first-order derivative spectrum, and establish a spectral temperature measurement equation according to the ordinate value and the corresponding temperature value; preferably, if multiple target low-sensitivity wavelengths are determined in step 101, then establish an equation for each target low-sensitivity wavelength according to the above operation, and then select the equation with the best equation evaluation parameters as the spectral temperature measurement equation and select the corresponding target low-sensitivity wavelength;

[0115] Step 103: Obtain the infrared spectrum of the sample to be tested, calculate the first-order derivative spectrum of the infrared spectrum, obtain the ordinate value corresponding to the selected target low-sensitivity wavelength on the first-order derivative spectrum, substitute the ordinate value into the spectrum temperature measurement equation to calculate, and predict the temperature T of the sample to be tested;

[0116] Step 104: If the database stores a qualitative model and a quantitative model of the components in the sample at temperature T, directly substitute the infrared spectrum of the sample to be tested into the qualitative model and the quantitative model to predict the content of the components in the sample to be tested;

[0117] Otherwise, obtain a sample set P of temperature T±s stored in the database, 0.5℃≤s≤1.5℃, the database stores the measured temperature, component content and infrared spectrum of each sample in the sample set P, calculate the projection correlation distance of each sample in the sample set P according to the formula shown below, screen out samples with a projection correlation distance greater than t, t is 2.5-10, and retain the remaining samples; establish a qualitative model and a quantitative model based on the component content and infrared spectrum of the remaining samples, substitute the infrared spectrum of the sample to be tested into the qualitative model and the quantitative model for calculation, and predict the component content of the sample to be tested;

[0118]

[0119] in,

[0120] i is the number in the order in which the samples were obtained;

[0121] PCD i is the projection correlation distance of the i-th sample;

[0122] L i is the residual between the principal component score of the ith sample and the mean score of the sample set, wherein the principal component score of the ith sample is a matrix obtained by PCA dimensionality reduction of a 1×n-order matrix constructed with the absorbance at different wavelengths in the infrared spectrum of the ith sample as column data, and the mean score of the sample set is the mean of the principal component scores of all samples in the sample set;

[0123] C is the inverse matrix of the covariance matrix of the mean score of the sample set;

[0124] L i ' is L i The transposed matrix of

[0125] PCs is the number of principal components involved in the calculation.

[0126] In one embodiment, the temperature in step (1) is higher than the lowest temperature in step (2) and lower than the highest temperature in step (2).

[0127] In one embodiment, the temperature in step (1) is the median value of all temperatures in step (2).

[0128] In one embodiment, the established qualitative model and quantitative model are stored in a database with temperature T as a label.

[0129] In one embodiment, the sample is a soy sauce sample;

[0130] In one embodiment, the ingredient is benzoic acid;

[0131] In one embodiment, the qualitative model is a classification model, the classification model includes three categories, the boundary concentration between the first and second categories is 0.25 g / kg, and the boundary concentration between the second and third categories is 0.59 g / kg;

[0132] In one embodiment, the quantitative model is a segmented quantitative model with crossover concentration segments, the segmented quantitative model includes three concentration segments and two crossover concentration segments, in the segmented quantitative model with crossover concentration segments, the crossover concentration segments of the first and second segments are 0.24-0.28 g / kg, and the crossover concentration segments of the second and third segments are 0.57-0.60 g / kg;

[0133] In one embodiment, in step (1) and / or step (2), the temperature is selected in the range of 20°C to 50°C;

[0134] In one embodiment, in step (2), an equation is established according to the ordinate value and the temperature by a machine learning algorithm, such as a multivariate linear regression algorithm;

[0135] In one embodiment, in step (1), step (2) and / or step (3), the infrared spectrum is preprocessed by python, Java, Matlab, R or Julia before calculating the first-order derivative spectrum;

[0136] In one embodiment, in step (4), before prediction, the infrared spectrum of the sample to be tested is subjected to mathematical preprocessing; before modeling, the infrared spectrum of the database sample is subjected to the same mathematical preprocessing; the mathematical preprocessing is: SG convolution smoothing (half-window width is 1, polynomial coefficient is 1), standard normal transformation and detrending in sequence.

[0137] In one embodiment, the detection wavelength range of the infrared spectrum is 780-2000 nm.

[0138] In one embodiment, the infrared spectrum is averaged 25 to 40 times.

[0139] In one embodiment, the infrared spectrum is averaged and measured 2 to 5 times, and the average spectrum is taken.

[0140] Figure 2 A schematic diagram of an embodiment of a device for predicting the content of a component in a sample according to the present invention;

[0141] The device comprises a target low-sensitivity wavelength determination module 11, a spectrum temperature measurement equation establishment module 12, a temperature prediction module 13, a storage module 14, a model construction module 15 and a component content prediction module 16; wherein,

[0142] The target low-sensitivity wavelength determination module 11 is used to obtain infrared spectra of multiple samples at the same temperature, calculate the first-order derivative spectra of each infrared spectrum, and determine the wavelength corresponding to the common intersection point of all first-order derivative spectra as the target low-sensitivity wavelength; wherein the component contents of all samples are different;

[0143] The spectral temperature measurement equation establishment module 12 is used to obtain the infrared spectrum of a single sample at different temperatures, calculate the first-order derivative spectrum of each infrared spectrum, obtain the ordinate value corresponding to the target low-sensitivity wavelength on each first-order derivative spectrum, and establish the spectral temperature measurement equation according to the ordinate value and the corresponding temperature; preferably, if the target low-sensitivity wavelength determination module 11 obtains multiple target low-sensitivity wavelengths, the spectral temperature measurement equation establishment module 12 is used to establish an equation for each target low-sensitivity wavelength according to the aforementioned operation, and then select the equation with the best equation evaluation parameters as the spectral temperature measurement equation and select the corresponding target low-sensitivity wavelength;

[0144] The temperature prediction module 13 is used to obtain the infrared spectrum of the sample to be tested, calculate the first-order derivative spectrum of the infrared spectrum, obtain the ordinate value corresponding to the selected target low-sensitivity wavelength on the first-order derivative spectrum, substitute the ordinate value into the spectrum temperature measurement equation for calculation, and predict the temperature T of the sample to be tested;

[0145] The storage module 14 is used to store the measured temperature, component content and infrared spectrum of the sample;

[0146] The model building module 15 is used to obtain a sample set P of temperature T±s stored in the storage module 14, 0.5°C≤s≤1.5°C, calculate the projection correlation distance of each sample in the sample set P according to the formula shown below, filter out samples with a projection correlation distance greater than t, t is 2.5-10, retain the remaining samples, and then establish a qualitative model and a quantitative model based on the component content and infrared spectrum of the remaining samples;

[0147]

[0148] in,

[0149] i is the number in the order in which the samples were obtained;

[0150] PCD i is the projection correlation distance of the i-th sample;

[0151] L i is the residual between the principal component score of the ith sample and the mean score of the sample set, wherein the principal component score of the ith sample is a matrix obtained by PCA dimensionality reduction of a 1×n-order matrix constructed with the absorbance at different wavelengths in the infrared spectrum of the ith sample as column data, and the mean score of the sample set is the mean of the principal component scores of all samples in the sample set;

[0152] C is the inverse matrix of the covariance matrix of the mean score of the sample set;

[0153] L i ' is L i The transposed matrix of

[0154] PCs is the number of principal components involved in the calculation;

[0155] The component content prediction module 16 is used to substitute the infrared spectrum of the sample to be tested into the qualitative model and the quantitative model for calculation, so as to predict the component content of the sample to be tested.

[0156] In one embodiment, the storage module 14 is further used to store the qualitative model and / or the quantitative model constructed by the model construction module 15 and use the temperature T as a label.

[0157] In one embodiment, the temperature adopted by the target low-sensitivity wavelength determination module 11 is higher than the lowest temperature adopted by the spectrum temperature measurement equation establishment module 12 and lower than the highest temperature adopted by the spectrum temperature measurement equation establishment module 12 .

[0158] In one embodiment, the temperature used by the target low-sensitivity wavelength determination module 11 is the median value of all temperatures used by the spectrum temperature measurement equation establishment module 12 .

[0159] In one embodiment, if the storage module 14 stores a qualitative model and a quantitative model of the components in the sample at temperature T, the component content prediction module 16 is used to directly substitute the infrared spectrum of the sample to be tested into the stored qualitative model and quantitative model to calculate and predict the component content of the sample to be tested.

[0160] In one embodiment, the sample is a soy sauce sample;

[0161] In one embodiment, the ingredient is benzoic acid;

[0162] In one embodiment, the qualitative model is a classification model, and the number of classifications in the classification model is three; wherein the boundary concentration between the first and second categories is 0.25 g / kg, and the boundary concentration between the second and third categories is 0.59 g / kg;

[0163] In one embodiment, the quantitative model is a segmented quantitative model with crossover concentration segments, and the segmented quantitative model includes three concentration segments and two crossover concentration segments; wherein the crossover concentration segments of the first and second segments are 0.24 to 0.28 g / kg, and the crossover concentration segments of the second and third segments are 0.57 to 0.60 g / kg;

[0164] In one embodiment, in the target low-sensitivity wavelength determination module 11 and / or the spectrum temperature measurement equation establishment module 12, the temperature selection range is 20° C. to 50° C.;

[0165] In one embodiment, the spectral temperature measurement equation establishment module 12 is used to establish an equation according to the ordinate value and the temperature through a machine learning algorithm, preferably through a multivariate linear regression algorithm;

[0166] In one embodiment, the target low-sensitivity wavelength determination module 11, the spectrum temperature measurement equation establishment module 12 and / or the temperature prediction module 13 are also used to pre-process the infrared spectrum by python, Java, Matlab, R or Julia before calculating the first-order derivative spectrum;

[0167] In one embodiment, the component content prediction module 16 is also used to perform mathematical preprocessing on the infrared spectrum of the sample to be tested before prediction; the model building module 15 is also used to perform the same mathematical preprocessing on the infrared spectrum of the database sample before modeling; the mathematical preprocessing is: SG convolution smoothing (half window width is 1, polynomial coefficient is 1), standard normal transformation and detrending in sequence;

[0168] In one embodiment, the detection wavelength range of the infrared spectrum is 780 to 2000 nm;

[0169] In one embodiment, the infrared spectrum is averaged 25 to 40 times;

[0170] In one embodiment, the infrared spectrum is averaged and measured 2 to 5 times, and the average spectrum is taken.

[0171] The present invention also relates to a device for predicting the content of benzoic acid in a condiment, comprising:

[0172] A memory for storing instructions;

[0173] A processor is coupled to the memory, and the processor is configured to execute the following based on the instructions stored in the memory: Figure 1 The method shown.

[0174] The present invention also relates to a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the following are implemented: Figure 1 The method shown.

[0175] The memory may include a high-speed RAM memory, or may include a non-volatile memory, such as at least one disk memory. The memory may also be a memory array. The memory may also be divided into blocks, and the blocks may be combined into virtual volumes according to certain rules.

[0176] The processor may be a central processing unit (CPU), or a GPU, or may be an application specific integrated circuit (ASIC), or may be one or more integrated circuits configured to implement the embodiments of the present invention.

[0177] The apparatus described above may be implemented as a general purpose processor, a programmable logic controller (PLC), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components or any suitable combination thereof for performing the functions described in the present application.

[0178] Example

[0179] (1) Determine the target low-sensitivity wavelength and spectral temperature measurement equation:

[0180] Six soy sauce samples (C1-C6) of different concentrations were subjected to infrared spectroscopy at 30°C. The detection index was benzoic acid. The detection wavelength range was 900-1650nm. The spectrum was averaged 32 times, and the parallel injection measurement was performed 3 times. The average spectrum was taken. The spectrum processing was realized by Python programming, and the following was obtained: Figure 3 The infrared spectrum is shown. The infrared spectrum is processed by first-order derivative to obtain Figure 4 The first derivative spectrum shown will Figure 4 The common intersection point of the six spectra is defined as the target low-sensitivity wavelength.

[0181] The soy sauce sample with a benzoic acid content of 0.35 g / kg was subjected to infrared spectroscopy at multiple temperature points between 26.5°C and 36.5°C. The detection conditions, spectral processing and first-order derivative processing were the same as above, and the first-order derivative spectrum (the horizontal axis is the wavelength, and the vertical axis is the angular coefficient) was obtained. The spectral temperature measurement equation was established by linear regression algorithm based on the temperature value and the angular coefficient corresponding to the target low-sensitivity wavelength in the first-order derivative spectrum; when there are multiple target low-sensitivity wavelengths, the equation is established for each target low-sensitivity wavelength according to the above method, and then the parameter (R 2 ) selects the best one as the spectrum temperature measurement equation, and its corresponding wavelength is the selected target low-sensitivity wavelength. The target low-sensitivity wavelength selected in this embodiment is between 1400 and 1500 nm, specifically 1438 nm, and the spectrum temperature measurement equation y = -3094x + 51.881 (R 2 =0.9886), such as Figure 5 shown.

[0182] (2) Predict the temperature of the sample to be tested:

[0183] The sample to be tested was subjected to infrared spectroscopy detection, the detection index was benzoic acid, the detection wavelength range was 900-1650nm, the spectrum was averaged 32 times, and the parallel injection measurement was performed 3 times to obtain the average spectrum; the infrared spectrum of the sample to be tested was preprocessed: SG convolution smoothing (half-window width was 1, polynomial coefficient was 1), standard normal transformation, and detrending; the preprocessed infrared spectrum was subjected to first-order derivative processing, and then the corresponding angular coefficient was obtained according to the first-order derivative spectrum and the selected target low-sensitivity wavelength, and the angular coefficient was substituted into the spectral temperature measurement equation y=-3094x+51.881(R 2 =0.9886), the temperature T of the sample to be tested is predicted, and the prediction results of each batch of samples to be tested are shown in Table 1.

[0184] (3) Establish a multi-classification model and a segmented quantitative model with cross-concentration:

[0185] If a multi-classification model with a detection temperature label of T and a segmented quantitative model with cross-concentration segments are stored in the database, the model is directly retrieved to perform the prediction in step (4); otherwise, the model is established according to the following steps.

[0186] All training samples with temperature labels of T±1℃ in the database are selected. The data stored in the database for the training samples include measured temperature, benzoic acid concentration, and infrared spectrum data. The infrared spectrum data of the selected training samples are mathematically preprocessed. Then the projection correlation distance (PCD) of each training sample is calculated according to the following formula. The training samples with PCD values ​​greater than the threshold t (t is 6.5) are eliminated, and the remaining training samples are used for modeling. Among them, the principal component score of the training sample is a matrix obtained by PCA dimensionality reduction of a 1×n-order matrix (the n columns of data are the absorbance data of different wavelengths of the infrared spectrum); the number of principal components involved in the calculation refers to the number of columns of the matrix after the above PCA dimensionality reduction; the mean score of the training sample set refers to the mean of the principal component scores of all selected training samples.

[0187]

[0188] in:

[0189] i is the number of the training samples in the order of acquisition;

[0190] PCD i is the projection correlation distance of the i-th training sample;

[0191] L i is the residual between the principal component score of the i-th training sample and the mean score of the training sample set;

[0192] C is the inverse matrix of the covariance matrix of the mean score of the training sample set;

[0193] L i ' is L i The transposed matrix of

[0194] PCs is the number of principal components involved in the calculation.

[0195] The absorbance of infrared spectra at different wavelengths of the selected training samples was used as the independent variable and the category of benzoic acid concentration was used as the dependent variable, and a qualitative classification model was constructed using the quadratic discriminant algorithm. Figure 6 As shown, the classification model divides the training samples into three categories according to the benzoic acid concentration from low to high. The boundary concentration between the first and second categories is 0.25 g / kg, and the boundary concentration between the second and third categories is 0.59 g / kg.

[0196] The absorbance of infrared spectra at different wavelengths of the selected training samples was used as the independent variable and the concentration of benzoic acid was used as the dependent variable. The segmented quantitative model with cross-concentration segments was constructed by partial least squares regression algorithm (e.g. Figure 6 The crossover concentration ranges are 0.24-0.28 g / kg and 0.57-0.60 g / kg respectively.

[0197] The established multi-classification model and the segmented quantitative model with cross-concentration segments are stored in the database as models of temperature label T.

[0198] (4) Prediction of benzoic acid content:

[0199] The infrared spectrum data of the sample to be tested is subjected to the same mathematical preprocessing as in step (3);

[0200] The absorbance data of different wavelengths of the infrared spectrum of the pretreated sample are classified through a classification model to predict the range of benzoic acid content in the sample; then, the benzoic acid content in the sample is predicted through a segmented quantitative model with cross-concentration segments based on the absorbance data of different wavelengths of the infrared spectrum of the pretreated sample.

[0201] The prediction results of each batch of tested samples are shown in Table 1.

[0202] Comparative Example

[0203] The sample to be tested in step (2) of the embodiment and all the training samples in the database in step (3) of the embodiment are used. The infrared spectrum data of the sample to be tested and all the training samples in the database are subjected to the same mathematical preprocessing: SG convolution smoothing (half-width window is 1, polynomial coefficient is 1), standard normal transformation, and detrending.

[0204] With the measured temperature and absorbance at different wavelengths of infrared spectra of all training samples as independent variables and benzoic acid content as dependent variable, a global model was established for quantitative prediction using the partial least squares algorithm.

[0205] The temperature and the absorbance data of different wavelengths of the infrared spectrum of the samples to be tested are substituted into the global model for calculation, and the benzoic acid content of the samples to be tested is predicted. The prediction results of each batch of samples to be tested are shown in Table 1.

[0206] Table 1 Prediction results of sample temperature and benzoic acid content

[0207]

[0208]

[0209]

[0210]

[0211]

[0212] As shown in Table 1, the residual error of the temperature predicted by the method of the present invention is within ±0.5°C, and the temperature can be predicted more accurately. Compared with the prediction using the global model, the residual error of the benzoic acid content of the sample to be tested predicted by the method of the present invention is smaller. The RMSECV of the global model is 0.036 g / kg, while the RMSECV of the segmented quantitative model with cross-concentration segments of the present invention is 0.012 g / kg, which shows that the method of the present invention can more accurately predict the benzoic acid content of the sample, which has obvious advantages.

[0213] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the invention.

Claims

1. A method for predicting the content of a component in a sample, comprising the following steps: (1) Obtain infrared spectra of multiple samples at the same temperature, calculate the first-order derivative spectra of each infrared spectrum, and determine the wavelength corresponding to the common intersection point of all first-order derivative spectra as the target low-sensitivity wavelength; wherein, All samples contained different amounts of ingredients; (2) Obtaining infrared spectra of a single sample at different temperatures, calculating the first-order derivative spectra of each infrared spectrum, obtaining the ordinate value corresponding to the target low-sensitivity wavelength on each first-order derivative spectrum, and establishing a spectral temperature measurement equation according to the ordinate value and the corresponding temperature value; if multiple target low-sensitivity wavelengths are determined in step (1), obtaining the ordinate value corresponding to each target low-sensitivity wavelength on each first-order derivative spectrum, and then establishing an equation for each target low-sensitivity wavelength according to the ordinate value and the corresponding temperature, and then selecting the equation with the best equation evaluation parameters as the spectral temperature measurement equation and selecting the corresponding target low-sensitivity wavelength; (3) Obtain the infrared spectrum of the sample to be tested, calculate the first-order derivative spectrum of the infrared spectrum, obtain the ordinate value corresponding to the selected target low-sensitivity wavelength on the first-order derivative spectrum, substitute the ordinate value into the spectrum temperature measurement equation to calculate, and predict the temperature T of the sample to be tested; (4) If the database stores a qualitative model and a quantitative model of the components in the sample at temperature T, the infrared spectrum of the sample to be tested is directly substituted into the qualitative model and the quantitative model to predict the content of the components in the sample to be tested; Otherwise, obtain a sample set P of temperature T±s stored in the database, 0.5℃≤s≤1.5℃, the database stores the measured temperature, component content and infrared spectrum of each sample in the sample set P, calculate the projection correlation distance of each sample in the sample set P according to the formula shown below, screen out samples with a projection correlation distance greater than t, t is 2.5~10, and retain the remaining samples; establish a qualitative model and a quantitative model based on the component content and infrared spectrum of the remaining samples, and then substitute the infrared spectrum of the sample to be tested into the qualitative model and the quantitative model for calculation, and predict the component content of the sample to be tested; PCD i = in, i is the number in the order in which the samples were obtained; PCD i is the projection correlation distance of the i-th sample; L i is the residual between the principal component score of the ith sample and the mean score of the sample set, wherein the principal component score of the ith sample is a matrix obtained by PCA dimensionality reduction of a 1×n-order matrix constructed with the absorbance at different wavelengths in the infrared spectrum of the ith sample as column data, and the mean score of the sample set is the mean of the principal component scores of all samples in the sample set; C is the inverse matrix of the covariance matrix of the mean score of the sample set; for The transposed matrix of PCs is the number of principal components involved in the calculation.

2. The method according to claim 1, wherein: The temperature in step (1) is higher than the lowest temperature in step (2) and lower than the highest temperature in step (2).

3. The method according to claim 1, wherein: The temperature in step (1) is the median of all temperatures in step (2).

4. The method according to claim 1, wherein: The established qualitative model and quantitative model are stored in the database with temperature T as a label.

5. The method according to any one of claims 1 to 4, characterized in that One or more of the following: a. The sample is a food sample or a natural fermentation sample; b. The components are the physical and chemical components contained in the sample; c. The qualitative model is a classification model; d. The quantitative model is a segmented quantitative model with cross-concentration segments; e. In step (1) and / or step (2), the temperature is selected in the range of 20°C to 50°C; f. In step (2), an equation is established by a machine learning algorithm according to the ordinate value and the temperature value; g. In step (1), step (2) and / or step (3), the infrared spectrum is preprocessed before calculating the first-order derivative spectrum; h. In step (4), before prediction, the infrared spectrum of the sample to be tested is mathematically preprocessed.

6. The method according to claim 5, wherein: In item a, the sample is a condiment sample.

7. The method according to claim 5, wherein: In item a, the sample is a soy sauce sample.

8. The method according to claim 5, wherein: In item c, the number of categories in the classification model is three.

9. The method according to claim 5, wherein: In item d, the segmented quantitative model includes three concentration segments and two cross-concentration segments.

10. The method according to claim 9, wherein: In item d, the span of each cross-concentration segment accounts for 2% to 18% of the total concentration span of sample set P.

11. The method according to claim 9, wherein: In item d, the number of samples corresponding to each cross-concentration segment accounts for 5% to 10% of the total number of samples in the sample set P.

12. The method according to claim 5, wherein: In item f, in step (2), the equation is established through the regression algorithm.

13. A device for predicting the content of a component in a sample, comprising a target low-sensitivity wavelength determination module, a spectrum temperature measurement equation establishment module, a temperature prediction module, a storage module, a model construction module and a component content prediction module; wherein, The target low-sensitivity wavelength determination module is used to obtain infrared spectra of multiple samples at the same temperature, calculate the first-order derivative spectra of each infrared spectrum, and determine the wavelength corresponding to the common intersection point of all first-order derivative spectra as the target low-sensitivity wavelength; wherein the component contents of all samples are different; The spectral temperature measurement equation establishment module is used to obtain the infrared spectrum of a single sample at different temperatures, calculate the first-order derivative spectrum of each infrared spectrum, obtain the ordinate value corresponding to the target low-sensitivity wavelength on each first-order derivative spectrum, and establish the spectral temperature measurement equation according to the ordinate value and the corresponding temperature value; if the target low-sensitivity wavelength determination module obtains multiple target low-sensitivity wavelengths, the spectral temperature measurement equation establishment module is used to obtain the ordinate value corresponding to each target low-sensitivity wavelength on each first-order derivative spectrum, and then establish an equation for each target low-sensitivity wavelength according to the ordinate value and the corresponding temperature, and then select the equation with the best equation evaluation parameters as the spectral temperature measurement equation and select the corresponding target low-sensitivity wavelength; The temperature prediction module is used to obtain the infrared spectrum of the sample to be tested, calculate the first-order derivative spectrum of the infrared spectrum, obtain the ordinate value corresponding to the target low-sensitivity wavelength selected on the first-order derivative spectrum, substitute the ordinate value into the spectrum temperature measurement equation for calculation, and predict the temperature T of the sample to be tested; The storage module is used to store the measured temperature, component content and infrared spectrum of the sample; The model building module is used to obtain a sample set P of temperature T±s stored in the storage module, 0.5°C≤s≤1.5°C, calculate the projection correlation distance of each sample in the sample set P according to the formula shown below, filter out samples with a projection correlation distance greater than t, t is 2.5-10, retain the remaining samples, and then establish a qualitative model and a quantitative model according to the component content and infrared spectrum of the remaining samples; PCD i = in, i is the number in the order in which the samples were obtained; PCD i is the projection correlation distance of the i-th sample; L i is the residual between the principal component score of the ith sample and the mean score of the sample set, wherein the principal component score of the ith sample is a matrix obtained by PCA dimensionality reduction of a 1×n-order matrix constructed with the absorbance at different wavelengths in the infrared spectrum of the ith sample as column data, and the mean score of the sample set is the mean of the principal component scores of all samples in the sample set; C is the inverse matrix of the covariance matrix of the mean score of the sample set; for The transposed matrix of PCs is the number of principal components involved in the calculation; The component content prediction module is used to substitute the infrared spectrum of the sample to be tested into the qualitative model and the quantitative model for calculation, so as to predict the component content of the sample to be tested; The storage module is also used to store the qualitative model and the quantitative model constructed by the model construction module and use temperature T as a label.

14. The device according to claim 13, wherein: The temperature adopted by the target low-sensitivity wavelength determination module is higher than the lowest temperature adopted by the spectrum temperature measurement equation establishment module and lower than the highest temperature adopted by the spectrum temperature measurement equation establishment module.

15. The device according to claim 13, wherein: The temperature adopted by the target low-sensitivity wavelength determination module is the median value of all temperatures adopted by the spectrum temperature measurement equation establishment module.

16. The device according to claim 13, wherein: If the storage module stores the qualitative model and the quantitative model of the components in the sample at temperature T, the component content prediction module is used to directly substitute the infrared spectrum of the sample to be tested into the stored qualitative model and the quantitative model to calculate and predict the component content of the sample to be tested.

17. The device according to any one of claims 13 to 16, characterized in that One or more of the following: (A) The sample is a food sample or a naturally fermented sample; (B) The components are the physical and chemical components contained in the sample; (C) The qualitative model is a classification model; (D) The quantitative model is a segmented quantitative model with overlapping concentration segments; (E) In the target low-sensitivity wavelength determination module and / or the spectrum temperature measurement equation establishment module, the temperature selection range is 20°C to 50°C; (F) a spectral temperature measurement equation establishment module is used to establish an equation according to the ordinate value and the temperature value through a machine learning algorithm; (G) the target low-sensitivity wavelength determination module, the spectrum temperature measurement equation establishment module and / or the temperature prediction module are also used to pre-process the infrared spectrum before calculating the first-order derivative spectrum; (H) The component content prediction module is also used to mathematically preprocess the infrared spectrum of the sample to be tested before prediction.

18. The device according to claim 17, wherein: In item (A), the sample is a condiment sample.

19. The device according to claim 17, wherein: In item (A), the sample is a soy sauce sample.

20. The device according to claim 17, wherein: In item (C), the number of categories in the classification model is three.

21. The device according to claim 17, wherein: In item (D), the segmented quantitative model includes three concentration segments and two cross-concentration segments.

22. The device according to claim 21, wherein In item (D), the span of each crossover concentration segment accounts for 2% to 18% of the total concentration span of sample set P.

23. The device according to claim 21, wherein In item (D), the number of samples corresponding to each cross-concentration segment accounts for 5% to 10% of the total number of samples in sample set P.

24. The device according to claim 17, wherein: In item (F), the equation is established through regression algorithm.

25. A device for predicting the content of a component in a sample, comprising: A memory for storing instructions; A processor is coupled to the memory, and the processor is configured to execute the method according to any one of claims 1 to 12 based on instructions stored in the memory.

26. A computer-readable storage medium, characterized in that: The readable storage medium stores computer instructions, and when the instructions are executed by a processor, the method according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • Near infrared spectrum nondestructive testing method and device for material component content

    CN101915744A

  • Method for predicting content of amino acid of feed and feed raw materials based on infrared spectroscopy

    CN107290300A