RAIDEN: Real-world Attack and Incident Detection ENgine
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
- Clone the repository
git clone <repository-url>
cd MasterThesis- Install dependencies
pip install -r requirements.txt- 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
- Run the server
python run_server.py- Open the browser
π― Usage
- Upload a video file (or supported media)
- Choose the model (YOLO or RF-DETR) and set confidence threshold
- 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.pywrappers (default values passed to inference)backend/inference/yolo_inference.pyandbackend/inference/rfdetr_inference.py
π§ Development
backend/main_gradio.pyβ Gradio interface and app wiringbackend/inference/yolo_inference.pyβ YOLO inference pipeline, tracking, overlays, loggingbackend/inference/rfdetr_inference.pyβ RF-DETR inference pipeline, tracking, overlays, loggingrun_server.pyβ launcher and temp directory management
Logs and debug
- Console logs are printed during runtime
- Check temporary files under
backend/temp/and outputs underbackend/temp/outputs/
On this page
Contributors
MIT License
Created August 16, 2025
Updated March 12, 2026