droidspan-eval
A Preliminary Study On the Sustainability of Android Malware Detection — Cai (2018) (arXiv:1807.08221, 2018)
What this evaluates
Evaluates the sustainability and robustness of a dynamic behavioral profiling approach (DroidSpan) for Android malware detection over time and against code obfuscation, compared to a static baseline (MamaDroid).
Datasets
- all-data — total ?; splits: train (-1), test (-1)
- oldBen+oldMal — total ?; splits: train (-1)
- MalObf — total 220; splits: test (220)
Metrics
Precision — range: [0, 1]
- P = TP / (TP + FP), computed with respect to the positive class L = MALICIOUS.
Recall — range: [0, 1]
- R = TP / (TP + FN), computed with respect to the positive class L = MALICIOUS.
F1-measure (primary) — range: [0, 1]
- F1 = 2 * (P * R) / (P + R). The paper notes that F1 scores in cross-validation are averaged across folds, not recomputed from averaged P and R.
Input / output format
Input: Runtime dynamic traces of Android apps, specifically the Sensitive Access Distribution (SAD) profile capturing patterns of sensitive data and operation accesses.
Output: Binary classification label: BENIGN or MALICIOUS.
Scoring recipe
def compute_metrics(predictions, gold_labels):
tp = sum(1 for p, g in zip(predictions, gold_labels) if p == 'MALICIOUS' and g == 'MALICIOUS')
fp = sum(1 for p, g in zip(predictions, gold_labels) if p == 'MALICIOUS' and g != 'MALICIOUS')
fn = sum(1 for p, g in zip(predictions, gold_labels) if p != 'MALICIOUS' and g == 'MALICIOUS')
precision = tp / (tp + fp) if (tp + fp) > 0 else 0.0
recall = tp / (tp + fn) if (tp + fn) > 0 else 0.0
f1 = 2 * (precision * recall) / (precision + recall) if (precision + recall) > 0 else 0.0
return precision, recall, f1
Common pitfalls
- F1 scores in cross-validation are averaged across folds, not recomputed from averaged precision and recall.
- MamaDroid's static analysis (FlowDroid) fails on obfuscated apps, making direct comparison on the MalObf dataset impossible.
- Evaluation splits are strictly time-based (training on older malware, testing on newer) to measure sustainability, not random splits.
Evidence (verbatim from paper)
In our evaluation, we gauged the performance of DroidSpan versus the baseline in terms of three metrics: precision, recall, and F1-measure (accuracy), as defined below. ... Precision (P) = TP/(TP + FP), Recall (R) = TP/(TP + FN), and F1 = 2 * (P*R)/(P+R). For evaluating malware detection, these metrics are computed concerning L = MALICIOUS only.
Citation
@misc{cai2018preliminary,
title={A Preliminary Study On the Sustainability of Android Malware Detection},
author={Cai (2018)},
year={2018},
note={arXiv:1807.08221}
}
1---2name: droidspan-eval3description: Evaluates the sustainability and robustness of a dynamic behavioral profiling approach (DroidSpan) for Android malware detection over time and against code obfuscation, compared to a static baseline (MamaDroid). Use when the user wants to benchmark on all-data, oldBen+oldMal, MalObf, or asks about evaluating this task. Reports F1-measure.4---56# droidspan-eval78> A Preliminary Study On the Sustainability of Android Malware Detection — Cai (2018) (arXiv:1807.08221, 2018)910## What this evaluates1112Evaluates the sustainability and robustness of a dynamic behavioral profiling approach (DroidSpan) for Android malware detection over time and against code obfuscation, compared to a static baseline (MamaDroid).1314## Datasets1516- **all-data** — total ?; splits: train (-1), test (-1)17- **oldBen+oldMal** — total ?; splits: train (-1)18- **MalObf** — total 220; splits: test (220)1920## Metrics2122- `Precision` — range: [0, 1]23 - P = TP / (TP + FP), computed with respect to the positive class L = MALICIOUS.24- `Recall` — range: [0, 1]25 - R = TP / (TP + FN), computed with respect to the positive class L = MALICIOUS.26- `F1-measure` **(primary)** — range: [0, 1]27 - F1 = 2 * (P * R) / (P + R). The paper notes that F1 scores in cross-validation are averaged across folds, not recomputed from averaged P and R.2829## Input / output format3031**Input**: Runtime dynamic traces of Android apps, specifically the Sensitive Access Distribution (SAD) profile capturing patterns of sensitive data and operation accesses.3233**Output**: Binary classification label: BENIGN or MALICIOUS.3435## Scoring recipe3637```python38def compute_metrics(predictions, gold_labels):39 tp = sum(1 for p, g in zip(predictions, gold_labels) if p == 'MALICIOUS' and g == 'MALICIOUS')40 fp = sum(1 for p, g in zip(predictions, gold_labels) if p == 'MALICIOUS' and g != 'MALICIOUS')41 fn = sum(1 for p, g in zip(predictions, gold_labels) if p != 'MALICIOUS' and g == 'MALICIOUS')42 precision = tp / (tp + fp) if (tp + fp) > 0 else 0.043 recall = tp / (tp + fn) if (tp + fn) > 0 else 0.044 f1 = 2 * (precision * recall) / (precision + recall) if (precision + recall) > 0 else 0.045 return precision, recall, f146```4748## Common pitfalls4950- F1 scores in cross-validation are averaged across folds, not recomputed from averaged precision and recall.51- MamaDroid's static analysis (FlowDroid) fails on obfuscated apps, making direct comparison on the MalObf dataset impossible.52- Evaluation splits are strictly time-based (training on older malware, testing on newer) to measure sustainability, not random splits.5354## Evidence (verbatim from paper)5556> In our evaluation, we gauged the performance of DroidSpan versus the baseline in terms of three metrics: precision, recall, and F1-measure (accuracy), as defined below. ... Precision (P) = TP/(TP + FP), Recall (R) = TP/(TP + FN), and F1 = 2 * (P*R)/(P+R). For evaluating malware detection, these metrics are computed concerning L = MALICIOUS only.5758## Citation5960```bibtex61@misc{cai2018preliminary,62 title={A Preliminary Study On the Sustainability of Android Malware Detection},63 author={Cai (2018)},64 year={2018},65 note={arXiv:1807.08221}66}67```6869- arXiv: 1807.08221