The findings from this study’s evaluation of a variety of supervised machine learning pipeline configurations for DDoS attack detection using the CICDDoS2019 dataset are discussed in this section. Additionally, statistical testing, feature importance analysis and generalisation evaluation are performed to strengthen the findings. The primary objective was to investigate the most effective pipeline configuration by systematically evaluating and assessing their performance across a range of conventional and computational metrics. The study involved a total of 210 unique pipelines that comprised five supervised classifiers, three feature selection techniques, two hyperparameter tuning techniques and seven train–test splits and were evaluated using nine metrics: accuracy, precision, recall, F1, MCC, training time, inference time, average memory usage and average CPU time. The following section will detail the performance results starting from a wider perspective, then it will hone in on the top 10 most performant pipelines; subsequently, feature frequency analysis is performed to identify the most effective features for detection, and finally the section concludes with a discussion of performance trade-offs. The metric values were obtained by training and evaluating each pipeline against the same pre-processed dataset that was stratified and randomly sampled from the original dataset, containing a total of 20,304 rows and 62 columns (61 features, 1 label) post pre-processing.
4.1. Performance Results
Generally, as shown in
Table 7, pipelines that utilise tree-based classifiers dominate predictive performance. LR-based pipelines appear to struggle, suggesting that there may be non-linear patterns in the data that they simply are not able to catch, or that the interactions between features in the dataset cannot be effectively captured by linear models. Further, LR-based pipelines also have considerably higher training times compared to other pipelines; this, however, may be the result of having to provide static parameters to the LR classifier function from
scikit-learn to enable it to identify a valid model within the
max_iter limit. SVM and DT both exhibit very fast training times compared to more complex models such as XGBoost and RF. Similarly, DT-based pipelines note the fastest inference times on average. Additionally, DT-based pipelines also showcase the lowest memory usage on average, indicating that they are more memory-efficient in comparison to other classifiers. On the other hand, SVM showcases the worst memory usage, likely due to its need to store the generated support vectors.
As shown in
Table 8, feature selection results highlight that
SelectKBest offers the highest predictive performance with an MCC of 0.51649, at the clear cost of more memory usage and a moderate increase in training time compared to RFE, making it the most suitable and practical selector for maximising predictive performance.
RFE achieves moderately lower predictive performance with an MCC of 0.45046, but it is both faster in training time and more memory-efficient, showcasing a good compromise between computational resources and predictive performance on average when needed.
VarianceThreshold performs the worst across the predictive performance metric and most computational metrics, indicating that it is likely not an appropriate selector for the CICDDoS2019 dataset because of the feature complexity present within in the dataset.
Comparing both hyperparameter tuning methods explored in this study shows a clear trade-off between predictive performance and computational efficiency (see
Table 9). The Grid tuner achieves a higher average MCC score (0.50017) compared to the Random tuner (0.41209), indicating better overall performance. However, despite this, it comes at the cost of significantly longer training times, with Grid taking an average of 33.35 s versus only 12.40 s for Random. In terms of inference time, both methods perform similarly (roughly 0.008 s), suggesting that prediction speed is largely unaffected by the tuning method employed in the pipeline. The CPU time is also comparable across the tuners, with Random being slightly lower. On the other hand, Random tuning appears to consume slightly over two times more memory than Grid tuning on average. Overall, while Grid tuning provides better predictive performance and lower memory usage on average, it still requires substantially more training time, whereas Random tuning sacrifices some predictive performance and uses memory to achieve faster training speeds.
To identify the champion pipeline from the 210 that were evaluated in this study, a two-step approach was used: composite scoring and statistical testing. First, composite scoring was employed. To do this, we identified, using Spearman’s correlation coefficient, highly correlated metrics such as accuracy, recall, precision and F1 and removed them from the composite scoring formula to avoid redundant contributions (see
Figure 2). This formula was used to ensure that each metric reflected some form of unique information about the pipeline itself, rather than overweighting a specific aspect, where
is the normalised metric and
is its weight (see Equation (
6)). Despite
train_time_sec and
cpu_time_sec being highly correlated with each other (
) they were both retained, as they capture distinct aspects of the computational efficiency of a given pipeline. Moreover, to not overweight them, their combined influence was controlled through a weight for each metric of 0.125. Next, each metric was normalised to a range of [0, 1] based on whether higher values were indicative of better (e.g., MCC) or worse (e.g., training time) performance (see Equation (
7)). This weighted composite score was computed from the normalised metrics to produce a preliminary ranking of the top 10 candidate champion pipelines. The top 10 pipelines presented in
Table 10 were selected according to this weighted composite score.
Second, statistical testing was performed on the top 10 selected pipelines, with each candidate pipeline being re-run 10 times with a different
random_seed value set for the
train_test_split function each time, generating multiple measures for each metric. These repeated measures enabled the use of the Friedman test to assess whether the performance differences among the top 10 pipelines’ metrics were statistically significant. For each of the 9 metrics, the Friedman test was applied to determine if any pipeline performed significantly differently from the others. When the test indicated significance (
), a post hoc Nemenyi test was used to identify which pipelines differed significantly in pairwise comparisons, the results of which are summarised in
Table 11 and
Table 12.
Despite the post hoc tests not being able to identify a single statistically superior pipeline across all of the metrics, they still revealed notable differences in specific pairwise comparisons. Several of the pairwise comparisons highlighted meaningful differences between specific pipelines, revealing trends that are not immediately apparent. While several pipelines excel in specific metrics, no single pipeline dominates across all of them, highlighting the trade-offs between computational efficiency and predictive performance. Thus, with
Table 11 and
Table 12 (where an X character denotes a top-performing pipeline for a given metric) in mind, the selection of the champion pipeline is based on choosing the pipeline that is top-ranked in a majority of metrics rather than strict statistical superiority. As a result, DT_RFE_Grid_90-10 was identified to be the champion pipeline, ranking highest across six of the nine metrics considered, Recall, Precision, Accuracy, F1, MCC and Inference Time, with other pipelines not achieving the same.
With the champion pipeline, the false negative rate (FNR) achieved was 0, indicating that no positive samples were misclassified (see
Table 13). However, given the relative size of the negative class (n = 5), the conventional performance metrics are highly sensitive to individual misclassifications. Consequently, while the pipeline appears to perfectly avoid false positives and false negatives, the results should be interpreted with caution. The observed performance may overstate the pipeline’s robustness and may not generalise well to other datasets with a larger size or more balanced class distribution.
In real-world applications where negative samples are much more abundant, even a small number of false positives may reduce precision and increase operational costs, such as allocating resources like analysts to inspect flagged events. The limited test size also raises the risk that the pipeline is overfitted to CIC-DDoS2019, meaning that its apparent perfect performance may not hold in cross-dataset evaluations.
4.2. Feature Analysis
From the top 10 most performant pipelines as reported in
Table 10, the frequency of each feature’s appearance in the corresponding feature subsets was counted and totalled (see
Table 14). The analysis reveals that a single feature appeared in all of the top 10 most performant pipelines:
Idle Min.
The consistent presence of the aforementioned core feature indicates that it is highly predictive of the target label. In particular, its repeated selection highlights a strong underlying correlation with the Label column, which tree-based classifiers such as DT, RF and XGBoost are able to exploit to great effect. This may explain why the top 10 most performant pipelines each make use of these features to achieve perfect predictive performance across all conventional evaluatory metrics.
Furthermore, the top 10 most performant pipelines employed the RFE feature selector that used the DecisionTreeClassifier as the estimator. This fact inherently ties the feature selection performed by RFE to the bias of the DT classifier itself. As a consequence, the repeated selection of the same features might reflect the properties of the RFE-DT combination rather than purely the dataset’s inherent characteristics.
To enhance interpretability of the champion pipeline (DT_RFE_Grid_90-10), a SHapley Additive exPlanations (SHAP) analysis was conducted to quantify the contributions of each feature to the pipeline’s predictions [
37]. The results of this indicate that a small subset of features consistently drive the majority of the predictive power, with top-ranked features exhibiting the largest SHAP values. In the case of the champion pipeline, only three features provide predictive information, which are: Source Port (
), Destination Port (
) and Inbound (
). These accounted for
of the pipeline’s total predictive contribution, while the remaining features did not contribute any predictive information. The beeswarm and global feature importance plots (see
Figure 3 and
Figure 4) confirm that these features consistently push predictions towards or away from the positive class, highlighting their key role in the pipeline’s decision-making process. The sparsity in feature usage is a reflection of the pipeline’s inherent simplicity and interpretability; this is because DT_RFE_Grid_90-10 uses a maximum tree depth of 5 nodes, while RFE selects 20 features. The shallow tree cannot fully utilise all 20 features, which explains why only 3 features show non-zero contributions in the SHAP plots.
4.3. Generalisation and Overfitting
Generalisation is a critical requirement for reliable model deployment and assessment. As a result, the champion pipeline was evaluated on an independent dataset derived from the CIC-IDS2017 dataset [
18]. A subset of approximately 25,000 samples, including both benign and DDoS-labelled traffic from the Friday afternoon attack file was extracted and adjusted to match the class distribution of the CIC-DDoS2019 subset used during pipeline development. Both datasets were obtained from the Canadian Institute for Cybersecurity using the same CICFlowMeter tool, ensuring comparable features sets, while offering differing traffic scenarios, network conditions and attack implementations. This evaluation aimed at determining whether the champion pipeline retains its high predictive performance and relatively good computational efficiency on previously unseen data, providing a robust assessment of its generalisation beyond the patterns present in the original training and testing sets.
The pre-processing steps defined in
Section 3.3 were applied accordingly to this independent dataset to ensure compatibility. Similarly, the same evaluation metrics as defined in
Section 3.4 were used to quantify the pipeline’s performance. To enable a fair cross-dataset comparison, the champion pipeline was constrained to feature shared by both datasets. Certain features originally selected by the RFE feature selector were not present in CIC-IDS2017, therefore, RFE was re-run restricted to the shared feature set, preserving the overall pipeline structure. Pipeline performance was evaluated across 10 random train–test splits per dataset, with the metrics reported as mean ± standard deviation to capture variability.
Furthermore, all computational metrics reported in
Table 15 were measured separately for training and inference, as retraining on the independent dataset would provide misleading results. Training was performed solely on the CIC-DDoS2019 subset used throughout this study. As shown in
Table 15, the pipeline retained near-perfect performance, with MCC and other predictive performance metrics approaching 1.0. In contrast, on the unseen CIC-IDS2017 subset, performance can be seen to drop considerably. While precision remained moderately high, other metrics suffered significant drops, indicating the pipeline’s inability to correctly identify most DDoS samples. CPU time and memory usage remained low across inference on both datasets, with slight differences in inference time.
The results indicate that while the pipeline may perform exceptionally on the CIC-DDoS2019 subset, it exhibits very poor generalisation on unseen data. Differences in attack patterns and traffic distributions between both datasets appear to have a substantial impact on predictive performance.
4.4. Performance Trade-Offs
In evaluating models for DDoS detection and, more broadly, cyber attack detection, performance must be assessed not only from a predictive perspective but also from a computational perspective. This is because this perspective is of particular use in cases where the deployment environment is constrained by the available resources. This study reveals that while many pipelines do in fact achieve perfect or near-perfect predictive performances, trade-offs are evident when comparing them in the computational dimension.
Notably, pipelines using more complex and exhaustive hyperparameter tuning approaches like Grid Search on average only marginally increased their predictive performance while incurring a several fold increase in computational cost in metrics such as training, inference and CPU time, along with average memory usage. The fact that the results indicate diminishing returns highlights a common trade-off—that is, gaining a small increasein predictive capabilities may not be justified when the resource requirement is considered. Further, while efficiency may have appeared to play only a background role in some prior works or have been absent entirely, it is often of paramount importance in real-world deployments, alongside conventional ML metrics. For instance, a pipeline that has very high predictive performance but poor computational metrics may be deemed unsuitable for high-throughput networks. In contrast, a pipeline with marginally lower predictive capabilities but a several fold improvement in terms of memory usage and CPU time may be far more adequate.
Another less evident trade-off occurs when the maintainability and interpretability of a pipeline are an area of concern. This is because pipelines with simpler and more efficient configurations such as those using RFE and Random Search tend to be much easier to re-train, debug and maintain over time compared to those that require much more heavy computation such as Variance Threshold and Grid Search. Furthermore, tree-based models, shown in this study to be well-suited for the DDoS detection task, offer greater interpretability advantages compared to other supervised classifiers. Their tree structure enables security analysts to visualise decision paths and understand which features drive predictions. This transparency supports bias detection, maintainability and informed decision making based on the model’s structure and outputs.
All things considered, the selection of a pipeline and its respective components for production and use often involves a much more comprehensive and context-tailored approach that goes beyond using the best pipeline in terms of conventional ML metrics. It often requires an adequate balance between predictive and computational performance along with other trade-offs to be considered, all of which shape the decision made in relation to the pipeline design process. As demonstrated in this study, the most performant pipelines are not always the most computationally efficient and vice versa; this underscores the importance and necessity of evaluating all these trade-offs using a holistic and nuanced evaluatory framework.