Leveraging Uncertainty for Improved Static Malware Detection Under Extreme False Positive Constraints

André T. Nguyen, Edward Raff, Charles Nicholas, James HoltarXiv 2021

Introduction

In enterprise cybersecurity, a False Positive (FP)—labeling a benign file as malicious—is more than a nuisance; it is an operational bottleneck. High FP rates overwhelm security analysts and can halt critical business workflows. Consequently, production-grade malware detectors must operate under "extreme" False Positive Rate (FPR) constraints, typically 0.1% or lower, and sometimes as stringent as 0.001% ($10^{-5}$).

Standard machine learning research often focuses on overall accuracy or Area Under the Curve (AUC). However, these metrics fail to capture model behavior at the extreme edges of the ROC curve. This paper investigates how Bayesian uncertainty and ensembling can be leveraged to meet these requirements while exposing a critical flaw in current evaluation methodologies.

The "Validation Gap" in Malware Detection

A significant contribution of this work is identifying a widespread evaluation error dubbed the "Validation Gap." Most research selects detection thresholds using the test set, which assumes access to future labels—a luxury not available in real-world deployments. The authors demonstrate that this practice leads to a significant overestimation of performance.

Relative error in True Positive Rate (TPR) when using test-set thresholds versus validation-set thresholds. The error can exceed 30% at low FPRs.

As shown in the figure above, the relative error in TPR can reach up to 35% when thresholds are improperly tuned. Using a separate validation set to pick thresholds is the only way to obtain a realistic estimate of production performance.

Methodology: Ensembling and Bayesian Inference

The researchers explored two primary avenues for improvement:

  1. Ensembling: Combining multiple models such as LightGBM and Feed-Forward Neural Networks (FFNN). Interestingly, even "low-diversity" ensembles—identical architectures trained with different random seeds—yielded substantial gains at low FPRs.
  2. Bayesian Uncertainty: Utilizing Monte Carlo Dropout to sample from a model's posterior distribution. This allows for the calculation of epistemic uncertainty (what the model doesn't know) and aleatoric uncertainty (inherent noise in the data).

These metrics are used in a novel "Uncertainty-Aware Thresholding" scheme. Instead of a single global threshold, the model adjusts its sensitivity locally based on its confidence in a specific file, optimized via Brent’s method on a validation set to maximize TPR while strictly honoring FPR constraints.

Key Results and Performance Gains

The proposed methods were tested on industry-scale datasets, including EMBER2018 and Sophos AI SOREL-20M. The results indicate that ensembling is particularly effective in the low-FPR regime required for deployment.

ROC curves comparing single models (dashed) to ensembles (solid). Ensembles consistently provide higher True Positive Rates at extreme low False Positive Rates.

On the Sophos dataset, the TPR at an FPR of $10^{-5}$ improved from 0.69 to 0.80 using the best ensemble configuration. Furthermore, the uncertainty-aware thresholding consistently satisfied strict FPR constraints across various targets (1% down to 0.001%) while outperforming naive global thresholding.

Uncertainty as a Functional Tool

Beyond performance metrics, uncertainty serves as a "red flag" for security analysts. The study found that high epistemic uncertainty scores are strongly correlated with model errors and novel malware families (out-of-distribution samples). This allows the system to flag emerging threats that the model has not encountered during training, providing a valuable signal for human-in-the-loop review and prioritization.

Conclusion and Future Directions

While ensembling and Bayesian methods provide clear performance benefits, they introduce computational overhead. Future work will focus on more efficient techniques like BatchEnsemble to reduce latency in high-throughput environments. Additionally, the authors aim to integrate these uncertainty "flags" into real-world Security Operations Center (SOC) workflows to assist analysts in interpreting model decisions.

Summary updated

BibTeX
@misc{nguyen2021leveraging,
  author = {André T. Nguyen and Edward Raff and Charles Nicholas and James Holt},
  title = {{Leveraging Uncertainty for Improved Static Malware Detection Under Extreme False Positive Constraints}},
  year = {2021},
  eprint = {2108.04081},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.04081},
}
Figure