Home

Awesome

Sentry-Image

Sentry-Image: Detect Any AI-generated Images

<p align="center"> πŸ“ƒ <a href="https://arxiv.org/abs/2304.13023" target="_blank">NeurIPS'23 Paper</a> β€’ πŸ€— <a href="http://sentry.infimagine.com/" target="_blank">Demo & Leaderboard</a> β€’ πŸ“‹ <a href="https://docs.google.com/forms/d/e/1FAIpQLSfhYMAEnqsaxQPNfLqFEpnFxEUqBhmUoRyfPBfYVfZOx4MtLA/viewform?usp=sharing" target="_blank">Sentry-Questionnaire</a> β€’ 🐦 <a href="https://twitter.com/infimagine/status/1680439942063992832" target="_blank">Twitter</a> β€’ πŸ“¦ <a href="https://huggingface.co/datasets/InfImagine/FakeImageDataset" target="_blank">Dataset</a> <br> </p>

Sentry-Image is an open-source project for detecting AI-generated contents. The core features will include:

Why we need Sentry-Image?

Stay tuned for this project! Feel free to contact contact@infimagine.com! πŸ˜†

News

Fake Image Dataset

Fake Image Dataset is now open-sourced at huggingface (InfImagine Organization) and openxlab. It consists of two folders, ImageData and MetaData. ImageData contains the compressed packages of the Fake Image Dataset, while MetaData contains the labeling information of the corresponding data indicating whether they are real or fake.

How to Download in huggingface

You can use following codes to download the dataset:

git lfs install
git clone https://huggingface.co/datasets/InfImagine/FakeImageDataset

You can use following codes to extract the files in each subfolder (take the IF-CC95K subfolder in ImageData/val/IF-CC95K as an example):

cat IF-CC95K.tar.gz.* > IF-CC95K.tar.gz
tar -xvf IF-CC95K.tar.gz

Data Organization

We recommend that your data directory should be organized like this:

FakeImageDataset/
β”œβ”€β”€ ImageData/
β”‚Β Β  β”œβ”€β”€ train/
|   |   β”œβ”€β”€ IFv1-CC1M/
|   |   |   └── IFv1-dpmsolver++-50-1M/
|   |   β”œβ”€β”€ SDv15R-CC1M/
|   |   |   └── SDv15R-dpmsolver-25-1M/
|   |   └── stylegan3-80K/
|   |       β”œβ”€β”€ stylegan3-r-afhqv2-512x512/
|   |       β”œβ”€β”€ stylegan3-r-ffhqu-1024x1024/
|   |       β”œβ”€β”€ stylegan3-r-metfaces-1024x1024/
|   |       β”œβ”€β”€ stylegan3-t-afhqv2-512x512/
|   |       β”œβ”€β”€ stylegan3-t-ffhqu-1024x1024/
|   |       └── stylegan3-t-metfaces-1024x1024/
β”‚Β Β  └── val/
|       β”œβ”€β”€ IF-CC95K/
|       |   β”œβ”€β”€ IF-ddim-25-15K/
|       |   β”œβ”€β”€ IF-ddim-50-15K/
|       |   β”œβ”€β”€ IF-ddpm-50-15K/
|       |   β”œβ”€β”€ IF-dpmsolver++-10-15K/
|       |   β”œβ”€β”€ IF-dpmsolver++-25-15K/
|       |   └── IF-dpmsolver++-50-15K/
|       β”œβ”€β”€ Midjourneyv5-5K/
|       β”œβ”€β”€ SDv15-CC30K/
|       |   β”œβ”€β”€ SDv15-dpmsolver-25-15K/
|       |   └── SDv15R-dpmsolver-25-15K/
|       β”œβ”€β”€ SDv21-CC15K/
|       |   └── SDv2-dpmsolver-25-10K/
|       β”œβ”€β”€ cogview2-22K/
|       └── stylegan3-60K/
|           β”œβ”€β”€ stylegan3-r-afhqv2-512x512/
|           β”œβ”€β”€ stylegan3-r-ffhqu-1024x1024/
|           β”œβ”€β”€ stylegan3-r-metfaces-1024x1024/
|           β”œβ”€β”€ stylegan3-t-afhqv2-512x512/
|           β”œβ”€β”€ stylegan3-t-ffhqu-1024x1024/
|           └── stylegan3-t-metfaces-1024x1024/
└── MetaData/
 Β Β  β”œβ”€β”€ train/
    |   β”œβ”€β”€ IF-CC1M.csv
    |   β”œβ”€β”€ SDv15R-CC1M.csv
    |   └── stylegan3-80K.csv
 Β Β  └── val/
        β”œβ”€β”€ IF-CC95K.csv
        β”œβ”€β”€ Midjourneyv5-5K.csv
        β”œβ”€β”€ SDv15-CC30K.csv
        β”œβ”€β”€ SDv21-CC15K.csv
        β”œβ”€β”€ cogview2-22K.csv
        β”œβ”€β”€ stylegan3-60K.csv
        └── stylegan3-80K.csv

Training Dataset (Fake2M)

DatasetSD-V1.5Real-dpms-25IF-V1.0-dpms++-25StyleGAN3
GeneratorDiffusionDiffusionGAN
Numbers1M1M87K
Resolution512256(>=512)
CaptionCC3M-TrainCC3M-Train-
ImageData PathImageData/train/SDv15R-CC1MImageData/train/IFv1-CC1MImageData/train/stylegan3-80K
MetaData PathMetaData/train/SDv15R-CC1M.csvMetaData/train/IF-CC1M.csvMetaData/train/stylegan3-80K.csv

Validation Dataset (MPBench)

DatasetSDv15SDv21IFCogview2StyleGAN3Midjourneyv5
GeneratorDiffusionDiffusionDiffusionARGAN-
Numbers30K15K95K22K60K5K
Resolution512512256480(>=512)(>=512)
CaptionCC15K-valCC15K-valCC15K-valCC15K-val--
ImageData PathImageData/val/SDv15-CC30KImageData/val/SDv21-CC15KImageData/val/IF-CC95KImageData/val/cogview2-22KImageData/val/stylegan3-60KImageData/val/Midjourneyv5-5K
MetaData PathMetaData/val/SDv15-CC30K.csvMetaData/val/SDv21-CC15K.csvMetaData/val/IF-CC95K.csvMetaData/val/cogview2-22K.csvMetaData/val/stylegan3-60K.csvMetaData/val/Midjourneyv5-5K.csv

Others

Aesthetic Quality: We provide corresponding aesthetic scores for our dataset, using CLIP-IQA. You can download the aesthetic scores from here in our huggingface dataset page.

Visulization: We provide visualizations for our dataset, which you can find here.

Maintenance Plan

We are currently in the process of expanding our support to include two of the latest models for the fake image dataset: Stable Diffusion XL and Midjourney V5. We have devised a comprehensive maintenance plan, as follows:

License

This project is open-sourced under the Apache-2.0. These weights and datasets are fully open for academic research and can be used for commercial purposes with official written permission. If you find our open-source models and datasets useful for your business, we welcome your donation to support the development of the next-generation Sentry-Image model. Please contact contact@infimagine.com for commercial licensing and donation inquiries.

Citation

The code and model in this repository is mostly developed for or derived from the paper below. Please cite it if you find the repository helpful.

@misc{sentry-image-leaderboard,
      title = {Sentry-Image Leaderboard},
      author = {Zeyu Lu, Di Huang, Chunli Zhang, Chengyue Wu, Xihui Liu, Lei Bai, Wanli Ouyang},
      year = {2023},
      publisher = {InfImagine, Shanghai AI Laboratory},
      howpublished = "\url{https://github.com/Inf-imagine/Sentry}"
},
@inproceedings{lu2023seeing,
 title = {Seeing is not always believing: Benchmarking Human and Model Perception of AI-Generated Images},
 author = {Zeyu Lu, Di Huang, Lei Bai, Jingjing Qu, Chengyue Wu, Xihui Liu, Wanli Ouyang},
 booktitle = {Advances in Neural Information Processing Systems},
 year = {2023},
}