ymcmy's picture
Update README.md
1adb073 verified
---
title: AI Generated Image Detector
emoji: 🐨
colorFrom: yellow
colorTo: purple
sdk: gradio
sdk_version: 4.36.1
app_file: app.py
pinned: false
license: mit
---
# Mode Description
Images are first divided into patches and classified as rich texture or poor texture. The azimuthal integral is then calculated for each patch with positional embedding applied. See train.py for subsequent classifier architecture.
The four datasets I trained on:
- AI Recognition Dataset: https://www.kaggle.com/datasets/superpotato9/dalle-recognition-dataset
- AI ArtBench: https://www.kaggle.com/datasets/ravidussilva/real-ai-art
- Dalle-3 Images: https://huggingface.co/datasets/ehristoforu/dalle-3-images
- 130k Images--Universal Image Embeddings: https://www.kaggle.com/datasets/rhtsingh/130k-images-512x512-universal-image-embeddings
I sampled approximated 50,000 real and 50,000 AI generated images. I was able to achieve 97.5% validation accuracy
# Training Suggestion
First run preprocess.py and save the preprocessed data as .h5 files in disk. Then run train.py for model training.
Preprocessing takes a long time (probably longer than training). It's not a good idea to preprocess while you train, because preprocessing will max out the CPU and leave the GPU idle.
# Thanks
The model design is inspired by https://arxiv.org/abs/2311.12397 and https://arxiv.org/abs/2003.01826.
Used code from https://github.com/hridayK/Detection-of-AI-generated-images and https://github.com/cc-hpc-itwm/UpConv