/ Модель

Характеристики

Лицензия
CC BY-NC-SA 4.0
Библиотека
onnx
Опубликована
3 окт 2026

ai-image-analyzer-weights

Классификация изображенийИзображение → label

Набор ONNX-моделей EfficientNet-B0 для классификации изображений как реальных или сгенерированных ИИ и определения вероятного генератора.

0скачиваний за 30 дней0лайковвеса обновлены3 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Набор весов alpha v0.2 для библиотеки AI Image Analyzer, разработанный автором репозитория. В него входят две модели EfficientNet-B0 на базе timm, предварительно обученные на ImageNet и сохранённые в формате ONNX: классификатор отличает реальные изображения от созданных ИИ, а модель атрибуции определяет вероятный генератор среди 11 известных вариантов. Классификатор также формирует карту свидетельств 6×6, показывающую вклад областей изображения в решение; модель атрибуции воздерживается от ответа, если уверенность ниже 0,80.

Модели предназначены для исследовательских и учебных задач, прототипов объяснимой экспертизы изображений и как один из слабых сигналов при анализе происхождения изображения. На тесте с новыми генераторами точность детектора составила около 71%, а точность атрибуции на отдельном бенчмарке — 47,5%. Качество заметно зависит от знакомости генератора и обработки изображения; возможны ложные срабатывания на реальных фотографиях. Лицензия CC BY-NC-SA 4.0 допускает использование с указанием авторства, на некоммерческих условиях и с распространением производных материалов на той же лицензии.

Сценарии применения

  • оценка, создано ли изображение генеративной моделью
  • определение вероятного генератора синтетического изображения
  • изучение признаков, влияющих на детекцию ИИ-изображений
  • создание учебных прототипов цифровой экспертизы изображений

Ограничения

Это alpha-модель с ограниченной переносимостью на новые генераторы и конвейеры обработки; детектор может ошибочно помечать реальные фотографии, а уверенность не откалибрована. Изменение формата, сжатие и уменьшение изображения влияют на оценки, поэтому результаты не подходят как единственное основание для юридических, журналистских, академических или модерационных решений.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

AI Image Analyzer — weights (alpha, v0.2)

Two small EfficientNet-B0 models used by the AI Image Analyzer library:

FileWhat it doesSize
detector_v2.onnx (+ .json, .pt)real vs AI-generated, plus a 6×6 evidence map (exact per-region contribution to the decision)15 MB
attribution_v1.onnx (+ .json, .pt)which of 11 generators made an AI image (abstains below 0.80 confidence)15 MB

Alpha release — not a reliable detector for arbitrary images. It is right ~84% of the time on unseen images from generators it was trained on, ~71% on a different benchmark with new generators, and flags some real photos as AI (13.5% of RAISE camera raws). Do not use a single score to make decisions about a person or an image's origin. Full analysis: REPORT.md.

Use with the library (recommended)

pip install git+https://github.com/Dadhichi-Sarker-Shayon/AI-Generated-Image-Analyzer.git   # weights are bundled
from ai_image_analyzer import AIImageAnalyzer
report = AIImageAnalyzer(use_clip=False).analyze("photo.jpg")
print(report.verdict, report.ai_probability, report.attribution.specific_model)

Use the ONNX file directly

Preprocessing must match training: center-crop square → 256 px (Lanczos) → JPEG quality 95 → resize 192 px → ImageNet normalization.

import io, json, numpy as np, onnxruntime as ort
from PIL import Image

meta = json.load(open("detector_v2.json"))

def preprocess(path):
    im = Image.open(path).convert("RGB")
    w, h = im.size; s = min(w, h); left, top = (w - s) // 2, (h - s) // 2
    im = im.crop((left, top, left + s, top + s)).resize((256, 256), Image.LANCZOS)
    buf = io.BytesIO(); im.save(buf, "JPEG", quality=95)
    im = Image.open(buf).convert("RGB").resize((meta["input_size"], meta["input_size"]), Image.BILINEAR)
    x = (np.asarray(im, np.float32) / 255 - np.array(meta["mean"], np.float32)) / np.array(meta["std"], np.float32)
    return x.transpose(2, 0, 1)[None].astype(np.float32)

sess = ort.InferenceSession("detector_v2.onnx", providers=["CPUExecutionProvider"])
probs, evidence = sess.run(None, {"pixel_values": preprocess("photo.jpg")})
print("P(AI) =", float(probs[0, 1]))                      # probs = [P(real), P(AI)]
# evidence: (1, 6, 6); sum(evidence) + meta["evidence_bias"] == logit_AI - logit_real  (exact)

attribution_v1.onnx takes the same input and returns 11 probabilities in the order of classes in attribution_v1.json (adm, biggan, dalle3, glide, midjourney, sd15, sd21, sd3, sdxl, vqdm, wukong). Treat the answer as "unknown" if the top probability is below min_confidence (0.80).

Training

  • Architecture: efficientnet_b0 (timm), ImageNet-pretrained, 192×192 input, 2-class head (detector) / 11-class head (attribution).
  • Data: 70,000 training images — Defactify (COCO real vs SD 2.1, SDXL, SD3, DALL-E 3, Midjourney v6; 42,000) + Tiny-GenImage (ImageNet real vs ADM, BigGAN, GLIDE, Midjourney, SD 1.x, VQDM, Wukong; 28,000). 21,000 real / 49,000 AI. Every image: center-crop → 256 px → JPEG q95 (removes file-format/resolution shortcuts).
  • Recipe: AdamW lr 1e-4, batch 32 (16×2 accumulation), label smoothing 0.1, class-balanced sampling, horizontal flip + color jitter, fp16, early stopping on validation AUC (detector: 15 epochs of 28k samples, best epoch 11; attribution: 6 epochs, best epoch 5).
  • Hardware: one GTX 1650 (4 GB); ~2 h for the detector.

Evaluation (threshold 0.5; 95% CIs in the report)

BenchmarkImagesAUCAccuracyReal kept realAI caught
Validation (used to select the epoch — optimistic)16,0000.98394.5%94.6%94.5%
Defactify test (unseen images; 5 generators vs COCO)11,2500.97483.9%97.8%81.1%
Synthbuster-plus test (unseen; 13 generators incl. FLUX, Imagen 3, Firefly; real = RAISE raws)2,8000.85670.6%86.5%69.3%

At a 1% false-positive rate the detector catches 70% (Defactify) and only 9% (Synthbuster-plus) of AI images. Synthbuster-plus detection by generator: DALL-E 3 98%, GLIDE 96%, SDXL 91%, FLUX.1-schnell 83%, Midjourney v5 81%, SD 1.x 66–69%, FLUX.1-dev 68%, SD3-medium 60%, Firefly 53%, SD 2 52%, Imagen 3 46%, DALL-E 2 42%.

Attribution: 78% correct on unseen images of the training pipeline, 47.5% on a different benchmark. At the shipped 0.80 threshold it answers ~26% of images with 87% precision, and names ~12% of images from generators it never saw (e.g. FLUX) with a wrong label.

Intended use and limitations

Intended: research, education, building explainable-forensics prototypes, one weak signal among several. Out of scope: verifying the authenticity of a specific image for legal, journalistic, academic-integrity or moderation decisions; detecting edited (inpainted) real photos; adversarial settings.

  • Generalization to new generators and pipelines is limited (see above); newer high-fidelity generators (Imagen 3, Firefly) are mostly missed.
  • False positives occur on real photos, especially raw-camera images (13.5% on RAISE).
  • Scores change with re-encoding (same photo: JPEG 0.20, WebP 0.27, grayscale 0.16); robustness to compression/resizing/screenshots was not systematically tested.
  • The probability is not calibrated. The input is reduced to 192 px, discarding fine pixel-level artifacts.
  • Real and AI images in the training data come from different content distributions (COCO/ImageNet vs prompt-driven images), so content or style may contribute to the signal.
  • The evidence map shows where the network's evidence lies (typically spread over the whole image); it is not proof of generation.

License

CC BY-NC-SA 4.0 — non-commercial, attribution, share-alike. The weights inherit this from the most restrictive training dataset (Tiny-GenImage, CC BY-NC-SA 4.0); two other datasets declare no license. This is the authors' conservative reading, not legal advice; see LICENSE-WEIGHTS.md. The library code is MIT.

Acknowledgements

Datasets: GenImage / Tiny-GenImage, Defactify (arXiv:2601.00553), Synthbuster, MS COCO, RAISE. Models/libraries: EfficientNet (Tan & Le 2019), timm, ONNX Runtime. Details in NOTICE.md.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · onnx

Нельзя запустить

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
f29b77b

0 моделей