## 2 RUL Prediction for Rails Based on CNNBiLSTM-RSA
### Feature Extraction Module  
The use of expert knowledge to determine the rail degradation to manage the full life-cycle data of the rail can increase the interference of artificial factors to a certain extent. Allowing the feature extraction module to adaptively learn the fault features without any signal processing to a certain extent can avoid processing the original sample data, thereby reducing the impact of artificial factors. The CNN-BiLSTM module is constructed and includes a convolutional layer, ReLU, MAXpool, and BiLSTM layer. The rail vibration signal belongs to the single-dimensional time series signal, for which 1 DCNN is usually used. A typical 1 DCNN structure is illustrated in Figure 2. The input vibration signal is expressed as \(X=[x_{1},x_{2},\cdots x_{N}]\). Features in different regions are extracted by multiple one-dimensional convolution kernels. The convolution operation is defined as follows:  
\[X_{i}=f_{i}(w^{T}x_{i-1}+b_{i}), \tag{1}\]  
where \(b_{i}\) and \(f_{i}\) denote the bias term and activation function, respectively. The ReLU function is expressed in the following form:  
\[f(X)=\max(0,X). \tag{2}\]  
Then, the features extracted through the convolution calculation are used as inputs for the pooling layer, the sequence is downsized, the network model is simplified by pooling calculation, and the maximum pooling is selected in this paper. A multi-layer convolutional layer and pooling layer are designed. This allows the characteristics of the rail vibration signal to be effectively extracted. Finally, the output of the pooling layer is used as the input for the fully connected layer. However, CNNs have a weak ability to associate features in long sequence information [29]. Although CNN has the ability to automatically extract features from data, it is less capable of handling time-series data with strong time dependence; in contrast, LSTM can effectively solve the long-term dependence problem due to the introduction of gating units. By combining the two, the extraction of spatial and temporal features can be enhanced and the computation time can be relatively reduced. BiLSTM and LSTM are both variants of RNNs (recurrent neural networks), which can effectively avoid the long-term dependency problem caused by gradient vanishing or gradient explosion during the training process of RNN [30]. Compared to the RNN, the LSTM enables the learning of long-term memory through gating units. Many studies have demonstrated that LSTM is effective in dealing with the temporal relationship between inputs and outputs and in learning the data correlation of the time series [31]. LSTM maintains the current recurrent neuron state based on the current inputs and the previous recurrent neuron states. The LSTM unit introduces four gating units defined as the input gate, the output gate, the forgetting  
Figure 2: Structure diagram of CNN. gate, and the self-recycling memory unit in order to control the different memory units in their information flow interactions with each other [32]. In the hidden unit, the forgetting gate chooses which state information to keep or forget from previous time steps; the input gate determines what pattern of input vectors needs to be fed into that memory cell state; by comparison, the output gate controls how it changes other memory cell states. It is assumed that \(X_{t}\) and \(H_{t}\) denote sequential input data and cyclic output state at time step t, respectively. The gate, hidden output, and cell state are expressed as follows:  
\[\left\{ \begin{array}{l}I_{t}=\sigma(U_{t}X_{t}+W_{t}H_{t-1}+b_{t}),\\ F_{t}=\sigma(U_{f}X_{t}+W_{f}H_{t-1}+b_{f}),\\ O_{t}=\sigma(U_{o}X_{t}+W_{o}H_{t-1}+b_{o}),\\ \widetilde{C}_{t}=\tanh(U_{c}X_{t}+W_{c}H_{t-1}+b_{c}),\\ C_{t}=F_{t}\otimes C_{t-1}+l_{t}\otimes\widetilde{C}_{t},\\ H_{t}=O_{t}\otimes\tanh(C_{t}),\end{array} \right. \tag{3}\]  
where \(U\) denotes the weight matrix of the respective gate; \(W_{i}\), \(W_{f}\), \(W_{o}\), and \(W_{c}\) denote the corresponding recursive weight matrix of the respective gate.