Image Classification
Transformers
Safetensors
PyTorch
vit
ViT
real-fake-detection
deep-fake
ai-detect
ai-image-detection
Eval Results (legacy)
Run this model with HF Jobs
Run jacoballessio/ai-image-detect-distilled on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/jacoballessio/ai-image-detect-distilled. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/jacoballessio/ai-image-detect-distilled on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use jacoballessio/ai-image-detect-distilled with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jacoballessio/ai-image-detect-distilled with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="jacoballessio/ai-image-detect-distilled") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("jacoballessio/ai-image-detect-distilled") model = AutoModelForImageClassification.from_pretrained("jacoballessio/ai-image-detect-distilled", device_map="auto") - Notebooks
- Google Colab
- Kaggle
AI Detection Model
Model Architecture and Training
Three separate models were initially trained:
- Midjourney vs. Real Images
- Stable Diffusion vs. Real Images
- Stable Diffusion Fine-tunings vs. Real Images
Data preparation process:
- Used Google's Open Image Dataset for real images
- Described real images using BLIP (Bootstrapping Language-Image Pre-training)
- Generated Stable Diffusion images using BLIP descriptions
- Found similar Midjourney images based on BLIP descriptions
This approach ensured real and AI-generated images were as similar as possible, differing only in their origin.
The three models were then distilled into a small ViT model with 11.8 Million Parameters, combining their learned features for more efficient detection.
Data Sources
- Google's Open Image Dataset: link
- Ivan Sivkov's Midjourney Dataset: link
- TANREI(NAMA)'s Stable Diffusion Prompts Dataset: link
Performance
Validation Set: 74% accuracy
- Held out from training data to assess generalization
Custom Real-World Set: 72% accuracy
- Composed of self-captured images and online-sourced images
- Designed to be more representative of internet-based images
Comparative Analysis:
- Outperformed other popular AI detection models by 5 percentage points on both sets
- Other models achieved 89% and 79% on validation and real-world sets respectively
Key Insights
- Strong generalization on validation data (75% accuracy)
- Good adaptability to diverse, real-world images (72% accuracy)
- Consistent outperformance of other popular models
- 10-point accuracy drop from validation to real-world set indicates room for improvement
- Comprehensive training on multiple AI generation techniques contributes to model versatility
- Focus on subtle differences in image generation rather than content disparities
Future Directions
- Expand dataset with more diverse, real-world examples to bridge the performance gap
- Improve generalization to internet-sourced images
- Conduct error analysis on misclassified samples to identify patterns
- Integrate new AI image generation techniques as they emerge
- Consider fine-tuning for specific domains where detection accuracy is critical
- Downloads last month
- 117
Model tree for jacoballessio/ai-image-detect-distilled
Spaces using jacoballessio/ai-image-detect-distilled 3
Evaluation results
- accuracyself-reported0.740