SLADD
Official code for Self-supervised Learning of Adversarial Example: Towards Good Generalizations for Deepfake Detection (CVPR 2022 oral)
Install / Use
/learn @liangchen527/SLADDREADME
Self-supervised Learning of Adversarial Example: Towards Good Generalizations for Deepfake Detection
This repository contains PyTorch implementation of the CVPR oral presentation paper:
Self-supervised Learning of Adversarial Example: Towards Good Generalizations for Deepfake Detection.
Liang Chen, Yong Zhang, Yibing Song, Lingqiao Liu, Jue Wang
The proposed method uses adversarial self-supervised training to improve the generability of current deepfake detectors. The pipeline is illustrated in the following figure:

Preparation
pacakges
Please refer to the requirements.txt for details.
pretrained weights
Download Xception pretrained weights and dlib landmark predictor and put them in the weights folder.
Datasets
training datasets
We use the FaceForensicsDataset (FF++) for training. Please go to their project page for downloading. For every video in FF++ dataset, we extract 270 frames for training, and 100 each for evaluation and testing rigously following their data splitting strategy. The data structure is like:
SLADD project
|---README.md
|---...
|---data
|---FF
|---image
|---FF-DF
|---071_054
|---0001.png
|---...
|---...
|---FF-F2F
|---FF-FS
|---FF-NT
|---real
|---mask
|---FF-DF
|---071_054
|---0001_mask.png
|---...
|---...
|---FF-F2F
|---FF-FS
|---FF-NT
|---config
|---train.json
|---test.json
|---eval.json
test datasets
We use the DFDC, CelebDF, and DF1.0 for testing. These datasets are organized similar to FF++. Please go to their sites for downloading.
Running
python train.py --resolution 256 --dataname none --dset FF-DF --meta FF-DF -n 1 -g 8 -nr 0 -mp 5555
Citation
If you find this code useful for your research, please cite:
@inproceedings{chen2022self,
author = {Liang Chen and Yong Zhang and Yibing Song and Lingqiao Liu and Jue Wang},
title = {Self-supervised Learning of Adversarial Examples: Towards Good Generalizations for DeepFake Detections},
booktitle = {CVPR},
year = {2022}
}
Contact
Please open an issue or contact Liang Chen (liangchen527@gmail.com) if you have any questions or any feedback.
Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
groundhog
399Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
last30days-skill
18.8kAI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
sec-edgar-agentkit
10AI agent toolkit for accessing and analyzing SEC EDGAR filing data. Build intelligent agents with LangChain, MCP-use, Gradio, Dify, and smolagents to analyze financial statements, insider trading, and company filings.
