APEX
Advanced Predictive Engine for X-Sectoring
Inspiration
Crowd management is often reactive rather than predictive. The Bengaluru Crowd Crush (2025), where 11 people lost their lives and more than 50 were injured, highlighted the need for real-time crowd guidance. Inspired by Formula 1 strategy systems, we built APEX to help people make safer movement decisions before congestion becomes dangerous.
What It Does
APEX is a real-time crowd intelligence platform that uses live GPS telemetry to monitor nearby crowd activity and provide situational awareness through an interactive radar interface. By transforming raw location data into actionable insights, APEX helps users make safer navigation decisions in crowded environments.
How We Built It
Telemetry Layer
APEX continuously collects live GPS coordinates from participating devices. Telemetry updates create a dynamic representation of crowd movement and allow the system to monitor nearby activity in real time.
Processing Layer
A Python FastAPI backend processes incoming telemetry streams, filters active devices, and performs geospatial computations with low latency. The processed data is synchronized through Supabase and made instantly available to connected users.
Geospatial Intelligence Engine
Distance Estimation (Haversine Formula)
To calculate the distance between two users on Earth's surface, APEX uses the Haversine Formula:
$$ a = \sin^2\left(\frac{\Delta\phi}{2}\right) + \cos(\phi_1)\cos(\phi_2)\sin^2\left(\frac{\Delta\lambda}{2}\right) $$
$$ d = R \cdot 2\arctan2(\sqrt{a}, \sqrt{1-a}) $$
Where:
- R = Earth's radius
- φ (phi) = latitude
- λ (lambda) = longitude
- d = distance between two GPS points
This enables accurate proximity detection between nearby participants.
Direction Estimation (Forward Azimuth)
To determine the relative direction of nearby users, APEX calculates the forward azimuth (bearing):
$$ y = \sin(\Delta\lambda)\cos(\phi_2) $$
$$ x = \cos(\phi_1)\sin(\phi_2) - \sin(\phi_1)\cos(\phi_2)\cos(\Delta\lambda) $$
$$ \theta = \operatorname{atan2}(y, x) $$
The resulting bearing allows the platform to understand where nearby users are positioned relative to the current user.
Radar Projection Model
Once distance and bearing are known, APEX converts real-world coordinates into a normalized radar visualization:
$$ Ratio = \frac{Distance}{MaxRadius} $$
$$ x = 0.5 + 0.5 \cdot Ratio \cdot \sin(\theta) $$
$$ y = 0.5 - 0.5 \cdot Ratio \cdot \cos(\theta) $$
This enables nearby crowd activity to be displayed as radar blips, creating a responsive situational awareness interface.
AI Prediction Engine
To move beyond reactive crowd monitoring, APEX incorporates a lightweight TensorFlow/Keras neural network that performs real-time crowd forecasting and hazard detection.
The model analyzes key crowd dynamics such as:
- Current crowd density
- Predominant movement direction
- Opposite-flow activity
Using these signals, APEX predicts future crowd density and identifies potential counter-flow hazards before they become critical. This predictive layer enables proactive crowd management rather than simply reporting existing conditions.
Model Performance
| Metric | Value |
|---|---|
| Accuracy | 91% |
| Mean Absolute Error (MAE) | 1.83 |
| Loss | 5.04 |
Risk Assessment Layer
Based on proximity calculations, APEX continuously evaluates nearby activity and classifies surrounding conditions into safety levels, enabling real-time alerts and crowd awareness.
Visualization Layer
Leaflet.js powers the mapping and visualization engine, providing real-time spatial awareness and interactive crowd monitoring capabilities.
Technology Stack
| Layer | Technology |
|---|---|
| Frontend | React |
| Backend | Next.js |
| API | Python FastAPI |
| Maps | Leaflet.js |
| Database | Supabase (PostgreSQL) |
| Deployment | Vercel |
| Mobile Access | Progressive Web App (PWA) |
Challenges We Ran Into
- Handling noisy and inconsistent GPS data from mobile devices
- Maintaining low-latency updates across multiple simultaneous users
- Converting raw geospatial coordinates into intuitive radar visualizations
- Balancing performance and responsiveness on mobile devices
Accomplishments That We Are Proud Of
- Creating a proactive rather than reactive approach to crowd management
- Building a solution applicable across events, stadiums, metro networks, and large public gatherings
- Developing a complete Telemetry to Logic to Instruction pipeline that works end to end in real time
What We Learned
- How to build a functional real-time crowd intelligence platform from scratch
- Implementing live geospatial proximity detection at scale
- Developing a radar-based crowd awareness interface on mobile browsers
- Demonstrating a practical and deployable approach to proactive crowd safety
What's Next for APEX
- Enhanced forecasting using real-world crowd datasets
- Emergency evacuation route optimization
- Smart-city and public infrastructure integration
- Advanced crowd analytics and anomaly detection
Built With
- fastapi
- leaflet.js
- next.js
- postgresql
- python
- react
- supabase
- vercel
Log in or sign up for Devpost to join the conversation.