Run this model with HF Jobs
Run dima806/ai_vs_human_generated_image_detection 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/dima806/ai_vs_human_generated_image_detection. 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/dima806/ai_vs_human_generated_image_detection 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 dima806/ai_vs_human_generated_image_detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dima806/ai_vs_human_generated_image_detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="dima806/ai_vs_human_generated_image_detection") 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("dima806/ai_vs_human_generated_image_detection") model = AutoModelForImageClassification.from_pretrained("dima806/ai_vs_human_generated_image_detection", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Note to users who want to use this model in production
Beware that this model is trained on a dataset collected about 1 year ago. Since then, there is a remarkable progress in generating deepfake images with common AI tools, resulting in a significant concept drift. To mitigate that, I urge you to retrain the model using the latest available labeled data. As a quick-fix approach, simple reducing the threshold (say from default 0.5 to 0.1 or even 0.01) of labelling image as a fake may suffice. However, you will do that at your own risk, and retraining the model is the better way of handling the concept drift.
=======
Predicts with about 98% accuracy whether an attached image is AI-generated.
See https://www.kaggle.com/code/dima806/ai-vs-human-generated-images-prediction-vit for details.
Classification report:
precision recall f1-score support
human 0.9655 0.9930 0.9790 3998
AI-generated 0.9928 0.9645 0.9784 3997
accuracy 0.9787 7995
macro avg 0.9791 0.9787 0.9787 7995
weighted avg 0.9791 0.9787 0.9787 7995
- Downloads last month
- 613
