# A Fault Detection Framework for Rotating Machinery with a Spectrogram and Convolutional Autoencoder
## 3 Proposed Framework
### OCC Algorithm with Extracted Features from 2D-CAE for Fault Detection
The probability distribution function of \(z_{new}\) can be computed as follows:  
\[P(z_{new})=\sum_{i=1}^{K}w_{i}P(z_{new}|\mu_{i},\ \Sigma_{i}), \tag{10}\]  
where \(K\) is the number of Gaussian probability distribution components and \(w_{i}\) is a weight of the \(i\)-th component. Furthermore, \(\mu_{i}\) and \(\Sigma_{i}\) represent the mean vector and covariance matrix of the latent feature vectors in the training target class corresponding to the \(i\)-th Gaussian probability distribution component. The parameters of all Gaussian probability distribution components are estimated by maximum likelihood estimation (MLE) with the expectation maximization (EM) algorithm. Then, the signal having a high probability distribution function value is classified as a target class, and vice versa for signals with a low probability distribution function value. _Parzen window density estimation (PWDE)_: The PWDE is another probabilistic approach to estimate the probability distribution function of given samples. This algorithm estimates the probability distribution function through kernel functions representing the contribution of individual training samples to generate the probability distribution of the target class. In this study, the probability distribution function of \(z_{new},f(z_{new})\) can be described as follows:  
\[f(z_{new})=\frac{1}{N\sigma}{\sum\limits_{i=1}^{N}{K\left({\frac{{z_{new}-z_{i}}} {\sigma}}\right)}}, \tag{11}\]  
where \(N\) and \(z_{i}\) are the number of latent feature vectors of the training data and the \(i\)-th training latent feature vector, respectively. In addition, \(K(\cdot)\) means a kernel function, and \(\sigma\) denotes its bandwidth parameter. The bandwidth parameter of the kernel function plays the role of a smoothing parameter which determines the shape of the probability distribution function. A new latent feature vector having small \(f(z_{new})\) value is rejected as a fault signal. _One-class support vector machine (OCSVM)_: The support vector-based OCC algorithms directly build a decision boundary separating the majority of the target class and potential anomalous samples. The support vector-based methods attempt to involve the majority of the target class within the decision boundary, and they prevent the decision boundary from rejecting excessively large numbers of target samples as anomalies. In addition, they also employ nonlinear feature mapping into a high or infinite dimensional space, and it helps to build a flexible boundary. The most eminent support vector-based OCC algorithm is OCSVM. In this study, the OCSVM defines the decision boundary as a hyperplane farthest from the origin, above which most of the latent feature vectors of the training target class are placed. The optimal hyperplane in the OCSVM, \(w^{T}\varphi(z)-b=0\), can be obtained by solving the following optimization problem:  
\[\begin{array}{c}\underset{w,b,z}{\text{min}}\frac{1}{2}w^{T}w-b+\frac{1}{wn} \sum\limits_{i=1}^{n}{\varepsilon_{i}}\\ s.t.\;\;w^{T}\varphi(z_{i})-b\geq-{\varepsilon_  
\[s(z_{new})=2^{-\frac{\frac{1}{2}\sum_{i=1}^{B}\sum_{i=1}^{B}ln(z_{new})}{s(i)}}, \tag{13}\]  
where \(B\) and \(n\) are the number of isolation trees and latent feature vectors in the training target class, respectively. Additionally, \(h_{i}(z_{new})\) denotes the path length to the leaf node of \(z_{new}\) in the \(i\)-th isolation tree, and \(c(n)\) is the average path length of an unsuccessful search in a binary search tree and used to normalize \(h(\cdot)\), which is calculated as follows:  
\[c(n)=2H(n-1)-(2(n-1)/n), \tag{14}\]  
where \(H(\cdot)\) denotes the harmonic number and is estimated as \(H(n-1)=ln(n-1)+0.5772156649\) ([PERSON]'s constant). If a new latent feature vector is located in the region where the training latent feature vectors are clustered, many splits are required to isolate it, and thus the new latent feature vector will have a large anomaly score, \(s(z_{new})\).