In industrial visual inspection, the goal is to identify products that deviate from the "normal" standard. For years, this field focused on structural anomalies: local defects like scratches, dents, or cracks. If a pixel looks different from its neighbors or its expected value, it is flagged.
However, a new class of challenges has emerged: logical anomalies. In these cases, every individual component of a product might be physically perfect, but the product is still defective because the components are missing, misplaced, or present in the wrong quantity. A breakfast cereal box with the wrong number of toy prizes or a circuit board missing a single, undamaged resistor are logical anomalies.
The Failure of Texture-Based Reconstruction
Traditional anomaly detection often relies on reconstruction. A model like DRÆM, developed by Vitjan Zavrtanik and Matej Kristan, learns to "fix" anomalies by reconstructing a normal version of the input. If the reconstruction error is high, an anomaly is detected.
This works for a scratch because the model "paints over" the scratch with a healthy texture. But as noted in Ano-SuPs, these methods struggle when a component is simply missing. If a screw is absent, the model sees the perfectly normal metal surface underneath. Since that surface is part of the "normal" training distribution, the reconstruction error is zero. The model is blind to the logical requirement that a screw should be there.
From Pixels to Components
To solve this, researchers are moving away from treating images as uniform grids of pixels and toward object-centric modeling. The intuition is that if you can identify the individual parts of an assembly, you can verify the "logic" of their arrangement.
The ComAD framework by Tongkun Liu and colleagues exemplifies this "divide and conquer" approach. By segmenting an image into discrete components, the system can perform metrological checks—counting instances, measuring areas, and checking colors. Similarly, SAM-LAD, introduced by Yun Peng, leverages the Segment Anything Model to treat scenes as collections of objects. This allows the system to detect an extra washer or a missing bolt by comparing the detected object set against a known-good template.
Modeling Compositional Logic
Detecting a missing part is one thing; detecting a misplaced part is another. This requires understanding the spatial relationships between components.
Soopil Kim and Ehsan Adeli proposed PSAD, which uses few-shot part segmentation to reveal "compositional logic." By learning the expected coordinates and counts of specific parts, the model can identify when a component is visually intact but logically misplaced.
Other researchers, such as Y.F. Cai in the UniVAD framework, model these relationships as graphs. In a graph-based view, the "logic" of a product is defined by the edges between nodes (components). An anomaly is not just a weird-looking node, but a missing edge or an impossible connection in the structural graph.
Bridging Vision and Symbolic Rules
The most recent shift in the field involves using Large Language Models (LLMs) and Vision-Language Models (VLMs) to bridge the gap between raw pixels and human-defined rules.
LogiCode takes this a step further by using LLMs to generate Python code that verifies expert-defined rules. Instead of a black-box neural network guessing if a box is "wrong," the system generates a script to count the items and check their positions. This provides an interpretable "why" behind every detection.
Similarly, TMUAD by Jiawei Liu uses a text memory bank to translate visual scenes into structured descriptions. By comparing these descriptions (e.g., "three blue screws") against a reference, the system can ignore textural noise and focus entirely on the high-level assembly logic.
Synthesizing Logical Failures
A major bottleneck in this research is the lack of training data; logical anomalies are rare in the wild. To address this, LogicAL by Ying Zhao focuses on logical anomaly synthesis. By manipulating the edges of objects and using GAN-based generators, researchers can create photo-realistic images of missing or swapped parts. This allows models to "see" logical failures during training, preparing them for the complex, rule-based errors they will encounter on the factory floor.