/ Модель

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

Контекст
8 192 токена
Размер весов
16,1 ГБ
Лицензия
Apache 2.0
Архитектура
llava_onevision · dense
Базовая модель
llava-onevision-qwen2-7b-si-hf
Библиотека
transformers
Опубликована
2 сен 2026

AnomalyThink-LLaVA-OneVision-7B-KCR

Изображение и текст → текст3 профессии
16скачиваний за 30 дней0лайковвеса обновлены18 сен 2026

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

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

Мультимодальная модель на базе LLaVA-OneVision, дообученная для объяснимого обнаружения дефектов на изображениях промышленных изделий.

AnomalyThink-LLaVA-OneVision-7B-KCR — исследовательская модель для объяснимого обнаружения аномалий на промышленных изображениях, разработанная как артефакт магистерской работы TU Delft. Она принимает изображение изделия и формирует текстовый разбор, описание дефекта при его наличии и бинарный вердикт о наличии аномалии. Модель основана на LLaVA-OneVision с языковой частью Qwen2, дообучена методом SFT на 6 000 трассах KCR, полученных из собственных генераций семейства; обучались мультимодальный проектор и языковая модель, а визуальный энкодер SigLIP был заморожен. Контекст обучения ограничен 8 192 токенами; репозиторий содержит веса safetensors и использует Apache-2.0.

Модель предназначена для исследовательских экспериментов и анализа отдельных изображений промышленных изделий. В описанных испытаниях сбалансированная точность составила 88,45% на DS-MVTec и 74,25% на VisA. Результат DS-MVTec подвержен загрязнению: базовая LLaVA-OneVision обучалась на данных, включавших примеры MVTec-AD; результат VisA авторы считают незагрязнённым. Модель может убедительно обосновывать ошибочный вердикт, склонна чрезмерно относить повреждения к классу «отсутствующие части» и хуже подходит для загромождённых сцен, нескольких объектов и непривычного освещения. Авторы прямо обозначают её как исследовательский артефакт, а не готовую систему производственного контроля.

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

  • поиск аномалий на изображении отдельного изделия
  • текстовое описание обнаруженного промышленного дефекта
  • получение бинарного вердикта о норме или дефекте изделия
  • исследовательское сравнение методов визуального контроля качества
  • анализ объяснений модели при обнаружении дефектов

Ограничения

Модель может уверенно выдавать неверные вердикты и чрезмерно относить разные повреждения к классу «отсутствующие части»; её трассы рассуждений не гарантируют корректного анализа изображения. Результат DS-MVTec осложнён возможным загрязнением обучающими данными базовой модели, а загромождённые сцены, несколько объектов и необычное освещение находятся вне распределения обучения.

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

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

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

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

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

Бенчмарки пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь рядом с другими моделями теста

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Изображение → текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

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

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

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

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

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

Открыть на Hugging Face

AnomalyThink-LLaVA-OneVision-7B-KCR

The strongest LLaVA-OneVision model in this family. Trained with SFT only, on a self-distilled corpus that the model family generated itself.

A LLaVA-OneVision-7B-SI model fine-tuned for explainable industrial anomaly detection (IAD). Given one product image it writes a reasoning trace in <think>, then a defect <location> and <type> when it sees a defect, and finally a binary <answer>. Research artefact from the MSc thesis Reasoning-Enhanced Vision-Language Models for Explainable Industrial Anomaly Detection (TU Delft, 2026).

This is the cross-architecture replication of the thesis pipeline. The backbone is the same one IAD-R1 uses, so the comparison is on IAD-R1's own ground.

Results

Metric is balanced accuracy, (TPR + TNR) / 2, in percent.

BenchmarkBalanced accuracy
MMAD DS-MVTec (1,670 images)88.45
MMAD VisA (2,141 images)74.25

Which build these weights are. This checkpoint is the first KCR build on this backbone. Its corpus was drawn from the whole 10,236-image rollout pool rather than from the 6,000-image SFT split (only 3,516 of its images lie inside that split, the other 2,484 come from the GRPO split) and it was balanced on the folder name rather than on the trace verdict, which left it at 45.0 % anomalous. The thesis reports the corrected build, rebuilt with all 6,000 images inside the SFT split and exactly 3,000 / 3,000 by verdict, as the replication result: 84.35 / 71.36, 87.32 / 72.65, 86.96 / 73.57 and 86.60 / 74.29 at epochs 1 to 4, with 87.32 / 72.65 the DS-MVTec-selected row. The first build stays on record in the thesis (Table 6.16, Appendix M). Both corpora are in the dataset repo: llava_kcr/sft_llava_C_train.json (first build, this model) and llava_kcr/sft_llava_C_corrected_train.json (corrected build).

Reference rows measured on the exact same harness:

ModelDS-MVTecVisA
LLaVA-OneVision-7B-SI base75.6653.80
IAD-R1 released checkpoint81.9271.34
AnomalyThink LLaVA SFT (6K Gemini traces)85.9168.26
AnomalyThink LLaVA SFT then GRPO87.6672.38
This model (KCR, SFT only)88.4574.25

Evaluation protocol. One shared harness for every row above. The DS-MVTec and VisA subsets of MMAD, single image per prompt, the same instruction the model was trained on, greedy decoding at temperature 0, at most 1024 new tokens, images capped at 262,144 pixels. Answers are parsed from the <answer> tag. Generation ran through vLLM 0.10.2, which agreed with the plain transformers generate path on 99 percent of a probe set. Nothing here is a re-scored or best-of-N number.

Strict scoring: a generation with no parsable verdict counts as wrong, as in the thesis. Six of the 2,141 VisA generations of the SFT then GRPO model have no verdict, which gives 72.38; over the 2,135 parsable outputs it is 72.58. No ordering changes.

Contamination note, please read this before you compare DS-MVTec numbers

The public LLaVA-OneVision training mixture (lmms-lab/LLaVA-OneVision-Data, config vision_flan(filtered)) contains 426 rows whose id matches %MVTecAD%. The base model has therefore seen MVTec-AD material during its own instruction tuning. Every DS-MVTec number for any LLaVA-OneVision derived model carries that caveat, including the 88.45 above, and including the IAD-R1 row. We do not know how much of the gap is real capability and how much is recall.

VisA is not affected. The same query over the mixture returns 0 rows for VisA. So the 74.25 on VisA is the clean number and it is the one to trust for a cross-model comparison.

Training

  • Base model: llava-hf/llava-onevision-qwen2-7b-si-hf.
  • Corpus: llava_kcr/sft_llava_C_train.json, 6,000 traces, balanced 50/50 over normal and anomalous parts, on Real-IAD images.
  • Recipe: supervised fine-tuning only. No reinforcement learning stage. The SigLIP vision tower is frozen, the multimodal projector and the language model are trained. Learning rate 1e-5, cosine schedule, warmup ratio 0.03, weight decay 0.1, effective batch size 32, context cutoff 8,192 tokens, bf16, 4 epochs.
  • Epoch: this is epoch 4 of 4 (step 748), the best of the four saved epochs. The full epoch curve on DS-MVTec / VisA was 85.29 / 72.32, 85.60 / 70.10, 86.45 / 73.56, and 88.45 / 74.25.

The KCR corpus here is LLaVA native, not borrowed from Qwen

This matters, so it is stated plainly. KCR stands for keep, correct, rewrite. The corpus for this model was built from LLaVA-OneVision's own rollouts, not from the Qwen rollouts used elsewhere in the thesis. The loop was:

  1. Sample 10,236 rollouts on Real-IAD training images from the sibling SFT then GRPO checkpoint, k = 8 per image at temperature 0.7.
  2. Bucket each trace by whether its verdict matched the label, into keep, needs correction, or needs rewrite.
  3. Score every trace with a Gemini-3-Flash faithfulness judge, and demote traces that were right for the wrong reason.
  4. Have Gemini-3-Flash correct or rewrite the traces that failed, then sample a balanced 6,000.

The intermediate arms are published next to the final one: llava_kcr/ holds sft_llava_A_kept.json (keep only), sft_llava_B_kept_corrected.json (keep plus corrected), sft_llava_C_train.json (the first-build corpus this model was trained on) and sft_llava_C_corrected_train.json (the corrected build the thesis reports, see the build note above).

Because the rollouts come from this backbone, the corpus is on-policy for LLaVA-OneVision, and that is worth the extra loop. We also ran the control, which is the Qwen derived KCR corpus fine-tuned on this same LLaVA backbone with the same recipe. Its four epochs scored 87.70 / 70.97, 85.05 / 73.52, 86.97 / 69.95, and 85.85 / 70.75. No single checkpoint of that control reaches the 88.45 / 74.25 of the native corpus, and no checkpoint is best on both benchmarks at once. Building the corpus from the backbone's own rollouts is the difference.

Tested transformers versions

The weights and configs in this repo were written by transformers 4.51.3. Loading, the processor, and the full evaluation were verified under transformers 4.57.1, both through the plain HF generate path and through vLLM 0.10.2.

One warning for anyone rebuilding this pipeline. Checkpoints saved by transformers 5.0 write the rope settings under text_config.rope_parameters. Transformers 4.x does not read that key and silently falls back to rope_theta = 10000, which is 100 times too small. The model then stays fluent but goes blind and answers "no" to nearly everything, which looks like a collapsed run rather than a loading bug. This repo ships a plain text_config.rope_theta = 1000000.0 next to the 5.0 style block, so it loads correctly on both major versions.

Usage

import torch
from PIL import Image
from transformers import AutoProcessor, LlavaOnevisionForConditionalGeneration

repo = "aacudad/AnomalyThink-LLaVA-OneVision-7B-KCR"
model = LlavaOnevisionForConditionalGeneration.from_pretrained(
    repo, torch_dtype=torch.bfloat16, device_map="auto")
processor = AutoProcessor.from_pretrained(repo)

image = Image.open("part.png").convert("RGB")
product = "tile"          # the product category, it goes into the prompt

question = (
    f"Analyze the provided image of the {product}. "
    "Determine if there are any anomalies present. "
    "If an anomaly is detected, specify its type and location, "
    "and provide a detailed reasoning for your conclusion."
)
messages = [{"role": "user", "content": [
    {"type": "image"},
    {"type": "text", "text": question},
]}]
prompt = processor.apply_chat_template(messages, add_generation_prompt=True)
inputs = processor(images=image, text=prompt, return_tensors="pt").to(
    model.device, torch.bfloat16)

out = model.generate(**inputs, max_new_tokens=1024, do_sample=False)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:],
                       skip_special_tokens=True))

Use this exact instruction. The model was trained on it and it degrades on a different phrasing.

Expected output on a defective part:

<think>
I am inspecting a tile with a speckled, grayish-white surface. ... In the center of the
tile, I detect a triangular, translucent plastic fragment. ...
</think>
<location>center</location>
<type>Contamination</type>
<answer>Yes</answer>

On a normal part the model emits <think> and then <answer>No</answer>, with no <location> or <type> tag.

Intended use and limitations

Research on explainable industrial anomaly detection. This is a thesis artefact, not a production inspection system.

Known limitations:

  • The DS-MVTec contamination caveat above.
  • The model can write a confident and well argued trace for a defect that is not there.
  • The <type> label is coarse and the model over-uses "missing parts" for any loss of material, including chips and gouges.
  • It was trained on Real-IAD style single-object images on plain backgrounds. Cluttered scenes, multiple parts per image, and very different lighting are out of distribution.
  • Reasoning traces were distilled from a teacher model. A fluent trace is not proof that the model looked at the right pixels.

Citation

@mastersthesis{acudad2026reasoning,
  author  = {Acudad, A.},
  title   = {Reasoning-Enhanced Vision-Language Models for Explainable Industrial Anomaly Detection},
  school  = {Delft University of Technology},
  year    = {2026},
  type    = {Master's thesis},
  url     = {https://resolver.tudelft.nl/uuid:65c62420-79c0-447f-b095-7fb11d4474fc}
}

Thesis: https://resolver.tudelft.nl/uuid:65c62420-79c0-447f-b095-7fb11d4474fc. Code and evaluation files: https://github.com/aacudad/IAD-VLMs. The training data is at aacudad/AnomalyThink.

Related models

License

Apache-2.0, inherited from the LLaVA-OneVision-7B-SI base. Trained on Real-IAD images, which are not redistributed here, so cite Real-IAD separately. Reasoning traces were distilled from Gemini 2.5-Flash.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей