A web application for detecting deepfakes in images, videos, and audio using CNN and Wav2Vec2 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 |
- Install dependencies:
pip3 install -r requirements.txt- Download the audio model (optional, for audio detection):
git lfs install
git clone https://huggingface.co/mo-thecreator/Deepfake-audio-detection- Run the application:
python3 app.py- Open your browser:
http://127.0.0.1:5001
- 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
- Images: PNG, JPG, JPEG, GIF, BMP, WebP
- Videos: MP4, AVI, MOV, MKV, WebM
- Audio: MP3, WAV, OGG, FLAC, M4A
- Open Chrome →
chrome://extensions/ - Enable Developer mode
- Click Load unpacked → Select the
extensionfolder - Run the Flask app (
python3 app.py) — it listens on http://127.0.0.1:5001 (port 5001 avoids macOS AirPlay using port 5000) - Toolbar: Open the popup to upload files
- 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).
POST /analyze
curl -X POST -F "file=@image.jpg" -F "type=image" http://127.0.0.1:5001/analyzeResponse:
{
"is_fake": true,
"confidence": 87.5,
"fake_probability": 87.5,
"real_probability": 12.5,
"message": "FAKE detected with 87.5% confidence"
}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)
- Python 3.9+
- TensorFlow 2.16+
- PyTorch 2.1+
- ~1GB disk space for models