This software and experiment package provides the reproducibility materials for a comparative study of Variational Quantum Classification (VQC) and Quantum Kernel Alignment (QKA) for binary network intrusion detection using the UNSW-NB15 benchmark dataset. Version 2 preserves the original VQC/QKA/Fast-QKA experiment material and adds a reviewer-requested validation layer consisting of a paired 10-seed comparison of RBF-SVC, VQC, and QKA under identical sampling and train-only preprocessing. Each seed uses 200 balanced training and 200 balanced testing observations, eight PCA components, and an eight-qubit ZZFeatureMap representation. The package includes per-seed metrics, summary statistics, confusion counts, runtime measurements, optimizer outputs, objective histories, environment manifests, and paired statistical tests. Across the ten seeds, RBF-SVC achieved the highest mean accuracy (0.8535 ± 0.0282), followed by QKA (0.8275 ± 0.0290) and VQC (0.6050 ± 0.0428). QKA achieved a mean ROC-AUC of 0.9162 ± 0.0260 and substantially outperformed the tested VQC, while the classical baseline remained strongest overall. Version 2 also includes the final QKA finite-shot and synthetic-noise sensitivity experiment implemented with Qiskit Aer using 1,024 shots and simulator seeds 101, 202, and 303. Under the highest tested noise setting (p1 = 0.005, p2 = 0.030, readout error = 0.030), QKA ROC-AUC decreased from 0.9175 in the exact reference to 0.5875 ± 0.0217. The package contains notebooks, raw and summarised results, kernel matrices, publication figures, documentation, provenance records, software requirements, metadata templates, manifests, and SHA-256 checksums. Historical Fast-QKA results are retained for provenance but are not used as part of the repeated-seed inferential comparison. The experiments are simulation-based and do not establish general quantum advantage or physical-device readiness.
This software and experiment package provides the reproducibility materials for a comparative study of Variational Quantum Classification (VQC) and Quantum Kernel Alignment (QKA) for binary network intrusion detection using the UNSW-NB15 benchmark dataset. Version 2 preserves the original VQC/QKA/Fast-QKA experiment material and adds a reviewer-requested validation layer consisting of a paired 10-seed comparison of RBF-SVC, VQC, and QKA under identical sampling and train-only preprocessing. Each seed uses 200 balanced training and 200 balanced testing observations, eight PCA components, and an eight-qubit ZZFeatureMap representation. The package includes per-seed metrics, summary statistics, confusion counts, runtime measurements, optimizer outputs, objective histories, environment manifests, and paired statistical tests. Across the ten seeds, RBF-SVC achieved the highest mean accuracy (0.8535 ± 0.0282), followed by QKA (0.8275 ± 0.0290) and VQC (0.6050 ± 0.0428). QKA achieved a mean ROC-AUC of 0.9162 ± 0.0260 and substantially outperformed the tested VQC, while the classical baseline remained strongest overall. Version 2 also includes the final QKA finite-shot and synthetic-noise sensitivity experiment implemented with Qiskit Aer using 1,024 shots and simulator seeds 101, 202, and 303. Under the highest tested noise setting (p1 = 0.005, p2 = 0.030, readout error = 0.030), QKA ROC-AUC decreased from 0.9175 in the exact reference to 0.5875 ± 0.0217. The package contains notebooks, raw and summarised results, kernel matrices, publication figures, documentation, provenance records, software requirements, metadata templates, manifests, and SHA-256 checksums. Historical Fast-QKA results are retained for provenance but are not used as part of the repeated-seed inferential comparison. The experiments are simulation-based and do not establish general quantum advantage or physical-device readiness.
Both VQC and QKA achieved competitive intrusion detection performance on the UNSW-NB15 dataset using identical preprocessing and feature encoding. Quantum Kernel Alignment demonstrated more stable optimization by reducing the number of trainable parameters while preserving classification accuracy. Fast QKA significantly reduced computational time compared with conventional scaled QKA, making it more suitable for practical hybrid quantum–classical intrusion detection systems. GPU-accelerated Qiskit Aer simulation substantially reduced execution time, enabling efficient experimentation using eight-qubit quantum circuits. The experimental results confirm that trainable quantum kernel methods constitute a promising alternative to variational quantum classifiers for near-term quantum intrusion detection, particularly under current NISQ hardware limitations.
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.
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.
Quantum kernel methods have been proposed for network intrusion detection, yet their performance limitations are often attributed to noise in current quantum hardware. This study evaluates that assumption through a controlled analysis of Pegasos-QSVC on the NSL-KDD and ToN-IoT datasets. We perform 56 quantum experiments using one exact noiseless statevector backend and three noise-simulated superconducting backends while keeping preprocessing, PCA features, data splits, and classical baselines identical. XGBoost achieves accuracies of 98.94% on NSL-KDD and 99.41% on ToN-IoT, compared with 91.80% and 82.98% for Pegasos-QSVC. The quantum model also exhibits substantially greater seed-dependent variability. Eight runs collapse into degenerate classifiers, including four recall-collapse cases and four trivial-positive classifiers. Notably, two failures occur on the noiseless backend, demonstrating that hardware noise is not a necessary condition for classi-fier collapse. Kernel Gram matrix analysis further reveals low effective rank and severe ill-conditioning even in the absence of noise, indicating intrinsic fragility in the learned quantum representation. These results show that average accuracy alone can conceal operationally unacceptable behavior and highlight the importance of reporting worst-case performance, seed-level variability, class-specific metrics, and explicit degeneracy tests in quantum intrusion detection studies.
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.
Variational quantum classifiers (VQCs) are often compared with classical models under unequal data partitions, tuning budgets, or statistical treatment. We benchmark a 4-qubit VQC against logistic regression, an RBF-SVM, random forest, a quantum-kernel SVM (QSVM), and a majority-class control on Breast Cancer Wisconsin (n=569), Coimbra (n=116), and Golub leukemia (n=72), using five stratified folds across five seeds (25 paired blocks per dataset), identical training-fold-fitted preprocessing, and Nadeau–Bengio corrected paired tests with Holm correction. A first arm with a frozen configuration and the common [0, π] angle encoding left the VQC at 0.563, 0.515, and 0.576 accuracy (majority 0.617, 0.552, 0.652). In a second arm, in which every model was tuned by the same inner cross-validation and the encoding scale was a tuned hyperparameter, VQC accuracy rose to 0.864, 0.616, and 0.747. On Wisconsin the VQC stayed significantly below every matched classical model (differences 0.079–0.097, Holm p≤0.006) but above the majority class; on Golub it was significantly below only the SVM (Holm p=0.016); on Coimbra no comparison was significant. A QSVM with the same feature map exceeded the VQC numerically on every dataset, and three optimizers reached the same training loss in pilot diagnostics, pointing to the encoding and the variational head rather than the optimizer. The Wisconsin arms also differ in sample size (120 versus 569). Results apply to this low-qubit, PCA-compressed, exactly simulated setting and do not indicate a quantum advantage.