🚉 Crowd Flow Optimiser (NDLS Transit Hub Edition)
Predictive crowd density forecasting and autonomous safety rerouting powered by Deep Learning, Hugging Face Hub, and Real-Time Graph Simulation.
📌 Overview
Crowd Flow Optimiser is an end-to-end spatiotemporal monitoring and decision-support system designed to prevent crowd surges, bottlenecks, and stampede risks at high-density transit hubs (demonstrated on the New Delhi Railway Station / NDLS Metro Hub).
Unlike traditional post-incident crowd management software, this platform predicts capacity breaches minutes before they occur, autonomously recalculates network flow, and generates instant PA announcements and security directives using an open-weights Large Language Model.
🚀 Key Features
- Custom PyTorch Time-Series Engine: A custom LSTM neural network forecasting multi-node occupancy trends (Hosted on Hugging Face Hub:
shivam2e2/crowd-flow-model).
- Real-Time Graph Simulation: Macro-level directed graph dynamics modeled with
NetworkX and served via asynchronous WebSockets in FastAPI.
- Autonomous Security Directives: Hugging Face Inference API (
Meta-Llama-3-8B-Instruct) generates actionable diversion commands and PA announcements when capacity thresholds are breached.
- Interactive Command Dashboard: High-contrast, neon-styled 3-column transit layout (Concourse $\rightarrow$ Ticketing $\rightarrow$ Platforms) with live metric updates, bottleneck visualization, and an inline Map Builder.
🛠️ Tech Stack
| Layer | Technologies |
|---|
| Frontend | React 18, Vite, Tailwind CSS, WebSockets |
| Backend API | FastAPI, Uvicorn, Python asyncio, NetworkX |
| AI / Machine Learning | PyTorch (Custom LSTM), Hugging Face Hub, Hugging Face Datasets |
| LLM Reasoning | Hugging Face Serverless Inference API (Meta-Llama-3-8B-Instruct) |
🔮 Production Data Pipeline (Hugging Face Integration)
While synthetic data was utilized during the 24-hour hackathon sprint to rapidly prototype our physics simulation, the backend is natively wired to process state-of-the-art vision and audio datasets directly from the Hugging Face Hub.
Our dynamic graph simulation replaces synthetic nodes with live streams from:
- Crowd Density Tracking:
UniDataPro/crowd-counting and rootstrap-org/crowd-counting
- Pedestrian Vector Trajectories:
2uanDM/p-destre
- Privacy-Preserving Anomaly Telemetry:
urbanaudiosensing/ASPED
See backend/hf_data_pipeline.py for the pipeline implementation bridge.
🔄 Automated MLOps & Continuous Training
The backend/hf_model_trainer.py module establishes an end-to-end MLOps pipeline. It enables the system to continuously ingest real CCTV density datasets, fine-tune the PyTorch crowd-flow LSTM model on new environmental constraints, and automatically deploy the updated weights (model_weights.pth) back to the Hugging Face Hub for instant edge inference scaling.