File size: 8,897 Bytes
9f0e5e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b063992
9f0e5e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b063992
9f0e5e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b063992
9f0e5e3
 
 
 
 
b063992
9f0e5e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
---
language:
- en
pretty_name: BODMAS Cleaned
task_categories:
- tabular-classification
tags:
- cybersecurity
- malware
- static-analysis
- pe-files
- malware-detection
- malware-family-classification
- concept-drift
- temporal-analysis
- tabular
- ai-ready
- tabular-classification
size_categories:
- 100K<n<1M
---
 
# BODMAS Cleaned
 
BODMAS Cleaned is a cleaned and analysis-ready version of the original **BODMAS (Blue Hexagon Open Dataset for Malware Analysis)** dataset.
 
The original BODMAS dataset was introduced for machine-learning-based static malware analysis on Windows Portable Executable (PE) files, with support not only for binary malware detection but also for **temporal analysis** and **malware family studies**. This cleaned release preserves that analytical value while making the data easier to load, validate, and reuse.
 
Compared with the original source asset, this release removes duplicate samples, drops constant features, standardizes metadata, and preserves both timestamp and family information. Each sample is represented as a fixed-length numerical vector extracted statically from the original PE file, without executing the binary.
 
## Original dataset
 
This dataset is a cleaned derivative of the original BODMAS dataset:
 
- **Original name:** BODMAS (Blue Hexagon Open Dataset for Malware Analysis)
- **Original providers:** University of Illinois at Urbana-Champaign (UIUC) / Blue Hexagon
- **Original paper:** Yang et al. (2021). *BODMAS: An Open Dataset for Learning based Temporal Analysis of PE Malware*
- **Original paper link:** https://liminyang.web.illinois.edu/data/DLS21_BODMAS.pdf
- **Original website/repository:** https://whyisyoung.github.io/BODMAS/
 
Please cite the original BODMAS paper when using this cleaned release in research.
 
## Files
 
| File | Description |
|---|---|
| `bodmas_clean.npz` | Index file with row/feature counts and file references |
| `bodmas_clean_X.npy` | Feature matrix (`float32`), raw memmap, shape `(134428, 2326)` |
| `bodmas_clean_y.npy` | Label vector (`int32`), `0 = benign`, `1 = malware` |
| `bodmas_clean_metadata.parquet` | Per-sample metadata: SHA-256, timestamps, family fields, and quality flags |
| `manifest.json` | Versioned manifest with checksums and artifact references |
| `bodmas_cleaned_dataset.ipynb` | Exploration and usage notebook |
 
## What’s in the dataset?
 
This cleaned release contains a fully labeled static malware dataset derived from the original BODMAS collection.
 
### Core contents
 
- **134,428 labeled samples**
- **2,326 numerical features**
- feature dtype: `float32`
- label dtype: `int32`
- labels:
  - `0` = benign
  - `1` = malware
 
### Label distribution
 
- **77,138 benign samples**
- **57,290 malware samples**
 
### Metadata retained
 
The cleaned metadata preserves the fields that make BODMAS especially useful for temporal and family-aware analysis, including:
 
- `sha256`
- `timestamp`
- `family`
- `record_id`
- `sample_id`
- `label_int`
- `label_str`
- `timestamp_raw`
- `hash_type`
- `bodmas_family`
- `flag_sha256`
- `flag_timestamp_missing`
- `flag_family_missing`
- `flag_is_benign`
- `feature_hash`
 
### Family information
 
- **580 unique malware families** are present in the cleaned dataset
- the family distribution is skewed:
  - top 5 families cover **35.5%** of malware samples
  - top 20 families cover **69.4%** of malware samples
 
### Feature representation
 
Samples are not raw executables. Each file is represented as a **fixed-length static feature vector** extracted from the original PE file. These features describe structural and statistical properties of the binary, such as:
 
- PE headers
- sections
- imports
- entropy-related information
- histogram-based characteristics
 
## Cleaning summary
 
This release is the output of a quality-control and harmonization pipeline applied to the original BODMAS artifacts.
 
Main processing steps:
 
1. **Duplicate removal**
2. **Constant-feature filtering**, reducing the feature space from 2,381 to **2,326**
3. **Metadata standardization**
4. **Missing-value normalization and quality flagging**
5. **Family/label consistency checks**
6. **Manifest generation** for reproducibility and integrity checks
 
Summary of the cleaned release:
 
- original source size: **134,435 labeled samples**
- final cleaned size: **134,428 samples**
- final feature space: **2,326 features**
- **no separate unlabeled split**
- timestamps and malware family metadata preserved
 
In the cleaned metadata, family-label consistency is also checked using the BODMAS convention that empty family values correspond to benign samples, while non-empty family values correspond to malware samples.
 
## File structure
 
```text
BODMAS_cleaned/
├── bodmas_clean.npz
├── bodmas_clean_X.npy
├── bodmas_clean_y.npy
├── bodmas_clean_metadata.parquet
└── manifest.json
```
 
The `.npz` index stores `_rows` and `_features` for reliable loading.  
The feature matrix is a raw memmap-backed array and should be loaded with explicit dtype and shape.
 
Unlike EMBER Cleaned, there is **no separate unlabeled split** in BODMAS Cleaned.
 
## Requirements
 
To run the quickstart examples, install the minimum required dependencies:
 
```bash
pip install numpy pandas pyarrow
```
 
For notebook-based exploration and basic visualization, you may also install:
 
```bash
pip install jupyter matplotlib seaborn scikit-learn
```
 
## Quickstart
 
This example loads the labeled BODMAS Cleaned dataset and checks that features, labels, and metadata are consistent and ready for supervised use.
 
```python
import numpy as np
import pandas as pd
 
idx = np.load("bodmas_clean.npz", allow_pickle=True)
n_rows = int(idx["_rows"])
n_features = int(idx["_features"])
 
X = np.fromfile("bodmas_clean_X.npy", dtype=np.float32)
assert X.size == n_rows * n_features, (
    f"Unexpected X size: got {X.size}, expected {n_rows * n_features}"
)
X = X.reshape(n_rows, n_features)
 
meta = pd.read_parquet("bodmas_clean_metadata.parquet")
y = meta["label_int"].to_numpy(dtype=np.int32, copy=False)
 
print(
    f"Dataset: {X.shape[0]} samples, {X.shape[1]} features | "
    f"labels: {len(y)} | metadata columns: {meta.shape[1]}"
)
 
assert X.shape[0] == len(y) == len(meta)
assert set(np.unique(y)) == {0, 1}
 
print("Unique labels:", np.unique(y))
print("Metadata columns:", meta.columns.tolist())
print("All checks passed.")
```
 
## Notebook
 
The repository also includes an exploration notebook in `.ipynb` format, designed to provide additional context on the cleaned dataset, its structure, and its main analytical use cases.
 
The notebook can be used to:
 
- inspect the labeled dataset
- explore metadata fields, timestamps, and family distributions
- validate dataset consistency
- review temporal and family-aware analyses
- explore example downstream use cases
 
To open it locally, run:
 
```bash
jupyter notebook bodmas_cleaned_dataset.ipynb
```
 
or, if you use JupyterLab:
 
```bash
jupyter lab bodmas_cleaned_dataset.ipynb
```
 
Make sure to open the notebook from the dataset root directory so that relative file paths resolve correctly.
 
 
## Typical use cases
 
BODMAS Cleaned supports:
 
- binary malware detection
- malware family classification
- temporal analysis
- concept drift studies
- time-aware validation
- family distribution analysis
- feature importance analysis
 
The accompanying notebook includes loading, exploratory data analysis, temporal and family analysis, and example use cases focused on discriminative signal and model evaluation.
 
## Notes and limitations
 
- This is a **static-analysis** dataset only.
- The cleaned release contains **derived features**, not raw PE binaries.
- Family names are dataset-specific and should not be treated as a universal malware ontology.
- Temporal metadata should be respected during evaluation to avoid leakage.
- Family distribution is concentrated, so downstream family-level evaluation should account for skew.
- The dataset is intended for defensive research, benchmarking, and education.
 
## License
 
This cleaned release is derived from BODMAS. The original BODMAS data files are associated with the BSD-2 License. Please verify that your downstream redistribution and reuse remain aligned with the original BODMAS terms.
 
## References
 
If you use this dataset, please cite the original BODMAS paper:
 
```bibtex
@inproceedings{yang2021bodmas,
  title={BODMAS: An Open Dataset for Learning based Temporal Analysis of PE Malware},
  author={Yang, Limin and others},
  booktitle={Proceedings of the 2021 ACM Workshop on Data-Limited Security Research},
  year={2021}
}
```
 
APA:
 
Yang, L., et al. (2021). *BODMAS: An Open Dataset for Learning based Temporal Analysis of PE Malware*. In *Proceedings of the 2021 ACM Workshop on Data-Limited Security Research*.
 
## Contacts

- **Shared by:** ACN