Manuscript Offprint

arXiv:2609.05091

Training-Free Logical and Structural Anomaly Detection via Calibrated Fusion

Changyi Li, Miao Yu, Kai Dong, Yu Xiao

Changyi Li 1∗^{1*}, Miao Yu 2^{2}, Kai Dong 1^{1}, and Yu Xiao 1^{1}

1^{1} Aalto University, 02150 Espoo, Finland

{changyi.li, kai.dong, yu.xiao}@aalto.fi

2^{2} Harbin Engineering University, 150001 Harbin, China

miao.yu@hrbeu.edu.cn

Abstract. Industrial anomaly detection must handle two distinct defect families: structural anomalies, which manifest as local texture corruptions, and logical anomalies, which violate global rules on object count, composition, or arrangement. Existing detectors typically favor one family at the expense of the other. In particular, training-free methods effectively exploit frozen representations but lack an explicit notion of object count, while methods that reason about counts usually rely on category-specific component modeling. We show that counting ability can be introduced into training-free anomaly detection without additional training or part-level supervision. Our key idea is a normal-set calibration that aligns heterogeneous anomaly cues using statistics from normal images, enabling their direct fusion within a unified training-free framework. Built upon this calibration, our detector combines complementary frozen cues to address both logical and structural anomalies. On MVTec-LOCO, our method achieves image-level AUROCs of 89.0 and 95.9 on logical and structural anomalies, respectively, yielding a 92.5 average—the best among training-free detectors in our comparison. It remains competitive with methods requiring network training or part annotations, while its structural variant matches PatchCore on MVTec-AD (99.1 image-AUROC), suggesting that the proposed calibration generalizes beyond logical anomaly detection.

Keywords: Anomaly detection · Logical anomalies · Training-free · Foundation models · Open-vocabulary segmentation · Explainability.

1 Introduction

Industrial visual inspection aims to detect anomalies using only normal images for training. The MVTec-LOCO benchmark [2] highlighted an important distinction between two defect families. Structural anomalies are local appearance corruptions such as scratches, contamination, or deformation, whereas logical anomalies preserve local appearance but violate global rules, for example,

∗^{*} Corresponding author.

C. Li et al.

Figure

Fig. 1. Logical and structural anomalies on the same product (left: normal reference). A logical anomaly (middle) preserves local appearance but violates global rules on count or composition, whereas a structural anomaly (right) preserves global composition but disrupts local appearance. Handling both requires complementary global and local reasoning, yet existing detectors often excel at one at the expense of the other.

through an incorrect number of parts, missing or swapped components, or invalid arrangements. A screw bag with too few nuts contains only normal-looking nuts, so no local patch is anomalous, yet the image is defective (Fig. 1). Detecting both families within a single model is challenging because they require opposite inductive biases: structural anomalies rely on local evidence, whereas logical anomalies require reasoning over global count and composition.

Existing approaches expose a tension between counting ability and ease of deployment. Training-free methods reuse frozen representations and avoid category-specific optimization. Representative examples such as SINBAD [4] perform well on logical anomalies by aggregating element sets into permutation-invariant descriptors, but they lack an explicit notion of object count and therefore struggle when anomalies arise solely from changes in the number of otherwise normal parts. In contrast, methods such as PSAD [7] and CSAD [5] explicitly count components using category-specific part segmenters, achieving strong logical performance at the cost of additional training and annotation. This trade-off undermines the training-free property that makes industrial inspection systems attractive in practice.

This motivates a simple question: can a training-free detector acquire explicit counting ability without per-category training? Our key idea is a normal-set calibration that places heterogeneous anomaly cues extracted from frozen models onto a common scale, enabling them to be aggregated within a unified training-free framework. Building on this calibration, we combine complementary appearance and counting cues to address both structural and logical anomalies, while a subsequent p-norm soft-OR preserves strong evidence from individual branches rather than averaging it away.

A diagnostic oracle analysis suggests that signal availability is not the bottleneck: across MVTec-LOCO categories, at least one branch correctly identifies nearly every anomaly. The primary challenge therefore lies in effective aggregation, and the calibrated fusion substantially narrows the gap between naïve com-binations and the oracle upper bound. On MVTec-LOCO, our method achieves the best average image-level AUROC among training-free detectors (92.5) and the strongest structural performance in our comparison, while remaining competitive with methods that require network training or part-level annotations.

Our contributions are threefold. We introduce a unified training-free framework that addresses both logical and structural anomalies without gradient-based optimization, large language models, or category-specific models. The framework relies on a normal-set calibration and a pp-norm soft-OR to render heterogeneous frozen cues directly fusible without suppressing single-branch evidence, and further incorporates open-vocabulary counting to provide competitive logical reasoning together with interpretable evidence attribution.

References (16)

  • Efficientad: Accurate visual anomaly detection at millisecond-level latencies
  • Beyond dents and scratches: Logical constraints in unsupervised anomaly detection and localization
  • Mvtec ad-a comprehensive real-world dataset for unsupervised anomaly detection
  • Set features for anomaly detection
  • Csad: Unsupervised component segmentation for logical anomaly detection
  • Winclip: Zero-/few-shot anomaly classification and segmentation
  • Few shot part segmentation reveals compositional logic for industrial anomaly detection
  • S2tkd: Dual-student knowledge distillation for industrial visual anomaly detection and localization
  • Unislad: A unified framework for structural and logical industrial visual anomaly detection (opens arXiv in a new tab)
  • Component-aware anomaly detection framework for adjustable and logical industrial visual inspection
  • DINOv2: Learning Robust Visual Features without Supervision
  • Sam-lad: Segment anything model meets zero-shot logic anomaly detection
  • Towards total recall in industrial anomaly detection
  • Puad: Frustratingly simple method for robust anomaly detection
  • Slsg: Industrial image anomaly detection with improved feature embeddings and one-class classification
  • Wide residual networks