## 3 Methods
### Introduction of the SAES-DNN Model  
Compared with shallow machine learning, deep multi-layer models are better at reflecting essential data characteristics. The characteristics of a deep belief network [44], for example, include easy training and learning optimization as well as advantages of a deep network structure. Based on the DBN (Deep Belief Nets) network structure, we developed a deep learning neural network model for train fault diagnosis by using a stacked auto-encoder [45] composed of a sparse auto-encoder and DNN network. We define the network model as SAES-DNN, where SAE refers to the sparse auto-encoder, and network refers to the deep network composed of multiple sparse auto-encoders. The network structure is shown in Figure 3. The SAES-DNN model contains multiple hidden layers and is composed of a series of SAEs (sparse auto-encoders) stacked in a certain way. For each SAE unit, considering that the input data is the sampling sequence of the train sensor in a certain period of time, we designed the middle layer of the network in the form of a full connection. Compared with the traditional signal feature processing method, the encoder has better feature expression technology, which can greatly reduce the data integrity labeling requirement in the process of neural network training. A single sparse auto-encoder can minimize the reconstruction error by adding a penalty factor. Our SAES-DNN model uses the feature of a sparse auto-encoder to learn hidden information in the process of data reconstruction and keep extracted features in the hidden layer. The automatic encoder was then trained greedily layer by layer, and the data was reconstructed through the decoder decoding process to minimize reconstruction error. A sparse auto-encoder is a kind of derived automatic encoder with specific functions due to added constraints. The mechanism of decreasing the number of neurons can retain the original function in a quicker and more efficient manner. Since original train fault data information is usually miscellaneous and high-dimensional, a sparse auto-encoder is used as the AE portion in  
Figure 3: SAES-DNN network model structure. The model consists of SAEs and a DNN. The DNN adjusts the weight parameters of the model through feedback training, and the SAEs reduce the dimension of feature dimension through coding. our model. For the SAEs, we define the sample data set as \(\{x_{1},x_{2},\ldots,x_{n}\}\) and define the average activity of the j neuron in its hidden layer as follows:  
\[\hat{\rho}_{j}=\frac{1}{N}\sum_{i=1}^{N}[a_{j}(x^{(i)})] \tag{1}\]  
where \(a_{j}\Big{(}x^{(i)}\Big{)}\) is the activation degree of a sample on the number j hidden neuron. To ensure that the hidden layer meets the sparsity constraint, we tried to make \(\hat{\rho}_{j}=\rho_{j}\), with \(\hat{\rho}_{j}\) representing the sparsity parameter, which was set to 0.06 in this study. To achieve constraint adjustment, an additional penalty factor was added to the optimization objective function based on the relative entropy method, which is defined as follows:  
\[\sum_{j=1}^{m}KL\big{(}\rho\parallel\hat{\rho}_{j}\big{)}=\sum_{j=1}^{m}\left( \rho\log\frac{\rho}{\hat{\rho}_{j}}+(1-\rho)\log\frac{1-\rho}{1-\hat{\rho}_{j}}\right) \tag{2}\]  
where m is the number of neurons in the hidden layer, and index j represents the number \(j\) neuron in the hidden layer. When \(\hat{\rho}_{j}=\rho_{j}\), the penalty factor \(KL\) is the minimum. The overall loss function of the sparse auto-encode is defined as follows, where \(\beta\) is the weight coefficient of the sparsity penalty factor. The definition of the loss function of a single sparse auto-encoder is shown in Equation (4), where \(\beta\) is the weight coefficient of the sparsity penalty factor, and \(J(W,b)\) is the definition of the loss function without sparsity constraint, which is composed of the mean square error term and the weight attenuation rule term.