English | 简体中文
IntraSpanNet names what produced a flow from its first five packets: a security appliance, an endpoint security agent, or a piece of common software. It reports a product label, a type, a tier, and an open-set distance. Flows that do not match a known product are rejected as unknown.
Code and training guide: github.com/lupingQAQ/IntraSpanNet — docs/TRAINING.md
Install: pip install intraspannet runs on CPU; pip install "intraspannet[gpu]" adds the Triton kernel. Same weights either way.
s0 standard multi-task objective, lda logit adjustment by class prior, hn hard-negative weighting). Checkpoint files carry the same labels in lower case, for example stage3_a_s0.pth is arm A-S0.The model is intended for authorized monitoring on networks you own or administer. It is not a replacement for an IDS, EDR, or vulnerability scanner.
The product labels are:
windows_defender, clamav_freshclam_win, clamav_freshclam, velociraptor, velociraptor_win, osquery, wazuh_agent, wireguard, openvpn, stunnel, squid_proxy, ntopng, guacamole_mgmt, waf_modsecurity, suricata_update, web_http, ssh, ftp.
| Metric | Test (503 flows) | All validation (1006 flows) |
|---|---|---|
| Product accuracy | 0.8787 | 0.8817 |
| Tier accuracy | 0.9245 | 0.9334 |
| Macro-F1 (supported classes) | 0.7621 | 0.8240 |
| Gate AUROC | 0.9784 | 0.9820 (dev) |
Additional results:
The test split is a flow-level half of the validation set, not a session-level holdout. Each class has one held-out session. See docs/RESULTS.md for the full protocol.
stunnel has zero recall in the acceptance demo (0/30).pip install "intraspannet[gpu]" enables the Triton path.Traffic classification can reveal sensitive information about a network. Use the model only on networks you own or have written authorization to monitor. Do not upload captures to public demos. Follow local law and organizational policy.
The model outputs a probability and a distance, not a fact. Treat low-confidence and unknown results as prompts for human review.
The supervised and reinforcement-learning objectives are part of the pip package, so these weights are a starting point rather than a fixed artifact.
| Item | What it does |
|---|---|
SFTConfig |
Loss weights for the multi-task supervised stage |
compute_sft_loss |
Product, type, tier, malicious and contrastive terms |
RLConfig |
Reward weights for the REINFORCE stage |
compute_rl_loss |
Correct product, correct type, honest rejection |
Trainer |
One optimizer step per call |
load_backbone |
Warm start across a changed label set, resizing the product head |
from intraspannet.model import DualHeadClassifier
from intraspannet.train import SFTConfig, Trainer, load_backbone
model = DualHeadClassifier(num_software=18)
model, report = load_backbone("stage3_a_s0.pth", model)
trainer = Trainer(model)
stats = trainer.step_sft(batch, SFTConfig(lda=1.0), class_prior=prior)
Two runnable examples live in the repository: examples/train_sft.py and examples/train_rl.py, both driven by a JSONL manifest of captures and product labels. The guide covers the batch contract, prototype and threshold recalibration, and the checkpoint format the CLI reloads:
Stage 1, the contrastive pretraining on lab captures, is not included because it depends on a data layout that cannot be redistributed.
stage3_*.pth: six classifier arms.prototypes_*_k3.pth: prototype matrices.stage1_clean_*.pth: contrastive encoders.student_d1.pth: distilled student, experimental.config.json: ensemble configuration and reference metrics.labels.json: label table.SHA256SUMS: checksums.@software{luping2026intraspannet,
author = {luping},
title = {IntraSpanNet: Identifying security appliances, endpoint agents and common software from intranet flows},
year = {2026},
doi = {10.5281/zenodo.23643146},
url = {https://github.com/lupingQAQ/IntraSpanNet},
note = {Model: https://huggingface.co/luping123/IntraSpanNet}
}
stage3_a_lda.pth 11 MBstage3_b_lda.pth 11 MBstage3_a_hn.pth 11 MBstage3_a_s0.pth 11 MBstage3_b_hn.pth 11 MBstage3_b_s0.pth 11 MBstudent_d1.pth 11 MBstage1_clean_a.pth 9 MBstage1_clean_b.pth 9 MBprototypes_a_lda_k3.pth 57.4 kBprototypes_b_lda_k3.pth 57.4 kBprototypes_a_hn_k3.pth 57.4 kBprototypes_a_s0_k3.pth 57.4 kBprototypes_b_hn_k3.pth 57.4 kBprototypes_b_s0_k3.pth 57.4 kB