TL;DR
This paper introduces a framework that enables Multimodal Large Language Models (MLLMs) to perform both anomaly detection and pixel-level defect localization using only image-level labels (normal vs. abnormal). By extracting and aligning anomaly-specific reasoning tokens with visual attention via reinforcement learning, the method eliminates the need for expensive pixel-wise masks or external vision modules.
What Problem Does This Paper Address?
In industrial manufacturing, identifying and locating defects (Industrial Anomaly Detection or IAD) is critical for quality control. While Multimodal Large Language Models (MLLMs) excel at high-level reasoning and stating if an anomaly exists, they traditionally struggle to pinpoint where it is at a pixel level.
To get pixel-level localization, existing approaches either rely on costly, dense pixel-level annotations or patch together complex pipelines using external vision experts like the Segment Anything Model (SAM). These multi-stage designs suffer from error propagation, misalignment between textual reasoning and visual focus, and high deployment complexity.
The authors address this gap by asking: Can we unlock an MLLM's intrinsic attention mechanism to localize defects directly, using only cheap, image-level supervision?
Methods
The authors propose a training framework built on top of an open-source MLLM (Qwen2.5-VL) consisting of two core components:
- Reasoning-Driven Anomaly Localization (ReAL): During the model's autoregressive text generation, it produces a chain-of-thought explanation. ReAL filters out the most relevant tokens from this process based on two metrics:
- Inter-modality semantic relevance ($S_T$): How strongly a token attends to anomaly-related words in the prompt (e.g., "defect", "scratch").
- Intra-modality attention concentration ($S_I$): The spatial entropy of the token's visual attention map. Lower entropy means the token is focusing tightly on a specific image region rather than diffusing across the whole scene.
The visual attention maps of these highly localized, semantically relevant tokens are then aggregated into a final pixel-level anomaly map.
- Consistency-Guided Reasoning Optimization (CGRO): Under weak supervision, MLLMs often suffer from hallucinations or contradictions (e.g., correctly answering "Yes, there is a defect" while its internal attention maps are scattered randomly). CGRO uses reinforcement learning (specifically a group-based policy optimization variant) to enforce a class-conditional consistency reward. For anomalous images, it rewards high spatial consensus (measured via the Jaccard Index) among key reasoning tokens. For normal images, it rewards low consensus, forcing the model to ground its textual arguments in visual evidence.
Datasets
- Training: A curated dataset of 4,000 industrial images with weak image-level labels (normal/anomaly) aggregated from public benchmarks: VisA, GoodsAD, Vision, PR-REAL, Real-IAD, and BSData.
- Evaluation: Zero-shot evaluation across four distinct benchmarks to test generalization: MVTec-AD, WFDD, SDD, and DTD.
- New Benchmark: The authors introduce MVTec-COT, a dataset pairing MVTec-AD test images with expert-verified ground-truth anomaly descriptions to quantitatively evaluate the quality and accuracy of the model's textual reasoning using SBERT and ROUGE-L scores.
Key Insights and Ideas
- The Hidden Map in the Text: Only a tiny fraction of reasoning tokens (like "scratch" or "mark") hold precise spatial cues. As shown in the paper's analysis, averaging all tokens dilutes localization accuracy, but filtering by semantic relevance and spatial concentration unlocks sharp localization maps without any explicit pixel training.
- Self-Correction via RL Consistency: Instead of feeding the model dense masks, you can teach it where to look by rewarding internal consistency. If the model's text output claims a defect is present, its internal attention maps for those descriptive tokens must tightly overlap on the image.
Key Results
- Competitive with Dense Supervision: Despite using zero pixel-level masks during training, the full 7B model variant achieved a pixel-level Area Under the ROC Curve (AUROC) of 80.7% and an Accuracy (ACC) of 97.1%, performing on par with MLLM methods that require dense pixel supervision.
- Superior Interpretability: The model achieved the highest reasoning scores on the new MVTec-COT benchmark compared to all baselines (including commercial models like GPT-4o), proving its explanations are highly aligned with actual visual defects.
- Ablation Validation: Combining both spatial entropy ($S_I$) and semantic relevance ($S_T$) filters yielded significantly cleaner and more accurate anomaly maps than using either filter alone.
Limitations and Future Work
- Boundary Fidelity: A performance gap still remains compared to fully supervised pixel-level methods, particularly regarding sharp defect boundaries and highly complex textures.
- Multi-Spot Scenarios: The model occasionally suffers from missed detections when an image contains multiple separate defect spots.
- Inference Latency: Because the localization relies on the autoregressive decoding of an MLLM backbone, inference is inherently slower than conventional, specialized industrial vision pipelines, posing a challenge for real-time deployment on fast production lines.
Summary updated