Tracking and detecting suspicious activity is one of the most demanding tasks for many security personnel and systems. If a security system fails in places like airports and banks, then criminals will get an advantage to carry out theft at gunpoint. Out of fear, people won’t be able to call the police for help.
But if a smart camera can detect any suspicious activity and automatically trigger an alarm to call the police, then such criminal acts can be prevented.
So, let’s learn how to build such a device in this project.
Bill Of Materials
Teaching The Camera
First create an ML model having datasets of normal activities such as walking, talking, reading, sitting etc. Then feed the datasets of Suspicious Activity such as fighting, boxing, pointing guns or any other violent movement deemed suspicious into the ML model.
Also, perform such activities in front of the smart camera so that various movements are captured. This will be useful for training the ML model and deploying it on Raspberry Pi to make a smart AI camera.
To create and train an ML model, there are several flexible options such as TensorFlow, Google Teachable, Edge Impulse, Lobe etc. You can choose any and work on the above idea. Here, I am demonstrating with the help of Google Teachable.
In Google Teachable, select the PoseNet option for tracking the various body movements and actions. Earlier, we performed different actions like walking, talking, eating, standing etc. By correctly labelling them, feed these datasets into the ML model. Similarly, feed the datasets of activities like pointing guns, firing guns, fighting, beating etc.
After feeding the required datasets, click on ‘Train Model’. You will be given an option to export the ML model or upload it to the cloud. I uploaded the ML model to the cloud as it will be safely stored there, allowing users to access and deploy it anywhere in the world.
On uploading to the cloud, you will receive a URL for using the ML model.
Deploying on Camera
Next, deploy the ML model on the camera and connect a speaker so that the Raspberry Pi triggers an alarm when any suspicious activity gets detected.
Now, you need to deploy the ML model in Raspberry Pi for which coding is required.
Import the ML model that was previously uploaded to the cloud. Then check whether activities such as beating, gun firing, gun possession etc, are detected by the ML model during video processing. The model gives the likelihood of a particular activity to occur in the range of 0.00 to 1.00. So, by using an if condition, if the output is greater than 0.98 then it means a person is either pointing a gun or fighting. At this point, an alarm gets triggered to alert people in the neighboring area.
Really very good system
Can you please share the coding of this project.
I am in my final year and I would like to use this as my final project.
Hi, we were facing some issues earlier with the Source page. Kindly refresh the page and retry.
Sir I tried but the source page doesn’t showing anything. Please help me I need the coding part.
Hi Muhammad, I have shared you the code via email, please check.
Can you send steps and code of this project i want to do it please
Hi Nikita, the Source Codes are present at the end of the article.
Sir can you please provide us with detailed project
sir please help me out I need coding part. I’m unable to download it.
Kindly refresh the page and retry