AnomalyR1: A GRPO-based End-to-end MLLM for Industrial Anomaly Detection

Yuhao Chao, Jie Liu, Jie Tang, Gangshan WuarXiv 2025 · DOI · arXiv

Introduction

Industrial Anomaly Detection (IAD)—the task of identifying defects like cracks or missing parts in manufactured goods—is challenging due to the extreme scarcity of negative samples. Traditional approaches often rely on specialized "Expert Models" that function as black boxes, or general-purpose Multimodal Large Language Models (MLLMs) that lack the precision and domain-specific reasoning required for the factory floor.

AnomalyR1 addresses this "reasoning gap," where models might correctly identify a defect but fail to provide a logical justification. By teaching the model to "think" before it acts, the researchers have developed a system that is both interpretable and highly accurate.

Methodology: Reasoning-Driven Detection

AnomalyR1 is a 3-billion parameter MLLM based on the Qwen2.5VL-3b architecture. Its primary innovation is the application of Group Relative Policy Optimization (GRPO) and a specialized reward metric to industrial tasks.

The AnomalyR1 end-to-end pipeline, integrating industrial prompts and GRPO training to generate multimodal reasoning and segmentation masks.

The training process utilizes three key components:

  • Group Relative Policy Optimization (GRPO): This reinforcement learning technique allows the model to learn from a group of generated responses for a single prompt, scoring them against each other to find the most effective reasoning path without the need for a separate critic model.
  • Reasoned Outcome Alignment Metric (ROAM): ROAM ensures that the model's "Chain of Thought" (CoT) is both visually accurate and logically consistent with the final answer. It penalizes "guessing behavior" where a model arrives at the right conclusion through incorrect logic.
  • End-to-End Pipeline: The model accepts industrial images and domain-specific prompts, generates a reasoning block, and outputs bounding boxes. These are then refined into pixel-level masks using SAM2 (Segment Anything Model 2).

Experimental Setup and Datasets

The model was fine-tuned using a small dataset of 600 images from the MVTec AD and VisA collections, adapted for few-shot reasoning. Performance was primarily measured using the Multimodal Industrial Anomaly Detection (MMAD) benchmark, which evaluates tasks ranging from defect discrimination to impact analysis. Additionally, the model's zero-shot capabilities were tested on the MVTec3D-AD dataset to observe how it handles novel, unseen objects.

Key Results

AnomalyR1 demonstrates that specialized reasoning can outperform raw scale. Despite its relatively small 3B parameter count, it achieved state-of-the-art results across multiple benchmarks.

Performance comparison of AnomalyR1 against few-shot baselines across multiple industrial datasets.
  • Benchmark Superiority: AnomalyR1 reached an average accuracy of 76.96% on the MMAD benchmark, outperforming GPT-4o (74.92%) and the 76B-parameter InternVL2 (70.75%).
  • Reliability through ROAM: By enforcing logical consistency, the model showed a 14% improvement over its base version, significantly reducing instances of correct answers derived from flawed reasoning.
  • Zero-Shot Generalization: The model successfully generalized to unseen categories, showing significant performance gains in detecting defects in items like peaches (+9.32%) and cable glands (+7.86%) without prior exposure during the RL phase.

Conclusion

AnomalyR1 represents a significant step toward interpretable and efficient industrial AI. By prioritizing the quality of the reasoning process over model size, it provides a robust framework for high-stakes manufacturing environments. Future work will explore scaling this methodology to larger models and expanding the diversity of the training data to further improve absolute performance scores.

Summary updated

Abstract

Industrial Anomaly Detection (IAD) poses a formidable challenge due to the scarcity of defective samples, making it imperative to deploy models capable of robust generalization to detect unseen anomalies effectively. Traditional approaches, often constrained by hand-crafted features or domain-specific expert models, struggle to address this limitation, underscoring the need for a paradigm shift. We introduce AnomalyR1, a pioneering framework that leverages VLM-R1, a Multimodal Large Language Model (MLLM) renowned for its exceptional generalization and interpretability, to revolutionize IAD. By integrating MLLM with Group Relative Policy Optimization (GRPO), enhanced by our novel Reasoned Outcome Alignment Metric (ROAM), AnomalyR1 achieves a fully end-to-end solution that autonomously processes inputs of image and domain knowledge, reasons through analysis, and generates precise anomaly localizations and masks. Based on the latest multimodal IAD benchmark, our compact 3-billion-parameter model outperforms existing methods, establishing state-of-the-art results. As MLLM capabilities continue to advance, this study is the first to deliver an end-to-end VLM-based IAD solution that demonstrates the transformative potential of ROAM-enhanced GRPO, positioning our framework as a forward-looking cornerstone for next-generation intelligent anomaly detection systems in industrial applications with limited defective data.
BibTeX
@misc{chao2025anomalyr,
  author = {Yuhao Chao and Jie Liu and Jie Tang and Gangshan Wu},
  title = {{AnomalyR1: A GRPO-based End-to-end MLLM for Industrial Anomaly Detection}},
  year = {2025},
  eprint = {2504.11914},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.11914},
}
Figure