About the Project: CROWDSHIELD
Inspiration
As we approach the 2026 FIFA World Cup, American civic infrastructure faces an unprecedented stress test. When European cities host mega-events, their century-old, hyper-dense transit webs absorb surges of 80,000 fans seamlessly. However, American host cities—like Atlanta and Seattle—are fundamentally car-centric. Our stadiums are serviced by limited rail bottlenecks and surrounded by massive, gridlock-prone surface parking lots.
Currently, city authorities manage crowd control reactively. They only know a transit platform is at critical capacity—or that a parking lot has trapped thousands of frustrated drivers alongside vulnerable pedestrians—when it's already too late.
We realized that infrastructure collapse isn't just a matter of volume; it is driven by human psychology and emotion. If the home team is losing 35-0 in the 3rd quarter, 40,000 angry fans will abandon the stadium simultaneously, 45 minutes early. This unpredictable, localized population explosion leads to two fatal scenarios: Transit Platform Crushes and Golden Hour Gridlock (where ambulances are trapped by fleeing crowds).
We built CROWDSHIELD to eliminate the "blind spot" of reactive crowd management and buy emergency dispatchers the most valuable resource in a crisis: Time.
How we built it
CROWDSHIELD is a predictive crisis triage engine that connects what happens on the field to what happens on the street. We architected a robust, edge-optimized "Agentic Stack":
The Dual-Stream Data Pipeline: We built an ETL pipeline using Python, FastAPI, and SQLAlchemy to fuse municipal transit APIs (Socrata) with live NFL Play-by-Play telemetry. To ensure our 24-hour interactive demo ran with zero latency, we pre-cached 1,440 minutes of simulation data into a local SQLite database.
The Prediction Engine: We trained an XGBoost model on historical game data. However, human safety requires planning for extreme edge cases, not averages. We implemented a Monte Carlo Simulation (10,000 permutations) to calculate the 95th-percentile worst-case Surge Velocity.
The surge velocity $V_{surge}$ is dynamically calculated as a function of score differential ($\Delta S$), time remaining ($T_{rem}$), and win probability ($P_{win}$):
$$V_{surge} = f(\Delta S, T_{rem}, P_{win}) \times \mathcal{M}_{momentum}$$
Where $\mathcal{M}_{momentum}$ is a stochastic multiplier applied during blowout conditions.
The Agentic Orchestrator (Pydantic AI): When the threat score breaches critical thresholds, our AI orchestrator takes autonomous action. To prevent fatal map hallucinations, we used Pydantic AI to enforce strict, type-safe JSON outputs. The agent evaluates the math, locks down overwhelmed transit nodes, and selects safe pedestrian and EMS routing payloads from a pre-verified array of coordinates.
The Tactical Frontend: We bypassed standard map libraries (like Leaflet or Mapbox) which proved too heavy. Instead, we built a bespoke, 60fps Hybrid HTML5 and React architecture. It features a custom-drawn vector basemap of Seattle, absolute HTML overlays for transit hubs, and a projector-optimized "Retro-Military HUD" aesthetic.
Challenges we ran into
The Data Scale Trap: Initially, we tried to use massive gigabyte-scale X/Y player tracking datasets, which crashed our local environments. We pivoted to structured Play-by-Play data, realizing that crowd emotion relies on momentum shifts, not player coordinates.
Agentic Hallucinations in the Physical World: Giving an LLM the power to draw maps is incredibly dangerous. If an AI hallucinates an ambulance route through a brick wall, people die. We solved this by using Pydantic AI to constrain the model, forcing it to choose from a strict schema of pre-verified GeoJSON routes rather than generating raw spatial coordinates.
Frontend Performance: Rendering thousands of dynamic route changes while scrubbing a 24-hour timeline caused massive UI lag. Ripping out heavy mapping libraries and writing our own HTML5 rendering engine instantly brought us to a silky-smooth 60fps.
What we learned
Psychology Dictates Traffic: Infrastructure planning usually revolves around train schedules, but emotionally driven mass-egress breaks all standard civic models. You cannot optimize stadium traffic without understanding the score of the game.
AI Sovereignty & Strict Guardrails: When building AI for municipal infrastructure and human safety, strict deterministic rails (like those provided by Pydantic AI's type enforcement) are vastly superior and infinitely safer than open-ended LLM reasoning.
Detailed Write up is at https://github.com/andomo3/hackalytics2026
Built With
- fastapi
- figma
- react
- sqlalchemy
- sqlite
- vite
Log in or sign up for Devpost to join the conversation.