Quality-related fault diagnosis based on k-nearest neighbor rule for non-linear industrial processes

The fault diagnosis approaches based on k-nearest neighbor rule have been widely researched for industrial processes and achieve excellent performance. However, for quality-related fault diagnosis, the approaches using k-nearest neighbor rule have been still not sufficiently studied. To tackle this problem, in this article, we propose a novel quality-related fault diagnosis framework, which is made up of two parts: fault detection and fault isolation. In the fault detection stage, we innovatively propose a novel non-linear quality-related fault detection method called kernel partial least squares-k-nearest neighbor rule, which organically incorporates k-nearest neighbor rule with kernel partial least squares. Specifically, we first employ kernel partial least squares to establish a non-linear regression model between quality variables and process variables. After that, the statistics and thresholds corresponding to process space and predicted quality space are appropriately designed by adopting k-nearest neighbor rule. In the fault isolation stage, in order to match our proposed non-linear quality-related fault detection method kernel partial least squares-k-nearest neighbor seamlessly, we propose a modified variable contributions by k-nearest neighbor (VCkNN) fault isolation method called modified variable contributions by k-nearest neighbor (MVCkNN), which elaborately introduces the idea of the accumulative relative contribution rate into VC k-nearest neighbor, such that the smearing effect caused by the normal distribution hypothesis of VC k-nearest neighbor can be mitigated effectively. Finally, a widely used numerical example and the Tennessee Eastman process are employed to verify the effectiveness of our proposed approach.


Introduction
With the rapid development of industry, modern industrial systems are expanding toward the direction of large scale and complexity. To ensure safety and reliability in industrial production, multivariate statistical process monitoring (MSPM) as a kind of data-driven approach has been extensively studied and successfully applied to actual industrial processes. [1][2][3] In MSPM, process-related fault detection is a popular research task, of which the mainstream method is principal component analysis (PCA). 4 Many researchers have improved PCA for better application in fault detection.
For example, Xiu et al. 5 proposed a novel Laplacian regularized robust PCA method that can effectively capture the intrinsic non-linear geometric information. Other process-related fault detection methods have canonical correlation analysis (CCA), 6 non-negative matrix factorization (NMF), 7,8 and so on. Another particularly important research direction for MSPM is quality-related fault diagnosis, [9][10][11] in which qualityrelated fault detection and fault isolation are two key tasks. Quality-related fault detection belongs to a supervised learning task in machine learning area, 12 and it aims to detect whether a fault that affects product quality occurs in the industrial system. When a fault detection algorithm indicates some faults exist in the system, fault isolation attempts to locate the faulty sensors. By the diagnosis of quality-related faults, unnecessary downtime and cost brought by the qualityunrelated faults can be greatly reduced, and the risky faulty sensors can also be located as quickly as possible. Therefore, quality-related fault diagnosis has been a research hotspot recently. [13][14][15] Compared with process samples in real industry, quality samples usually have a large time lag to collect and a relatively rare quantity. Hence, the direct use of quality samples cannot meet the requirement of realtime online monitoring. To tackle this situation, the commonly adopted idea is to first establish a regression model between process variables and quality variables, and then extract the quality-related features from process variables, which will replace quality variables to realize quality-related online fault detection. Currently, two mainstream frameworks based on this idea are least squares (LS)-based and partial least squares (PLS)based approaches. Zhou et al. 16 comprehensively analyzed the defect of PLS 17 for quality-related fault detection and proposed a total projection to latent structures (TPLS) model. 18 Yin et al. 19,20 performed singular value decomposition (SVD) method on coefficient matrix of LS and PLS separately, and presented modified partial least squares (MPLS) and improved partial least squares (IPLS). Since all above are linear methods which are unsuitable for non-linear processes, the kernel trick has been widely adopted for non-linear fault detection. Its main idea is to map the original process variables into Reproducing Kernel Hilbert Space (RKHS) through some kernel function, thus making the process variables linearly separable in such kernel space. 21 By introducing the kernel trick, many linear methods can be transformed into non-linear versions. 14,22,23 However, all of the above methods design statistics without considering the local characteristics among samples.
k-Nearest neighbor (k-NN) rule is a classical machine learning method, which is usually adopted as a classifier. 24,25 Because it is capable of mining local characteristics between near neighbors, 26 k-NN rule has been modified to propose a fault detection method based on the k-NN rule, namely, FD-k-NN. 27 It provides a promising direction for the solution of the above problems to some extent. The statistics of FD-k-NN are designed by fully considering the Euclidean distance measurement among local neighbor samples. Due to its excellent performance, k-NN-based fault detection methods have been studied extensively. [28][29][30] Although these methods have been employed into various tasks, such as multirate sampling process 31 and multimode process, 32 quality-related fault detection methods based on k-NN rule have still not been well-established so far.
Fault isolation is a successor task of fault detection, which is utilized to locate fault sensor variables. Many classical fault isolation approaches have been proposed. Contribution plot and reconstruction-based contribution (RBC) are two most commonly used isolation methods, but they have relatively obvious smearing effect. To deal with this problem, many other fault isolation techniques have been addressed in previous works. [33][34][35][36] Unfortunately, these methods fail to be used in k-NN-based fault detection. To handle the problem, Zhou et al. 37 proposed a novel fault isolation method based on k-NN rule, VCk-NN, which makes it possible to determine the failed sensors after detecting faults using FD-k-NN. Compared with previous methods, VCk-NN suffers from less effect of fault smearing. Nevertheless, VCk-NN assumes that the process samples follow a multivariate normal distribution, which greatly restricts its effect of fault isolation.
In this article, we propose a novel quality-related fault diagnosis framework, which is made up of two parts: non-linear quality-related fault detection and fault isolation. For quality-related fault detection task, the motivation of proposing kernel partial least squares (KPLS) by combining KPLS with k-NN rule is that (1) KPLS can effectively utilize process variables to obtain predictive quality variables, which will replace the actual quality variables that cannot get in real time, and (2) k-NN rule can mine information between a test sample and the nearest template samples for a better detection effect compared with only using a single test sample. For fault isolation task, the motivation to improve VCk-NN to MVCk-NN is that the hypothesis is sometimes not satisfied, and in this case, VCk-NN still has a smearing effect, so MVCk-NN is presented to deal with this problem by mitigating the influence of faulty variables on faultless variables. The main contributions of this article are summarized as follows: We propose a new quality-related non-linear fault diagnosis framework based on k-NN rule, including a new quality-related non-linear fault detection method KPLS-k-NN and a new fault isolation method modified VCk-NN. KPLS-k-NN is proposed by combining KPLS with k-NN rule. Quality-related statistics of KPLS-k-NN take into full consideration the local neighbor information among predicted quality samples, which greatly improve the detection rate (DR) for quality-related faulty samples. Modified VCk-NN is established by introducing the idea of the relative variable contributions of accumulative relative contribution rate (ARCR) into VCk-NN, which does not need the assumption that the process samples obey a multivariate normal distribution and has more precise isolation results in identifying latent fault root cause than VCk-NN.
The rest of this article is arranged as follows: first, give some relevant preliminaries. Afterward, the k-NN scheme for quality-related non-linear fault diagnosis is proposed in a detailed presentation. Then, the simulation results are provided and discussed. Finally, we conclude the article and present our future work.

Preliminaries
Let the non-linear process contain an input data matrix X which records N samples of m process variables and an output data matrix Y including N samples of l quality variables, that is Y = y 1 , y 2 , :: where x i 2 R m and y i 2 R l (i = 1, :::, N ) represent the ith sample of X and Y, respectively. All samples are supposed to obey normal distribution. The implementation of KPLS method is divided into two steps as follows. First, kernel trick 21 is introduced into KPLS model to effectively deal with the non-linear relationship among variables. Given a kernel function f, it maps the original samples x i (i = 1, 2, . . . , N ) into a high-dimension kernel space F , which is defined as Thus, the process matrix X is transformed into feature matrix F as As a necessary step, f(x i ) needs to be processed to zero mean vector f, that where 1 N = ½1, 1, . . . , 1 T 2 R N . Hence, the zero mean matrix of F can be obtained by where I N is the identity matrix. The concrete form of F is unknowable, but its kernel matrix K = F F T 2 R N 3 N can be artificial setting. In this article, the radial basis function (RBF) kernel is used to calculate the elements in K, which is where s is the kernel parameter that needs to be set according to experience. The zero mean of K is calculated as follows Second, PLS model is established between F and Y in space F . Thus, the KPLS model is constructed as where T 2 R N 3 a and P 2 R f 3 a are the score matrix and the loading matrix of F, respectively, U 2 R N 3 a and Q 2 R l 3 a are the score matrix and the loading matrix of Y, respectively, F r and Y r are the residual matrices, and a represents the number of latent variables.
The iterative calculation algorithm of KPLS has been elaborated in Jiao et al., 14 in which we can get the score matrix U and R that is R = F T U(T T KU) À1 . For the score matrix T and the loading matrix Q, the following equations hold Obviously, the score vector Methodology FD-k-NN as a popular fault detection approach has ability in determining whether a fault has occurred in the process, but it cannot estimate whether the fault occurred will have an impact on the production quality. Therefore, in this section, we propose k-NN-based fault diagnosis scheme. Its fault detection scheme KPLS-k-NN is designed as follows: first, FD-k-NN is employed to monitor the process space. Then, KPLS is adopted to obtain the predicted quality samples Y p of training process samples X in predicted quality space, where quality-related fault detection will be carried out. When KPLS-k-NN indicates that the system has failed, a new fault isolation method MVCk-NN is given for better locating the faulty sensor variables.
The proposed KPLS-k-NN for fault detection Fault detection in process space. FD-k-NN is designed through following the principle: any normal samples should be close to other normal samples to some extent, while for a faulty sample, it should deviate from normal samples. Usually, the degree of deviation is measured by k-NN distance, which is defined as the average square distance between the test sample and its k-NNs from the training normal samples. When the k-NN distance of a sample exceeds the threshold, it is considered as a faulty sample, otherwise, it is judged as a normal sample. The details of the algorithm are as follows.
Model building. Given the training samples X, the model is built according to the following procedures: 1. Find the k-NNs for each sample x i in X and compute all the Euclidean distance, that where kÀNNs(x i ) represents the set of k-NNs of x i .
2. Calculate the k-NN distance of x i . k-NN distance is adopted as the statistics D 2 x (x i ) as 3. Determine the threshold D 2 x, a : x is rearranged in descending order as D 2 x arrange , of which (1 À a)Àempiricalquartile is chosen as D 2 x, a in Zhou et al., 37 Fault detection. For a new incoming test sample x new , the sample categories are inferred as the following steps: x, a , then x new is considered as a faulty sample. Otherwise, x new is a normal sample.
Fault detection in predicted quality space. Given the training process samples X and training quality samples Y. To obtain the predicted quality samples Y p of training process samples X, KPLS 41 is adopted to obtain Y p (the prediction value of Y), since it has the ability to utilize X to effectively mine the essential information of Y. We set the coefficient matrix of X and Y p as M, which is According to the calculation of equations (10) and (11), the predictive output Y p is calculated by Similar to process space, we call the space where y p (i = 1, . . . , N) 2 Y p is located predicted quality space.
At this point, FD-k-NN is employed to perform the detection of quality-related faults in predicted quality space. We need to find the k-NNs for each sample y p in Y p , and obtain the y p 's k-NN distance D 2 y (y p ) according to equation (14). Notice that since X and Y p generally do not obey the same distribution, for x and y p in the same point, their corresponding k-NNs might not be the samples in the same points. Hence, the k-NNs for x and y p should be calculated separately. In addition, our KPLS-k-NN method does not need to carry out any variable transformation in the original space, and it directly depends on the Euclidian distance of the variables in the original space as an index to quantify the discrepancy between test samples and normal samples.
Different from the threshold in Zhou et al., 37 in this article, kernel density estimation (KDE) 42 , as a nonparameter probability density estimation method of random variable, is utilized to determine the threshold for two monitoring spaces, which can be referred in detail in Parzen. 38 Thus, corresponding to D 2 x and D 2 y , we will get their thresholds D 2 x, a and D 2 y, a . For a new incoming test sample x new , its predicted quality y p, new is calculated by equations (12) and (15) as follows To determine whether y p, new is a faulty sample, we find y p, new 's k-NNs from Y p , and compute y p, new 's k-NN distance D 2 y (y p, new ). Finally, detection logic is performed by comparing D 2 y (y p, new ) with the threshold D 2 y, a : if D 2 y (y p, new ).D 2 y, a , then x new is considered as a quality-related faulty sample. Otherwise, x new is a normal sample or a qualityunrelated faulty sample.
The whole scheme of KPLS-k-NN. By combining fault detection in process space as well as in predicted quality space, our proposed the whole KPLS-k-NN non-linear quality-related fault detection scheme is summarized as follows: Offline modeling. 1. Normalize the training process sample X and training quality samples Y to the zero mean and unit variance. 2. Obtain the coefficient matrix M of KPLS by equation (15) and get Y p using equation (16).
x (x) and y p 's k-NN distance D 2 y (y p ) to get the thresholds D 2 x, a and D 2 y, a .
Online detection. For a new incoming test sample x new : 1. Obtain y p, new using equation (17). 2. Compute the statistics D 2 x (x new ) and D 2 y (y p, new ).
Detection logic.
x, a , the system has some quality-unrelated faults.
Notice that our KPLS-k-NN is essentially a supervised quality-related fault detection method, which is designed by combining KPLS with FD-k-NN. The above seems to be a simple combination, but FD-k-NN as an unsupervised method is successfully applied to complete a supervised fault detection task.

The proposed MVCk-NN for fault isolation
The KPLS-k-NN-based fault detection approach has been presented in the above section, which can effectively judge whether there are some faults in the process and whether the faults are related to product quality. Next, when KPLS-k-NN indicates the system exists some faults, a fault isolation method matched with KPLS-k-NN will be needed to locate faulty variables. Here, we propose a new fault isolation method MVCk-NN in detail.
In general, the sensor fault as a kind of system faults is classified as the additive fault. Hence, a process sample x 2 R m can be expressed as To locate which sensors cause the statistics D 2 x to alarm faults, the contributions from all variables of x to D 2 x need to be calculated. We decompose D 2 x as follows Then, define the contribution from ith variable of x to D 2 x as Obviously, by equations (19) and (20), D 2 x is the sum of the contributions of all variables, namely, D 2 x = P m i = 1 C(x, i). Next, we discuss the influence of the fault magnitude on variable contributions. Set x include at least one fault. Without loss of generality, we assume the ith variable be faulty, and others be normal or faulty, that By equations (20) and (21), we have According to neighborhood relationship, a reasonable hypothesis is given 37 as follows. Hypothesis 1. Any variable's fault magnitude is much larger than the Euclidean distance between the variable and its neighbors on the same dimension, that where ½Á i represents the ith component of vector.
Due to j T i j i = 1, j T i j j = 0, 8j 6 ¼ i, and Hypothesis 1, it can be obtained that It indicates that the contribution of each fault variable to the statistics is approximately equal to the square of the fault magnitude, and this method hardly suffers from smearing effect when the Hypothesis 1 is satisfied.
The above are VCk-NN-based variable contributions, but there exists a drawback that Hypothesis 1 sometimes cannot be enough satisfied, which causes that the contribution of fault variables may not be significantly different from that of normal variables, so as to increase the smearing effect.
Therefore, our proposed MVCk-NN introduces the idea of ARCR 35 into VCk-NN to obtain the relative variable contributions instead of absolute ones, so that the smearing effect is further eliminated. The detailed steps are illustrated as follows: 1. For a new sample x new 2 R m , when m = 1, it means process variable is a single source variable. In this case, once a fault occurs, the faulty variable must be this process variable. However, when m ø 2, we need to execute the following Steps 2-5 to isolate faulty process variables. 2. Normalize each C(x new , i) obtained by equation (20) to guarantee that all variables contribute more or less the same to x neŵ 3. To eliminate the smearing effect,Ĉ(x new , i) is divided by the sum of all the m normalized contributions to obtain relative variable contribution C r (x new , i) 4. The recommended experience threshold is given in Peng et al. 35 where C r (x new ) = ½C r (x new , 1), . . . , C r (x new , m) T .
5. If C r (x new , i) is more than u, the ith variable of x new can be considered as a root cause of faults, otherwise not.
Through the above derivation, the flow chart of the proposed k-NN-based quality-related non-linear fault diagnosis scheme is summarized in Figure 1.

Case study
This section applies a widely typical numerical and a real industrial Tennessee Eastman (TE) process benchmark to validate the effectiveness of our proposed method. Two fault evaluation indexes are adopted for performance evaluation. In the fault detection stage, our method KPLS-k-NN will be compared with the state-of-the-art approach total kernel projection to latent structures (TKPLS) 22 and the most recent SVDbased non-linear method modified kernel least squares (MKLS) 23 to show its superiorities. In the fault isolation stage, our MVCk-NN will be compared with VCk-NN. Besides, in the experiment, the confidence level a is set to 0.99.

Evaluation index
Two evaluation indexes-that is, the fault DR and the false alarm rate (FAR)-are used in our experiments, which are defined as follows DR  where an effective alarm represents a quality-related faulty sample is detected, while a false alarm represents a quality-unrelated faulty sample is detected. For performance evaluation, when a quality-related fault occurs, DR is adopted as the key indicator, while when a quality-unrelated fault happens, then FAR is used as the key indicator. More details on DR and FAR can be referred to Wang and Jiao. 23 Typical numerical example The following numerical example introduced in Peng et al. 22 is applied where e i ;N(0, 0:001 2 )(i = 1, 2, 3), v ; N(0, 0:005 2 ), and e i and v denote the noises. x = ½x 1 , x 2 , x 3 , x 4 , x 5 T is the process variable, and y is the quality variable. From the above equation, we can see that y can only be affected by x 1 , x 3 , and x 4 , but not by x 2 and x 5 . Hence, when a fault occurs in x 1 , it will have influence on quality variable y. While a fault happens in x 2 , it will not do anything to y. We generate 400 normal samples as training samples for offline modeling, 400 normal samples as validation samples for selecting the hyperparameters, and 400 test samples which include 200 normal samples and 200 faulty samples for online detection. The fault scenarios are as follows: Fault 1: step bias occurs in x 1 :  For the choice of hyper-parameters, that is, A, c, and k, we utilize cross-validation method to determine them. In detail, in the normal state, several sets of parameters with the minimum of sum of FARs of process variables and quality variables will be selected as the alternative hyper-parameters. In addition, we also need to consider the predictive performance of KPLS meanwhile. Therefore, we select one from the alternative hyper-parameters that has the minimum prediction error as final hyper-parameters. In this experiment, the hyper-parameters are set as A = 2, c = 2 3 10 4 , and k = 5. The significance level a is 0.01. To make the experiment more comprehensive, the magnitude of  Table 1. As shown in Table 1, the DRs of three methods to detect Fault 1 are all 100%, and the DRs of three methods for Fault 2 are almost above 90%. So, three methods all give right detection results.
Furthermore, without loss of generally, we set f = 0:4 in Fault 1 and observe the statistics values of three methods. From Figure 2, it is obvious that for these three methods, almost of all statistics of normal samples are below the threshold, while those faulty samples are significantly above the threshold. Therefore, three methods all have a good detection ability for quality-related faults.
Fault isolation. When f = 0:4, the Fault 1 isolation results of MVCk-NN and VCk-NN are shown in Figure 3. According to the setting of Fault 1, variable x 1 is the root cause of Fault 1, while x 3 and x 4 are also affected by x 1 , but they are not root causes. In Figure  3(a), VCk-NN regards x 1 , x 3 , and x 4 as the root cause of Fault 1, while from Figure 3(b), MVCk-NN can only identify x 1 as the root cause of Fault 1. By contrast with VCk-NN, our proposed MVCk-NN has higher accuracy in the fault isolation task. The results of quality-unrelated faults Fault detection. The results to detect Fault 3 and Fault 4 using three methods are shown in Table 2. Because the quality-unrelated statistics of these three approaches are all over 90%, they can all warn that some process faults have happened in the system. The FARs of the statistics using TKPLS are over 90%, so TKPLS fails to identify the true natures of these faults.   International Journal of Distributed Sensor Networks For MKLS, although its FARs of the statistics T 2 mkls are all less than 1%, they are still not equal to 0. However, using KPLS-k-NN, the FARs of the statistics D 2 y are all 0, so it achieves the best performance in comparison methods.
We set f = 0:003 in Fault 2 to valid the fault detection and isolation performance for quality-unrelated faults. The values of three methods' statistics are shown in Figure 4. From Figure 4, when Fault 2 occurs, quality-unrelated statistics of three methods are all over their own thresholds, so they all indicate some faults have occurred. Because Q 2 kr of TKPLS is almost higher than its threshold in all faulty samples, it misunderstands that the faults are quality-related, so it fails. Since quality-related statistics of both the KPLS-k-NN method and MKLS are lower than the thresholds, they both can give the correct results: the system exists some quality-unrelated faults. Compared with T 2 mkls of MKLS, it is very obvious that D 2 y of KPLS-k-NN can achieve a better margin, because it is much lower than the threshold. Therefore, for quality-unrelated faults, KPLS-k-NN can make a clearer division between quality-related and quality-unrelated samples.
Fault isolation. When f = 0:003, the Fault 2 isolation results of two methods are displayed in Figure 5. Variable x 2 is the root cause of Fault 2. Although x 5 is not root cause, it will be affected by x 2 . In Figure 3, VCk-NN considers x 2 and x 5 both as root cause variables, while our MVCk-NN only determines that x 2 is the root cause of Fault 2, which is consistent with the fact.
Through the above analysis of the experimental results, our method KPLS-k-NN does a much excellent job for quality-related fault detection task than other comparison methods. Besides, when KPLS-k-NN indicates some faults happen, our proposed MVCk-NN has high accuracy in fault root cause diagnosis and has prominent advantages over VCk-NN.

TE benchmark
TE process is a real simulation benchmark of industrial process, which has been widely utilized for the simulation and verification of various control and MSPM approaches, 39 and its structure flowchart is shown in Figure 6. The variables in this process contain two blocks of variables: the XMV block of 11 manipulated variables and the XMEAS block of 41 measured variables which include 22 process and 19 analysis variables. In this simulation, 22 process variables (XMEAS ) and 11 manipulated variables (XMV (1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)) are chosen to be process input X, and select purge gas analysis component G (XMEAS (35)) as the quality output Y.
The training data set and validation data set contain 500 and 960 fault-free data samples, respectively. For the test data set, it is composed of 21 different fault sets, each of which includes 960 data samples and they are displayed in Table 3. The fault categories can be roughly divided into the following ones: step faults, random variation faults, slow drift faults, sticking faults, constant position faults, and some unknown faults. The detailed fault information is described in Downs and Vogel 40 and the website (http://depts.washington.edu/control/LARRY/TE/download.html).
To classify the process faults into the category of affecting Y and that of not affecting, the criterion of Zhou et al. 16 is adopted, that is, if n y =n t .10%, then the faults are considered to be quality-related, otherwise quality-unrelated, where n y =n t denotes the affected rate of Y. According to the validation data set, the model parameters are N = 500, m = 33, and l = 1 and the hyper-parameters are set as A = 10, c = 2 3 10 4 , and k = 10.
The results of fault detection. For the quality-related faults, detection results of KPLS-k-NN, MKLS and TKPLS are presented in Table 4. We can see that TKPLS performs better than KPLS-k-NN and MKLS since all its FDRs are higher than the corresponding ones of the other methods. However, KPLS-k-NN and MKLS still provide satisfactory results, with most of their statistics above being 10%. The DRs of KPLS-k-NN are significantly superior to MKLS in IDV(6) and IDV (18).
For the quality-unrelated faults, Table 5 gives the detection results. We can see the corresponding statistics D 2 x , Q mkls , and T 2 ko &T 2 kr of all comparative methods have very close values, indicating that the three statistics are equally effective to detect system faults. TKPLS fails to judge the correlation between faults and quality, because its statistics for these faults are all above 10%. For difficult-to-detect faults IDV(9), IDV(15)-IDV (17), both KPLS-k-NN and MKLS fail, but they enable to give correct results for the other faults. Compared with MKLS, KPLS-k-NN performs much better, because the FARs of KPLS-k-NN is much less than MKLS. Because KPLS-k-NN has good detection ability for different 21 kinds of faults, it indicates that the model trained by KPLS-k-NN has perfect generalization ability.
The results of fault isolation. We select IDV(1) to verify the fault isolation effect of MVCk-NN by compared with VCk-NN. IDV(1) is a step fault which represents the change of A/C feed ration. The root cause of IDV(1) is the variable of x 25 . When IDV(1) happens, variables x 1 , x 26 , x 4 , and x 18 will deviate from the normal operation state in turn because of the influence of x 25 . Figure 7 displays the relative variable contributions of all process variables from 161th sample point to 960th sample point. From Figure 7(a), we can see that for the most part, VCk-NN identifies x 25 , x 1 , x 4 , and x 18 as the root cause of IDV (1). Whereas in Figure 7(b), MVCk-NN only needs to consider variables x 25 and x 1 as the root cause. Therefore, our proposed MVCk-NN has a relatively better ability to locate the variables causing faults than VCk-NN.
According to the above results, we can conclude that the proposed method is effective in quality-related nonlinear fault diagnosis and has prominent advantages over traditional methods. Compared with the SVDbased methods, KPLS-k-NN directly utilizes the   relationship among the predicted quality samples to design the statistics, which considers the information of the nearest neighbor structure. Besides, KPLS-k-NN directly detects the process space, avoiding the problem that the residual statistics may have a large component of variance, such as MKLS. Moreover, compared with VCk-NN, the proposed MVCk-NN has advantages in both variable contribution and threshold setting.

Conclusion
In this article, we present a novel quality-related nonlinear fault diagnosis method based on k-NN, which is especially suitable for non-linear industrial processes with relatively small training samples. It consists of a new quality-related fault detection method KPLS-k-NN and a new fault isolation method MVCk-NN. First, KPLS is applied to establish a regression model between process variables and quality variables in order to obtain predictive quality samples. Then, FD-k-NN method is used to design two corresponding statistics, that is, D 2 x and D 2 y for the process space and the predicted quality space, respectively. They will make a judgment on whether there is a fault happening in the system, and whether the fault is related to quality when a fault occurs. When KPLS-k-NN detects faults, in order to locate root cause variables of faults, MVCk-NN is proposed by introducing the idea of ARCR into     Table 3. Fault types in the TE process.

Fault
Description Type

IDV(1) A/C Feed ratio, B composition constant (Stream 4)
Step IDV (2) B composition, A/C ratio constant (Stream 4) Step IDV (3) D feed temperature (Stream 2) Step IDV (4) Reactor cooling water inlet temperature Step IDV (5) Condenser cooling water inlet temperature Step IDV (6) A feed loss (Stream 1) Step IDV (7) C header pressure loss (Stream 4) Step IDV (8) A, B, C feed composition (Stream 4) Random variation IDV (9) D feed temperature (Stream 2) Random variation IDV (10) C feed temperature (Stream 4) Random variation IDV (11) Reactor cooling water inlet temperature Random variation IDV (12) Condenser cooling water inlet temperature Random variation IDV (13) Reactor kinetics Slow drift IDV (14) Reactor cooling water valve Sticking IDV (15) Condenser cooling water valve Sticking IDV (16) Unknown Unknown IDV (17) Unknown Unknown IDV (18) Unknown Unknown IDV (19) Unknown Unknown IDV (20) Unknown Unknown IDV (21) Valve (Stream 4) Constant position TE: Tennessee Eastman. Table 5. Detection results of KPLS-k-NN, MKLS, and TKPLS for quality-unrelated faults in the TE process (%). x VCk-NN. Finally, the proposed method is applied to detect the faults in case study and the effectiveness is validated. Due to the superior fitting ability of the deep neural networks in comparison to KPLS, further work will focus on how to combine deep neural networks with k-NN rule to detect quality-related faults.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.