Skip to content

About

Threat Track AI: A Scalable Multi-Agent Framework for Automated Cybersecurity Log Analysis and Threat Detection | 6th International Conference on Digital Futures and Transformative Technologies (ICoDT2)

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

78 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Threat Track AI

A Scalable Multi-Agent Framework for Automated Cybersecurity Log Analysis and Threat Detection

Accepted at the 6th International Conference on Digital Futures and Transformative Technologies (ICoDT2) Β· IEEE

Paper Python LangGraph FastAPI Streamlit License

99.88% accuracy Β· 0.12% false-positive rate Β· 4 GB GPU Β· 100% on-premise

πŸ“„ Paper Β· πŸ—οΈ Architecture Β· πŸ“Š Results Β· πŸš€ Quick Start Β· πŸ“š Citation


πŸ“Œ Table of Contents


πŸ”Ž Overview

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.


✨ Key Contributions

# 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

πŸ—οΈ System Architecture

Threat Track AI end-to-end architecture

Figure 1 β€” End-to-end workflow: offline training pipeline (top) and online real-time agentic pipeline (bottom).

Online pipeline at a glance

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"]
Loading

βš™οΈ How It Works

1 Β· Log ingestion and normalization

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 ⟩

2 Β· Semantic feature extraction

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.

3 Β· Isolation Forest pre-filtering

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.

4 Β· LLM classification

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

5 Β· Three-agent LangGraph workflow

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
Loading

6 Β· Backend and frontend

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

πŸ“Š Results

All numbers below come from the paper. Evaluation used a held-out 20% test split (19,093 entries).

Headline metrics (TinyLLaMA-1B)

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

Confusion matrix

TinyLLaMA-1B confusion matrix

Model comparison

Fine-tuned model comparison

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 ⚠️ Partial (overfits, weak on unseen formats)
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.

Why semantic embeddings? (anomaly pre-filter)

TF-IDF vs MiniLM with Isolation Forest

MiniLM + Isolation Forest reaches 0.88 F1 versus 0.58 for TF-IDF + Isolation Forest.

Why data balance matters

Dataset construction stages

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%.

Latency and resource footprint

Per-stage latency

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

System testing

  • βœ… 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

πŸ“ Repository Structure

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

πŸš€ Quick Start

Prerequisites

  • Python 3.10+
  • NVIDIA GPU with β‰₯ 4 GB VRAM (for local LLM inference)
  • Microsoft SQL Server (for the LOG_DB database)
  • An SMTP account for critical-alert emails

1 Β· Clone and set up the environment

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\activate

2 Β· Install dependencies

pip install streamlit requests pandas matplotlib
pip install fastapi uvicorn langgraph langchain
pip install torch transformers sentence-transformers scikit-learn

3 Β· Start the backend API

The 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 --reload

4 Β· Launch the dashboard

streamlit run pages/Landing_page.py

5 Β· Reproduce the experiments

Open the notebooks in order:

  1. Stage_1/ β€” preprocessing and dataset construction
  2. Stage-2/ and Isolation_Forest.ipynb β€” embeddings and anomaly detection
  3. Stage_3/ and FineTuning_part2_*.ipynb β€” fine-tuning
  4. Classifier_Agent.ipynb and AI_Agent/ β€” agent workflow

πŸ—ƒοΈ Dataset

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.


⚠️ Limitations & Future Work

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

πŸ“š Citation

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}
}

πŸ‘₯ Authors

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.


πŸ“„ License

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.

About

Threat Track AI: A Scalable Multi-Agent Framework for Automated Cybersecurity Log Analysis and Threat Detection | 6th International Conference on Digital Futures and Transformative Technologies (ICoDT2)

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages