PMDC: A Prior Knowledge Constrained Multimodal Method for Encrypted Malicious Traffic Detection Integrating DifficultyAwareness and Confusion Rectification
Abstract
Encrypted network traffic is increasingly exploited for covert malicious activities, complicating detection. Current approaches often rely on closed box models that make limited use of domain knowledge and struggle to distinguish similar malware families, leading to performance degradation under evolving traffic distributions. We propose PMDC, a dual-branch multimodal model for encrypted malicious traffic detection at the bidirectional-flow level. PMDC uses an improved MobileViT branch to capture spatial patterns from the spatialized payload representation with header-derived priors and flow-level statistical knowledge, while a Temporal Convolutional Network (TCN) branch captures fine-grained packet-level temporal patterns and long-range behavioral dependencies. A difficulty-aware global fusion mechanism selects a single pair of branch weights on the validation set by considering classification confidence, uncertainty, and historical stability, and applies the selected weights to all test samples. Additionally, a directed low-rank residual rectification module (CARM) helps separate easily confused malware families while largely preserving the decisions for other classes. Experiments on four benchmark datasets show that PMDC achieves consistently strong accuracy, F1-score, true positive rate (TPR), and false positive rate (FPR) compared with representative baselines, and shows non-catastrophic degradation under packet-loss perturbations. On a small self-built power-grid dataset collected from a single attack incident, PMDC correctly identifies all 64 malicious flows with a false positive rate of 0.73%, providing preliminary evidence of binary cross-scenario detection capability under this limited setting.