AnomalyThink-Qwen2.5-VL-7B-KCR
The single best detector in the thesis (DS-MVTec 82.80 / VisA 72.07). Supervised fine-tuning only, no reinforcement-learning stage on top.
A Qwen2.5-VL-7B model fine-tuned for explainable industrial anomaly detection (IAD). Given a product image it produces a structured reasoning trace (<think>), a defect <location> and <type> (for anomalies), and a binary <answer>. Research artefact from the MSc thesis Reasoning-Enhanced Vision-Language Models for Explainable Industrial Anomaly Detection (TU Delft, 2026).
What Keep-Correct-Revise (KCR) means
Keep-Correct-Revise (KCR) is the data recipe this model is named after. It works in four steps:
- An SFT plus GRPO policy generates its own reasoning traces on Real-IAD images.
- A trace is kept when the policy got the verdict right and the reasoning holds up.
- A trace is corrected by a teacher model when the verdict is wrong.
- A trace is revised by a teacher model when the verdict is right but the reasoning is only weakly grounded in the image.
The curated traces are then used to fine-tune the base model again from scratch. So the policy supplies the raw material, the teacher only repairs what is broken or poorly grounded, and the final model is a fresh fine-tune of Qwen2.5-VL-7B on the result.
Results (MMAD subsets, balanced accuracy)
| Benchmark | Balanced accuracy |
|---|
| DS-MVTec (1,670) | 82.80% |
| VisA (2,141) | 72.07% |
Evaluated under a single common harness on the MMAD DS-MVTec and VisA subsets. It exceeds the released IAD-R1 checkpoint on both benchmarks under this harness, using supervised fine-tuning alone.
Training
Supervised fine-tuning from the Qwen2.5-VL-7B base on the curated KCR corpus. 6,000 balanced traces, 50/50 defect and non-defect, vision encoder frozen. No reinforcement-learning stage is used.
The traces that the teacher writes or repairs come from
Gemini 2.5-Flash, on
Real-IAD images. Training data:
aacudad/AnomalyThink (folder
iter2).
The AnomalyThink Qwen family
| Model | DS-MVTec | VisA | Note |
|---|
…-7B-KCR | 82.80 | 72.07 | this model, thesis headline |
…-7B-SFT | 80.16 | 64.78 | plain SFT baseline |
…-7B-SFT-GRPO | 82.73 | 70.39 | SFT then GRPO, the policy KCR rolls out from |
…-7B-KCR-GRPO | 82.95 | 72.62 | research preview, not a thesis result |
Usage
1import torch
2from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
3model_id = "aacudad/AnomalyThink-Qwen2.5-VL-7B-KCR"
4model = Qwen2_5_VLForConditionalGeneration.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
5processor = AutoProcessor.from_pretrained(model_id)
6# Build the structured single-image IAD prompt + image, then generate.
Intended use and limitations
Research on explainable IAD. Known limitations: the model can confidently hallucinate a defect on a normal part (false positive), and GRPO-lineage variants can over-predict the "Missing Parts" type. As the public DS-MVTec/VisA images may appear in VLM pretraining, absolute numbers should be read with that caveat.
Citation
1@mastersthesis{acudad2026anomalythink,
2 title = {Reasoning-Enhanced Vision-Language Models for Explainable Industrial Anomaly Detection},
3 author = {Acudad, Adnane},
4 school = {Delft University of Technology},
5 year = {2026}
6}
License
Apache-2.0 (inherits the Qwen2.5-VL-7B base). Trained on Real-IAD (cite Real-IAD separately, images are not redistributed) with traces distilled from Gemini 2.5-Flash.