Violence Detection using Conv3D
Model Architecture
- Type: 3D Convolutional Neural Network (Conv3D)
- Input: Video sequence of 16 frames, resized to 112x112.
- Structure:
- 4 Conv3D Layers with BatchNorm, ReLU, and MaxPooling.
- Flatten Layer.
- 2 Fully Connected Layers.
- Dropout (0.5) for regularization.
- Output: Binary Classification (Violence vs No-Violence).
Dataset Structure
The code expects a Dataset folder in the parent directory (or modify DATASET_DIR in train.py).
Structure:
Dataset/
βββ violence/
β βββ video1.mp4
β βββ ...
βββ no-violence/
βββ video2.mp4
βββ ...
How to Run
- Install dependencies:
torch,opencv-python,scikit-learn,numpy. - Run
python train.py.