Alfeesi's picture
Update README.md
586d281 verified
---
license: apache-2.0
language:
- en
tags:
- cybersecurity
- intrusion-detection
- phishing-detection
- vulnerability-scoring
- machine-learning
- random-forest
- xgboost
---
# πŸ›‘οΈ Cybersecurity ML Models
A collection of machine learning models for cybersecurity threat detection and vulnerability assessment.
## Models Included
### πŸ” Intrusion Detection (UNSW-NB15)
Detects network intrusions and classifies attack types.
- **Algorithm:** Random Forest + XGBoost
- **Classes:** Normal, DoS, Exploits, Fuzzers, Generic, Reconnaissance, Backdoor, Analysis, Shellcode, Worms
- **Dataset:** UNSW-NB15
### 🎣 Phishing Detection
Identifies phishing URLs and malicious web content.
- **Algorithm:** Random Forest + XGBoost
- **Output:** Phishing / Legitimate
### πŸ›‘οΈ Vulnerability Scoring
Predicts vulnerability severity and CVSS scores.
- **Algorithm:** Random Forest + XGBoost (classifier + regressor)
- **Output:** Severity label + numeric score
---
## πŸ“ Repository Structure
```
β”œβ”€β”€ predictor.pkl # Main predictor (load this)
β”œβ”€β”€ preprocessors/
β”‚ β”œβ”€β”€ intrusion_label_encoder.pkl
β”‚ β”œβ”€β”€ intrusion_scaler.pkl
β”‚ β”œβ”€β”€ phishing_scaler.pkl
β”‚ β”œβ”€β”€ severity_encoder.pkl
β”‚ β”œβ”€β”€ vulnerability_scaler.pkl
β”‚ β”œβ”€β”€ intrusion_feature_names.json
β”‚ β”œβ”€β”€ phishing_feature_names.json
β”‚ └── vulnerability_feature_names.json
└── saved_models/
β”œβ”€β”€ intrusion_detection/
β”œβ”€β”€ phishing_detection/
└── vulnerability_scoring/
```
---
## πŸš€ Quickstart
### Install dependencies
```bash
pip install scikit-learn xgboost joblib huggingface_hub
```
### Load the models
```python
import joblib
from huggingface_hub import hf_hub_download
# Download and load main predictor
path = hf_hub_download(repo_id="Alfeesi/cybersecurity-ml-models", filename="predictor.pkl")
predictor = joblib.load(path)
```
### Intrusion Detection
```python
import numpy as np
features = np.array([[0.5, 0, 1, 1024, 512]]) # your network features
result = predictor.predict_intrusion(features)
print(f"Attack Type: {result['attack_type']}")
```
### Phishing Detection
```python
features = np.array([[75, 1, 3, 0]]) # url_length, has_ip, num_dots, has_https
result = predictor.predict_phishing(features)
print(f"Phishing: {result}")
```
### Vulnerability Scoring
```python
features = np.array([[7.5, 0, 0]]) # cvss_base, attack_vector, complexity
result = predictor.predict_vulnerability(features)
print(f"Severity: {result['severity']} | Score: {result['score']}")
```
---
## πŸ“Š Model Performance
| Model | Metric | Score |
|-------|--------|-------|
| Intrusion Detection | Accuracy | See evaluation/ |
| Phishing Detection | Accuracy | See evaluation/ |
| Vulnerability Scoring | RMSE | See evaluation/ |
---
## πŸ”— Live Demo
https://huggingface.co/spaces/Alfeesi/cybersecurity-demo
---
## πŸ“„ License
Apache 2.0 β€” free to use, modify, and distribute.