---
title: DRCT-2M
canonical_url: "https://www.modelscope.cn/datasets/BokingChen/DRCT-2M"
md_url: "https://www.modelscope.cn/datasets/BokingChen/DRCT-2M.md"
repository: BokingChen/DRCT-2M
chinese_name: "两百万级别稳定扩散生成图像检测数据集DRCT-2M"
last_updated: 2024-07-27
license: "Apache License 2.0"
storage_size: "414 GB"
domain:
  - image
tasks:
  - DRCT-2M
downloads: 797921
stars: 7
---

# DRCT-2M

> DRCT-2M - BokingChen 在 ModelScope 开源的数据集。用于AIGC生成图像检测研究，主要使用16种不同类型SD模型生成，包含SDv1.4、 SDv1.5,、SDv2、SDXL等

BokingChen/DRCT-2M 是 ModelScope 魔搭社区上的DRCT-2M数据集，涉及 image 领域，存储大小 414 GB，采用 Apache License 2.0 许可。

- **Repository**: BokingChen/DRCT-2M
- **License**: Apache License 2.0
- **Tasks**: DRCT-2M
- **Domain**: image
- **Storage size**: 414 GB
- **Downloads**: 797921
- **Stars**: 7
- **Last updated**: 2024-07-27

Source: https://www.modelscope.cn/datasets/BokingChen/DRCT-2M

---

### Clone with HTTP
```bash
git clone https://www.modelscope.cn/datasets/BokingChen/DRCT-2M.git
```
### Introduce
DRCT-2M: Two-Million-Scale Diffusion-Generated Dataset from "[DRCT: Diffusion Reconstruction Contrastive Training towards Universal Detection of Diffusion Generated Images](https://icml.cc/virtual/2024/poster/33086)", which 
was accepted by ICML2024. [[code](https://github.com/beibuwandeluori/DRCT)]

### Directory Tree
```
DRCT-2M/
├── README.md
├── pretrained.zip 
├── DRCT-2M.py
└── images/  
    ├── ldm-text2im-large-256.zip
    ├── stable-diffusion-v1-4.zip
    ├── stable-diffusion-v1-5.zip
    ├── stable-diffusion-2-1.zip
    ├── stable-diffusion-xl-base-1.0.zip
    ├── stable-diffusion-xl-refiner-1.0.zip
    ├── sd-turbo.zip
    ├── sdxl-turbo.zip
    ├── lcm-lora-sdv1-5.zip
    ├── lcm-lora-sdxl.zip
    ├── sd-controlnet-canny.zip
    ├── sd21-controlnet-canny.zip
    ├── controlnet-canny-sdxl-1.0.zip
    ├── stable-diffusion-inpainting.zip
    ├── stable-diffusion-2-inpainting.zip
    └── stable-diffusion-xl-1.0-inpainting-0.1.zip
└── fake_rec_images/  
    ├── stable-diffusion-v1-4.zip
    └── stable-diffusion-2-1.zip
```
- stable-diffusion-inpainting.zip、stable-diffusion-2-inpainting.zip and stable-diffusion-xl-1.0-inpainting-0.1.zip are real_rec images. 
- The fake_rec images were provided additionally for training in our proposed DRCT. To reconstruct the fake images in stable-diffusion-v1-4, 
we employed the reconstruction model named stable-diffusion-inpainting,
while the fake images in stable-diffusion-2-1 were reconstructed using stable-diffusion-2-inpainting.
- pretrained.zip: the pretrained weights of DRCT.


### More details of DRCT-2M dataset. 
| Diffusion Model | Model Name in diffusers                          | Image Count            | Inference Step | Condition      |
|-----------------|--------------------------------------------------|------------------------|----------------|----------------|
| LDM             | CompVis/ldm-text2im-large-256                    | train:118287, val:5000 | 50             | prompt         |
| SDv1.4          | CompVis/stable-diffusion-v1-4                    | train:118287, val:5000 | 50             | prompt         |
| SDv1.5          | runwayml/stable-diffusion-v1-5                   | train:118287, val:5000 | 50             | prompt         |
| SDv2            | stabilityai/stable-diffusion-2-1                 | train:118287, val:5000 | 50             | prompt         | 
| SDXL            | stabilityai/stable-diffusion-xl-base-1.0         | train:118287, val:5000 | 50             | prompt         |
| SDXL-Refiner    | stabilityai/stable-diffusion-xl-refiner-1.0      | train:118287, val:5000 | 40             | prompt         |
| SD-Turbo        | stabilityai/sd-turbo                             | train:118287, val:5000 | 1              | prompt         |
| SDXL-Turbo      | stabilityai/sdxl-turbo                           | train:118287, val:5000 | 1              | prompt         |
| LCM-SDv1.5      | latent-consistency/lcm-lora-sdv1-5               | train:118287, val:5000 | 4              | prompt         |
| LCM-SDXL        | latent-consistency/lcm-lora-sdxl                 | train:118287, val:5000 | 4              | prompt         |
| SDv1-Ctrl       | lllyasviel/sd-controlnet-canny                   | train:118287, val:5000 | 20             | prompt + canny |
| SDv2-Ctrl       | thepowefuldeez/sd21-controlnet-canny             | train:118287, val:5000 | 20             | prompt + canny |
| SDXL-Ctrl       | diffusers/controlnet-canny-sdxl-1.0              | train:118287, val:5000 | 20             | prompt + canny |
| SDv1-DR         | runwayml/stable-diffusion-inpainting             | train:118287, val:5000 | 50             | image + prompt + mask  |
| SDv2-DR         | stabilityai/stable-diffusion-2-inpainting        | train:118287, val:5000 | 50             | image + prompt + mask  |
| SDXL-DR         | diffusers/stable-diffusion-xl-1.0-inpainting-0.1 | train:118287, val:5000 | 50             | image + prompt + mask  |

### Merge big zip files:
- images/stable-diffusion-inpainting.zip
- images/stable-diffusion-2-inpainting.zip
- images/stable-diffusion-xl-1.0-inpainting-0.1.zip
- fake_rec_images/stable-diffusion-v1-4.zip
- fake_rec_images/stable-diffusion-2-1.zip
```
cd images/
zip -F stable-diffusion-inpainting_split.zip --out stable-diffusion-inpainting.zip
zip -F stable-diffusion-2-inpainting_split.zip --out stable-diffusion-2-inpainting.zip
zip -F stable-diffusion-xl-1.0-inpainting-0.1_split.zip --out stable-diffusion-xl-1.0-inpainting-0.1.zip
cd ../fake_rec_images/
zip -F stable-diffusion-v1-4_split.zip --out stable-diffusion-v1-4.zip
zip -F stable-diffusion-2-1_split.zip --out stable-diffusion-2-1.zip
```

### Download Real Images in DRCT-2M: [MSCOCO](https://cocodataset.org/#download)

- 2017 Train images [118K/18GB] -> [download link](http://images.cocodataset.org/zips/train2017.zip): Split 10% to be used as a validation set in DRCT-2M, with the remaining 90% serving as the training set.
- 2017 Val images,  [5K/1GB] -> [download link](http://images.cocodataset.org/zips/val2017.zip): Serving as test set in DRCT-2M.
- 2017 Train/Val annotations [241MB] -> [download link](thttp://images.cocodataset.org/annotations/annotations_trainval2017.zip): Provide prompts to generate fake images using Stable Diffusion models.
#### Real Images Directory Tree
```
MSCOCO/
├── train2017
├── val2017
└── annotations

```
### Citation
If you find this work useful for your research, please kindly cite our paper:
```
@InProceedings{pmlr-v235-chen24ay,
  title = 	 {{DRCT}: Diffusion Reconstruction Contrastive Training towards Universal Detection of Diffusion Generated Images},
  author =       {Chen, Baoying and Zeng, Jishen and Yang, Jianquan and Yang, Rui},
  booktitle = 	 {Proceedings of the 41st International Conference on Machine Learning},
  pages = 	 {7621--7639},
  year = 	 {2024},
  editor = 	 {Salakhutdinov, Ruslan and Kolter, Zico and Heller, Katherine and Weller, Adrian and Oliver, Nuria and Scarlett, Jonathan and Berkenkamp, Felix},
  volume = 	 {235},
  series = 	 {Proceedings of Machine Learning Research},
  month = 	 {21--27 Jul},
  publisher =    {PMLR},
  pdf = 	 {https://raw.githubusercontent.com/mlresearch/v235/main/assets/chen24ay/chen24ay.pdf},
  url = 	 {https://proceedings.mlr.press/v235/chen24ay.html}
}
```
