Inspiration

All of us had just moved to Chicago. One night, walking back around 11 PM, we followed the “fastest route” from a navigation app. Later, we found out that stretch had multiple assault incidents that same week. Nothing happened — but it easily could have.

That stuck with us.

Navigation software optimizes for time, distance, and tolls. It never asks, “Maybe don’t take this street alone at midnight?”

Chicago publicly reports tens of thousands of crashes and thousands of crime incidents. The data exists. It’s open. But it isn’t used to help people navigate more safely.

So we built SafePath.

What It Does

SafePath is an AI-powered navigation app that routes users around danger — not just traffic.

It pulls 49,505 crash records and thousands of crime reports from Chicago’s open data portal, maps them onto a street-level H3 hex grid, and finds a path that is actually safer.

On average, users trade just 2–3 extra minutes for up to 40% less risk.

It works across travel modes:

  • Drivers — weighted toward crash risk
  • Pedestrians — weighted toward crime risk
  • Cyclists — balanced between crash and crime exposure

Users simply talk to it naturally:

“Drive me from O’Hare to downtown during rush hour.” “Walk me from Millennium Park to Navy Pier, it’s late and I’m alone.”

The AI extracts origin, destination, time context, travel mode, and safety priority from a single sentence.

How We Built It

Routing Engine

Each street segment is mapped into an H3 hexagonal cell (resolution 9). Each cell receives a risk score (0–100) based on:

  • Severity-weighted crash density
  • Type-weighted crime density
  • Hour-of-day multipliers
  • Live weather multipliers

Routing is performed using NetworkX with a custom cost function:

cost = travel_time + (beta × risk_score)

The parameter beta adjusts how much the user prioritizes safety. The AI infers this dynamically from user language.

Two routes are returned:

  • Fastest route
  • Safest route

AI Integration (Gemini)

Gemini is the intelligence layer of the system:

  • Gemini 3 Flash — natural language parsing and conversational routing assistant
  • Gemini 3 Flash — route safety summaries and contextual explanations
  • Gemini 2.5 Flash TTS — natural voice navigation output

Parsing and conversational generation run in parallel using ThreadPoolExecutor to maintain sub-second responsiveness.

Tech Stack

  • React 19 + Mapbox GL JS (Frontend)
  • Flask + NetworkX + H3 (Backend)
  • GeoPandas + OSMnx (Spatial processing)
  • Open-Meteo API (Live weather)

Challenges We Ran Into

  • Dynamic Risk Modeling: Risk shifts significantly by hour (peak crash density can be ~7x higher than low-risk hours).
  • Balancing Safety vs Speed: Avoiding extreme detours while still meaningfully reducing exposure.
  • Real-Time Voice Navigation: Implementing a two-tier alert system for advance and urgent turn warnings.
  • Data Cleaning: Ensuring all 49,505 crash records were fully geocoded and temporally structured.

Accomplishments We’re Proud Of

  • Built a full city-scale safety routing engine during a hackathon
  • Achieved ~40% average risk reduction
  • Integrated AI as the primary interface layer
  • Designed a city-agnostic and scalable architecture
  • Enabled contextual routing based on time, weather, and travel mode

What We Learned

  • Safety is multidimensional and time-dependent
  • Users value understanding trade-offs, not just alternate routes
  • Natural language reduces navigation friction dramatically
  • Risk-aware routing requires optimization beyond shortest-path algorithms

What’s Next for SafePath: AI Navigation That Prioritizes Safety

  • Expand beyond Chicago using other cities’ open data
  • Integrate live traffic and emergency incident feeds
  • Add community-reported safety signals
  • Introduce personalized safety profiles
  • Enable offline mode with cached risk tiles
  • Deploy as a production-ready mobile application

Built With

Share this project:

Updates