Awesome
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:
- The weights, training code and evaluation code for state-of-the-art AI-generated contents detection models.
- The training, validation and test datasets for Sentry-Image Leaderboard.
- An open questionnaire(Sentry-Questionnaire) from HPBench.
Why we need Sentry-Image?
-
π§ Recent study have shown that humans struggle significantly to distinguish real photos from AI-generated ones, with a misclassification rate of 38.7%.
-
π€ To help people confirm whether the images they see are real images or AI-generated images, we launched the Sentry-Image project.
-
π» Sentry-Image is an open source project which provides the SOTA fake image detection models in Sentry-Image Leaderboard to detect whether the image provided is an AI-generated or real image.
Stay tuned for this project! Feel free to contact contact@infimagine.com! π
News
- [2023/07] We open source the Sentry-Image repository and Sentry-Image Demo & Leaderboard.
- [2023/07] We open source the Sentry-Image dataset.
- [2023/08] We provide an open questionnaire(Sentry-Questionnaire) from HPBench! Now everyone can test your discriminant score against AIGC!
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)
Dataset | SD-V1.5Real-dpms-25 | IF-V1.0-dpms++-25 | StyleGAN3 |
---|---|---|---|
Generator | Diffusion | Diffusion | GAN |
Numbers | 1M | 1M | 87K |
Resolution | 512 | 256 | (>=512) |
Caption | CC3M-Train | CC3M-Train | - |
ImageData Path | ImageData/train/SDv15R-CC1M | ImageData/train/IFv1-CC1M | ImageData/train/stylegan3-80K |
MetaData Path | MetaData/train/SDv15R-CC1M.csv | MetaData/train/IF-CC1M.csv | MetaData/train/stylegan3-80K.csv |
Validation Dataset (MPBench)
Dataset | SDv15 | SDv21 | IF | Cogview2 | StyleGAN3 | Midjourneyv5 |
---|---|---|---|---|---|---|
Generator | Diffusion | Diffusion | Diffusion | AR | GAN | - |
Numbers | 30K | 15K | 95K | 22K | 60K | 5K |
Resolution | 512 | 512 | 256 | 480 | (>=512) | (>=512) |
Caption | CC15K-val | CC15K-val | CC15K-val | CC15K-val | - | - |
ImageData Path | ImageData/val/SDv15-CC30K | ImageData/val/SDv21-CC15K | ImageData/val/IF-CC95K | ImageData/val/cogview2-22K | ImageData/val/stylegan3-60K | ImageData/val/Midjourneyv5-5K |
MetaData Path | MetaData/val/SDv15-CC30K.csv | MetaData/val/SDv21-CC15K.csv | MetaData/val/IF-CC95K.csv | MetaData/val/cogview2-22K.csv | MetaData/val/stylegan3-60K.csv | MetaData/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:
- (2023.7) Release the training, validation datasets from MPBench.
- (2023.8) Release an open questionnaire from HPBench!
- (2023.9) Support Stable Diffusion XL fake image dataset
- (2023.9) Release the training and evaluation code of Sentry-Image.
- (2023.10) Support Midjourney V5 fake image datset
- (2023.10) Release a new test datasets for Sentry-Image-Leaderboard.
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},
}