Inspiration

Deer-vehicle collisions kill over 2 million deer per year. This also has a significant toll on humans, as over 400+ human lives are taken in these collisions, with yearly property damage from these collisions reaching nearly $10 billion. Yet, only some of these risky areas have a simple standard yellow, diamond-shaped warning sign. But this static sign cannot tell you whether that spot is still a risky spot. It cannot adapt to variations in season and where the deer potentially migrated to. Plus, it is not feasible to place additional warning signs across the entire US covering all the potentially risky areas. This is when the idea clicked. Why not help improve this structure and make it more dynamic through the use of technology?

What it does

DeerAware is a dynamic, real-time, location-aware iOS app that predicts risky areas for deer-vehicle collisions and displays them on a live map. It combines historical collision data (over 440k+ data points) to determine three parameters: where the collisions are clustered, how the risk shifts across different months of the year, and how the deer patterns vary throughout the day. These factors are then multiplied to create a risk score for points along your route. This app can also help you plan for the optimal departure time. The navigation map is overlaid with a color-coded heatmap and a color-coded route to help you determine if you are driving through high-risk locations at that given time. This entire app runs on the device itself, meaning that no location data ever leaves the phone and can also work offline, making it an extremely secure and reliable service.

How we built it

I started by researching datasets to find deer-vehicle collision reports. I used "Deer-vehicle collision data for 23 states of the United States" By Callan Cunningham. After conducting data analysis, however, I noticed that only some of these states had the exact coordinates of the accidents. So after cleaning the collision data, I had 440k+ records for 9 states.

I then built a kernel density estimation model using SciPy for three primary parameters: seasonal risk, collision hotspots, and time of the day.

I then converted the data into a grid file and JSON for the multiplier tables, so that it could be easily implemented into the iOS app, instead of having to host a server for running the model.

I built the app using SwiftUI and leveraged the MapKit framework for routing and live location. I was also able to overlay the heatmap of collisions using Core Graphics, and built the route-scoring feature that highlights the riskiest points along the planned trip.

Challenges we ran into

My initial plan was to use XGBoost because it shows which risk factors matter the most for the final decision and predicts categorical outcomes. But my dataset only contained points for when the accidents occurred. This means I only had bad events, but no confirmed clean examples of safe non-events. Without those non-event examples, I couldn't train a conventional supervised classifier to distinguish high-risk from low-risk conditions. So I resorted to using a purely statistical mathematical model that uses kernel density plotting to determine weightings for each of my three parameters.

Accomplishments that we're proud of

I am most proud of building a working risk model from scratch and shipping it to an iOS app, which turned raw collision records into a tool that can help save lives. I am also proud of making my app privacy-respecting and creating an app that can be used anywhere, even in places with no internet.

Another thing that I am proud of is that this model does not run on a server meaning it is completely on-device, making it actually easy to sustain!

What we learned

I learned how to use geospatial data and turn it into usable data points to build an accurate model, and how to present it through iOS frameworks. Additionally, I got to learn more about how I can port a model across different languages and the vulnerabilities that it exposes. This helped me learn more about data scrutiny and re-validating formulas across different languages.

What's next for DeerAware

DeerAware can be improved to incorporate more real-time inputs, like weather and traffic, to further the accuracy of the current predictive pipeline and make it more dynamic. Additionally, being able to partner with insurance companies can help get access to even more data, which can expand the app's reach to even more states and potentially even countries. I would also like to bring this same app for Android users as well, making it more accessible for all.

Built With

Share this project:

Updates

Submission history