GitHunt
DA

davidcocc/RAIDEN

RAIDEN: Real-world Attack and Incident Detection ENgine

RAIDEN: Real-world Attack and Incident Detection ENgine

YOLO
Roboflow Badge
Python Badge

A simple browser-based interface to run YOLO and RF-DETR on images and videos. It features real-time multi-class tracking with persistent IDs, vehicle–person collision detection (time-to-collision based), and gun/explosion threat heatmaps.

This project was developed as part of the Master's thesis in Computer Science at the University of Salerno, carried out during a research internship at the Jheronimus Academy of Data Science (JADS) in 's‑Hertogenbosch, The Netherlands πŸŽ“.

πŸš€ Features

  • Image and video inference (JPG/PNG and common video formats)
  • YOLO and RF-DETR model support
  • Real-time per-class tracking with stable IDs and on-frame overlays
  • Vehicle–person collision detection using geometric TTC heuristics
  • Threat heatmap overlay for guns and explosions
  • Gradio-based UI, runs locally in your browser

πŸ“ Project Structure

MasterThesis/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ inference/
β”‚   β”‚   β”œβ”€β”€ yolo_inference.py          # YOLO inference pipeline
β”‚   β”‚   └── rfdetr_inference.py        # RF-DETR inference pipeline
β”‚   β”œβ”€β”€ temp/
β”‚   β”‚   └── outputs/
β”‚   β”‚       β”œβ”€β”€ yolo/
β”‚   β”‚       β”‚   └── video_results/     # YOLO processed videos
β”‚   β”‚       └── rfdetr/
β”‚   β”‚           └── video_results/     # RF-DETR processed videos
β”‚   β”œβ”€β”€ stats/                         # JSONL logs (e.g., collisions.jsonl)
β”‚   β”œβ”€β”€ weights/
β”‚   β”‚   β”œβ”€β”€ yolo/weights_yolo.pt       # YOLO weights (required)
β”‚   β”‚   └── rf_detr/weights_rfdetr.pt  # RF-DETR weights (required)
β”‚   └── main_gradio.py                 # Main UI
β”œβ”€β”€ requirements.txt                   # Python dependencies
β”œβ”€β”€ run_server.py                      # Launcher
└── README.md                          # This file

πŸ› οΈ Installation

Prerequisites

  • Python 3.8+
  • pip

Setup

  1. Clone the repository
git clone <repository-url>
cd MasterThesis
  1. Install dependencies
pip install -r requirements.txt
  1. Place model weights
  • YOLO: put weights at backend/weights/yolo/weights_yolo.pt
  • RF-DETR: put weights at backend/weights/rf_detr/weights_rfdetr.pt
  1. Run the server
python run_server.py
  1. Open the browser

🎯 Usage

  1. Upload a video file (or supported media)
  2. Choose the model (YOLO or RF-DETR) and set confidence threshold
  3. Start inference; the processed video and status message will appear in the UI

Supported Formats

JPG, JPEG, PNG, BMP, TIFF, MP4, AVI, MOV, MKV, WMV, FLV, WebM

Outputs

  • Processed videos are saved under:
    • backend/temp/outputs/yolo/video_results/ (YOLO)
    • backend/temp/outputs/rfdetr/video_results/ (RF-DETR)

βš™οΈ Configuration

  • Confidence threshold: controlled via the UI slider
  • Advanced parameters (e.g., collision thresholds, tracker settings, threat weights) are defined in:
    • backend/main_gradio.py wrappers (default values passed to inference)
    • backend/inference/yolo_inference.py and backend/inference/rfdetr_inference.py

πŸ”§ Development

  • backend/main_gradio.py β€” Gradio interface and app wiring
  • backend/inference/yolo_inference.py β€” YOLO inference pipeline, tracking, overlays, logging
  • backend/inference/rfdetr_inference.py β€” RF-DETR inference pipeline, tracking, overlays, logging
  • run_server.py β€” launcher and temp directory management

Logs and debug

  • Console logs are printed during runtime
  • Check temporary files under backend/temp/ and outputs under backend/temp/outputs/
davidcocc/RAIDEN | GitHunt