π CyberGuard AI - Security Log Analyzer
Model Description
CyberGuard AI is a fine-tuned language model specialized in analyzing cybersecurity logs and identifying potential security threats. Built on Llama-2-7B and trained using Unsloth for efficient fine-tuning.
Developed by: omasteam
π― Model Capabilities
- Threat Classification: Categorizes logs as Normal, Suspicious, or Malicious
- Confidence Scoring: Provides confidence levels for classifications
- Detailed Analysis: Offers comprehensive reasoning for each assessment
- Actionable Recommendations: Suggests appropriate security responses
π Classification Categories
π’ Normal
- Routine system operations
- Standard user activities
- Expected network traffic
- Scheduled maintenance events
π‘ Suspicious
- Unusual access patterns
- Failed authentication attempts
- After-hours activities
- Anomalous data transfers
π΄ Malicious
- Active attack indicators
- Malware signatures
- SQL injection attempts
- Data exfiltration patterns
π Quick Start
from unsloth import FastLanguageModel
# Load the model
model, tokenizer = FastLanguageModel.from_pretrained(
"{omasteam}/{cyberguard-ai-security-analyzer}",
max_seq_length=2048,
dtype=None,
load_in_4bit=True,
)
# Set to inference mode
FastLanguageModel.for_inference(model)
# Analyze a security log
messages = [
{{
"role": "system",
"content": "You are CyberGuard AI, an expert cybersecurity analyst. Analyze security logs and classify them as 'normal', 'suspicious', or 'malicious'."
}},
{{
"role": "user",
"content": "Analyze this security log: Multiple failed login attempts from IP 192.168.1.100"
}}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt"
)
outputs = model.generate(
input_ids=inputs,
max_new_tokens=256,
temperature=0.3,
do_sample=True
)
response = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True)
print(response)
π§ Training Details
Training Data
- Dataset Size: 150 security log examples
- Categories: Normal (50), Suspicious (50), Malicious (50)
- Format: Conversational training with system prompts
Training Configuration
- Base Model: Llama-2-7B-Chat
- Training Method: LoRA (Low-Rank Adaptation)
- Training Steps: 60
- Learning Rate: 2e-4
- Batch Size: 2 (with gradient accumulation)
Training Framework
- Framework: Unsloth (optimized training)
- Quantization: 4-bit for memory efficiency
- Hardware: Google Colab GPU
π Performance
The model demonstrates strong performance in:
- Threat Detection: High accuracy in identifying malicious activities
- False Positive Reduction: Balanced classification to minimize alerts
- Contextual Understanding: Considers temporal and behavioral patterns
- Response Quality: Provides detailed, actionable analysis
β οΈ Limitations
- Trained on synthetic security log data
- May require fine-tuning for specific environments
- Performance varies with log format complexity
- Best used as part of broader security monitoring
π― Intended Use
Primary Applications
- Security Information and Event Management (SIEM)
- Log analysis automation
- Threat detection and classification
- Security monitoring workflows
Out of Scope
- Real-time critical security decisions without human oversight
- Standalone security solution
- Legal or compliance determinations
π Citation
If you use this model in your research or applications, please cite:
@misc{{cyberguard-ai-2024,
author = {{{omasteam}}},
title = {{CyberGuard AI: Fine-tuned Security Log Analyzer}},
year = {{2024}},
publisher = {{Hugging Face}},
journal = {{Hugging Face Model Hub}},
howpublished = {{\\url{{https://huggingface.co/{omasteam}/{cyberguard-ai-security-analyzer}}}}}
}}
π€ Contributing
Contributions, suggestions, and feedback are welcome! Please open an issue or submit a pull request.
π License
This model is released under the Apache 2.0 License.
π Acknowledgments
- Unsloth Team: For the efficient training framework
- Hugging Face: For the model hosting platform
- Meta AI: For the base Llama-2 model
Model tree for omasteam/cyberguard-ai-security-analyzer
Base model
unsloth/llama-2-7b-chat-bnb-4bit