Skip to content

rahulshendre/Deepfake_detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deepfake Detection App

A web application for detecting deepfakes in images, videos, and audio using CNN and Wav2Vec2 models.

Models

Media Type Model Architecture
Image deepfake_cnn.keras (included) CNN with 4 Conv2D blocks
Video Uses image model Frame-by-frame analysis
Audio Wav2Vec2 Transformer-based

Setup

  1. Install dependencies:
pip3 install -r requirements.txt
  1. Download the audio model (optional, for audio detection):
git lfs install
git clone https://huggingface.co/mo-thecreator/Deepfake-audio-detection
  1. Run the application:
python3 app.py
  1. Open your browser: http://127.0.0.1:5001

Features

  • Image Analysis: Analyzes images for deepfake artifacts using CNN
  • Video Analysis: Extracts frames and analyzes each with the image model
  • Audio Analysis: Uses Wav2Vec2 transformer model for voice deepfake detection

Supported Formats

  • Images: PNG, JPG, JPEG, GIF, BMP, WebP
  • Videos: MP4, AVI, MOV, MKV, WebM
  • Audio: MP3, WAV, OGG, FLAC, M4A

Chrome Extension

  1. Open Chrome → chrome://extensions/
  2. Enable Developer mode
  3. Click Load unpacked → Select the extension folder
  4. Run the Flask app (python3 app.py) — it listens on http://127.0.0.1:5001 (port 5001 avoids macOS AirPlay using port 5000)
  5. Toolbar: Open the popup to upload files
  6. Right‑click any image on a webpage → Analyze image for deepfake — opens a full tab so the window stays open (the small popup closes if you drag files elsewhere; use this for images on the page)

The extension needs permission to reach your local server and to download images you right‑click (http/https).

API

POST /analyze

curl -X POST -F "file=@image.jpg" -F "type=image" http://127.0.0.1:5001/analyze

Response:

{
  "is_fake": true,
  "confidence": 87.5,
  "fake_probability": 87.5,
  "real_probability": 12.5,
  "message": "FAKE detected with 87.5% confidence"
}

Project Structure

ml_Cp/
├── app.py                    # Flask backend with ML inference
├── requirements.txt          # Python dependencies
├── deepfake_cnn.keras/       # Image deepfake CNN model (included)
├── Deepfake-audio-detection/ # Audio model (download separately)
├── templates/
│   └── index.html            # Web UI
├── extension/                # Chrome extension
└── uploads/                  # Uploaded files (auto-created)

Requirements

  • Python 3.9+
  • TensorFlow 2.16+
  • PyTorch 2.1+
  • ~1GB disk space for models

About

Deepfake detection for images, audio and videos

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors