SafeSteps AI: The Safest Way Home in Toronto
About the Project
Every year Toronto records more than 70,000 crimes — assaults, robberies, car thefts, and violent incidents. If you’ve lived here for years, you already have that “street instinct”: you know which corner to avoid after dark, which alley feels wrong, which path is safe.
But millions of people don’t have that instinct yet:
- International students arriving at 11 PM with suitcases
- Tourists stepping out of Union Station
- Newcomer families with kids
- Uber and delivery drivers working late in unknown neighborhoods
For them, one wrong turn can be dangerous.
SafeSteps AI fixes that. We turn public crime data into a real-time, street-by-street safety map so everyone — from day one — can walk, bike, or drive the safest possible route.
What Inspired Me
I saw too many friends and classmates feel scared just because they didn’t know the city yet. Safety shouldn’t require years of experience. It should be on the map.
How I Built It
Data Sources
- 10+ years of Toronto Police Public Safety Data (158 neighbourhoods)
- OpenStreetMap full topology (11,000+ intersections, 13,000+ street segments, POIs, lighting, etc.)
- 10+ years of Toronto Police Public Safety Data (158 neighbourhoods)
Geospatial Processing (Python)
- Point-in-Polygon: every intersection inherits its neighbourhood’s crime rate
- Feature engineering:
- Density of bars/clubs in 100 m radius
- Street type & hierarchy
- Intersection complexity (number of connected roads)
- Density of bars/clubs in 100 m radius
- Final risk score (0–100) per intersection using weighted formula
- Street segments = average of their two endpoints
- Point-in-Polygon: every intersection inherits its neighbourhood’s crime rate
Graph & Routing
- Built weighted graph with NetworkX
- A* algorithm finds the safest path (not the shortest)
- Built weighted graph with NetworkX
Web App
- Leaflet.js dark-mode interactive map
- Streets colored green / yellow / red
- Real-time route calculation
- Click any street → see exact risk score and reasons
- Leaflet.js dark-mode interactive map
Live Updates
- Google Gemini API reads Toronto Police press releases and news daily
- Automatically adjusts risk weights when new incidents are reported
- Google Gemini API reads Toronto Police press releases and news daily
Challenges I Faced
- Merging neighbourhood-level crime data with street-level geometry (solved with spatial indexing)
- Keeping the app fast with 11,000+ nodes (vectorized calculations + caching)
- Making sure the map informs without stigmatizing communities (transparent methodology + focus on infrastructure factors)
Built With
- Python
- GeoPandas, Shapely, NetworkX
- Leaflet.js
- Google Gemini API
- OpenStreetMap
- Toronto Police Open Data
- Vercel (hosting)
Try It Out
- Live App → https://youtu.be/M0kzqOYuxMA
- GitHub Repo → https://github.com/Solarcemir/SafeSteps_AI
Project Media
(Upload these 4 images to Devpost – they look professional on dark background)
- Data fusion & point-in-polygon diagram
- Risk score formula with weights
- Shortest vs safest route example (Union Station → TMU)
- Screenshot of the live interactive map
Video Demo (90 seconds) → https://youtu.be/M0kzqOYuxMA
SafeRoute AI is more than an app — it’s a step toward UN SDG 11 (Sustainable Cities), SDG 9 (Innovation), and SDG 16 (Peace & Justice).
Let’s make Toronto the first big city where safety is truly available to everyone, from day one.
Built With
- css
- geminiapi
- html
- javascript
- jupyter
- pandas
- python
Log in or sign up for Devpost to join the conversation.