--- license: cc-by-nc-4.0 task_categories: - text-classification tags: - network-traffic - traffic-classification - network-security - encrypted-traffic - intrusion-detection - iot-security pretty_name: Lens Network Traffic Classification Benchmark size_categories: - 100K ℹ️ All tasks are *derived* from publicly available academic traffic datasets > obtained via the **[NetBench](https://arxiv.org/abs/2403.10319)** benchmark (Qian et al., 2024); the original terms and citations of > those datasets also apply (see [Source datasets](#source-datasets)). ## Dataset summary - **Source benchmark:** all six underlying datasets are taken from **[NetBench](https://arxiv.org/abs/2403.10319)** (Qian et al., 2024). - **Modality:** textual renderings of packet/flow sequences (Wireshark/`tshark`-style lines). Following the paper, each flow is represented by its first packets and classified at flow level. - **Schema (all configs):** - `anonymized_text` — `string`, the (anonymized) packet/flow text used as model input. - `label` — `ClassLabel`, the class. The stored value is the integer class index; class **names** are carried in the feature metadata (`features['label'].names`). One column therefore serves both *text-label* decoding (few classes) and *numeric/digit-label* decoding (many classes, e.g. the 196/209-class app-classification tasks — see the paper's note on mapping textual labels to numeric indices to keep the context compact). - **Total examples:** ~242,665 across all 12 configs. - **Pretraining data is _not_ released here** — only the downstream fine-tuning/evaluation data. (The paper's pretraining split is sampled without any downstream labels to avoid label leakage.) ## Tasks / configurations Task numbers match the Lens paper (Tasks 1–12). | Config (`name`) | #Classes | Train | Val | Test | Source | Paper task | |---|---:|---:|---:|---:|---|---| | `vpn_detection` | 2 | 4,155 | 1,385 | 1,385 | ISCX-VPN | Task 1 | | `vpn_service_classification` | 6 | 13,855 | 1,728 | 1,733 | ISCX-VPN | Task 2 | | `vpn_application_classification` | 16 | 13,859 | 1,725 | 1,732 | ISCX-VPN | Task 3 | | `tor_service_detection` | 7 | 9,033 | 3,761 | 3,763 | ISCX-Tor | Task 4 | | `ustc-tfc2016_app_detection` | 16 | 11,055 | 10,362 | 10,366 | USTC-TFC-2016 | Task 5 | | `crossplatform_android_app_classification` | 209 | 6,798 | 4,196 | 4,296 | Cross Platform (Android) | Task 6 | | `crossplatform_android_app_country_detection` | 3 | 6,854 | 4,283 | 4,285 | Cross Platform (Android) | Task 7 | | `crossplatform_ios_app_classification` | 196 | 6,495 | 2,361 | 2,456 | Cross Platform (iOS) | Task 8 | | `crossplatform_ios_app_country_detection` | 3 | 6,531 | 2,448 | 2,449 | Cross Platform (iOS) | Task 9 | | `dohbrw_query_generator_detection` | 5 | 10,909 | 8,183 | 8,183 | CIC-DoHBrw-2020 | Task 10 | | `iot_malicious_detection` | 2 | 9,780 | 8,150 | 16,301 | CIC-IoT-2023 | Task 11 | | `iot_method_detection` | 7 | 12,605 | 12,601 | 12,604 | CIC-IoT-2023 | Task 12 | ## How to load ```python from datasets import load_dataset # pick any config from the table above ds = load_dataset("Charles59/lens-network-traffic", "vpn_detection") print(ds) # DatasetDict({ train, validation, test }) with columns: anonymized_text, label ex = ds["train"][0] print(ex["anonymized_text"][:120]) print(ex["label"], "->", ds["train"].features["label"].int2str(ex["label"])) ``` List all available configs: ```python from datasets import get_dataset_config_names get_dataset_config_names("Charles59/lens-network-traffic") ``` ## Data fields | Field | Type | Description | |---|---|---| | `anonymized_text` | `string` | Anonymized textual rendering of a packet/flow sequence. Source/destination IP addresses in the flow header are replaced with the special tokens `` / ``. Hex payload bytes and protocol summaries are kept. | | `label` | `ClassLabel` | Class label. Integer index stored on disk; human-readable class names via `features['label'].names` / `.int2str(i)`. | ### Example (`vpn_detection`) ``` text : " LLMNR 64 Standard query 0xca9a AAAA wpad ca9a 0000 0001 0000 ..." label: 0 -> "nonvpn" ``` ## Data splits Splits follow the Lens experimental protocol. A `pretrain` portion present in some source files has been removed; only `train` / `validation` / `test` are published here. Per-config counts are in the [task table](#tasks--configurations). Class distributions are intentionally **imbalanced** to match real-world conditions (report macro-F1 in addition to accuracy). ## Anonymization & privacy - Flow-level source/destination IP addresses are replaced with `` / ``. - Anonymization is applied at the flow-header level. Some identifiers embedded **inside packet payloads** (e.g. IPs in DNS answers / HTTP content, occasional MAC addresses) may remain. The data is released **as-is**, consistent with the original public datasets it derives from (whose raw payloads are already publicly available). - No filesystem paths, capture filenames, or raw (non-anonymized) text columns are included. ## Source datasets All datasets are obtained through **[NetBench](https://arxiv.org/abs/2403.10319)** (Qian et al., 2024). Please cite the original sources and respect their individual terms of use: - **ISCX-VPN** (`vpn_*`) — Draper-Gil et al., *Characterization of Encrypted and VPN Traffic Using Time-Related Features*, ICISSP 2016. - **ISCX-Tor** (`tor_service_detection`) — Habibi Lashkari et al., *Characterization of Tor Traffic Using Time-Based Features*, ICISSP 2017. - **USTC-TFC-2016** (`ustc-tfc2016_app_detection`) — Wang et al., *Malware Traffic Classification Using Convolutional Neural Network for Representation Learning*, ICOIN 2017. - **Cross Platform (Android / iOS)** (`crossplatform_*`) — Van Ede et al., *FlowPrint: Semi-Supervised Mobile-App Fingerprinting on Encrypted Network Traffic*, NDSS 2020. - **CIC-DoHBrw-2020** (`dohbrw_query_generator_detection`) — MontazeriShatoori et al., *Detection of DoH Tunnels Using Time-Series Classification of Encrypted Traffic*, DASC/PiCom/CBDCom/CyberSciTech 2020. - **CIC-IoT-2023** (`iot_*`) — Neto et al., *CICIoT2023: A Real-Time Dataset and Benchmark for Large-Scale Attacks in IoT Environment*, 2023. ## License Released under **CC-BY-NC-4.0** (Creative Commons Attribution-NonCommercial 4.0). The benchmark also combines several research datasets, each governed by its own original terms (generally research / non-commercial use with attribution); those terms continue to apply to the respective subsets. ## Citation If you use this benchmark, please cite the Lens paper, the **[NetBench](https://arxiv.org/abs/2403.10319)** benchmark, and the relevant source datasets below. ```bibtex @article{li2026lens, title = {Lens: A Knowledge-Guided Foundation Model for Network Traffic}, author = {Li, Xiaochang and Qian, Chen and Wang, Qineng and Kong, Jiangtao and Wang, Yuchen and Yao, Ziyu and Ji, Bo and Cheng, Long and Zhou, Gang and Shao, Huajie}, journal = {Transactions on Machine Learning Research}, issn = {2835-8856}, year = {2026}, url = {https://openreview.net/forum?id=cGDwTgnJIR}, note = {arXiv:2402.03646} } @article{qian2024netbench, title = {NetBench: A Large-Scale and Comprehensive Network Traffic Benchmark Dataset for Foundation Models}, author = {Qian, Chen and Li, Xiaochang and Wang, Qineng and Zhou, Gang and Shao, Huajie}, journal = {arXiv preprint arXiv:2403.10319}, year = {2024}, url = {https://arxiv.org/abs/2403.10319} } @inproceedings{drapergil2016iscxvpn, title = {Characterization of Encrypted and VPN Traffic Using Time-Related Features}, author = {Draper-Gil, Gerard and Habibi Lashkari, Arash and Mamun, Mohammad Saiful Islam and Ghorbani, Ali A.}, booktitle = {Proceedings of the 2nd International Conference on Information Systems Security and Privacy (ICISSP)}, pages = {407--414}, year = {2016} } @inproceedings{lashkari2017iscxtor, title = {Characterization of Tor Traffic Using Time Based Features}, author = {Habibi Lashkari, Arash and Draper-Gil, Gerard and Mamun, Mohammad Saiful Islam and Ghorbani, Ali A.}, booktitle = {Proceedings of the 3rd International Conference on Information Systems Security and Privacy (ICISSP)}, pages = {253--262}, year = {2017} } @inproceedings{wang2017ustctfc, title = {Malware Traffic Classification Using Convolutional Neural Network for Representation Learning}, author = {Wang, Wei and Zhu, Ming and Zeng, Xuewen and Ye, Xiaozhou and Sheng, Yiqiang}, booktitle = {2017 International Conference on Information Networking (ICOIN)}, pages = {712--717}, year = {2017} } @inproceedings{vanede2020crossplatform, title = {FlowPrint: Semi-Supervised Mobile-App Fingerprinting on Encrypted Network Traffic}, author = {Van Ede, Thijs and Bortolameotti, Riccardo and Continella, Andrea and Ren, Jingjing and Dubois, Daniel J. and Lindorfer, Martina and Choffnes, David and van Steen, Maarten and Peter, Andreas}, booktitle = {Network and Distributed System Security Symposium (NDSS)}, year = {2020} } @inproceedings{montazerishatoori2020dohbrw, title = {Detection of DoH Tunnels Using Time-Series Classification of Encrypted Traffic}, author = {MontazeriShatoori, Mohammadreza and Davidson, Logan and Kaur, Gurdip and Habibi Lashkari, Arash}, booktitle = {2020 IEEE Intl Conf on Dependable, Autonomic and Secure Computing (DASC/PiCom/CBDCom/CyberSciTech)}, pages = {63--70}, year = {2020} } @article{neto2023ciciot, title = {CICIoT2023: A Real-Time Dataset and Benchmark for Large-Scale Attacks in IoT Environment}, author = {Neto, Euclides Carlos Pinto and Dadkhah, Sajjad and Ferreira, Raphael and Zohourian, Alireza and Lu, Rongxing and Ghorbani, Ali A.}, year = {2023} } ```