Downloads · 30 days
8
11% of all-time downloads
ha5eeb001/CyberHybridNet-anomaly-detector
CyberHybridNet-anomaly-detector is a machine learning model from ha5eeb001. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
CyberHybridNet is a cutting-edge hybrid transformer architecture designed specifically for network intrusion / anomaly detection in cybersecurity. It combines multiple advanced components:
Downloads · 30 days
8
11% of all-time downloads
All-time downloads
71
Public
Repo size
12.7 MB
Likes
0
Public
Click a slice to open those files.
.pt12.7 MB · 100%
From the Hugging Face model README
CyberHybridNet is a cutting-edge hybrid transformer architecture designed specifically for network intrusion / anomaly detection in cybersecurity. It combines multiple advanced components:
Input Features
│
┌───▼───┐
│ Input │
│Project │
└───┬───┘
│
┌───▼───────────┐ ┌──────────────────┐
│ Multi-Scale │────▶│ CNN Context │
│ CNN Extractor │ │ (3 scales: 1,3,5) │
└───┬───────────┘ └──────┬───────────┘
│ │
│ ┌───────────────────┘
│ │
┌───▼────▼───────────┐
│ Hybrid Attention │ × N layers
│ ┌─────────────────┐│
│ │Self-Attn + RoPE ││
│ ├─────────────────┤│
│ │Gated Cross-Attn ││
│ ├─────────────────┤│
│ │SwiGLU FFN ││
│ └─────────────────┘│
└────────┬───────────┘
│
┌────────▼───────────┐
│ Attention Pooling │
└────────┬───────────┘
│
┌────────▼───────────┐
│ MoE Classifier │
│ (4 experts + gate) │
└────────┬───────────┘
│
Predictions
| Metric | Score |
|---|---|
| Accuracy | 77.52% |
| F1-Macro | 74.61% |
| F1-Weighted | 76.14% |
| Precision | 80.75% |
| Recall | 73.83% |
| AUC-ROC | 88.39% |
| Metric | Score |
|---|---|
| Accuracy | 98.77% |
| F1-Macro | 97.03% |
| F1-Weighted | 98.80% |
| Precision | 95.02% |
| Recall | 99.31% |
| AUC-ROC | 99.94% |
import torch
from model import CyberHybridNet
# Load model
model = CyberHybridNet(
input_dim=78, # CICIDS2017 features
num_classes=3, # BENIGN, ATTACK, UNKNOWN
hidden_dim=128,
num_layers=4,
num_heads=8,
num_experts=4,
)
model.load_state_dict(torch.load("model.pt"))
model.eval()
# Predict
with torch.no_grad():
features = torch.randn(1, 78) # Your preprocessed features
logits, gate_probs = model(features)
prediction = logits.argmax(dim=-1)