Skip to content
Open access

When Calibrated Detectors Meet New Attacks: Per-Category Reliability of Machine-Learning Intrusion Detection Under Distribution Shift

2026 · International Journal of Advanced Computer Science and Applications · 0 citations · 45 references

TL;DR

A decision-curve analysis and expected-cost comparison show that an uncalibrated score used at its nominal cost threshold is very costly, and that both recalibration and a target-tuned threshold reduce operating cost, with recalibration additionally improving the multiclass probabilities.

Abstract

Machine-learning intrusion detectors are usually reported with accuracy or F1 on a single train and test split, and their confidence scores are often read operationally as probabilities without an explicit calibration check. We test that assumption. We measure the reliability of the predicted probabilities of three classifiers, logistic regression, random forest, and XGBoost, on two benchmarks, NSL-KDD and UNSW-NB15, in two settings: when training and test data share a distribution, and under the shift each benchmark's official split already contains. In distribution, all three detectors are well calibrated, with top-label expected calibration error at most 0.03. Under shift, the outcome depends on its content. On NSL-KDD, whose test set contains attack types absent from training, top-label calibration error rises from at most 0.007 in distribution to between 0.170 and 0.209, and the error is largest on the benign and Remote-to-Local classes, so unfamiliar attacks are labeled normal with high confidence. On UNSW-NB15, whose split keeps the same attack categories, the error stays far smaller, between 0.025 and 0.068, even though a domain classifier detects a clear shift on both benchmarks. Recalibrating on training-distribution data does not reliably transfer to the shifted test set. Supervised target-domain recalibration on a held-out labeled sample from the shifted distribution substantially reduces the calibration error and recovers much of the minority-class recall on NSL-KDD. Most of the aggregate top-label ECE reduction is obtained with about one hundred labeled target samples. This remedy requires labeled observations from the shifted environment and therefore describes reliability after target labels become available, not reliability against attacks that remain entirely unseen. A decision-curve analysis and expected-cost comparison show that an uncalibrated score used at its nominal cost threshold is very costly, and that both recalibration and a target-tuned threshold reduce operating cost, with recalibration additionally improving the multiclass probabilities. A leave-one-attack-out study reproduces the failure and indicates that the attack family for which performance degrades substantially is the one least separable from benign traffic, not the one most distinct from the other attacks.

Read PDF

Similar papers

Open access 2025

Robustness-Aware Machine Learning for Network Intrusion Detection under Feature and Distribution Variations Using UNSW-NB15

Network intrusion-detection models are commonly evaluated with a fixed training and testing configuration. Such an evaluation does not fully show how a classifier behaves when feature values or class distributions change. This paper evaluates the robustness of a Random Forest model using the UNSW-NB15 dataset. The expe...

D. P., H. S. · 0 citations
Open access Sep 2026

Towards Trustworthy Intrusion Detection: A Calibration-Aware and Explainable Classical-ML Pipeline on NSL-KDD

Existing assessments of machine-learning-based intrusion detection systems (IDSs) often consider each of accuracy, reliability of probability outputs, and transparency of decisions separately. Few attempt to combine all three dimensions in a single assessment. This paper provides a reproducible IDS pipeline that satisf...

Zainab Qahtan Mohammed · 0 citations
Open access Aug 2026

AI Transparency in Network Intrusion Detection

Machine-learning intrusion detectors often report near-perfect performance on familiar benchmarks, yet their generalization and decision transparency remain uncertain. This study evaluates a reproducible and explainable binary network-intrusion-detection workflow using the NSL-KDD KDDTrain+_20Percent file (25,192 recor...

Dawlat Mustafa Sulaiman · 0 citations
Aug 2026

Comparison of Network Attack Detection Algorithms Based on NSL-KDD Dataset

The paper put three classical machine learning methods—Decision Tree, Random Forest, and K-Nearest Neighbors—through the same set of binary and five-class detection tests, arguing for treating rare-class detection as the main priority in future work.

Qi Wu · 0 citations
Conference Open access Sep 2026

The 99 Percent Accuracy Illusion: A Base-Rate-Aware and Cross-Dataset Re-Evaluation of Machine-Learning Intrusion Detection

These results expose a systemic evaluation gap rather than an algorithmic deficiency, and a base-rate-aware, distribution-shift-aware evaluation protocol is proposed as a prerequisite for credible ML-IDS research.

Otabek Esanov, F. Nazarov, Asliddin Sayidqulov · 0 citations
Open access Sep 2026

DO CAN INTRUSION DETECTORS TRAVEL? A CROSS-DATASET AND ZERO-DAY STUDY WITH IDENTIFIER-AGNOSTIC, LOCALLY CALIBRATED ENSEMBLES

This is the first work that identifies the root-cause of a detector’s mean F1 score collapse, namely the feature representation, and presents and repairs this feature-representation to recover much of the lost cross-dataset performance.

Akinwole Obafemi · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.