TAO-Net: Two-stage Adaptive OOD Classification Network for Fine-grained Encrypted Traffic Classification
Zihao Wang, Wei Peng, Junming Zhang, Jian Li, Wenxin Fang
TL;DR
TAO-Net introduces a two-stage adaptive framework for encrypted traffic classification that handles both In-Distribution (ID) and Out-of-Distribution (OOD) traffic. The first stage uses a hybrid detector combining inter-layer transformation smoothness and PCA-based analysis to separate ID from OOD data; the second stage applies a Transformer classifier to ID traffic and leverages Large Language Models (LLMs) with a Semantic-enhanced Prompt Strategy (SPS) to generate fine-grained OOD labels. Across CHNAPP, ISCXVPN, and ISCXTor datasets, TAO-Net achieves macro-precision of 96.81–97.70% and macro-F1 of 96.77–97.68%, substantially outperforming baselines that struggle with OOD cases. The work demonstrates that transforming traffic classification into a generation task via controlled prompting and stage-specific processing yields robust, scalable identification of emerging applications, with strong implications for network security monitoring and threat detection.
Abstract
Encrypted traffic classification aims to identify applications or services by analyzing network traffic data. One of the critical challenges is the continuous emergence of new applications, which generates Out-of-Distribution (OOD) traffic patterns that deviate from known categories and are not well represented by predefined models. Current approaches rely on predefined categories, which limits their effectiveness in handling unknown traffic types. Although some methods mitigate this limitation by simply classifying unknown traffic into a single "Other" category, they fail to make a fine-grained classification. In this paper, we propose a Two-stage Adaptive OOD classification Network (TAO-Net) that achieves accurate classification for both In-Distribution (ID) and OOD encrypted traffic. The method incorporates an innovative two-stage design: the first stage employs a hybrid OOD detection mechanism that integrates transformer-based inter-layer transformation smoothness and feature analysis to effectively distinguish between ID and OOD traffic, while the second stage leverages large language models with a novel semantic-enhanced prompt strategy to transform OOD traffic classification into a generation task, enabling flexible fine-grained classification without relying on predefined labels. Experiments on three datasets demonstrate that TAO-Net achieves 96.81-97.70% macro-precision and 96.77-97.68% macro-F1, outperforming previous methods that only reach 44.73-86.30% macro-precision, particularly in identifying emerging network applications.
