Inspiration
On November 30th, 2021, at 12:51 PM, the Oakland County Sheriff responded to the first call of hundreds to come about potential shots fired at a nearby high school. Law enforcement reacted immediately, rushing to the high school by 12:55. But those minutes were too precious. 30 shots had been fired, 11 of which had been shot into people. It would be later found that day that this shooting at Oxford High School, Michigan had taken the lives of four people and the security that students once felt attending school. This high school was merely 15 minutes away from two of our team member’s schools and had resulted in a temporary shutting down of schools within the county until teachers and school administration had come up with an effective game plan to prevent such incidents. However, what could be truly done to prevent such shootings? Did this mean the implementation of metal detectors? Searching through bags every day? As software developers, we knew we had to do something. The student who had even recorded the initial call to law enforcement mentioned he had to find a safe place before being able to report it, even then whispering, using up critical time. In these situations, time is everything. Law enforcement reacting even 30 seconds earlier than they had could have easily saved lives. Most schools have fire alarms, but what if we were somehow able to automatically trigger a law enforcement device by somehow detecting a shooting? What if we were able to trigger an alarm based on audio detection of a gunshot? This is why we created a platform for students to provide law enforcement useful information to most effectively handle the situation along with a trained model to detect not only gunshots through audio but the type of gun as well, helping law enforcement handle the issue accordingly.
What it does
We made a live gunshot alarm classifier intended for schools across the world. We trained a multi-layered convolutional neural network to identify the multi-faceted aspects commonly present in a school through audio files converted into spectrograms. The neural network is then combined with a live microphone input to effectively classify sounds and guns. This prototype, once fully developed, will be able to help improve school safety by contacting law enforcement or implementing safety measures as soon as a gunshot is detected. It provides information such as the time it was detected, accuracy rates and a list of other potential factors.
How we built it
Data preprocessing is used for both the live microphone intake and training involved in taking in .wav files and transforming them into spectrograms for the convolutional neural network. The CNN consists of multiple layers such as the Convolution Layer which condenses image data through a filter, Pooling Layers which pools together pixels to condense data, and Dropout layers to avoid overfitting to training data.
For the integration aspect, we integrated later using flask as a local api endpoint for the react native app to use when integrating this in a real life scenario. We hope to later on use this in a hardware device, truly being used as an alarm. The react-native library records in real time sending data in 2 second intervals to the backend to provide a close to real time action as possible. We used react-recording to help with local audio storage on the phone and expo-permissions to request for the user's device allocation of data and audio.
Challenges we ran into
Some challenges of the multi-faceted project included the preparation of data. Directory formatting and spectrogram transformation delayed our advancements manyfold. The studying of machine learning concepts was paramount but time-consuming. The CNN also takes a place due to its large training time as well as its parameter and layer optimization.
What we learned
Throughout this hackathon, we have learned how CNNs work and operate as well as how to efficiently optimize their parameters and training speed (through preprocessing and directory formatting). Multiple libraries such as librosa and sounddevice were used and studied as well as the concepts that the libraries are intended to cover such as spectrograms and audio intake.
Some other issues we had were dependency and computer issues to the large load these computations and work would take on our computers, resulting in a few unsaved shutdowns.
What's next for GAAD
We wish to build these alarms and have Oakland county schools use these alarms within our school district. However, the monetary constraints of building an algorithm with 99.9% accuracy or higher and building these devices for all the local districts nearby are too big for us to be able to complete our goal of keeping students, like myself, safe. We hope to achieve the dreams of seeing our app being used in the real world, but to see these issues solved in the world. We hope that no one and no community has to experience something like the Oxford shooting again. We could not imagine losing a loved one to such an event. In terms of measurable success, if receiving the needed funds, We hope to have over 1000 downloads for the select apps I decide on the app store.
Built With
- dataprep
- javascript
- keras
- matplot
- python
- react-native
- react-navigation
- scipy

Log in or sign up for Devpost to join the conversation.