Downloads · 30 days
0
OrhanDerin/ModernBERT-DGA-finetuned
ModernBERT-DGA-finetuned is a text classification model from OrhanDerin. Use it when you need a label for a piece of text. The card lists the license as mit.
This repository contains a fine-tuned sequence classification model based on answerdotai/ModernBERT-base, specifically trained to detect Domain Generation Algorithms (DGA) in network traffic.
Downloads · 30 days
0
Access
Public
Updated Aug 4, 2026
Repo size
—
Likes
1
Public
Click a slice to open those files.
.md3.6 KB · 70%
From the Hugging Face model README
This repository contains a fine-tuned sequence classification model based on answerdotai/ModernBERT-base, specifically trained to detect Domain Generation Algorithms (DGA) in network traffic.
The model is optimized for real-time binary classification of domain names (Benign vs. Malicious) and is structurally designed to be exported to ONNX for lightweight execution on ARM-based edge hardware, such as a Raspberry Pi acting as a secure DNS sinkhole.
Label 0: Benign DomainLabel 1: Malicious (DGA) DomainThis model is intended to be integrated into network security appliances, specifically localized DNS sinkholes. By analyzing incoming DNS queries in real-time, the model categorizes requests.
Critical considerations for this deployment: In a DNS sinkhole environment, False Positives (FPR) are highly disruptive, as they block legitimate web traffic. The training configuration and evaluation metrics were heavily weighted toward optimizing Precision and F1 scores to ensure a near-zero False Positive Rate.
The model was fine-tuned using high-quality OSINT threat intelligence feeds (such as the Harpomaxx DGA dataset format), compiling domain strings into two primary classes:
The model was trained using native Hugging Face libraries (transformers, datasets, Trainer) with aggressive hardware optimization for consumer-grade GPUs.
Based on hardware stress-testing, the following hyperparameter configuration was utilized to maximize VRAM efficiency while maintaining mathematical stability:
3e-50.010.1FP16 (Tensor Core accelerated)F1 score.During evaluation, a custom metric computation block was utilized to track metrics beyond standard accuracy. The model was evaluated on:
(Note: Add your final printed metrics from the terminal here once the training run completes).
While these weights are native to PyTorch (.safetensors), this model is designed to be exported to ONNX via the Hugging Face optimum library. This allows the model to drop PyTorch dependencies entirely and run purely on ONNX Runtime for low-latency inference on ARM architectures (Raspberry Pi 4/5).