Netinfo Security ›› 2025, Vol. 25 ›› Issue (6): 859-871.doi: 10.3969/j.issn.1671-1122.2025.06.002

Previous Articles     Next Articles

Lightweight Malicious Traffic Detection Method Based on Knowledge Distillation

SUN Jianwen1(), ZHANG Bin1, SI Nianwen2, FAN Ying3   

  1. 1. Department of Cryptogram Engineering, Information Engineering University, Zhengzhou 450001, China
    2. Information System Engineering Institute, Information Engineering University, Zhengzhou 450001, China
    3. College of Equipment Management and Support, Engineering University of PAP, Xi’an 710038, China
  • Received:2025-02-20 Online:2025-06-10 Published:2025-07-11

Abstract:

To address the model lightweight requirements for multi-class malicious traffic detection in resource-constrained scenarios, this paper proposed a lightweight malicious traffic detection method based on knowledge distillation. The methodology transferred knowledge from a 12-layer transformer teacher model to a 1-layer transformer student model through a dual supervision mechanism that combined Kullback-Leibler divergence distillation loss with Focal supervisory loss. This approach achieved model compression from 286 MB to 26 MB with approximately 10 times faster inference speed, while limiting the decline in classification precision to less than 1.4 percentage points. Experimental results on three public datasets including USTC-TFC2016, ISCX-VPN2016-Service and CSE-CIC-IDS2018 demonstrate that the compressed model attains over 99.38% recognition accuracy for long-tailed category traffic and stealthy attack patterns, significantly outperforming traditional CNN/RNN- architecture-based lightweight methods. The framework establishes balance between resource efficiency and detection performance compared to existing solutions.

Key words: knowledge distillation, model depth compression, transformer layers, malicious traffic detection, multi classification

CLC Number: