# Multi-Head Self-Attention-Based Fully Convolutional Network for RUL Prediction of Turbofan Engines
## 4 RUL Prediction Experiment
### Experimental Metrics  
In this paper, both the Root Mean Squared Error (RMSE) and Score (referenced as [35]) are used as performance metrics to evaluate the performance of MSA-FCN.  
RMSE reflects the accuracy of the RUL prediction model. Therefore, the corresponding model should aim to achieve as low RMSE values as possible. RMSE can be represented by Equation (25).  
\[\text{RMSE}=\sqrt{\frac{1}{N_{tes}}{\sum_{i=1}^{N_{tes}}}{\left({y_{i}^{pre,tes }-y_{i}^{tes}}\right)^{2}}}, \tag{25}\]  
where \(N_{tes}\), \(y_{i}^{pre,tes}\), and \(y_{i}^{tes}\) represent the number of the testing samples, the predicted RUL of the \(i\)th testing sample, and the RUL label of the \(i\)th testing sample, respectively.  
The Score Function [35] is used in RUL prediction to evaluate the timeliness of model predictions. When the model's predicted RUL lags behind the actual RUL, such prediction lags may cause potential engine failures to be overlooked, which can lead to serious related accidents. The Score Function processes prediction lags through a penalty mechanism, assigning a higher Score to relevant predictions. Specifically, the Score Function captures any deviation between the predicted RUL and the actual value, assigning a corresponding penalty coefficient based on the degree of deviation. When the predicted value lags behind the actual value, the penalty coefficient increases, resulting in a relatively higher Score. Conversely, when the predicted value is ahead of or equal to the actual value, the penalty coefficient is smaller, resulting in a relatively lower Score. Therefore, to improve the timeliness of RUL predictions, prediction models should strive to achieve the lowest possible Score. The Score Function and Score can be calculated using Equation (26) and Equation (27), respectively.  
\[s_{i}=\begin{cases}\exp(y_{i}^{pre,tes}-y_{i}^{pre,tes})/13-1,\ \ if\ y_{i}^{pre,tes}<y_{i}^{tes}\\ \exp(y_{i}^{pred,tes}-y_{i}^{pos})/10-1,\ \ if\ y_{i}^{pre,tes}\geq y_{i}^{tes} \end{cases}, \tag{26}\]  
\[\text{Score}=\sum_{i=1}^{N_{tes}}s_{i}. \tag{27}\]  
To reduce randomness during training and verify the stability of MSA-FCN, the results reported in subsequent sections are based on the mean (mean) and standard deviation (STD) of ten independent experiments.  
In addition, Equation (28) is used in this paper to calculate the numerical reduction range of each performance metric.  
\[reduction=[1-(Result\ A/Result\ B)]\times 100 \tag{28}\]  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**DMSAM\_Data** & **MHFCN** & **DMSAM\_Features** & **MLPM** \\ \hline Key dimension = 8 & Filters of each layer = 14 & Key dimension = 8 & Neurons of first layer = 30 \\ Query dimension = 8 & Kernel size of each layer = 3 & Query dimension = 8 & Neurons of second layer = 17 \\ Value dimension = 8 & Layers of each head = 4 & Value dimension = 8 & Neurons of third layer = 1 \\ Number of heads = 6 & Number of heads = 3 & Number of heads = 24 & Dropout rate = 0.5 \\ Dropout rate = 0.5 & Dropout rate = 0.5 & \\ \hline \hline \end{tabular}
\end{table}
Table 3: Summary of MSA-FCN’s model parameters.