Inspiration
The challenge was to explore a buzzword topic. I chose to explore machine learning and brainstormed something useful I can make out of machine learning image processing. Recently, there was a major shooting incident in London and there have been many more shooting incidents in Toronto. So I thought to try and solve the gun violence issue with machine learning. I plan on expanding this project into other ways of helping the police (see more about it in "What's next for Crime Prevention ML Assistant").
What it does
Using machine learning algorithms, it identifies whether someone is armed or unarmed. If it identifies that someone is armed it sends an email to the police crime watch mailbox and sounds the police siren to deter the criminal activity from occurring.
How I built it
- In the MLH INIT workshop we learned how to identify ripe vs non-ripe bananas with machine learning for image processing by training the model via teachable machines and what bias data means.
- I came up with the idea to identify armed vs unarmed for my Crime Prevention ML Assistant. I couldn't find a dataset for this so I made sure the model is well trained by giving it armed images from different racial backgrounds and gender, positions and locations. For the unarmed classification, I used a similar approach but also added images where the position is similar to pointing a gun but the person is unarmed and is giving directions. Also, included images where person/people is/are walking, on phone and sitting on the street so that it can easily identify between armed and unarmed. Learning about what bias data is from the workshop really helped make a bias-free dataset to train my model.
- I used streamlit framework for the web application part of this project
- Also, once it identifies the person is armed, it sends out an email to the police crime watch email with a timestamp and intersection to alert the authorities which can be much faster than a person realizing what's going on and then reporting. It then blares the police siren to deter the criminal activity.
Challenges I ran into
One of the challenges I ran into was figuring out how to use the model I trained with Teachable Machines. Another was with Gmail API, and sometime later I stumbled upon a much simpler alternative (smtplib). Also, streamlit doesn't currently have autoplay feature for audio. To resolve it, I tried using html in streamlit.markdown() function but that didn't help at all. So, once audio autoplay feature is released for streamlit the police siren will play after an email is sent to alert the authorities.
Accomplishments that I am proud of
I am super proud of making this project as I visioned it despite several challenges. It has huge societal well-being value if deployed as it can help prevent crime and I learned and implemented new technologies very effectively.
What I learned
- learned how to train the computer with a dataset with teachable machines and what bias data is during the workshop
- learned on my own how to use the model that I trained to make something useful from it
- learned on my own how to work with the streamlit framework for making web apps in Python
- learned on my own how to send emails from python
What's next for Crime Prevention Assistant
- Better GUI
- Better dataset so that it can be exposed to the actual streets it will be monitoring. This can be achieved by reaching out to the Toronto Police and see if they will be interested in using this for crime prevention in gun violence. Model can be improved by CCTV footage where gun violence occurred so it will be able to detect someone taking out a gun or pointing a gun in an actual setting efficiently.
- Facial recognition feature to catch criminals faster
- Number plate locating feature also to catch criminals faster (Ontario Amber Alert sends out abduction-related inquiries, often they have the number plate of the vehicle. This ML bot can later also help find the vehicle much quicker.)
Built With
- machine-learning
- markdown
- pandas
- python
- smtplib
- streamlit
Log in or sign up for Devpost to join the conversation.