Multitask Learning for Network Traffic Classification

Shahbaz Rezaei, Xin Liu

TL;DR

Training deep learning models for network traffic classification usually requires massive amounts of hand-labeled data, which is expensive and slow to produce. This paper proposes a multitask learning (MTL) framework that uses "easy-to-get" labels—like a flow's bandwidth and duration—as auxiliary tasks to significantly boost classification accuracy even when human-labeled data is extremely scarce.

What Problem Does This Paper Address?

Network traffic classification is the backbone of modern internet management, used for everything from Quality of Service (QoS) and billing to security firewalls. While deep learning models (like CNNs) have replaced traditional "hand-crafted" feature methods, they have a major weakness: they are data-hungry.

The "labeling bottleneck" is real. To get reliable ground truth for a specific application (e.g., "this is a YouTube stream"), researchers often have to capture traffic in a strictly controlled, isolated environment. This is labor-intensive and often produces models that struggle with the "noise" of real-world traffic. The authors aim to bridge this gap by finding a way to train high-performing models using only a tiny fraction of human-labeled samples.

Methods

The authors move away from standard single-task classification and instead adopt a Multitask Learning (MTL) approach.

The Architecture

The model uses a 1D-Convolutional Neural Network (CNN) as a shared backbone. This backbone extracts features from the first k packets of a flow (specifically looking at packet length, inter-arrival time, and direction).

The "magic" happens at the output. Instead of one output head, the model has three:

  1. Traffic Class: The "hard" task (e.g., identifying the app).
  2. Bandwidth Prediction: An "easy" auxiliary task.
  3. Duration Prediction: Another "easy" auxiliary task.

Why Bandwidth and Duration?

These are "self-labeled" features. You don't need a human to tell you how long a flow lasted or how much data it consumed; the computer can calculate this automatically for any captured flow. By training the model to predict these values simultaneously with the traffic class, the shared layers of the CNN learn more robust, fundamental representations of how network traffic behaves.

The Loss Function

The authors use a weighted loss function where a hyperparameter ($\lambda$) controls the importance of the classification task. They also use a "masking" technique during training, allowing the model to learn from flows that have bandwidth/duration labels but lack a human-assigned traffic class.

Datasets

The study evaluated the framework on two public datasets:

  • QUIC Dataset: Focuses on Google services (Google Doc, Drive, Music, YouTube, and Search) using the QUIC protocol.
  • ISCX VPN-nonVPN Dataset: A well-known benchmark containing various traffic types like chat, email, file transfer, streaming, and VoIP, both over standard connections and VPNs.

Key Insights and Ideas

  • Auxiliary Tasks as Regularizers: Predicting bandwidth and duration acts as a powerful regularizer. It prevents the model from over-fitting on the small number of human-labeled samples by forcing it to understand the broader statistical structure of the traffic.
  • Overcoming "Catastrophic Forgetting": The authors found that MTL outperforms standard Transfer Learning (where a model is pre-trained on one task and then fine-tuned on another). In transfer learning, the model often "forgets" the general features of the first task; in MTL, the simultaneous training keeps those features fresh.
  • The Power of "Free" Data: The most significant "aha moment" is that you can achieve near state-of-the-art results with just 100 labeled samples if you leverage the thousands of "unlabeled" flows you likely already have.

Key Results

  • Massive Gains with Tiny Data: On the QUIC dataset, with only 10 labeled samples, the MTL approach achieved 93.33% accuracy. In contrast, a standard CNN+RNN model only managed 64.67% with the same amount of data.
  • Efficiency: With 100 labeled samples, the MTL model performed almost as well as a model trained on the entire labeled dataset (reaching ~97% accuracy).
  • Early Detection: The model remains highly accurate even when looking at only the first 60 packets of a flow, making it suitable for real-time, online applications.

Limitations and Future Work

  • Hyperparameter Sensitivity: The weight $\lambda$ is crucial. If it's set too high, the model overfits the small labeled set; if it's too low, the classification task is ignored. Finding the "sweet spot" currently requires manual tuning.
  • Task Selection: While bandwidth and duration worked well, the authors suggest that other statistical features (like burstiness or average inter-arrival time) might be even better auxiliary tasks.
  • Real-world Drift: While the model is more robust, the paper doesn't extensively explore how these models handle "concept drift" as applications update their protocols over time.

Summary updated

BibTeX
@inproceedings{rezaei2020multitask,
  author = {Shahbaz Rezaei and Xin Liu},
  title = {{Multitask Learning for Network Traffic Classification}},
  booktitle = {ICCCN},
  year = {2020},
  url = {https://openreview.net/forum?id=8dNYSl_FSQ4},
}

Loading related content...

Figure