Open-set detection of training-time unseen attacks in encrypted traffic based on a multi-granularity pre-trained transformer and prototype contrastive learning

With the widespread use of encrypted communication protocols, payload-based inspection is increasingly constrained, making it difficult to identify command-and-control communication, malicious downloads, scanning, lateral movement, and other attacks hidden in encrypted channels. Existing encrypted-traffic classifiers achieve high accuracy on known categories but usually rely on a closed-set assumption and may therefore force previously unseen traffic into known classes. This study proposes MGPT-PCL-OSD, an open-set detector for training-time unseen attack classes, which are used as a reproducible proxy for zero-day behavior rather than as evidence of previously undisclosed real-world exploits. The method represents traffic at byte-fragment, packet, flow, session, and interaction-graph levels, learns cross-granularity context through multi-task self-supervised pre-training, and uses prototype contrastive learning to compact known-class distributions and enlarge inter-class margins. Open-set rejection jointly considers nearest sub-prototype distance, class radius, classification confidence, energy, and predictive uncertainty; rejected traffic can then be clustered and incorporated through analyst-confirmed, replay-assisted prototype updates. Across five class-level holdout splits and three random seeds per split, MGPT-PCL-OSD achieves 94.1 ± 0.3% Accuracy, 93.5 ± 0.4% Macro-F1, 93.7 ± 0.6% open-set AUROC, and 86.8 ± 0.7% OSCR. The improvements over the strongest MIETT-like baseline are significant after adjustment (p < 0.001). On a matched CICIDS2017 S1 comparison, the proposed method reaches 93.8% AUROC and 14.7% FPR@95TPR, outperforming MSP, Energy, OpenMax, Mahalanobis, ARPL, and two traffic-specific open-set baselines under the same input/backbone control. The unknown-discovery stage achieves ARI 0.82 ± 0.05 and NMI 0.85 ± 0.04, and end-to-end single-flow latency is 11.0 ms on an RTX 3090. These results support open-set detection of training-time unseen attacks under controlled benchmark protocols; they should be interpreted as a zero-day proxy rather than direct evidence of detecting undisclosed real-world exploits.

Authors

Institutions

Publication Details

Journal
PLoS ONE
Published
2026-11-24
DOI
https://doi.org/10.1371/journal.pone.0359792
Primary Topic
Network Security and Intrusion Detection
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Open-set detection of training-time unseen attacks in encrypted traffic based on a multi-granularity pre-trained transformer and prototype contrastive learning

Siyan Gao
3 links
PLoS ONE
Network Security and Intrusion Detection
article

Open-set detection of training-time unseen attacks in encrypted traffic based on a multi-granularity pre-trained transformer and prototype contrastive learning

Siyan Gao
article en

Abstract

With the widespread use of encrypted communication protocols, payload-based inspection is increasingly constrained, making it difficult to identify command-and-control communication, malicious downloads, scanning, lateral movement, and other attacks hidden in encrypted channels. Existing encrypted-traffic classifiers achieve high accuracy on known categories but usually rely on a closed-set assumption and may therefore force previously unseen traffic into known classes. This study proposes MGPT-PCL-OSD, an open-set detector for training-time unseen attack classes, which are used as a reproducible proxy for zero-day behavior rather than as evidence of previously undisclosed real-world exploits. The method represents traffic at byte-fragment, packet, flow, session, and interaction-graph levels, learns cross-granularity context through multi-task self-supervised pre-training, and uses prototype contrastive learning to compact known-class distributions and enlarge inter-class margins. Open-set rejection jointly considers nearest sub-prototype distance, class radius, classification confidence, energy, and predictive uncertainty; rejected traffic can then be clustered and incorporated through analyst-confirmed, replay-assisted prototype updates. Across five class-level holdout splits and three random seeds per split, MGPT-PCL-OSD achieves 94.1 ± 0.3% Accuracy, 93.5 ± 0.4% Macro-F1, 93.7 ± 0.6% open-set AUROC, and 86.8 ± 0.7% OSCR. The improvements over the strongest MIETT-like baseline are significant after adjustment (p < 0.001). On a matched CICIDS2017 S1 comparison, the proposed method reaches 93.8% AUROC and 14.7% FPR@95TPR, outperforming MSP, Energy, OpenMax, Mahalanobis, ARPL, and two traffic-specific open-set baselines under the same input/backbone control. The unknown-discovery stage achieves ARI 0.82 ± 0.05 and NMI 0.85 ± 0.04, and end-to-end single-flow latency is 11.0 ms on an RTX 3090. These results support open-set detection of training-time unseen attacks under controlled benchmark protocols; they should be interpreted as a zero-day proxy rather than direct evidence of detecting undisclosed real-world exploits.

PLoS ONEVol. 21(11)
Nanyang Technological University (SG)
Network Security and Intrusion Detection
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon