# Image-Based Malicious Network Traffic Detection Framework: Data-Centric Approach
## 4 Experimental Results
### Effectiveness of Feature Engineering  
To evaluate the effectiveness of dimensionality reduction in improving a model's training efficiency, we conducted comparison experiments between two models: one trained on images without dimensionality reduction and the other trained on images with dimensionality reduction. Images without dimensionality reduction were created using one-hot encoding during data preprocessing, so 84 new one-hot encoding features were created by adding the number of unique values of categorical features _protocol_type_, _service_, and _flag_, which are 3, 70, and 11, respectively. When the newly created features are added to the existing 38 numeric features, a total of 122 features are created. To convert it to a square image, we removed the _urgent_ feature, which had the lowest importance, to create an \(11\times 11\)-pixel image based on a total of 121 features. The image dataset generated in this way was trained using our designed CNN model. Our model uses only 6 \(\times\) 6-pixel images in comparison to 11 \(\times\) 11-pixel images with the one-hot encoding method. However, as can be seen in Figure 9, our model has higher accuracy as well as less training time. While Figures 9 and 10 summarize the overall performance advantages of our approach in terms of accuracy and training time reduction, a more detailed statistical analysis is needed to verify the consistency of these improvements. To comprehensively evaluate the consistency and reliability of our results, each model was trained and tested 10 times. Figure 11 presents the boxplots showing the distribution of performance metrics across these 10 experimental runs. Table 10 summarizes the mean and standard deviation values for each metric. As shown in Table 10, our proposed model with dimensionality reduction consistently outperforms the dimensionality-reduction-free model across all metrics. Not only does it achieve higher average accuracy in training (\(0.9946\pm 0.00051\)), validation (\(0.9909\pm 0.00101\)), and testing (\(0.9906\pm 0.00099\)) compared to the model without feature reduction (\(0.9938\pm 0.00080\), \(0.9890\pm 0.00140\), and \(0.9898\pm 0.00116\), respectively), but it also demonstrates greater stability with lower standard deviations in most metrics. The boxplots in Figure 11 visually confirm this trend, showing tighter distributions for the model with feature reduction. Figure 9: The comparison with models without dimensionality reduction. Similarly, the loss metrics indicate better performance for our proposed model, with a training loss of \(0.01397\pm 0.00128\) compared to \(0.01604\pm 0.00209\) for the model without dimensionality reduction, as seen in Table 10. The validation loss shows a similar pattern (\(0.04132\pm 0.00542\) vs. \(0.04154\pm 0.00384\)), though with slightly higher variability in our model. Figure 10 shows the model training time of the proposed model in comparison to the model without dimensionality reduction. As presented in Table 10 and visualized in Figure 11, the average training time for the model without dimensionality reduction was \(926.47\pm 21.34\) s, while our model was trained in an average of \(764.66\pm 32.53\) s. This result shows that our model was trained about \(17.47\%\) faster and that the image dataset generated using one-hot encoding consumes relatively much more time for model training. On the other hand, the testing time was measured based on the test set used to evaluate the prediction performance of the trained model. As shown in Table 10, the dimensionality-reduction-free model took an average of \(3.71\pm 0.43\) s, whereas the proposed model completed the evaluation in an average of \(2.99\pm 0.33\) s, achieving a \(19.44\%\) improvement in inference speed. These results confirm that the proposed framework improved the speed and efficiency of normal and attack classification predictions while minimizing resource consumption through the application of dimensionality reduction.