SafeT.First: 2023 Toronto Accelerator Award winner

Safe.T.First
SafeT.First

Team members

Chloe Abbruzzese, Cynthia Lam, Dhwani Patel, Harjot Grewal, Samira Fairuz Ahmed, Yllka Bojku

Project summary

SafeT.First harnesses the power of ML models and historical crime data to provide Toronto’s pedestrians with safer route options, ensuring peace of mind on every walk!

Keywords

Crime data, Commute, Clustering, Empowering Safety, Google Map API, KNN Clustering, Machine Learning, Major Crime Indicators, Personal Safety Technology, Pedestrian Safety, Predictive Safety, Road safety, Real-time Data, Route Planning, Safety Score, Safest route, Safe Walking, Toronto city

Inspiration

In a world where safety and security are of paramount concerns, knowing what lies ahead on your journey is not just a convenience but a necessity. For every woman, there's a story of walking home late at night after a class, a long day at work, or traveling to a new city, and a common thread runs through these experiences—being on guard. It's a sad reality that women often find themselves in situations where personal safety becomes a primary concern.

“Anyone who looks over their shoulder too often or forces themselves to wear one earphone when out; to the sad truth of updating friends and family of your whereabouts with texts and live location tracking, all since you can never be sure what can happen next. It is all the sad and scary truth that I and so many others face every day when commuting, so I feel passionately about the purpose of this project and its ability to soar.”
– Chloe Abbruzzese

“In the days of being a cash-strapped student, I vividly recall spending my meager funds on a cab ride home after a grueling winter evening science lab. The weight of my concern for my safety outweighed the value of that money.”
– Harjot Grewal

Much like stories above, the solutions most women typically resort to are not a testament to convenience or freedom. They involve taking self-defense classes, clutching keys between clenched fingers, avoiding the use of earbuds, staying hyper-aware of their surroundings, or sometimes even opting to avoid certain routes altogether. These precautions, while important, should not be the only line of defense in a modern, technology-driven world.

Background

Safety concerns for pedestrians, both men and women, are heightened by numerous news reports and articles describing incidents of attacks and accidents in public spaces, as well as the inadequacy of measures in place to ensure their safety. These stories underscore the ongoing challenges individuals face when moving through urban environments. The frequent occurrence of such incidents emphasizes the pressing demand for holistic solutions that prioritize the safety and well-being of all pedestrians.The figure on the right demonstrates the major crime indicators just in Toronto.

In a time where technology has advanced to the point where it can predict the best time to avoid a route due to traffic, accidents, or adverse weather conditions, it's puzzling that there aren't readily available solutions to ensure safe walking. We can summon a rideshare vehicle with a few taps on our smartphones, order food from our favorite restaurants with ease, and have packages delivered to our doorstep within hours, all while benefiting from a layer of security that these services inherently provide.

It's high time that technology steps in to address the critical issue of personal safety during walking journeys. SafeT.First is the answer to this need, a groundbreaking app that leverages state-of-the-art algorithms and real-time data to predict the safety of your chosen walking route. It's a tool that not only recognizes the significance of your safety but also respects your time and your right to move freely.

With SafeT.First, you can have the confidence to pursue your daily activities, attend late-night classes, explore new cities, or simply enjoy a peaceful walk in your neighborhood without the constant burden of fear. We believe that technology should empower you to take control of your personal safety, just as it empowers you in so many other aspects of your life.

Your safety and peace of mind are at the heart of our mission. We understand the unique challenges pedestrians face, and we are committed to providing a solution that not only identifies potential risks but also offers alternative routes and access to a community of like-minded users who share safety tips and insights.

A major crime indicator dashboard for Toronto overlayed on a photo of downtown Toronto

List of Technologies

Backend: Google Colaborator, Python, Pandas, Numpy, Scipy, Pickle, Geopy, KMeans, K Nearest Neighbors, K Neighbors Classifier, Random (Generated Streetlight data), Safety Score Calculation function, Google Maps API, Polyline, gmplot

Front-end: Figma, HTML, CSS, Javascript, Procreate App (Logo), Google Slides (Presentation)

Project development

What does it do?

SafeT.First is an innovative application that addresses the common concern of feeling unsafe while traveling, particularly during late nights or in areas that are perceived as potentially risky. The main goal of the app is to help the user to choose the safest route for their commute. Hence, using this application a commuter, or tourists can navigate the city streets safely with confidence, and this significantly lowers the likelihood of accidents or other risks. Moreover, it utilizes machine-learning algorithms and Google Maps API to recommend safest routes to the user, and provide accurate directions.

How does it work?

When the user opens the application, they will be prompted to enter their starting point and end destination. Based on the data provided, the application recommends the safest routes to take. These recommendations use information from various datasets to alert users of historical crimes, potential dangers, and the length and elevation of each route, allowing users to make an informed choice about their path. While using the recommended route to reach the desired destination, users have options to call helpline numbers in case of any emergency or if they feel unsafe during their commute.

We used machine learning python libraries to perform data preprocessing and analysis, then train the models to recommend safe routes. Moreover, we utilized the Google Maps API to calculate routes that are both efficient and prioritize safety.

Example of the user interface for the SafeT.First application show on an iPhone

Use of Machine Learning

Using the K-nearest neighbors (KNN) algorithm for mapping nearby crime incidents to a centroid point in a targeted location and calculating a combined safety score is an excellent machine learning use case. The project comprises proximity based approach and real-time decision making. KNN is well-suited for proximity-based tasks where the outcome of a query is influenced by the proximity of its neighbors. In this case, crime incidents and safety scores of the desired neighborhood directly affect its safety assessment. One of the project goals is to incorporate real-time crime data to affect the safety scores and KNN enables this by providing real-time insights into safety conditions. As crime incidents are reported and updated, the KNN algorithm can quickly adjust its assessments, making it ideal for applications requiring dynamic and up-to-date information. Machine Learning models can be used for exploratory data analysis, identifying patterns and trends in crime incidents and safety scores that might not be immediately apparent. Moreover, it can be scaled for larger geographic areas and locations, making it adaptable to expanding the coverage of the application to include more cities or regions. Finally, the use of Machine Learning algorithms for safety assessment empowers users with actionable information. It enables them to make informed decisions about their routes and travel plans, enhancing their safety and confidence.

A map of Toronto highlighting real-time crime data.

Datasets

The year-to-date crime reporting dashboards page on the Toronto Police Services public safety data portal

We used data from the Toronto Police Services database and encompassed several crimes. We included information on pedestrian collisions, robberies, homicides, assault, thefts, and more. The data dated as far back as 2004 in some cases, so we chose to only include data from the previous decade.

Regarding the severity scores included in our safety calculation, we used an article published in 2019, “Route-The Safe: A Robust Model for Safest Route Prediction Using Crime and Accidental Data” as a basis for selecting the arbitrary scores for each crime, and included this in our final database.

Side-by-side safety comparison of two streets: On the left a poorly lit, dark street and on the right a well-lit route

Which road will make you feel safer during your journey?

Streetlights make you feel safer when walking at night by lighting up the way, preventing accidents, scaring off troublemakers, and just generally making you feel more secure. For our Project, we used simulated streetlight data. Using simulated data offers several advantages, particularly when official public data is not readily accessible. In this case, simulated data was generated using Python random generators to obtain geolocations of streetlights within the Toronto downtown region. Simulated data provides proof of concept, and data flexibility. It accelerates app development. Nevertheless, it’s essential to be transparent with users about the simulated nature of the data, ensuring trust and credibility, and planning for a transition to real data when it becomes available.

Impact and Innovation

Competitors

Competitor No. 1: CRIMEMAPPING.com

A big inspiration for our project came from this application started with the example of their map and the user interactiveness with it. The extensive zoom and easy scrolling make for an engaged user who can search their surrounding areas of crime swiftly. We disliked the inaccuracy and unfriendliness of the platform itself for crime awareness. When searching various locations in Toronto, since this is the focus location of our project, no results for the many crimes listed on their site showed up. In fact, no data for Toronto areas was displayed at all. The site has messages saying that they lack data, which is completely understandable, but as Toronto was our main location focus, we used this as a stepping stone for improvement. Another dislike was the unfriendliness of the site being unfavorable to use mobile devices in web or app form (the app form not existing). We feel that a safe commuting application should be available across all platforms for any age group or technical skill level differing group to use with ease. This site however does address the issue of creating a safe commute only in the part that covers mapping and plotting crime data yet missing the implementation of using it to produce a safer commute through route planning.

Competitor No. 2: WalkSafe App

The WalkSafe App was by far our closest competitor that mirrored our idea for SafeT.First. The main purpose of creating a safe commute checks in line with our main idea. However, we feel that with the consideration of working streetlight data and crime data from the Toronto Police Services, our application would be more beneficial for all Torontonians. The hypothetical still stands of course if we were to expand to more major cities and small rural areas, the usage of their public crime data would be used, too. We also found this competitor unfavorable for cross-platform usage, as they display a great website but mainly focus on a mobile user experience. Our largest con of inspiration was the unfair usage of their “WalkSafe Pro” feature which isn’t really a feature, but how you gain access to their app. A base plan for a group or organization that can be used for 0-10 people costs around $45 a month. By purchasing this subscription to safety, only then may one consider this as an alternative but in our opinion, safety shouldn’t have a cost. As well, due to this payment feature, a proper test demo was unable to be executed. From this example reinforcing our initial perspective on a fully accessible platform, the true idea that safety should be free to everyone who desires it will be something for us to further strive for, because safety shouldn’t cost a dime.

Competitor No. 3: Spot Crime Map

Spot Crime Map acts as the third and final puzzle piece to our idea of SafeT.First and that is the inspiration from their crime map. Though the look of the map itself feels outdated, the icons being plotted at proper intersections with a specific symbol per crime that contains a description when expanded upon is exactly what we had envisioned. Aside from the positive of each crime being linked to the source report, the negative of the case is that this map only displays crime from 2023. Though it may seem practical, we feel that keeping crime for about a few years before retiring from the map is essential as well as that we wish to keep a pinned record of all major crimes that have happened in a given area, no matter how old. With SafeT.First, we would further the usage of an ML model to then use collected areas of crime and hotspot those areas and neighborhoods based on how unsafe we rate them on a given scale. These are just additional ideas that we would love to implement in comparison to what we see as a base model with Spot Crime Map. Along with matching coordinates to the crime for better accuracy, expanding on the submission of a “helping community tip” option would take in the form of a live chat with the community where all can update crime in real time so others may take proper precautions. Essentially, this competitor seemed most efficient at plotting proper recent crime data and its ability to be interactive with a user though its downfall still lies with only being available through browser, not showing routes and has minimum features available.

Overall, we feel that each of these competitors were used for inspiration to specific parts of our project and as pieces of our larger puzzle, we used each inventive excellent example to benefit our end idea.

SafeT.First homepage with slogan “Safe navigation reimagined” and interface of the mobile app shown on an iPhone | Page d'accueil de SafeT.First avec le slogan "Safe navigation reimagined" et l'application mobile montrée sur un iPhone

Our Unique Solution

Our solution is unique because we are focused on integrating real crime data from the Toronto Police Department to address and plot where actual reported crimes have happened recently. With this crime data our goal is to create hotspotted areas on a map by neighborhood/area based on the amount of crimes that occurred there, how recent those crimes occurred and their severity. Creating a color-coded safety scale displayed on the map will give both locals and tourists, who may not be using the platform for safe route planning, an idea of what areas might be safer to venture into than others. Alongside hotspotting up-to-date police crime data, we want to integrate an area’s working streetlight data, since the most time people would desire to have a safe commute would be in darker hours. This extra bit of information will be taken into account for the overall safeness of a route or area statistic on our platform that a person may choose to plan for. In terms of the actual safe route planning, this other essential part of our project is to be an addition to a map feature such as Google Maps, which presents regular commuting routes but with SafeT.First, users will have different route options which take more of their safety into consideration. We feel this truly sets us apart from all other platforms that currently exist because with all the police department data, crime plotting, and route function, we combine all the information that is desired for consumers to have a safe commute.

Potential Harms

Although our intention with our project is to act as a safety tool for society, we acknowledge that through using AI, it’s impossible to be perfect. With the idea that we can hotspot areas and give them a ranking for level of danger based on the amount and severity of past occurring crimes, using ML to produce this means that our predictions may be biased or not completely accurate due to how much historic crime data we choose to include and its own reported accuracy. This coincides with another potential harm that is if people choose to solely rely on our application and something incidental were to happen to them. We feel this would occur when someone doesn’t use their better judgment of taking what’s in front of them in real life into account alongside our app’s safety suggestions, which is its intended purpose. To safely guide around this, on the opening welcome screen of our mock-up mobile app, we included a cautious “use at your own discretion and keep aware of your surroundings” message that users must read and agree to before continuing to use, reminding them that their safety is the most important priority. Overall, we feel that a tool such as our project should be used as access to more information to help someone make a more conscious decision about their travels, but not fully relied on due to its full unpredictability. In a worst case scenario, the harm resides in it being a liability for us and a danger for the user. Our idea to report crime not just from relying on police crime data but also having a community live crime chat box can also be a harm for those who choose to use this improperly to possibly spread misinformation and harm others. In this case, we feel a censor and verification method would need to be put in place, however, the original point still stands that no matter what, the suggestions from our platform should be taken as additional information for safety measures, not as a guide.

Challenges

Data Availability

This project presented us with many challenges, but our team triumphantly overcame them. For starters, we wanted to provide our users with streetlight data so they could be aware of and avoid broken streetlights that led to dimly lit areas. There was a lack of public data, so we temporarily simulated streetlights by creating a randomly generated dataset on their status on the map; functioning or broken. It was a good exercise for our growth and we incorporated it into our safety score calculation as a placeholder until we had further information. However, with our time constraints, we were unable to access real data.

Time Management

From the time restraint itself, we were unable to fully develop a prototype app for the project, with the main concern being that there was just too much we wanted to do with too little time to learn and implement. We had to decide whether the end goal of this project was to make it into its own platform or as an extension onto an existing application such as Google Maps. We decided to showcase our idea with the presentation as its own platform with a mock-up website and app how we wanted it to look, which can always be modified with upcoming changes. Along with that, our restricted time affected our overall presentation of our project. Our TA assisted us in coding up a proper website in HTML, with which remained incomplete, so we settled with mock-up boards on Figma to present with. The final challenge with the time restriction was once being thrown into the project, our focus target audience was only on walking commuters, although we like to pitch to all types of commuters.

Processing Power

Our biggest challenge was lack of resources. Big data requires huge computation power and we were limited with the constraints of Google colab. With access to higher computational resources and project finance we will be able to develop a more powerful version of the Project. Overall, the SafeT.First team effectively combatted each and every challenge that was thrown our way, successfully finishing strong to win the 2023 Toronto Accelerator Award.

What we learned & what we’re proud of

Lectures and Guest Speakers

Through the first few weeks of classes, tutorials, and amazing guest speakers, the AI4Good Lab made sure we were well equipped with the information and resources needed for our project. We learned the basics of machine learning with a crash course in several different algorithms and how to choose the best one for our project. The guest lecturers spoke on a variety of topics, teaching us how to manage projects, how to always be mindful of the implications of our actions, and what ethical considerations we need to adopt AI responsibly.

Hackathon

During the mini hackathon, we got to practice creating and pitching solutions. We worked with clean datasets to familiarize ourselves with the ever-important data pre-processing steps as well as python packages such as numpy, sklearn, pandas and seaborn that would help us later implement our project solution.

The Project

We learned so much from the fast-paced project weeks. Our mentor, Tahniat Khan, gave us an honest insight on AI project management from beginning to end. With her help, we stayed extremely organized, tracking our tasks and their dependencies, assigning roles within our team, and creating and maintaining a smooth workflow and smart deadlines.

We learned how to collaborate with teammates from all different educational backgrounds, with different levels of experience, and at different stages of their lives. The project development weeks taught us how to compromise and come together to complete an amazing project that we’re extremely proud of.

Personally, we’ve learned that sometimes we aren’t fully ready for the task at hand, rather it’s the task itself that prepares us. The Lab has taught us to simply get out there and get started. We’re both thankful and proud of everyone in the lab for creating a safe space for us to take that first step. Most importantly, we walked away with the idea that as women in STEM, we are enough, we are capable, and we won’t take no for an answer.

Next Steps

The next step for our project is refining our machine learning model to allow for the recommendation of safer routes with a higher accuracy. This could be done by getting access to more data from different sources, such as the City of Toronto. Currently, our prototype consists of an interactive Figma model that represents what we would like the app and website to look like. With more time, we would implement these features into a functioning app, further improve the UI, and integrate with third party services such as emergency helpline services to provide immediate help. We envision our app to become a part of every newcomers’ daily life. Unfortunately, our team members will be pursuing different paths — continuing studies, conducting research, and returning to our full time jobs - and have made the decision together to not proceed with the app yet. However, the lessons learned and connections made will always stay with us and we are open to reconnect in the future to make this project a reality.

Acknowledgements

Thanks to AI4Good Lab

We owe a big thank you to AI4Good Lab for being the launchpad for SafeT First. Their 7-week training program was jam-packed with ML and AI courses and workshops that gave us the knowledge and skills to bring this project to life.

A huge shoutout goes to the program co-ordinators and the entire AI4Good team and the fantastic guest speakers who shared their wisdom and insights with us. You've been a driving force behind our project’s success.

We can’t forget our mentor (Tahniat Khan) and TA (Yanan Wang); they've been our guiding lights in the world of ML and AI. You folks are the real MVPs.

SafeT First is indebted to AI4Good Lab for providing us with the tools and knowledge we needed to make it happen. Thank you for your support and for being a part of our journey.

Categorized under