This repository contains the code for a Violence Detection System developed using an LSTM-based deep learning model. The system is designed to classify video clips as either violent or non-violent with high accuracy.
- Introduction
- Dataset
- Model Architecture
- Training
- Evaluation
- Results
- Usage
- Installation
- Contributing
- License
The Violence Detection System leverages the power of deep learning to analyze video content and classify it into violent and non-violent categories. This project utilizes an LSTM (Long Short-Term Memory) network to capture temporal patterns in video sequences, providing accurate classification results.
The model was trained and tested on the Kaggle 2000 Videos dataset, which contains a balanced collection of violent and non-violent video clips. The dataset is preprocessed and padded to ensure uniform input shapes for the LSTM model.
The model consists of:
- An LSTM layer to capture temporal features.
- Dropout layers to prevent overfitting.
- Dense layers with a sigmoid activation function for binary classification.
The model was trained using the Adam optimizer and binary cross-entropy loss function. It was trained for 30 epochs with a batch size of 32, achieving a high level of accuracy.
The model was evaluated on a separate validation set, achieving a 97% accuracy rate. Various evaluation metrics such as accuracy, precision, recall, F1 score, ROC curve, and AUC were used to assess the model's performance.
The system demonstrates a robust performance with the following metrics:
- Accuracy: 97%
- Precision: High
- Recall: High
- F1 Score: High
- AUC: Near 1
To use the Violence Detection System:
- Clone this repository.
- Install the required dependencies.
- Run the provided scripts to preprocess data, train the model, and evaluate its performance.
-
Clone the repository:
git clone https://github.com/your-username/violence-detection-system.git cd violence-detection-system
-
Install the required packages:
pip install -r requirements.txt
-
Download the Kaggle 2000 Videos dataset and place it in the appropriate directory.
-
Run the preprocessing script:
python preprocess.py
-
Train the model:
python train.py
-
Evaluate the model:
python evaluate.py
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.