Example queries of the crime score lookup system.

Crime is an unfortunate byproduct of urban life, and Mexico City has a particularly high crime incidence. While locals are good at estimating a zone's risk level due to experience or anecdote, those unfamiliar with the area in most likelihood would lack a point of reference as to what measures to take in order to keep themselves safe.

Even though Mexico City has an open database of all reported crimes, quickly estimating a zone's relative danger based on the raw data is a complex task that cannot be feasibly solved because of its large volume and discrete format. Even when filtering by time and geography, sometimes crimes simply don't get reported. To solve this issue, I implemented a system that can estimate the crime level (a normalized score of how many crimes have occurred in a 100 meter radius in the last 30 days) based on a small subset of crimes in the last 10 days.

The solution implements a Nearest-Neighbor Regression with a Deep Neural Network that can interpolate the crime score at any point in Mexico City using the 10 nearest reported crimes in the reduced dataset. Both natural language queries and direction lookups are supported due to integration with the Google Maps API.
So that the system may be quickly deployed and queried, an ANNOY index adapted for geographic approximate nearest-neighbors lookup is used. This allows the system to be quickly scaled up and adjusted periodically.

The repository for this project can be found here.

You may also like

Back to Top