Interpretable Logical Anomaly Classification via Constraint Decomposition and Instruction Fine-Tuning
Xufei Zhang, Xinjiao Zhou, Ziling Deng, Dongdong Geng, Jianxiong Wang
TL;DR
The work tackles industrial logical anomalies by elevating detection to Logical Anomaly Classification (LAC), which identifies both the presence and the specific violation category. It introduces LogiCls, a compact vision-language framework that decomposes high-level logical constraints into atomic, verifiable subqueries and trains with fine-grained Chain-of-Thought data and targeted augmentations. A difficulty-aware resampling strategy prioritizes hard subqueries to improve performance on long-tail constraint types. On MVTec LOCO FC, LogiCls with small-scale VLMs achieves strong accuracy and provides interpretable reasoning trails, demonstrating improved robustness and practicality for quality assurance in constrained industrial settings. The approach highlights the value of constraint decomposition and data-centric instruction tuning for interpretable visual reasoning under data scarcity.
Abstract
Logical anomalies are violations of predefined constraints on object quantity, spatial layout, and compositional relationships in industrial images. While prior work largely treats anomaly detection as a binary decision, such formulations cannot indicate which logical rule is broken and therefore offer limited value for quality assurance. We introduce Logical Anomaly Classification (LAC), a task that unifies anomaly detection and fine-grained violation classification in a single inference step. To tackle LAC, we propose LogiCls, a vision-language framework that decomposes complex logical constraints into a sequence of verifiable subqueries. We further present a data-centric instruction synthesis pipeline that generates chain-of-thought (CoT) supervision for these subqueries, coupling precise grounding annotations with diverse image-text augmentations to adapt vision language models (VLMs) to logic-sensitive reasoning. Training is stabilized by a difficulty-aware resampling strategy that emphasizes challenging subqueries and long tail constraint types. Extensive experiments demonstrate that LogiCls delivers robust, interpretable, and accurate industrial logical anomaly classification, providing both the predicted violation categories and their evidence trails.
