-
Notifications
You must be signed in to change notification settings - Fork 1
AI ML Models
Emirhan Uçan edited this page Jul 17, 2026
·
13 revisions
HydraDragonAV Mobile employs an ONNX-based binary classifier for APK malware detection, plus a Java-side logistic regression heuristic (AIEngine).
APK feature extraction → 256-dimensional vector → tract-onnx inference:
-
Feature extraction (
features.rs): harvests printable ASCII + UTF-16LE strings fromAndroidManifest.xml,resources.arsc, allclasses*.dex, andMETA-INF/*. Produces a 256-d feature-hashed, L2-normalized vector. -
ONNX model (
model.onnx): a neural network trained offline on malware + benign APK corpora. Returns a confidence score (0.0–1.0). -
Threshold: default 0.5; configurable via
Model::set_threshold().
hydradragonml/
├── src/
│ ├── lib.rs # Model loading + inference (tract-onnx)
│ ├── features.rs # APK feature extraction (256-d vector)
│ └── main.rs # Dataset scanner CLI (hydradragonml-scan)
└── Cargo.toml
A standalone binary that batch-scans the entire dataset/ folder:
cargo run --release --bin hydradragonml-scan -- `
--dataset ..\dataset\ `
--model ..\app\src\main\assets\scan\model.onnx `
--whitelist ..\app\src\main\assets\scan\whitelist.xf `
--packages ..\app\src\main\assets\scan\whitelist_packages.db `
--threshold 0.5Scan pipeline per APK:
| Step | Check | ML Skipped? | Signature |
|---|---|---|---|
| 1 | NSRL hash whitelist (whitelist.xf) |
❌ (stats only) | NSRL.Whitelist |
| 2 | Package whitelist (whitelist_packages.db) |
❌ (stats only) | Package.Whitelist |
| 3 | ONNX model (model.onnx) |
❌ |
ML.Benign / ML.Malware
|
Output includes per-file verdict, matching signatures, package name, MD5, and a summary with accuracy / precision / recall / F1 vs folder labels.
- Detects zero-day malware that shares no signatures with known threats
- No training on the device — model is pre-trained offline
- Low false positive rate when combined with NSRL whitelisting
A lightweight logistic-regression classifier that operates on DEX-level features:
| Feature | Description |
|---|---|
| Obfuscation Score | Reflection, string encryption, dynamic class loading |
| Dynamic Loading |
DexClassLoader, PathClassLoader usage patterns |
| API Usage | Crypto (Cipher, SecretKey), sockets, Runtime.exec()
|
| Adware SDKs | Known ad/monetization SDK fingerprints |
| Dangerous Permissions | Count and combination analysis |
The AIEngine produces a continuous score (0.0–1.0). Thresholds are configurable:
-
< 0.3: Clean -
0.3–0.7: Suspicious (further analysis triggered) -
> 0.7: Malicious (immediate action)
- Detection-Engines — Overview of all engines
- Data-Pipeline — Training data generation
- NSRL-Whitelisting — Whitelist system used during scanning