Hierarchical program graphs
Each APK becomes a two-level program representation: CFGs capture within-function execution structure; an FCG captures relationships between functions.
FCG + CFGClassifying new Android malware families from just a few examples, by learning which functions carry the strongest family-specific signals.
Most functions in an APK are shared utilities or library code. SDL focuses the graph-level representation on functions that distinguish one malware family from another—particularly valuable when labeled examples are scarce.
Each APK becomes a two-level program representation: CFGs capture within-function execution structure; an FCG captures relationships between functions.
FCG + CFGA shared hierarchical GraphSAGE encoder learns representations with instance-level and set-level contrastive pre-training.
Dual contrastive objectivesA TF-IDF-inspired gate emphasizes family-specific functions using support-set similarity and a program-structural prior, then builds few-shot prototypes.
Interpretable · 2 scalarsSDL-Complexity uses CFG cyclomatic complexity. SDL-Degree uses FCG in-degree, and an ablation tests PageRank. The readout's key advantage comes from nonuniform, family-aware function weighting—not from any one chosen prior.
Mean 5-way few-shot classification accuracy on novel families. All compared methods use common family-disjoint evaluation episodes; scores come from Table II of the paper.
SDL-Complexity achieves 83.00% on HiGraph and 92.30% on MalDroid at 5-shot, exceeding the learned Self-Attention head on both.
SDL leads on most settings, but FAMCF is stronger on MalDroid 1-shot (83.64% versus SDL's 80.79%). Strong flat API features can still be competitive.
The study retains the subset of samples processable by all baseline pipelines, with disjoint training, validation, and novel-family partitions.
| Corpus | Base | Validation | Novel | Total APKs |
|---|---|---|---|---|
| HiGraph | 50 families | 16 | 18 | 34,006 |
| MalDroid | 15 families | 5 | 5 | 7,676 |
| KronoDroid | 27 families | 8 | 8 | 5,750 |
| Combined | 92 | 29 | 31 | 47,432 |
The public repository provides the hierarchical encoder, SDL variants, baselines, datasets' family labels and mappings, scripts, and evaluation tooling.
Hierarchical GraphSAGE, SDL weighting, baselines, and the end-to-end pipeline.
Open repository ↗ Docs · READMEData preparation, installation, training, configuration, and evaluation commands.
Read instructions ↗ Data · LabelsPer-corpus labeled samples and malware-family mapping files.
Browse labels ↗ Python · ModelsFunction encoder, episodic heads, pooling comparisons, and analysis tools.
Explore source ↗ Shell · WorkflowsScripts for full training, model comparisons, and temporal evaluation.
Browse scripts ↗ NDSS 2027 · PaperRead the paper offline using the bundled PDF, or copy its bibliographic entry.
Go to citation ↓# Prepare local environment git clone https://github.com/calebdeji/not-all-functions-are-equal.git cd not-all-functions-are-equal pip install -r requirements.txt # After obtaining APK datasets and completing README preprocessing bash scripts/run_training.sh bash scripts/run_evaluation.sh
Raw APKs are not included in the repository. The README specifies dataset acquisition, graph extraction, feature generation, and required splits before training.
If this code or method supports your research, please cite the associated conference paper.
@inproceedings{ogunwale2027functions,
title = {Not All Functions Are Equal: Adaptive Node
Weighting for Few-Shot Android Malware Family
Classification},
author = {Ogunwale, Pelumi and Hmaiti, Yohan and
LaViola Jr., Joseph J. and Mohaisen, David},
booktitle = {Proceedings of the Network and Distributed
System Security Symposium (NDSS)},
year = {2027},
doi = {10.14722/ndss.2027.233235}
}Adaptive Node Weighting for Few-Shot Android Malware Family Classification
Pelumi Ogunwale, Yohan Hmaiti, Joseph J. LaViola Jr., and David Mohaisen.
PDF is embedded in this single HTML file, so the download also works offline. The DOI may not resolve until the conference publishes its proceedings.