# Multi-Class Intrusion Detection Based on Transformer for IoT Networks Using CIC-IoT-2023 Dataset
## 4 Experimental Results
### Experimental Result  
The accuracy results of DNN are shown in Table 14, and the evaluation results of DNN are shown in Table 15.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Hyperparameter** & **Value** \\ \hline Batch Size & 1024 \\ Epochs & 10 \\ Learning Rate & 0.001 \\ Dropout & 0.1 \\ \hline \hline \end{tabular}
\end{table}
Table 13: Number of parameters of Transformer.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Project** & **Properties** \\ \hline OS & Windows 11 \\ CPU & Intel® CoreTM i7-13700 Processor \\ GPU & NVIDIA Geforce RTX 4080 \\ Memory & 128 GB \\ Disk & 1 TB SSD \\ Python & 3.7.16 \\ NVIDIA CUDA & 11.3.1 \\ Framework & Tensorflow-gpu 2.5 \& 2.6 \\ \hline \hline \end{tabular}
\end{table}
Table 12: Number of parameters of Transformer.  
The accuracy results of RNN are shown in Table 16, and the evaluation results of RNN are shown in Table 17.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Layer**} & \multirow{2}{*}{**Node**} & \multicolumn{2}{c}{**Precision (\%)**} & \multicolumn{2}{c}{**Recall (\%)**} & \multicolumn{2}{c}{**F1-Score (\%)**} \\ \cline{3-6}  & & **Binary** & **Multi-Class** & **Binary** & **Multi-Class** & **Binary** & **Multi-Class** \\ \hline \multirow{4}{*}{1} & 256 & 99.51 & 97.35 & 99.48 & 97.35 & 99.49 & 97.30 \\  & 512 & 99.51 & 97.74 & 99.48 & 97.73 & 99.49 & 97.66 \\  & 768 & 99.49 & 99.12 & 99.47 & 99.13 & 99.48 & 99.10 \\ \hline \multirow{4}{*}{3} & 256 & 99.54 & 99.17 & 99.53 & 99.16 & 99.54 & 99.12 \\  & 512 & 99.57 & 99.24 & 99.56 & 99.23 & 99.56 & 99.18 \\ \cline{1-1}  & 768 & 99.57 & 99.35 & 99.56 & 99.36 & 99.57 & 99.32 \\ \hline \hline \end{tabular}
\end{table}
Table 16: The accuracy results of RNN.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Layer**} & \multirow{2}{*}{**Node**} & \multicolumn{2}{c}{**Precision (\%)**} & \multicolumn{2}{c}{**Recall (\%)**} & \multicolumn{2}{c}{**F1-Score (\%)**} \\ \cline{3-6}  & & **Binary** & **Multi-Class** & **Binary** & **Multi-Class** & **Binary** & **Multi-Class** \\ \hline \multirow{4}{*}{1} & 256 & 99.51 & 99.21 & 99.49 & 99.21 & 99.50 & 99.17 \\ \cline{2-6}  & 512 & 99.50 & 99.23 & 99.49 & 99.22 & 99.49 & 99.19 \\ \cline{1-1} \cline{2-6}  & 768 & 99.51 & 99.23 & 99.48 & 99.24 & 99.49 & 99.21 \\ \hline \multirow{4}{*}{3} & 256 & 99.54 & 99.26 & 99.53 & 99.26 & 99.53 & 99.21 \\ \cline{1-1}  & 512 & 99.50 & 99.27 & 99.50 & 99.27 & 99.50 & 99.24 \\ \cline{1-1} \cline{2-6}  & 768 & 99.52 & 99.28 & 99.50 & 99.28 & 99.51 & 99.23 \\ \hline \hline \end{tabular}
\end{table}
Table 17: The evaluation results of RNN.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Layer**} & \multirow{2}{*}{**Neurons**} & \multicolumn{2}{c}{**Accuracy (\%)**} \\ \cline{3-6}  & & **Binary** & **Multi-Class** \\ \hline \multirow{4}{*}{1} & 256 & 99.48 & 97.35 \\  & 512 & 99.47 & 97.73 \\  & 768 & 99.53 & 99.13 \\ \hline \hline \end{tabular}
\end{table}
Table 14: The accuracy results of DNN.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Layer**} & \multirow{2}{*}{**Node**} & \multicolumn{2}{c}{**Precision (\%)**} & \multicolumn{2}{c}{**Recall (\%)**} & \multicolumn{2}{c}{**F1-Score (\%)**} \\ \cline{3-6}  & & **Binary** & **Multi-Class** & **Binary** & **Multi-Class** \\ \hline \multirow{4}{*}{1} & 256 & 99.51 & 99.21 & 99.49 & 99.21 & 99.50 & 99.17 \\ \cline{2-6}  & 512 & 99.50 & 99.23 & 99.49 & 99.22 & 99.49 & 99.19 \\ \cline{1-1} \cline{2-6}  & 768 & 99.51 & 99.23 & 99.48 & 99.24 & 99.49 & 99.21 \\ \hline \multirow{4}{*}{3} & 256 & 99.54 & 99.26 & 99.53 & 99.26 & 99.53 & 99.21 \\ \cline{1-1}  & 512 & 99.50 & 99.27 & 99.50 & 99.27 & 99.50 & 99.24 \\ \cline{1-1} \cline{2-6}  & 768 & 99.52 & 99.28 & 99.50 & 99.28 & 99.51 & 99.23 \\ \hline \hline \end{tabular}
\end{table}
Table 15: The evaluation results of DNN.