Introduction
Machine learning (ML) has become a fundamental tool in malware research within the academic security community, with its applications spanning a wide range of domains. While the high performance figures associated with machine learning solutions might lead one to believe that the issue of malware classification is practically solved, this is far from true.
Malware classifiers are challenged by the dynamic nature of operational environments and attacking techniques. The constant emergence of new malware variants and families often leads to a degradation in the predictive accuracy of these classifiers over time. Ensuring temporal consistency is therefore a critical factor in evaluating the effectiveness of these classifiers.
We identify two types of experimental bias: spatial bias and temporal bias. Spatial bias occurs when there are unrealistic assumptions about the ratio of goodware to malware in the dataset, which must be consistently enforced during the testing phase to mimic a realistic scenario. Temporal bias occurs when there is a temporal inconsistency between the training and testing datasets, which can lead to the integration of future knowledge into the training phase or create unrealistic settings, especially for concept drift detection.
We believe that the pervasiveness of these issues is due to two main reasons: first, possible sources of evaluation bias are not common knowledge; second, accounting for time complicates the evaluation and does not allow a comparison to other approaches using headline evaluation metrics such as the F1-Score or AUROC.
Previous works by Sommer and Paxson, Rossow et al., and Kouwe et al. propose guidelines for sound security evaluations, but none of them identify temporal and spatial bias or quantify the impact of errors on classifier performance. While Allix et al. and Miller et al. identify initial temporal constraints in Android malware classification, we demonstrate that recent work following their guidelines still suffer from temporal and spatial bias. Our paper is the first to identify and address these sources of bias with novel, actionable constraints, metrics, and tool support.
In this article, the term (experimental) bias is employed to denote the discrepancies between an experimental setting and the conditions observed in genuine real-world deployments. These discrepancies might give rise to evaluations that are potentially misleading. It is pivotal to differentiate that we are not referencing the trade-off between classifier bias and variance as delineated in the conventional machine learning literature.
Android Malware Classification
In this study, we primarily focus on two popular malware detection approaches: DREBIN and DEEPDREBIN. To ensure a robust experimental framework, we have thoroughly re-implemented both DREBIN and DEEPDREBIN based on the detailed methodologies outlined in their foundational papers. In contrast, we have excluded MAMADROID from this study due to its limited efficacy, as observed in our previous analysis spanning 2014 to 2016.
259,230 Android apps
The final dataset used in our study consists of 259,230 Android applications, with 232,843 labeled as goodware and 26,387 labeled as malware.
2014 to 2018
We select the period from 2014 to 2018 for analysis, a timeframe frequently cited in the assessment of contemporary methodologies.
VirusTotal labels
Since AndroZoo’s metadata reports the number p of positive anti-virus reports on VirusTotal for samples in the AndroZoo dataset, we chose p = 0 for goodware and p ≥ 4 for malware, following Miller et al.’s advice for a reliable ground-truth. About 9% of AndroZoo apps can be called grayware as they have 0 < p < 4 when we write the article.
DREBIN
It utilizes a linear support vector machine (SVM) with high-dimensional binary feature vectors derived from efficient static analysis.
DEEPDREBIN
Additionally, we incorporate DEEPDREBIN, a deep learning approach that uses the same input features as DREBIN. It comprises an input layer, succeeded by two hidden layers with 200 neurons each.
Top 10,000 features
Previous research studies have shown that utilizing only the top 10,000 features does not significantly affect DREBIN classification performance.
Estimating in-the-wild Malware Ratio
It is therefore essential to determine whether malware is a minority, majority, or equal-sized class compared to goodware. For instance, industry telemetry by a key player suggests that around 6% of Android apps are malicious. On the other hand, AndRadar measurement study indicates that the ratio of Android malware in the wild is approximately 8%. The 2017 Google’s Android security report estimates the malware percentage to be between 6% and 10%, while in 2023 the AndroZoo dataset analysis reveals an incidence of 16.3% of malicious apps among the whole dataset.
To stabilize the percentage of malware in our dataset, we choose to set it to 10%, which is an approximate average across different estimates, with monthly values ranging from 8% to 12%. It is important to emphasize that the decision to set the malware percentage at 10% in our dataset should not be interpreted as a universal benchmark for Android malware detection.
Sources of Experimental Bias
Temporal Experimental Bias
Concept drift is a problem that occurs in machine learning when a model becomes obsolete as the distribution of incoming data at test-time differs from that of training data, i.e., when the assumption does not hold that data is independent and identically distributed (i.i.d.). In the ML community, this problem is also known as dataset shift. Time decay is the decrease in model performance over time caused by dataset shift.
Concept drift in malware combined with similarities among malware within the same family causes k-fold cross validation (CV) to be positively biased, artificially inflating the performance of malware classifiers. K-fold CV is likely to include in the training set at least one sample of each malware family in the dataset, whereas new families will be unknown at training time in a real-world deployment.
We identify a novel form of temporal bias that arises when goodware and malware correspond to different time periods, often due to originating from distinct data sources. This situation can lead to the classifier learning to distinguish between applications from different time periods rather than differentiating between goodware and malware, thereby resulting in artificially inaccurate performance. For instance, spurious features such as new API methods may exhibit strong discriminatory power simply because malicious applications predate the introduction of those APIs.
Spatial Experimental Bias
We identify two main types of spatial experimental bias based on assumptions on percentages of malware in testing and training sets.
Spatial experimental bias in testing. The percentage of malware in the testing distribution needs to be estimated and cannot be changed, if one wants results to be representative of in-the-wild deployment of the malware classifier. We change the percentage of malware in the testing set by randomly down-sampling goodware, so the number of malware remains fixed throughout the experiments. In this scenario, we can observe that TPs (i.e., malware objects correctly classified as malware) and FNs (i.e., malware objects incorrectly classified as goodware) do not change, because the number of malware does not increase; hence, Recall remains stable. The increase in number of FPs (i.e., goodware objects misclassified as malware) decreases as we reduce the number of goodware in the dataset; hence, Precision improves. Since the F1-Score is the harmonic mean of Precision and Recall, it goes up with Precision. This example shows how considering an unrealistic testing distribution with more malware than goodware in this context positively inflates Precision and hence the F1-Score of classifiers.
Spatial experimental bias in training. It is observed that as the percentage of malware in training increases, the hyperplane of the SVM shifts towards the goodware region. Specifically, it improves the Recall of malware while reducing its Precision. In order to minimize the overall error rate Err = (FP + FN)/(TP + TN + FP + FN) (i.e., maximize Accuracy), it is advisable to train the dataset with the same distribution that is expected in the testing. However, in certain cases, there may be a greater interest in identifying objects of the minority class (e.g., ”more malicious samples”) by improving Recall while ensuring a constraint on the maximum FPR.
Motivational Example
We present a motivating example where we manipulate experimental biases to better illustrate the problem. The data presented in Table 1 reveal that both DREBIN and DEEPDREBIN exhibit significantly lower performance in realistic scenarios compared to settings similar to those described in prior works. This discrepancy can be attributed to unintentional experimental biases.
DREBIN, realistic setting: 0.47, difference: +0.38
- C1 Temporal training consistencyviolated
- C2 Temporal gw/mw time-window consistencymay be violated
- C3 Realistic malware-to-goodware ratio in testingholds
K-fold CV is likely to include in the training set at least one sample of each malware family in the dataset, whereas new families will be unknown at training time in a real-world deployment.
Show the full table
| Experimental setting | DREBIN 10% / 10% | DREBIN 90% / 10% | DEEPDREBIN 10% / 10% | DEEPDREBIN 90% / 10% | DREBIN 10% / 90% | DREBIN 90% / 90% | DEEPDREBIN 10% / 90% | DEEPDREBIN 90% / 90% |
|---|---|---|---|---|---|---|---|---|
| 10-fold CV | 0.85 | 0.55 | 0.84 | 0.51 | 0.91 | 0.98 | 0.88 | 0.98 |
| Temporally inconsistent | 0.64 | 0.48 | 0.62 | 0.38 | 0.71 | 0.49 | 0.66 | 0.92 |
| Temporally inconsistent gw/mw windows | 0.30 | 0.42 | 0.37 | 0.42 | 0.31 | 0.77 | 0.39 | 0.78 |
| Temporally consistent (realistic) | 0.47 | 0.39 | 0.36 | 0.39 | 0.53 | 0.80 | 0.39 | 0.84 |
Table 1: F1-Score results that show impact of spatial (in columns) and temporal (in rows) experimental bias. Column headings: % mw in training / testing. Highlighted: the realistic settings.
The last row of Table 1 shows that the realistic setting, where training is temporally precedent to testing, causes the worst classifier performance in the majority of cases.
The original paper of DREBIN utilizes a hold-out approach by performing 10 random splits, with 66% of the data used for training and 33% for testing. Since hold-out is nearly equivalent to k-fold cross-validation (CV) and is susceptible to the same spatio-temporal biases, for the sake of simplicity in this section, we refer to a k-fold cross validation setting for both DREBIN and DEEPDREBIN.
Space-Time Aware Evaluation
To evaluate the classifier, the dataset D must be split into a training dataset Tr with a time window of size W, and a testing dataset Ts with a time window of size S. Here, we consider S > W in order to estimate long-term performance and robustness to decay of the classifier. We emphasize that, although we have the labels of objects in Ts ⊆ D, all the evaluations and tuning algorithms must assume that labels yi of objects si ∈ Ts are unknown.
To evaluate performance over time, the test set Ts must be split into time-slots of size Δ. We now formalize three constraints that must be enforced when dividing D into Tr and Ts for a realistic setting that avoids spatio-temporal experimental bias. While C1 was proposed in past work, we are the first to propose C2 and C3—which we show to be fundamental.
C1 Temporal training consistency
All the objects in the training must be strictly temporally precedent to the testing ones.
time(si) < time(sj), ∀si ∈ Tr, ∀sj ∈ Ts
C2 Temporal gw/mw time-window consistency
In every testing slot of size Δ, all test objects si must be from the same time window. If violated, the results are biased because the classifier may learn and test on artifactual behaviors that, for example, distinguish goodware from malware just by their different API versions.
C3 Realistic malware-to-goodware ratio in testing
To have a realistic evaluation, the average percentage of malware in the testing (δ) must be as close as possible to the estimated percentage of malware in the wild (σ̂).
δ ≃ σ̂
If C3 is violated by overestimating the percentage of malware, the results are positively inflated. We highlight that, although the testing distribution δ cannot be changed (in order to get realistic results), the percentage of malware in the training φ may be tuned.
Time-aware Performance Metrics
We introduce a time-aware performance metric that allows for the comparison of different classifiers while considering time decay. Point estimates are always to be preferred to represent the real performance of an algorithm. The cumulative estimates can be used to highlight a smoothed trend and to show overall performance up to a certain point, but can be misleading if reported on their own if objects are too sparsely distributed in some test slots Δ.
To facilitate the comparison of different time decay plots, we define a new metric, Area Under Time (AUT), the area under the performance curve over time.
AUT(P, N) = 1⁄N−1 Σk=1N−1 [P(Xk+1) + P(Xk)] / 2
P(Xk) is the value of the point estimate of the performance metric P (e.g., F1) evaluated at point Xk := (W + kΔ); N is the number of test slots, and 1/(N − 1) is a normalization factor so that AUT ∈ [0, 1]. The perfect classifier with robustness to time decay in the time window S has AUT = 1. As an example, AUT(F1, 12m) is the point estimate of F1-Score considering time decay for a period of 12 months, with a 1-month interval.
AUT(P,N) is a metric that allows us to evaluate performance P of a malware classifier against time decay over N time units in realistic experimental settings—obtained by enforcing C1, C2, and C3.
Tuning Training Ratio
We propose a novel algorithm that allows for the adjustment of the training ratio φ when the dataset is imbalanced, in order to optimize a user-specified performance metric (F1-Score, Precision, or Recall) on the minority class, subject to a maximum tolerated error, while aiming to reduce time decay. Also, we assume that the user already has a training dataset Tr and wants to use as many objects from it as possible, while still achieving a good performance trade-off; for this purpose, we perform a progressive sub-sampling of the goodware class.
As a result, if we want to maximize F1-Score for the malware class, we need to limit both FPs and FNs. if P = Pr, we minimize FNs, so we constrain FNR. And if P = Rec, we constrain FPR.
Split the training set
Split the training set Tr into two subsets: actual training (ProperTr) and validation set (Val), while enforcing C1, C2, C3, also implying δ = σ̂
Divide into time-slots
Divide Val into N non-overlapped subsets, each corresponding to a time-slot Δ, so that Valarray = [V0, V1, ..., VN]
Initialize
The maximum performance observed P* and the optimal training ratio φ*P are initialized by assuming the estimated in-the-wild malware ratio σ̂ for training; in Android, σ̂ ≈ 10%.
Grid search
The grid-search phase iterates over different values of φ, with a learning rate µ (e.g., µ = 0.05), and keeps as φ*P the value leading to the best performance, subject to the error constraint. To reduce the chance of discarding high-quality points while down-sampling goodware, we prioritize the most uncertain points (e.g., points close to the decision boundary of the SVM).
Keep the best
Finally, the grid-search explores multiple values of φ and stores the best ones. To capture time-aware performance, we rely on AUT, and the error rate is computed according to the target P.
TESSERACT Implementation
We introduce TESSERACT, an open-source performance evaluation framework that rigorously applies constraints C1, C2, and C3, computes AUT, and possesses the capability to refine a classifier utilizing our proposed tuning algorithm. TESSERACT functions comparably to traditional Python ML libraries, yet it distinctively requires not only the features matrix X and labels y, but also an array of timestamps t, which sorts the dates corresponding to each data entry.
loader.py
loader.py is designed to transform the input dataset into a structure compatible with TESSERACT. It outputs a vectorized matrix X, a label array y, and an associated datetime array t.
temporal.py
temporal.py enhances traditional machine learning frameworks that utilize input features X and target variables y by incorporating datetime objects t. This addition enables time-sensitive data operations, such as dataset partitioning which adheres to temporal constraints C1 and C2, with functions like time_aware_partition() and time_aware_train_test_split().
spatial.py
This module allows the user to alter the proportion of the positive class in a given dataset. This module can also assert that constraint C3 has not been violated.
metrics.py
Importantly we also include aut(), with optional parameter granularity (δ) and observation time window (τ), for computing the AUT for a given metric (F1, Precision, Recall, etc.) over a given time period.
evaluation.py
Here we include the predict() and fit_predict_update() functions that accept a classifier, dataset and set of parameters and return the results of a time-aware evaluation performed across the chosen periods.
selection.py, rejection.py
For extending the evaluation to testing model update strategies, these modules provide hooks for novel query and reject strategies to be easily plugged into the evaluation cycle.
We make TESSERACT’s code and data available to the research community to promote the adoption of a sound and unbiased evaluation of classifiers. The TESSERACT project website with instructions to request access is at https://github.com/s2labres/tesseract-ml/, and all experiments related code can be found at https://github.com/s2labres/tesseract-journal-experiments/.
Impact of the artifact: TESSERACT Impact (ACSAC Cybersecurity Artifact Competition 2024)
TESSERACT: Revealing Hidden Performance
Here, we show how our methodology can reveal hidden performance of DREBIN and DEEPDREBIN, along with their robustness to time decay. Both approaches show a similar trend of performance in the testing data. The 10-fold CV results are 0.85 and 0.84, with an AUT(F1, 48m) of 0.50 and 0.49 for DREBIN and DEEPDREBIN, respectively.
Across all quartets of scenarios, the AUT consistently falls behind the 10-fold F1 score, as the latter violates constraint C1 and may violate C2 if the dataset classes are not evenly distributed across the timeline.
Performance decay over time
Focusing on the malware side, we observe that both F1-Scores and Recall rates initially decrease, followed by a modest recovery after Month 28. Precision remains stable in the first 24 months for both methods, then experiences a notable decline after Month 24 and generally remains lower thereafter. There is no obvious performance decay, apart from Month 39, from goodware’s side.
Observation window in AUT evaluation
When evaluating performance with the AUT metric, a new feature in TESSERACT framework is that users can define the observation time window (τ, by default, it equals the full length of the testing period) for more detailed performance change. When we set the time window as default, where τ = 48-month, DREBIN and DEEPDREBIN show similar performances of 0.50 and 0.49, respectively. Notably, when τ gets even smaller, DEEPDREBIN exhibits more consistent and robust performance in the second year (Month 13 to 24) and maintains this trend across all smaller time windows (e.g., τ = 3-month, 6-month, and 12-month).
AUT(F1) over four years of testing
τ = 3 months; training on 2014, testing January 2015 to December 2018.
Show as table
| Testing months | DREBIN | DEEPDREBIN |
|---|---|---|
| 1–3 | 0.75 | 0.72 |
| 4–6 | 0.74 | 0.70 |
| 7–9 | 0.74 | 0.69 |
| 10–12 | 0.62 | 0.67 |
| 13–15 | 0.50 | 0.59 |
| 16–18 | 0.53 | 0.56 |
| 19–21 | 0.57 | 0.60 |
| 22–24 | 0.41 | 0.41 |
| 25–27 | 0.31 | 0.23 |
| 28–30 | 0.33 | 0.26 |
| 31–33 | 0.46 | 0.44 |
| 34–36 | 0.44 | 0.44 |
| 37–39 | 0.40 | 0.37 |
| 40–42 | 0.43 | 0.41 |
| 43–45 | 0.55 | 0.52 |
| 46–48 | 0.14 | 0.13 |
Robustness of deep learning approach
In our initial analysis documented in the original paper, the deep learning method appeared to outshine the other two traditional ML approaches (Alg1(Drebin) and Alg2(MaMaDroid)) in terms of robustness after enforcing C1, C2 and C3. However, upon closer inspection and a more extended evaluation, this claim does not hold consistently. It is true that during the first two year of evaluation, the deep learning approach demonstrated a better and relatively stable performance. Nonetheless, when considering the broader scope of the analysis, it becomes evident that the overall performance of the deep learning method aligns closely with that of traditional machine learning techniques, if retraining is not possible.
Tuning algorithm
We first aim to maximize P = F1-Score of malware class, subject to Emax = 10%. After running Algorithm 1 on DREBIN and DEEPDREBIN, we set φ*F1 = 0.55 for DREBIN, and φ*F1 = 0.20 for DEEPDREBIN. We remark that the choice of φ*F1 uses only training information and no test information is used—the optimal value is chosen from a 4-month validation set extracted from the one year of training data; this is to simulate a realistic deployment setting in which we have no a priori information about testing.
When trained with φ*F1, a decrease in Precision is noted due to an increase in False Positives (FPs), while an increase in Recall is observed as a result of a decrease in False Negatives (FNs). This trade-off leads to a slight improvement of AUT for both classifiers. For each specific performance metric P, the tailored performance AUT(P, 48m) with φ*P generally surpasses the performance achieved using the original training ratio σ̂ for both DREBIN and DEEPDREBIN. The notable exception is when focusing on Precision; in this case, the tuning slightly underperforms compared to the original training ratio.
| Algorithm | φ | FP (48m) | FN (48m) | AUT F1 (48m) | AUT Pr (48m) | AUT Rec (48m) | AUT F1 (24m) |
|---|---|---|---|---|---|---|---|
| DREBIN | σ̂ (~10%) | 3,201 | 13,251 | 0.50 | 0.75 | 0.39 | 0.61 |
| DREBIN | φ*F1 (55%) | 12,053 | 10,409 | 0.51 | 0.49 | 0.54 | 0.64 |
| DREBIN | φ*Pr (5%) | 2,616 | 15,637 | 0.39 | 0.72 | 0.28 | 0.58 |
| DREBIN | φ*Rec (95%) | 48,891 | 5,878 | 0.37 | 0.25 | 0.75 | 0.46 |
| DEEPDREBIN | σ̂ (~10%) | 4,711 | 13,180 | 0.49 | 0.65 | 0.40 | 0.64 |
| DEEPDREBIN | φ*F1 (20%) | 6,381 | 11,509 | 0.53 | 0.62 | 0.48 | 0.68 |
| DEEPDREBIN | φ*Pr (5%) | 2,069 | 16,961 | 0.32 | 0.69 | 0.22 | 0.47 |
| DEEPDREBIN | φ*Rec (95%) | 86,487 | 1,844 | 0.30 | 0.18 | 0.91 | 0.32 |
Table 3: Testing AUTs performance when training with σ̂, φ*F1, φ*Pr, and φ*Rec. Highlighted rows: φ*F1.
Furthermore, a three-year evaluation window was also employed to assess the tuning algorithm. Aligning with the full dataset protocol, the first year of data from this three-year period was used to ascertain the optimal φ*F1, and subsequent tests were conducted over the following two years. The optimal φ*F1 was found to be 0.35 on both years 2015 and 2016 for both DREBIN and DEEPDREBIN. Our investigation strongly recommends the adoption of a dynamic tuning and testing regimen.
Windows and PDF Malware
We now discuss the impact of the spatial and temporal bias on ML-driven detection performance in other domains: Windows Portable Executables (PEs) and PDFs. Intuitively, we could expect a slower onset of concept drift—along with a more gradual decline in model performance—in these domains. The Android ecosystem predominantly features goodware. Conversely, the ratio of malware to goodware in Windows PE and PDF domains is not easily quantified due to a lack of comprehensive evidence.
Android
The Android ecosystem, predominantly comprising mobile applications, presents a unique challenge due to its vast, diverse app market and the rapid evolution of mobile technologies.
Windows PE: EMBER
Our analysis spans both the EMBER 2017 v2 and EMBER 2018 datasets, encompassing the years 2017 and 2018, resulting in a composite dataset of 255,499 benign and 148,231 malicious executables (labeled as having 40+ VirusTotal AV detections), constrained to this two-year period. Applying our Tuning Algorithm on the training set improves the model’s performance on the testing set, with the overall AUT(F1, 21m) increasing from 0.80 to 0.83.
PDF: HIDOST
We utilize the HIDOST evaluation dataset, which includes data from a 14-week period between July 16 and October 21, 2012, comprising 1,465,737 benign and 102,234 malicious files (identified with 5+ VirusTotal AV detections). While the overall improvement is modest due to the already high baseline performance, the tuning eradicates the performance drop in week 5 and slightly improves the overall AUT(F1, 10w) from 0.97 to 0.98, underscoring the benefits of adjusting the malware-to-goodware ratio.
Summary of Findings
Our case studies on both EMBER and HIDOST reveal significantly less concept drift compared to the Android dataset, likely due to the more stable and predictable nature of malware evolution in these environments. This stability is likely linked to the slower OS development cycle in Windows PE and the consistent format and usage in PDFs. Notably, we find that applying our algorithm 1 to tune the malware-to-goodware ratio during the training process enhances detection performance in testing within these domains.
Delaying Time Decay
While our work does not propose novel delay strategies, it leverages TESSERACT to facilitate the comparative analysis of several popular approaches aimed at mitigating time decay. To quantify performance-cost trade-offs of methods to delay time decay, we characterize the following three elements:
- Performance (P): the performance measured in terms of AUT to capture robustness against time decay;
- Labeling Cost (Lc): the number of testing objects (if any) that must be labeled—the labeling must occur periodically (e.g., every month), and is particularly costly in the malware domain as manual inspection requires many resources (infrastructure, time, expertise, etc)—for example, Miller et al. estimated that an average company could only manually label 80 objects per day;
- Quarantine Cost (Qc): the number of objects (if any) rejected by the classifier—these must be manually verified, so there is a cost for leaving them in quarantine.
Incremental Retraining
We begin by examining an approach that sets an ideal performance benchmark: including all points in a monthly retraining regime. Though representing an upper bound in performance, this strategy is likely impractical due to the continuous need for labeling a vast amount of objects.
Active Learning
Active Learning (AL) strategies focus on selecting a subset of test objects, whose labels are unknown, for manual labeling and inclusion in the training set. In our study, we employ the widely-used AL query strategy known as uncertainty sampling.
Classification with Rejection
As a mitigation approach, classifiers can designate decisions as ”low confidence” and defer them to a later date, effectively placing uncertain predictions into a quarantine zone pending manual review. While the original research focused on the nonconformity measure (NCM) for traditional ML algorithms, an adaptation of NCM has been developed for DNN (DEEPDREBIN) in this work, drawing upon the probabilistic outputs from its final SoftMax layer.
| Delay method | Lc (48m) both | Qc (48m) DREBIN / DEEPDREBIN | DREBIN φ = σ̂ | DEEPDREBIN φ = σ̂ | DREBIN φ = φ*F1 | DEEPDREBIN φ = φ*F1 |
|---|---|---|---|---|---|---|
| No update | 0 | 0 / 0 | 0.496 | 0.489 | 0.505 | 0.534 |
| AL: 1% | 1,993 | 0 / 0 | 0.632 | 0.651 | 0.655 | 0.657 |
| AL: 5% | 10,052 | 0 / 0 | 0.698 | 0.713 | 0.722 | 0.735 |
| AL: 10% | 20,127 | 0 / 0 | 0.705 | 0.753 | 0.738 | 0.764 |
| AL: 25% | 50,355 | 0 / 0 | 0.763 | 0.793 | 0.789 | 0.801 |
| Inc. retrain | 201,490 | 0 / 0 | 0.794 | 0.819 | 0.802 | 0.838 |
| Rejection (σ̂) | 0 | 29,391 / 35,127 | 0.537 | 0.613 | – | – |
| Rejection (φ*F1) | 0 | 10,891 / 19,695 | – | – | 0.558 | 0.635 |
| Delay method | Lc (48m) both | Qc (48m) DREBIN / DEEPDREBIN | DREBIN φ = σ̂ | DEEPDREBIN φ = σ̂ | DREBIN φ = φ*F1 | DEEPDREBIN φ = φ*F1 |
|---|---|---|---|---|---|---|
| No update | 0 | 0 / 0 | 0.609 | 0.636 | 0.645 | 0.667 |
| AL: 1% | 1,993 | 0 / 0 | 0.723 | 0.660 | 0.740 | 0.686 |
| AL: 5% | 10,052 | 0 / 0 | 0.778 | 0.709 | 0.800 | 0.735 |
| AL: 10% | 20,127 | 0 / 0 | 0.808 | 0.757 | 0.815 | 0.761 |
| AL: 25% | 50,355 | 0 / 0 | 0.809 | 0.775 | 0.814 | 0.791 |
| Inc. retrain | 201,490 | 0 / 0 | 0.808 | 0.812 | 0.810 | 0.834 |
| Rejection (σ̂) | 0 | 29,391 / 35,127 | 0.658 | 0.779 | – | – |
| Rejection (φ*F1) | 0 | 10,891 / 19,695 | – | – | 0.717 | 0.804 |
Table 4: Performance-cost comparison of delay methods.
The initial setup with no updates provides a baseline for performance. The training ratios with φ*F1, however, exhibit better results for both classifiers without incurring additional costs, underscoring the importance of precise initial training/tuning settings for sustained performance.
The more data we label, the better retrained performance we get. For example, employing Active Learning (AL) with a 25% relabeling rate results in a labeling cost of 50,355 samples over 48 months for both DREBIN and DEEPDREBIN.
A comparison between the two rejection rows clearly shows that the application of the optimal training ratio φ*F1 allows the classifier to more effectively quarantine dubious decisions. For DREBIN, TRANSCENDENT leads to a significant decrease in rejected samples—two-thirds less—while still improving performance: AUT(F1, 24m) rises from 0.658 to 0.717, and AUT(F1, 48m) from 0.537 to 0.558 respectively. Notably, TRANSCENDENT even enables DEEPDREBIN to outperform the AUT(F1, 24m) of the Active Learning scenario with a 25% budget, while quarantining fewer samples.
In this journal version
This article extends our work published at USENIX Security Symposium 2019. In this journal version, we focus on deepening and expanding the most promising aspects observed in our initial study on a larger dataset.
Five years of Android apps
As an extension of our previous conference paper, we experimentally verify our hypothesis on an extended Android dataset of 259,230 apps (with 10% malware) spanning over five years that, due to bias, performance can decrease up to 50% in practice in the well-known Android malware classifiers.
Deep learning
This version presents an in-depth analysis of the deep learning approach, particularly examining how it performs in comparison to the traditional ML method when applied to identical spatial and temporal bias.
Windows PE and PDF malware
Our findings reveal that, even in these domains where concept drift is less pronounced, applying our proposed tuning algorithm to the training data can still enhance detection capabilities.
A broader range for φ
This approach differs from the one in the conference version of TESSERACT, where we relax the constraint on line 6 from (σ̂ ≤ φ ≤ 0.5) to a broader range of (µ ≤ φ ≤ 1.0). We find that imposing a stringent boundary is unnecessary when an error rate control is already in place.
AUT observation window τ
Different τ can lead to distinct insights, enabling researchers to pinpoint when and how a classifier’s performance starts to decay, thus guiding the development of robust systems.
TRANSCENDENT for DNNs
Additionally, we implement the state-of-the-art conformal prediction framework-TRANSCENDENT-to be compatible with deep neural networks (DNN). This adaptation involves the implementation of a non-conformity measurement (NCM) based on the output from the SoftMax layer of a DNN model.
Conclusions
- We have identified novel temporal and spatial biases in ML-driven malware detection, and proposed novel constraints, metrics and tuning algorithm to address such issues.
- We have shown the two experimental biases commonly exist in detection tasks, and how TESSERACT can reveal the real performance of malware classifiers that remain hidden in wrong experimental settings in a non-stationary context.
- It enables evaluation of a classifier’s inherent robustness to performance decay using a baseline AUT performance metric, highlighting true performance and sometimes surprising results.
- Our experiments also indicate the necessity of regular retraining and tuning for sustained performance.
- We encourage the community to adopt TESSERACT to deeply evaluate the impact of temporal and spatial bias in any security domain where concept drift appears.
Cite
@misc{kan2024tesseract,
title={TESSERACT: Eliminating Experimental Bias in Malware Classification across Space and Time (Extended Version)},
author={Zeliang Kan and Shae McFadden and Daniel Arp and Feargus Pendlebury and Roberto Jordaney and Johannes Kinder and Fabio Pierazzi and Lorenzo Cavallaro},
year={2024},
eprint={2402.01359},
archivePrefix={arXiv},
primaryClass={cs.LG}
}