CN111125629B - Domain-adaptive PLS regression model modeling method - Google Patents

Domain-adaptive PLS regression model modeling method Download PDF

Info

Publication number
CN111125629B
CN111125629B CN201911353268.2A CN201911353268A CN111125629B CN 111125629 B CN111125629 B CN 111125629B CN 201911353268 A CN201911353268 A CN 201911353268A CN 111125629 B CN111125629 B CN 111125629B
Authority
CN
China
Prior art keywords
matrix
domain
parameter
adopting
regression model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911353268.2A
Other languages
Chinese (zh)
Other versions
CN111125629A (en
Inventor
陈孝敬
黄光造
石文
袁雷明
陈熙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wenzhou University
Original Assignee
Wenzhou University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wenzhou University filed Critical Wenzhou University
Priority to CN201911353268.2A priority Critical patent/CN111125629B/en
Publication of CN111125629A publication Critical patent/CN111125629A/en
Application granted granted Critical
Publication of CN111125629B publication Critical patent/CN111125629B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • G01N21/31Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
    • G01N21/35Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light
    • G01N21/359Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light using near infrared light

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Biochemistry (AREA)
  • Algebra (AREA)
  • Computing Systems (AREA)
  • Immunology (AREA)
  • General Health & Medical Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Pathology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Complex Calculations (AREA)

Abstract

The invention discloses a domain-adaptive PLS regression model modeling method, which comprises the steps of constructing an original domain spectrum centering matrix by adopting near infrared spectrum data acquired from an original domain, constructing a target domain spectrum centering matrix by adopting near infrared spectrum data acquired from a target domain, eliminating the mean difference of spectra of the original domain and the target domain, finding out the optimal projection direction from the original domain spectrum centering matrix and the target domain spectrum centering matrix by adopting a mode of mapping a transfer matrix to a nuclear matrix space based on the original domain spectrum centering matrix and the target domain spectrum centering matrix, determining an optimal projection matrix, constructing and obtaining a final PLS regression model based on the optimal projection matrix, and weakening the projection scores among different domains and the non-independence of domain labels; the method has the advantages that the difference of collected near-infrared spectrum data under different domains is eliminated by adopting a domain adaptive algorithm, and concentration information of a target domain sample is not required to be collected, so that the modeling process is simplified, and the constructed PLS regression model has good prediction precision on the near-infrared spectrum data of the target domain.

Description

Domain-adaptive PLS regression model modeling method
Technical Field
The invention relates to a modeling method of a PLS regression model, in particular to a domain-adaptive modeling method of the PLS regression model.
Background
The near infrared spectrum technology is a simple, rapid and reliable detection technology. The method comprehensively utilizes the research results of multiple subjects such as a spectrum technology, a computer technology, a mode recognition and the like, is increasingly widely applied in multiple fields by using the unique advantages of the research results, and is gradually accepted by the public and officially approved. Near infrared spectroscopy is an indirect analysis method, and a regression model reflecting the relationship between near infrared spectroscopy data and the property of a sample to be analyzed is often required to be constructed. Among them, a Partial Least Squares (PLS) regression model is the most commonly used multiple regression model. The PLS can eliminate noise information in the spectrum matrix and the concentration matrix, and a good prediction effect is obtained.
The modeling method of the existing Partial Least Squares (PLS) regression model in near infrared spectrum analysis comprises the following steps: the method comprises the steps of firstly, collecting near infrared spectrum data and concentration data of a standard sample to construct a corresponding near infrared spectrum data matrix and a concentration vector, then decomposing the near infrared spectrum matrix, determining the optimal principal component number of the near infrared spectrum matrix through a cross verification method, and finally establishing a mathematical model relation between the near infrared spectrum matrix and the concentration vector by utilizing a Partial Least Squares (PLS) regression method.
The conventional Partial Least Squares (PLS) regression model modeling method based on near infrared spectral data requires the acquisition of near infrared spectral data and concentration data of a standard sample. However, with the complication of the application scenario of the near infrared spectrum, the situation that the detection condition or the apparatus itself changes, such as the temperature/humidity change of the sample inspection, the change of the sample form, the aging of the apparatus, and the replacement of accessories, is often encountered, and at this time, the near infrared spectrum data of the collected standard sample often generates absorbance difference and wavelength drift, so that the prediction result of the Partial Least Squares (PLS) regression model constructed based on the data of the original domain (source domain, corresponding to the near infrared spectrum data collected under the condition 1 state) to the data of the target domain (target domain, corresponding to the near infrared spectrum data collected under the condition 2 state) has a large deviation.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a domain-adaptive PLS regression model modeling method, which does not need to acquire concentration information of a target domain sample, simplifies the modeling process, and eliminates the difference of acquired near-infrared spectrum data in different domains by adopting a domain-adaptive algorithm, so that the constructed PLS regression model has good prediction precision on the near-infrared spectrum data of the target domain.
The technical scheme adopted by the invention for solving the technical problems is as follows: a domain-adaptive PLS regression model modeling method comprises the following steps:
step 1, acquiring ns near-red spectrum samples from an original domain, wherein ns is an integer greater than or equal to 5, and constructing by adopting the ns near-red spectrum samples to obtain an original domain near-infrared spectrum data set { x [) sq ,y sq | q =1,2, \8230;, ns }, where x is sq Near-red spectral data for the q sample taken from the original domain, y sq The concentration attribute value of the q sample obtained from the original domain;
acquiring nt near-red spectrum samples from a target domain, wherein nt is an integer greater than or equal to 5, and constructing by adopting the nt near-red spectrum samples to obtain a target domain near-infrared spectrum data set { x tj L j =1,2, \8230 |, nt }, where x tj Is the near infrared spectral data of the jth sample obtained from the target domain; x is the number of sq And x tj Are vectors of 1 row and p columns respectively, and p is collected near-red spectral data x of an original domain sq And target domain near infrared spectral data x tj The number of wavebands of the spectroscopic instrument used;
step 2, adopting near-red spectral data x in the original domain near-infrared spectral data set s1 ~x sns Constructing to obtain an original domain spectrum matrix X,
Figure GDA0002419407730000021
the original domain spectrum matrix X is subjected to centering processing to obtain an original domain spectrum centering matrix, and the method specifically comprises the following steps: calculating the mean value of all data in each row in X, and then subtracting the mean value of all data in the row from each column of data in each row in X to obtain an original domain spectrum centering matrix X s
Near-red spectral data x in target domain near-infrared spectral data set t1 ~x snt Constructing to obtain a target domain spectrum matrix S,
Figure GDA0002419407730000022
the method comprises the following steps of performing centering processing on a target domain spectrum matrix S to obtain a target domain spectrum centering matrix, and specifically comprises the following steps: calculating the average value of all data in each line in S, and then, calculating the number of lines in SSubtracting the average value of all the data of the row from each line of data to obtain a target domain spectrum centering matrix X t
Concentration attribute value y in near infrared spectrum data set of original domain s1 ~y sns Constructing to obtain an original domain concentration vector Y,
Figure GDA0002419407730000031
step 3, designing a kernel function, and recording the kernel functions of the vector x and the vector y as k (x, y), wherein the k (x, y) is expressed by a formula (1):
Figure GDA0002419407730000032
in the formula (1), exp represents an exponential function with a natural logarithm as a base number, | | | | | represents an Euclidean distance between x and y, D represents a kernel parameter, the kernel matrixes corresponding to the two matrixes can be calculated by using the formula (1) and the conventional kernel matrix calculation method, and the kernel matrixes corresponding to the two matrixes Q and D obtained by calculation by using the formula (1) and the conventional kernel matrix calculation method are marked as K (Q, D);
step 4, constructing a category label matrix with m + n rows and m + n columns, wherein m = nt and n = ns, and recording the category label matrix as L, wherein L is expressed by adopting a formula (2):
Figure GDA0002419407730000033
step 5, constructing a transfer matrix, and recording the transfer matrix as X st ,X st Expressed by formula (3):
X st =[X s →X t ] (3)
wherein, X s →X t Representation matrix X s And X t The data in (1) are connected longitudinally in rows;
and 6, constructing an intermediate matrix, and recording the intermediate matrix as H, wherein the H is expressed by a formula (4):
Figure GDA0002419407730000034
/>
where v is the transition matrix X st Number of rows of (I) v×v For a unitary diagonal matrix containing v rows and v columns of elements, 1 v Representing a column vector containing v columns of elements and all elements being 1, the superscript T representing the transpose of the matrix,/representing the division operation sign;
step 7, setting parameter optimization interval d of parameters d, r and A, wherein the parameter optimization interval d belongs to [10 ] -5 ,10 -4 ,…10 4 ,10 5 ],r∈[10 -5 ,10 -4 ,…10 4 ,10 5 ],A∈[1,2,…14,15]Constructing a parameter set [ d, r, A ]]Combining all parameters in the parameter optimization interval of d, r and A to obtain
Figure GDA0002419407730000041
A parameter set [ d, r, A];
Step 8, setting a projection matrix W, and comparing the projection matrix W obtained in step 7
Figure GDA0002419407730000042
Individual parameter set [ d, r, A]Each parameter set [ d, r, A ] in]Calculating the projection matrix W corresponding to each parameter set by respectively adopting a grid optimization method to obtain ^ greater than or equal to>
Figure GDA0002419407730000043
The projection matrix W comprises the following specific processes:
a. judging whether A is equal to 1, and according to the judgment result, performing the following operations:
if A is equal to 1, the following steps are carried out:
a1-1, setting an intermediate parameter KS 1 、Y 1 、KT 1 And B 1 Respectively calculating by using formulas (5) to (8) to obtain an intermediate parameter KS 1 、Y 1 、KT 1 And B 1
KS 1 =K(X s ,X s ) (5)
Y 1 =Y (6)
KT 1 =K(X st ,X s ) (7)
Figure GDA0002419407730000044
In the formula (8), the upper corner symbol T represents matrix transposition, K (X) s ,X s ) Representation matrix X s And matrix X s The corresponding kernel matrix is obtained by calculation by adopting the formula (1) and the conventional kernel matrix calculation method, and K (X) st ,X s ) Representation matrix X st And matrix X s The corresponding kernel matrix is obtained by calculation by adopting a formula (1) and the conventional kernel matrix calculation method;
a1-2, setting an intermediate parameter w 1 A1 to B 1 The eigenvector corresponding to the largest eigenvalue of (a) is assigned to w 1
a1-3, mixing w 1 As using the current parameter set [ d, r, A]Calculating to obtain a projection matrix W;
if A is not equal to 1, the following steps are carried out:
a2-1, calculating according to the step a1-1 to obtain an intermediate parameter KS 1 、Y 1 、KT 1 And B 1
a2-2, obtaining an intermediate parameter w by adopting the method of the step a1-2 1 The intermediate parameter w 1 As the 1 st generation projection matrix, finishing the 1 st generation assignment of the projection matrix;
a2-3, setting an intermediate parameter t1 1 、t2 1 、p1 1 、p2 1 And c 1 Calculating to obtain an intermediate parameter t1 by using the formulas (9) to (13) 1 、t2 1 、p1 1 、p2 1 And c 1
t1 1 =KS 1 w 1 (9)
t2 1 =KT 1 w 1 (10)
Figure GDA0002419407730000051
Figure GDA0002419407730000052
Figure GDA0002419407730000053
Wherein, the upper corner mark-1 represents matrix inversion, and the upper corner mark T represents the transposition of the matrix;
a2-4, setting an algebraic variable i, initializing i, and enabling i to be equal to 2;
a2-5, carrying out ith generation assignment on the projection matrix, specifically:
s1, setting an intermediate parameter KS i 、KT i 、Y i And B i Calculating the intermediate parameter KS by using the formula (14) to the formula (17) i 、KT i 、Y i And B i
Figure GDA0002419407730000054
Figure GDA0002419407730000055
Y i =Y i-1 -c i t1 i-1 (16)
Figure GDA0002419407730000056
S2, setting an intermediate parameter w i A1 to B i The eigenvector corresponding to the largest eigenvalue of (a) is assigned to w i W is to be i As the ith generation projection matrix, finishing the ith generation assignment of the projection matrix;
s3, setting an intermediate parameter t1 i 、t2 i 、p1 i 、p2 i And c i Calculating to obtain the intermediate parameter t1 by adopting the formulas (18) to (22) i 、t2 i 、p1 i 、p2 i And c i c 1
t1 i =KS i w i (18)
t2 i =KT i w i (19)
Figure GDA0002419407730000057
Figure GDA0002419407730000061
Figure GDA0002419407730000062
S4, judging whether the value of i is equal to A or not, if not, adding 1 to the current value of i and updating the value of i, returning to the step S1 to carry out next generation assignment of the projection matrix, and if the value of i is equal to A, entering the step a2-6;
step a2-6, obtaining w 1 To w A After being connected in sequence and transversely according to columns, the parameter group [ d, r, A ] at this time is used]Calculated projection matrix, W = [ W = 1 ,…,w A ];
Step 9, setting an intermediate variable T s And T t The product obtained in step 8
Figure GDA0002419407730000063
The projection matrixes W are respectively substituted into formulas (23) and (24) to be calculated, and the result is ^ greater or less than or equal to>
Figure GDA0002419407730000064
An intermediate variable T s And &>
Figure GDA0002419407730000065
An intermediate variable T t
T s =K(X s ,X s )W (23)
T t =K(X xt ,X s )W (24)
Step 10, obtaining step 9
Figure GDA0002419407730000066
An intermediate variable T s Respectively as independent variable and Y as dependent variable to obtain
Figure GDA0002419407730000067
And the data matrix is composed of independent variables and dependent variables.
Step 11, constructing a PLS regression model by a 5-fold cross validation method to obtain
Figure GDA0002419407730000068
The PLS regression model specifically comprises: will adopt>
Figure GDA0002419407730000069
An intermediate variable T s Based on a dependent variable Y>
Figure GDA00024194077300000610
The data matrix composed of independent variables and dependent variables is divided into 5 parts at random, and 4 parts are selected at random and constructed by adopting a cross validation method to obtain
Figure GDA00024194077300000611
A PLS regression model;
step 12, the product obtained in step 9
Figure GDA00024194077300000612
An intermediate variable T t Combined as test data with the argument in the remaining part 1 as argument for the->
Figure GDA00024194077300000613
Testing each PLS regression model for 4 times in succession to obtain the prediction result in the dependent variable Y of each PLS regression model>
Figure GDA00024194077300000614
And X t Prediction result of the corresponding dependent variable>
Figure GDA00024194077300000615
Wherein the predicted result->
Figure GDA00024194077300000616
Derived by an argument in the remaining 1 part, prediction result->
Figure GDA00024194077300000617
By means of intermediate variables T as arguments t Obtaining;
step 13, defining a PLS regression model optimization objective function, wherein the optimization objective function is expressed by an equation (25):
Figure GDA0002419407730000071
/>
in the formula (25), mean represents the Mean value of the solved vector, std represents the standard deviation of the solved vector, and | represents the symbol of taking the absolute value;
step 14, the dependent variable Y and the prediction result corresponding to each PLS regression model
Figure GDA0002419407730000072
And prediction result>
Figure GDA0002419407730000073
Respectively substituting the values into an equation (25) for calculation to obtain the value of f corresponding to each PLS regression model;
step 15, comparing all the values of f obtained in step 14, and corresponding the f with the minimum value to a group [ d, r, A ]]Calculating to obtain a corresponding projection matrix by adopting the method of the step 8, and taking the projection matrix as an optimal projection matrix and marking as W op Setting the optimum independent variable and marking it as T sop By means of T sop =K(X s ,X s )W op Calculating to obtain T sop In terms of T sop A final PLS regression model was constructed with Y as the dependent variable.
Compared with the prior art, the method has the advantages that the original domain spectrum centering matrix is constructed by adopting the near infrared spectrum data acquired from the original domain, the target domain spectrum centering matrix is constructed by adopting the near infrared spectrum data acquired from the target domain, the mean difference of the original domain spectrum and the target domain spectrum is eliminated, then the optimal projection direction is found out by adopting the mode that the transfer matrix is mapped to the nuclear matrix space based on the original domain spectrum centering matrix and the target domain spectrum centering matrix, the optimal projection matrix is determined, the final PLS regression model is constructed based on the optimal projection matrix, and therefore the projection scores and the non-independence of domain labels between different domains are weakened.
Detailed Description
The present invention will be described in further detail with reference to examples.
The embodiment is as follows: a domain-adaptive PLS regression model modeling method comprises the following steps:
step 1, acquiring ns near-red light spectrum samples from an original domain, wherein ns is an integer greater than or equal to 5, and constructing by adopting the ns near-red light spectrum samples to obtain an original domain near-infrared spectrum data set { x } sq ,y sq | q =1,2, \8230;, ns }, where x is sq Near-red spectral data for the q sample taken from the original domain, y sq The concentration attribute value of the q sample obtained from the original domain;
acquiring nt near-red spectrum samples from a target domain, wherein nt is an integer greater than or equal to 5, and constructing by adopting the nt near-red spectrum samples to obtain a target domain near-infrared spectrum data set { x [) tj L j =1,2, \8230;, nt }, where x tj Is the near infrared spectral data of the jth sample obtained from the target domain; x is the number of sq And x tj Respectively 1 row and p columns of vectors, p is the collected near-red spectral data x of the original domain sq And target domain near infrared spectral data x tj To makeThe number of bands of the spectroscopic instrument used;
step 2, adopting near-red spectral data x in the original domain near-infrared spectral data set s1 ~x sns Constructing to obtain an original domain spectrum matrix X,
Figure GDA0002419407730000081
the original domain spectrum matrix X is subjected to centering processing to obtain an original domain spectrum centering matrix, and the method specifically comprises the following steps: calculating the mean value of all data in each row in X, and then subtracting the mean value of all data in the row from each column of data in each row in X to obtain an original domain spectrum centering matrix X s
Near-red spectral data x in target domain near-infrared spectral data set t1 ~x snt Constructing and obtaining a target domain spectrum matrix S,
Figure GDA0002419407730000082
the method comprises the following steps of performing centering processing on a target domain spectrum matrix S to obtain a target domain spectrum centering matrix, and specifically comprises the following steps: calculating the mean value of all data in each row in the S, and then subtracting the mean value of all data in each row from each line of data in each row in the S to obtain a target domain spectrum centering matrix X t ;/>
Concentration attribute value y in original domain near infrared spectrum data set s1 ~y sns Constructing to obtain an original domain concentration vector Y,
Figure GDA0002419407730000083
step 3, designing a kernel function, and marking the kernel functions of the vector x and the vector y as k (x, y), wherein the k (x, y) is expressed by a formula (1):
Figure GDA0002419407730000084
in the formula (1), exp represents an exponential function with a natural logarithm as a base number, | | | | | represents an Euclidean distance between x and y, D represents a kernel parameter, the kernel matrixes corresponding to the two matrixes can be calculated by using the formula (1) and the conventional kernel matrix calculation method, and the kernel matrixes corresponding to the two matrixes Q and D obtained by calculation by using the formula (1) and the conventional kernel matrix calculation method are marked as K (Q, D);
step 4, constructing a category label matrix with m + n rows and m + n columns, wherein m = nt and n = ns, and recording the category label matrix as L, wherein L is expressed by adopting a formula (2):
Figure GDA0002419407730000091
step 5, constructing a transfer matrix, and marking the transfer matrix as X st ,X st Expressed by formula (3):
X st =[X s →X t ] (3)
wherein, X s →X t Representation matrix X s And X t The data in (1) are connected longitudinally in rows;
and 6, constructing an intermediate matrix, and recording the intermediate matrix as H, wherein the H is expressed by a formula (4):
Figure GDA0002419407730000092
where v is the transition matrix X st Number of rows of (I) v×v For a unity diagonal matrix containing v rows and v columns of elements, 1 v Representing a column vector containing v columns of elements, all the elements being 1, the superscript T representing the transpose of the matrix,/representing a division operator;
step 7, setting parameter optimization interval d of parameters d, r and A, wherein the parameter optimization interval d belongs to [10 ] -5 ,10 -4 ,…10 4 ,10 5 ],r∈[10 -5 ,10 -4 ,…10 4 ,10 5 ],A∈[1,2,…14,15]Constructing a parameter set [ d, r, A ]]Combining all parameters in the parameter optimization interval of d, r and A to obtain
Figure GDA0002419407730000093
Individual parameter set [ d, r, A];
Step 8, setting a projection matrix W, for the stepObtained in step 7
Figure GDA0002419407730000094
Individual parameter set [ d, r, A]Each parameter set [ d, r, A ] in]Calculating projection matrix W corresponding to each parameter set by respectively adopting a grid optimization method to obtain->
Figure GDA0002419407730000095
The projection matrix W comprises the following specific processes:
a. judging whether A is equal to 1, and according to the judgment result, performing the following operations:
if A is equal to 1, the following steps are carried out:
a1-1, setting an intermediate parameter KS 1 、Y 1 、KT 1 And B 1 Respectively calculating by using formulas (5) to (8) to obtain an intermediate parameter KS 1 、Y 1 、KT 1 And B 1
KS 1 =K(X s ,X s ) (5)
Y 1 =Y (6)
KT 1 =K(X st ,X s ) (7)
Figure GDA0002419407730000101
In the formula (8), the upper corner mark T represents matrix transposition, K (X) s ,X s ) Representation matrix X s And matrix X s The corresponding kernel matrix is obtained by calculation by adopting the formula (1) and the conventional kernel matrix calculation method, and K (X) st ,X s ) Representation matrix X st And matrix X s The corresponding kernel matrix is obtained by calculation by adopting a formula (1) and the conventional kernel matrix calculation method;
a1-2, setting an intermediate parameter w 1 B is to be 1 The eigenvector corresponding to the largest eigenvalue of (a) is assigned to w 1
a1-3, mixing w 1 As using the current parameter set [ d, r, A]Calculating to obtain a projection matrix W;
if A is not equal to 1, the following steps are carried out:
a2-1, calculating according to the step a1-1 to obtain an intermediate parameter KS 1 、Y 1 、KT 1 And B 1
a2-2, obtaining the intermediate parameter w by adopting the method of the step a1-2 1 The intermediate parameter w 1 As the 1 st generation projection matrix, finishing the 1 st generation assignment of the projection matrix;
a2-3, setting an intermediate parameter t1 1 、t2 1 、p1 1 、p2 1 And c 1 Calculating to obtain an intermediate parameter t1 by using the formulas (9) to (13) 1 、t2 1 、p1 1 、p2 1 And c 1
t1 1 =KS 1 w 1 (9)
t2 1 =KT 1 w 1 (10)
Figure GDA0002419407730000102
Figure GDA0002419407730000103
Figure GDA0002419407730000104
Wherein, the upper corner mark-1 represents matrix inversion, and the upper corner mark T represents the transposition of the matrix;
a2-4, setting an algebraic variable i, initializing i, and enabling i to be equal to 2;
a2-5, carrying out ith generation assignment on the projection matrix, specifically:
s1, setting an intermediate parameter KS i 、KT i 、Y i And B i Calculating by using the formulas (14) to (17) to obtain an intermediate parameter KS i 、KT i 、Y i And B i
Figure GDA0002419407730000111
Figure GDA0002419407730000112
Y i =Y i-1 -c i t1 i-1 (16)
Figure GDA0002419407730000113
S2, setting an intermediate parameter w i A1 to B i The eigenvector corresponding to the largest eigenvalue of (a) is assigned to w i W is to be i As the ith generation projection matrix, finishing the ith generation assignment of the projection matrix;
s3, setting an intermediate parameter t1 i 、t2 i 、p1 i 、p2 i And c i Calculating intermediate parameter t1 by using equations (18) to (22) i 、t2 i 、p1 i 、p2 i And c i c 1
t1 i =KS i w i (18)
t2 i =KT i w i (19)
Figure GDA0002419407730000114
/>
Figure GDA0002419407730000115
Figure GDA0002419407730000116
S4, judging whether the value of i is equal to A or not, if not, adding 1 to the current value of i and updating the value of i, returning to the step S1 to carry out next generation assignment of the projection matrix, and if the value of i is equal to A, entering the step a2-6;
step a2-6, obtaining w 1 To w A After being connected in series and transversely, the parameter group [ d, r, A ] of this time is used]Calculated projection matrix, W = [) 1 ,…,w A ];
Step 9, setting an intermediate variable T s And T t The product obtained in step 8
Figure GDA0002419407730000117
The projection matrixes W are respectively substituted into formulas (23) and (24) to be calculated, and the result is ^ greater or less than or equal to>
Figure GDA0002419407730000118
An intermediate variable T s And &>
Figure GDA0002419407730000119
An intermediate variable T t
T s =K(X s ,X s )W (23)
T t =K(X xt ,X s )W (24)
Step 10, obtaining step 9
Figure GDA0002419407730000121
An intermediate variable T s Respectively as independent variable and Y as dependent variable to obtain
Figure GDA0002419407730000122
And the data matrix is composed of independent variables and dependent variables.
Step 11, constructing a PLS regression model by a 5-fold cross validation method to obtain
Figure GDA0002419407730000123
The PLS regression model specifically comprises: will adopt>
Figure GDA0002419407730000124
An intermediate variable T s Obtained respectively as independent variable and Y as dependent variable>
Figure GDA0002419407730000125
The data matrix composed of independent variables and dependent variables is divided into 5 parts at random, 4 parts are randomly selected and constructed by adopting a cross validation method to obtain
Figure GDA0002419407730000126
A PLS regression model; the 5-fold cross validation method is one of the current mature methods for constructing the PLS regression model;
step 12, the product obtained in step 9
Figure GDA0002419407730000127
An intermediate variable T t Combined as test data with the argument in the remaining part 1 as argument for the->
Figure GDA0002419407730000128
Testing the PLS regression models for 4 times to obtain the prediction result of the dependent variable Y of each PLS regression model>
Figure GDA0002419407730000129
And X t Prediction result of the corresponding dependent variable>
Figure GDA00024194077300001210
Wherein the prediction result +>
Figure GDA00024194077300001211
The prediction result is obtained by the argument in the remaining part 1, the prediction result->
Figure GDA00024194077300001212
By means of intermediate variables T as arguments t Obtaining;
step 13, defining a PLS regression model optimization objective function, wherein the optimization objective function is expressed by an equation (25):
Figure GDA00024194077300001213
in the formula (25), mean represents the Mean value of the vector, std represents the standard deviation of the vector, and | | represents the symbol of taking the absolute value;
step 14, the dependent variable Y and the prediction result corresponding to each PLS regression model are calculated
Figure GDA00024194077300001214
And predicting a result->
Figure GDA00024194077300001215
Respectively substituting into an equation (25) for calculation to obtain a value of f corresponding to each PLS regression model;
step 15, comparing all the values of f obtained in step 14, and corresponding the f with the minimum value to a group [ d, r, A ]]Calculating to obtain a corresponding projection matrix by adopting the method of the step 8, and taking the projection matrix as an optimal projection matrix and marking as W op Setting the optimum independent variable and marking it as T sop By means of T sop =K(X s ,X s )W op Calculating to obtain T sop With T sop A final PLS regression model was constructed with Y as the dependent variable.
When the domain self-adaptive PLS regression model modeling method is adopted to test the test sample, the corresponding near infrared spectrum x of the test sample is obtained t X is to t As a one-dimensional matrix, an independent variable parameter T is set t By using T t =K(x t ,X s )W op Calculating to obtain T t Then T is added t Substituting the constructed PLS model as an independent variable to obtain x t The predicted result of the corresponding dependent variable.

Claims (1)

1. A domain-adaptive PLS regression model modeling method is characterized by comprising the following steps:
step 1, acquiring ns near-red spectrum samples from an original domain, wherein ns is an integer greater than or equal to 5, and constructing by adopting the ns near-red spectrum samples to obtain an original domain near-infrared spectrum data set { x [) sq ,y sq | q =1,2, \8230;, ns }, where x is sq Near-red spectral data for the q sample taken from the original domain, y sq The concentration attribute value of the q sample obtained from the original domain;
acquiring nt near-red spectrum samples from a target domain, wherein nt is an integer greater than or equal to 5, and constructing by adopting the nt near-red spectrum samples to obtain a target domain near-infrared spectrum data set { x [) tj L j =1,2, \8230;, nt }, where x tj Is the near infrared spectral data of the jth sample obtained from the target domain; x is the number of sq And x tj Are vectors of 1 row and p columns respectively, and p is collected near-red spectral data x of an original domain sq And target domain near infrared spectral data x tj The number of wavebands of the spectroscopic instrument used;
step 2, adopting near-red spectral data x in the original domain near-infrared spectral data set s1 ~x sns Constructing to obtain an original domain spectrum matrix X,
Figure QLYQS_1
the original domain spectrum matrix X is subjected to centering processing to obtain an original domain spectrum centering matrix, and the method specifically comprises the following steps: calculating the mean value of all data in each row in X, and then subtracting the mean value of all data in the row from each column of data in each row in X to obtain an original domain spectrum centering matrix X s
Near-red spectral data x in target domain near-infrared spectral data set t1 ~x snt Constructing and obtaining a target domain spectrum matrix S,
Figure QLYQS_2
the method comprises the following steps of performing centering processing on a target domain spectrum matrix S to obtain a target domain spectrum centering matrix, and specifically comprises the following steps: calculating the mean value of all data in each row in the S, and then subtracting the mean value of all data in each row from each line of data in each row in the S to obtain a target domain spectrum centering matrix X t
Concentration attribute value y in near infrared spectrum data set of original domain s1 ~y sns Constructing to obtain an original domain concentration vector Y,
Figure QLYQS_3
step 3, designing a kernel function, and marking the kernel functions of the vector x and the vector y as k (x, y), wherein the k (x, y) is expressed by a formula (1):
Figure QLYQS_4
in the formula (1), exp represents an exponential function with a natural logarithm as a base number, | | | | | represents an Euclidean distance between x and y, D represents a kernel parameter, the kernel matrixes corresponding to the two matrixes can be calculated by using the formula (1) and the conventional kernel matrix calculation method, and the kernel matrixes corresponding to the two matrixes Q and D obtained by calculation by using the formula (1) and the conventional kernel matrix calculation method are marked as K (Q, D);
step 4, constructing a category label matrix with m + n rows and m + n columns, wherein m = nt, n = ns, and recording the category label matrix as L, wherein L is expressed by adopting a formula (2):
Figure QLYQS_5
step 5, constructing a transfer matrix, and marking the transfer matrix as X st ,X st Expressed by formula (3):
X st =[X s →X t ] (3)
wherein, X s →X t Representation matrix X s And X t The data in (2) are connected longitudinally in rows;
and 6, constructing an intermediate matrix, and recording the intermediate matrix as H, wherein the H is expressed by a formula (4):
Figure QLYQS_6
where v is the transition matrix X st Number of lines of (I) v×v For a unitary diagonal matrix containing v rows and v columns of elements, 1 v Representing a column vector containing v columns of elements, all elements being 1, with superscriptsT represents the transpose of the matrix,/represents the division operation symbol;
step 7, setting parameter optimization interval d of parameters d, r and A, wherein the parameter optimization interval d belongs to [10 ] -5 ,10 -4 ,…10 4 ,10 5 ],r∈[10 -5 ,10 -4 ,…10 4 ,10 5 ],A∈[1,2,…14,15]Constructing the parameter set [ d, r, A ]]Combining all parameters in the parameter optimization interval of d, r and A to obtain
Figure QLYQS_7
A parameter set [ d, r, A];
Step 8, setting a projection matrix W, and comparing the projection matrix W obtained in step 7
Figure QLYQS_8
A parameter set [ d, r, A]Each parameter set [ d, r, A ] in]Calculating the projection matrix W corresponding to each parameter set by respectively adopting a grid optimization method to obtain ^ greater than or equal to>
Figure QLYQS_9
The projection matrix W comprises the following specific processes:
a. judging whether A is equal to 1, and according to the judgment result, performing the following operations:
if A is equal to 1, the following steps are carried out:
a1-1, setting an intermediate parameter KS 1 、Y 1 、KT 1 And B 1 Respectively calculating by using formulas (5) to (8) to obtain an intermediate parameter KS 1 、Y 1 、KT 1 And B 1
KS 1 =K(X s ,X s ) (5)
Y 1 =Y (6)
KT 1 =K(X st ,X s ) (7)
Figure QLYQS_10
In the formula (8), the upper corner symbol T represents matrix transposition, K (X) s ,X s ) Representation matrix X s And matrix X s The corresponding kernel matrix is obtained by calculation by adopting the formula (1) and the conventional kernel matrix calculation method, and K (X) st ,X s ) Representation matrix X st And matrix X s The corresponding kernel matrix is obtained by calculation by adopting a formula (1) and the conventional kernel matrix calculation method;
a1-2, setting an intermediate parameter w 1 A1 to B 1 Is assigned to w 1
a1-3, mixing w 1 As using the current parameter set [ d, r, A]Calculating to obtain a projection matrix W;
if A is not equal to 1, the following steps are carried out:
a2-1, calculating according to the step a1-1 to obtain an intermediate parameter KS 1 、Y 1 、KT 1 And B 1
a2-2, obtaining the intermediate parameter w by adopting the method of the step a1-2 1 The intermediate parameter w 1 As the 1 st generation projection matrix, finishing the 1 st generation assignment of the projection matrix;
a2-3, setting an intermediate parameter t1 1 、t2 1 、p1 1 、p2 1 And c 1 Calculating to obtain an intermediate parameter t1 by using the formulas (9) to (13) 1 、t2 1 、p1 1 、p2 1 And c 1
t1 1 =KS 1 w 1 (9)
t2 1 =KT 1 w 1 (10)
Figure QLYQS_11
Figure QLYQS_12
Figure QLYQS_13
/>
Wherein, the upper corner mark-1 represents matrix inversion, and the upper corner mark T represents the transposition of the matrix;
a2-4, setting an algebraic variable i, initializing i, and enabling i to be equal to 2;
a2-5, carrying out ith generation assignment on the projection matrix, specifically:
s1, setting an intermediate parameter KS i 、KT i 、Y i And B i Calculating by using the formulas (14) to (17) to obtain an intermediate parameter KS i 、KT i 、Y i And B i
Figure QLYQS_14
Figure QLYQS_15
Y i =Y i-1 -c i t1 i-1 (16)
Figure QLYQS_16
S2, setting an intermediate parameter w i A1 to B i Is assigned to w i W is to be i As the ith generation projection matrix, finishing the ith generation assignment of the projection matrix;
s3, setting an intermediate parameter t1 i 、t2 i 、p1 i 、p2 i And c i Calculating intermediate parameter t1 by using equations (18) to (22) i 、t2 i 、p1 i 、p2 i And c i c 1
t1 i =KS i w i (18)
t2 i =KT i w i (19)
Figure QLYQS_17
Figure QLYQS_18
Figure QLYQS_19
S4, judging whether the value of i is equal to A or not, if not, adopting the current value of i plus 1 and updating the value of i, returning to the step S1 for next generation assignment of the projection matrix, and if the value of i is equal to A, entering the step a2-6;
step a2-6, obtaining w 1 To w A After being connected in series and transversely, the parameter group [ d, r, A ] of this time is used]Calculated projection matrix, W = [) 1 ,…,w A ];
Step 9, setting an intermediate variable T s And T t The product obtained in step 8
Figure QLYQS_20
The projection matrixes W are respectively substituted into formulas (23) and (24) to be calculated, and the result is ^ greater or less than or equal to>
Figure QLYQS_21
An intermediate variable T s And &>
Figure QLYQS_22
An intermediate variable T t
T s =K(X s ,X s )W (23)
T t =K(X xt ,X s )W (24)
Step 10, obtaining step 9
Figure QLYQS_23
An intermediate variable T s Respectively as independent variable and Y as dependent variable, get ^ 5>
Figure QLYQS_24
A data matrix composed of independent variables and dependent variables;
step 11, constructing a PLS regression model through a 5-fold cross validation method to obtain
Figure QLYQS_25
The PLS regression model specifically comprises: will adopt>
Figure QLYQS_26
An intermediate variable T s Based on a dependent variable Y>
Figure QLYQS_27
The data matrix composed of independent variables and dependent variables is divided into 5 parts at random, and 4 parts are selected at random and constructed by adopting a cross validation method to obtain
Figure QLYQS_28
A PLS regression model;
step 12, the product obtained in the step 9
Figure QLYQS_29
An intermediate variable T t Combined as test data with the argument in the remaining part 1 as argument for the->
Figure QLYQS_30
Testing each PLS regression model for 4 times in succession to obtain the prediction result in the dependent variable Y of each PLS regression model>
Figure QLYQS_31
And X t Prediction result of the corresponding dependent variable>
Figure QLYQS_32
Wherein the prediction result +>
Figure QLYQS_33
The prediction result is obtained by the argument in the remaining part 1, the prediction result->
Figure QLYQS_34
By means of intermediate variables T as arguments t Obtaining;
step 13, defining a PLS regression model optimization objective function, wherein the optimization objective function is expressed by an equation (25):
Figure QLYQS_35
in the formula (25), mean represents the Mean value of the vector, std represents the standard deviation of the vector, and | | represents the symbol of taking the absolute value;
step 14, the dependent variable Y and the prediction result corresponding to each PLS regression model
Figure QLYQS_36
And predicting a result->
Figure QLYQS_37
Respectively substituting into an equation (25) for calculation to obtain a value of f corresponding to each PLS regression model;
step 15, comparing all the values of f obtained in step 14, and corresponding the f with the minimum value to a group [ d, r, A ]]Calculating to obtain a corresponding projection matrix by adopting the method of the step 8, and taking the projection matrix as an optimal projection matrix and marking as W op Setting the optimum independent variable and marking it as T sop By using T sop =K(X s ,X s )W op Calculating to obtain T sop With T sop A final PLS regression model was constructed using Y as the dependent variable as the independent variable.
CN201911353268.2A 2019-12-25 2019-12-25 Domain-adaptive PLS regression model modeling method Active CN111125629B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911353268.2A CN111125629B (en) 2019-12-25 2019-12-25 Domain-adaptive PLS regression model modeling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911353268.2A CN111125629B (en) 2019-12-25 2019-12-25 Domain-adaptive PLS regression model modeling method

Publications (2)

Publication Number Publication Date
CN111125629A CN111125629A (en) 2020-05-08
CN111125629B true CN111125629B (en) 2023-04-07

Family

ID=70502473

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911353268.2A Active CN111125629B (en) 2019-12-25 2019-12-25 Domain-adaptive PLS regression model modeling method

Country Status (1)

Country Link
CN (1) CN111125629B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112069450A (en) * 2020-10-07 2020-12-11 武汉筑信科技有限公司 Multi-object structural equation model calculation technology based on interactive projection between convex sets
CN114611582B (en) * 2022-02-16 2024-05-14 温州大学 Method and system for analyzing substance concentration based on near infrared spectrum technology

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101832909A (en) * 2010-03-12 2010-09-15 江苏大学 Selection method for subintervals of near infrared spectral characteristics based on simulated annealing-genetic algorithm
CN102928382A (en) * 2012-11-12 2013-02-13 江苏大学 Near-infrared spectral characteristic wavelength selecting method based on improved simulated annealing algorithm
CN103308463A (en) * 2013-06-28 2013-09-18 中国农业大学 Characteristic spectrum area selection method for near infrared spectrum
CN104063710A (en) * 2014-06-13 2014-09-24 武汉理工大学 Method for removing abnormal spectrum in actual measurement spectrum curve based on support vector machine model
CN104091089A (en) * 2014-07-28 2014-10-08 温州大学 Infrared spectrum data PLS modeling method
CN104237158A (en) * 2014-09-04 2014-12-24 浙江科技学院 Near infrared spectrum qualitative analysis method with universality
CN104376325A (en) * 2014-10-30 2015-02-25 中国科学院半导体研究所 Method for building near-infrared qualitative analysis model
CN107064054A (en) * 2017-02-28 2017-08-18 浙江大学 A kind of near-infrared spectral analytical method based on CC PLS RBFNN Optimized models
CN108593592A (en) * 2018-04-19 2018-09-28 广东药科大学 A kind of tuber of pinellia based on near-infrared spectrum technique mixes pseudo- discrimination method
CN109145403A (en) * 2018-07-31 2019-01-04 温州大学 A kind of near infrared spectrum modeling method based on sample common recognition

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101832909A (en) * 2010-03-12 2010-09-15 江苏大学 Selection method for subintervals of near infrared spectral characteristics based on simulated annealing-genetic algorithm
CN102928382A (en) * 2012-11-12 2013-02-13 江苏大学 Near-infrared spectral characteristic wavelength selecting method based on improved simulated annealing algorithm
CN103308463A (en) * 2013-06-28 2013-09-18 中国农业大学 Characteristic spectrum area selection method for near infrared spectrum
CN104063710A (en) * 2014-06-13 2014-09-24 武汉理工大学 Method for removing abnormal spectrum in actual measurement spectrum curve based on support vector machine model
CN104091089A (en) * 2014-07-28 2014-10-08 温州大学 Infrared spectrum data PLS modeling method
CN104237158A (en) * 2014-09-04 2014-12-24 浙江科技学院 Near infrared spectrum qualitative analysis method with universality
CN104376325A (en) * 2014-10-30 2015-02-25 中国科学院半导体研究所 Method for building near-infrared qualitative analysis model
CN107064054A (en) * 2017-02-28 2017-08-18 浙江大学 A kind of near-infrared spectral analytical method based on CC PLS RBFNN Optimized models
CN108593592A (en) * 2018-04-19 2018-09-28 广东药科大学 A kind of tuber of pinellia based on near-infrared spectrum technique mixes pseudo- discrimination method
CN109145403A (en) * 2018-07-31 2019-01-04 温州大学 A kind of near infrared spectrum modeling method based on sample common recognition

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Yasheng Wang 等.Improved PLS regression based on SVM classification for rapid analysis of coal properties by near-infrared reflectance spectroscopy.《Sensors and Actuators B Chemical》.2014,723-729. *
张红光.近红外光谱新型建模方法与应用基础研究.《中国博士学位论文全文数据库 基础科学辑》.2016,A005-32. *
成忠 等.快速稳健偏最小二乘回归及其在近红外光谱分析中的应用.《光谱学与光谱分析》.2006,1046-1050. *

Also Published As

Publication number Publication date
CN111125629A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
Bouveresse et al. Two novel methods for the determination of the number of components in independent components analysis models
Hazama et al. Covariance-based locally weighted partial least squares for high-performance adaptive modeling
Bai et al. Accurate prediction of soluble solid content of apples from multiple geographical regions by combining deep learning with spectral fingerprint features
Wehrens Chemometrics with R
WO1993021592A1 (en) Improved method for interpreting complex data and detecting abnormal instrument or process behavior
CN106596450B (en) Incremental method based on infrared spectrum analysis material component content
CN111125629B (en) Domain-adaptive PLS regression model modeling method
CN113705092B (en) Disease prediction method and device based on machine learning
CN112129741A (en) Insulating oil aging analysis method and device, computer equipment and storage medium
CN105103166A (en) Systems and methods for texture assessment of a coating formulation
JP7076463B2 (en) Spectrum analyzer and spectrum analysis method
US8831316B2 (en) Point source detection
CN110308713A (en) A kind of industrial process failure identification variables method based on k neighbour reconstruct
CN114943674A (en) Defect detection method, electronic device and storage medium
CN115713634A (en) Color collocation evaluation method combining similarity measurement and visual perception
CN110648763A (en) Method and apparatus for tumor assessment using artificial intelligence for spectral analysis
CN116994117A (en) Training method, device, equipment and storage medium of target spectrum analysis model
CN114611582A (en) Method and system for analyzing substance concentration based on near infrared spectrum technology
CN102906851B (en) Analyze mass spectrographic method and system
CN109145403B (en) Near infrared spectrum modeling method based on sample consensus
CN115541531A (en) Method for predicting protein content in feed based on two-dimensional correlation spectrum
CN111220565B (en) CPLS-based infrared spectrum measuring instrument calibration migration method
Kalivas Data fusion of nonoptimized models: applications to outlier detection, classification, and image library searching
CN110632024B (en) Quantitative analysis method, device and equipment based on infrared spectrum and storage medium
Cocchi et al. Chemometrics–Bioinformatics

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant