Best Public Datasets for Malware Classification
The best overall public dataset for training malware classification models is the Microsoft Malware Classification Challenge (BIG 2015) dataset. It offers 10,000 labeled samples with both byte and assembly representations, making it ideal for deep learning and feature engineering. Its size, diversity, and clear benchmark history give it a strong edge over alternatives.
What to Look For
Choosing a malware dataset isn’t just about file count. The criteria that actually matter:
- Label quality: Ground truth must be reliable—ideally from multiple antivirus engines or a known family taxonomy. Mislabeled samples silently corrupt your model.
- File type and format: PE (Windows executables), ELF, PDF, or Android APK? Your model must match the format you plan to deploy on.
- Balance and class distribution: Imbalanced families cause biased predictions. Check whether rare classes are present or if you’ll need to resample.
- Size and storage: Raw binaries can be tens of GB. Consider whether you can store and process them within your compute budget.
- Age and relevance: Malware evolves fast. A 2015 dataset may not reflect current threats; a 2023 one may lack historical context. For research, older benchmarks are fine; for production, you need recent samples.
- Legal and ethical restrictions: Some datasets are restricted to academic use or require a license. Check terms before downloading.
Microsoft Malware Classification Challenge (BIG 2015)
Strengths: This is the gold standard for academic research. It contains 10,000 labeled PE files across 9 families (e.g., Ramnit, Lollipop, Kelihos_ver3, Vundo). Each sample includes raw bytes and assembly code, enabling both static and dynamic feature extraction. The benchmark is well-documented with many published baselines, so you can compare your model’s performance directly.
Trade-offs: The dataset is from 2015, so it’s outdated for current threat detection. Also, the labels are family-level, not malware/goodware—there are no benign samples. You’ll need to source clean executables separately. Storage is ~200 GB uncompressed.
Who it suits: Researchers and students who want a reproducible benchmark for deep learning (CNN, RNN, transformer) on raw bytes or assembly. Also good for feature engineering competitions.
Malimg Dataset
Strengths: A classic image-based dataset: 9,339 grayscale images of malware binaries (converted from PE files) across 25 families. It’s tiny (~2 GB), easy to load, and perfect for computer vision approaches like CNNs. The visual representation is intuitive and allows transfer learning from pre-trained image models.
Trade-offs: Images lose a lot of structural information—you can’t recover opcode sequences or API calls. The dataset is also from 2011, so it’s quite old. Class imbalance exists (some families have very few samples).
Who it suits: Teams exploring image-based malware detection with limited compute. Also good for teaching or prototyping before scaling to raw bytes.
EMBER (Endgame Malware Benchmark for Research)
Strengths: A modern benchmark with 1.1 million PE files (400k benign, 300k malicious, 400k unlabeled) from 2017-2018. Instead of raw bytes, it provides 2,381 features (hashes, imports, section info, etc.) extracted via LIEF. This makes it extremely fast to train classical ML models (XGBoost, Random Forest) without heavy preprocessing. The train/test split is predefined, and the authors provide a baseline model.
Trade-offs: The feature set is fixed—you can’t extract new features without re-running LIEF on the raw binaries (which are not publicly distributed due to size). The unlabeled portion limits semi-supervised learning. Also, it’s Windows PE only.
Who it suits: Practitioners who want to quickly build a baseline classifier with gradient boosting or logistic regression. Also great for feature engineering research.
MalwareBazaar (abuse.ch)
Strengths: A continuously updated, free database of real malware samples (PE, ELF, APK, PDF, etc.) with rich metadata: SHA256, file type, tags, and often family labels from multiple AV engines. You can download samples via API or web interface. It’s the go-to source for fresh, real-world malware.
Trade-offs: It’s not a curated dataset—you must build your own training set. Labels are noisy and sometimes missing. Benign samples are not included; you’ll need to collect clean files separately. Also, downloading live malware carries a risk of accidental infection—use isolated VMs.
Who it suits: Security teams that need current samples for fine-tuning or testing. Also good for building custom datasets with specific families or file types.
Contagio Malware Dumps
Strengths: A collection of curated malware dumps (mostly PDFs and executables) from the Contagio blog. It includes well-documented sets like the PDF malware collection (with labels) and the Drebin Android dataset (a separate but related resource). The PDF set is particularly useful for document-based malware detection.
Trade-offs: The dumps are not uniformly structured—you’ll need to parse and organize them yourself. Some collections are small (hundreds of samples). The site is a bit dated and not actively maintained.
Who it suits: Researchers focused on PDF malware or those needing a quick, small set for proof-of-concept.
VirusShare
Strengths: A massive repository of over 30 million malware samples (mostly PE, but also other formats). Access is free after registration, and you can download by hash or via torrents. It’s the largest source of raw binaries for deep learning at scale.
Trade-offs: No labels—you must classify samples yourself (e.g., via VirusTotal API). Downloading huge amounts requires significant bandwidth and storage (terabytes). Also, the lack of benign samples means you’ll need a separate source for clean files.
Who it suits: Organizations with substantial compute and storage, building large-scale deep learning models from scratch. Also good for pre-training on raw bytes.
How to Choose
Start by defining your use case. For academic research or benchmarking, Microsoft BIG 2015 is the clear choice. For a production baseline on modern PE files, EMBER offers a fast start. For current threat detection, combine MalwareBazaar with your own benign collection. For image-based approaches, Malimg is the easiest.
Your budget matters in two ways: monetary and computational. Free datasets like BIG 2015 and Malimg are great, but they require significant disk space and GPU time for deep learning. EMBER is lightweight and trains in minutes on a CPU. If you have no GPU, stick with EMBER or Malimg.
A common trade-off is age vs. realism. Older datasets are cleaner and well-studied, but they don’t reflect current malware. Newer sources like MalwareBazaar are messy but relevant. For a robust model, consider pre-training on an older benchmark and fine-tuning on recent samples.
Also consider file type. If you need to detect Android malware, look at Drebin or AndroZoo (not covered here). For PDFs, Contagio is your best bet. For ELF (Linux), MalwareBazaar has some, but you may need to curate your own.
Frequently Asked Questions
Can I use these datasets for commercial purposes? Most academic datasets (BIG 2015, Malimg, EMBER) are for research only. MalwareBazaar and VirusShare allow more flexible use, but always check the license. For commercial products, you may need to build your own dataset.
Do I need benign samples? Yes, for binary classification (malware vs. benign). Only EMBER includes benign files. For others, you’ll need to collect clean executables from a trusted source (e.g., your own system or a clean Windows installation).
How do I handle class imbalance? Use techniques like oversampling, class weights, or synthetic data (SMOTE). For BIG 2015, the imbalance is moderate; for Malimg, some families have very few samples—consider merging rare families or using few-shot learning.
What’s the best model for raw bytes? Convolutional neural networks (CNNs) on byte sequences work well, as do transformers. But they require large datasets (like VirusShare). For smaller datasets, feature-based models (EMBER) are more practical.
Are these datasets safe to download? Yes, but handle with care. Store malware in an isolated VM or air-gapped machine. Never execute samples on your host. Use hashes to verify integrity.
Can I combine datasets? Yes, but be careful about format differences and label conflicts. Normalize features and map family labels consistently. Combining EMBER features with MalwareBazaar raw binaries can be powerful but requires effort.
Bottom Line
For most research and benchmarking needs, start with the Microsoft BIG 2015 dataset—it’s the most cited, has clear labels, and offers both byte and assembly views. For a quick, modern baseline, use EMBER. If you need current samples for a production system, pull from MalwareBazaar and supplement with your own benign files. No single dataset is perfect, so plan to combine sources and always validate on fresh data.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.