Views
No views yet
legit (0) or dga (1)| Metric | Value |
|---|---|
| Accuracy | 0.9200 |
| F1 | 0.9000 |
| Precision | 0.9400 |
| Recall | 0.8900 |
| FPR | 0.0400 |
| Query Time | 0.490 ms/domain (CPU) |
1from huggingface_hub import hf_hub_download
2import importlib.util, torch
3
4# Download model files
5weights = hf_hub_download("Reynier/dga-cnn", "dga_cnn_model_1M.pth")
6model_py = hf_hub_download("Reynier/dga-cnn", "model.py")
7
8# Load module
9spec = importlib.util.spec_from_file_location("cnn_model", model_py)
10mod = importlib.util.module_from_spec(spec)
11spec.loader.exec_module(mod)
12
13# Load model
14model = mod.load_model(weights)
15
16# Predict
17results = mod.predict(model, ["google.com", "xkr3f9mq.ru"])
18print(results)
19# [{"domain": "google.com", "label": "legit", "score": 0.02},
20# {"domain": "xkr3f9mq.ru", "label": "dga", "score": 0.98}]train_1M.csv — ~845K samples across 54 DGA families + legitimate domains.1@article{reynier2026dga,
2 title={DGA Multi-Family Benchmark: Comparing Classical and Transformer-based Detectors},
3 author={Reynier et al.},
4 year={2026}
5}