Skip to content

Sahilverse/Deepfake-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Deepfake Detection Model

This project implements a Cross-Attention Fusion Network for deepfake detection, combining EfficientNet-B2 (Spatial) and ResNet18 (Frequency) features.

📋 Prerequisites

  • Python: 3.10 or higher recommended.
  • CUDA-capable GPU: Highly recommended for training (Model is configured for cuda).
  • RAM: At least 16GB recommended.

🛠️ Environment Setup

Follow these steps to set up the development environment using either venv or Conda.

1. Create Environment

Option A: Using venv (Standard Python)

# Windows
python -m venv venv
.\venv\Scripts\activate

# Linux/Mac
python3 -m venv venv
source venv/bin/activate

Option B: Using Conda

conda create -n deepfake-detection python=3.10
conda activate deepfake-detection

2. Install Dependencies

Install all required packages from the requirements.txt file.

pip install -r requirements.txt

3. Verify Installation

Ensure that PyTorch can see your GPU:

import torch
print(torch.cuda.is_available()) 

📂 Project Structure

  • notebooks/: Contains the training notebook (model.ipynb) and experiments.
  • data/: Dataset directory (expected structure below).

📊 Dataset Setup

The training notebook expects the data to be organized as follows:

data/
└── faces/
    ├── real/           # Real video files
    └── fake/
        └── Deepfakes/  # Deepfake video files

The script will automatically handle frame extraction to data/faces/extracted_frames/.

🚀 Running the Training

  1. Open the notebook:
    jupyter notebook notebooks/model.ipynb
  2. Run all cells to process data, extract frames, and train the model.

About

Deepfake detection using a hybrid CNN approach: spatial features from EfficientNet-B2, frequency analysis via FFT and ResNet-18, fused with cross-attention to reliably identify manipulated videos.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors