/violence_detection

This is a Computer Vision project which aims to detect violence in realtime.

Primary LanguageJupyter Notebook

Violence Detection using VGG16 network

This is a Computer Vision project which aims to classify images containing violence.
Major Tech Stack:
->TensorFlow 2.1.0
->OpenCV

How to use?

Note: To maintain the ennvironments, I highly recommend using conda.

git clone https://github.com/aitikgupta/violence_detection.git
cd violence_detection
conda env create -f environment.yml
conda activate {environment name, for eg. conda activate cv}
jupyter notebook Training_Model.ipynb {or you can use my trained model, link is below}
jupyter notebook Violence_Detection.ipynb

Model link:

https://drive.google.com/file/d/1ib6zg_8kWmRQhkVFRszi3Y6r1fB5jR1a/view?usp=sharing

Note: If you choose to download my trained model, place the model.h5 file in the root directory.

About the model:

The model is built using TensorFlow 2.1.0 with 1.5 hours training on GeForce GTX-1650 GPU. Last 4 layers of the VGG16 pretrained network were fine tuned, along with fully-connected layers.

Application of VGG16 network:

Given image → find object name in the image It can detect any one of 1000 images It takes input image of size 224 * 224 * 3 (RGB image) Built using:

Convolutions layers (used only 33 size ) Max pooling layers (used only 22 size) Fully connected layers at end Total 16 layers

Model size:

528MB

Pre trained model(Tensorflow):

VGG16-weights

Built by:

Visual Geometry Group VGG Homepage

Description of layers:

Couldn't find image!

Convolution using 64 filters
Convolution using 64 filters + Max pooling
Convolution using 128 filters
Convolution using 128 filters + Max pooling
Convolution using 256 filters
Convolution using 256 filters
Convolution using 256 filters + Max pooling
Convolution using 512 filters
Convolution using 512 filters
Convolution using 512 filters + Max pooling
Convolution using 512 filters
Convolution using 512 filters
Convolution using 512 filters + Max pooling
Fully connected with 4096 nodes
Fully connected with 4096 nodes
Output layer with Softmax activation with 1000 nodes

Full view at image level:

Couldn't find image!