提出无需修改模型的统一框架,提升网络流量分类在真实环境下的鲁棒性。
UniAlign: A Model-Agnostic Framework for Robust Network Traffic Classification under Distribution Shifts

- 通过域对齐微调学习跨网络条件的不变特征表示
- 平均准确率提升2.51%,F1得分提升2.71%,优于最强基线
- 适用于主流原始字节模型,训练时间仅需基线12.4%~53.9%
网络流量分类(NTC)模型在真实部署中常因网络条件变化导致分布偏移而性能下降。现有增强鲁棒性的方法多依赖特定模型结构或数据设置,难以泛化到先进的原始字节类NTC模型,且训练开销大。本文提出UniAlign,一种新型无模型依赖框架,可提升深度学习型NTC模型在分布偏移下的鲁棒性。该框架结合域对齐微调(促进异构网络条件下流量表征的域不变性)与稳定模型集成(通过聚合平坦损失区域内的检查点提升推理鲁棒性)。该框架可无缝集成至现有监督式NTC模型,无需特定特征模态,且不引入随训练增长的额外成本。我们在三个涵盖加密方式、采集设备和攻击行为等多样分布偏移的公开数据集上评估,结果表明:相比标准训练,UniAlign在两种代表性模型上平均准确率提升2.51%,平均F1分数提升2.71%,优于最强基线1.45%(准确率)和1.69%(F1),同时训练时间仅为所有特定于NTC基线的12.4%~53.9%。
原文摘要 · Abstract (English)
Network traffic classification (NTC) models often suffer severe performance degradation when deployed in real-world environments due to distribution shifts caused by changing network conditions. Existing robustness-enhancing approaches are commonly coupled to specific model architectures or data settings, fail to generalize to state-of-the-art raw-byte-based NTC models, or incur significant training overhead. In this paper, we propose UniAlign, a novel model-agnostic framework that improves the robustness of deep learning-based NTC models under distribution shifts. UniAlign combines \emph{domain alignment fine-tuning}, which encourages the learning of domain-invariant traffic representations across heterogeneous network conditions, with \emph{stable model ensembling}, which enhances inference robustness by aggregating checkpoints within a flat loss region. The framework can be seamlessly integrated into existing supervised NTC models without requiring specific feature modalities or introducing non-constant additional training costs. We evaluate UniAlign on three public datasets covering diverse distribution shifts, including encryption schemes, data collection devices, and attack behaviors. Experimental results on two representative NTC models demonstrate that, compared with standard training, UniAlign improves average classification accuracy by 2.51\% and average F1 score by 2.71\%, outperforming the strongest baseline by 1.45\% in accuracy and 1.69\% in F1 score, while requiring only 12.4\%--53.9\% of the training time of all NTC-specific baselines.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。