cycloevan commited on
Commit
b641012
Β·
verified Β·
1 Parent(s): beef6da

Translate model card to English + correct sizes/params/arch/citation

Browse files
Files changed (1) hide show
  1. README.md +126 -123
README.md CHANGED
@@ -18,138 +18,140 @@ library_name: onnxruntime
18
 
19
  # EMBER2024 Malware Detection Models
20
 
21
- 4μ’… λͺ¨λΈ μ•„ν‚€ν…μ²˜(DNN, TabNet, Hybrid GBDT2NN, LightGBM)λ₯Ό [EMBER2024](https://huggingface.co/datasets/joyce8/EMBER2024) λ°μ΄ν„°μ…‹μ˜ 8개 파일 νƒ€μž… subset 전체에 λŒ€ν•΄ ν•™μŠ΅Β·ν‰κ°€ν•˜κ³  배포 κ°€λŠ₯ν•œ 포맷으둜 λ³€ν™˜ν•œ λͺ¨λΈ μ»¬λ ‰μ…˜μž…λ‹ˆλ‹€.
22
 
23
- > **ν•™μŠ΅ ν™˜κ²½**: NVIDIA DGX Spark (GB10 Grace Blackwell, 128 GB 톡합 λ©”λͺ¨λ¦¬, CUDA 13)
24
- > **μ½”λ“œ**: [github.com/evan0416/ember-ml](https://github.com/evan0416/ember-ml)
25
- > **데이터셋 λ…Όλ¬Έ**: [Joyce et al., KDD 2025 (arXiv:2506.05074)](https://arxiv.org/abs/2506.05074)
26
 
27
  ---
28
 
29
- ## λͺ¨λΈ ꡬ성
30
 
31
- | 디렉토리 | μ•„ν‚€ν…μ²˜ | 배포 포맷 | νŒŒλΌλ―Έν„° |
32
- |---------|---------|---------|---------|
33
- | `dnn/` | Feed-Forward DNN (PReLU + Dropout) | ONNX (INT8 Static / FP32) | 13.2 M (PE) / 0.73 M (non-PE) |
34
  | `tabnet/` | TabNet ([Arik & Pfister, 2021](https://arxiv.org/abs/1908.07442)) | ONNX FP32 | ~3 M |
35
  | `hybrid/` | GBDT2NN ([DeepGBM, KDD 2019](https://www.microsoft.com/en-us/research/publication/deepgbm-a-deep-learning-framework-distilled-by-gbdt-for-online-prediction-tasks/)) | ONNX (nn_part) + LightGBM booster | ~1 M NN |
36
- | `lightgbm/` | LightGBM (μ‚¬μ „ν•™μŠ΅, [joyce8/EMBER2024-benchmark-models](https://huggingface.co/joyce8/EMBER2024-benchmark-models)) | Treelite `.tl` | β€” |
37
 
38
- ### Subset λͺ©λ‘
39
 
40
- | Subset | λŒ€μƒ 파일 νƒ€μž… | μž…λ ₯ 차원 |
41
- |--------|-------------|---------|
42
- | `PE` | PE λ°”μ΄λ„ˆλ¦¬ 전체 (Win32 + Win64 + .NET) | 2,568 |
43
  | `Win32` | Windows 32-bit PE | 2,568 |
44
  | `Win64` | Windows 64-bit PE | 2,568 |
45
- | `.NET` | .NET μ–΄μ…ˆλΈ”λ¦¬ | 2,568 |
46
  | `APK` | Android APK | 696 |
47
  | `ELF` | Linux ELF | 696 |
48
- | `PDF` | PDF λ¬Έμ„œ | 696 |
49
- | `all` | 전체 파일 νƒ€μž… ν˜Όν•© | 2,568 |
50
 
51
  ---
52
 
53
- ## 디렉토리 ꡬ쑰
54
 
55
- 파일λͺ… κ·œμΉ™: `{λͺ¨λΈ}_{subset}[_suffix].{ext}`
56
- `.NET` subset은 파일λͺ…μ—μ„œ `dotnet`으둜 λ³€ν™˜λ©λ‹ˆλ‹€.
57
 
58
  ```
59
  dnn/
60
- β”œβ”€β”€ dnn_PE.onnx # INT8 Static (배포용, PE/Win32/Win64/dotnet/all)
61
- β”œβ”€β”€ dnn_PE_fp32.onnx # FP32 ONNX (참쑰용, INT8 κ³„μ—΄λ§Œ μΆ”κ°€ 포함)
62
- β”œβ”€β”€ dnn_PE.pt # PyTorch 체크포인트
63
- β”œβ”€β”€ dnn_PE_metrics.json # 평가 κ²°κ³Ό (AUC, TPR@1%FPR)
64
- β”œβ”€β”€ dnn_PE_benchmark.json # ν¬κΈ°Β·λ ˆμ΄ν„΄μ‹œ
65
- β”œβ”€β”€ dnn_APK.onnx # FP32 (non-PE β€” INT8 AUC 손싀 κ³Όλ‹€)
66
  β”œβ”€β”€ dnn_APK.pt
67
  └── ...
68
 
69
  tabnet/
70
- β”œβ”€β”€ tabnet_PE.onnx # FP32 ONNX (134 MB β€” sparsemax 언폴딩)
71
- β”œβ”€β”€ tabnet_PE.zip # pytorch-tabnet λ„€μ΄ν‹°λΈŒ (7 MB, κ²½λŸ‰)
72
  └── ...
73
 
74
  hybrid/
75
  β”œβ”€β”€ hybrid_PE_nnpart.onnx # GBDT2NN nn_part ONNX (5.1 MB)
76
  β”œβ”€β”€ hybrid_PE_lgbm.model # LightGBM booster (3.6 MB)
77
- β”œβ”€β”€ hybrid_PE.pt # PyTorch 체크포인트
78
  └── ...
79
 
80
  lightgbm/
81
- β”œβ”€β”€ lightgbm_PE.tl # Treelite 직렬화 (ν”Œλž«νΌ 독립, 재컴파일 ν•„μš”)
82
  └── ...
83
  ```
84
 
85
  ---
86
 
87
- ## μ„±λŠ₯ κ²°κ³Ό (EMBER2024 test set)
88
 
89
- > 평가 κΈ°μ€€: ROC-AUC, TPR @ 1% FPR (λ…Όλ¬Έ Β§4.1), challenge set detection rate @ FPR=1% μž„κ³„κ°’
90
- > Challenge set: 6,315 evasive malware (μ–‘μ„± only, Win32 3,225 / .NET 829 / Win64 814 / PDF 805 / ELF 386 / APK 256)
91
 
92
  ### DNN
93
 
94
- | Subset | ROC-AUC | TPR@1%FPR | 배포 포맷 | 크기 |
95
- |--------|---------|----------|---------|------|
96
- | PE | 0.9969 | 0.9539 | INT8 Static ONNX | 13.3 MB |
97
- | Win32 | 0.9966 | 0.9468 | INT8 Static ONNX | 13.3 MB |
98
- | Win64 | 0.9969 | 0.9656 | INT8 Static ONNX | 13.3 MB |
99
- | .NET | 0.9939 | 0.8976 | INT8 Static ONNX | 13.3 MB |
100
- | all | 0.9942 | 0.9103 | INT8 Static ONNX | 13.3 MB |
101
  | APK | 0.9761 | 0.7682 | FP32 ONNX | 3.9 MB |
102
  | ELF | 0.9840 | 0.8103 | FP32 ONNX | 3.9 MB |
103
  | PDF | 0.9795 | 0.8902 | FP32 ONNX | 3.9 MB |
104
 
105
- > non-PE(APK/ELF/PDF)λŠ” μž…λ ₯ 696-dim, νŒŒλΌλ―Έν„° 수 λΆ€μ‘±μœΌλ‘œ INT8 AUC 손싀이 ν¬λ―€λ‘œ FP32 μœ μ§€.
 
 
106
 
107
  ### TabNet
108
 
109
- | Subset | ROC-AUC | TPR@1%FPR | 배포 포맷 | 크기 |
110
- |--------|---------|----------|---------|------|
111
- | PE | 0.9951 | 0.9212 | FP32 ONNX | 134 MB |
112
- | Win32 | 0.9949 | 0.9322 | FP32 ONNX | 134 MB |
113
- | Win64 | 0.9946 | 0.9323 | FP32 ONNX | 134 MB |
114
- | .NET | 0.9925 | 0.8702 | FP32 ONNX | 134 MB |
115
- | all | 0.9922 | 0.8912 | FP32 ONNX | 134 MB |
116
  | APK | 0.9741 | 0.7028 | FP32 ONNX | 13.5 MB |
117
  | ELF | 0.9793 | 0.5460 | FP32 ONNX | 13.5 MB |
118
  | PDF | 0.9810 | 0.8597 | FP32 ONNX | 13.5 MB |
119
 
120
- > PE 계열 ONNX 크기 134 MB: sparsemax attention loop이 ONNX κ·Έλž˜ν”„λ‘œ μ–Έν΄λ”©λ˜λŠ” ꡬ쑰적 νŠΉμ„±. 크기 μš°μ„ μ΄λ©΄ `tabnet_model.zip`(7 MB) 직접 μ‚¬μš© ꢌμž₯.
121
 
122
  ### Hybrid (GBDT2NN)
123
 
124
- | Subset | ROC-AUC | TPR@1%FPR | 배포 포맷 | 크기 |
125
- |--------|---------|----------|---------|------|
126
- | PE | 0.9982 | 0.9752 | nn_part ONNX + LightGBM booster | 5.1 + 3.6 MB |
127
- | Win32 | 0.9981 | 0.9747 | nn_part ONNX + LightGBM booster | 5.1 + 3.6 MB |
128
- | Win64 | 0.9983 | 0.9812 | nn_part ONNX + LightGBM booster | 5.1 + 3.6 MB |
129
- | .NET | 0.9961 | 0.9466 | nn_part ONNX + LightGBM booster | 5.1 + 3.5 MB |
130
- | all | 0.9970 | 0.9528 | nn_part ONNX + LightGBM booster | 5.1 + 3.6 MB |
131
- | APK | 0.9821 | 0.8003 | nn_part ONNX + LightGBM booster | 5.1 + 3.5 MB |
132
- | ELF | 0.9899 | 0.8827 | nn_part ONNX + LightGBM booster | 5.1 + 3.6 MB |
133
- | PDF | 0.9879 | 0.9283 | nn_part ONNX + LightGBM booster | 5.1 + 3.6 MB |
134
-
135
- ### LightGBM (Treelite 컴파일)
136
-
137
- | Subset | ROC-AUC | TPR@1%FPR | 크기 (.tl) | 크기 (원본 .model) |
138
- |--------|---------|----------|-----------|-----------------|
139
- | PE | 0.9983 | 0.9707 | 5.3 MB | 3.6 MB |
140
- | Win32 | 0.9984 | 0.9736 | 5.3 MB | 3.6 MB |
141
- | Win64 | 0.9989 | 0.9831 | 5.3 MB | 3.6 MB |
142
- | .NET | 0.9980 | 0.9566 | 5.3 MB | 3.5 MB |
143
- | all | 0.9968 | 0.9440 | 5.3 MB | 3.6 MB |
144
- | APK | 0.9861 | 0.8157 | 5.3 MB | 3.5 MB |
145
- | ELF | 0.9929 | 0.9140 | 5.3 MB | 3.6 MB |
146
- | PDF | 0.9913 | 0.9275 | 5.3 MB | 3.6 MB |
147
-
148
- > 원본 LightGBM λͺ¨λΈ: [joyce8/EMBER2024-benchmark-models](https://huggingface.co/joyce8/EMBER2024-benchmark-models). `.tl`은 Treelite 3.9.1둜 μ§λ ¬ν™”λœ ν”Œλž«νΌ 독립 파일 β€” 각 ν”Œλž«νΌμ—μ„œ 재컴파일 ν•„μš”.
149
 
150
  ### Challenge Set Detection Rate
151
 
152
- > Challenge set: 6,315 evasive malware (μ „λΆ€ μ–‘μ„±). test set FPR=1% μž„κ³„κ°’ 적용.
153
 
154
  | Subset | DNN | TabNet | Hybrid | LightGBM |
155
  |--------|-----|--------|--------|----------|
@@ -164,11 +166,11 @@ lightgbm/
164
 
165
  ---
166
 
167
- ## μΆ”λ‘  μ„±λŠ₯ (Apple M1, darwin-arm64)
168
 
169
- > `warm_batch1` λ ˆμ΄ν„΄μ‹œ: 배치 크기=1, μΊμ‹œ μ›œμ—… ν›„ μΈ‘μ •. 배포 ν™˜κ²½(x86_64 Linux)κ³Ό λ‹€λ₯Ό 수 있음.
170
 
171
- ### λ ˆμ΄ν„΄μ‹œ (ms, warm batch=1)
172
 
173
  | Subset | DNN | TabNet | Hybrid | LightGBM |
174
  |--------|-----|--------|--------|----------|
@@ -181,32 +183,32 @@ lightgbm/
181
  | `Win64`| 0.220 | 5.621 | 0.422 | 0.039 |
182
  | `all` | 0.254 | 4.788 | 0.147 | 0.068 |
183
 
184
- > TabNet λ ˆμ΄ν„΄μ‹œ λ†’μŒ: sparsemax attention이 ONNX κ·Έλž˜ν”„λ‘œ μ–Έν΄λ”©λ˜λŠ” ꡬ쑰적 νŠΉμ„±.
185
- > Hybrid = nn_part ONNX μΆ”λ‘ λ§Œ μΈ‘μ • (LightGBM leaf extraction μ œμ™Έ).
186
- > LightGBM λ ˆμ΄ν„΄μ‹œ = 컴파일 `.dylib` κΈ°μ€€; μ—…λ‘œλ“œ νŒŒμΌμ€ `.tl` (재컴파일 ν•„μš”).
187
 
188
- ### λͺ¨λΈ 파일 크기 (배포 포맷)
189
 
190
  | Subset | DNN | TabNet `.onnx` | TabNet `.zip` | Hybrid (nn+lgbm) | LightGBM `.tl` |
191
- |--------|-----|----------------|---------------|-------------------|----------------|
192
- | PE 계열 | 13.3 MB (INT8) | 140.2 MB | 7.4 MB | 5.3 + 3.8 MB | 5.3 MB |
193
- | non-PE | 3.9 MB (FP32) | 13.5 MB | 3.2 MB | 5.3 + 3.7 MB | 5.3 MB |
194
 
195
  ---
196
 
197
- ## μ‚¬μš© 방법
198
 
199
- ### μ˜μ‘΄μ„± μ„€μΉ˜
200
 
201
  ```bash
202
  pip install onnxruntime>=1.20 numpy
203
- # LightGBM / Hybrid μΆ”λ‘  μ‹œ
204
  pip install "treelite==3.9.1" "treelite_runtime==3.9.1" lightgbm>=4.6
205
- # TabNet 체크포인트 직접 μ‚¬μš© μ‹œ
206
  pip install pytorch-tabnet>=4.1
207
  ```
208
 
209
- ### DNN μΆ”λ‘  (ONNX Runtime)
210
 
211
  ```python
212
  import numpy as np
@@ -238,7 +240,7 @@ X = np.random.randn(1, 696).astype(np.float32) # non-PE: dim=696
238
  prob = 1 / (1 + np.exp(-sess.run(["logit"], {"features": X})[0].ravel()))
239
  ```
240
 
241
- ### TabNet μΆ”λ‘  (ONNX Runtime)
242
 
243
  ```python
244
  import numpy as np
@@ -251,12 +253,12 @@ model_path = hf_hub_download(
251
  )
252
  sess = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
253
  X = np.random.randn(1, 2568).astype(np.float32)
254
- # 좜λ ₯: logit (sigmoid μ „)
255
  logit = sess.run(["logit"], {"features": X})[0]
256
  prob = 1 / (1 + np.exp(-logit.ravel()))
257
  ```
258
 
259
- ### Hybrid μΆ”λ‘  (ONNX + LightGBM)
260
 
261
  ```python
262
  import numpy as np
@@ -264,7 +266,7 @@ import lightgbm as lgb
264
  import onnxruntime as ort
265
  from huggingface_hub import hf_hub_download
266
 
267
- # 1. LightGBM booster둜 leaf indices μΆ”μΆœ
268
  booster = lgb.Booster(model_file=hf_hub_download(
269
  repo_id="cycloevan/ember-model",
270
  filename="hybrid/hybrid_PE_lgbm.model",
@@ -272,7 +274,7 @@ booster = lgb.Booster(model_file=hf_hub_download(
272
  X_raw = np.random.randn(1, 2568).astype(np.float64)
273
  leaf_indices = booster.predict(X_raw, pred_leaf=True).astype(np.int64) # (N, n_trees)
274
 
275
- # 2. GBDT2NN ONNX둜 μ΅œμ’… λΆ„λ₯˜
276
  nn_sess = ort.InferenceSession(hf_hub_download(
277
  repo_id="cycloevan/ember-model",
278
  filename="hybrid/hybrid_PE_nnpart.onnx",
@@ -282,10 +284,10 @@ prob = 1 / (1 + np.exp(-logit.ravel()))
282
  print(f"malware probability: {prob[0]:.4f}")
283
  ```
284
 
285
- ### LightGBM μΆ”λ‘  (Treelite 컴파일 β€” λΉ λ₯Έ μΆ”λ‘ )
286
 
287
  ```python
288
- # 1. Treelite .tl β†’ ν”Œλž«νΌλ³„ 곡유 라이브러리 컴파일 (졜초 1회)
289
  import treelite, treelite_runtime, sys, numpy as np
290
  from huggingface_hub import hf_hub_download
291
 
@@ -302,58 +304,59 @@ tl_model.export_lib(
302
  verbose=False,
303
  )
304
 
305
- # 2. μΆ”λ‘ 
306
  predictor = treelite_runtime.Predictor(lib_path, verbose=False)
307
  X = np.random.randn(1, 2568).astype(np.float32)
308
  prob = predictor.predict(treelite_runtime.DMatrix(X))
309
  print(f"malware probability: {prob[0]:.4f}")
310
  ```
311
 
312
- > **주의**: `treelite==3.9.1` + `treelite_runtime==3.9.1` ν•„μš”. 4.xλŠ” `export_lib()` 미지원.
313
 
314
  ---
315
 
316
- ## ν•™μŠ΅ 및 평가 ν™˜κ²½
317
 
318
- | ν•­λͺ© | λ‚΄μš© |
319
- |------|------|
320
- | 데이터셋 | [EMBER2024](https://huggingface.co/datasets/joyce8/EMBER2024) β€” train 52μ£Ό(2.6 M), test 12μ£Ό(606 K), challenge 6,315 |
321
- | Feature 차원 | PE 2,568 (v3) / non-PE 696 (유효 prefix) |
322
- | Split μ •μ±… | μ‹œκ°„μ  μˆœμ„œ κ³ μ • (temporal split), μž„μ˜ μ…”ν”Œ μ—†μŒ |
323
- | ν•™μŠ΅ ν™˜κ²½ | DGX Spark (GB10 Grace Blackwell, 128 GB, CUDA 13) |
324
- | ν”„λ ˆμž„μ›Œν¬ | PyTorch 2.11.0, pytorch-tabnet 4.1, LightGBM 4.6 |
325
- | μž¬ν˜„ μ‹œλ“œ | 42 |
326
- | DNN μ•„ν‚€ν…μ²˜ | Linear(2568β†’2568β†’1024β†’512β†’1) + PReLU + Dropout(0.5) |
327
- | Hybrid | LightGBM leaf extraction → Linear(n_trees→512→256→1) + PReLU |
328
- | 평가 μ§€ν‘œ | ROC-AUC, PR-AUC, **TPR @ 1% FPR** (λ…Όλ¬Έ Β§4.1) |
329
 
330
  ---
331
 
332
- ## μ•Œλ €μ§„ ν•œκ³„
333
 
334
- - **TabNet ONNX 크기**: sparsemax attention loop μ–Έν΄λ”©μœΌλ‘œ PE 계열 ONNXκ°€ 134 MB둜 팽창. 원본 `tabnet_model.zip`(7 MB)이 κ²½λŸ‰.
335
- - **Treelite `.dylib`**: Mac ARM64 μ „μš© 사전 컴파일 파일. λ‹€λ₯Έ ν”Œλž«νΌμ€ `.tl`μ—μ„œ 재컴파일 ν•„μš”.
336
- - **DNN non-PE INT8**: 696-dim λͺ¨λΈμ€ μ–‘μžν™” AUC 손싀이 ν¬λ―€λ‘œ FP32 μœ μ§€.
337
- - **Hybrid μΆ”λ‘ **: 단일 ONNX 파일이 μ•„λ‹˜ β€” LightGBM leaf extraction + nn_part ONNX 2단계.
338
- - **challenge detection rate**: test setμ—μ„œ FPR=1% μž„κ³„κ°’μœΌλ‘œ μΈ‘μ •. subset별 뢄포 차이둜 값이 상이할 수 있음.
339
 
340
  ---
341
 
342
- ## 인용
343
 
344
  ```bibtex
345
  @inproceedings{joyce2025ember2024,
346
- title = {EMBER2024: An Open Dataset for Training Behavioral Malware Detection Models},
347
- author = {Joyce, Ruby and Rudd, Ethan M. and others},
348
- booktitle = {Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
349
  year = {2025},
 
350
  url = {https://arxiv.org/abs/2506.05074}
351
  }
352
  ```
353
 
354
  ---
355
 
356
- ## λΌμ΄μ„ μŠ€
357
 
358
- μ½”λ“œ 및 λͺ¨λΈ κ°€μ€‘μΉ˜: Apache 2.0
359
- LightGBM 원본 λͺ¨λΈ(`hybrid/hybrid_*_lgbm.model`): [joyce8/EMBER2024-benchmark-models](https://huggingface.co/joyce8/EMBER2024-benchmark-models) λΌμ΄μ„ μŠ€ μ€€μˆ˜
 
18
 
19
  # EMBER2024 Malware Detection Models
20
 
21
+ A collection of four model architectures (DNN, TabNet, Hybrid GBDT2NN, LightGBM) trained and evaluated on all eight subsets of the [EMBER2024](https://huggingface.co/datasets/joyce8/EMBER2024) dataset β€” six file formats (Win32, Win64, .NET, APK, ELF, PDF) plus a combined `PE` group and an `all`-types set β€” and converted into deployment-ready formats.
22
 
23
+ > **Training environment**: NVIDIA DGX Spark (GB10 Grace Blackwell, 128 GB unified memory, CUDA 13)
24
+ > **Code**: [github.com/evan0416/ember-ml](https://github.com/evan0416/ember-ml)
25
+ > **Dataset paper**: [Joyce et al., KDD 2025 (arXiv:2506.05074)](https://arxiv.org/abs/2506.05074)
26
 
27
  ---
28
 
29
+ ## Models
30
 
31
+ | Directory | Architecture | Deployment Format | Parameters |
32
+ |-----------|--------------|-------------------|------------|
33
+ | `dnn/` | Feed-Forward DNN (PReLU + Dropout) | ONNX (INT8 Static / FP32) | 13.2 M (PE) / 0.98 M (non-PE) |
34
  | `tabnet/` | TabNet ([Arik & Pfister, 2021](https://arxiv.org/abs/1908.07442)) | ONNX FP32 | ~3 M |
35
  | `hybrid/` | GBDT2NN ([DeepGBM, KDD 2019](https://www.microsoft.com/en-us/research/publication/deepgbm-a-deep-learning-framework-distilled-by-gbdt-for-online-prediction-tasks/)) | ONNX (nn_part) + LightGBM booster | ~1 M NN |
36
+ | `lightgbm/` | LightGBM (pretrained, [joyce8/EMBER2024-benchmark-models](https://huggingface.co/joyce8/EMBER2024-benchmark-models)) | Treelite `.tl` | β€” |
37
 
38
+ ### Subset List
39
 
40
+ | Subset | Target File Type | Input Dim |
41
+ |--------|------------------|-----------|
42
+ | `PE` | All PE binaries (Win32 + Win64 + .NET) | 2,568 |
43
  | `Win32` | Windows 32-bit PE | 2,568 |
44
  | `Win64` | Windows 64-bit PE | 2,568 |
45
+ | `.NET` | .NET assemblies | 2,568 |
46
  | `APK` | Android APK | 696 |
47
  | `ELF` | Linux ELF | 696 |
48
+ | `PDF` | PDF documents | 696 |
49
+ | `all` | All file types combined | 2,568 |
50
 
51
  ---
52
 
53
+ ## Directory Structure
54
 
55
+ Filename convention: `{model}_{subset}[_suffix].{ext}`
56
+ The `.NET` subset is rendered as `dotnet` in filenames.
57
 
58
  ```
59
  dnn/
60
+ β”œβ”€β”€ dnn_PE.onnx # INT8 Static (deployment; PE/Win32/Win64/dotnet/all)
61
+ β”œβ”€β”€ dnn_PE_fp32.onnx # FP32 ONNX (reference; bundled only for INT8 subsets)
62
+ β”œβ”€β”€ dnn_PE.pt # PyTorch checkpoint
63
+ β”œβ”€β”€ dnn_PE_metrics.json # Evaluation results (AUC, TPR@1%FPR)
64
+ β”œβ”€β”€ dnn_PE_benchmark.json # Size & latency
65
+ β”œβ”€β”€ dnn_APK.onnx # FP32 (non-PE β€” INT8 AUC loss too large)
66
  β”œβ”€β”€ dnn_APK.pt
67
  └── ...
68
 
69
  tabnet/
70
+ β”œβ”€β”€ tabnet_PE.onnx # FP32 ONNX (140 MB β€” sparsemax unfolding)
71
+ β”œβ”€β”€ tabnet_PE.zip # pytorch-tabnet native (7.4 MB, lightweight)
72
  └── ...
73
 
74
  hybrid/
75
  β”œβ”€β”€ hybrid_PE_nnpart.onnx # GBDT2NN nn_part ONNX (5.1 MB)
76
  β”œβ”€β”€ hybrid_PE_lgbm.model # LightGBM booster (3.6 MB)
77
+ β”œβ”€β”€ hybrid_PE.pt # PyTorch checkpoint
78
  └── ...
79
 
80
  lightgbm/
81
+ β”œβ”€β”€ lightgbm_PE.tl # Treelite serialization (platform-independent; recompilation required)
82
  └── ...
83
  ```
84
 
85
  ---
86
 
87
+ ## Performance Results (EMBER2024 test set)
88
 
89
+ > Metrics: ROC-AUC, TPR @ 1% FPR (paper Β§4.1), and challenge-set detection rate at the FPR=1% threshold.
90
+ > Challenge set: 6,315 evasive malware samples (positives only; Win32 3,225 / .NET 829 / Win64 814 / PDF 805 / ELF 386 / APK 256).
91
 
92
  ### DNN
93
 
94
+ | Subset | ROC-AUC | TPR@1%FPR | Deployment Format | Size |
95
+ |--------|---------|-----------|-------------------|------|
96
+ | PE | 0.9969 | 0.9472 | INT8 Static ONNX | 13.3 MB |
97
+ | Win32 | 0.9965 | 0.9479 | INT8 Static ONNX | 13.3 MB |
98
+ | Win64 | 0.9969 | 0.9617 | INT8 Static ONNX | 13.3 MB |
99
+ | .NET | 0.9920 | 0.8444 | INT8 Static ONNX | 13.3 MB |
100
+ | all | 0.9938 | 0.8870 | INT8 Static ONNX | 13.3 MB |
101
  | APK | 0.9761 | 0.7682 | FP32 ONNX | 3.9 MB |
102
  | ELF | 0.9840 | 0.8103 | FP32 ONNX | 3.9 MB |
103
  | PDF | 0.9795 | 0.8902 | FP32 ONNX | 3.9 MB |
104
 
105
+ > non-PE subsets (APK/ELF/PDF) use 696-dim inputs and have too few parameters, so INT8 quantization causes a large AUC drop β€” they are kept in FP32.
106
+ > Figures are for the INT8 models (fixed 100K-sample set). Ξ”AUC vs FP32 stays within 0.19 pp.
107
+ > For the .NET and all subsets, INT8 quantization causes a relatively larger drop in TPR@1%FPR (still passes the AUC gate: |Ξ”AUC| < 0.5 pp).
108
 
109
  ### TabNet
110
 
111
+ | Subset | ROC-AUC | TPR@1%FPR | Deployment Format | Size |
112
+ |--------|---------|-----------|-------------------|------|
113
+ | PE | 0.9948 | 0.9195 | FP32 ONNX | 140 MB |
114
+ | Win32 | 0.9949 | 0.9317 | FP32 ONNX | 140 MB |
115
+ | Win64 | 0.9944 | 0.9318 | FP32 ONNX | 140 MB |
116
+ | .NET | 0.9923 | 0.8700 | FP32 ONNX | 140 MB |
117
+ | all | 0.9922 | 0.8912 | FP32 ONNX | 140 MB |
118
  | APK | 0.9741 | 0.7028 | FP32 ONNX | 13.5 MB |
119
  | ELF | 0.9793 | 0.5460 | FP32 ONNX | 13.5 MB |
120
  | PDF | 0.9810 | 0.8597 | FP32 ONNX | 13.5 MB |
121
 
122
+ > The 140 MB ONNX size for the PE-family subsets is structural: the sparsemax attention loop is unfolded into the ONNX graph. If size matters, use `tabnet_PE.zip` (7.4 MB) directly.
123
 
124
  ### Hybrid (GBDT2NN)
125
 
126
+ | Subset | ROC-AUC | TPR@1%FPR | Deployment Format | Size |
127
+ |--------|---------|-----------|-------------------|------|
128
+ | PE | 0.9982 | 0.9736 | nn_part ONNX + LightGBM booster | 5.3 + 3.8 MB |
129
+ | Win32 | 0.9982 | 0.9734 | nn_part ONNX + LightGBM booster | 5.3 + 3.7 MB |
130
+ | Win64 | 0.9982 | 0.9811 | nn_part ONNX + LightGBM booster | 5.3 + 3.7 MB |
131
+ | .NET | 0.9961 | 0.9466 | nn_part ONNX + LightGBM booster | 5.3 + 3.7 MB |
132
+ | all | 0.9972 | 0.9513 | nn_part ONNX + LightGBM booster | 5.3 + 3.8 MB |
133
+ | APK | 0.9828 | 0.8003 | nn_part ONNX + LightGBM booster | 5.3 + 3.7 MB |
134
+ | ELF | 0.9899 | 0.8827 | nn_part ONNX + LightGBM booster | 5.3 + 3.8 MB |
135
+ | PDF | 0.9879 | 0.9283 | nn_part ONNX + LightGBM booster | 5.3 + 3.7 MB |
136
+
137
+ ### LightGBM (Treelite-compiled)
138
+
139
+ | Subset | ROC-AUC | TPR@1%FPR | Size (.tl) | Size (original .model) |
140
+ |--------|---------|-----------|------------|------------------------|
141
+ | PE | 0.9983 | 0.9686 | 5.3 MB | 3.8 MB |
142
+ | Win32 | 0.9985 | 0.9722 | 5.3 MB | 3.7 MB |
143
+ | Win64 | 0.9988 | 0.9830 | 5.3 MB | 3.7 MB |
144
+ | .NET | 0.9980 | 0.9561 | 5.3 MB | 3.7 MB |
145
+ | all | 0.9970 | 0.9450 | 5.3 MB | 3.8 MB |
146
+ | APK | 0.9861 | 0.8157 | 5.3 MB | 3.7 MB |
147
+ | ELF | 0.9929 | 0.9140 | 5.3 MB | 3.8 MB |
148
+ | PDF | 0.9913 | 0.9275 | 5.3 MB | 3.7 MB |
149
+
150
+ > Original LightGBM models: [joyce8/EMBER2024-benchmark-models](https://huggingface.co/joyce8/EMBER2024-benchmark-models). The `.tl` files are serialized with Treelite 3.9.1 and are platform-independent β€” they must be recompiled on each target platform.
151
 
152
  ### Challenge Set Detection Rate
153
 
154
+ > Challenge set: 6,315 evasive malware (all positive). The FPR=1% threshold from the test set is applied.
155
 
156
  | Subset | DNN | TabNet | Hybrid | LightGBM |
157
  |--------|-----|--------|--------|----------|
 
166
 
167
  ---
168
 
169
+ ## Inference Performance (Apple M1, darwin-arm64)
170
 
171
+ > `warm_batch1` latency: batch size = 1, measured after cache warm-up. May differ from the deployment environment (x86_64 Linux).
172
 
173
+ ### Latency (ms, warm batch=1)
174
 
175
  | Subset | DNN | TabNet | Hybrid | LightGBM |
176
  |--------|-----|--------|--------|----------|
 
183
  | `Win64`| 0.220 | 5.621 | 0.422 | 0.039 |
184
  | `all` | 0.254 | 4.788 | 0.147 | 0.068 |
185
 
186
+ > TabNet latency is high because the sparsemax attention is unfolded into the ONNX graph (structural).
187
+ > Hybrid = nn_part ONNX inference only (LightGBM leaf extraction excluded).
188
+ > LightGBM latency is for the compiled `.dylib`; the uploaded file is `.tl` (recompilation required).
189
 
190
+ ### Model File Sizes (deployment format)
191
 
192
  | Subset | DNN | TabNet `.onnx` | TabNet `.zip` | Hybrid (nn+lgbm) | LightGBM `.tl` |
193
+ |--------|-----|----------------|---------------|------------------|----------------|
194
+ | PE family | 13.3 MB (INT8) | 140.2 MB | 7.4 MB | 5.3 + 3.8 MB | 5.3 MB |
195
+ | non-PE | 3.9 MB (FP32) | 13.5 MB | 3.2 MB | 5.3 + 3.7 MB | 5.3 MB |
196
 
197
  ---
198
 
199
+ ## Usage
200
 
201
+ ### Install Dependencies
202
 
203
  ```bash
204
  pip install onnxruntime>=1.20 numpy
205
+ # For LightGBM / Hybrid inference
206
  pip install "treelite==3.9.1" "treelite_runtime==3.9.1" lightgbm>=4.6
207
+ # To use the TabNet checkpoint directly
208
  pip install pytorch-tabnet>=4.1
209
  ```
210
 
211
+ ### DNN Inference (ONNX Runtime)
212
 
213
  ```python
214
  import numpy as np
 
240
  prob = 1 / (1 + np.exp(-sess.run(["logit"], {"features": X})[0].ravel()))
241
  ```
242
 
243
+ ### TabNet Inference (ONNX Runtime)
244
 
245
  ```python
246
  import numpy as np
 
253
  )
254
  sess = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
255
  X = np.random.randn(1, 2568).astype(np.float32)
256
+ # output: logit (pre-sigmoid)
257
  logit = sess.run(["logit"], {"features": X})[0]
258
  prob = 1 / (1 + np.exp(-logit.ravel()))
259
  ```
260
 
261
+ ### Hybrid Inference (ONNX + LightGBM)
262
 
263
  ```python
264
  import numpy as np
 
266
  import onnxruntime as ort
267
  from huggingface_hub import hf_hub_download
268
 
269
+ # 1. Extract leaf indices with the LightGBM booster
270
  booster = lgb.Booster(model_file=hf_hub_download(
271
  repo_id="cycloevan/ember-model",
272
  filename="hybrid/hybrid_PE_lgbm.model",
 
274
  X_raw = np.random.randn(1, 2568).astype(np.float64)
275
  leaf_indices = booster.predict(X_raw, pred_leaf=True).astype(np.int64) # (N, n_trees)
276
 
277
+ # 2. Final classification with the GBDT2NN ONNX model
278
  nn_sess = ort.InferenceSession(hf_hub_download(
279
  repo_id="cycloevan/ember-model",
280
  filename="hybrid/hybrid_PE_nnpart.onnx",
 
284
  print(f"malware probability: {prob[0]:.4f}")
285
  ```
286
 
287
+ ### LightGBM Inference (Treelite-compiled β€” fast inference)
288
 
289
  ```python
290
+ # 1. Compile Treelite .tl β†’ platform-specific shared library (one-time)
291
  import treelite, treelite_runtime, sys, numpy as np
292
  from huggingface_hub import hf_hub_download
293
 
 
304
  verbose=False,
305
  )
306
 
307
+ # 2. Inference
308
  predictor = treelite_runtime.Predictor(lib_path, verbose=False)
309
  X = np.random.randn(1, 2568).astype(np.float32)
310
  prob = predictor.predict(treelite_runtime.DMatrix(X))
311
  print(f"malware probability: {prob[0]:.4f}")
312
  ```
313
 
314
+ > **Note**: Requires `treelite==3.9.1` + `treelite_runtime==3.9.1`. Version 4.x does not support `export_lib()`.
315
 
316
  ---
317
 
318
+ ## Training & Evaluation Environment
319
 
320
+ | Item | Details |
321
+ |------|---------|
322
+ | Dataset | [EMBER2024](https://huggingface.co/datasets/joyce8/EMBER2024) β€” train 52 weeks (2.6 M), test 12 weeks (606 K), challenge 6,315 |
323
+ | Feature dim | PE 2,568 (v3) / non-PE 696 (valid prefix) |
324
+ | Split policy | Fixed temporal order (temporal split), no random shuffling |
325
+ | Training environment | NVIDIA DGX Spark (GB10 Grace Blackwell, 128 GB unified memory, CUDA 13) |
326
+ | Frameworks | PyTorch 2.11.0, pytorch-tabnet 4.1, LightGBM 4.6 |
327
+ | Random seed | 42 |
328
+ | DNN architecture | 2 × [Linear(d→d) + BatchNorm + PReLU(α=0.25) + Dropout(0.5)] → Linear(d→1), where d = 2,568 (PE) / 696 (non-PE) |
329
+ | Hybrid | LightGBM leaf extraction β†’ shared leaf Embedding (dim 8) β†’ concat β†’ MLP[256, 128] (BatchNorm + PReLU) β†’ Linear(β†’1) |
330
+ | Evaluation metrics | ROC-AUC, PR-AUC, **TPR @ 1% FPR** (paper Β§4.1) |
331
 
332
  ---
333
 
334
+ ## Known Limitations
335
 
336
+ - **TabNet ONNX size**: unfolding the sparsemax attention loop inflates the PE-family ONNX to 140 MB. The original `tabnet_PE.zip` (7.4 MB) is lighter.
337
+ - **Treelite `.tl`**: the uploaded LightGBM artifact is a platform-independent serialization. You must compile it into a shared library (`.dylib`/`.so`) on each target platform before inference β€” see the LightGBM usage example. (The reported LightGBM latency is for a `.dylib` compiled on Mac ARM64.)
338
+ - **DNN non-PE INT8**: the 696-dim models suffer large AUC loss from quantization, so they are kept in FP32.
339
+ - **Hybrid inference**: not a single ONNX file β€” two stages: LightGBM leaf extraction + nn_part ONNX.
340
+ - **Challenge detection rate**: measured using the FPR=1% threshold from the test set. Values may vary across subsets due to distribution differences.
341
 
342
  ---
343
 
344
+ ## Citation
345
 
346
  ```bibtex
347
  @inproceedings{joyce2025ember2024,
348
+ title = {EMBER2024 -- A Benchmark Dataset for Holistic Evaluation of Malware Classifiers},
349
+ author = {Joyce, Robert J. and Miller, Gideon and Roth, Phil and Zak, Richard and Zaresky-Williams, Elliott and Anderson, Hyrum and Raff, Edward and Holt, James},
350
+ booktitle = {Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD '25)},
351
  year = {2025},
352
+ doi = {10.1145/3711896.3737431},
353
  url = {https://arxiv.org/abs/2506.05074}
354
  }
355
  ```
356
 
357
  ---
358
 
359
+ ## License
360
 
361
+ Code and model weights: Apache 2.0
362
+ Original LightGBM models (`hybrid/hybrid_*_lgbm.model`): subject to the [joyce8/EMBER2024-benchmark-models](https://huggingface.co/joyce8/EMBER2024-benchmark-models) license.