← Lab /Software

Dynamic analysis detects malicious ML models up to 44% higher F1-score

DynaHug detects malicious pre-trained models more effectively than existing detectors

Software arXiv 21 Apr 2026 Method Prototype evidence Threat model

Published as “Malicious ML Model Detection by Learning Dynamic Behaviors”

Why it matters

Deploying DynaHug can automatically block malicious models before they run on Model Hubs, reducing the risk of reverse shells and data exfiltration.

Summary

DynaHug achieves up to 0.9963 F1-score in detecting malicious PTMs, which is up to 44% higher than existing detectors. It learns benign model behavior via dynamic analysis and one-class SVM, and shows high detection rates (92.8-100% real malicious, 98.07-99.7% synthetic) across three task clusters. Evidence is based on evaluation of over 25,000 models, but static-only variants perform poorly.

What they found 3

  1. High overall detection performance

    “DynaHug is effective in malicious PTM detection across all three (3) clusters (up to 0.9963 F1-score).”

  2. Significant improvement over baselines

    “DynaHug is up to 44% more effective than the detectors in terms of F1-score.”

  3. Dynamic analysis outperforms static analysis

    “dynamic analysis in DynaHug is twice (2x) as effective as static analysis (precision of 0.5 vs. 0.9995).”

Caveats 2

  • Static-only DynaHug achieved only 0.6667 F1-score, far lower than the dynamic version (quote: "Static DynaHug ... 0.6667").
  • Adding sequence or process-sequence features reduced performance (quote: "adding sequence of system calls and/or sequence of system processes leads to poorer performance").

What’s new here 4

  • Learns benign model behavior using dynamic system-call traces rather than static blacklists.
  • Applies task-specific clustering before anomaly detection.
  • Uses one-class SVM on frequency and presence of system calls for unsupervised detection.
  • Demonstrates detection of rare PyPI imports that evade existing blacklists.

Threat model stated by the source

Adversarythird-party model provider or attacker who modifies or supplies a PTM containing arbitrary malicious payloads (e.g., reverse shell)
Capabilitycan upload malicious PTMs to public Model Hubs and rely on users loading them in standard environments
Assumesdefender loads the model following provider instructions without source-code inspection; model under test can be executed in a sandbox; attacker does not use anti-debugging techniques