/ Модель

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

Лицензия
CC BY-NC-SA 4.0
Архитектура
convnext · dense
Базовая модель
convnext-tiny-224
Библиотека
transformers
Опубликована
18 ноя 2026

ai-image-detector

Классификация изображенийИзображение → label3 профессии
123скачиваний за 30 дней0лайковвеса обновлены21 ноя 2026

Описание модели

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

Бинарный классификатор ConvNeXt-Tiny для предварительного определения, является ли изображение фотографией или генерацией ИИ.

mkk1135 разработал бинарный детектор изображений на базе сверточной архитектуры ConvNeXt-Tiny, дообученной от facebook/convnext-tiny-224 в рамках выпускного проекта по кибербезопасности. Модель классифицирует изображение как фотографию, сделанную камерой (real), или изображение, созданное ИИ (ai). Она доступна через библиотеку Transformers и принимает изображения; выход — классы с оценками модели.

Модель обучена на 36 562 изображениях, включая фотографии и генерации разных семейств моделей. На отложенном тестовом наборе из 384 изображений точность составила 81,5%. Оценка не является откалиброванной вероятностью; автор рекомендует считать результаты ниже 0,75 неопределёнными. Модель предназначена для предварительной проверки происхождения изображений, а не для подтверждения подлинности.

Качество снижается на изображениях современных генераторов, после JPEG-пересохранения и размытия. Скриншоты, сканы, рисунки, сильно отредактированные и частично синтетические изображения не тестировались. Лицензия — CC BY-NC-SA 4.0, с ограничениями на коммерческое использование.

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

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

Ограничения

На тестовом наборе точность составила 81,5%; модель может ошибочно классифицировать реальные и сгенерированные изображения, особенно после JPEG-сжатия или размытия и для генераторов современных чат-ассистентов. Оценка не является вероятностью, а скриншоты, сканы, рисунки и сильно отредактированные изображения не тестировались.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

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

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

Открыть на Hugging Face

AI-generated image detector (ConvNeXt-Tiny)

A binary classifier that labels an image real (a photograph taken by a camera) or ai (AI-generated). It is a ConvNeXt-Tiny CNN fine-tuned from facebook/convnext-tiny-224 for a Bachelor of Cybersecurity graduation project. Code, a small web interface, the lists of test images, every prediction and the evaluation protocol: https://github.com/mkk1135/graduation-project

Try it in your browser: https://huggingface.co/spaces/mkk1135/ai-image-detector (the image is analysed on your own device and is not uploaded).

Read the limitations before relying on it. On a held-out test set of 384 images it classified 81.5% correctly, and its answer is an indication, not proof.

Use

from transformers import pipeline

detector = pipeline("image-classification", model="mkk1135/ai-image-detector")
print(detector("photo.jpg"))

The processor does not resize: the model looks at the whole image at its original resolution, because shrinking an image removes the fine traces that generators leave. Very large images need more memory and time; the project's interface analyses at most the central 2048 x 2048 pixels. The decision threshold that was chosen on development images is built into the model, so the label with the higher score is the model's answer. That score is the model's score for its answer, not a calibrated probability; treat a score below 0.75 as "undetermined". The project's interfaces show it as "detector score" and state that it is not a probability.

The project's repository also contains a combination of this model with the published detector OwensLab/commfor-model-384 (fusion.py), which was more accurate than either part on the held-out test set (95.3% against 81.5% and 92.2%, and 94.0% for the published detector with a threshold tuned on the development images).

Training data

36,562 images, of which a random 10% was held out for validation.

ClassSourceImages
GeneratedCommunity Forensics-Small: 377 community Stable Diffusion models (latent diffusion)14,592
GeneratedCommunity Forensics-Small: GLIDE, DeepFloyd IF (pixel diffusion), BigGAN2,992
RealCommunity Forensics-Small: COCO (4,831), VISION (1,153), Landscapes HQ (2,992), FFHQ (2,992)11,968
RealDataSeeds.AI Sample Dataset: peer-ranked photographs of varied subjects7,010

Images flagged NSFW by Community Forensics were removed.

Training

Three epochs, AdamW, learning rate 5e-5, batch size 32, seed 42, on 256 x 256 crops taken at the images' original resolution. Augmentation: random shrinking (seven times in ten, by any factor down to the crop size), horizontal flip, Gaussian blur (radius 0.3 to 1.2 px, probability 0.3), Gaussian noise (standard deviation 1 to 5, probability 0.3), and JPEG re-compression applied zero, one or two times at quality 30 to 95. The generated training images are uncompressed PNG and most real ones are JPEG, so the augmentation is there to keep the model from using an image's size, sharpness or compression history as the answer.

This is the fifth training setting of the project. The model published before it (setting 4) called small, lightly compressed photographs generated; the strong shrinking was added to remove that shortcut. After training, the decision threshold was set to 0.69 on the "AI" score, the value with the highest accuracy on 541 development images.

Results

"Real" is the positive class. None of the named generators of the evaluation sets is in the training data, but some open-source generators of the development and final test sets (three LCM-LoRA models and a Midjourney-style adapter) are built on Stable Diffusion, the family that supplies most of the generated training images. The generators of the Reddit images are not known. The training setting and the threshold were chosen on development images only; the three held-out sets were scored once, after all decisions had been committed to the public repository.

SetImagesAccuracyReal correctAI correct
Validation split (same sources as training; default threshold)3,65795.3%
Check set (development)15788.5%66 / 6973 / 88
Development test set38482.6%167 / 192150 / 192
Final test set (held out)38481.5% (95% CI 77.3 to 85.1)171 / 192142 / 192
Final test set, every image re-compressed as JPEG quality 9038478.1%174 / 192126 / 192
ChatGPT and Gemini set (held out)16868.5%61 / 7254 / 96
Reddit set (held out; labels may be wrong in some cases)12068.3%56 / 6026 / 60

The final test set holds 192 photographs (Wikimedia Commons, Unsplash and Open Images, 64 each) and 192 images from the Community Forensics evaluation set: 132 from 11 commercial generators (Midjourney v5.2 and v6.1, DALL-E 2 and 3, Firefly Image 2 and 3, Imagen 3, Ideogram v1 and v2, FLUX dev and schnell) and 60 from 10 open-source generators. By source: Wikimedia Commons 56 / 64, Unsplash 62 / 64, Open Images 53 / 64, commercial generators 105 / 132, open-source generators 37 / 60.

Compared on the same 384 held-out images: Claude Sonnet 5.5 (asked in a blind test) 96.6%, the combination of this model with OwensLab/commfor-model-384 95.3%, OwensLab/commfor-model-384 alone 92.2%, this model 81.5%, the model published before it (setting 4) 82.3%, and the three other public detectors compared in the project's report between 50.0% and 66.4%.

Three training runs that differ only in the seed scored between 81.5% and 83.9% on the final test set (mean 83.0%, standard deviation 1.3). The published model is the run with seed 42, which was fixed in advance.

Limitations

  • Treat its answer as a hint, not as proof that an image is real or generated. On the held-out final test set 71 of 384 answers were wrong.
  • Its main error is missing generated images: on the final test set it called 50 of the 192 generated images real, and 21 of the 192 photographs generated.
  • It is weak on images from the generators of current chat assistants. On the held-out ChatGPT and Gemini set it recognised 12 of 24 images from GPT Image 2, 10 of 24 from GPT Image 1.5, 23 of 24 from Nano Banana and 9 of 24 from Nano Banana Pro.
  • JPEG re-compression lowers its accuracy on the final test set from 81.5% to 78.1%: of the 192 generated images it then recognises 126.
  • It still reacts to processing. After a slight Gaussian blur (radius 0.6 px) it recognised 58 of the 69 photographs of the check set (without blur: 66) and 73 of the 88 generated images (without blur: 73).
  • Its score is not a calibrated probability. On the final test set, answers with a score of 0.75 or more were right in 86.4% of 324 cases, answers with a lower score in 55.0% of 60.
  • This model is not better than the one published here before it (training setting 4, default threshold), and on some images it is worse. On the final test set the two cannot be told apart (81.5% against 82.3%). On the ChatGPT and Gemini set the earlier model scored 73.2% against 68.5%, and on the Reddit set 79.2% against 68.3%: the stronger shrinking and the tuned threshold make this model slower to call an image generated. This model was published because the rule for choosing it had been fixed before the held-out sets were scored. For images from recent generators or from social media, prefer the earlier model, which is kept in this repository under the tag round-1: pipeline("image-classification", model="mkk1135/ai-image-detector", revision="round-1").
  • It was trained and tested on photographs and on unedited generator output. Screenshots, scans, drawings, heavily edited photographs, and partly synthetic images are untested.
  • Generators released after the training data was collected may not be detected.

Licence

CC BY-NC-SA 4.0, following the licence of the Community Forensics training data: non-commercial use only.

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

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

GPU в ailist

Универсальный рантайм · transformers · image-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
ConvNextForImageClassification
Ревизия весов
fb3e159

0 моделей