Malicious ML Model Detection by Learning Dynamic Behaviors
Sarang Nambiar, Dhruv Pradhan, Ezekiel Soremekun
TLDR
DynaHug detects malicious pre-trained ML models by learning benign models' dynamic runtime behaviors, outperforming static analysis.
Key contributions
- Addresses limitations of static analysis in detecting malicious ML models.
- Proposes DynaHug, using dynamic analysis and one-class SVM to learn benign model behaviors.
- Evaluated on over 25,000 models from Hugging Face and MalHug.
- Outperforms state-of-the-art detectors by up to 44% in F1-score.
Why it matters
The proliferation of pre-trained models from hubs introduces significant security risks due to potential malicious code execution. DynaHug offers a robust solution by dynamically analyzing model behaviors, significantly improving detection rates. This enhances the trustworthiness and safety of the ML supply chain for users.
Original Abstract
Pre-trained machine learning models (PTMs) are commonly provided via Model Hubs (e.g., Hugging Face) in standard formats like Pickles to facilitate accessibility and reuse. However, this ML supply chain setting is susceptible to malicious attacks that are capable of executing arbitrary code on trusted user environments, e.g., during model loading. To detect malicious PTMs, state-of-the-art detectors (e.g., PickleScan) rely on rules, heuristics, or static analysis, but ignore runtime model behaviors. Consequently, they either miss malicious models due to under-approximation (blacklisting) or miscategorize benign models due to over-approximation (static analysis or whitelisting). To address this challenge, we propose a novel technique (DynaHug) which detects malicious PTMs by learning the behavior of benign PTMs using dynamic analysis and machine learning (ML). DynaHug trains an ML classifier (one-class SVM (OCSVM)) on the runtime behaviours of task-specific benign models. We evaluate DynaHug using over 25,000 benign and malicious PTMs from different sources including Hugging Face and MalHug. We also compare DynaHug to several state-of-the-art detectors including static, dynamic and LLM-based detectors. Results show that DynaHug is up to 44% more effective than existing baselines in terms of F1-score. Our ablation study demonstrates that our design decisions (dynamic analysis, OCSVM, clustering) contribute positively to DynaHug's effectiveness.
📬 Weekly AI Paper Digest
Get the top 10 AI/ML arXiv papers from the week — summarized, scored, and delivered to your inbox every Monday.