## 4 Experiment Results and Discussion
### Experiment Results
#### 4.2.3 Experiment 3  
As mentioned in Section 4.2.2, the LSTM model obtained the best accuracy among three approach models. Hence, the LSTM model is selected to measure memory profiles in two cases. Case 1 calculates memory profiles on complete feature dataset of LSTM model. Case 2 calculates memory profiles on the best feature subset generated by SFSDT model of LSTM model. The memory profile reports to the memory used (in MiB unit) and time executed (in the second unit) of Python scripts. This experiment performed to measure running an executable of learning model, recording memory usage and plotting the recorded memory usage. Figure 15: Confusion matrix results of three approach models RNN, LSTM, and GRU on ISCX selected feature subset. (**a–c**) on Tuesday, (**d–f**) on Wednesday, (**g–i**) on Thursday. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **Attack** & **RNN** & **LSTM** & **GRU** \\ \hline \multirow{4}{*}{NSL-KDD} & Normal & 0.94 & 0.96 & 0.96 \\  & R2L & 0.81 & 0.89 & 0.86 \\  & DoS & 0.88 & 0.92 & 0.91 \\  & U2R & 0.85 & 0.87 & 0.90 \\  & Probe & 1.00 & 0.96 & 0.96 \\ \hline \multirow{2}{*}{Saturday data} & Normal & 1.00 & 1.00 & 1.00 \\  & Attack & 0.99 & 1.00 & 1.00 \\ \hline \multirow{2}{*}{Sunday data} & Normal & 0.99 & 1.00 & 1.00 \\  & Attack & 0.94 & 1.00 & 0.99 \\ \hline \multirow{2}{*}{Monday data} & Normal & 0.98 & 1.00 & 1.00 \\  & Attack & 0.79 & 0.99 & 0.98 \\ \hline \multirow{2}{*}{Tuesday data} & Normal & 1.00 & 0.99 & 1.00 \\  & Attack & 0.86 & 0.85 & 0.84 \\ \hline \multirow{2}{*}{Wednesday data} & Normal & 1.00 & 0.99 & 1.00 \\  & Attack & 0.86 & 0.88 & 0.85 \\ \hline \multirow{2}{*}{Thursday data} & Normal & 1.00 & 1.00 & 1.00 \\  & Attack & 0.96 & 1.00 & 0.99 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The accuracy of attack types detection on two datasets. Figure 16 shows the memory profiles of LSTM model on NSL-KDD dataset. The used memory and the time for training of two cases are quite small different about memory profiles. In particular, memory used and time compiling of LSTM model is trained on selected feature subset occupied under 250 MiBs and near 50 s, respectively. While the LSTM model is trained on complete feature dataset obtained 300 MiBs and approximately 60 s corresponding to the memory used and time compiling. In the ISCX dataset, the memory profile results of LSTM model are plotted in Figures 17 and 18. In summary, the memory used and time executed of LSTM model on both cases ISCX dataset are listed in Table 4. Smaller values are better. Obviously, case 2 obtained almost better results of memory profiles on both memory used and time executed. Figure 16: Memory profile of two models on NSL-KDD dataset. (**a**) Original feature dataset; (**b**) Selected feature subset. On the other hand, this work measured the memory profiler of the proposed SFSDT model to find the best feature subset on both datasets. Figure 19 shows the memory profiler of the proposed model on NSLKDD dataset. Besides, Figure 20 presents the memory profiler of the SFSDT model on ISCX dataset. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **Memory Used Case 1** & **Memory Use Case 2** & **Time Executed Case 1** & **Time Executed Case 2** \\ \hline Saturday & 550 & 300 & 550 & 480 \\ Sunday & 900 & 550 & 1100 & 1000 \\ Monday & 650 & 450 & 950 & 650 \\ Tuesday & 700 & 450 & 730 & 710 \\ Wednesday & 550 & 310 & 550 & 570 \\ Thursday & 580 & 300 & 650 & 780 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The memory profiles of LSTM model on ISCX dataset. Figure 17: Memory profile results of LSTM model on complete feature data and selected feature subset data respectively. (**a**) & (**b**) Saturday data; (**c**) & (**d**) Sunday data; (**e**) & (**f**) Monday data. Figure 19: Memory profile results of SFSDT model to select the best feature subset on NSLKDD dataset. Figure 18: Memory profile results of LSTM model on complete feature data and selected feature subset data respectively.