Some defects are not damage. A part can be missing, duplicated, or attached in the wrong place while every visible piece still looks perfect. Detecting these errors is called logical anomaly detection. Recent methods try to do it zero-shot, meaning with no training on the target product. They cut the image into components with a general-purpose segmenter and then compare the components' counts and arrangement against normal examples. When these systems fail, we cannot tell why. The segmenter may have cut the scene wrongly, or the comparison step may have misjudged the relations between parts. Industrial benchmarks do not provide exact component masks or a complete list of rules, so the two causes cannot be separated.
We propose to build a test set in which they can be separated. Metal–organic coordination compounds are metal ions held together by flexible organic linkers. Their structure is known exactly from X-ray crystallography, and they obey crisp compositional rules: how many donor atoms surround each metal, how many linkers bridge two metals, and which binding modes appear in which ratio. If we render these structures as images and inject rule violations at the level of the structure graph, we get logical anomalies with exact component masks and exact labels. They also contain the regime that published zero-shot methods name as their weakness: many identical, textureless components. The core experiment swaps each detector's own segmentation for perfect masks and measures how much of the logical-detection gap closes. That turns a vague failure into a number that says where the field should invest.
Core Claim
Our hypothesis is that most of the remaining error of decomposition-based zero-shot logical detectors comes from segmentation, not from relational reasoning. We expect this especially when components repeat without texture, as with pushpins in industry or atoms of one element in a crystal. We make two further claims. First, a second failure mode is untested: some normal objects contain the same component in several legitimate states. Methods that match each component to a single normal prototype should raise false alarms on these objects. Second, coordination structures let us measure both effects exactly because the ground truth is the structure graph itself.
The chemistry does two jobs in this proposal. It supplies rules that are well defined, and it supplies a realistic case of "normal but multimodal" components. In the erbium framework of Wei et al., the same flexible diacetate linker appears in two crystallographically independent binding modes in one normal structure. One copy chelates, meaning it grips a metal with two atoms, at both ends. The other chelates and bridges at one end and only bridges at the other. A detector must learn that both modes are normal while a changed ratio between them is an anomaly. No industrial benchmark in the file isolates this case.
Research Program
Source structures. We start from the solved structures in the file and choose them to cover different logical rules:
- The nine-coordinate Er(III) layered framework with lattice waters acting as hydrogen-bond "glue" (Wei et al.). Its rules are coordination number and binding-mode ratio.
- The dinuclear Mn(II) complex held together by a double end-on azide bridge (Wang et al.). Its rule is "exactly two bridges."
- The carboxylate-bridged tetratin cluster (tetratin structure). Its rule is instance count within a cluster.
- A mixed-ligand zinc complex (Zn bipyridine structure). Its rule is ligand identity per site.
- A dicarboxylate-locked zinc dimer (dizinc ciprofloxacin structure). Its rule is auxiliary bridge presence.
Rendering. Each structure is rendered from many viewpoints, following the multi-view rendering protocol that xCrysAlloys used for nanoclusters. We use two styles. Ball-and-stick keeps component boundaries clear. Space-filling merges neighbouring atoms of the same element and so stresses the segmenter. Every render carries exact instance masks for every atom, ligand, and bridge.
Anomalies. Anomalies are made by editing the structure graph and keeping local geometry intact, so every remaining piece looks normal, in the spirit of MVTec LOCO. The edits are:
- deleting one azide bridge;
- converting a chelating linker to a monodentate one, bound through a single atom;
- adding a surplus linker;
- flipping the binding-mode ratio in the erbium framework;
- removing lattice waters;
- dropping a metal's coordination number.
As a structural control we also recolour a metal to change its element. That anomaly is local and should be easy for every method.
The anomaly categories were not picked arbitrarily. The source papers name the properties they left unmeasured, and these edits change exactly what those properties depend on. The azide bridge is the magnetic exchange pathway the Mn paper cites as motivation but never measured. The lattice waters are what Wei et al. flag as governing porosity after dehydration. This keeps the benchmark tied to the direction of unexplored application potential. The anomalies are the structural changes a later functional screen would most need to notice. We do not claim to predict those properties here.
Protocols. There are two:
- A strict single-image protocol, with no normal references, for self-referencing methods.
- A reference protocol, in which a handful of normal renders is given, for matching methods.
We also run a fixed-view condition so that pose mismatch is not confused with logical failure.
Baselines
The naive reference point has two parts. One is chance. The other is a count-only oracle: it takes the perfect masks, counts instances per element or ligand class, and flags any image whose histogram differs from the normal references. If this crude rule already solves the benchmark once perception is perfect, that is itself the finding. It would mean relational reasoning is not the bottleneck, and the benchmark would say so. It gets the same references and the same masks as the oracle-mask condition of every learned method.
The strongest existing zero-shot competitor is SAM-LAD. It segments scenes with the Segment Anything Model, describes parts with DINOv2 features, models relations between parts with graph attention, and matches query parts to reference parts with optimal transport. It reports image-level AUROC (area under the ROC curve; 1.0 is perfect separation of normal and anomalous images) of 90.7 on MVTec LOCO against 83.1 for the prior best, and 92.3 on DigitAnatomy. Its authors name identical textureless repeats as a limitation. That makes it both the strongest method and the most direct test of our hypothesis.
ObjectCore finds parts with GroundingDINO and the Segment Anything Model and matches them with the Hungarian algorithm. It reports 4-shot AUROC of 80.8% on MVTec LOCO. It represents the few-shot, detector-based alternative and runs only in the reference protocol with four normal renders.
LogiCode has a language model compile rules into code that calls vision functions. It reports 98.9% average accuracy on MVTec LOCO, but only about 60% first-pass code success. Our rules are stated in text exactly, which gives it its best case, and we allow the same retry budget it reports.
The file gives two reference points for methods that assume no relational structure. INP-Former builds normal prototypes from the query image itself; its authors state it misses logical anomalies. For patch memory matching, AnomalyDINO is our stand-in. PatchCore itself reports 0.623 sPRO on MVTec LOCO in DSKD; sPRO is a localization score that rewards covering the defective region. DSKD itself reaches 0.812 AUROC on logical anomalies alone. It needs training on normal images, so it is reported separately as a non-zero-shot upper reference.
On the new benchmark there is no reported result found on Lacuna for any of these methods. All methods get the same renders, backbone sizes where configurable, and a fixed hyperparameter budget tuned only on a held-out source structure.
The ablation that isolates the key ingredient replaces each decomposition method's own masks with perfect masks, keeping everything else fixed. A second ablation replaces SAM-LAD's single-prototype matching with a per-class mixture of normal component states. This tests the multimodal-normality claim on the erbium framework.
"Beating" has two meanings here.
- Diagnosis. The diagnostic succeeds if the perfect-mask swap raises SAM-LAD's logical AUROC by at least half the distance between its perception-based score and 1.0 on textureless renders. It must also raise it much less on ball-and-stick renders with clear boundaries.
- Mixture variant. This variant beats SAM-LAD if it cuts false alarms on normal erbium renders without losing AUROC on mode-ratio anomalies.
Why not just…?
Why not just check the structure graph with chemical rules instead of rendering images? For chemistry itself this is the right tool, and we say so. A coordination-number and bridge-count checker run on the structure file is included as the ceiling. It should score near-perfectly, since the anomalies are defined on the graph. The proposal is not a chemistry validator. It uses crystals because their graphs give exact ground truth for a vision problem. The real threat is that the benchmark proves too easy or too alien to inform industrial inspection. The transfer check below exists to settle that.
Why not just add perfect masks to MVTec LOCO or DigitAnatomy? MVTec LOCO does not provide exhaustive per-instance masks or a closed rule list, so a "perfect decomposition" condition cannot be defined there. DigitAnatomy components are textured digits, not identical repeats. Neither lets us vary boundary contrast, viewpoint, or multimodal component states independently. We do run the counterpart analysis on the MVTec LOCO pushpins category, where identical repeats occur naturally, as a sanity check.
Why not just ask a vision-language model whether the structure is chemically valid? Stress-Testing Multimodal Foundation Models for Crystallographic Reasoning reports that such models hallucinate invalid space groups. They also violate density constraints, and their errors blow up under compositional hold-out. We include a prompted model as a baseline anyway. If it scored well, that would contradict that study on a different kind of structure and would be worth reporting.
Why not just use patch matching or self-referencing reconstruction? DSKD and the INP-Former authors already document that these methods cannot see pristine-but-misplaced parts. We keep them only to confirm that the benchmark's logical anomalies really are invisible locally. If they succeed, our anomaly edits leak local cues and must be fixed.
Proposed Experiments
The decisive experiment is the perfect-mask swap across both rendering styles and all anomaly types. We report four measures:
- image AUROC per anomaly type;
- sPRO for localization;
- the perception gap, defined as AUROC with perfect masks minus AUROC with each method's own masks;
- segmenter instance recall against the perfect masks, which should predict the perception gap if our hypothesis holds.
The erbium binding-mode experiment measures false-alarm rates on normal renders for single-prototype versus mixture matching.
The transfer check asks whether the benchmark says anything about industrial inspection. We compute the same perception gap on MVTec LOCO pushpins, using manually annotated instance masks for a few hundred images. We then test whether the ordering of methods and the size of the gap agree with the crystal renders. Agreement supports using coordination crystals as a controlled stand-in for inspection. Disagreement would show that the chemistry domain answers a different question, and we would report it as such.
References
- Poly[[tetraaquabis[μ4-2,2′-(p-phenylenedioxy)diacetato][μ2-2,2′-(p-phenylenedioxy)diacetato]dierbium(III)] hexahydrate]
- Crystal structure of di- μ -azido -k 1 N bis[2-(1,10-phenanthrolin-2-yl)benzo[ d ]imidazol-1-ido-k 3 N,N ′, N ′′]-bis(methanol-k 1 O )-di-manganese
- The crystal structure of tetrakis(μ 2-2-amino-3,5-dibromobenzoate-κ 2 O:O′)-octakis(n-butyl-κ 1 C)-bis(μ 3-oxo)tetratin(II), C60H92Br8N4O10Sn4
- The crystal structure of bis(6-phenylpyridine-2-carboxylate-κ2 N,O)-(2,2′-bipyridine-κ2 N,N′)zinc(II) monohydrate, C34H26N4O5Zn
- Crystal structure of bis(biphenyl-2,2′-dicarboxylato-κ2 O:O′)-bis(1-cyclopropyl-6-fluoro-4-oxo-7-(1-piperazinyl)-1,4-dihydroquinoline-3-carboxylato-κ2 O,O′)dizinc(II)2.5 hydrate, C62H57N6Zn2O16.5F2
- Stress-Testing Multimodal Foundation Models for Crystallographic Reasoning
- SAM-LAD: Segment Anything Model meets zero-shot logic anomaly detection
- ObjectCore - Efficient Few-shot Logical Anomaly Detection using Object Representations
- LogiCode: An LLM-Driven Framework for Logical Anomaly Detection
- Exploring Intrinsic Normal Prototypes within a Single Image for Universal Anomaly Detection
- AnomalyDINO: Boosting Patch-based Few-Shot Anomaly Detection with DINOv2
- Contextual Affinity Distillation for Image Anomaly Detection