aacudad/AnomalyThink-Qwen2.5-VL-7B-KCR
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)
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
Usage
import torch
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
model_id = "aacudad/AnomalyThink-Qwen2.5-VL-7B-KCR"
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
processor = AutoProcessor.from_pretrained(model_id)
# 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
@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>.
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.
