RuleText-AD: Logical Anomaly Detection via Textual Rule Engines Generated by MLLMs - Silva, Leandro Souza da; Schiezaro, Mauricio; Oliveira, Diulhio (Anais da Conference on Graphics, Patterns and Images (SIBGRAPI); 2025: Anais da XXXVIII Conference on Graphics, Patterns and Images, 2025)
Visual anomaly detection is an important tool in industrial quality control that may impact production efficiency and product quality. Traditional supervised methods struggle due to the difficulties and cost to obtain labeled anomaly data, particularly logical anomalies that violate global constraints that yet appear normal samples. This study investigates multimodal large language models (MLLMs) in few-shot prompting configurations to address this issue. We introduce RuleText-AD, a lightweight anomaly detection framework based on textual rule engines automatically generated by MLLMs from minimal visual examples and concise textual schemas. RuleText-AD eliminates the need for external segmentation tools, extensive prompt engineering, or heavy visual processing backbones, enabling efficient anomaly detection via high-level attribute reasoning. Experiments are conducted on the MVTec-LOCO logical anomaly benchmark, demonstrating that Gemini 2.5 Flash provides the best balance between accuracy and computational cost, achieving competitive performance with significantly reduced deployment complexity. This work highlights the potential for scalable, interpretable, and cost-effective anomaly detection solutions suitable for diverse industrial environments. Our method targets logical (global, ruleviolation) anomalies and does not address structural, pixel-level defects.