Inspiration

The recent rise of hate crimes against marginalized communities, with a 537% increase in SF and 361% in NYC, stresses the need for individuals to be equipped with the most up to date knowledge of the risk of hate crimes for their particular city. With the hope to reduce future hate crimes, such as the attack against Michelle Go (where a man pushed her onto an incoming subway train in NYC), we strived to build an app using the most recent locations of hate crime data so all users, especially those at a higher risk due to their identity, can more safely navigate their cities.

What it does

Our web app allows users to input personal information such as gender, religion, race, etc, and our algorithm predicts the relative danger indices (value from 0-1) for each of New York's 77 precincts, where an index closer to 0 signifies a safer area for that demographic. We then visualize this data on a heatmap using the Google Maps API so users can better understand their risk of hate crimes in their area. Areas with higher rates of hate crimes are indicated by a redder tone to denote the risk of violence in the precinct, personalized for each user. Every time a different user chooses their personal demographics, the heat map redistributes to display the updated frequency and location of incidents by the user's criteria.

How we built it

We cleaned and processed the New York City hate crimes dataset using R and pandas to observe relationships between personal demographics such as race, age, gender, and religion and the relative safety of the different precincts. For our data visualization, we utilized ggplot and dplyr libraries in R to process and display trends in our data. Then, we performed linear regression to predict the ideal precinct based on one's selected attributes. We utilized Python's Django web-framework for the backend where we calculated a danger index per precinct dependent on the user's inputted demographics. Then, we implemented the Google Maps API to build the heat map as well as Javascript, HTML, CSS, and Bootstrap for the front end.

Challenges we ran into

Finding the dataset fit for our task and cleaning the data proved more challenging than we originally though. Most of us were not familiar with full-stack development so we had to learn Django and Javascript as we went. We also had never worked with Google Maps API so implementing it to fit our needs and reflect our data proved difficult. We had to make sure our user could input their demographics, that we could process that data to calculate a safety index for each of NYC's 77 precincts, and visualize the resulting numbers into a simple heatmap.

Accomplishments that we're proud of

  • The fact that we were able to create an app based off our statistical models.
  • Able to function with only 2 hours of sleep.
  • Learning how to incorporate large chunks of data and clean it in a way to benefit us
  • Our first datathon!

What we learned

  • How to clean data and sort it out.
  • How to create a heat map.
  • How to use multiple front-end and back-end languages to create one unifying project

What's next for SafeCity

We built this app centered on NYC data as hate crimes remain highly prevalent here. However, with the rise of violence towards marginalized communities in other cities such as San Francisco and Seattle, we wish to expand our app to serve various cities.

Share this project:

Updates