[Paper Review] On Generalisability of Machine Learning-based Network Intrusion Detection Systems
This paper investigates the generalisability of machine learning-based network intrusion detection systems (NIDS) across four recently published benchmark datasets. It finds that no model generalises well across all datasets, generalisability is highly asymmetric, and unsupervised models outperform supervised ones in cross-domain settings due to reliance on feature-class correspondences that break under distribution shifts.
Many of the proposed machine learning (ML) based network intrusion detection systems (NIDSs) achieve near perfect detection performance when evaluated on synthetic benchmark datasets. Though, there is no record of if and how these results generalise to other network scenarios, in particular to real-world networks. In this paper, we investigate the generalisability property of ML-based NIDSs by extensively evaluating seven supervised and unsupervised learning models on four recently published benchmark NIDS datasets. Our investigation indicates that none of the considered models is able to generalise over all studied datasets. Interestingly, our results also indicate that the generalisability has a high degree of asymmetry, i.e., swapping the source and target domains can significantly change the classification performance. Our investigation also indicates that overall, unsupervised learning methods generalise better than supervised learning models in our considered scenarios. Using SHAP values to explain these results indicates that the lack of generalisability is mainly due to the presence of strong correspondence between the values of one or more features and Attack/Benign classes in one dataset-model combination and its absence in other datasets that have different feature distributions.
Motivation & Objective
- To investigate the generalisability of ML-based NIDS across multiple benchmark datasets, especially in real-world deployment scenarios.
- To determine whether high-performing models on standard benchmarks generalise to unseen network environments.
- To compare the performance of supervised versus unsupervised learning models in cross-dataset evaluation.
- To identify the root causes of poor generalisation using SHAP values to explain model decisions across different data distributions.
- To bridge the gap between academic NIDS research and practical deployment by diagnosing failure modes in model transferability.
Proposed method
- The study evaluates seven ML models—four supervised and three unsupervised—on four recently published, NetFlow-converted NIDS datasets with identical feature sets.
- Each model is trained on one dataset and evaluated on all four, including the training dataset, to compare single-domain and multi-domain performance.
- Cross-evaluation is performed in both directions (source-to-target and target-to-source) to assess asymmetry in generalisability.
- SHAP (SHapley Additive exPlanations) values are computed to interpret model predictions and identify features with strong correspondence to attack or benign classes.
- Performance is measured using standard metrics such as accuracy, detection rate, and F1-score across all model-dataset combinations.
- Statistical comparisons are made between single-domain and cross-domain evaluations to quantify generalisation performance.
Experimental results
Research questions
- RQ1To what extent do ML-based NIDS models trained on one benchmark dataset generalise to other benchmark datasets?
- RQ2Is the generalisability of ML-based NIDS models symmetric when swapping source and target datasets?
- RQ3Do unsupervised learning models generalise better than supervised models across different NIDS datasets?
- RQ4What features or model patterns explain the lack of generalisation across different data distributions?
- RQ5How do SHAP values reveal the presence of simple, data-dependent decision rules that hinder cross-domain transfer?
Key findings
- None of the seven evaluated ML models generalised well across all four benchmark datasets, indicating a significant generalisation gap.
- Generalisability was highly asymmetric: performance dropped significantly when swapping source and target datasets, indicating directional dependency in model transfer.
- Unsupervised learning models outperformed supervised models in cross-dataset evaluation, despite lower single-domain performance.
- High performance on a given dataset-model combination was primarily due to strong, simple feature-class correspondences (e.g., MAX_TTL values clearly separating benign and attack traffic).
- SHAP analysis revealed that models relying on such single-feature rules failed to generalise when feature distributions shifted in the target dataset.
- The lack of generalisation was attributed to the absence of consistent, strong feature-class relationships in target datasets, even when the same model and features were used.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.