NetCoFi: A Budget-Aware Coarse-Fine Dual-Branch Model for Encrypted Traffic Classification

Networking and Internet Architecture

Summary

The gist is being written…

Authors

Zhengyi Ma, Qiming Yu, Chungang Lin, Wentao Cui, Zijia Song, Guozheng Yang

Abstract

Encrypted traffic classification is critical for network management and security, but practical deployment must balance classification accuracy and inference cost. Existing models typically process fixed flow windows with limited control over computation after training, which can limit the accuracy-efficiency trade-off under constrained resources. To address this problem, we present NetCoFi, a budget-aware classifier that allocates computation at coarse and fine granularities. Using byte representations and observable packet metadata, NetCoFi selects token neighborhoods for fine-grained encoding while compressing the full window into complementary coarse context. Multi-budget training enables the same model to operate at different routing budgets without retraining. Evaluation on six public datasets shows that NetCoFi achieves state-of-the-art classification performance when trained from scratch. Under low-budget settings, NetCoFi improves average Macro-F1 by 7.86 percentage points across three datasets, compared with a same-depth static baseline. In a DPDK-GPU traffic processing pipeline, it increases mean batch throughput from 26.42 to 43.42 Mb/s, a 1.64x improvement over NetMamba.