## 4 Results and Discussion
Figure 5 illustrates the performance comparison between the proposed CNN-based intrusion detection method and traditional machine learning algorithms (DT, RF, SVM, and KNN) across binary, 6-class, and 15-class classifications. The CNN achieved 100% accuracy in binary classification, surpassing SVM (99.98%), DT (95.79%), RF (96.26%), and KNN (63.89%). For multiclass tasks, the CNN maintained superior results, as follows: 99.12% (6-class) and 95.5% (15-class), outperforming RF (96.26%, 93.82%) and DT (95.79%, 93.22%), while SVM (58.57%, 55.65%) and KNN (63.89%) lagged significantly. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Epoch** & \begin{tabular}{c} **Learning** \\ **Rate** \\ \end{tabular} & **Loss\_Value** & **Accuracy\_Value** & \begin{tabular}{c} **Validation** \\ **Loss\_Value** \\ \end{tabular} & \begin{tabular}{c} **Validation Accuracy\_Value** \\ **curve\_Value** \\ \end{tabular} & \
\begin{tabular}{c} **Training** \\ **Time\_Value** \\ \end{tabular} &
\begin{tabular}{c} **Validation** \\ **Time\_Value** \\ \end{tabular} \\ \hline
**1** & & 32,756.21 & 0.97 & 0.0 & 1.0 & 450 s & 9 ms \\ \hline
**2** & & 4607.17 & 0.99 & 0.0 & 1.0 & 442 s & 9 ms \\ \hline
**3** & 0.001 & 102.65 & 0.99 & 0.0 & 1.0 & 449 s & 9 ms \\ \hline
**4** & & 0.0 & 1.0 & 0.0 & 1.0 & 433 s & 9 ms \\ \hline
**5** & & 0.0 & 1.0 & 0.0 & 1.0 & 435 s & 9 ms \\ \hline
**1** & & 21,769.84 & 0.99 & 0.0 & 1.0 & 249 s & 5 ms \\ \hline
**2** & & 0.0 & 1.0 & 0.0 & 1.0 & 245 s & 5 ms \\ \hline
**3** & 0.005 & 0.0 & 1.0 & 0.0 & 1.0 & 246 s & 5 ms \\ \hline
**4** & & 0.0 & 1.0 & 0.0 & 1.0 & 244 s & 5 ms \\ \hline
**5** & & 0.0 & 1.0 & 0.0 & 1.0 & 241 s & 5 ms \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Performance of the CNN model for intrusion detection in a binary classification scenario. The CNN's accuracy on Raspberry Pi 4 decreased to 98.7% due to hardware constraints (low-power processors and limited memory) and optimizations like model pruning (30% parameter reduction) and INT8 quantization. Class imbalance (e.g., rare attacks like XSS) further challenged detection. Despite this, the CNN's ability to identify spatial-temporal patterns (e.g., DDoS, SQL injection) ensures its effectiveness in IIoT environments, where traditional methods struggle with high-dimensional, multiclass data. These results highlight the CNN's robustness in handling complex traffic flows and diverse attack types, leveraging its capacity to capture intricate data patterns--a critical advantage over resource-efficient, but less accurate, traditional approaches. The summarized results, including F1 score, recall, and precision, obtained using different machine learning methods (DT, RF, SVM, and KNN) compared to the proposed CNN method for binary and multiclass classifications (2, 6, and 15 classes), are shown in Tables 10-12, respectively. Table 10 presents the binary classification results, demonstrating that the proposed method attained the highest values in precision, recall, and F1 score. This indicates the model's strong performance in accurately identifying normal traffic and detecting attacks. However, other methods (DT and RF) also managed to achieve these high levels of classification. Based on the results obtained in Tables 10-12, the CNN-based intrusion detection system demonstrates superior performance in multiclass attack classification, particularly in scenarios requiring spatial pattern recognition inherent to IoT/IIoT network traffic. Unlike traditional methods, such as SVM and KNN, which rely on manual feature engineering, the CNN autonomously learns localized correlations between features (e.g., abrupt packet rate spikes in DDoS attacks or anomalous payload patterns in SQL injections). This capability underpins its high precision and recall for most attack types, including near-perfect detection of DDoS_ICMP/UDP- and MITM-based attacks, where spatial-temporal dependencies are pronounced.