CoolFace
Modelpublic

boluobobo/ItsNotAI-ai-detector-v1

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
2likes22downloads
Model Card

ItsNotAI v1 - Multiclass AI Image Detector

Detect AI-generated images | Identify the AI generator | Verify human-made artwork

A Vision Transformer model that detects AI-generated images and identifies the specific AI generator used (33 classes).

Website: https://itsnotai.org


Newer Version Available

VersionFeaturesLink
v2 (Latest)Dual-head, FLUX detection, improved MidjourneyItsNotAI-ai-detector-v2
v1 (This)Single-head, 33-class classificationCurrent page
Recommendation: Use v2 for better binary (Real/AI) classification. Use v1 if you only need source identification without the binary head.

Note: This is one of the models used by ItsNotAI. For official verification at itsnotai.org, we use an ensemble of multiple models combined with human expert review to ensure maximum accuracy.

About ItsNotAI

Most AI detectors focus on catching AI usage. ItsNotAI takes the opposite approach: helping artists prove their work is human-made.

Key Features

  • Verifiable Label: Beyond just a percentage score, we provide artists with a verifiable "Not AI" label that can be embedded in their work.
  • Industry-Focused: We specialize in digital painting, manga illustration, and texture design, developed in deep collaboration with 100+ professional artists.
  • Artist-First: Our industry endorsements and artist partnerships create a trust network that goes beyond pure technical metrics.

Use Cases

  • Artists & Creators: Prove your artwork is human-made, protect your reputation
  • Stock Photo Platforms: Filter AI-generated uploads, maintain content quality
  • Social Media Moderation: Detect AI-generated profile pictures and fake content
  • News & Media: Verify photo authenticity, combat misinformation
  • NFT Marketplaces: Ensure digital art authenticity
  • Academic Research: Study AI image generation patterns

Model Description

This model can:

  1. 1.Detect whether an image is real or AI-generated
  2. 2.Identify the specific AI generator used (e.g., Stable Diffusion, DALL-E 3, Midjourney, StyleGAN2, etc.)

Architecture

  • Base Model: microsoft/beit-large-patch16-224 (BEiT-Large)
  • Parameters: ~304M
  • Input Size: 224x224 pixels
  • Mode: Multi-class classification

Output Labels (33 Classes)

Real: All real images (from ImageNet, COCO, FFHQ, CelebA-HQ, AFHQ, LSUN, MetFaces, Landscape)

AI Sources:

LabelDescription
stable_diffusionStable Diffusion 1.x/2.x/XL
latent_diffusionLatent Diffusion Models
glideOpenAI GLIDE
dalleDALL-E series
midjourneyMidjourney
stylegan1StyleGAN v1
stylegan2StyleGAN v2
stylegan3StyleGAN v3
pro_ganProgressive GAN
big_ganBigGAN
gau_ganGauGAN / NVIDIA Canvas
cycle_ganCycleGAN
star_ganStarGAN
ddpmDenoising Diffusion Probabilistic Models
vq_diffusionVQ-Diffusion
palettePalette Diffusion
gansformerGANsformer
projected_ganProjected GAN
diffusion_ganDiffusion GAN
denoisingdiffusionganDenoising Diffusion GAN
taming_transformerTaming Transformers
generative_inpaintingGenerative Inpainting
lamaLaMa Inpainting
matMAT Inpainting
cipsCIPS
face_syntheticsFace Synthetics
sfhqSynthetic Faces HQ

Recommended Usage

python
from transformers import AutoModelForImageClassification, AutoImageProcessor
from PIL import Image
import torch

# Load model
model_id = "boluobobo/ItsNotAI-ai-detector-v1"
model = AutoModelForImageClassification.from_pretrained(model_id)
processor = AutoImageProcessor.from_pretrained(model_id)

def detect_image(image_path):
    image = Image.open(image_path).convert("RGB")
    inputs = processor(image, return_tensors="pt")

    with torch.no_grad():
        outputs = model(**inputs)
        probs = torch.softmax(outputs.logits, dim=-1)[0]

    # Get top predictions
    top_indices = probs.argsort(descending=True)[:5]
    predictions = []
    for idx in top_indices:
        label = model.config.id2label[str(idx.item())]
        score = probs[idx].item()
        predictions.append({"label": label, "score": round(score, 3)})

    return {
        "predicted_source": predictions[0]["label"],
        "confidence": predictions[0]["score"],
        "top5_predictions": predictions
    }

# Example
result = detect_image("test.jpg")
print(f"Predicted Source: {result['predicted_source']}")
print(f"Confidence: {result['confidence']:.1%}")

Example Output:

json
{
  "predicted_source": "stable_diffusion",
  "confidence": 0.452,
  "top5_predictions": [
    {"label": "stable_diffusion", "score": 0.452},
    {"label": "latent_diffusion", "score": 0.213},
    {"label": "glide", "score": 0.089},
    {"label": "ddpm", "score": 0.056},
    {"label": "imagenet", "score": 0.042}
  ]
}
Note: v1 returns source classification only. For binary Real/AI detection, use v2 with its dedicated binary head.

Performance

MetricValue
Accuracy93.51%
Precision95.40%
Recall93.51%
F1 Score94.11%

Quick Start

Installation

bash
pip install transformers torch pillow

Basic Usage

python
from transformers import AutoModelForImageClassification, AutoImageProcessor
from PIL import Image
import torch

# Load model
model_id = "boluobobo/ItsNotAI-ai-detector-v1"
model = AutoModelForImageClassification.from_pretrained(model_id)
processor = AutoImageProcessor.from_pretrained(model_id)

# Load image
image = Image.open("your_image.jpg").convert("RGB")

# Predict
inputs = processor(image, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)
    probs = torch.softmax(outputs.logits, dim=-1)
    pred_idx = outputs.logits.argmax(-1).item()

# Get label
label = model.config.id2label[pred_idx]
confidence = probs[0][pred_idx].item()

print(f"Prediction: {label}")
print(f"Confidence: {confidence:.2%}")

With Source Metadata

python
import json
from huggingface_hub import hf_hub_download

# Download source metadata
meta_path = hf_hub_download(repo_id=model_id, filename="source_meta.json")
with open(meta_path) as f:
    meta = json.load(f)

source_names = meta["source_names"]

# Get all probabilities
for i, (name, prob) in enumerate(zip(source_names, probs[0].tolist())):
    if prob > 0.01:  # Show only >1%
        print(f"  {name}: {prob:.2%}")

Training Details

  • Dataset: ArtiFact (50K+ images from multiple sources)
  • Epochs: 10
  • Batch Size: 64
  • Learning Rate: 5e-6
  • Optimizer: AdamW with cosine scheduler
  • Loss: Focal Loss with label smoothing (0.1)
  • Hardware: NVIDIA T4 / A100 GPU

FAQ

Q: Can this detect Midjourney images? A: Yes, the model can detect images from Midjourney, Stable Diffusion, DALL-E, and 25+ other AI generators.

Q: Does it work on digital paintings? A: Yes! We specialize in digital art, manga, and illustration detection with input from 100+ professional artists.

Q: How is this different from other AI detectors? A: ItsNotAI focuses on helping artists prove their work is human-made, not just catching AI usage. We provide verifiable labels for authentic artwork.

Q: What image formats are supported? A: PNG, JPG, WEBP, and other common formats. Images are automatically resized to 224x224 for processing.

Limitations

  • Best performance on 224x224 or larger images
  • May have reduced accuracy on heavily compressed images
  • Trained primarily on Western-style images
  • New AI generators not in training data may not be correctly identified

Citation

bibtex
@misc{itsnotai2025,
  title={ItsNotAI: Multi-class AI Image Detection},
  author={ItsNotAI Team},
  year={2025},
  url={https://huggingface.co/boluobobo/ItsNotAI-ai-detector-v1}
}

License

Apache 2.0