Unknown-Traffic Detection, Calibration and Shortcut Reliance in Distilled Encrypted-Traffic Classifiers over One Year
Organizations: University of Salamanca, Salamanca, Spain · AIR Institute, Salamanca, Spain
Abstract
Knowledge distillation is the standard way to compress encrypted-traffic classifiers for the edge, and almost all such work judges students by accuracy alone. We ask what else a student inherits: unknown-traffic detection, calibration, shortcut reliance, and whether any survives a year of drift. Resemblance proves little on its own, since soft targets also regularise. We therefore distil one 101k-parameter student from two teachers of equal accuracy but different construction, a five-member ensemble and a single wider model, so that following one rather than the other is attributable to it. The design was pre-registered before any test result was seen. We tested ten hypotheses on CESNET-TLS-Year22, a year of real TLS traffic, across 18 test windows over 35 weeks. Two are supported: a student's per-flow unknown-scores shift toward its own teacher, but only at a conventional temperature, not the accuracy-optimal one; and a shortcut-reliant teacher passes its over-confidence to a student that never sees the feature. The drift prediction is reversed under both scores, the gap narrowing rather than widening and the student overtaking under the energy score in two of three replicates, as is the prediction that such a teacher harms its student's detection, which improves slightly. Shortcut reliance is set by model size, not distillation. Under the logit-based scores nothing else transfers: distillation beats neither a temperature-scaled direct student nor label smoothing. Exploratory analysis shows this turns on the scoring rule: with a feature-space detector the teacher detects unknown traffic 0.073 AUROC better than the direct student, where the energy score sees 0.000, and the conventional-temperature student inherits most of it. Label smoothing, with no teacher, recovers more. Distillation transfers the teacher's habits; what looks like an inherited ability is available without one.
Figures & tables
| Condition | Teacher | Objective |
| direct | — | cross-entropy |
| directTS | — | direct , then post-hoc temperature scaling |
| ls | — | label smoothing, |
| kdA | A | Hinton KD, (accuracy-tuned) |
| kdB | B | Hinton KD, |
| kdA4 | A | Hinton KD, (conventional) |
| Model | Params | Macro-F1 | AUROC | AUROC | FPR@95 | OSCR | NLL | AURC |
|---|---|---|---|---|---|---|---|---|
| Teacher A (5 mm_cesnet_v2) | 11.3M | 0.860 | 0.836 | 0.868 | 0.626 | 0.789 | 0.447 | 0.012 |
| Teacher B (wide) | 10.3M | 0.855 | 0.840 | 0.851 | 0.614 | 0.791 | 0.480 | 0.014 |
| direct | 101k | 0.806 | 0.835 | 0.844 | 0.674 | 0.768 | 0.609 | 0.020 |
| directTS | 101k | 0.806 | 0.835 | 0.845 | 0.676 | 0.767 | — | 0.020 |
| ls ( ) | 101k | 0.797 | 0.814 | 0.836 | 0.683 | 0.747 | 0.561 | 0.023 |
| kdA ( ) | 101k | 0.806 | 0.834 | 0.843 | 0.667 | 0.767 | 0.601 | 0.020 |
| # | Hypothesis | Estimate (95% CI) | Holm | Outcome |
|---|---|---|---|---|
| H1 | inheritance is teacher-specific | kdA4 (0.005, 0.009); kdB4 (0.024, 0.028) | 0.009 | supported |
| H2[energy] | KD beats ls , directTS at matched accuracy | AUROC vs ls , vs directTS ; NLL vs ls , vs directTS | 1.0 | not supported |
| H2[MSP] | as H2, MSP | AUROC vs ls , vs directTS | 1.0 | not supported |
| H3[energy] | gap grows with time | per week ( , ) | 1.0 | reversed |
| H3[MSP] | as H3, MSP | per week ( , ) | 1.0 | reversed |
| H4a | KD student relies on a visible shortcut more | (lower bound ) | 1.0 | not supported |
| Model | Near unknowns | Far unknowns |
|---|---|---|
| Teacher A | 0.805 / 0.836 | 0.840 / 0.872 |
| Teacher B | 0.788 / 0.794 | 0.848 / 0.859 |
| direct , directTS , kdA | 0.846 / 0.824 | 0.833 / 0.847 |
| ls | 0.795 / 0.809 | 0.816 / 0.840 |
| kdA4 | 0.788 / 0.794 | 0.812 / 0.829 |
| enddA | 0.695 / 0.816 | 0.749 / 0.838 |
| Weeks | Teacher A | kdA | Gap | kdA macro-F1 |
|---|---|---|---|---|
| 3.5 | 0.869 | 0.854 | 0.902 | |
| 7.5 | 0.863 | 0.858 | 0.880 | |
| 11.5 | 0.841 | 0.846 | 0.848 | |
| 19.5 | 0.815 | 0.818 | 0.747 | |
| 27.5 | 0.803 | 0.806 | 0.724 | |
| 35.3 | 0.784 | 0.793 | 0.687 |
| Teacher (2.3M) | direct student | KD student ( ) | |
|---|---|---|---|
| 0 | 0.000 | 0.000 | 0.000 |
| 0.5 | 0.037 | 0.069 | 0.068 |
| 0.9 | 0.103 | 0.185 | 0.196 |
| 1.0 | 0.800 | 0.945 | 0.870 |
| Model | Parameters | Weights (MB) | Latency p50 (ms) | Latency p99 (ms) | Flows/s, 1 thread | Flows/s, all cores |
|---|---|---|---|---|---|---|
| Student, ONNX Runtime | 101k | 0.4 | 0.082 | 0.160 | 21,201 | — |
| Student, PyTorch | 101k | 0.4 | 0.501 | 1.026 | 10,604 | 39,418 |
| Teacher A, one member | 2.3M | 9.1 | 3.560 | 5.348 | 812 | 3,875 |
| Teacher A, 5-member ensemble | 11.3M | 45.4 | 19.093 | 27.357 | 161 | 789 |
| Teacher B | 10.3M | 41.3 | 12.262 | 17.213 | 218 | 1,153 |
| XGBoost (flow statistics) | — | 244.4 | 41.606 | 53.011 | 1,369 | 11,078 |
| Comparison | Energy | MSP | Mahalanobis | Feature -NN |
|---|---|---|---|---|
| direct_w16 | ( , ) | ( , ) | — | — |
| direct_w96 | ( , ) | ( , ) | — | — |
| directTS_w16 | ( , ) | ( , ) | — | — |
| directTS_w96 | ( , ) | ( , ) | — | — |
| kdA4_w16 | ( , ) | ( , ) | — | — |
| kdA4_w96 | ( , ) | ( , ) | — | — |
| Comparison | Units | Shift (95% CI) |
|---|---|---|
| H1 replication | ||
| kdA4 : A vs B | 18 | ( , ) |
| kdB4 : B vs A | 18 | ( , ) |
| single vs single | ||
| kdM0 : member 0 vs B | 18 | ( , ) |
| identity only | ||
| Model | Energy | MSP |
|---|---|---|
| Teacher A (ensemble) | ||
| member mean | ||
| teacherA_0 | ||
| teacherA_1 | ||
| teacherA_2 | ||
| teacherA_3 |
| Start | Windows | First week | Last week | Shared unit-weeks |
| 11 | 9 | 16 | 51 | 23 |
| 24 | 6 | 29 | 51 | 23 |
| 37 | 3 | 42 | 51 | 9 |
| Mahmoud Abbasi received the M.Sc. degree in computer software engineering from Islamic Azad University, Mashhad, Iran, in 2017, and the Ph.D. degree in computer engineering from the University of Salamanca, Salamanca, Spain, in 2026, where the doctoral work was supported by a Marie Skłodowska-Curie Fellowship within the EU Horizon 2020 IoTalentum network (grant no. 953442). Since 2026, Dr. Abbasi has been a Researcher with the AIR Institute, Salamanca, Spain. Research interests include machine learning for network traffic monitoring and analysis, intent-based networking, and secure, scalable Internet-of-Things systems. Dr. Abbasi has been a Member of IEEE since 2019. |