TL;DR
This paper introduces a Spatio-Temporal Parallel Convolutional Network (ST-PCN) that generates robust, generalizable foundational embeddings of malware behavior directly from network flow telemetry. By shifting away from traditional task-specific models, these embeddings achieve state-of-the-art performance across multiple downstream tasks, including malware strain classification, zero-day threat detection, and closest attack-type attribution.
What Problem Does This Paper Address?
The current state-of-the-art in machine learning-based malware detection relies heavily on task-specific objectives. While effective for their narrow, intended use cases, these models fail to generalize to other downstream tasks involving the same malware classes. Furthermore, many existing approaches rely on static analysis or localized device data-flow graphs, missing the broader, dynamic picture of how malware interacts across a network.
To build a more agile defense, security operations need a "foundational model" approach—universal embeddings that capture the nuanced, spatio-temporal behavior of malware communication (such as interacting with command-and-control servers) without requiring fragile feature normalization across disparate network environments.
Methods
The authors propose a novel pipeline that transforms raw network flow data into structured behavioral embeddings:
-
Graph Construction & Novel Edge Weighting: They construct a directed network-connection graph where nodes represent distinct IP addresses and edges represent aggregated network flows. Edges are weighted using a novel formula designed to capture data transfer dynamics relative to time: $$\text{weight}(edge) = \frac{\text{sourceBytes} - \text{destinationBytes}}{\alpha^{\text{duration}}}$$ where $\alpha$ is a tunable hyperparameter.
-
Normalization-Free Node Embeddings: They utilize Very Sparse Random Projections (FastRP) to generate node embeddings. This eliminates the need for raw feature normalization, which is historically unreliable when comparing vastly different originating networks.
- Spatio-Temporal Example Creation: Network flows are ordered chronologically. For a given window of flows, the authors construct a spatial adjacency matrix ($A$) and a temporal feature matrix ($F$) containing the FastRP node embeddings.
- ST-PCN Architecture: A parallel convolutional network processes $A$ and $F$ independently through separate convolutional layers to extract spatial and temporal features, which are then concatenated into a final 32-dimensional embedding vector.
The model is trained using a metric learning objective—specifically, a softmax-based additive angular margin loss (ArcFace)—to maximize the distance between different malware strains in the latent space while minimizing the distance between similar behaviors.
Datasets
The methodology was benchmarked on two distinct datasets:
- Gigas: A proprietary dataset consisting of network data collected over five years, capturing more than 100 real malware detonations in an internal cyber-range. A balanced subset of 20 diverse malware classes (10,000 examples per class) was used.
- Malnet: A public dataset compiled from packet captures on
malware-traffic-analysis.netacross 16 malware types. This dataset features severe class imbalance (ranging from 110 to 42,000 examples per class; median of 2,570), serving as a robust benchmark for real-world, imbalanced scenarios.
Key Insights and Ideas
- The Power of the Latent Space Organization: A key "aha moment" is that the embedding space naturally organizes itself by semantic behavior. When a completely novel "holdout" malware strain (a zero-day) is projected into the latent space, it clusters near known malware families that share its functional behavior (e.g., Remote Access Trojans cluster near other RATs).
- Bypassing Feature Normalization: By using FastRP graph embeddings on a per-asset basis over discrete time windows, the model successfully compares malware behavior across entirely different network topologies without the distortion introduced by standard normalization techniques.
Key Results
The pre-trained ST-PCN embeddings demonstrated exceptional performance across three primary downstream tasks without any fine-tuning:
- Cluster Quality: UMAP visualizations and quantitative metrics showed clean separation of malware strains. The model achieved a Silhouette score of 0.69 on Gigas and 0.66 on Malnet, alongside high Rand indices (0.97 and 0.96, respectively).
- Malware Classification: Using a simple Random Forest classifier on top of the embeddings yielded a Macro Average AUC of 0.99 for both datasets. Even when evaluating a completely unseen holdout class, the model maintained high generalizability (Macro Avg AUC of 0.95 on Gigas, 0.93 on Malnet).
- Zero-Day Threat Detection & Attribution: Across 5 different holdout strains per dataset, the model achieved an average zero-day detection AUC of 0.89 and a precision of 0.94. Furthermore, its Closest Attack Type Attribution (CATA) successfully mapped the unseen Nanocore holdout to Meterpreter with 91% confidence, correctly identifying it as a functionally similar Remote Access Trojan (RAT).
Limitations and Future Work
The primary limitation acknowledged by the authors is the diversity of the training data. While 36 total malware classes across two datasets were evaluated, the real-world threat landscape contains thousands of evolving strains.
For future work, the authors plan to scale the framework by incorporating multi-modal data—such as endpoint logs and malware severity scores—to enrich the context beyond network flow patterns alone. They also plan to explore more complex, task-specific downstream architectures to further exploit the well-organized latent space.
Summary updated