Inspiration

At UC Berkeley, we frequently experience scenarios walking home alone late at night, regretting the path we took down that dark alleyway or hoping we had someone with us.

What we created

This inspired us to create SafeRoute, which automatically finds the safest routes based on historical crime data. Additionally, we added a user self-report feature with uses Groq to classify user incident photos and add them to the map.

How we built it

The site's crime database based on PostGre SQL has two sources: publicly scraped incident data and self-reported incidents from the application itself (described and classified through groq). These two kinds of incidents are entered into the postgresql database. When the user queries a new route, we use mapbox to identify relevant road segments by using a modified dijkstra algorithm to traverse a K-dimensional Tree data structure with weighted edges that generates the shortest path from point a to b. We decided that the edge weights should be calculated using a cost function based on multiplying time, crime severity score, and distance, in which the algorithm finds the closest unvisited node to take its next direction.

Challenges we ran into

  • The public records site with the dataset we were scraping from coincidentally began requiring auth for API requests the second day of the hackathon, leaving us very confused. Luckily we found a workaround.
  • Figuring out how to incorporate road pathing (valid path recognition) was very difficult considering that we had to still have the algorithm optimize for safety.

Accomplishments that we're proud of

  • The routing algorithm
  • Very strong image recognition accuracy
  • Frontend Development
  • Team communication

What we learned

  • Docker
  • Postgresql
  • Mapbox
  • Common routing/pathing algorithms

What's next for SafeRoute

Next, we plan on expanding the platform to have even more advanced routing for safest routes and customized settings. We would also like for SafeRoute to eventually be compatible with Google Maps because of the user concentration. Additionally, we would like to have live rerouting in the case of new incidents.

Share this project:

Updates