Downloads ยท 30 days
0
krishnas4415/log-anomaly-detection-models
log-anomaly-detection-models is a text classification model from krishnas4415. Use it when you need a label for a piece of text. The card lists the license as mit.
This repository contains trained models for the Log Anomaly Detection System that classifies system logs into 7 anomaly categories.
Downloads ยท 30 days
0
Access
Public
Updated Oct 16, 2025
Repo size
881 MB
Likes
5
Public
Click a slice to open those files.
.pt881 MB ยท 100%
From the Hugging Face model README
This repository contains trained models for the Log Anomaly Detection System that classifies system logs into 7 anomaly categories.
models/DANN-BERT-Log-Anomaly-Detection/) - Domain-Adversarial Neural Networkmodels/LoRA-BERT-Log-Anomaly-Detection/) - Low-Rank Adaptationmodels/Hybrid-BERT-Log-Anomaly-Detection/) - BERT + Template Featuresmodels/XGBoost-Log-Anomaly-Detection/) - Gradient Boosting Classifier| Model | F1-Score (Macro) | Accuracy | Parameters |
|---|---|---|---|
| Hybrid-BERT | 92.8% | 94.3% | 110M |
| DANN-BERT | 90.3% | 92.1% | 110M |
| LoRA-BERT | 88.7% | 90.5% | 1.5M (trainable) |
| XGBoost | 88.5% | 91.2% | - |
from huggingface_hub import hf_hub_download
# Download BERT model
model_path = hf_hub_download(
repo_id="krishnas4415/log-anomaly-detection-models",
filename="models/Hybrid-BERT-Log-Anomaly-Detection/pytorch_model.pt"
)
# Download XGBoost model
xgb_path = hf_hub_download(
repo_id="krishnas4415/log-anomaly-detection-models",
filename="models/XGBoost-Log-Anomaly-Detection/best_mod.pkl"
)
import torch
import pickle
from transformers import AutoTokenizer
# Load BERT model
model = torch.load(model_path)
tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased')
# Load XGBoost model
with open(xgb_path, 'rb') as f:
xgb_model = pickle.load(f)
# Example prediction
log_text = "Apr 15 12:34:56 server sshd[1234]: Failed password for admin"
inputs = tokenizer(log_text, return_tensors='pt', max_length=128, truncation=True, padding=True)
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.softmax(outputs.logits, dim=-1)
predicted_class = torch.argmax(predictions, dim=-1)
@misc{log-anomaly-detection-2024,
title={Log Anomaly Detection System},
author={Krishna Sharma},
year={2024},
url={https://github.com/krishnasharma4415/log-anomaly-detection}
}
MIT License - see LICENSE file for details.