Media Forensics / Fake Image Detection experiments in PyTorch.
Project report can be found here.
We use conda
for managing Python and CUDA versions, and pip-tools
for managing Python package dependencies.
- Specify the appropriate
cudatoolkit
andcudnn
versions to install on your machine in theenvironment.yml
file. - To create the
conda
environment, run:conda env create
- Activate the environment:
conda activate fake-detection-lab
- Install all necessary packages:
pip-sync requirements/prod.txt
All model artifacts can be accessed and downloaded here.
exif_sc.npy
: EXIF-SC model weights
├── artifacts
│ └── exif_sc.npy <-- Store model weights here
├── assets
├── configs <-- Configuration files for scripts
├── data
│ ├── downloaded <-- To store downloaded data
│ └── raw <-- Dataset metadata
├── notebooks
├── requirements
├── src
│ ├── attacks <-- Implementation of adversarial attacks
│ ├── datasets <-- Data loading classes
│ ├── evaluation <-- Evaluation classes and utilities
│ ├── models <-- Implementation of detection models
│ ├── trainers <-- Classes for model training
│ ├── structures.py
│ └── utils.py
├── evaluate.py <-- Main entry point for evaluation
├── non_adv_evaluate.py <-- Main entry point for evaluation
├── train.py <-- Main entry point for training
└── ...
python train.py \
--config configs/train/exif_sc.yaml \
--checkpoints_dir checkpoints \
--gpu 0
Runs training on a dataset, based on the settings specified in the configuration file. Weights are saved as a torch .ckpt
file in the specified directory.
More info.
python non_adv_evaluate.py \
--config configs/evaluate/non_adv.yaml \
--weights_path path/to/weights.{npy, ckpt}
Runs the evaluation on a dataset, based on the settings specified in the configuration file.
python evaluate.py \
--config configs/evaluate/adv.yaml \
--weights_path path/to/weights.{npy, ckpt}
Runs the evaluation on a clean dataset, and also on the dataset after it has been adversarially perturbed, based on the settings specified in the configuration file.
All metadata for the datasets used can be found here.
- Media Forensics and DeepFakes: an overview (Luisa Verdoliva, 2020)
- A Survey of Machine Learning Techniques in Adversarial Image Forensics (Nowroozia et al., 2020)
- Fighting Fake News: Image Splice Detection via Learned Self-Consistency (Huh et al., ECCV 2018)
- Adversarial Attack on Deep Learning-Based Splice Localization (Rozsa et al., 2020)