ML scanner detects malicious pickle models with 90% F1, beating existing tools
The authors claim their lightweight ML-based scanner outperforms prior defenses in detecting malicious pickle-serialized models
AI/ML arXiv 23 Feb 2026 Defense Prototype evidence
Published as “SafePickle: Robust and Generic ML Detection of Malicious Pickle-based ML Models”
Why it matters
The sub-millisecond detection speed and high F1 make SafePickle practical for real-time scanning pipelines in model hubs and CI/CD workflows.
Summary
SafePickle’s RandomForest model reaches 90.01% F1 on a 727-model curated Hugging Face dataset, far surpassing existing scanners that only reach 7.23-62.75% F1, and it detects all 9 evasive Hide-and-Seek samples while running in under 1 ms per file. The evaluation spans four datasets (curated, PickleBall, Hide-and-Seek, malware) and shows strong cross-dataset generalization. However, the paper notes labeling uncertainty and reliance on default hyper-parameters, and unsupervised variants achieve lower scores. The evidence is based on real-world Hugging Face models and public benchmark datasets, compared against picklescan, ClamAV, Fickling, ModelScan, VirusTotal, and PickleBall.
What they found 2
- RandomForest model achieves 90.01% F1 on the curated dataset, far above SOTA scanners.
“Our best model achieves 90.01% F1-Score on our dataset compared with 7.23%-62.75% achieved by the SOTA scanners”
- SafePickle detects all 9 evasive malicious models from Hide-and-Seek while scanners fail.
“it correctly detects all 9/9 evasive malicious models from Hide-and-Seek [25] which SOTA scanners fail to scan.”
Caveats 6
- PickleScan shows 0.00% true-negative rate and only 19.15% F1, indicating high false-positive behavior.
- quote: "TN (%) ... 0.00"
- quote: "F1 (%) ... 19.15"
- Labeling Pickle-based files typically requires the use of existing analysis tools, but however, none of these existing tools can be considered fully trustworthy. This risk of contaminating the dataset with inaccuracies, which in turn may negatively impact model performance.
- We used the default hyperparameters in all our experiments in our classifiers, we leave the optimization of hyperparameters to future work.
- We cannot publish the code of our experiments since it is proprietary.
What’s new here 3
- Applies supervised and unsupervised ML to static opcode features for Pickle malware detection, eliminating need for per-library policies.
- Demonstrates detection of all 9 evasive Hide-and-Seek samples that defeat existing scanners.
- Achieves sub-millisecond inference latency, orders of magnitude faster than traditional scanners.