Label-efficient Training Updates for Malware Detection over Time
Authors: Luca Minnei, Cristian Manca, Giorgio Piras, Angelo Sotgiu, Maura Pintor, Daniele Ghiani, Davide Maiorca, Giorgio Giacinto, Battista Biggio
Organizations: Department of Electrical and Electronic Engineering, University of Cagliari, Italy · Department of Computer, Control and Management Engineering, Sapienza University, Rome, Italy · CINI, Rome, Italy
Machine Learning (ML)-based detectors are becoming essential to counter the proliferation of malware. However, common ML algorithms are not designed to cope with the dynamic nature of real-world settings, where both legitimate and malicious software evolve. This distribution drift causes models trained under static assumptions to degrade over time unless they are continuously updated. Regularly retraining these models, however, is expensive, since labeling new acquired data requires costly manual analysis by security experts. To reduce labeling costs and address distribution drift in malware detection, prior work explored active learning (AL) and semi-supervised learning (SSL) techniques. Yet, existing studies (i) are tightly coupled to specific detector architectures and restricted to a specific malware domain, resulting in non-uniform comparisons; and (ii) lack a consistent methodology for analyzing the distribution drift, despite the critical sensitivity of the malware domain to temporal changes. In this work, we bridge this gap by proposing a model-agnostic framework that evaluates an extensive set of AL and SSL techniques, isolated and combined, for Android and Windows malware detection. We show that these techniques, when combined, can reduce manual annotation costs by up to 90% across both domains while achieving comparable detection performance to full-labeling retraining. We also introduce a methodology for feature-level drift analysis that measures feature stability over time, showing its correlation with the detector performance. Overall, our study provides a detailed understanding of how AL and SSL behave under distribution drift and how they can be successfully combined, offering practical insights for the design of effective detectors over time.
Figures & tables
Fig. 1: Overview of our proposed pipeline combining AL and SSL. The dash‑dot line represents the detector’s decision boundary. Given a set of newly collected unlabeled samples (left), AL queries a small set of informative samples for expert annotation (center), while SSL automatically assigns pseudo-labels to high-confidence samples (right), enabling efficient model retraining with reduced labeling cost.
Fig. 2: F1 score at FPR =1% over time for RF on ELSA (quarterly) and EMBER (monthly) with a 10% labeling budget. Top: comparison of AL strategies, alongside NR and FL references. Bottom: comparison of SSL strategies under the same budget, with the same references.
AL Strategy
1% Budget
2% Budget
5% Budget
10% Budget
ρ
F1
ρ
F1
ρ
F1
ρ
F1
SVM + NR
74.9
80.0
74.9
80.0
74.9
80.0
74.9
80.0
SVM + FL
82.2
85.4
82.2
85.4
82.2
85.4
82.2
85.4
SVM + RS
72.9
78.5
74.5
79.9
76.0
81.2
76.6
81.6
SVM + BADGE
78.6
82.9
80.2
84.0
81.5
85.0
83.5
86.3
SVM + CLUE
78.1
82.6
80.4
84.2
82.2
85.4
82.5
85.6
TABLE I: Average recall ( ρ ) and F1 score across different AL strategies and label budgets, at fixed FPR of 1%, for SVM and RF models on ELSA. Best overall results are in bold , the top AL method is underlined , and values below the NR baseline are in red .
AL Strategy
1% Budget
2% Budget
5% Budget
10% Budget
ρ
F1
ρ
F1
ρ
F1
ρ
F1
RF + NR
56.6
66.3
56.6
66.3
56.6
66.3
56.6
66.3
RF + FL
86.7
91.4
86.7
91.4
86.7
91.4
86.7
91.4
RF + RS
67.0
76.7
72.4
81.4
75.1
83.1
79.0
86.5
RF + Badge
69.0
78.3
73.5
81.9
79.6
86.5
84.8
90.3
RF + CLUE
61.7
71.3
67.6
76.8
74.9
83.1
80.7
87.6
TABLE II: Comparison of AL strategies for different label budgets on EMBER (RF). Refer to Table I caption for metrics and formatting.
SSL strategy
10% Budget
20% Budget
60% Budget
80% Budget
ρ
F1
ρ
F1
ρ
F1
ρ
F1
SVM + NR
74.9
80.0
74.9
80.0
74.9
80.0
74.9
80.0
SVM + FL
82.2
85.4
82.2
85.4
82.2
85.4
82.2
85.4
SVM + ST
73.8
79.1
73.7
79.0
73.5
78.9
73.9
79.3
SVM + AT
72.1
77.9
71.0
76.9
66.0
71.7
65.3
70.7
RF + NR
71.9
78.1
71.9
78.1
71.9
78.1
71.9
78.1
TABLE III: Average recall ( ρ ) and F1 score across different SSL strategies and pseudo-label budgets, at fixed FPR of 1%, for SVM and RF models on ELSA. Best overall results are in bold , the top SSL method is underlined , and values below the NR baseline are in red .
SSL strategy
10% Budget
20% Budget
60% Budget
80% Budget
ρ
F1
ρ
F1
ρ
F1
ρ
F1
RF + NR
56.6
66.3
56.6
66.3
56.6
66.3
56.6
66.3
RF + FL
86.7
91.4
86.7
91.4
86.7
91.4
86.7
91.4
RF + ST
52.1
60.3
52.3
60.9
48.1
55.7
48.1
56.1
RF + AT
50.8
58.5
51.6
59.8
47.4
54.6
48.3
56.0
TABLE IV: Comparison of SSL strategies for different pseudo-label budgets on EMBER (RF). Refer to Table III caption for metrics and formatting.
Fig. 3: F1 score at FPR =1% over time using RF on ELSA (quarterly) and EMBER (monthly), where each AL strategy is combined with its best-performing SSL strategy, including the optimal SSL budget, at a fixed labeling budget of 1% (ELSA) and 2% (EMBER). The lower panel reports the discriminant percentage of features over time, denoted by β , corresponding to the performance curves above.
Fig. 4: Scatter plots of F1 score versus β of the curve in Fig. 3 for ELSA (right plot) and EMBER (left plot). The insets report Pearson r and Kendall τ correlations with two-sided permutation-test p-values (10,000 resamples).
Machine learning based malware detectors become obsolete over time due to concept drift in benign and malware applications. Recent methods rely on fully labeled data and use hierarchical contrastive loss (HCL) with active learning to improve robustness against drift by exploiting semantic structure in malware representations. However, obtaining labeled data in the security domain is difficult. Under partially labeled settings, HCL suffers significant performance degradation in detecting unseen malware, especially on datasets such as BODMAS where strong semantic structure may not exist. In this paper, we propose SEED, a semantic-structure-agnostic method for malware detection under limited supervision. SEED combines a tailored binary cross-entropy objective with semi-supervised continual learning and active learning. For partially labeled seen tasks, unlabeled samples are projected into a representation space constructed from previously seen data using singular value decomposition, and paired with suitable labeled samples to encourage representation consistency. For unseen tasks with fully unlabeled data, uncertainty is quantified using cosine distance in representation space, and the most uncertain samples are selected for analyst labeling. We evaluate SEED on both Windows and Android malware datasets. Using only 20% labeled data on seen tasks, SEED achieves average AUT improvements of 40% on BODMAS and 14% on AndroZoo for unseen malware detection compared to HCL* (the semi-supervised adaptation of HCL), while remaining competitive on APIGraph. Finally, we introduce a delayed buffer update strategy to reduce label noise propagation during replay and improve learning stability.
Concept drift refers to changes over time in the statistical properties of data, as compared to the data that was used to train a learning model. Machine learning models for malware detection or classification are particularly susceptible to performance degradation caused by concept drift, as attackers constantly modify existing malware. In this chapter, we analyze two machine learning-based approaches to automated concept drift detection-a novel approach based on One-Class Support Vector Machines (OCSVM) and a previously-studied technique based on Minibatch K-Means (MK-Means). For comparison we also consider Maximum Mean Discrepancy (MMD), a statistical technique for detecting changes in multidimensional data. We conduct an extensive series of experiments comparing the effectiveness of four learning models, namely, Multilayer Perceptron, Random Forest, Support Vector Machines, and eXtreme Gradient Boosting. For each of these models, we consider three distinct scenarios: A static scenario where no model retraining occurs, a periodic scenario where models are constantly retrained irrespective of concept drift, and a drift-aware scenario where models are only retrained when concept drift is detected. Under the drift-aware scenario, we analyze the tradeoff between accuracy and training efficiency using Pareto Front analysis. We find that all three concept drift detection techniques achieve classification accuracy comparable to periodic retraining, while offering substantially greater efficiency in terms of the number of models that must be retrained. In addition, drift-aware retraining based on our OCSVM technique generally outperforms the MK-Means and MMD approaches. Overall, these results provide strong evidence that we can accurately detect concept drift in malware classification models.
Christofer Washington Berruz Chungata, Martin Jurecek, Katerina Potika +2
Department of Computer Science, San Jose State University · Faculty of Information Technology, Czech Technical University in Prague
Concept drift, driven by the rapid evolution of Android malware, severely degrades the performance of machine learning detectors. Current adaptation strategies are often reactive, responding only after performance has dropped and imposing a significant manual annotation burden, or they are proactive but rely on unstable adversarial training and incomplete, single-level graph representations. To overcome these limitations, we propose HYDRA (Hybrid Drift Adaptation), a proactive adaptation framework that learns drift-invariant representations from hierarchically structured data. HYDRA first models applications using a hybrid graph structure, combining fine-grained Control Flow Graphs (CFGs) and coarse-grained Function Call Graphs (FCGs) to capture comprehensive behavioral patterns. It then introduces a novel cross-domain contrastive learning objective that aligns historical (source) and new (target) data distributions. By generating pseudo-labels for unlabeled target samples, our method pulls representations of semantically similar applications together, regardless of their domain, within a single, stable optimization process. This approach unifies feature learning and domain alignment, eliminating the need for complex adversarial objectives. Extensive experiments on large-scale, time-ordered malware datasets demonstrate that HYDRA achieves substantially lower False Negative and False Positive Rates than state-of-the-art baselines while requiring up to 87.5% fewer labeled samples. Our work thus offers a robust and efficient solution to combat concept drift in security applications.
Han Chen, Hanchen Wang, Hongmei Chen +3
University of Technology Sydney Sydney, New South Wales, Australia · Yunnan University Kunming, Yunnan, China · University of New South Wales Sydney, New South Wales, Australia