Multiscale fault classification framework using kernel principal component analysis and k-nearest neighbors for chemical process system

Process monitoring techniques in chemical process systems help to improve product quality and plant safety. Multiscale classification plays a crucial role in the monitoring of chemical processes. However, there is a problem in coping with high-dimensional correlated data produced by complex, nonlinear processes. Therefore, an improved multiscale fault classification framework has been proposed to enhance the fault classification ability in nonlinear chemical process systems. This framework combines wavelet transform (WT), kernel principal component analysis (KPCA), and K nearest neighbors (KNN) classifier. Initially, a moving window-based WT is used to extract multiscale information from process data in time and frequency simultaneously at different scales. The resulting wavelet coefficients are reconstructed and fed into the KPCA to produce feature vectors. In the final step, these vectors have been used as inputs for the KNN classifier. The performance of the proposed multi-scale KPCA-KNN framework is analyzed and compared using a continuous stirred tank reactor (CSTR) system as a case study. The results show that the proposed multiscale KPCA-KNN framework has a high success rate over PCA-KNN and KPCA-KNN methods.


Introduction
Process monitoring is essential for ensuring consistent product quality and safety in chemical process systems. The root causes of process faults should be identified earlier so the system can be restored to its normal operating conditions by corrective measures. Various process monitoring methods have been developed, and they are broadly classified into model-based and datadriven methods [1][2][3]. The primary function of process monitoring is fault detection and fault diagnosis. After detecting the fault, the fault classification must be identified, which is intended to determine which fault has occurred, and the cause of the irregular conditions observed. Once the fault type is determined, the correct troubleshooting measures may be taken immediately, ultimately preventing greater economic losses and casualties.
The complexity of chemical process systems has increased in recent years as a result of improved on-line sensor technology, automation, and well-equipped computerized measurement devices. These processes generate a large amount of highly correlated nonlinear data, making it difficult to develop a correct mathematical model for such processes is difficult [4]. The data-driven approach requires transforming a large amount of data into a specific form of information representation to enable the accurate detection and diagnosis of faults [5].
These methods can extract meaningful information from process data making them suitable for large-scale complex industrial processes [6,7]. Over the last decade, researchers have been able to develop data-driven multivariate statistical process monitoring (MSPM) methods such as the principal component analysis (PCA) [8] and partial least squares (PLS) [9,10].
Conventional MSPM techniques such as PCA and PLS are frequently used for the monitoring of chemical processes. The key limitation of both methods is the presence of a linear correlation among the process variables and the gaussian distribution of data, limiting their usefulness [11]. Kernel-based PCA (KPCA) is introduced to deal with nonlinear systems and improve classification ability. The majority of available methods rely upon the data collected on a fixed scale, whereas the multi-scale approach can depict information in different scales using wavelet transform (WT). WT is the most influential multiresolution analysis tool, categorically decomposing the input signals into several different resolution levels [12]. To address the multiscale nature in process monitoring, a multiscale PCA (MSPCA) framework has been proposed by integrating wavelet analysis with PCA [13]. In recent years, multiscale process monitoring has been extensively studied with various modifications such as dynamic [14], recursive [15], nonlinear [16], and orthogonal nonlinear [17]. Recently, a multiscale framework for real-time process monitoring has also been proposed that effectively detects the faults in the continuous stirred tank reactor (CSTR) system [18]. MSPCA methods have also been developed to deal with incipient faults in process data by combining PCA with wavelet analysis [19] and ensemble empirical mode decomposition (EEMD) [20]. This paper proposes a new fault classification framework using a wavelet-based multiscale KPCA and K nearest neighbors (KNN) classifier. KNN is a nonparametric classifier that classifies a sample of data based on the distance between this sample and some pre-labeled training samples. The paper is organized as follows. Section 2 presents the background, which includes a brief introduction of WT and KPCA. The methodology of the proposed method is discussed in section 3. The results and discussion are included in Section 4, while Section 5 concludes the paper.

Wavelet transform
Wavelet transform (WT) is usually used in multi-scale process monitoring to decompose original process data into multi-scale components. WT provides many advantages over traditional single-scale techniques since it distinguishes deterministic and stochastic features from the process's initial measurements [21,22]. This allows for a more meaningful interpretation of the process phenomena in their time-frequency bands [23]. All basis functions , ( ) a b ψ λ within WT are obtained from a mother wavelet ( ) ψ λ via dilation and translation processes where a and b are discretized scale and position parameters, respectively. The multi-scale representation involves transmitting the signal at different scales through a low pass and high pass filter. The scaled version of the original signal is achieved by projecting it on an orthonormal basis function family represented as The approximation coefficient and detail coefficients of each level are obtained by means of the signal projection on the various wavelet functions represented as The original signal is obtained by adding the final scaled signal and all detail signals and represented as where J and n are the level of decomposition and original signal length, respectively.

Kernel principal component analysis
Traditional PCA can only be effectively applied to a linear set of observations. However, if the data has more complicated structures that cannot be easily expressed in a linear subspace, standard PCA is not beneficial. Kernel PCA helps to generalize standard PCA to a non-linear dimensionality reduction.
To derive the KPCA, consider an input matrix [ ] x is the observation vector at a time i . The data is transferred to the linear feature space F , and the covariance matrix is determined as follows [24]: where ɸ(.) is the nonlinear mapping function that projects the input vectors from the input space to F. Like PCA, PCs can be computed by solving the eigenvalue problem [24]: where λ≥0 and v represents the eigenvalues and eigenvector of F C . C F v can be expressed as follows: Considering that all solutions v with In the feature space, the SPE can be computed as The threshold for SPE is determined as This limit is based on the box equation achieved by adjusting the weighted distribution of the reference distribution utilizing training. Taking into account a and b the estimated mean and variance of the SPE. g and h are the weight assigned to the SPE size and degree of freedom, respectively, and are computed using,

Methodology
The main idea behind the proposed framework is to develop multiscale fault classification for nonlinear chemical processes. First, each variable is decomposed and reconstructed individually by applying WT. Next, kernel PCA is performed on the wavelet coefficients for each selected scale to find out the feature vectors. Appropriate numbers of component loading vectors are retained using the cumulative percent variance (CPV) technique at each selected scale. In this work, three scales (s=3) are used for WT of the original signal. After reducing the original data dimension using KPCA, which finds a set of orthogonal discriminant vectors, a KNN classifier is used to describe the faulty patterns. For the KNN application, the likelihood of the test sample is adaptively estimated without any preliminary assumption, except for k, which is selected to produce the best results for train data. To classify test samples, all train data points must be saved, and the distances between the test sample and all training samples must be measured and sorted. Then, the k nearest to the neighbors is selected for the final decision.

Results and discussion
CSTR systems are frequently used in the chemical and food industries. As control of CSTR is a challenging problem, several researchers often use CSTR to evaluate the effectiveness of process monitoring techniques. Fig. 1 illustrates a schematic of the CSTR system with cascade control. In this system, a first-order irreversible exothermic reaction occurs, in which reactant A enters the reactor, and product B flows out, as shown below.
The cooling liquid in the jacket removes the heat from the exothermic reaction. The reactor's liquid level and temperature are controlled by manipulating the outlet flow and cooling liquid flow, respectively. The following equations represent the dynamic model of this CSTR system.
Process data are generated by simulating the CSTR system with a period of one minute for normal and faulty operating conditions. 1000 samples of fault-free process data were recorded with normal operating conditions (NOCs). Eight fault scenarios were simulated, and 1,000 samples were recorded for each fault pattern. All simulated faults are listed in Table 1, including the process disturbances, sensor bias, and process faults. The proposed MSKPCA fault detection and classification approach are compared with PCA and KPCA methods to evaluate the performance. For the proposed MSKPCA method, only the monitoring results based on the approximation function (A3) are presented, whereas monitoring results based on all detail functions (D1, D2, and D3) are discarded as these functions include the noises.  Table 2, it can be observed that the accuracy of fault classification using multiscale KPCA-KNN framework is about 70%, while the accuracy of fault 8 was raised to 79%, which is significantly higher than KPCA and traditional PCA methods. For the KPCA-KNN fault classification framework, the diagnosis accuracy is around 60%. In this case, fault 8 again shows a maximum accuracy rate that is 74.1%. Whereas, in the case of PCA-KNN based fault classification framework, the diagnosis accuracy is around 40% less than the other two comparative frameworks. In the multiscale KPCA process monitoring technique, after the decomposition of process data using wavelet analysis into various multiple scales, KPCA is performed on these multi-scaled fault data, which offers important supplemental classification information KPCA.
Without proper variable weightage, all variables are used simultaneously, and the data sets are masked with irrelevant information. The integration of WT with KPCA improved the extraction of features relevant to the abnormal operation in both the time and frequency domain and led to better classification. In addition, the high misclassifications rate for PCA shows the advantage of the nonlinear technique when the fault data are highly overlapped.

Conclusions
This paper has presented PCA, KPCA, and multiscale KPCA with KNN classifier-based for fault diagnosis system. The effectiveness of these classification frameworks is demonstrated by using the CSTR system as a case study. From the results, the combination of multiscale feature extraction using WT with KPCA and KNN method for classification proved the proposed method suitable for implementation in fault diagnosis system of chemical processes. The results showed that the performance of the classifier by multi-scale KPCA-KNN was better than the others. Further research can extend by using different multiscale classification techniques to more complex and complicated chemical processes.