计算机工程与应用 ›› 2025, Vol. 61 ›› Issue (18): 273-289.DOI: 10.3778/j.issn.1002-8331.2406-0023

• 网络、通信与安全 • 上一篇    下一篇

基于EfficientViT的加密流量实时分类方法

姚利峰,蔡满春,朱懿,陈咏豪,张溢文   

  1. 中国人民公安大学 信息网络安全学院,北京 100038
  • 出版日期:2025-09-15 发布日期:2025-09-15

Real-Time Classification of Encrypted Traffic Based on EfficientViT

YAO Lifeng, CAI Manchun, ZHU Yi, CHEN Yonghao, ZHANG Yiwen   

  1. College of Information and Cyber Security, People??s Public Security University of China, Beijing 100038, China
  • Online:2025-09-15 Published:2025-09-15

摘要: 随着网络技术的快速发展,实时高效地分类加密流量已成为网络管理和安全监测的关键需求。现有自监督预训练方法面临模型规模庞大、计算复杂度高、推理速度慢以及对大量训练数据的依赖等限制,难以满足边缘设备对实时性和高效性的要求。针对这一问题,提出了一种基于轻量化视觉Transformer的加密流量实时分类新方法——AgileViT。通过采用EfficientViT框架,优化模型架构和计算流程,显著降低了模型的规模和内存需求;通过设计级联分组代理注意力机制,有效减少了模型的计算复杂度,大幅提高了模型的推理效率,同时保持了高表达能力;提出并行轻量化残差块,应用归纳偏置,增强了对加密流量局部特征的学习能力,提高了模型在有限训练数据情况下的适应性和分类准确性。实验结果表明,所提的AgileViT方法在商业级数据集AppClassNet上,以仅1.179×107可训练参数的条件下,实现了85.38%的分类准确率和每样本149.45?μs的推理速度,与现有的先进轻量化方法相比,在推理效率和分类性能上均显示出显著优势,有效解决了边缘设备上加密流量实时分类的核心挑战。

关键词: 加密流量分类, EfficientViT, 自注意力机制, 轻量化网络, 实时性能优化

Abstract: With the rapid advancement of network technology, efficient real-time classification of encrypted traffic is crucial for network management and security monitoring. Current self-supervised pre-training methods, limited by large model sizes, high computational complexity, and slow inference speeds, fail to meet the demands of edge devices. This study introduces AgileViT, a novel encrypted traffic classification method using a lightweight visual Transformer, EfficientViT. This method significantly reduces model size and optimizes computational processes. It features a cascading grouped agent attention mechanism that lessens computational complexity and enhances inference efficiency. Additionally, the integration of parallel lightweight residual blocks with inductive bias improves the learning of local traffic features, boosting adaptability and accuracy with limited training data. Experiments on the AppClassNet dataset show that AgileViT achieves 85.38% accuracy and an inference speed of 149.45 microseconds per sample, outperforming existing lightweight models in efficiency and performance, effectively addressing the challenges of real-time encrypted traffic classification on edge devices.

Key words: encrypted traffic classification, EfficientViT, self-attention mechanism, lightweight network, real-time performance optimization