# Multi-Head Self-Attention-Based Fully Convolutional Network for RUL Prediction of Turbofan Engines
## 4 RUL Prediction Experiment
### Data Preprocessing  
#### 4.2.1 Training Datasets  
First, sensor data selection refers to the selection of historical sensor data. Not all sensor data in the dataset are utilized as training and testing samples. Actually, there are some sensor data that do not change significantly with the time series or even remain constant. These data are hardly helpful for predicting RUL and should be removed during sensor data selection. Referring to studies [28; 30], 14 sensor data points of FD002 and FD004, i.e., sensor data numbered 2, 3, 4, 7, 8, 9, 11, 12, 13, 14, 15, 17, 20, and 21, are selected to generate training and testing samples for RUL prediction. The selected sensor data are summarized in Table 2. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Sub-Datasets** & **FD002** & **FD004** \\ \hline Operational conditions & 6 & 6 \\ Fault modes & 1 (HPC degradation) & 2 (HPC degradation, fan degradation) \\ Training engines & 260 & 249 \\ Test engines & 259 & 248 \\ Training samples & 48,559 & 56,567 \\ Test samples & 259 & 248 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Summary of FD002 and FD004. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Number** & **Symbol** & **Brief Introduction** & **Unit** \\ \hline
2 & T24 & Total temperature at LPC outlet & \({}^{\circ}\)R \\
3 & T30 & Total temperature at HPC outlet & \({}^{\circ}\)R \\
4 & T50 & Total temperature at LPT outlet & \({}^{\circ}\)R \\
7 & P30 & Total pressure at HPC outlet & psia \\
8 & Nf & Physical fan speed & rpm \\
9 & Nc & Physical core speed & rpm \\
11 & Ps30 & Static pressure at HPC outlet & psia \\
12 & phi & Ratio of fuel flow to Ps30 & pps/psi \\
13 & NRf & Corrected fan speed & rpm \\
14 & NRc & Corrected core speed & rpm \\
15 & BPR & Bypass ratio & None \\
17 & htBleed & Bleed enthalpy & None \\
20 & W31 & HPT coolant bleed & lbm/s \\
21 & W32 & LPT coolant bleed & lbm/s \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Summary of the selected sensor data. Then, data normalization is used to process the selected sensor data. Commonly, data in a small range have stronger sensitivity, which helps to accelerate the training process and enhance the perception of the data by the neural network. Therefore, it is necessary to use data normalization to limit the range of the data. The data to be processed are expressed as Equation (19). \[H=\left[H^{1},\ldots,H^{s},\ldots,H^{N_{s}}\right],H^{s}=\left[h^{s}_{1},\ldots,h^{s}_{t},\ldots,h^{s}_{L_{T}}\right]^{T}, \tag{19}\]  
where \(H^{s}\), \(h^{s}_{t}\), \(L_{T}\), and \(N_{S}\) represent the \(s\)th sensor data, the \(t\)th time step data point in the \(s\)th sensor data, the length of the time series, and the number of sensors, respectively. This paper adopts the min-max scaler to normalize each data point to the range of \([0,1]\), which can be calculated by Equation (20). \[\overline{h}^{s}_{t}=\left[\left(h^{s}_{t}-h^{s}_{min}\right)/\left(h^{s}_{ max}-h^{s}_{min}\right)\right]\times\left(bound_{upper}-bound_{lower} \right)+bound_{lower}, \tag{20}\]  
where \(\overline{h}^{s}_{t}\), \(h^{s}_{min}\), \(h^{s}_{max}\), \(bound_{lower}\), and \(bound_{upper}\) represent the normalized data point, the minimum data point in the \(s\)th sensor data, the maximum data point in the \(s\)th sensor data, the lower bound of the range, and the upper bound of the range, respectively. After the normalization, all normalized data points can be expressed as Equation (21). \[\overline{H}=\left[\overline{H}^{1},\ldots,\overline{H}^{s},\ldots,\overline {H}^{N_{s}}\right],\overline{H}^{s}=\left[\overline{h}^{s}_{1},\ldots, \overline{h}^{s}_{t},\ldots,\overline{h}^{s}_{L_{T}}\right]^{T}. \tag{21}\]  
After that, as shown in Figure 6, a sliding time window operation [22; 24; 33] is used to process the normalized data. There are temporal dependencies among data points of the normalized data. Therefore, it is vital to capture these dependencies, and the sliding time window operation is utilized to accomplish this task. The \(i\)th sample obtained by the operation can be expressed as Equation (22).