Our inspiration for this project is the elimination of graffiti, a crime that is often reported. It's seen being often related to other crime and disorder problems, including: . Littering, public urination, and loitering . Shoplifting of materials needed for graffiti, such as paint and markers . Gangs and gang violence, as gang graffiti conveys threats and identifies turf boundaries . Property destruction, such as broken windows or slashed bus or train seats
What it does
The program utilizes computer vision through OpenCV, to develop a surveillance system that captures the image of specific areas and analyzes whether it has graffiti or not. The neural network to compare the images to the datasets is using PyTorch.
How we built it
We utilized computer vision for real-time object (graffiti) detection and implemented a convolutional neural network (CNN) to train our data. We worked in python so we could more easily access libraries like OpenCV and Pytorch to use machine learning/computer vision.
For computer vision, we used OpenCV to capture the camera by continuously iterating over and reading the camera’s frames. Using “cv2.imwrite”, we were able to write a specific frame into the user’s local computer. The “time” library was used to keep track of the seconds and capture the frame every 2 minutes. Then, the image was sent to be rendered by the neural network to be sorted as having graffiti or not.
For the neural network, we decided to use the popular convolutional ResNet50, outfitted with diverse convolutional functions and 23 million parameters.
Challenges we ran into
Some challenges we encountered was combining our neural network with computer vision. More precisely, we initially struggled to capture a frame from our webcam using OpenCV and formatting it properly so that our neural network could predict the outcome. Another initial challenge we faced was improving the accuracy of our neural network; however, we were able to improve the neural network and increase the accuracy to approximately 94%.
Accomplishments that we're proud of
Our greatest accomplishment was being able to create a Pytorch neural network with over 90% accuracy and combining it with OpenCV for real-time detection.
What we learned
While developing the project, we learned advanced Pytorch and file operations along with python libraries like os, sklearn, and PIL. We also learned how to combine a PyTorch neural network and computer vision for real-time detection and prediction.
What's next for Graffiti Detector
While we have integrated the backhand of the project, we hope to make a more appealing user interface and use a larger dataset to further improve the accuracy of our model. Our long-term goal will be to implement this with a real surveillance system.
Log in or sign up for Devpost to join the conversation.