Learning Joint Embeddings of Function and Process Call Graphs for Malware Detection

Kartikeya Aneja, Nagender Aneja, Murat Kantarcioglu

TL;DR

Static code analysis and dynamic runtime monitoring provide complementary views of software behavior, yet machine learning detectors typically analyze them in silos. This paper introduces GeminiNet, a dual-branch graph neural network (GNN) that jointly learns from static Function Call Graphs (FCGs) and dynamic Process Call Graphs (PCGs) using a learnable gating mechanism. By fusing local structural features with global file entropy, the framework achieves an average F1 score of 0.85 (reaching up to 0.94), significantly outperforming single-modality baselines and naive graph-merging strategies.

What Problem Does This Paper Address?

Graph representations of software—such as Function Call Graphs (FCGs) and Process Call Graphs (PCGs)—allow machine learning models to analyze program structure and behavior. However, prior work tends to rely on only a single graph view:

  • Static FCGs capture intra-binary control flow and call relationships, but can be obscured by packing, obfuscation, or dynamic invocation.
  • Dynamic PCGs reveal runtime process creation and inter-process communication in a sandbox, but can miss malicious paths that remain dormant during sandboxed execution.

Relying strictly on one modality leaves malware detectors vulnerable to evasion. Naively combining them into a single graph is also problematic because static functions and dynamic processes inhabit fundamentally different conceptual and structural planes. The authors address how to effectively construct, feature-engineer, and fuse both static and dynamic graph views into a joint embedding.

Methods

The authors introduce GeminiNet, which processes paired graph representations through parallel encoders:

  • Dual-Branch GNN Architecture: One branch ingests the static FCG while the other ingests the dynamic PCG. The model evaluates several backbone architectures, including Graph Convolutional Networks (GCN), Simplifying Graph Convolutional Networks (SGC), Graph Isomorphism Networks (GIN), and GraphSAGE.
  • Adaptive Gating Mechanism: Instead of simple concatenation or static averaging, GeminiNet fuses the graph-level representations ($g_1, g_2$) using a learnable gating parameter $w$: $$\alpha = \text{softmax}(w), \quad g = \alpha_1 g_1 + \alpha_2 g_2$$ This allows the model to dynamically balance the static versus dynamic contributions per dataset/task before passing the pooled vector $g$ to downstream classification layers.

  • Enriched Node Features: Each node in both graphs is initialized with a 6-dimensional feature vector combining:

  • Local Degree Profile (LDP) (5 features): The node's own degree plus the minimum, maximum, mean, and standard deviation of its neighbors' degrees.
  • Global Shannon Entropy (1 feature): Computed byte-level entropy of the raw executable file, replicated across all nodes to capture overall file randomness (e.g., encryption/packing).
   Static FCG  ───► [ GCN / SGC Branch 1 ] ───► g₁ ──┐
                                                      ├──► [ α₁g₁ + α₂g₂ ] ──► [ MLP Classifier ]
   Dynamic PCG ───► [ GCN / SGC Branch 2 ] ───► g₂ ──┘

Datasets

The authors constructed a new dataset of 635 Windows Portable Executable (PE) files (318 malicious and 317 benign):

  • FCG Extraction: Generated via static decompilation using the NSA's Ghidra framework. Across all samples, FCGs totaled 449,960 nodes and 1,048,741 edges.
  • PCG Extraction: Captured by running executables in the Any.Run interactive sandbox for 60 seconds each. PCGs accounted for 3,053 nodes and 2,663 edges across the corpus.
  • Each binary is paired with both representations, enabling direct comparisons between static-only, dynamic-only, graph-merged, and dual-branch configurations.

Key Insights and Ideas

  • Separation of representations beats monolithic merging: Merging FCG and PCG edge lists directly into a single disconnected graph performed poorly (median F1 ~0.72). Processing them through separate convolutional stacks before embedding fusion achieved substantially better results (median F1 ~0.87, $p = 2.15 \times 10^{-34}$). Dynamic and static graph topologies have completely different edge densities and semantic meanings, making shared convolution detrimental.
  • Dynamic processes carry more individual signal than static calls: When evaluated in isolation, single-graph PCG models consistently outperformed single-graph FCG models (PCG median F1 ~0.82 vs. FCG median F1 ~0.67), despite PCGs having orders of magnitude fewer nodes and edges.
  • Local topology + global randomness is synergistic: Adding raw byte-level Shannon entropy to topological LDP node features produced statistically significant performance jumps over either feature type alone ($p \approx 2.57 \times 10^{-33}$).

Key Results

Evaluated over 5-fold cross-validation:

  • Top Configurations: Both SGC and GCN with the dual-branch weighted sum (wsum) and LDP+Entropy features achieved a mean F1 of 0.85 (standard deviation 0.06–0.09) and a maximum peak F1 of 0.94.
  • Modality Comparisons (Median F1 from Top-100 runs):
  • Dual-branch weighted sum (both_wsum): $\approx \mathbf{0.87}$
  • Single PCG: $\approx 0.82$
  • Merged single graph: $\approx 0.72$
  • Single FCG: $\approx 0.67$
  • Statistical validation via Kruskal–Wallis tests and post-hoc Dunn tests with Bonferroni correction confirmed that the dual-branch gated fusion significantly outperforms all individual and merged modalities ($p = 3.86 \times 10^{-76}$).

Limitations and Future Work

  • Dataset Scale: The experimental evaluation is conducted on a relatively small corpus of 635 executables, largely due to the overhead of dynamic sandbox execution.
  • Sandbox Evasion & Timeouts: Dynamic traces were captured for 60 seconds; samples employing long sleep delays or sandbox-detection evasion techniques may yield incomplete PCGs.
  • Interpretability: The paper focuses on detection performance; the authors note that incorporating GNN explainability techniques to determine which specific functions and processes trigger malicious classifications remains an open direction for future work.

Summary updated

BibTeX
@inproceedings{aneja2025learning,
  author = {Kartikeya Aneja and Nagender Aneja and Murat Kantarcioglu},
  title = {{Learning Joint Embeddings of Function and Process Call Graphs for Malware Detection}},
  booktitle = {NPGML @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=eGRSHMDRPi},
}
Figure