# Multi-Class Intrusion Detection Based on Transformer for IoT Networks Using CIC-IoT-2023 Dataset
## 4 Experimental Results
### Accuracy Figure  
In this subsection, we show the comparison between the validation and training accuracy in every model. In Figures 7-13, we provide the most complex case for each model (DNN, RNN, CNN, LSTM, CNN + RNN, CNN + LSTM, Transformer, etc.). As shown in Figures 7-13, there is no overfitting. \begin{table} \begin{tabular}{c c c c c} \hline \hline
**Dense Dimension** & **Number of** & **Number of Layers** & \multicolumn{2}{c}{**Accuracy (\%)**} \\
**(FFN)** & **Heads** & **(Encoder)** & **Binary** & **Multi-Class** \\ \hline
256 & \(1\) & \(1\) & \(99.51\) & \(99.12\) \\
128 & & & \(99.50\) & \(97.54\) \\
512 & & & \(99.51\  
Figure 8: Accuracy figure of RNN (with layer = 3, node = 768, multi-class classification).  
Figure 7: Accuracy figure of DNN with (layer = 3, Node = 768, multi-class).  
Figure 9: Accuracy figure of CNN (with layer = 3, node = 768, multi-class classification).  
Figure 11: Accuracy figure of CNN + RNN (with layer = 3, node = 768, multi-class classification).  
Figure 12: Accuracy figure of CNN + LSTM (with layer = 3, node = 768, multi-class classification).  
Figure 10: Accuracy figure of LSTM (with layer = 3, node = 768, multi-class classification).  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline  & \begin{tabular}{c} Benign \\ Traffic \\ \end{tabular} & 1,034,444 & 14 & 7 & 22,362 & 127 & 47 & 41,192 & 2 \\ \cline{2-10}  & DDos & 83 & 83,979,984 & 3238 & 764 & 0 & 0 & 63 & 428 \\ \cline{2-10}  & Dos & 36 & 6228 & 8,084,368 & 20 & 0 & 0 & 37 & 49 \\ \cline{2-10}  & Recon & 78,798 & 2093 & 40 & 236,729 & 790 & 161 & 35,930 & 24 \\ \cline{2-10}  & \begin{tabular}{c} Web- \\ Based \\ \end{tabular} & 6077 & 1 & 2 & 5485 & 2960 & 7 & 10,297 & 0 \\ \cline{2-10}  & \begin{tabular}{c} Brute \\ Based \\ \end{tabular} & 3564 & 0 & 0 & 3584 & 78 & 2401 & 3437 & 0 \\ \cline{2-10}  & \begin{tabular}{c} Spoofing \\ Traffic \\ \end{tabular} & 101,541 & 23 & 4 & 24,349 & 880 & 98 & 359,605 & 4 \\ \cline{2-10}  & \begin{tabular}{c} Mirai \\ \end{tabular} & 5 & 380 & 63 & 6 & 0 & 0 & 16 & 2,633,654 \\ \cline{2-10}  & \begin{tabular}{c} Benign \\ Traffic \\ \end{tabular} & DDos & Dos & Recon & \
\begin{tabular}{c} Web- \\ Based \\ \end{tabular} &
\begin{tabular}{c} Brute \\ Force \\ \end{tabular} & Spoofing & Mirai \\ \hline \hline \end{tabular}
\end{table}
Table 33: Confusion matrix figure of LSTM (with layer = 3, node = 768, multi-class classification).  
\begin{table}
\begin{tabular}{c} Brute \\ Force \\ \end{tabular} & Spoofing & Mirai \\ \hline \hline \end{tabular} 
\end{table}
Table 34: Confusion matrix figure of LSTM (with layer = 3, node = 768, multi-class classification). \begin{table}
\begin{tabular}{c} Brute \\ Force \\ \end{tabular} & Spoofing & Mirai \\ \hline \hline \end{tabular}
\end{table} 
Table 32: Confusion matrix figure of CNN (with layer = 3, node = 768, multi-class classification). \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline  & \begin{tabular}{c} Benign \\ Traffic \\ \end{tabular} & 1,042,720 & 31 & 6 & 25,929 & 367 & 26 & 29,116 & 0 \\ \cline{2-10}  & DDos & 33 & 83,980,794 & 2611 & 778 & 0 & 3 & 83 & 258 \\ \cline{2-10}  & Dos & 15 & 6435 & 8,084,207 & 10 & 1 & 0 & 30 & 40 \\ \cline{2-10}  & Recon & 66,965 & 1731 & 27 & 251,565 & 1386 & 155 & 32,689 & 47 \\ \cline{2-10}  & \begin{tabular}{c} Web- \\ Space \\ \end{tabular} & 4273 & 6 & 1 & 6214 & 5465 & 10 & 8410 & 0 \\ \cline{2-10}  & \begin{tabular}{c} Brute \\ Space \\ \end{tabular} & 3036 & 1 & 0 & 3710 & 177 & 2740 & 3400 & 0 \\ \cline{2-10}  & \begin{tabular}{c} Spoofing \\ Traffic \\ \end{tabular} & 93,724 & 109 & 28 & 26,392 & 2532 & 77 & 363,638 & 4 \\ \cline{2-10}  & \begin{tabular}{c} Mirai \\ \end{tabular} & 7 & 368 & 31 & 70 & 0 & 0 & 103 & 2,633,545 \\ \cline{2-10}  & \begin{tabular}{c} Benign \\ Traffic \\ \end{tabular} & DDos & Dos & Recon & \
\begin{tabular}{c} Web- \\ Based \\ \end{tabular} &
\begin{tabular}{c} Brute \\ Force \\ \end{tabular} & Spoofing & Mirai \\ \hline \hline \end{tabular}
\end{table}