https://github.com/xinyilai00/SafeRoute

Inspiration

Most navigation apps are coded for speed and disregard safety factors such as turns and crashes. Elderly drivers and teens with minimal experience can easily get stranded, stuck, or hurt while using current navigation apps. We wanted a navigator that prioritizes safety first and an application that treats road conditions and crash risks as part of the route.

What it does

SafeRoute is an iOS navigation app currently for Austin. You pick a driver profile (teen, elderly, or sensitive passenger) and a destination. It optimizes the best route which includes safety and time constraints. It also shows how many minutes the safer route adds and how much lower its crash risk is. The route avoids high-crash roads and risky maneuvers such as unprotected left turns across fast roads, highway merges, and U-turns. For sensitive passengers it also avoids curves and rough pavement. The map has a crash-risk heatmap and hazard markers, and a heads-up when it’s raining. You can also choose to avoid tolls or highways.

How we built it

  • App: SwiftUI and MapKit.
  • Routing: a Python FastAPI backend gets up to five alternative routes from GraphHopper, times them with live TomTom traffic, and drops routes through road closures.
  • Risk model: about 233,000 Austin Vision Zero crashes combined with TxDOT traffic counts. We measure crash risk per vehicle-mile, so a busy road isn’t penalized just for having more cars.
  • Route choice: each route’s crash risk and maneuver penalties are traded off against time, within a detour cap that differs by profile. Elderly is the most safety-first, teen the least.
  • Data layer: traffic signals, street condition, weather, and a pipeline that refreshes the data weekly through a GitHub Action. The pipeline accepts an update only if it passes a numeric check against crashes the model hasn’t seen.

Challenges we ran into

  • Raw crash counts penalized highways just for carrying more traffic making busy roads look more dangerous than they really are. We rebuilt the model per vehicle-mile, which more than doubled the safety gain in our test.
  • Our application ran into challenges trying to calculate an honest evaluation with accurate data. So, we chose every setting on an earlier period (models through 2021, judged on 2022–23) and used 2024–25 only to confirm.
  • We also encountered messy data, matching crashes to roads, a placeholder traffic count on many local streets, and frontage roads next to highways.

Accomplishments that we're proud of

On 200 random Austin trips, judged on 2024–25 crashes the model saw:

  • Per-vehicle crash risk drops by about 21–24% versus the fastest route, for about half a minute of extra driving on average.
  • The safer route wins on almost all trips it changes (42 to 6 for teen, 48 to 8 for sensitive passenger, 52 to 12 for elderly).
  • When the model calls one route safer than another, it’s right in 82% of pairs, against 63% for the older crash-count model.

What we learned

  • How to coordinate a technical project between multiple teammates working on different parts.
  • How to generate data and tweak parameters accordingly
  • OSM, Graphhopper, TomTom API, Gemini API
  • Xcode and iOS features

What's next for Safe Route

Next, we want to test SafeRoute with real drivers and expand beyond Austin. We also plan to let riders choose between routes based on their own safety and speed preferences.

Built With

Share this project:

Updates

Submission history