TESSERACT: Eliminating Experimental Bias in Malware Classification across Space and Time (Extended Version)

Zeliang Kan, Shae McFadden, Daniel Arp, Feargus Pendlebury, Roberto Jordaney, Johannes Kinder, Fabio Pierazzi, Lorenzo CavallaroarXiv 2024 · DOI · arXiv

Introduction

Malware classification research often reports near-perfect accuracy (99%+). However, these results are frequently a "mirage" caused by experimental bias. This paper introduces TESSERACT, an open-source framework that enforces strict temporal and spatial constraints to reveal how classifiers actually perform against evolving threats in the real world.

The Problem of Experimental Bias

In laboratory settings, machine learning (ML) models for malware detection appear invincible. In reality, their performance decays rapidly due to concept drift—the evolution of attacker techniques and operating system changes. The authors argue that most academic evaluations are inflated by two pervasive biases:

  1. Temporal Bias: Using data from the "future" to train models for the "past" (e.g., through random k-fold cross-validation), or using training/testing sets where malware and goodware come from different time periods. This creates "spurious correlations" that do not exist in the wild.
  2. Spatial Bias: Testing models on datasets with unrealistic ratios of malware to goodware (e.g., 50/50). In the real world, malware is usually a small minority (around 10% for Android), and inflating its presence artificially boosts precision scores.

The TESSERACT Framework

The authors propose a "Space-Time Aware" evaluation strategy built on three fundamental constraints:

  • C1 (Temporal Training Consistency): All training data must strictly precede testing data. No "peeking" into the future.
  • C2 (Temporal Window Consistency): Malware and goodware in any given testing slot must come from the same time window to avoid time-based artifacts.
  • C3 (Realistic Ratio): The testing set must reflect "in-the-wild" distributions (e.g., 10% malware for Android).
Figure 1: Data distribution across the evaluation period (2014–2018), illustrating the training/testing split and the realistic ratio of malware to goodware.

Beyond these constraints, they introduce AUT (Area Under Time), a new metric that calculates the area under a performance curve (like $F_1$-score) over time. It provides a single number representing a model's robustness to decay.

Experimental Setup

The study validates its findings across three distinct domains:

  • Android: An extensive dataset of 259,230 apps from AndroZoo, spanning five years (2014–2018).
  • Windows PE: The EMBER dataset, covering 2017–2018.
  • PDF Malware: The HIDOST dataset, covering a 14-week period in 2012.

Key Results: The 99% Myth

When biases are eliminated, the performance of established classifiers like DREBIN drops significantly. An $F_1$-score that looks like 0.90 in a biased setup can plummet to 0.50 over a four-year period in a realistic one.

Figure 6: Performance decay of DREBIN and DEEPDREBIN over a 48-month testing period. Even deep learning models suffer significant decay when evaluated under realistic space-time constraints.

Key insights include:

  • Deep Learning isn't a Silver Bullet: While deep learning (DEEPDREBIN) showed some initial resilience, it eventually suffered from performance decay similar to traditional SVM-based models. It is not inherently immune to concept drift.
  • Spurious Correlations are Dangerous: If temporal consistency is ignored, models might learn to distinguish between "old" and "new" API calls rather than actual malicious behavior.
  • Retraining is Mandatory: Periodic retraining and tuning are the only ways to maintain stable performance over time, though even this has diminishing returns as the "arms race" continues.

Conclusion and Future Work

TESSERACT demonstrates that current malware classification metrics are often over-optimistic. By enforcing temporal and spatial constraints, researchers can better understand model robustness. The authors suggest further research into Explainable AI (XAI) to understand why certain features cause models to decay faster than others, and expanding the framework to handle adversarial ML scenarios where attackers specifically target model weaknesses.

Summary updated

Abstract

Machine learning (ML) plays a pivotal role in detecting malicious software. Despite the high F1-scores reported in numerous studies reaching upwards of 0.99, the issue is not completely solved. Malware detectors often experience performance decay due to constantly evolving operating systems and attack methods, which can render previously learned knowledge insufficient for accurate decision-making on new inputs. This paper argues that commonly reported results are inflated due to two pervasive sources of experimental bias in the detection task: spatial bias caused by data distributions that are not representative of a real-world deployment; and temporal bias caused by incorrect time splits of data, leading to unrealistic configurations. To address these biases, we introduce a set of constraints for fair experiment design, and propose a new metric, AUT, for classifier robustness in real-world settings. We additionally propose an algorithm designed to tune training data to enhance classifier performance. Finally, we present TESSERACT, an open-source framework for realistic classifier comparison. Our evaluation encompasses both traditional ML and deep learning methods, examining published works on an extensive Android dataset with 259,230 samples over a five-year span. Additionally, we conduct case studies in the Windows PE and PDF domains. Our findings identify the existence of biases in previous studies and reveal that significant performance enhancements are possible through appropriate, periodic tuning. We explore how mitigation strategies may support in achieving a more stable and better performance over time by employing multiple strategies to delay performance decay.
BibTeX
@misc{kan2024tesseract,
  author = {Zeliang Kan and Shae McFadden and Daniel Arp and Feargus Pendlebury and Roberto Jordaney and Johannes Kinder and Fabio Pierazzi and Lorenzo Cavallaro},
  title = {{TESSERACT: Eliminating Experimental Bias in Malware Classification across Space and Time (Extended Version)}},
  year = {2024},
  eprint = {2402.01359},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.01359},
}
Figure