generated_from_trainer

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

diffusion-detection

This model was trained to distinguish real world images (negative) from machine generated ones (postive).

Model usage

from transformers import BeitImageProcessor, BeitForImageClassification
from PIL import Image

processor = BeitImageProcessor.from_pretrained('TimKond/diffusion-detection')
model = BeitForImageClassification.from_pretrained('TimKond/diffusion-detection')

image = Image.open("2980_saltshaker.jpg")

inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits

predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])

Training and evaluation data

BEiT-base-patch16-224-pt22k was loaded as a base model for further fine tuning:

As negatives a subsample of 10.000 images from imagenet-1k was used. Complementary 10.000 positive images were generated using Realistic_Vision_V1.4.

The labels from imagenet-1k were used as prompts for image generation. GitHub reference

Training hyperparameters

The following hyperparameters were used during training:

Framework versions