Views
No views yet
pytorch_model.bin + config.jsonT5ForConditionalGeneration.| Task | Config / subfolder | #Cls | Acc | Macro-F1 | Decode |
|---|---|---|---|---|---|
| 1 | vpn_detection | 2 | 0.9942 | 0.9870 | text |
| 2 | vpn_service_classification | 6 | 0.8979 | 0.8893 | text |
| 3 | vpn_application_classification | 16 | 0.8406 | 0.8137 | text |
| 4 | tor_service_detection | 7 | 0.9692 | 0.8120 | text |
| 5 | ustc-tfc2016_app_detection | 16 | 0.9538 | 0.9676 | text |
| 6 | crossplatform_android_app_classification | 209 | 0.9660 | 0.8847 | digit |
| 7 | crossplatform_android_app_country_detection | 3 | 0.9960 | 0.9898 | text |
| 8 | crossplatform_ios_app_classification | 196 | 0.9752 | 0.9492 | digit |
| 9 | crossplatform_ios_app_country_detection | 3 | 0.9951 | 0.9951 | text |
| 10 | dohbrw_query_generator_detection | 5 | 0.9963 | 0.9610 | text |
| 11 | iot_malicious_detection | 2 | 0.9877 | 0.9870 | text |
| 12 | iot_method_detection | 7 | 0.9878 | 0.6802 | text |
finetune_classification.py. text tasks generate the
class-name string (label_format: label_string, config cls); digit tasks (≥100 classes) generate the
numeric class index (label_format: digit, config cls_digit), as described in the paper. Every checkpoint
was verified to reproduce its row via the test commands below.1from huggingface_hub import hf_hub_download
2ckpt = hf_hub_download("Charles59/lens-finetuned", "vpn_detection/pytorch_model.bin")1python scripts/finetune_classification.py \
2 mode=finetune_test \
3 data.hf_repo=Charles59/lens-network-traffic data.hf_config=vpn_detection \
4 task_args.name=VPN_Detection \
5 model_args.pretrained_checkpoint=<ckpt>
6# -> accuracy: 0.9942, macro-f1: 0.9870crossplatform_android_app_classification, Task 8 crossplatform_ios_app_classification)
use the same script with --config-name=cls_digit:1python scripts/finetune_classification.py --config-name=cls_digit \
2 mode=finetune_test \
3 data.hf_repo=Charles59/lens-network-traffic data.hf_config=crossplatform_android_app_classification \
4 task_args.name=CrossPlatform_Android_APP_Classification \
5 model_args.pretrained_checkpoint=<ckpt>data.hf_config = the subfolder name; task_args.name = the original task name (see the table; e.g.
vpn_detection ↔ VPN_Detection).iot_method_detection) was re-finetuned (30 epochs) to recover a lost checkpoint; it
reproduces the paper (Acc 0.9897 / Macro-F1 0.6813 vs. paper 0.9878 / 0.6802).1@article{li2026lens,
2 title = {Lens: A Knowledge-Guided Foundation Model for Network Traffic},
3 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},
4 journal = {Transactions on Machine Learning Research},
5 issn = {2835-8856},
6 year = {2026},
7 url = {https://openreview.net/forum?id=cGDwTgnJIR},
8 note = {arXiv:2402.03646}
9}