Analog Circuit Soft Fault Diagnosis Based on Sparse Random Projections and K-Nearest Neighbor

Analog circuit fault diagnosis is a key problem in theory of circuit networks and has been investigated by many researchers in recent years. An approach based on sparse random projections (SRPs) and K-nearest neighbor (KNN) to the realization of analog circuit soft fault diagnosis has been presented in this paper. )e proposed method uses the wavelet packet energy spectrum and sparse random projections to preprocess the time response for feature extraction. )en, the variables of the fault features are constructed, which are used to form the observation sequences of K-nearest neighbor classifier. K-nearest neighbor classifier is used to accomplish the fault diagnosis of analog circuit. In this paper, four-opamp biquad high-pass filter has been used as simulation example to verify the effectiveness of the proposed method. )e simulations show that the proposed method offers higher correct fault location rate in analog circuit soft fault diagnosis application as compared with the other methods.


Introduction
With the rapid development of the microelectronics industry, fault diagnosis of mixed-signal integrated circuits is an essential area of scientific research [1][2][3][4][5]. At present, there are well-consolidated fault diagnosis techniques for digital circuits. However, fault diagnosis of analog circuits is still a challenging and complex task due to the lack of the simple fault model, the presence of component tolerance, the disturbance of noise, and the influence of nonlinear property [6,7]. In recent years, a number of scientists are getting more attention in the fields of analog circuit fault diagnosis, and many methods have been appeared [8][9][10][11][12]. e techniques used in the analog circuit fault diagnosis can be divided into two broad categories: the parameter estimation methods and pattern recognition methods. e parameter estimation methods require complex mathematical models.
us, the application of parameter estimation methods is very limited in practice [13]. Recently, pattern recognition methods have been widely used in analog circuit fault diagnosis. Fault feature extraction and fault classification are two critical processes for analog circuit fault diagnosis in pattern recognition methods. rough fault feature extraction, dimensions of fault feature can be reduced and redundancies of fault feature can be removed. It would be convenient to recognize fault category of analog circuit [14][15][16][17]. It is common to see that signal processing methods, information entropy methods, frequency analysis methods, and time-domain analysis methods are used to extract fault feature in analog circuit fault diagnosis [18]. In addition, principle component analysis (PCA) and linear discriminant analysis (LDA) are used to reduce the dimensionality of fault feature in analog circuit fault diagnosis [19,20]. On the other hand, to design a robust classifier is also of the key importance for analog circuit fault diagnosis. Some machine learning algorithms are widely applied to diagnosis analog circuit fault, such as artificial neural network (ANN), support vector machine (SVM), support vector data description (SVDD), and Bayes network and fuzzy theory [21][22][23]. However, the network structure, weight, and threshold of artificial neural network are difficult to determine, and artificial neural network suffers from low convergence speed in fault diagnosis, which lead to be a poor efficiency in analog circuit fault diagnosis based on artificial neural network. Penalty parameter and kernel parameter influence SVM performance. It is difficult to determine kernel functions of SVM [24,25]. ese affect the performance in analog circuit fault diagnosis.
K-nearest neighbor is a machine learning algorithm based on statistical characteristic. It classifies the test sample throughout estimating the distances of different eigenvalues and has the advantage of simple structure, no need for training and estimation parameter. e KNN algorithm has a good classification effect on overlap data. us, it is appropriate to use KNN classifier for analog circuit fault diagnosis. It has been recognized that fault diagnosis based on KNN can effectively deal with some characteristics of analog circuit, such as component tolerance and nonlinearity [26]. However, the computation complexity and storage space involved in neighbors searching of KNN prevent it from online monitoring, especially for multiple faults and high-dimensional cases [27]. One possible solution to this problem is to reduce the dimensionality of the data, ideally without losing predictive performance. e reason why KNN can deal with the problems in analog circuit fault is that the distances between local samples are utilized to perform fault detection. erefore, the dimension reduction cannot cause the distance distortion and must guarantee the performance of KNN in the subspace. Random projections are a powerful method of dimensionality reduction that preserves the structure of the data without introducing significant distortion. e similarity of data vectors is preserved well under random projections. Random projections do not need to decompose matrix, so it have lower computational requirement. Sparse random projections can further improve computational efficiency, and it is extremely suitable for applications of high dimension and limited samples. e advantages of SRP make it be very suitable for analog circuit fault diagnosis [28,29]. A fault diagnosis method combining random projection and K-nearest neighbor rule can realize reducing computational complexity while guaranteeing the performance of fault detection.
To improve efficiency of analog circuit fault diagnosis, a new approach is introduced to diagnose fault via sparse random projection and K-nearest neighbor classifier for analog circuit in this paper. e proposed method not only can reduce the computational complexity and storage space but also approximately guarantee the advantages of KNN classifier in dealing with the problems of component tolerance and nonlinearity that often exist in analog circuit.

Sparse Random Projections.
Random projections are an approximate algorithm for estimating distances between pairs of points in a high-dimensional vector space. It uses a suitable scale random matrix whose columns have unit lengths to project the high-dimensional feature vector down to a much lower-dimensional subspace, thus achieving the dimensional reduction of the original data set. Random projections are extremely suitable for applications of high dimension and limited samples [30]. Recently, it has been extensively applied in several areas, such as machine learning, image processing, and compressed sensing. e random projections algorithm is implemented as follows.
Let X d×n be an original high-dimensional matrix, where d is the dimensionality. Let R k×d be random projection matrix, where k ≤ d. e transformation of dimensionality reduction is given by the following equation: where X RP k×N is a low-dimensional matrix obtained after random projections. Random projections reduce data dimension, while approximately preserving the distance between pairs of mapping points in the Euclidean space. e data vectors in the low-dimensional matrix have important characteristic information of original data vectors. erefore, random projections preserve the similarities of data vectors to a high degree. is theory can be derived from the famous JL (Johnson-Lindenstrauss) theorem. JL theorem is defined as follows: where W is an arbitrary dataset in d-dimensional Euclidean space. ere is a map f: R d ⟶ R k , and any two data u and v in set W satisfy the following formula: JL theorem indicates that n data in high-dimensional Euclidean space can map into O(log n/ε 2 ) dimensional subspace, and the distance between these data after projection is still approximate. e change distance is within 1 ± ε disturbance bound. e above analysis shows that the key to achieving data dimensionality reduction using the random projections method is to determine the appropriate random projections matrix. At present, the Gaussian random matrix is commonly used. Each of its elements is independent and subject to standard normal distribution. However, the Gaussian random matrix is more complicated for constructing largescale random matrices and has a higher computational complexity for the projection operation of data. Bingham et al. [31] proposed that two simple distributions produce a random projections matrix. e elements are independent of each other in the Gaussian random matrix. eir values will be present in the form as follows: Scientific Programming e above two distributions greatly reduce the computational complexity of random projections matrix mapping conversion. Especially in equation (5), it can be seen from the construction that the matrix is very sparse. e elements in matrix have values of 0 with probability 2/3, and 2/3 projection calculated amount can be saved. So, the operation is faster. e sparse random projections matrix is proposed in this paper.

K-Nearest
Neighbor. KNN is a supervised classifier. is algorithm calculates the similarity between the data samples and all neighbors and finds the k most similar samples. is algorithm classifies a new entity based on decision [32]. e time required may be significantly reduced by using the dimensionality reduction while still maintaining a high accuracy in KNN. Assume that the fault sample to be di- e category set is C � c l |l � 1, 2, · · · , m , where training sample x i is a p-dimensional column vector and c i is the category label corresponding to x i . Steps in KNN classifier algorithms are as follows: (1) Calculate the distance between the samples X s to be classified and all training samples. Euclidean distance, Manhattan distance, and Minkowski distance are usually used as the distance measured between the test object and every object in the set of training objects. Euclidean distance function is used in this paper.
(2) Select nearest neighbor parameter k. Find K-nearest neighbor samples X s according to the calculated Euclidean distance, and it is written as follows: Q s � (x sj , c sj )|j � 1, 2, · · · , k , where x sj is the jth (1 ≤ j ≤ k) nearest neighbor sample of the sample X s to be classified and c sj is the category corresponding to x sj . (3) Vote based on the category information of the K-nearest neighbor samples in Q s . e result of the vote is written as follows: To make decisions according to the voting results, the decision rule is as follows:

Analog Circuit Fault Diagnosis Model Based on SRP-KNN
Use four-opamp biquad high-pass filter circuit shown in Figure 1 as example to introduce the analog circuit soft fault diagnosis method based on SRP-KNN. ere are four opamps, two capacitors, and ten resistors in four-opamp biquad high-pass filter circuit. Capacitors and resistors are used as fault components to diagnose.

Experiment Results and
Analysis of Simulation e example for analog circuit is a four-opamp biquad highpass filter, which is shown as Figure 1. It consists of 4 operational amplifiers, 2 capacitors, and 10 resistors. e nominal value of each component is indicated in Figure 1 wherein the resistor and capacitor each has a tolerance of 1%. If the values of resistor and capacitor are outside the tolerance range and are within 50%, then the circuit is considered to have a soft fault.
Select C 1 , C 2 , R 1 , R 2 , R 3 , and R 4 as diagnostic components by sensitivity analysis. e soft fault of each component has two modes: a large soft fault and a small soft fault. Use ↑ to indicate that the component has a large fault and ↓ to indicate that the component has a small fault. ere are 13 soft fault modes including fault-free state (NF), which are listed in Table 1.
OrCAD10.5 software is used to produce the simulation fault data according to the fault modes in Table 1. e circuit is inputted a pulse stimulus with the amplitude of 5 V and   Let the quadratic sum of each frequency band signal decomposed by wavelet packet be the wavelet packet energy spectrum. Assume d i,j (k) denotes the signal decomposed by wavelet packet. e energy of the signal in each frequency band is given by where N denotes the length of original signal. Let the wavelet packet energy spectrum be E, which is constituted of all E i,j as follows: When the energy is large, it can be normalized as follows: e feature vector is defined as follows: 50 samples are collected for each fault model, and each sample has 8 attributes. Partial fault features of the wavelet packet energy spectrum are shown as Figure 6, where x-axis represents eight bands by three-layer wavelet packet decomposition, y-axis represents analog circuit fault category, and z-axis represents energy value by wavelet packet decomposition.
In order to reduce redundancy and improve the recognition rate of analog circuit fault diagnosis, the sparse random projections algorithm mentioned above is used to further extract the fault features of analog circuit. Figure 7 is a three-dimensional fault information distribution map extracted with sparse random projections.
Each fault feature is clearly divided in Figure 7. It shows that the sparse random projections feature extraction algorithm can reflect the essence of analog circuit faults and has better clustering and distinguishing ability for analog circuit faults, which creates a good condition for subsequent fault diagnosis.
In order to diagnosis circuit fault through KNN classifier, the extracted fault features are divided into two data sets. 30 samples are used as training data, and the rest 20 sample are test data. e total training data and test data are 390 and 260, respectively. Table 2 lists diagnosis results of four-opamp biquad high-pass filter circuit using different classifiers. From Table 2, the proposed method diagnoses all kinds of faults correctly. It achieves 100% classification. e accuracy rate of RBF classifier is 65.77%, and the fuzzy fault number is 8. e result of SVM is 81.92%. Its fuzzy fault number is 9. e accuracy rate of BayesNet and decision tree is 97.31% and 96.54%, respectively, and the fuzzy fault number is 4 and 5, respectively. Obviously, the proposed method is better than other methods.
Fuzzy fault sets are listed in Table 3. e SRP-KNN method obtains the least fuzzy faults. RBF classifier cannot       In order to further illustrate the superiority of the proposed method, white noise is added to the fault information. In order to reflect the randomness of noise, the experiment is repeated ten times, and the average value of the ten experiments is recorded as the final diagnosis result. Table 4 lists diagnosis results in the noisy environment.
From Table 4, the accuracy of fault diagnosis has decreased slightly in the noisy environment. is shows that noise can affect the results of analog circuit fault diagnosis. e accuracy rate of the proposed method is 99.5%. e accuracy rate of BayesNet and decision tree is 96.19% and 96.27%, respectively. e accuracy rate of SVM is only 75.62%, which is much lower. e proposed method can diagnose eight fault modes, and BayesNet can only diagnose three fault modes. None of the fault modes can be completely diagnosed correctly by decision tree and SVM. It can be seen that SVM performs the worst in the noisy environment.
Fault diagnosis accuracy rate curves of ten experiments in noisy environment are drawn in Figure 8. From Figure 8, the accuracy rate of the proposed method is always the highest, and it is 100% in seven experiments. e accuracy rate of BayesNet, decision tree, and SVM is significantly lower than that of the proposed method. In addition, the accuracy rate of BayesNet, decision tree, and SVM fluctuates greatly. It indicates that these methods are more sensitive to noise. erefore, the proposed method is significantly better than BayesNet, decision tree, and SVM in noisy environment. In summary, the fault diagnosis results prove that the introduced method can more effectively diagnose soft faults for analog circuit.

Conclusion
In this paper, sparse random projections and K-nearest neighbor classifier techniques are applied for fault diagnosis in analog circuit. e study indicates that the preprocessing technique has a significant impact on fault diagnosis of   analog circuit. e proposed method uses the wavelet packet energy spectrum and sparse random projections as preprocessor to extract analog circuit fault feature. It is contributed to reduce noise interference and test cost in fault diagnosis, and dimensionality reduction using SPR can lead to more effective KNN classification. Experiment results show that the introduced SRP-KNN-based method performs better than existing methods for analog circuit fault diagnosis even when noise is added. According analog circuit theory, the response of the nonlinear system is different from that of the linear system. Hence, the proposed method will be studied to diagnose nonlinear circuit fault in our further research.

Data Availability
e data used to support the findings of this study are available from the author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest.