Spectral data correction method based on weight coefficient

文档序号:969504 发布日期:2020-11-03 浏览:2次 中文

阅读说明:本技术 一种基于权重系数的光谱数据修正方法 (Spectral data correction method based on weight coefficient ) 是由 刘浩 闫晓剑 张国宏 王毅 于 2020-08-24 设计创作,主要内容包括:本发明公开了一种基于权重系数的光谱数据修正方法,首先通过黑、白、灰校准板的基准值及复值,计算出不同时间点的光谱倍率值,然后根据黑、白、灰校准板与待测样品的反射率关系,计算出各校准板的权重系数,进而得到光谱修正公式,接着,结合黑、白、灰校准板光谱倍率值及光谱修正公式对待测样品复值光谱数据进行修正,最后,将待测样品光谱数据的基准值分别与原始复值及修正后复值进行整合建模,并分别判断两模型的质量。本发明的方法充分结合了便携式近红外光谱数据的特性,可以有效对不同时间点的便携式近红外光谱数据进行修正,进而提升光谱模型质量,同时易于实施,极大程度的解决了不同时间点便携式近红外光谱数据难以修正的问题。(The invention discloses a spectral data correction method based on weight coefficients, which comprises the steps of firstly calculating spectral power values of different time points through reference values and complex values of black, white and gray calibration plates, then calculating the weight coefficients of the calibration plates according to the reflectivity relations of the black, white and gray calibration plates and a sample to be detected, further obtaining a spectral correction formula, then correcting the complex value spectral data of the sample to be detected by combining the spectral power values of the black, white and gray calibration plates and the spectral correction formula, finally performing integrated modeling on the reference values of the spectral data of the sample to be detected, the original complex value and the corrected complex value respectively, and judging the quality of two models respectively. The method provided by the invention fully combines the characteristics of the portable near infrared spectrum data, can effectively correct the portable near infrared spectrum data at different time points, further improves the quality of the spectrum model, is easy to implement, and greatly solves the problem that the portable near infrared spectrum data at different time points are difficult to correct.)

1. A spectral data correction method based on weight coefficients is characterized by comprising the following steps:

A. respectively collecting the spectrum data of the black, white and gray calibration plates and the sample to be detected at preset intervals in a collection period, wherein the spectrum data collected for the first time is set as reference value spectrum data, and the spectrum data collected later is set as original complex value spectrum data;

B. respectively calculating the spectrum multiplying power values of the black, white and gray calibration plates at each acquisition time point by combining the reference value spectrum data and the original complex value spectrum data of the black, white and gray calibration plates;

C. respectively calculating the weight coefficients of the black, white and gray calibration plates according to the reflectivity relation of the black, white and gray calibration plates and a sample to be detected, and further obtaining a spectrum correction formula;

D. correcting the original complex value spectrum data of the sample to be detected by combining the spectrum multiplying power values of the black, white and gray calibration plates at each acquisition time point and a spectrum correction formula to obtain corrected complex value spectrum data;

E. and integrating and modeling the reference value spectrum data with the original complex value spectrum data and the corrected complex value spectrum data respectively, and judging the quality of the two models respectively.

2. The method according to claim 1, wherein if the number of times of acquiring the spectral data of the calibration plates and the sample to be measured is n, the step B is specifically:

setting the collected reference value spectrum data of the black calibration plate as B1=(B11,B12,……B1(m-1),B1m) Spectral power value T of black calibration plate at the time of first acquisition of spectral dataBlack 1(1, 1, … … 1); wherein m is the number of wavelength points of the spectrum of the used near-infrared spectrometer;

setting the complex value spectrum data of the ith collected black calibration plate as Bi=(Bi1,Bi2,……Bi(m-1),Bim) Wherein i is 2, 3, … …, n;

the spectral power value T of the black calibration plate at the ith acquisition of spectral dataBlack i

TBlack i=(Bi/B1)*TBlack 1=(Bi1/B11,Bi2/B12,……Bi(m-1)/B1(m-1),Bim/B1m);

Similarly, the collected reference value spectrum data of the white calibration plate is set as W1=(W11,W12,……W1(m-1),W1m) The spectral power value T of the white calibration plate at the time of first acquisition of spectral dataWhite 1=(1,1,……1);

Let the complex-valued spectral data of the ith collected white calibration plate be Wi=(Wi1,Wi2,……Wi(m-1),Wim) Wherein i is 2, 3, … …, n;

the spectral power value T of the white calibration plate at the ith acquisition of spectral dataWhite i

TWhite i=(Wi/W1)*TWhite 1=(Wi1/W11,Wi2/W12,……Wi(m-1)/W1(m-1),Wim/W1m);

Similarly, the collected reference value spectrum data of the gray calibration plate is set as G1=(G11,G12,……G1(m-1),G1m) The spectral power value T of the gray calibration plate at the time of first acquisition of spectral dataAsh 1=(1,1,……1);

Let the complex-valued spectral data of the ith collected gray calibration plate be Gi=(Gi1,Gi2,……Gi(m-1),Gim) Wherein i is 2, 3, … …, n;

the spectral power value T of the gray calibration plate at the ith acquisition of spectral dataAsh i

TAsh i=(Gi/G1)*TAsh 1=(Gi1/G11,Gi2/G12,……Gi(m-1)/G1(m-1),Gim/G1m)。

3. The method for modifying spectral data based on weight coefficients as claimed in claim 2, wherein the step C is specifically:

let the reflectivities of the black, white and gray calibration plates be HBlack colour、HWhite colour (Bai)、HAsh ofThe reflectivity of the sample to be measured is HSample to be testedCalculating to obtain the difference C between the reflectivity of the black, white and gray calibration plates and the reflectivity of the sample to be measuredBlack colour、CWhite colour (Bai)、CAsh ofComprises the following steps:

correcting the complex value spectrum data by adopting a black, white and gray calibration plate together, wherein the spectrum correction formula is as follows: t ═ aTBlack colour+bTWhite colour (Bai)+cTAsh of

Wherein T is complex value correction multiplying factor value, a, b, c are weight coefficients of black, white, grey calibration plate, TBlack colour,TWhite colour (Bai),TAsh ofThe spectrum multiplying power values of the black, white and gray calibration plates;

the values of the weighting coefficients a, b, c are:

4. the method for modifying spectral data according to claim 3, wherein the step D is specifically as follows:

substituting the spectrum multiplying power values of the black, white and gray calibration plates at each acquisition time point into a spectrum correction formula to obtain the spectrum correction multiplying power values of the black, white and gray calibration plates at the acquisition time points, which specifically comprises the following steps:

Ti=aTblack i+bTWhite i+cTAsh i

If the original complex value spectrum data at the ith acquisition is Si=(Si1,Si2,……Si(m-1),Sim) Obtaining corrected complex value spectrum data S at the time of the ith acquisition after correction through a spectrum correction formulai′:

Figure FDA0002647084010000032

5. The method for modifying spectral data according to claim 1, wherein the step E is specifically as follows:

performing data integration on the reference value spectral data of the sample to be tested and the original complex value obtained in the ith acquisition and performing mathematical modeling to obtain a spectral model M;

integrating the data of the reference value spectrum data of the sample to be tested and the corrected complex value spectrum data corresponding to the ith acquisition, and performing mathematical modeling to obtain a spectrum model M';

and comparing the model correlation coefficients and the root mean square errors of the spectrum models M and M' to judge the quality of the two models.

6. The method for modifying spectral data according to claim 5, wherein the specific determination rule for determining the quality of the two models is: the larger the correlation coefficient of the model is, the better the quality of the model is; the smaller the root mean square error, the better the model quality.

7. The method for modifying spectral data according to claim 1 or 5, wherein the modeling in step E is performed by using partial least squares.

8. The method according to claim 1, wherein the predetermined interval is 1 day.

9. The method of claim 1, wherein the collection period is 14 days.

Technical Field

The invention relates to the technical field of spectral data correction, in particular to a spectral data correction method based on a weight coefficient.

Background

In recent years, the near infrared spectrum analysis technology is developed rapidly and is applied to a plurality of fields such as chemical industry, pharmacy, military industry, food and the like. The near infrared spectrum technology belongs to the molecular spectrum technology, can indicate material composition and property information on the molecular level, and obtains very high benefit no matter for economic or social influence, thereby having great development potential.

However, most of the existing material composition and property information detection is mainly carried out by using a large laboratory near infrared spectroscopy instrument, although the methods have high quantitative accuracy and sensitivity, the required equipment has huge volume, expensive equipment cost, long sample preparation time and strict sample preparation method, the detection equipment and the sample preparation need professional operation, the detection environment is fixed, the analysis time is long, and the method is not suitable for field detection and is not convenient for popularization and use.

Along with the development of portable near infrared spectroscopy technology, the mainstream large near infrared spectrometer equipment in the market is developed towards the portable direction of small size and low price. However, the portable near-infrared spectrometer is easily affected by a light source, a detector, a using method, environmental conditions and the like, so that the acquired spectral data has poor stability and low precision, and the effect of a spectral model is further affected. Especially, the spectral data of the portable near-infrared spectrometer may have large differences from day to day, week to week. The traditional method for correcting the spectrum data through a preprocessing algorithm has poor effect and is difficult to solve the problem fundamentally. In order to ensure the quality of the model of the portable near-infrared spectrometer, a method capable of correcting the portable near-infrared spectrum data is urgently needed.

Disclosure of Invention

The invention aims to overcome the defects in the background art, provides a spectral data correction method based on weight coefficients, can effectively correct portable near infrared spectral data at different time points, further improves the quality of a spectral model, is easy to implement, and solves the problem that the portable near infrared spectral data at different time points are difficult to correct to a great extent.

In order to achieve the technical effects, the invention adopts the following technical scheme:

a spectral data correction method based on weight coefficients comprises the following steps:

A. respectively collecting the spectrum data of the black, white and gray calibration plates and the sample to be detected at preset intervals in a collection period, wherein the spectrum data collected for the first time is set as reference value spectrum data, and the spectrum data collected later is set as original complex value spectrum data;

the black, white and gray calibration plates are all standardized calibration plates of international certification, are little influenced by the environment, are not easy to change in material, have strong oil stain resistance, are uniform in distribution of the test surface, are extremely stable in the wavelength range of near infrared spectrum, and are calibration materials extremely suitable for portable near infrared spectrum data; meanwhile, the design of the collection of the spectral data in the method fully considers the influence of the portable near-infrared spectrometer on a light source, a detector, a using method, environmental conditions and the like, so that even if the spectral data obtained by collecting the same sample slightly changes from day to day, the characteristic of great change is obtained from week to week, the correction effect is embodied to the maximum extent by collecting the data once every fixed interval time in the collection period, wherein the specific collection period and the interval time can be set according to the actual situation;

B. respectively calculating the spectrum multiplying power values of the black, white and gray calibration plates at each acquisition time point by combining the reference value spectrum data and the original complex value spectrum data of the black, white and gray calibration plates;

C. respectively calculating the weight coefficients of the black, white and gray calibration plates according to the reflectivity relation of the black, white and gray calibration plates and a sample to be detected, and further obtaining a spectrum correction formula;

D. correcting the original complex value spectrum data of the sample to be detected by combining the spectrum multiplying power values of the black, white and gray calibration plates at each acquisition time point and a spectrum correction formula to obtain corrected complex value spectrum data;

E. integrating and modeling the reference value spectrum data with the original complex value spectrum data and the corrected complex value spectrum data respectively, and judging the quality of the two models respectively;

the invention relates to a spectral data correction method based on weight coefficients, which comprises the steps of firstly calculating spectral power values of calibration plates according to spectral data of calibration plates at different time points, then calculating respective weight coefficients of the three calibration plates by combining the particularity of portable spectral data, namely the power values are matrix data, then calculating a spectral correction formula by the relationship between the reflectivity of the three calibration plates of black, white and gray and the reflectivity of a sample to be measured, and finally substituting the spectral data at different time points, namely m light intensity data points, into the spectral correction formula in sequence to obtain corrected spectral data, namely correcting the m light intensity data points of each spectral data one by combining the spectral power values and the reflectivity of the three calibration plates in the technical scheme of the application to enable the spectral data to more accurately reflect the component content value of the sample to be measured, thereby effectively improving the accuracy of the spectrum model.

Further, if the number of times of acquiring the spectral data of the black, white and gray calibration plates and the sample to be measured in the acquisition period is n, the step B specifically comprises:

setting the collected reference value spectrum data of the black calibration plate as B1=(B11,B12,……B1(m-1),B1m) Spectral power value T of black calibration plate at the time of first acquisition of spectral dataBlack 1(1, 1, … … 1); wherein m is the number of wavelength points of the spectrum of the used near-infrared spectrometer;

setting the complex value spectrum data of the ith collected black calibration plate as Bi=(Bi1,Bi2,……Bi(m-1),Bim) Wherein i is 2, 3, … …, n;

the spectral power value T of the black calibration plate at the ith acquisition of spectral dataBlack i

TBlack i=(Bi/B1)*TBlack 1=(Bi1/B11,Bi2/B12,……Bi(m-1)/B1(m-1),Bim/B1m);

Similarly, the collected reference value spectrum data of the white calibration plate is set as W1=(W11,W12,……W1(m-1),W1m) The spectral power value T of the white calibration plate at the time of first acquisition of spectral dataWhite 1=(1,1,……1);

Let the complex-valued spectral data of the ith collected white calibration plate be Wi=(Wi1,Wi2,……Wi(m-1),Wim) Wherein i is 2, 3, … …, n;

the spectral power value T of the white calibration plate at the ith acquisition of spectral dataWhite i

TWhite i=(Wi/W1)*TWhite 1=(Wi1/W11,Wi2/W12,……Wi(m-1)/W1(m-1),Wim/W1m);

Similarly, the collected reference value spectrum data of the gray calibration plate is set as G1=(G11,G12,……G1(m-1),G1m) The spectral power value T of the gray calibration plate at the time of first acquisition of spectral dataAsh 1=(1,1,……1);

Let the complex-valued spectral data of the ith collected gray calibration plate be Gi=(Gi1,Gi2,……Gi(m-1),Gim) Wherein i is 2, 3, … …, n;

the light of the gray calibration plate at the ith acquisition of spectral dataSpectral power value TAsh i

TAsh i=(Gi/G1)*TAsh 1=(Gi1/G11,Gi2/G12,……Gi(m-1)/G1(m-1),Gim/G1m)。

Namely, the spectral magnification value at the time of the 2 nd acquisition can be obtained by setting the spectral data of the calibration plate acquired at the 1 st acquisition as a reference value and the spectral magnification value as 1 and dividing the spectral data acquired at the 2 nd acquisition by the spectral data acquired at the 1 st acquisition. And similarly, the 3 rd to nth spectral data are divided by the 1 st acquired spectral data respectively to obtain the 3 rd to nth spectral power values.

Further, the step C specifically includes:

let the reflectivities of the black, white and gray calibration plates be HBlack colour、HWhite colour (Bai)、HAsh ofThe reflectivity of the sample to be measured is HSample to be testedCalculating to obtain the difference C between the reflectivity of the black, white and gray calibration plates and the reflectivity of the sample to be measuredBlack colour、CWhite colour (Bai)、CAsh ofComprises the following steps:

correcting the complex value spectrum data by adopting a black, white and gray calibration plate together, wherein the spectrum correction formula is as follows: t ═ aTBlack colour+bTWhite colour (Bai)+cTAsh of

Wherein T is complex value correction multiplying factor value, a, b, c are weight coefficients of black, white, grey calibration plate, TBlack colour,TWhite colour (Bai),TAsh ofThe spectrum multiplying power values of the black, white and gray calibration plates;

the values of the weighting coefficients a, b, c are:

the actual principle of collecting spectral data by the diffuse reflection portable near-infrared spectrometer is as follows: near infrared light emitted by the portable near infrared spectrometer is diffusely reflected back to a light receiving sensor of the spectrometer through a calibration plate or the surface of a sample to be detected, and is converted into a light intensity value which can be directly used for analysis through a series of conversions. The smaller the difference between the reflectivity of the calibration plate and the reflectivity of the sample to be measured is, the higher the reliability is, namely the higher the weight coefficient is; the larger the difference between the reflectivity of the calibration plate and the reflectivity of the sample to be measured is, the lower the reliability of the calibration plate is, namely, the smaller the weight coefficient is.

Further, the step D specifically includes:

substituting the spectrum multiplying power values of the black, white and gray calibration plates at each acquisition time point into a spectrum correction formula to obtain the spectrum correction multiplying power values of the black, white and gray calibration plates at the acquisition time points, which specifically comprises the following steps:

Ti=a Tblack i+b TWhite i+c TAsh i

If the original complex value spectrum data at the ith acquisition is Si=(Si1,Si2,……Si(m-1),Sim) Obtaining corrected complex value spectrum data S at the time of the ith acquisition after correction through a spectrum correction formulai′:

The spectrum correction multiplying power values of the black, white and gray calibration plates during the 2 nd to nth acquisition are respectively substituted into a spectrum correction formula, the spectrum correction multiplying power values during the 2 nd to nth acquisition are calculated, and the spectrum data of the sample to be detected during the 2 nd to nth acquisition are combined for calculation to obtain the corrected complex value spectrum data of the sample to be detected at the corresponding time point.

Further, the step E specifically includes:

performing data integration on the reference value spectral data of the sample to be tested and the original complex value obtained in the ith acquisition and performing mathematical modeling to obtain a spectral model M;

integrating the data of the reference value spectrum data of the sample to be tested and the corrected complex value spectrum data corresponding to the ith acquisition, and performing mathematical modeling to obtain a spectrum model M';

and comparing the model correlation coefficients and the root mean square errors of the spectrum models M and M' to judge the quality of the two models.

Further, the specific judgment rule when judging the quality of the two models is as follows: the larger the correlation coefficient of the model is, the better the quality of the model is; the smaller the root mean square error, the better the model quality.

Further, a partial least square method is specifically adopted when modeling is performed in the step E, and actually, other suitable modeling methods can also be adopted.

Further, the preset interval time is 1 day, and can be specifically set according to actual conditions.

Further, one acquisition period is 14 days, and can be set according to actual conditions.

Compared with the prior art, the invention has the following beneficial effects:

the invention relates to a spectral data correction method based on weight coefficients, which comprises the steps of firstly calculating spectral power values of different time points through reference values and complex values of black, white and gray calibration plates, then calculating the weight coefficients of the calibration plates according to the reflectivity relations of the black, white and gray calibration plates and a sample to be detected, further obtaining a spectral correction formula, then correcting the complex value spectral data of the sample to be detected by combining the spectral power values of the black, white and gray calibration plates and the spectral correction formula, finally performing integrated modeling on the reference values of the spectral data of the sample to be detected, the original complex values and the corrected complex values respectively, and judging the quality of two models respectively. The method fully combines the characteristics of the portable near infrared spectrum data, can effectively correct the portable near infrared spectrum data at different time points, further improves the quality of the spectrum model, is easy to implement, and solves the problem that the portable near infrared spectrum data at different time points are difficult to correct to a great extent.

Drawings

Fig. 1 is a flow chart of the method for correcting spectral data based on weighting coefficients according to the present invention.

Detailed Description

The invention will be further elucidated and described with reference to the embodiments of the invention described hereinafter.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于加工前后同步近红外分析的烟草热加工强度及波动性在线监测方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!