Random-forest QKD-attack classifier, with quantum-kernel SVC and QNN comparisons
published ONNX: a 200-tree scikit-learn random forest over 7 telemetry features. Offline comparisons, not in the ONNX: a quantum-kernel SVC (PCA -> angle embedding; its fidelity kernel is exactly the classical product kernel prod cos^2((x_i - x'_i)/2)) and a variational QNN (StronglyEntanglingLayers, 25 parameters)
Part of QSMPC-QKD-QHE-AI-Hybrid,
a quantum-safe orchestration demo.
This is the plaintext model for the telecom_ids use case. No code path
evaluates this model under encryption; what each use case encrypts, if anything,
is stated in the notes below.
Measured performance
| metric | value |
|---|---|
aggregate_accuracy |
0.986667 |
classical_rf_macro_f1 |
0.986629 |
n_classes |
8 |
n_samples |
2400 |
quantum_qnn_accuracy |
0.875 |
quantum_qnn_binary_f1 |
0.933333 |
quantum_qnn_macro_f1 |
0.466667 |
quantum_qnn_n_params |
25 |
quantum_svc_accuracy |
0.908333 |
quantum_svc_binary_f1 |
0.945274 |
quantum_svc_macro_f1 |
0.831611 |
wall_clock_s |
341.5 |
Published baselines this is measured against
- Target metric: macro F1 (synthetic QKD-attack telemetry)
- Baseline: Architecture showcase, not a performance claim. On THIS project's synthetic telemetry neither quantum model beats the classical random forest (RF macro F1 0.987 vs variational QNN 0.467). Published results are MIXED, not uniformly below a random forest -- an earlier revision of this note claimed they were, and the very paper cited here contradicts it: Al-Kuwari et al. (arXiv:2509.14282) Table VIII reports a hybrid QLSTM at 94.7% accuracy / 94.7% F1 against their own random-forest baseline on the same generated data, at 81.5 to 82.6% accuracy by tree count (read at the source, 2026-11-12). This project's forest reaches macro F1 0.987 on its own generator; the metrics and the simulations differ, so the figures rank nothing, but this generator's classes separate more easily than theirs. What remains well-founded is caution about evaluation quality rather than a universal ranking: arXiv:2512.05069 was withdrawn by its own authors, who 'have identified limitations in the experimental evaluation, which are insufficient to fully support the paper's conclusions' (its v2 comment, 2026-04-02). That single withdrawal is thin support for a field-wide claim, so the anchor is now a survey: Kaissar, Bou Nassif & Bouridane, Future Internet 18(5):234 (2026-04-27, CC BY 4.0, DOI 10.3390/fi18050234), systematic to January 2026, finds that 'most current approaches rely on simulated quantum environments and legacy datasets, while evaluation practices remain inconsistent across studies' - active but methodologically early, which is a different and better-founded statement than 'worse than a random forest'. The Al-Kuwari paper is now peer-reviewed: IET Quantum Communication 7(1), DOI 10.1049/qtc2.70028 (2026-02-23). And the nearest 2026 results are CLASSICAL, which corroborates the framing here. The nearest in shape, read at the abstract on 2026-11-21: Isha et al. (arXiv:2608.04047, 2026-08-04, a preprint) classify seven BB84 eavesdropping attacks and a normal channel, this model's eight classes, under noise and loss from 63 temporal QBER features, with XGBoost at macro F1 0.8803 over ten runs on their own simulator, where a fixed 11% QBER threshold reaches 25.82% accuracy as an attack-or-normal detector. Their simulator and features are not this project's, so the figures rank nothing either. IACR ePrint 2026/1282 reaches 96.9% recall / 97.6% precision with physics-aware temporal features plus XGBoost against 17.3% for static QBER thresholding, but on a DIFFERENT problem: entanglement-based BBM92, binary detection of blended sub-threshold attacks on simulated FSO telemetry. And a synthetic score need not travel: QF-LOG (arXiv:2610.25203, QUANCOM 2026) reports macro F1 0.82 on its generator and 0.56 on the same equations under shifted operating parameters. Each is an anchor, not a baseline.
- Companion metric shown alongside:
aggregate_accuracy- reported together because the aggregate figure can look healthy while the class that matters is not.
Training data
- Dataset: QKD attack telemetry (synthetic, signatures of this project's own design)
- Licence: Apache-2.0
- Source: https://arxiv.org/abs/2509.14282 (licence read 2026-11-01)
8 classes = 7 attack types + normal, per Al-Kuwari et al. (IET Quantum Communication 7(1), e70028, 2026). The class list follows the paper; the 7 features and their signature values are this project's own design: illustrative, not fitted to any measurement. No public real QKD-attack capture was found (arXiv:2508.12749 reports anomalies recorded on an experimental QKD receiver and states no data release); this is labelled synthetic everywhere it is reported. The rows are written by this repository's generator (qsh.qml_ids.attacks), and they and the weights trained on them are released under the repository's licence, Apache-2.0.
Notes and limitations
The published model and its headline accuracy are the random forest's. The quantum-kernel SVC and the variational QNN, recorded at training time and not run on the page, are BINARY attack-against-normal classifiers, each trained on its own smaller draw (60 and 120 rows per class), so their macro F1, 0.832 and 0.467, averages two classes; the QNN predicts attack for every row, and 0.467 is that constant predictor's score. On each one's own split and labels a forest trained the same way scores 1.0 and 0.990 (docs/measurements/telecom-quantum-like-for-like-2026-11-07.json). The SVC's kernel uses no entangling gate, so it is computable classically in closed form.
Honest scope
This model is published as part of a research proof of concept, not as a production system.
Numbers above are what this repository measured on the split described, with the code in
scripts/train/. Where a figure is carried from the literature rather than measured here,
it is labelled as such.