ali-faraz-py/deepfake-detector
ali-faraz-py/deepfake-detector has 34 GitHub stars and 1 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-11 07:24 UTC. Last push 2026-08-17.
AI-powered deepfake detector that classifies uploaded face images and videos as Real or Fake with confidence scores. Full-stack app built with PyTorch (EfficientNet-B0), FastAPI, and Next.js — trained on 100k+ images and deployed with Vercel + Render.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 업데이트 지연
- in 1 month
- 업데이트 지연
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original🔍 Deepfake Detector
An AI-powered web app that analyzes uploaded face images and videos to classify them as Real or Deepfake, with a confidence score. Built as a full-stack project covering model training, backend API development, and frontend deployment.
Live app: deepfake-detector-olive.vercel.app Backend API: deepfake-detector-api-amqf.onrender.com
Demo

What it does
- Upload a face image or video
- The model classifies it as Real or Fake
- Returns a confidence percentage, shown with a visual confidence bar
- For videos, samples multiple frames and averages predictions across them
- Drag-and-drop upload, live preview, and a history of recent checks
- Try-it-now sample buttons (one real photo, one AI-generated photo) for visitors without their own test files
- File type and size validation, with toast notifications for errors
- Dark mode toggle
- A visible disclaimer noting the model's known generalization limits (see below)
Tech Stack
Frontend
- Next.js (React)
- Tailwind CSS
- Deployed on Vercel
Backend
- FastAPI (Python)
- PyTorch + EfficientNet-B0
- OpenCV (video frame extraction)
- Deployed on Render
Model Training
- Trained on Google Colab (free GPU)
- Dataset: 140k Real and Fake Faces (Kaggle, by xhlulu)
- 100,000 training images / 20,000 validation images
- 3 epochs, ~99.7% training accuracy
How it works
- The frontend sends the uploaded file to the FastAPI backend
- If it's an image, it's resized, normalized, and passed through EfficientNet-B0
- If it's a video, OpenCV extracts ~5-10 sampled frames, each is classified individually, and the results are averaged into one final prediction
- The model returns a label (
Real/Fake) and a confidence score as JSON - The frontend displays the result with a color-coded card
Known Limitations
- Generalization: The model was trained on StyleGAN-generated faces (the dataset's specific fake-image style). It performs very well (~99.7%) on that distribution, but may not generalize reliably to images generated by other AI tools (e.g. diffusion models like Midjourney or DALL·E), since those leave different visual artifacts than the ones the model learned to detect. This is a well-documented, open challenge in deepfake detection research generally — not unique to this project.
- Cold starts: The backend is hosted on Render's free tier, which spins down after inactivity. The first request after idle time may take 30-60 seconds to respond.
- Video processing: Limited to a small number of sampled frames (not every frame) to stay within free-tier memory limits.
Running Locally
Backend
cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload
Frontend
cd frontend
npm install
npm run dev
Create a .env.local file in frontend/ with:
NEXT_PUBLIC_API_URL=http://127.0.0.1:8000
Project Structure
deepfake-detector/
├── backend/
│ ├── app/
│ │ ├── main.py # FastAPI routes
│ │ ├── model.py # Model loading + inference
│ │ └── preprocessing.py # Video frame extraction
│ ├── models/
│ │ └── deepfake_model.pth
│ └── requirements.txt
└── frontend/
└── src/app/
└── page.js # Upload UI + result display
Author
Built by Ali Faraz as a portfolio project exploring the intersection of computer vision, cybersecurity, and full-stack deployment.
관련 프로젝트 살펴보기
tensorflow/tensorflow
모두를 위한 오픈소스 머신러닝 프레임워크
201,505 스타huggingface/transformers
🤗 Transformers: 텍스트, 비전, 오디오, 멀티모달 분야의 최첨단 머신러닝 모델을 위한 모델 정의 프레임워크로, 추론과 학습을 모두 지원합니다.
168,815 스타AUTOMATIC1111/stable-diffusion-webui
Stable Diffusion 웹 UI
165,289 스타Comfy-Org/ComfyUI
그래프와 노드로 구성된 인터페이스를 갖춘, 가장 강력하고 모듈성이 뛰어난 확산 모델 GUI, API, 백엔드입니다. 세계에서 가장 빠른 로컬 추론 엔진입니다.
146,271 스타