Our experiments are based on the open-source datasets DiffusionForensics, Artifact and GenImage.
-
Clone this repository and navigate to the MAID folder:
git clone https://github.com/Zhu-Luyu/MAID.git cd MAID
-
Install the required packages:
conda env create -f environment.yaml -n maid conda activate maid
-
Download pre-trained diffusion models:
- DDIM
- The repository for Stable Diffusion v1.5 has been removed, but you can use Stable Diffusion v1.4 as a substitute.
- DiT
- DeepFloyd IF-I-M-v1.0
- LDM
Modify the script parameters as needed to run training and evaluation:
sh train.sh
sh eval.sh
To run DMA extraction before training or evaluation:
cd dma
# DDIM
python compute_dma.py --diffusion_name "ddim" --diffusion_path path/to/your/ddim/checkpoint_file.ckpt --dataroot path/to/img_dataset --postfix "_ddim" --batch_size 100
# IF. The usage of LDM, SD, and DiT is similar
python compute_dma.py --diffusion_name "if" --diffusion_path path/to/your/if/model_folder --dataroot path/to/img_dataset --postfix "_if" --batch_size 100
We selected the following model classes for the experiment:
- DiffusionForensics (LSUN bedroom subset)
Framework | Classes |
---|---|
GAN | StyleGAN |
Diffusion Model | ADM, IDDPM, PNDM |
- | Real |
- Artifact
Framework | Classes |
---|---|
GAN | BiqGAN, CIPS, CycleGAN, Denoising Diffusion GAN, Diffusion GAN, Gansformer, GauGAN, Lama, ProGAN, ProjectedGAN, StarGAN, StyleGAN, Taming Transformer, Generative Inpainting |
Diffusion Model | Latent Diffusion, Stable Diffusion, VQ Diffusion, Glide, Palette, Mat |
- | Real |
- GenImage
Framework | Classes |
---|---|
GAN | BigGAN |
Diffusion Model | ADM, Glide, Midjourney, SDv1.5, VQDM, wukong |
- | Real |
Our code is based on the frameworks provided by CNNDetection and DNF. We greatly appreciate their contributions and code.
If you find this work useful for your research, please cite our paper:
@inproceedings{zhu2025maid,
title={MAID: Model Attribution via Inverse Diffusion},
author={Luyu Zhu and Kai Ye and Jiayu Yao and Chenxi Li and Luwen Zhao and Yuxin Cao and Derui Wang and Jie Hao},
booktitle={ICASSP 2025 - 2025 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
year={2025}
}