## 2 Monitoring Model Based on Statistical Process Control  
### Offline Modeling Based on K-PLS Algorithm  
In the process of multivariate statistical monitoring, the data are standardized first. Process variables and quality variables are represented by \(\mathbf{X}=\mathbf{R}^{n\times m}\) and \(\mathbf{Y}=\mathbf{R}^{n\times l}\), where \(n\) represents the number of sampling points, and \(m\) and \(l\) represent the number of variables. The mean and variance of statistical data are used to normalize the original data to eliminate the influence of dimension on the monitoring process. After standardizing the data, the mean value of each vector is 0, and the variance is 1. The variables were processed by PLS to form the latent score matrix. The latent score vectors of process variables and quality variables are represented by \(\mathbf{t}_{i}\) and \(\mathbf{u}_{i}\), where \(i\) represents the number of latent variables (also called principal components, \(i=1,2,\ldots,A\)). In order to realize the algorithm idea of PLS, it is required to maximize the covariance of \(\mathbf{t}_{i}\) and \(\mathbf{u}_{i}\). \[\max\{Cov(\mathbf{t}_{i},\mathbf{u}_{i})\}=\max\mathbf{X}_{i-1}\mathbf{w}_{i},Y_{i-1}\mathbf{c}_{i} \tag{1}\]  
The Lagrange multiplier method is used to solve the equation as follows:  
\[\left\{ \begin{array}{l}\mathbf{X}_{i-1}^{\Gamma}\mathbf{Y}_{i-1}\mathbf{Y}_{i-1}^{\Gamma }\mathbf{X}_{i-1}=\mathbf{\lambda}_{i}\mathbf{w}_{i}\\ \mathbf{Y}_{i-1}^{\Gamma}\mathbf{X}_{i-1}\mathbf{X}_{i-1}^{\Gamma}\mathbf{Y}_{i-1}=\mathbf{\lambda }_{i}\mathbf{c}_{i}\end{array} \right. \tag{2}\]  
where \(\mathbf{w}_{i}\) is the unit eigenvector of the input matrix, \(||\mathbf{w}_{i}||=1\). \(\mathbf{c}_{i}\) is the unit eigenvector of the output matrix, \(||\mathbf{c}_{i}||=1\). \(\mathbf{\lambda}_{i}\) is the eigenvalue of the vector. The training process is as follows:  
1. Collect and standardize training sample data \(\mathbf{X}\) and \(\mathbf{Y}\), initialize \(\mathbf{u}_{i}\) and set \(i=1\). 2. The projection direction \(\mathbf{w}_{i}\) of the process variable is calculated according to the given score vector of the quality matrix; the latent score vector \(\mathbf{t}_{i}\) is obtained; then invert the latent score vector \(\mathbf{u}_{i}\) of the quality matrix and iterate until the score vector converges. 3. Calculate the residual matrix of the process variable and quality variable. \[\left\{ \begin{array}{l}\mathbf{X}_{i}=\mathbf{X}_{i-1}-\mathbf{t}_{i}\mathbf{p}_{i}^{\mathrm{ T}}\\ \mathbf{Y}_{i}=\mathbf{Y}_{i-1}-\mathbf{u}_{i}\mathbf{q}_{i}^{\mathrm{T}}\end{array} \right.\] (3) where \(\mathbf{p}_{i}\) is the input load vector, \(\mathbf{p}_{i}=\frac{\mathbf{x}_{i-1}^{\mathrm{T}}\mathbf{t}_{i}}{||\mathbf{t}_{i}||^{2}}\). \(\mathbf{q}_{i}\) is the output load vector, \(\mathbf{q}_{i}=\frac{\mathbf{y}_{i-1}^{\mathrm{T}}\mathbf{t}_{i}}{||\mathbf{t}_{i}||^{2}}\). 4. The residual matrix is used to extract the next set of latent score vectors until the preset number of principal components is met: \(i=A\). The final linear data relationship model is as follows: \[\left\{ \begin{array}{l}\mathbf{X}=\mathbf{T}\mathbf{P}^{\mathrm{T}}+\mathbf{E}\\ \mathbf{Y}=\mathbf{U}\mathbf{Q}^{\mathrm{T}}+\mathbf{F}\end{array} \right.\] (4) where \(\mathbf{T}\) is the latent score matrix of the process variables, \(\mathbf{U}\) is the latent score matrix of the quality variables, \(\mathbf{P}\) is the load matrix of process variables, and \(\mathbf{Q}\) is the load matrix of quality variables. The monitoring model based on the PLS algorithm is essentially constructed according to the linear relationship between process variables and quality variables [10; 11; 12; 19]. However, in the actual production process, there is correlation and nonlinearity between the relevant variables. Therefore, KPLS is introduced to explain the nonlinear relationship between process and quality variables. As shown in Figure 1, the original nonlinear separable data are mapped to a high-dimensional linear feature space through a kernel function.