## 4 Experiment
### Wiener-LSTM Training and Optimization  
A Wiener-LSTM model with PSO optimization is proposed to control the uncertainty and improve the accuracy of the prediction RUL simultaneously. In the training process, the time-domain feature RMS of the vibration signal is calculated first. Then, the data are generated according to the data augmentation model for model training. In the testing process, the RMS of the testing vibration signal is sent to the predictor which has trained in the training process. Then, the predicted RUL of the testing data can be given by the predictor automatically. The prediction uncertainty model of the predicted RUL is introduced in the LSTM network. When the loss function (introduced in Equation (23)) is used in the LSTM model. The training sample of the Wiener-LSTM should be a sequence of data such as \(x_{0,t}\), which is different from the point prediction that one training sample is one data at time \(t\). Thus, the relationship of the difference of predicted RUL \(\alpha_{t+1}-\alpha_{t},\alpha_{t}-\alpha_{t-1}....\) can be established and introduced in the LSTM model.  
A randomly under-sample method based on mini-batch is implemented in the training process, which is different from the normal LSTM training process with the same training sample in every epoch. Fixed-length sub-sequence from every input sequence is used to form a data batch. The fixed length of the sub-sequence is set for the minimum of the length of the input sequences. The under-sampling method in each minibatch can guarantee the independence of the statistical process and make full use of each sequence of data. The fixed length of the sub-sequence is set for 99 (to make full use of each sequence data among under-sample, the fixed-length equals the minimum value of the lifetime data minus one). The process of the under-sample method based on mini-batch follows three steps: (1) under-sampling method is implemented to get the training sample \(X_{i}\); (2) \(c\) value is updated by Equation (22); and (3) parameters \(\Theta\) are updated by the Adam algorithms. The algorithm of the under-sample method based on mini-batch is in Algorithm 1.  
```
0: Training data \(X\), corresponding RUL \(r\), epoch of training process \(I\)
1:initialization \(\Theta\) and \(c\) of the network.
2: If i<I
3:\(X_{i}\) are under-sampled on training data \(X\).
4: Update parameter \(c\) by Equation (22)
5: Update parameter \(\Theta\) by random gradient descent algorithm by the loss function in Equation (23)
6: End
7:return(\(\Theta^{*}\), \(c^{*}\))=argmin(log(loss(\(\Theta\), \(c\), \(X\)))).
8:\(\Theta^{*},c^{*}\)
```  
**Algorithm 1**Down-sample algorithm based on mini-batch  
The structure of the LSTM model contains two layers: one LSTM layer and one fully-connected layer. After the optimization by the PSO algorithm, the optimal number of neurons in LSTM is set for 64. The optimal dropout rate is 0.23, and the optimal learning rate is 0.02; the activation function is ReLU. In the fully-connected layer, the number of neurons is set for 1, and the activation function is sigmoid. The input of the Wiener-LSTM model is (250, 99, 1). The number of the training sample is 250, the length of each sub-sequence under-sampled in each epoch is 99, and the feature of input data is 1. The label of the training data is (250, 99), which is the corresponding RUL of training samples.  
The loss functions of Wiener-LSTM model among epochs are shown in Figure 8. The \(X\)-axis represents the magnitude of the loss function. As shown in Figure 8 from the first to the 20 th epoch, the Wiener-LSTM model'straining loss function dramatically decreased. From the 20 th to the 60 th epoch, the loss function continues slowly degrade. The loss function gradually finds convergence from the 60 th to the 80 th epoch.