# Latent Dimensions of Auto-Encoder as Robust Features for Inter-Conditional Bearing Fault Diagnosis
## 4 Proposed Method
### Auto-Encoder for Feature Extractor  
From the studied literature, it is evident that the generic features extracted based on statistical methods do not provide much robustness across the conditions. Unlike the statistical methods from the literature, here we investigated the usage of latent features of an Auto-Encoder (AE) for designing a classifier that can be robust across conditions. Auto-Encoder Architecture  
Convolution layers have empowered many deep learning algorithms in computer vision tasks and have followed the trend with one-dimensional data alike. In our approach,  
Figure 4: Structure of the proposed method train (**a**) and test (**b**). Note that every module that can be trained in the proposed methodology will be trained using only one condition’s data. Figure 3: Random observations of various faults from raw data (X-axis: sample number, Y-axis: g) and frequency transformed data (X-axis: Harmonic order (HZ), Y-axis: g) of (**a**) CWRU and (**b**) Paderborn dataset. we use convolutional layers as the feature extractors followed by dense network layers for further learning. Contrary to the typical implementation of CNN for bearing fault feature extraction, we employ a Multi-Layer Convolutional AE network (MLCAE). This makes network training feasible without the class labels. The architecture of MLCAE has multiple things to consider. As the original application of this work is to perform fault detection on resource-constrained devices, our main criteria will be to keep the network simple while not losing the prediction accuracies. By simple we mean as few parameters as possible to compute the necessary features for appropriate cross-domain fault detection. After parameter tuning, a 7-layered convolutional AE structure was found to be producing good results in terms of fault detection accuracy. Thus, a similar convolutional AE architecture was used for all the experiments going forward. The structure of the AE is detailed below. The Encoder \((E_{i})\) and Decoder \((DE_{i})\) networks of an AE are generally understood as,  
\[E_{i}:X_{i}\mapsto F_{i}\]  
\[DE_{i}:F_{i}\mapsto X_{i}^{{}^{\prime}}\]  
where \(i\) is the unique condition of the considered dataset, \(X\) is the input data, \(F\) is the compressed representation or latent features of \(X_{i}\) and \(X_{i}^{{}^{\prime}}\) is the reconstructed output from latent features. The optimization of networks \(E_{i}\) and \(DE_{i}\) is performed through backpropagation while minimizing the objective function 'Mean Squared Error loss':  
\[E_{i},DE_{i}=argmin\Big{(}\frac{1}{N}\Sigma_{i=1}^{N}(X_{i}-X_{i}^{{}^{\prime} })^{2}\Big{)} \tag{1}\]  
where \(N\) represents the batch size. The first part of the AE, an encoder \(E_{i}\), compresses input data \(X_{i}\) to \(F_{i}\) using several convolution, pooling, flatten and dense layers. Output of each layer differs based on the type of the layer. In this paper, the first layer is a 1D convolution layer followed by a pooling layer. Here, the convolution layer extracts features by performing convolution operations, and a pooling operation reduces the number of parameters from convolution layer and avoids over-fitting. Outputs of a \(l\)th combination of convolution and pooling layer can be defined as  
\[X_{i}^{l}=pool(\sigma(X_{i}^{l-1}*k^{l}+b^{l}))\]  
Here, \(pool\) represents an average pooling layer, \(\sigma\) represents an activation function \(relu\), \(*\) represents a convolution operation, \(k\) is the kernel and \(b\) is the biases of the layer \(l\). In the Encoder, there are two such combinational layers which are followed by a flatten layer and two dense layers. The last of the dense layers in the encoder network provides the latent representation \(F_{i}\) of the input \(X_{i}\).