[Paper Review] Learning from Context: Exploiting and Interpreting File Path Information for Better Malware Detection
This paper proposes a multi-view deep learning model that enhances static malware detection by jointly analyzing portable executable (PE) file content and file path information, achieving a 32.3% reduction in false negative rate at 10⁻³ FPR and 33.1% at 10⁻⁴ FPR over a content-only baseline, using real-world customer endpoint data with minimal infrastructure changes.
Machine learning (ML) used for static portable executable (PE) malware detection typically employs per-file numerical feature vector representations as input with one or more target labels during training. However, there is much orthogonal information that can be gleaned from the extit{context} in which the file was seen. In this paper, we propose utilizing a static source of contextual information -- the path of the PE file -- as an auxiliary input to the classifier. While file paths are not malicious or benign in and of themselves, they do provide valuable context for a malicious/benign determination. Unlike dynamic contextual information, file paths are available with little overhead and can seamlessly be integrated into a multi-view static ML detector, yielding higher detection rates at very high throughput with minimal infrastructural changes. Here we propose a multi-view neural network, which takes feature vectors from PE file content as well as corresponding file paths as inputs and outputs a detection score. To ensure realistic evaluation, we use a dataset of approximately 10 million samples -- files and file paths from user endpoints of an actual security vendor network. We then conduct an interpretability analysis via LIME modeling to ensure that our classifier has learned a sensible representation and see which parts of the file path most contributed to change in the classifier's score. We find that our model learns useful aspects of the file path for classification, while also learning artifacts from customers testing the vendor's product, e.g., by downloading a directory of malware samples each named as their hash. We prune these artifacts from our test dataset and demonstrate reductions in false negative rate of 32.3% at a $10^{-3}$ false positive rate (FPR) and 33.1% at $10^{-4}$ FPR, over a similar topology single input PE file content only model.
Motivation & Objective
- Address the limitation of static malware detectors that rely solely on PE file content, ignoring contextual information like file paths.
- Investigate whether file paths—though not inherently malicious—can provide useful signals for distinguishing malware from benign software.
- Develop a multi-view deep learning model that fuses PE content features and file path representations to improve detection performance.
- Evaluate the model on a large-scale, real-world commercial dataset from actual customer endpoints to ensure practical relevance.
- Ensure model interpretability using LIME to validate that learned patterns reflect meaningful malicious heuristics rather than data artifacts.
Proposed method
- Collect a commercial-scale dataset of ~10 million PE files and their file paths from real user endpoints across a large security vendor network.
- Extract numerical feature vectors from PE file content using standard static analysis techniques, and embed file paths using a fixed-length convolutional neural network.
- Train a multi-view neural network that takes both PE content features and file path embeddings as inputs, combining them via late fusion before outputting a malware confidence score.
- Perform time-based split validation to simulate real-world deployment and avoid data leakage.
- Apply LIME (Local Interpretable Model-agnostic Explanations) to interpret model decisions and identify which path segments most influenced detection scores.
- Prune dataset artifacts—such as test samples named after their hash—identified via interpretability analysis to improve model generalization.
Experimental results
Research questions
- RQ1Can file path information serve as a meaningful auxiliary signal for improving static malware detection beyond file content alone?
- RQ2Does a multi-view deep learning model that fuses PE content and file path features outperform a content-only baseline in real-world deployment scenarios?
- RQ3What specific path patterns or structures does the model learn to associate with malicious or benign behavior?
- RQ4To what extent do model predictions depend on data artifacts (e.g., test sample naming) rather than genuine malicious heuristics?
- RQ5Can interpretability techniques like LIME help identify and remove spurious signals in the file path data to improve model robustness?
Key findings
- The multi-view PE+FP model achieved a 32.3% reduction in false negative rate at a 10⁻³ false positive rate compared to the content-only model.
- At a 10⁻⁴ false positive rate, the model reduced false negatives by 33.1%, demonstrating strong performance in low-FPR operational settings.
- LIME analysis revealed that the model learned to associate specific path patterns—such as obfuscation techniques or common malware dropper behaviors—with higher detection scores.
- The model also learned spurious artifacts, such as file paths with hash-named samples, which were later pruned to improve generalization.
- After removing artifact-laden samples, the model’s performance improved significantly, confirming that contextual data can introduce noise if not properly cleaned.
- The approach is deployable in existing static detection pipelines with minimal infrastructure changes, as file paths require no additional endpoint instrumentation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.