Skip to content

This repository is the official implementation of our paper Robust Diffusion Model-Generated Image Detection with CLIP, accepted by MIPR 2024

License

Notifications You must be signed in to change notification settings

Purdue-M2/Robust_DM_Generated_Image_Detection

Repository files navigation

Robust DM-generated images detection with CLIP

Santosh, Li Lin, Xin Wang, Shu Hu


This repository is the official implementation of our paper Robust Diffusion Model-Generated Image Detection with CLIP

1. Data Preparation

  • Download the dataset from the HuggingFace
  • After downloading the parquet files, tranform them into h5 files.
python get_data.py
python h5_process.py

2. Train the model

  • load, 'train' folder for train_dataset in train.py; load 'val' folder for val_dataset in train.py.
    train_dataset = DFADDataset('train')
    val_dataset = DFADDataset('val')
python train.py
  • Use CVaR & AUC Loss
 model_trainer(loss_type='auc', alpha=0.1,  batch_size=2048, num_epochs=32)

Tune gamma on CVaR + AUC loss to find the best tradeoff hyperparameter

Citation

Please kindly consider citing our papers in your publications.

@inproceedings{Santosh2024robust,
      title={Robust Diffusion Model-Generated Image Detection with CLIP}, 
      author={Santosh and Li Lin and Xin Wang and Shu Hu},
      booktitle={1st Workshop on New Trends in AI-Generated Media and Security},
      year={2024},
}

About

This repository is the official implementation of our paper Robust Diffusion Model-Generated Image Detection with CLIP, accepted by MIPR 2024

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages