Using Machine Learning to catch a thief

Vijay Dontharaju
4 min readMar 4, 2021

We live in a relatively safe neighborhood and I woke up this morning with news about a couple of neighbors’ cars broken into. Neighbors exchanged videos from their security cameras, smart door bells etc. I felt really bad for the neighbors and was frustrated for a bit especially when I saw videos like this one.

You can see the timeline at the right top side of the video. It happened around 2 AM on 3rd March , 2021. You can see how there were two people in the video walking around the neighborhood checking for any unlocked cars to break-in. I was frustrated that none of the videos shared on WhatsApp and other community networks clearly captured the faces. But the software guy inside me didn’t want to give up. So I gave it a try. First I tried pausing the above YouTube video multiple times to see if I could see a frame with the person’s face in it. It was a bit tough. So I wrote a simple Python program using OpenCV to extract each and every frame from the video. Finally I ended up with 2850 frames.

Now I selected a photo where I could see a face. Zoom to maximum level and cropped it. Below is what I ended up with

Now the problem with above image was I could see a person but the face was not clearly visible. At one point I was wondering if he was wearing a mask to cover his original face. But somehow after asking a couple of neighbors to validate, I concluded that it’s a proper human face.

This is the point where I was stuck. I tried converting the image to grayscale and was trying to write a program to enhance the image. I tried for a bit and finally thought it isn’t that straightforward. Below you can see the grayscale image I was playing with.

This is when the Commercial/End-user mindset in mine started working. I reassessed my objective and told myself not to reinvent the wheel and went to google to search for “image enhancement software online” and bumped into https://letsenhance.io/. I just uploaded the color image to their website and Voila !! the processed image looks stunningly clear. Best part is I didn’t pay anything to use their trial version with some initial credits.

Processed image from letsenhance.io

When I read a bit about how the software works, this is what I found on their website.

They use Deep Convolution Neural Networks to enhance the images. It was mind-blowing to see how they trained the neural network with a huge dataset of images which could be further utilized by citizen data scientists like me to solve a specific problem. You could clearly see the face of the thief trying to break into the car in the above final processed image.

I felt pretty excited and thought I should share this with you all. It just proves that where there is a will, there would be always a way to solve problems. Sometimes it helps to not to get too focused on implementing the entire solution from scratch, not to reinvent the wheel and try to use existing tools to solve the problem. I am not sure what the effort would be to build a neural network and train it with a huge dataset of images and I am not sure how accurate the results would be. There are multiple tools and software involved in this entire process:

  1. Smart video door bells, surveillance cameras.
  2. Social networks such as WhatsApp, Nextdoor to share these videos and alert each other.
  3. Python or any programming language to do some image/video processing.
  4. A third party Neural Network based Image enhancing software.
  5. And most important of all, a Human Mindset that could connect all the dots together.

Hope you enjoyed reading this !

Edit: 4-MAR-2021: 12 PM : Received a response from our Precinct Sheriff that he received the information I shared and assured that he will have the issue addressed. Fingers crossed now :)

--

--