arXiv:2608.27610cs.CVAug 2026

Manuscript Offprint

arXiv:2608.27610

ShiftSplit-AD: Separating Domain Shift from Defects in Foundation-Feature Visual Anomaly Detection

Muhamathu Ameer Ali Aacaas Muhamath

Abstract

Visual anomaly detectors based on frozen foundation-model features commonly score distances from test patches to a memory of normal features. Benign acquisition changes can also enlarge these distances, confounding domain variation with defects. We investigate whether structured decomposition of nearest-normal DINOv2 residuals can suppress shift-induced evidence while retaining unseen defects. ShiftSplit-AD decomposes the patch residual matrix into low-rank and row-sparse components and scores the sparse component, with an optional low-rank/sparse fusion. The experiments expose a central trade-off rather than a universal separation: genuine defects can contain correlated, low-dimensional structure, so filtering broad residual activity may also remove defect information. On AeBAD-S, using settings fixed after Bottle development, sparse-only scoring improves image AUROC from 0.6780 to 0.7294 and AUPRC from 0.8052 to 0.8465. Paired bootstrap 95% intervals for the improvements are [0.0238, 0.0808] and [0.0170, 0.0650], respectively. However, sparse-only scoring reduces mean clean AUROC from 0.9890 to 0.9133 on four held-out MVTec categories and degrades Bottle localization. These findings show that residual decomposition can help when domain shift strongly contaminates anomaly evidence, but preserving defect structure remains the limiting problem.

1 Introduction

Industrial visual anomaly detection is commonly posed as a one-class problem: normal images are available for training, whereas the appearance of future defects is unknown. Feature-memory methods address this setting by extracting pretrained patch representations and measuring the distance from each test patch to a bank of normal features. Such systems are simple and effective on established benchmarks such as MVTec AD [1], and memory-based designs including SPADE [5] and PatchCore [12] demonstrate the strength of local pretrained features.

Distance from normality, however, does not identify the cause of that distance. Illumination, viewpoint, background, blur, and sensor noise can move a normal image away from the training distribution. A nearest-normal detector may therefore produce a large residual for a harmless acquisition change. This ambiguity matters in deployment because the operating domain need not reproduce the conditions under which the normal memory was collected. AeBAD was introduced specifically to expose this issue for aero-engine blade inspection, with changes in illumination, view, alignment, and scale between training and testing [13].

We study this problem directly in frozen foundation-feature space. DINOv2 provides general visual features without task-specific fine-tuning [11]. For each test patch, we subtract its nearest normal-memory feature and stack the residuals into a matrix. The central question is whether the structure of that matrix can help distinguish broad domain variation from localized defect evidence.

We study ShiftSplit-AD, a lightweight post-processing step that approximates the residual matrix by low-rank and row-sparse components. Low-rank/sparse decomposition itself is classical [2], and anomaly detection under distribution shift is an established research problem [3, 4, 13]. The specific contribution examined here is the use of per-test-image nearest-normal foundation-feature residual structure to study shift suppression versus defect preservation. Sparsity acts on spatial rows rather than individual entries. The initial intuition is that correlated, spatially broad residual activity may be absorbed into the low-rank term, while concentrated activity remains in the row-sparse term.

The experiments do not support the simplistic identity “domain shift equals low rank, defects equal sparse.” Real defects also contain correlated structure, and removing it can lower detection and localization quality. Instead, the results reveal a trade-off between suppressing shift-induced residual activity and preserving defect information. Sparse-only scoring strongly improves Bottle under synthetic Gaussian noise and improves AeBAD-S overall, but it loses accuracy on held-out MVTec categories whose raw residual detector is already strong. A fusion of low-rank and sparse scores recovers much of this loss without becoming universally superior.

Our contributions are threefold. First, we instantiate and empirically study per-test-image low-rank/row-sparse decomposition of frozen DINO nearest-normal patch residuals, rather than claiming novelty for decomposition or shift-aware anomaly detection in general.

Second, we evaluate the method using a transparent development/held-out protocol: Bottle informs the fixed decomposition, top-5 aggregation, and fusion weight; four other MVTec categories and AeBAD-S are subsequently evaluated without retuning these settings. Third, we report positive and negative evidence together, including paired bootstrap uncertainty on AeBAD-S, a defect-type failure on breakdown, and substantial localization degradation. The resulting claim is deliberately conditional: structured residual filtering can help when domain variation contaminates raw anomaly evidence, but its usefulness depends on whether removed structure is nuisance or defect signal.

ShiftSplit-AD differs from these approaches in intervention point and supervision. ADShift performs distribution alignment, whereas ShiftSplit-AD leaves the frozen representation and normal memory unchanged and decomposes each test image's nearest-normal residual matrix. Invariant Anomaly Detection learns partially invariant representations through regularization, whereas ShiftSplit-AD is post-hoc and training-free after memory construction. We use AeBAD-S as the principal real-shift evaluation rather than treating synthetic corruptions as a substitute. Controlled brightness, contrast, blur, and noise remain diagnostics of false-positive evidence, not models of the full acquisition domain.