This project implements a deepfake video detection system using a CNN-LSTM model. The workflow includes data processing, model training, evaluation, and visualization. The system is designed to distinguish between real and fake videos using sequences of image frames.
app.py: Streamlit app for model inference and visualization.model/Deepfake_CNN_LSTM.h5: Trained model file.notebooks/model_trainng.ipynb: Jupyter notebook for data processing, training, and evaluation.
- Clone the repository.
- Create a virtual environment and activate it.
- Install dependencies:
pip install -r requirements.txt
- Uses the DFDC Faces of the Train Sample dataset from Kaggle.
- Data is organized into
trainandvalidationfolders. - Sequences of frames are grouped for model input.
- CNN layers extract spatial features from frames.
- LSTM layer captures temporal dependencies across sequences.
- Final dense layers output binary classification (real/fake).
- Early stopping and learning rate reduction callbacks are used.
- Model is trained for up to 15 epochs.
- Training and validation accuracy/loss are visualized.
- Confusion matrix, classification report, and ROC curve are generated.
- Metrics: accuracy, precision, recall, F1 score, AUC.
Run the Streamlit app:
streamlit run app.pySee requirements.txt for all dependencies.