This repository provides the reproducibility package for a selective quantum intervention framework for network intrusion detection. The proposed approach treats quantum inference as a conditional computational resource rather than a universal replacement for classical classification. A strong classical intrusion detection model remains the default decision mechanism, while a benefit–risk routing strategy selectively authorizes quantum intervention for samples where correction benefit is predicted to outweigh the risk of breaking an otherwise correct classical prediction. The principal S-QIDS architecture combines boundary eligibility, break-risk rejection, correction-benefit estimation, a fixed fidelity-based quantum classifier, and safe override or abstention. Quantum Utilization Rate (QUR) and Net Quantum Benefit Rate (NQBR) are used to quantify resource utilization and the net value of selective intervention. The package contains code, experimental configurations, evaluation procedures, and supporting results for leakage-controlled repeated-seed validation, matched-utilization controls, cross-dataset evaluation, frozen-state reproduction, and repeated finite-shot statistical robustness analysis. The principal UNSW-NB15 evaluation demonstrates constrained positive selective routing utility while invoking the quantum component for only a small fraction of test samples. Cross-dataset experiments also examine safe abstention when the frozen router does not identify sufficiently reliable intervention opportunities. Repeated finite-shot experiments assess statistical stability of the frozen selective intervention under measurement randomness and controlled generic state-level depolarizing perturbations. The results should not be interpreted as evidence of universal quantum advantage, physical quantum-hardware robustness, or guaranteed computational speedup. They instead provide evidence for selective, conditional, and complementary quantum utility under the experimental protocols documented in this repository.
This repository provides the reproducibility package for a selective quantum intervention framework for network intrusion detection. The proposed approach treats quantum inference as a conditional computational resource rather than a universal replacement for classical classification. A strong classical intrusion detection model remains the default decision mechanism, while a benefit–risk routing strategy selectively authorizes quantum intervention for samples where correction benefit is predicted to outweigh the risk of breaking an otherwise correct classical prediction. The principal S-QIDS architecture combines boundary eligibility, break-risk rejection, correction-benefit estimation, a fixed fidelity-based quantum classifier, and safe override or abstention. Quantum Utilization Rate (QUR) and Net Quantum Benefit Rate (NQBR) are used to quantify resource utilization and the net value of selective intervention. The package contains code, experimental configurations, evaluation procedures, and supporting results for leakage-controlled repeated-seed validation, matched-utilization controls, cross-dataset evaluation, frozen-state reproduction, and repeated finite-shot statistical robustness analysis. The principal UNSW-NB15 evaluation demonstrates constrained positive selective routing utility while invoking the quantum component for only a small fraction of test samples. Cross-dataset experiments also examine safe abstention when the frozen router does not identify sufficiently reliable intervention opportunities. Repeated finite-shot experiments assess statistical stability of the frozen selective intervention under measurement randomness and controlled generic state-level depolarizing perturbations. The results should not be interpreted as evidence of universal quantum advantage, physical quantum-hardware robustness, or guaranteed computational speedup. They instead provide evidence for selective, conditional, and complementary quantum utility under the experimental protocols documented in this repository.
Quantum machine learning (QML) is increasingly investigated for network intrusion detection, but the practical value of current quantum models remains uncertain because many studies rely on small simulated data sets, idealized execution, weak classical baselines, or isolated accuracy comparisons. This study develops and evaluates a resource-aware hybrid quantum-classical intrusion detection framework that combines fixed fidelity quantum kernels, repaired Quantum Kernel Alignment (QKA), a Variational Quantum Classifier (VQC), LightGBM, prototype-based kernel reduction, and probabilistic stacking. Experiments use the UNSW-NB15 benchmark under a leakage-aware preprocessing protocol and repeated evaluation across five random seeds. The experimental program covers 4- and 6-qubit representations, multiple training sizes, prototype budgets, and finite-shot configurations, yielding 260 experimental configurations/runs. The strongest quantum-assisted model, a 6-qubit QKA-VQC-LightGBM stack at 100 samples per class, obtains mean F1=0.8480, MCC=0.7092, ROC-AUC=0.9398, and PR-AUC=0.9302. Repaired QKA improves F1 from 0.8043 for the corresponding fixed kernel to 0.8089, while 50-prototype QKA attains F1=0.8257 with a more favorable kernel-workload trade-off than larger prototype budgets. Finite-shot experiments between 1,024 and 4,096 shots remain stable in simulation. However, full-data LightGBM remains stronger overall (F1=0.8957, MCC=0.8068, ROC-AUC=0.9755, PR-AUC=0.9704), and corrected statistical tests do not establish general quantum superiority. These findings motivate a Selective Quantum Intrusion Detection System (S-QIDS), in which classical inference handles high-confidence traffic and quantum processing is reserved for uncertain, novel, or high-risk observations. The study therefore reframes near-term quantum intrusion detection from unconditional quantum advantage toward measurable quantum utility, quantum-classical complementarity, and resource-aware quantum intervention.
This repository provides the reproducibility package for a controlled study of adversarial robustness in quantum supervised learning (QSL) for network intrusion detection using the UNSW-NB15 benchmark. The experiment evaluates a four-qubit variational QSL intrusion detector together with a matched classical multilayer perceptron (MLP) baseline. The shared preprocessing pipeline applies categorical encoding, feature extraction, principal component analysis to four dimensions, and scaling to the interval [0, π]. Experiments are conducted over ten matched random seeds. White-box Fast Gradient Sign Method (FGSM) and Projected Gradient Descent (PGD) attacks are evaluated at perturbation budgets ε/π = 0.02, 0.05, and 0.10. The robust QSL training protocol uses a mixture of 50% clean, 25% FGSM, and 25% PGD samples. PGD uses three steps during adversarial training and seven steps during final evaluation. The repository contains the principal experiment notebooks, repeated-seed robustness results, attack diagnostics, statistical summaries, confidence intervals, paired statistical tests, effect-size analyses, and quantum-versus-classical comparison outputs. Across ten matched seeds, PGD-aware adversarial training improves QSL accuracy from 9.10% to 26.90% under PGD at ε = 0.05π and from 2.60% to 20.73% at ε = 0.10π. This improvement is accompanied by a reduction in clean QSL accuracy from 70.73% to 61.57%. The adversarially trained classical MLP retains higher absolute robustness, achieving 64.27% and 50.50% accuracy at PGD 0.05π and 0.10π, respectively. These results demonstrate that PGD-aware adversarial training materially strengthens the evaluated QSL model but do not establish quantum advantage. The repository is intended to support transparent reproduction, independent verification, and further research on adversarial robustness in quantum machine learning for cybersecurity.
Network intrusion detection systems (NIDS) must classify high-dimensional, heavily imbalanced traffic flows under tight operational constraints, and the flow features produced by modern capture tools routinely exceed the qubit budgets available on today’s noisy intermediate-scale quantum (NISQ) hardware. Existing quantum machine-learning (QML) detectors typically either assume that every extracted feature can be encoded on a dedicated qubit or apply generic dimensionality reduction that is blind to the downstream quantum encoder; in both cases the qubit budget — the binding constraint on real devices — never drives which features are encoded, and evaluation is frequently confined to ideal statevector simulation that omits shot noise, depolarizing error, and readout confusion. This paper presents ANHQ-IDS, an adaptive, noise aware hybrid quantum intrusion-detection framework that makes the qubit budget a first-class design constraint. A resource-constrained feature-selection stage scores candidate features through a composite objective jointly balancing mutual-information relevance, inter-feature redundancy, cross-split stability, and an explicit quantum-encoding cost, and greedily selects a subset sized to a target qubit budget rather than fixed a priori. The retained features are embedded through parameterized angle and second-order (ZZ) feature maps and classified by a hardware-efficient variational quantum classifier (VQC) trained with gradient-free optimizers (COBYLA and SPSA) under finite-shot sampling. To characterize behaviour under realistic hardware conditions, the classifier is evaluated on a statevector reference and under synthetic depolarizing and readout-error models, and benchmarked on CIC-IDS2017 against classical baselines (logistic regression, random forest, support vector machine) using a leakage-resistant train/validation/test protocol. On a class-balanced CIC-IDS2017 benchmark, the ZZ-encoded VQC attains macro-F1 0.766 and ROC-AUC 0.853 under exact simulation — exceeding logistic regression (0.502) and approaching a support-vector baseline, while a random forest remains strongest (0.964); performance degrades gracefully under depolarizing and readout noise, consistent with the predicted (1−p) contraction. All preprocessing, feature-selection, and quantum-training components are released as a reproducible Qiskit package with fixed seeds and recorded circuit-resource metadata (qubits, depth, gate and parameter counts).
Quantum machine learning (QML) for network intrusion detection (NIDS) is routinely reported to reach near-perfect accuracy, yet the most rigorous studies find that well-tuned classical models remain competitive, and that apparent quantum gains may be artefacts of classical dimensionality reduction and implicit regularisation rather than genuine quantum effects. We ask not whether a quantum model can post a high accuracy, but how quantum the advantage really is. We present a unified, reproducible QML-IDS benchmark evaluating hybrid variational quantum circuits and quantum-kernel SVMs against five honestly-tuned classical baselines across four standard NIDS datasets (NSL-KDD, UNSW-NB15, CICIDS2017, NF-ToN-IoT-v2) under one leakage-controlled protocol, with an equal-budget feature view, imbalance- and calibration-aware metrics with significance testing, and a simulated NISQ noise sweep. We introduce a quantum-attribution audit (parameter-matched classical controls, a random-feature kernel, and a regularisation sweep) that quantifies how much of any gain is genuinely attributable to the quantum component. Tuned classical models (Random Forest, XGBoost) match or exceed the quantum models on aggregate detection on every dataset, and the audit attributes this to classical preprocessing and regularisation rather than quantum effects. Two advantages survive false-discovery-rate correction: the quantum-kernel SVM out-ranks its direct classical surrogate (a random-feature kernel) on AUPRC and ROC-AUC, and a small four-qubit hybrid out-detects the best classical baseline at the 1% false-positive operating point on the distribution-shifted NSL-KDD task (p = 0.005, BH q = 0.030). Code, seeds, and splits are released; our contribution stands whether quantum wins, ties, or loses.
Modern networks generate high-dimensional traffic that requires numerous features for effective intrusion detection and cybercrime defence, creating a critical challenge for quantum approaches, where qubit availability remains the primary bottleneck for near-term implementation. We present a quantum-enhanced framework that employs Dual-Parameter encoding, using both the polar angle θ and azimuthal phase ϕ of each qubit to encode two normalized features, combined with multi-metric anomaly scoring and calibrated false-positive control. Our detector forms a composite score [Formula: see text] that unifies quantum fidelity (global state similarity), Kullback-Leibler divergence (distributional shift), and von Neumann entropy change (uncertainty shift). The decision threshold is set by quantile calibration on benign validation, and via the Dvoretzky-Kiefer-Wolfowitz inequality, comes with an explicit finite-sample upper bound on the false-positive rate under i.i.d. assumptions. For a selected feature set of size [Formula: see text], our Dual-Parameter encoding reduces the data-qubit requirement from [Formula: see text] to [Formula: see text] at matched-feature count. This qubit reduction preserves the entangling topology but adds one additional single-qubit encoding rotation [Formula: see text] per data qubit and a Hadamard readout layer; when a SWAP-test ancilla is used, the total count becomes [Formula: see text]. We evaluate DP-QIDS on UNSW-NB15 and CIC-IDS2017 and reproduce the baseline's DDoS setting both at a richer selected feature count and under the baseline's standard 87→4 classical compression pipeline applied to both encoders, to ensure direct matched-setting comparisons at the encoder level. Ablations show that fidelity captures correlation-shifting attacks, while KL/entropy detects randomized marginals; their fusion yields consistently reliable operation. We further provide a complexity analysis, deployment architecture, and streaming variants with drift-aware recalibration. Our Dual-Parameter Quantum Intrusion Detection System (DP-QIDS) advances quantum intrusion detection from proof-of-concept toward auditable, resource-aware deployment, connecting simulator studies with practical security operations for resilient infrastructure.
The practical value of quantum machine learning for network anomaly detection remains unclear under controlled and comparable benchmarking conditions. This study evaluates a trash-qubit-based Quantum Autoencoder (QAE) against seven classical anomaly-detection methods on UNSW-NB15 using shared data partitions, preprocessing steps, model selection procedures, and threshold calibration protocols. The experimental design included five independent seeds, three training set sizes, two feature budgets, and 12 QAE architectures, together with low-FPR analysis, finite-shot and synthetic-noise evaluation, less-constrained classical reference settings, and a cross-dataset assessment on TON_IoT. The Angle-RY encoding with a Real-Amplitudes Ring ansatz at depth L = 2 achieved the highest mean validation-selection AUPRC. On UNSW-NB15, the QAE was competitive in AUPRC and AUROC but remained behind the strongest classical baselines in F1-score, and its attack recall declined sharply under low-FPR constraints. The TON_IoT results further showed that relative model performance depended on the dataset. Under finite-shot and synthetic-noise conditions, anomaly-score rankings were largely preserved, whereas threshold-based decisions were more sensitive. Overall, the QAE showed competitive continuous-score discrimination on UNSW-NB15, but achieving reliable detection at low false-alarm rates remains a key operational challenge.