Accepted at the 6th International Conference on Digital Futures and Transformative Technologies (ICoDT2) Β· IEEE
99.88% accuracy Β· 0.12% false-positive rate Β· 4 GB GPU Β· 100% on-premise
π Paper Β· ποΈ Architecture Β· π Results Β· π Quick Start Β· π Citation
- Overview
- Key Contributions
- System Architecture
- How It Works
- Results
- Repository Structure
- Quick Start
- Dataset
- Limitations & Future Work
- Citation
- Authors
- License
Modern IT infrastructure produces millions of log events per day. Rule-based SIEM tools depend on static signatures, miss novel threats, and flood analysts with false positives (alert fatigue). Cloud-hosted LLM solutions help, but they send sensitive logs outside the organization and need GPUs that smaller teams can't afford.
Threat Track AI is an end-to-end, locally deployable, privacy-preserving framework that:
- π§© Normalizes eight heterogeneous log formats into one unified schema
- π§ Pre-filters events using semantic embeddings (
all-MiniLM-L6-v2) + Isolation Forest - π― Classifies each event as Critical or Non-Critical with a fine-tuned TinyLLaMA-1.1B
- π€ Acts through a three-agent LangGraph workflow that explains the decision and emails analysts only for critical events
- π Visualizes everything on a Streamlit dashboard backed by FastAPI and MSSQL
The whole system runs on a single 4 GB NVIDIA GeForce RTX 2050, and no raw log data ever leaves the organizational perimeter.
| # | Contribution |
|---|---|
| 1 | A unified preprocessing pipeline that normalizes eight heterogeneous log formats into one schema |
| 2 | A hybrid anomaly detector combining MiniLM sentence embeddings with Isolation Forest, clearly outperforming a TF-IDF baseline |
| 3 | A fine-tuning methodology for LLM log classification on 95,467 balanced entries |
| 4 | A three-agent LangGraph workflow (Parser β Classifier β Responder) for classification, explanation and alerting |
| 5 | A comparative study of LLaMA-2 7B, LLaMA-3 3B, BERT and TinyLLaMA-1B under the same 4 GB GPU constraint |
| 6 | A Streamlit dashboard with a FastAPI backend and MSSQL storage for real-time monitoring |
Figure 1 β End-to-end workflow: offline training pipeline (top) and online real-time agentic pipeline (bottom).
flowchart LR
A[("π₯ Log Sources<br/>8 formats")] --> B["π§© Parser<br/>Unified schema"]
B --> C["π§ MiniLM<br/>384-d embeddings"]
C --> D{"π² Isolation<br/>Forest"}
D -- Normal --> G[("ποΈ MSSQL<br/>Non-Critical")]
D -- Anomalous --> E["π― TinyLLaMA-1B<br/>Classifier"]
E -- Non-Critical --> G
E -- Critical --> F["π€ Responder<br/>Explain + Email"]
F --> H["π§ Analyst Alert"]
F --> G
G --> I["π Streamlit<br/>Dashboard"]
Logs from Server, Web access, Windows Event, Application, Hadoop, HDFS audit, Apache HTTP and OpenStack cloud sources are parsed with per-source regex parsers into a unified tuple:
L = β¨ timestamp, source_type, log_level, message, ip_address β©
Each log message is encoded by all-MiniLM-L6-v2 into a 384-dimensional vector, which captures meaning even when two messages share few tokens. TF-IDF is kept as the baseline.
Isolation Forest scores every embedding. Entries scoring above a threshold Ο are marked Anomalous and sent on to the LLM. The rest are marked Normal and stored as Non-Critical. This keeps expensive LLM inference off the bulk of benign traffic.
Anomalous entries were labeled by three external LLMs (LLaMA-3-8B, Qwen-32B, GPT-4o-mini) and settled by majority vote; entries where all three disagreed were dropped. A random sample of 300+ entries was manually reviewed (96% agreement). TinyLLaMA-1.1B-Chat was then fine-tuned on the result.
Fine-tuning configuration
| Hyperparameter | Value |
|---|---|
| Base model | TinyLLaMA-1.1B-Chat-v1.0 |
| Epochs | 3 |
| Batch size (train / eval) | 8 / 8 |
| Learning rate | 2 Γ 10β»β΅ |
| LR scheduler | Linear with warmup (ratio 0.03) |
| Max sequence length | 512 tokens |
| Optimizer | AdamW (weight decay 0.01) |
| Hardware | NVIDIA GeForce RTX 2050, 4 GB VRAM |
| Training time | β 4 hours |
sequenceDiagram
autonumber
participant U as User / Log Source
participant P as π§© Parser Agent
participant C as π― Classifier Agent
participant R as π€ Responder Agent
participant DB as ποΈ MSSQL
participant A as π§ Analyst
U->>P: Raw log entry
P->>P: Detect format Β· extract fields Β· ISO-8601 timestamp
P->>C: Unified structured log
C->>C: TinyLLaMA-1B β Critical / Non-Critical
C->>R: { log, label }
R->>R: Generate natural-language explanation
R->>DB: Store log + label + explanation
alt Critical
R->>A: Email alert
else Non-Critical
R-->>A: (silent, no alert)
end
| Layer | Details |
|---|---|
| FastAPI | POST /register (bcrypt hashing) Β· POST /login (JWT) Β· POST /process_log (async LangGraph invocation) |
| MSSQL | LOG_DB stores log entries and user credentials |
| Streamlit | Landing, login, sign-up and analysis dashboard; single-log entry, CSV batch upload, filtering by timestamp / class / severity |
All numbers below come from the paper. Evaluation used a held-out 20% test split (19,093 entries).
| Accuracy | Precision | Recall | F1-score | False-positive rate | Missed critical logs |
|---|---|---|---|---|---|
| 99.88% | 99.85% | 99.84% | 99.85% | 0.12% (18 / 14,817) | 5 / 4,276 |
| Model | Accuracy | Precision | Recall | F1 | Deployable on 4 GB GPU? |
|---|---|---|---|---|---|
| LLaMA-2 7B | β | β | β | β | β >23 h per epoch |
| LLaMA-3 3B | 0.8664 | 0.9005 | 0.8664 | 0.8794 | β needs 8β12 GB |
| BERT (base) | 0.9705 | 0.9419 | 0.9705 | 0.9560 | |
| TinyLLaMA-1B | 0.9988 | 0.9985 | 0.9984 | 0.9985 | β Yes |
LLaMA-2 7B and LLaMA-3 3B were trained on Google Colab / Kaggle for comparison only, since they exceed the on-premise 4 GB budget.
MiniLM + Isolation Forest reaches 0.88 F1 versus 0.58 for TF-IDF + Isolation Forest.
With the initial dataset (β3.2% critical), TinyLLaMA-1B reached only 83% accuracy by predicting Non-Critical almost every time. After augmentation and balancing to 95,467 entries, accuracy rose to 99.88%.
| Stage | Single log | 100-log batch | Memory |
|---|---|---|---|
| Log parsing | < 1 ms | < 50 ms | negligible |
| MiniLM embedding | β 8 ms | β 0.6 s | β 90 MB |
| Isolation Forest | < 2 ms | < 100 ms | β 50 MB |
| TinyLLaMA inference | β 1.2 s | β 120 s | β 2.2 GB |
| Email dispatch | β 0.8 s | n/a | negligible |
| End-to-end | β 2.1 s | β 122 s | β 2.4 GB |
- β 99% classification consistency across 500 individually tested logs covering all eight source types
- β 100% email-alert reliability across 150 critical logs (no missed alerts, no duplicates)
- β All four functional test cases passed: log ingestion, classification + notification, multi-agent workflow, MSSQL storage
Threat-Track-AI/
βββ π Stage_1/ # Preprocessing & dataset construction notebooks
βββ π Stage-2/ # Embedding-based anomaly detection experiments
βββ π Stage_3/ # LLM fine-tuning experiments
βββ π AI_Agent/ # LangGraph agent workflow & LLM experimentation
βββ π Dashboard/ # Dashboard application assets
βββ π pages/ # Streamlit UI (landing, login, sign-up, dashboard)
βββ π Threat-Track-AI/ # Project application files
βββ π docs/ # Research paper
βββ π assets/ # README figures
β
βββ π Isolation_Forest.ipynb # Isolation Forest anomaly detection
βββ π Classifier_Agent.ipynb # Classifier agent (TinyLLaMA)
βββ π FineTuning_part2_*.ipynb # Fine-tuning experiments
β
βββ ποΈ balanced_data.csv # Final balanced dataset (95,467 entries)
βββ ποΈ llama3_finetune_data.jsonl # Instruction-format fine-tuning data
βββ ποΈ web_logs.csv Β· accesslog.csv Β· WebLogReduced.csv Β· part1.csv Β· part2.csv
βββ π README.md
- Python 3.10+
- NVIDIA GPU with β₯ 4 GB VRAM (for local LLM inference)
- Microsoft SQL Server (for the
LOG_DBdatabase) - An SMTP account for critical-alert emails
git clone https://github.com/javaidgithub/Threat-Track-AI.git
cd Threat-Track-AI
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activatepip install streamlit requests pandas matplotlib
pip install fastapi uvicorn langgraph langchain
pip install torch transformers sentence-transformers scikit-learnThe Streamlit pages expect the FastAPI backend at http://127.0.0.1:8000:
| Endpoint | Purpose |
|---|---|
POST /register |
Create a user account |
POST /login |
Authenticate and receive a JWT |
POST /process_log/ |
Run the Parser β Classifier β Responder workflow |
uvicorn <backend_module>:app --host 127.0.0.1 --port 8000 --reloadstreamlit run pages/Landing_page.pyOpen the notebooks in order:
Stage_1/β preprocessing and dataset constructionStage-2/andIsolation_Forest.ipynbβ embeddings and anomaly detectionStage_3/andFineTuning_part2_*.ipynbβ fine-tuningClassifier_Agent.ipynbandAI_Agent/β agent workflow
| Stage | Total entries | Critical ratio |
|---|---|---|
| Initial raw (8 sources) | 53,973 | β 3.2% |
| + Synthetic critical logs | 75,467 | β 28.4% |
| + 20,000 non-critical logs | 95,467 | β 22.4% |
The final dataset is in balanced_data.csv, and the instruction-format version is in llama3_finetune_data.jsonl.
We believe in reporting limitations plainly:
- Synthetic-data leakage risk. Synthetic critical logs built from similar templates may appear in both training and test splits, which could inflate the reported accuracy compared with a fully independent, non-synthetic evaluation set.
- Throughput. TinyLLaMA inference runs at roughly 50 events per minute, which may not be enough for very high-volume environments.
- Generalization. Performance is unvalidated on log formats outside the eight training sources.
- Evaluation scope. The reported metrics cover the LLM classification stage; the full Isolation Forest β LLM pipeline has not yet been audited against ground truth.
Roadmap
- Periodic re-fine-tuning on analyst-corrected, real-world data (human-in-the-loop feedback)
- Template-aware train/test splitting and validation on an external log corpus
- Cross-log correlation / root-cause-analysis agent
- Role-based, multi-tier SOC dashboards
- Integration with Splunk, ELK, Microsoft Sentinel and IBM QRadar
- Training data aligned with the MITRE ATT&CK framework
- Evaluation of NIST SP 800-92 compliant log formatting
If you use Threat Track AI in your research, please cite:
@inproceedings{javaid2026threattrackai,
title = {Threat Track AI: A Scalable Multi-Agent Framework for Automated
Cybersecurity Log Analysis and Threat Detection},
author = {Javaid, Muhammad and Ahmad, Khawaja Bilal and Khan, Danyal and Wazir, Saad},
booktitle = {6th International Conference on Digital Futures and Transformative
Technologies (ICoDT2)},
year = {2026},
publisher = {IEEE}
}| Author | Affiliation |
|---|---|
| Muhammad Javaid | Faculty of Computing, Riphah International University, Islamabad, Pakistan |
| Khawaja Bilal Ahmad | Faculty of Computing, Riphah International University, Islamabad, Pakistan |
| Danyal Khan | Faculty of Computing, Riphah International University, Islamabad, Pakistan |
| Saad Wazir | School of Computing, KAIST, Daejeon, South Korea |
Supervision: Saad Wazir and Dr. Muhammad Mansoor Alam provided academic and research guidance throughout the project.
This project is released under the MIT License. See the LICENSE file for details.
If you find this work useful, please consider giving the repository a β
Built for privacy-first, analyst-friendly security operations.





