## 2 Monitoring Model Based on Statistical Process Control
### Offline Modeling Based on K-PLS Algorithm
The original spatial two classes of data require ellipses to separate them. The high-dimensional feature space transforms the original data into a linearly separable problem, and data differentiation can be achieved through the linear classification surface. According to the principle of kernel function, first, suppose there is a finite subset containing \(n\) sample points as follows:  
\[\mathbf{X}=[\mathbf{x}_{1},\mathbf{x}_{2},\ldots,\mathbf{x}_{n}]^{\mathrm{T}}\in\mathbb{R}^{k} \tag{5}\]  
\(\phi:\mathbf{x}\rightarrow\phi(\mathbf{x})\) is the mapping from the original matrix \(\mathbf{X}\) to the high-dimensional feature space \(\mathbf{H}\); then obtain a new finite subset as follows:  
\[\mathbf{\phi}(\mathbf{X})=[\mathbf{\phi}(\mathbf{x}_{1}),\mathbf{\phi}(\mathbf{x}_{2}),\ldots,\mathbf{\phi }(\mathbf{x}_{n})]^{\mathrm{T}}\in\mathbb{R}^{k} \tag{6}\]  
where \(k\) is the new matrix dimensions, \(k>m\). The mapping function is unknown; a kernel function can be introduced to calculate the inner product of the mapping points, thereby describing the relationship between the  
Figure 1: The original data space is mapped to the feature space \(H\). mapping points. Let \(\mathbf{\phi}(\mathbf{x}_{i})\), \(\mathbf{\phi}(\mathbf{x}_{j})\) be the inner product of \(\mathbf{\phi}(\mathbf{x}_{i})\) and \(\mathbf{\phi}\big{(}\mathbf{x}_{j}\big{)}\), then the kernel function expression is as follows:  
\[k\big{(}\mathbf{x}_{i},\mathbf{x}_{j}\big{)}=\big{\langle}\mathbf{\phi}(\mathbf{x}_{i}),\mathbf{ \phi}\big{(}\mathbf{x}_{j}\big{)}\big{\rangle}=k_{ij} \tag{7}\]  
where \(i=1,2,\ldots,n\), \(j=1,2,\ldots,n\). After calculating the inner product of all mapping points, the kernel matrix can be constructed according to the order of subscripts as follows:  
\[\mathbf{K}=\left[ \begin{array}{cccc}k(\mathbf{x}_{1},\mathbf{x}_{1})&k(\mathbf{x}_{1},\mathbf{x }_{2})&\ldots&k(\mathbf{x}_{1},\mathbf{x}_{n})\\ k(\mathbf{x}_{2},\mathbf{x}_{1})&k(\mathbf{x}_{2},\mathbf{x}_{2})&\ldots&k(\mathbf{x}_{2},\mathbf{x}_{n })\\ \vdots&\vdots&\ddots&\vdots\\ k(\mathbf{x}_{n},\mathbf{x}_{1})&k(\mathbf{x}_{n},\mathbf{x}_{2})&\ldots&k(\mathbf{x}_{n},\mathbf{x}_{ n})\end{array} \right] \tag{8}\]  
As can be seen from the structure of the kernel matrix, it contains the inner product of all the mapping points in the feature space and is the set of mapping information. The data information of the original space can be completely retained through the kernel function; thus the selection of the kernel function is crucial to the construction of the model. After the kernel matrix \(\mathbf{K}\) is obtained, the central processing is first as follows:  
\[\mathbf{\overline{K}}=\mathbf{K}-\mathbf{I}_{n}\mathbf{K}-\mathbf{K}\mathbf{I}_{n}+\mathbf{I}_{n}\mathbf{K}\bm {I}_{n} \tag{9}\]  
where \(\mathbf{I}_{n}=\frac{1}{n}\left[ \begin{array}{ccc}1&\ldots&1\\ \vdots&\ddots&\vdots\\ 1&\ldots&1\end{array} \right]\in\mathbf{R}^{n\times n}\). The offline training steps of the monitoring model based on the KPLS algorithm are as follows:  
1. Initialize \(\mathbf{u}_{i}\) as any column of mass matrix \(\mathbf{Y}\) and initialize \(i=1\). 2. The mapped input score is converted to an inner product by the kernel function: \[\mathbf{t}_{i}=\phi(\mathbf{X})\cdot\phi(\mathbf{X})^{\mathrm{T}}\mathbf{u}_{i}=\mathbf{\overline {K}}\mathbf{u}_{i}\] (10)
3. Normalization processing: \(\mathbf{t}_{i}=\frac{\mathbf{t}_{i}}{||\mathbf{t}_{i}||}\). 4. Find the latent variable of the output variable: \(\mathbf{c}_{i}=\mathbf{Y}^{\mathrm{T}}\mathbf{t}_{i},\mathbf{u}_{i}=\mathbf{Y}\mathbf{c}_{i}\). 5. Normalization processing: \(\mathbf{u}_{i}=\frac{\mathbf{u}_{i}}{||\mathbf{u}_{i}||}\). 6. Repeat steps (2)-(5) until \(\mathbf{u}_{i}\) converges. 7. Calculate the residual matrix: \[\left\{ \begin{array}{l}\mathbf{K}=\big{(}\mathbf{I}-\mathbf{t}_{i}\mathbf{t}_{j}^{\mathrm{T }}\big{)}\mathbf{\overline{K}}\big{(}\mathbf{I}-\mathbf{t}_{i}\mathbf{t}_{i}^{\mathrm{T}}\big{)} \\ \mathbf{Y}=\mathbf{Y}-\mathbf{t}_{i}\mathbf{t}_{j}^{\mathrm{T}}\mathbf{Y}\end{array} \right.\] (11)
8.