# Machinery Fault Signal Detection with Deep One-Class Classification
## 3 Fault Signal Detection with Deep Support Vector Data Description
Soft-boundary deep SVDD  
In the Soft-boundary deep SVDD model, the loss function is defined as follows:  
\[\underset{R,W}{minimizeR^{2}}+\frac{1}{\
u n}\underset{i=1}{\sum}\max\{0,\| \phi(x_{i};\mathcal{W})-c\|^{2}-R^{2}\}+\frac{\lambda}{2}\underset{\ell=1}{ \sum}\left\|\mathcal{W}^{\ell}\right\|_{F}^{2}, \tag{6}\]  
\(R\) represents the radius of hypersphere in the latent feature space, and \(\phi(x_{i};\mathcal{W})\) denotes the mapped signal to the \(q\)-dimensional latent feature space by neural network structures. In addition, \(c\) is the center of the hypersphere, and \(\mathcal{W}\) represents the weight set of the neural network structures, \(\left\{\mathcal{W}^{1},\ldots,\mathcal{W}^{L}\right\}\). In this loss function, the first term minimizes \(R^{2}\) to find the smallest volume of the hypersphere that can enclose most of the target signal data. The second term is a slack term that allows for a few false positive errors that some mapped signals can be located outside the hypersphere. By adding the second term, the deep SVDD encourages the exclusion of a couple of anomalous target signals and prevents too many fault signals from being accepted as target signals. In this term, the slack hyperparameter \(\
u\in(0,1]\) controls the trade-off between the size of the hypersphere and errors of the deep SVDD model. Finally, the third term is a weight decay regularizer for neural network weights \(\mathcal{W}\) with the hyperparameter \(\lambda>0\), where \(\|\cdot\|_{F}^{2}\) indicates the Frobenius norm. By adopting the third term, the overfitting problem of the deep neural network structures can be alleviated. 2. One-class deep SVDD  
Under the assumption that the training data comprise only target signals, minimizing the size of the hypersphere enclosing most of the target signals in the latent feature space can be regarded as minimizing the average distances from the center of the hypersphere to the target signals. Thus, the first and second terms in the soft-boundary deep SVDD can be integrated as the sum of the average distance between the center and all training target signals in the latent feature space. Then, the one-class deep SVDD model can be formulated as follows:  
\[\underset{R,W}{minimize}\frac{1}{n}\underset{i=1}{\sum}\|\phi(x_{i};\mathcal{ W})-c\|^{2}+\frac{\lambda}{2}\underset{\ell=1}{\sum}\left\|\mathcal{W}^{\ell} \right\|_{F}^{2}. \tag{7}\]  
In the above equation, the first term attempts to minimize the average distance between the center and all training target signals in the \(q\)-dimensional latent feature space. Through this term, the neural network weights \(\mathcal{W}\) can be updated to find latent feature space more specialized for fault signal detection in that it encourages the building of a compact decision boundary on the target signals. Compared with the soft-boundary deep SVDD, one-classdeep SVDD can build ma more compact decision boundary by ignoring the slacks in Equation (5). Besides, the second term helps to prevent the overfitting risk, the same as the soft-boundary deep SVDD formulation. Finally, one-class deep SVDD does not require hyperparameter in that the first and second terms of the soft-boundary deep SVDD are integrated. Please note that in the deep SVDD, the hypersphere center \(c\) should not be a free variable to prevent trivial solutions from having all zero values. That is to say, if the hypersphere center \(c\) is allowed to update during training of deep SVDD, \(c\) is estimated at zero values, and the hypersphere radius also nearly converges into zero. This problem is referred to as hypersphere collapse [12]. To avoid this problem, the hypersphere center \(c\) is calculated as the mean vector of the mapped signal \(\phi(x_{i};\psi)\) into the initial latent space obtained from the pre-training procedure for the encoding part of 1D-CAE. Once it is calculated, the hypersphere center \(c\) is then fixed during the fine-tuning procedure.