Graph-Contrastive Pretraining for Payload-Free Encrypted-Traffic Intrusion Detection: Cross-Dataset OOD Transfer with Frozen Artifacts
Abstract
1. Introduction
- 1.
- GCP with frozen-encoder probing;
- 2.
- 3.
- an SSL ablation without contrastive learning;
- 4.
- and strong tabular baselines (XGBoost and MLP), which remain competitive in separable regimes.
- (i)
- (ii)
- we provide a cross-dataset evaluation that explicitly measures out-of-domain (OOD) transfer via frozen artifacts and lightweight probing, complementing in-domain performance with generalization evidence [5];
- (iii)
- and we operationalize end-to-end reproducibility by freezing the exact run manifests, configurations, and intermediate artifacts used to generate every table and figure, extending deterministic IDS benchmarking principles to graph-based self-supervised learning [9].
2. Methodology
2.1. Overview and Reproducible Pipeline
2.2. Datasets, Label Spaces, and Prediction Targets
2.3. Tabular Preprocessing and Flow Materialization
2.4. Graph Construction and Stored Graph Assets
2.5. Seeded Train/Validation/Test Splits
2.6. Models and Training Objectives
- Graph-Contrastive Pretraining (GCP).
- Linear-probe evaluation on frozen embeddings.
- Supervised GNN baseline (GNN-Sup).
- SSL without contrast (reconstruction baseline).
- Tabular baselines.
2.7. In-Domain Evaluation and OOD Transfer
- In-domain protocol.
- OOD transfer protocol.
2.8. Metrics and Uncertainty Estimation
2.9. Implementation Details and Artifact Traceability
3. Discussion of Results
3.1. Scope, Evaluation Protocol, and How to Read the Tables/Figures
- What the results substantiate about novelty
3.2. In-Domain Binary Results (y): Where Graphs Help and Where They Do Not
- UNSW-NB15: a clear win for GCP on Macro-F1 and FAR.
- CICIDS2017: tabular remains dominant; graph SSL is competitive but not best.
- DoH L1/L2: feature-driven separability and the PR-vs-ROC reading.
3.3. Multi-Class/Multi-Label Results (): Macro Effects and Rare-Class Failure Modes
- UNSW multi-class: full-test reveals systematic minority-class collapse.
- DoH L3: GCP is robust but remains behind XGBoost on Macro-F1.
3.4. Out-of-Domain (OOD) Transfer: Frozen-Encoder Generalization and Dataset Shift
- Results Obtained for
- OOD transfer under multi-class labels ().
- Key OOD pattern: DoH-pretrained encoders transfer well to UNSW, CICIDS2017 does not transfer to DoH.
3.5. Comparative Performance Analysis
3.6. Operational Robustness and Error Analysis
- In-domain ROC behavior (y).
- In-domain PR behavior (y).
- ROC behavior under .
- PR behavior under and rare-class effects.
4. Conclusions and Future Works
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Appendix A
| Source Encoder | Target Dataset | Macro-F1 (95% CI) | AUROC | AUPR | FAR |
|---|---|---|---|---|---|
| CICIDS2017 | DoH-Combined L3 | 1.0000 [1.0000, 1.0000] | NA | NA | NA |
| DoH-Combined L1 | DoH-Combined L3 | 1.0000 [1.0000, 1.0000] | NA | NA | NA |
| DoH-Combined L2 | DoH-Combined L3 | 1.0000 [1.0000, 1.0000] | NA | NA | NA |
| DoH-Combined L3 | DoH-Combined L3 | 1.0000 [1.0000, 1.0000] | NA | NA | NA |
| UNSW-NB15 | DoH-Combined L3 | 1.0000 [1.0000, 1.0000] | NA | NA | NA |
References
- Hoffman, P.; McManus, P. DNS Queries over HTTPS (DoH); IETF RFC 8484; IETF: Fremont, CA, USA, 2018. [Google Scholar]
- Axelsson, S. The Base-Rate Fallacy and the Difficulty of Intrusion Detection. ACM Trans. Inf. Syst. Secur. 2000, 3, 186–205. [Google Scholar] [CrossRef]
- Chen, T.; Guestrin, C. XGBoost: A Scalable Tree Boosting System. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), San Francisco, CA, USA, 13–17 August 2016; pp. 785–794. [Google Scholar]
- Buczak, A.L.; Guven, E. A Survey of Data Mining and Machine Learning Methods for Cyber Security Intrusion Detection. IEEE Commun. Surv. Tutor. 2016, 18, 1153–1176. [Google Scholar] [CrossRef]
- Quionero-Candela, J.; Sugiyama, M.; Schwaighofer, A.; Lawrence, N.D. Dataset Shift in Machine Learning; MIT Press: Cambridge, MA, USA, 2008. [Google Scholar]
- Sommer, R.; Paxson, V. Outside the Closed World: On Using Machine Learning for Network Intrusion Detection. In Proceedings of the IEEE Symposium on Security and Privacy (S&P), Oakland, CA, USA, 16–19 May 2010; pp. 305–316. [Google Scholar]
- Liu, X.-M.; Chang, X.-H.; Hou, L.-W. Attack-Dependent Adaptive Event-Triggered Security Fuzzy Control for Nonlinear Networked Cascade Control Systems Under Deception Attacks. Mathematics 2024, 12, 3385. [Google Scholar] [CrossRef]
- Liu, X.-M.; Chang, X.-H. Adaptive event-triggered tracking control for nonlinear networked systems with dynamic quantization and deception attacks. Int. J. Robust Nonlinear Control 2024, 34, 8311–8333. [Google Scholar] [CrossRef]
- Arcos-Argudo, M.; Bojorque, R.; Torres, A. A Deterministic Comparison of Classical Machine Learning and Hybrid Deep Representation Models for Intrusion Detection on NSL-KDD and CICIDS2017. Algorithms 2025, 18, 749. [Google Scholar] [CrossRef]
- van den Oord, A.; Li, Y.; Vinyals, O. Representation Learning with Contrastive Predictive Coding. arXiv 2018, arXiv:1807.03748. [Google Scholar]
- Chen, T.; Kornblith, S.; Norouzi, M.; Hinton, G. A Simple Framework for Contrastive Learning of Visual Representations. In Proceedings of the 37th International Conference on Machine Learning (ICML), Virtual, 13–18 July 2020; pp. 1597–1607. [Google Scholar]
- Velićkovixcx, P.; Fedus, W.; Hamilton, W.L.; Liò, P.; Bengio, Y.; Hjelm, R.D. Deep Graph Infomax. In Proceedings of the 7th International Conference on Learning Representations (ICLR), New Orleans, LA, USA, 6–9 May 2019. [Google Scholar]
- You, Y.; Chen, T.; Sui, Y.; Chen, T.; Wang, Z.; Shen, Y. Graph Contrastive Learning with Augmentations. In Proceedings of the 34th Annual Conference on Neural Information Processing Systems (NeurIPS), Virtual, 6–12 December 2020. [Google Scholar]
- Sharafaldin, I.; Lashkari, A.H.; Ghorbani, A.A. Toward Generating a New Intrusion Detection Dataset and Intrusion Traffic Characterization. In Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP), Madeira, Portugal, 22–24 January 2018; pp. 108–116. [Google Scholar]
- Moustafa, N.; Slay, J. UNSW-NB15: A Comprehensive Data Set for Network Intrusion Detection Systems (UNSW-NB15 Network Data Set). In Proceedings of the IEEE Military Communications Conference (MILCOM), Tampa, FL, USA, 26–28 October 2015; pp. 1–6. [Google Scholar]
- MontazeriShatoori, M.; Golestan, L.; Hamadi, E.A.; Lashkari, A.H.; Ghorbani, A.A. Detection of DoH Tunnels Using Time-Series Classification of Encrypted Traffic. In Proceedings of the IEEE International Conference on Communications (ICC), Dublin, Ireland, 7–11 June 2020; pp. 1–6. [Google Scholar]
- Davis, J.; Goadrich, M. The Relationship Between Precision-Recall and ROC Curves. In Proceedings of the 23rd International Conference on Machine Learning (ICML), Pittsburgh, PA, USA, 25–29 June 2006; pp. 233–240. [Google Scholar]
- Saito, T.; Rehmsmeier, M. The Precision-Recall Plot is More Informative than the ROC Plot When Evaluating Binary Classifiers on Imbalanced Datasets. PLoS ONE 2015, 10, e0118432. [Google Scholar] [CrossRef] [PubMed]
- Kipf, T.N.; Welling, M. Semi-Supervised Classification with Graph Convolutional Networks. In Proceedings of the 5th International Conference on Learning Representations (ICLR), Toulon, France, 24–26 April 2017. [Google Scholar]
- Velićkovixcx, P.; Cucurull, G.; Casanova, A.; Romero, A.; Liò, P.; Bengio, Y. Graph Attention Networks. In Proceedings of the 6th International Conference on Learning Representations (ICLR), Vancouver, BC, Canada, 30 April–3 May 2018. [Google Scholar]
- Hamilton, W.L. Graph Representation Learning; Morgan & Claypool Publishers: San Rafael, CA, USA, 2020. [Google Scholar]
- Wasserman, L. All of Statistics: A Concise Course in Statistical Inference; Springer: Berlin/Heidelberg, Germany, 2004. [Google Scholar]
- Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In Proceedings of the NeurIPS, Vancouver, BC, Canada, 8–14 December 2019; pp. 8024–8035. [Google Scholar]
- Fey, M.; Lenssen, J.E. Fast Graph Representation Learning with PyTorch Geometric. In Proceedings of the ICLR Workshop on Representation Learning on Graphs and Manifolds, New Orleans, LA, USA, 6–9 May 2019. [Google Scholar]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine Learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar]
- Harris, C.R.; Millman, K.J.; van der Walt, S.J.; Gommers, R.; Virtanen, P.; Cournapeau, D.; Wieser, E.; Taylor, J.; Berg, S.; Smith, N.J.; et al. Array Programming with NumPy. Nature 2020, 585, 357–362. [Google Scholar] [CrossRef] [PubMed]
- McKinney, W. Data Structures for Statistical Computing in Python. In Proceedings of the Python in Science Conference (SciPy), Austin, TX, USA, 28 June–3 July 2010; pp. 56–61. [Google Scholar]
- Canadian Institute for Cybersecurity. CICIDS2017 Dataset. University of New Brunswick, 2017. Available online: https://www.unb.ca/cic/datasets/ids-2017.html (accessed on 5 February 2025).
- UNSW Canberra Cyber. The UNSW-NB15 Dataset, 2015. Available online: https://research.unsw.edu.au/projects/unsw-nb15-dataset (accessed on 6 March 2026).
- Canadian Institute for Cybersecurity. CIRA-CIC-DoHBrw-2020 Dataset. 2020. Available online: https://www.unb.ca/cic/datasets/dohbrw-2020.html (accessed on 6 March 2026).












| Model/Component | Key Setup/Hyperparameters |
|---|---|
| GCP encoder | Backbone: GraphSAGE-mean with L = 2 layers, hidden dim hidden = 128, dropout p = 0.2; neighbor sampling neigh_k = 10; categorical embedding cat_emb = 16. Batch nodes batch_nodes = 4096; device cpu. Graph inputs: cicids2017/graph_v2, unsw-nb15/argus/graph_v2, unsw-nb15/feature/graph_v3, doh-combined/l1|l2|l3/graph_v2. |
| Projection head | 2-layer MLP: 128 → 128 → 64 (proj_dim = 64), activation ReLU, dropout 0.0, output L2-normalized. |
| Contrastive objective | InfoNCE with cosine similarity; temperature tau = 0.2; in-batch negatives over batch_nodes = 4096. |
| Graph augmentations | Feature masking feat_mask_p = 0.15; edge dropout edge_drop_p = 0.2; subgraph cap max_nodes in {50,000, 200,000}; edge budget per epoch edge_sample in {2,000,000, 3,000,000} (fallback 2 for tiny graphs). |
| Pretraining optimization | Optimizer Adam; learning rate lr = 0.001; weight decay epochs 5 (short ablations may use 1 or 3); gradient clipping 1.0; early stopping on val_loss with patience 10; embeddings saved as float16 (save_embed_dtype = float16). |
| Linear probe (frozen encoder) | Binary y: logistic regression (solver = lbfgs), C = 1.0, max_iter = 2000, class_weight = balanced. Multiclass : multinomial logistic regression (solver = lbfgs), C = 1.0, max_iter = 2000. For both: random_state = seed, features standardized (StandardScaler) on train split only. |
| GNN-Sup (end-to-end) | Backbone: GraphSAGE-mean with L = 2 layers; hidden = 256, dropout = 0.2, epochs = 50, lr = 0.001, weight_decay = , batch_nodes = 512, neigh_k = 10, cat_emb = 16, early stopping patience = 3, max_train_nodes = 200,000, deterministic = true. |
| SSL no-contrast | ssl_nocontrast_graphmae_lite (masked reconstruction): encoder backbone GraphSAGE-mean, n_layers = 2, hidden = 128, dropout = 0.2, batch_nodes = 512, neigh_k = 10, mask ratio mask_ratio = 0.3. Pretraining: pre_epochs = 50, pre_lr = 0.001, pre_wd = , pre_patience = 4. Probe: probe_epochs = 50, probe_lr = 0.01, probe_patience = 5. Device: cpu. |
| Tabular-XGB | XGBoost (tree_method = hist): n_estimators = 500, max_depth = 8, learning_rate = 0.05, subsample = 0.8, colsample_bytree = 0.8, min_child_weight = 1, gamma = 0, reg_lambda = 1.0, reg_alpha = 0.0; early stopping early_stopping_rounds = 50 on validation. Seeds: {0,42,1337,2026,9999}; deterministic training enabled. Datasets/targets: cicids2017 (y, ), unsw-nb15-feature (y, ), doh-combined-l1 (y), doh-combined-l2 (y), doh-combined-l3 (). |
| Tabular-MLP | MLP: layers [512, 256], activation ReLU, dropout 0.2; optimizer Adam, lr = 0.001, weight_decay = , batch size 1024, epochs 50, early stopping patience 10 on validation. Seeds: {0,42,1337,2026,9999}; deterministic training enabled. |
| Source Encoder | Target Dataset | Macro-F1 | AUROC | AUPR | FAR |
|---|---|---|---|---|---|
| CICIDS2017 | CICIDS2017 | 0.8194 [0.7679, 0.8538] | 0.9281 [0.9221, 0.9339] | 0.7115 [0.6921, 0.7341] | 0.0937 [0.0619, 0.1311] |
| DoH-Combined L1 | CICIDS2017 | 0.7845 [0.7186, 0.8407] | 0.9260 [0.9192, 0.9312] | 0.7233 [0.6962, 0.7448] | 0.0958 [0.0666, 0.1312] |
| DoH-Combined L2 | CICIDS2017 | 0.7803 [0.7411, 0.8313] | 0.9190 [0.9082, 0.9273] | 0.6855 [0.6640, 0.7114] | 0.0923 [0.0606, 0.1404] |
| DoH-Combined L3 | CICIDS2017 | 0.8225 [0.7974, 0.8637] | 0.9268 [0.9213, 0.9344] | 0.7478 [0.7253, 0.7779] | 0.1053 [0.0641, 0.1366] |
| UNSW-NB15 | CICIDS2017 | 0.8440 [0.8280, 0.8708] | 0.9302 [0.9258, 0.9370] | 0.7317 [0.7146, 0.7586] | 0.1052 [0.0737, 0.1324] |
| CICIDS2017 | DoH-Combined L1 | 0.9902 [0.9896, 0.9909] | 0.9987 [0.9984, 0.9989] | 0.9962 [0.9952, 0.9968] | 0.0061 [0.0057, 0.0068] |
| DoH-Combined L1 | DoH-Combined L1 | 0.9946 [0.9942, 0.9951] | 0.9996 [0.9996, 0.9996] | 0.9983 [0.9982, 0.9985] | 0.0023 [0.0020, 0.0026] |
| DoH-Combined L2 | DoH-Combined L1 | 0.9928 [0.9919, 0.9939] | 0.9995 [0.9995, 0.9996] | 0.9978 [0.9977, 0.9981] | 0.0035 [0.0034, 0.0038] |
| DoH-Combined L3 | DoH-Combined L1 | 0.9934 [0.9921, 0.9939] | 0.9995 [0.9995, 0.9995] | 0.9972 [0.9970, 0.9975] | 0.0028 [0.0025, 0.0034] |
| UNSW-NB15 | DoH-Combined L1 | 0.9936 [0.9933, 0.9938] | 0.9995 [0.9995, 0.9996] | 0.9983 [0.9982, 0.9984] | 0.0030 [0.0025, 0.0035] |
| CICIDS2017 | DoH-Combined L2 | 0.9915 [0.9858, 0.9940] | 0.9999 [0.9999, 0.9999] | 1.0000 [1.0000, 1.0000] | 0.0228 [0.0129, 0.0430] |
| DoH-Combined L1 | DoH-Combined L2 | 0.9876 [0.9826, 0.9921] | 0.9998 [0.9998, 0.9998] | 1.0000 [1.0000, 1.0000] | 0.0326 [0.0155, 0.0518] |
| DoH-Combined L2 | DoH-Combined L2 | 0.9875 [0.9826, 0.9910] | 0.9998 [0.9998, 0.9998] | 1.0000 [1.0000, 1.0000] | 0.0323 [0.0195, 0.0513] |
| DoH-Combined L3 | DoH-Combined L2 | 0.9905 [0.9850, 0.9934] | 0.9999 [0.9998, 0.9999] | 1.0000 [1.0000, 1.0000] | 0.0252 [0.0158, 0.0454] |
| UNSW-NB15 | DoH-Combined L2 | 0.9871 [0.9843, 0.9907] | 0.9998 [0.9998, 0.9998] | 1.0000 [1.0000, 1.0000] | 0.0342 [0.0205, 0.0460] |
| CICIDS2017 | UNSW-NB15 | 0.9157 [0.8773, 0.9301] | 0.9550 [0.9539, 0.9559] | 0.9782 [0.9776, 0.9786] | 0.1797 [0.1471, 0.2212] |
| DoH-Combined L1 | UNSW-NB15 | 0.9064 [0.8735, 0.9410] | 0.9512 [0.9491, 0.9533] | 0.9720 [0.9687, 0.9764] | 0.1519 [0.1475, 0.1558] |
| DoH-Combined L2 | UNSW-NB15 | 0.9064 [0.8725, 0.9414] | 0.9512 [0.9490, 0.9531] | 0.9721 [0.9685, 0.9762] | 0.1513 [0.1461, 0.1550] |
| DoH-Combined L3 | UNSW-NB15 | 0.9051 [0.8712, 0.9395] | 0.9509 [0.9489, 0.9529] | 0.9711 [0.9682, 0.9752] | 0.1499 [0.1430, 0.1549] |
| UNSW-NB15 | UNSW-NB15 | 0.9053 [0.8748, 0.9382] | 0.9511 [0.9494, 0.9533] | 0.9711 [0.9657, 0.9762] | 0.1507 [0.1471, 0.1549] |
| Source Encoder | Target Dataset | Macro-F1 | AUROC | AUPR | FAR |
|---|---|---|---|---|---|
| CICIDS2017 | CICIDS2017 | 0.1588 [0.1121, 0.1825] | 0.5529 [0.5007, 0.5939] | 0.1705 [0.1452, 0.1864] | 0.1289 [0.0038, 0.3195] |
| DoH-Combined L1 | CICIDS2017 | 0.1330 [0.1089, 0.1771] | 0.5489 [0.4982, 0.6404] | 0.1714 [0.1432, 0.2276] | 0.1374 [0.0004, 0.3864] |
| DoH-Combined L2 | CICIDS2017 | 0.1406 [0.1227, 0.1676] | 0.5350 [0.4952, 0.5973] | 0.1579 [0.1426, 0.1813] | 0.1095 [0.0002, 0.2898] |
| DoH-Combined L3 | CICIDS2017 | 0.1392 [0.1230, 0.1773] | 0.5435 [0.4949, 0.5965] | 0.1649 [0.1436, 0.1845] | 0.1400 [0.0015, 0.3490] |
| UNSW-NB15 | CICIDS2017 | 0.1399 [0.1051, 0.1653] | 0.5857 [0.5470, 0.6123] | 0.1848 [0.1715, 0.1968] | 0.2545 [0.0499, 0.3815] |
| CICIDS2017 | DoH-Combined L1 | 0.8240 [0.5260, 0.9233] | 0.8471 [0.6492, 0.9174] | 0.7538 [0.4913, 0.8498] | 0.0187 [0.0038, 0.0340] |
| DoH-Combined L1 | DoH-Combined L1 | 0.8371 [0.6992, 0.9249] | 0.8689 [0.6963, 0.9606] | 0.7897 [0.5660, 0.9154] | 0.0154 [0.0029, 0.0440] |
| DoH-Combined L2 | DoH-Combined L1 | 0.9297 [0.8778, 0.9582] | 0.9594 [0.9291, 0.9781] | 0.9190 [0.8568, 0.9494] | 0.0155 [0.0030, 0.0268] |
| DoH-Combined L3 | DoH-Combined L1 | 0.9353 [0.9245, 0.9585] | 0.9578 [0.9347, 0.9707] | 0.9176 [0.8655, 0.9301] | 0.0161 [0.0033, 0.0296] |
| UNSW-NB15 | DoH-Combined L1 | 0.4511 [0.4329, 0.4752] | 0.6025 [0.5692, 0.6241] | 0.3901 [0.3700, 0.4104] | 0.0921 [0.0248, 0.1411] |
| CICIDS2017 | DoH-Combined L2 | 0.4743 [0.4740, 0.4755] | 0.5133 [0.5078, 0.5247] | 0.9033 [0.9023, 0.9054] | 0.9996 [0.9985, 1.0000] |
| DoH-Combined L1 | DoH-Combined L2 | 0.5454 [0.5020, 0.5696] | 0.5605 [0.5118, 0.5941] | 0.9214 [0.9098, 0.9271] | 0.8618 [0.7433, 0.9589] |
| DoH-Combined L2 | DoH-Combined L2 | 0.5507 [0.5348, 0.5808] | 0.5626 [0.5330, 0.5826] | 0.9228 [0.9175, 0.9290] | 0.8185 [0.7190, 0.9253] |
| DoH-Combined L3 | DoH-Combined L2 | 0.5146 [0.4922, 0.5378] | 0.5356 [0.5047, 0.5557] | 0.9138 [0.9090, 0.9191] | 0.9978 [0.9928, 1.0000] |
| UNSW-NB15 | DoH-Combined L2 | 0.2218 [0.1874, 0.2645] | 0.4637 [0.4275, 0.4953] | 0.6136 [0.5933, 0.6449] | 0.9534 [0.8579, 1.0000] |
| CICIDS2017 | DoH-Combined L3 | 0.3154 [0.2287, 0.3710] | 0.6674 [0.6410, 0.7044] | 0.3092 [0.2812, 0.3349] | 0.2240 [0.0796, 0.6506] |
| DoH-Combined L1 | DoH-Combined L3 | 0.3843 [0.2718, 0.4309] | 0.7318 [0.6649, 0.7798] | 0.3928 [0.3538, 0.4359] | 0.2721 [0.1805, 0.4957] |
| DoH-Combined L2 | DoH-Combined L3 | 0.3521 [0.3266, 0.3802] | 0.7136 [0.6932, 0.7424] | 0.3585 [0.3352, 0.3779] | 0.2807 [0.1920, 0.5039] |
| DoH-Combined L3 | DoH-Combined L3 | 0.4145 [0.2608, 0.4665] | 0.7530 [0.6574, 0.8046] | 0.4195 [0.3675, 0.4714] | 0.2567 [0.1842, 0.4677] |
| UNSW-NB15 | DoH-Combined L3 | 0.1067 [0.0720, 0.1374] | 0.5875 [0.4991, 0.6653] | 0.2537 [0.2250, 0.2813] | 0.4466 [0.1428, 0.8560] |
| CICIDS2017 | UNSW-NB15 | 0.0085 [0.0000, 0.0317] | 0.5814 [0.4701, 0.6280] | 0.3512 [0.2755, 0.4060] | 0.9991 [0.9971, 0.9999] |
| DoH-Combined L1 | UNSW-NB15 | 0.0077 [0.0001, 0.0319] | 0.5798 [0.4660, 0.6198] | 0.3518 [0.2789, 0.4036] | 0.9991 [0.9973, 0.9999] |
| DoH-Combined L2 | UNSW-NB15 | 0.0125 [0.0004, 0.0305] | 0.5863 [0.4976, 0.6168] | 0.3685 [0.2980, 0.3997] | 0.9976 [0.9936, 0.9998] |
| DoH-Combined L3 | UNSW-NB15 | 0.0145 [0.0004, 0.0364] | 0.5863 [0.4688, 0.6446] | 0.3734 [0.2729, 0.4647] | 0.9977 [0.9925, 0.9998] |
| UNSW-NB15 | UNSW-NB15 | 0.0449 [0.0407, 0.0515] | 0.5934 [0.5493, 0.6166] | 0.3767 [0.3365, 0.4041] | 0.9925 [0.9823, 0.9975] |
| Dataset | Method | Acc. | Macro-F1 | AUROC | AUPR | FAR |
|---|---|---|---|---|---|---|
| CICIDS2017 | GCP (ours) | 0.9796 [0.9784, 0.9807] | 0.9764 [0.9718, 0.9810] | 0.9589 [0.9501, 0.9677] | 0.9796 [0.9745, 0.9847] | 0.0385 [0.0302, 0.0468] |
| CICIDS2017 | GNN-Sup | 0.9977 [0.9973, 0.9981] | 0.9969 [0.9967, 0.9971] | 0.9972 [0.9970, 0.9974] | 0.9995 [0.9994, 0.9996] | 0.0018 [0.0014, 0.0022] |
| CICIDS2017 | SSL w/o contrast | 0.9940 [0.9938, 0.9942] | 0.9878 [0.9872, 0.9884] | 0.9892 [0.9884, 0.9900] | 0.9970 [0.9967, 0.9973] | 0.0100 [0.0090, 0.0110] |
| CICIDS2017 | Tabular-XGB | 0.9989 [0.9988, 0.9989] | 0.9985 [0.9984, 0.9986] | 0.9990 [0.9990, 0.9990] | 0.9998 [0.9998, 0.9999] | 0.0011 [0.0010, 0.0012] |
| CICIDS2017 | Tabular-MLP | 0.9959 [0.9954, 0.9965] | 0.9857 [0.9844, 0.9870] | 0.9875 [0.9852, 0.9898] | 0.9948 [0.9941, 0.9955] | 0.0107 [0.0076, 0.0138] |
| UNSW-NB15 | GCP (ours) | 0.9987 [0.9980, 0.9993] | 0.9932 [0.9899, 0.9965] | 0.9981 [0.9977, 0.9985] | 0.9976 [0.9970, 0.9982] | 0.0126 [0.0079, 0.0173] |
| UNSW-NB15 | GNN-Sup | 0.8642 [0.8572, 0.8712] | 0.6202 [0.6066, 0.6338] | 0.9520 [0.9497, 0.9543] | 0.9381 [0.9355, 0.9407] | 0.3536 [0.3280, 0.3792] |
| UNSW-NB15 | SSL w/o contrast | 0.7258 [0.7205, 0.7311] | 0.5033 [0.4824, 0.5242] | 0.7641 [0.7486, 0.7796] | 0.7149 [0.6912, 0.7386] | 0.9444 [0.8883, 1.0000] |
| UNSW-NB15 | Tabular-XGB | 0.9340 [0.9335, 0.9344] | 0.9287 [0.9283, 0.9291] | 0.9975 [0.9974, 0.9976] | 0.9714 [0.9709, 0.9719] | 0.1357 [0.1348, 0.1366] |
| UNSW-NB15 | Tabular-MLP | 0.8946 [0.8923, 0.8969] | 0.9294 [0.9284, 0.9304] | 0.9976 [0.9974, 0.9978] | 0.9721 [0.9707, 0.9735] | 0.1356 [0.1334, 0.1378] |
| DoH-Combined L1 | GCP (ours) | 0.8969 [0.8962, 0.8976] | 0.9375 [0.9040, 0.9710] | 0.9687 [0.9355, 1.0000] | 0.9890 [0.9785, 0.9995] | 0.0347 [0.0000, 0.0694] |
| DoH-Combined L1 | GNN-Sup | 0.9055 [0.9034, 0.9076] | 0.8587 [0.8199, 0.8975] | 0.9318 [0.8864, 0.9772] | 0.9627 [0.9428, 0.9826] | 0.1254 [0.0715, 0.1793] |
| DoH-Combined L1 | SSL w/o contrast | 0.9358 [0.9276, 0.9440] | 0.9584 [0.9477, 0.9691] | 0.9950 [0.9942, 0.9958] | 0.9990 [0.9990, 0.9990] | 0.0469 [0.0259, 0.0679] |
| DoH-Combined L1 | Tabular-XGB | 0.9926 [0.9925, 0.9928] | 0.9999 [0.9999, 0.9999] | 1.0000 [1.0000, 1.0000] | 1.0000 [1.0000, 1.0000] | 0.0002 [0.0001, 0.0003] |
| DoH-Combined L1 | Tabular-MLP | 0.9715 [0.9689, 0.9741] | 0.9594 [0.9198, 0.9990] | 0.9944 [0.9941, 0.9947] | 0.9994 [0.9991, 0.9997] | 0.0658 [0.0000, 0.1390] |
| DoH-Combined L2 | GCP (ours) | 0.9685 [0.9681, 0.9688] | 0.8582 [0.8313, 0.8851] | 0.9412 [0.9258, 0.9566] | 0.9609 [0.9444, 0.9774] | 0.1440 [0.1150, 0.1730] |
| DoH-Combined L2 | GNN-Sup | 0.9195 [0.9128, 0.9263] | 0.4792 [0.4520, 0.5064] | 0.8978 [0.8920, 0.9036] | 0.8969 [0.8907, 0.9031] | 0.8562 [0.7960, 0.9164] |
| DoH-Combined L2 | SSL w/o contrast | 0.9241 [0.9074, 0.9409] | 0.9239 [0.9057, 0.9421] | 0.9758 [0.9640, 0.9876] | 0.9968 [0.9946, 0.9990] | 0.0890 [0.0468, 0.1312] |
| DoH-Combined L2 | Tabular-XGB | 0.9965 [0.9964, 0.9965] | 0.9820 [0.9816, 0.9824] | 0.9973 [0.9971, 0.9975] | 0.9989 [0.9988, 0.9990] | 0.0202 [0.0194, 0.0210] |
| DoH-Combined L2 | Tabular-MLP | 0.9846 [0.9838, 0.9854] | 0.9480 [0.9458, 0.9502] | 0.9950 [0.9948, 0.9952] | 0.9995 [0.9994, 0.9996] | 0.0968 [0.0924, 0.1012] |
| Dataset | Method | Acc. | Macro-F1 | AUROC | AUPR | |
|---|---|---|---|---|---|---|
| CICIDS2017 | 5 | GCP (ours) | 0.9883 [0.9840, 0.9926] | 0.9411 [0.9285, 0.9537] | 0.9808 [0.9692, 0.9924] | 0.9323 [0.9139, 0.9507] |
| CICIDS2017 | 5 | GNN-Sup | 0.9864 [0.9861, 0.9867] | 0.9782 [0.9774, 0.9790] | 1.0000 [1.0000, 1.0000] | 0.9998 [0.9996, 1.0000] |
| CICIDS2017 | 5 | SSL w/o contrast | 0.9820 [0.9809, 0.9831] | 0.9589 [0.9572, 0.9606] | 0.9897 [0.9893, 0.9901] | 0.9686 [0.9671, 0.9701] |
| CICIDS2017 | 5 | Tabular-XGB | 0.9959 [0.9958, 0.9960] | 0.9659 [0.9654, 0.9664] | 0.9995 [0.9982, 1.0000] | 0.9800 [0.9385, 1.0000] |
| CICIDS2017 | 5 | Tabular-MLP | 0.9797 [0.9770, 0.9824] | 0.8771 [0.8657, 0.8885] | 0.9896 [0.9731, 1.0000] | 0.8686 [0.8290, 0.9082] |
| UNSW-NB15 | 4 | GCP (ours) | 0.6157 [0.6129, 0.6184] | 0.2940 [0.2925, 0.2955] | 0.5966 [0.5956, 0.5975] | 0.3174 [0.3166, 0.3181] |
| UNSW-NB15 | 4 | GNN-Sup | 0.7364 [0.7324, 0.7404] | 0.2558 [0.2518, 0.2598] | 0.9109 [0.8792, 0.9426] | 0.6874 [0.6221, 0.7527] |
| UNSW-NB15 | 4 | SSL w/o contrast | 0.9639 [0.9632, 0.9646] | 0.6195 [0.6081, 0.6309] | 0.8646 [0.8623, 0.8669] | 0.5330 [0.5205, 0.5455] |
| UNSW-NB15 | 4 | Tabular-XGB | 0.9368 [0.9362, 0.9374] | 0.6806 [0.6794, 0.6818] | 0.9611 [0.9604, 0.9617] | 0.7939 [0.7904, 0.7973] |
| UNSW-NB15 | 4 | Tabular-MLP | 0.9371 [0.9355, 0.9387] | 0.6822 [0.6800, 0.6844] | 0.9305 [0.9223, 0.9386] | 0.6986 [0.6781, 0.7191] |
| DoH-Combined L1 | 2 | GCP (ours) | 0.9544 [0.9441, 0.9647] | 0.9382 [0.9192, 0.9572] | 0.9683 [0.9436, 0.9930] | 0.9892 [0.9834, 0.9950] |
| DoH-Combined L1 | 2 | GNN-Sup | 0.9116 [0.9050, 0.9182] | 0.8898 [0.8747, 0.9049] | 0.9053 [0.8879, 0.9228] | 0.8655 [0.8507, 0.8804] |
| DoH-Combined L1 | 2 | SSL w/o contrast | 0.9706 [0.9696, 0.9716] | 0.9386 [0.9356, 0.9416] | 0.9950 [0.9944, 0.9956] | 0.9989 [0.9985, 0.9993] |
| DoH-Combined L1 | 2 | Tabular-XGB | 0.9999 [0.9999, 0.9999] | 0.9999 [0.9999, 0.9999] | 1.0000 [1.0000, 1.0000] | 1.0000 [1.0000, 1.0000] |
| DoH-Combined L1 | 2 | Tabular-MLP | 0.9717 [0.9688, 0.9746] | 0.9633 [0.9525, 0.9741] | 0.9955 [0.9948, 0.9962] | 0.9991 [0.9988, 0.9994] |
| DoH-Combined L2 | 2 | GCP (ours) | 0.9015 [0.8914, 0.9116] | 0.8668 [0.8466, 0.8870] | 0.9420 [0.9290, 0.9550] | 0.9613 [0.9464, 0.9762] |
| DoH-Combined L2 | 2 | GNN-Sup | 0.5799 [0.5594, 0.6004] | 0.4792 [0.4520, 0.5064] | 0.8978 [0.8920, 0.9036] | 0.8969 [0.8907, 0.9031] |
| DoH-Combined L2 | 2 | SSL w/o contrast | 0.9535 [0.9464, 0.9606] | 0.9240 [0.9062, 0.9418] | 0.9758 [0.9640, 0.9876] | 0.9968 [0.9946, 0.9990] |
| DoH-Combined L2 | 2 | Tabular-XGB | 0.9911 [0.9909, 0.9913] | 0.9820 [0.9816, 0.9824] | 0.9973 [0.9971, 0.9975] | 0.9989 [0.9988, 0.9990] |
| DoH-Combined L2 | 2 | Tabular-MLP | 0.9530 [0.9521, 0.9539] | 0.9480 [0.9458, 0.9502] | 0.9950 [0.9948, 0.9952] | 0.9995 [0.9994, 0.9996] |
| DoH-Combined L3 | 6 | GCP (ours) | 0.9630 [0.9617, 0.9643] | 0.8130 [0.8059, 0.8201] | 0.9747 [0.9720, 0.9774] | 0.8636 [0.8550, 0.8722] |
| DoH-Combined L3 | 6 | GNN-Sup | 0.9513 [0.9504, 0.9522] | 0.6891 [0.6769, 0.7013] | 0.7054 [0.6748, 0.7360] | 0.4514 [0.3579, 0.5449] |
| DoH-Combined L3 | 6 | SSL w/o contrast | 0.9408 [0.9402, 0.9414] | 0.6540 [0.6475, 0.6605] | 0.9710 [0.9706, 0.9714] | 0.8477 [0.8460, 0.8494] |
| DoH-Combined L3 | 6 | Tabular-XGB | 0.9938 [0.9937, 0.9939] | 0.9867 [0.9865, 0.9869] | 0.9999 [0.9999, 0.9999] | 0.9979 [0.9978, 0.9980] |
| DoH-Combined L3 | 6 | Tabular-MLP | 0.9866 [0.9858, 0.9874] | 0.8653 [0.8599, 0.8707] | 0.9971 [0.9964, 0.9979] | 0.9679 [0.9617, 0.9742] |
| Class | Support (Mean [Min, Max]) | F1 (95% CI) |
|---|---|---|
| 0 | 18,600 [18,600, 18,600] | 0.4492 [0.4451, 0.4533] |
| 1 | 3282 [3231, 3335] | 0.0000 [0.0000, 0.0000] |
| 7 | 2805 [2701, 2878] | 0.0000 [0.0000, 0.0000] |
| 11 | 26,848 [26,805, 26,956] | 0.7268 [0.7248, 0.7289] |
| Class | Support (Mean [Min, Max]) | F1 (95% CI) |
|---|---|---|
| 0 | 20,024 [19,896, 20,056] | 0.9509 [0.9501, 0.9516] |
| 1 | 2878 [2812, 2937] | 0.5561 [0.5515, 0.5607] |
| 2 | 4282 [4232, 4335] | 0.6888 [0.6780, 0.6996] |
| 3 | 27,525 [27,375, 27,632] | 0.9328 [0.9311, 0.9345] |
| 4 | 18,044 [17,953, 18,118] | 0.8317 [0.8274, 0.8360] |
| 5 | 17,621 [17,507, 17,721] | 0.9198 [0.9178, 0.9218] |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Arcos-Argudo, M.; Bojorque, R.; Galarza-García, D. Graph-Contrastive Pretraining for Payload-Free Encrypted-Traffic Intrusion Detection: Cross-Dataset OOD Transfer with Frozen Artifacts. Algorithms 2026, 19, 389. https://doi.org/10.3390/a19050389
Arcos-Argudo M, Bojorque R, Galarza-García D. Graph-Contrastive Pretraining for Payload-Free Encrypted-Traffic Intrusion Detection: Cross-Dataset OOD Transfer with Frozen Artifacts. Algorithms. 2026; 19(5):389. https://doi.org/10.3390/a19050389
Chicago/Turabian StyleArcos-Argudo, Miguel, Rodolfo Bojorque, and David Galarza-García. 2026. "Graph-Contrastive Pretraining for Payload-Free Encrypted-Traffic Intrusion Detection: Cross-Dataset OOD Transfer with Frozen Artifacts" Algorithms 19, no. 5: 389. https://doi.org/10.3390/a19050389
APA StyleArcos-Argudo, M., Bojorque, R., & Galarza-García, D. (2026). Graph-Contrastive Pretraining for Payload-Free Encrypted-Traffic Intrusion Detection: Cross-Dataset OOD Transfer with Frozen Artifacts. Algorithms, 19(5), 389. https://doi.org/10.3390/a19050389

