Skip to content
项目

关于

Open-source deepfake detection: train your own model with TensorFlow, Keras & EfficientNet

人工智能与机器学习

这些数字如何统计

实测星标增长

24小时
0
7天
正在收集历史
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

DeepFake-Detect (DFDetect)

DFDetect is a free web tool for checking still photos for signs of face manipulation. It marks the faces it finds and reports a model score for each. This repository contains the original Python training pipeline for researchers who want to train and evaluate their own classifier.

Open the web checker · Try the sample without uploading · API and MCP guide · Measured evaluation

Try DFDetect

DFDetect desktop checker showing the three tools, the upload panel, and the sample button

Tool What you can check
Image Upload Choose a JPEG or PNG up to 2 MiB. For a larger supported image, preview a smaller copy on your device before deciding to scan it.
Deepfake Profile Checker Crop a public profile photo from a screenshot. In browsers that support tab sharing, you can also capture the browser tab. Only the selected crop is sent for analysis.
Bluesky Profile Checker Paste a public Bluesky profile URL to scan its avatar.

If a private scan fails temporarily, you can retry from the scan panel. On a phone, DFDetect brings the results into view when a scan finishes. Tap a face marker to jump to its score card and suggested next step. Private scans process images without saving the image files. Training contributions are a separate website opt-in. Privacy policy

See the mobile resultsDFDetect mobile results showing two individual face scores, the second face selected, and guidance for interpreting each result

Live result from the generated two-face evaluation image. Even a high real-face score can occur on a generated image.

Watch the 7-second walkthrough

On the DFDetect homepage, selecting Try a sample reveals two face markers and their illustrative score cards

The walkthrough uses the built-in example. No image is uploaded. Open the interactive example

Scan from code

Try the public API with the same generated sample. The private scan endpoint accepts JPEG or PNG up to 2 MiB and 20 million pixels. Submit images you have permission to share.

curl -fsS -o dfdetect-sample.png \
  https://deepfake-detect.com/img/evaluation/portrait-source.png

curl --fail-with-body -sS \
  -F '[email protected];type=image/png' \
  'https://api.deepfake-detect.com/v1/upload?mode=scan'

The response includes model_version, face_count, face boxes, and real_face_score values from 0 to 1. When the detector finds no faces, it returns no_faces_detected with an empty faces array. OpenAPI contract and example responses

For MCP, connect a client that supports stateless Streamable HTTP to https://api.deepfake-detect.com/v1/upload?mode=mcp. The tool is analyze_image_for_face_manipulation and accepts standard base64 image bytes in image_base64. Ask before sending an image on someone’s behalf. MCP setup and response details · Agent integration index

Understand the scores

DFDetect scores each face it finds in a still image. Higher values lean toward the classifier’s real-face class. Use the result alongside evidence about the photo’s source and any identity claim. A high score is an uncalibrated model output. A missing face has no score.

The evaluation includes 46 scans across 10 source images with downloadable inputs. It shows how cropping, JPEG compression, screenshots, and small faces can change outcomes. The cohort is small and illustrates specific failure modes. Methodology and limitations · Troubleshoot a no-face result

Train your own classifier

The public training example uses an ImageNet-initialized EfficientNet-B0, 128 × 128 RGB face crops, and a binary classifier. The hosted checker uses a separate EfficientNet-B7 checkpoint. Use the hosted quickstart for inference with the deployed model. Training and serving details

The scripts expect Windows-style paths and use older Keras APIs. Start in a virtual environment, review requirements.txt, and adapt the paths before running on Linux or macOS. The dependencies are loosely pinned, so compatibility depends on the Python and library versions you install.

Step Script Output
1. Extract frames 00-convert_video_to_image.py Frames in one directory per video. The script reads filenames from train_sample_videos/metadata.json.
2. Crop faces 01a-crop_faces_with_mtcnn.py Individual face crops from each frame. The optional Azure script uses a separate cloud service and requires your own configuration.
3. Balance and split 02-prepare_fake_real_dataset.py Balanced real and fake crops split 80/10/10 into train, validation, and test folders.
4. Train 03-train_cnn.py Validation metrics and a best_model.h5 checkpoint under tmp_checkpoint/.

Check your dataset’s access terms before use. The original work references DeepFake-TIMIT, FaceForensics++, Google DFD, Celeb-DF, and DFDC. For evaluation on unseen material, hold out whole source videos or identities before extracting crops. The example split operates on prepared crops.

Contribute

If DFDetect helps with your work, consider starring the repository. To suggest a change or report a reproducible bug, use GitHub Issues. Include the script or page, the environment, and steps to reproduce. Use a public sample or synthetic input you have permission to share.

Cite and license

DeepFake-Detect was created by Aaron Chong and Hugo Ng. The repository code is available under the MIT License.

@software{deepfake_detect,
  title  = {DeepFake-Detect},
  author = {Chong, Aaron and Ng, See Long Hugo},
  year   = {2020},
  url    = {https://github.com/aaronchong888/DeepFake-Detect}
}

探索相关项目

加载中…