arXiv:2611.08140cs.CVNov 2026

Manuscript Offprint

arXiv:2611.08140

Fault-Guided Cross-Layer Prediction for Unsupervised Anomaly Detection

Tao Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Feature reconstruction is widely used for unsupervised industrial anomaly detection in the single-class setting, where only normal images from one product category are available for training. We propose a single-class detector that asks what information one block can pass to another. We

treat the depth of a frozen vision transformer as a sequence of discrete transitions. A directed predictor learns a block-to-block hidden-state transition pointwise over tokens. Adjacent-layer cosine similarity exposes four sharp fault lines in DINOv2 ViT-L, separating stable depth segments. The deepest blocks retain semantic context but lose local detail; a prediction from deep or shallow sources to

Figure

(a) Fault geometry and residual separation

(b) Cross-layer localization across four categories

Figure 1. Measured evidence for fault-guided cross-layer prediction. (a) Adjacent-depth cosine similarity averaged over five categories. Four faults separate stable depth segments. L14 is marked as the midpoint of the stable segment and the participation-ratio peak. The two angular-residual manifolds show normal patches concentrating near the origin while defect patches spread outward for backward 21→14 and forward 1→7. (b) One anomaly from each of four MVTec-AD categories. The first two rows use 21→14 and the last two use 1→7, illustrating complementary backward and forward evidence; the adjacent column compares these with 14→13 and 7→8 under the same training run.

sensitive targets therefore exposes the information that cannot be transported. The fault structure fixes the source and target roles, and the same rule transfers to ViT-B and RADIO-B.

We use a bounded foreground prior calibrated solely on training images: it attenuates background evidence without also erasing defects outside the estimated foreground. Using one predictor architecture and a common training-only calibration protocol, image AUROC is 99.75 on MVTec-AD, 99.42 on VisA and 94.27 on Real-IAD. On Real-IAD the object-level AUROC is 96.26. At 256×256256 \times 256 pixel resolution, P-AUROC/P-AUPRO are 98.46/95.97 on MVTec-AD, 99.21/96.12 on VisA and 99.26/96.59 on Real-IAD.

1. Introduction

Industrial inspection must detect defects that cannot be enumerated in advance. We consider the single-class setting, where training uses only normal images from one product category. MVTec-AD [3], VisA [42] and Real-IAD [36] follow this protocol. The leading methods reconstruct features from a frozen encoder [11, 16, 17]. A bottleneck compresses the features, a decoder reconstructs selected teacher features, and anomalies appear as large residuals. Fig. 1 motivates a different design: the deepest features remain insensitive to local defects, while an asymmetric cross-layer predictor tests whether deep and shallow sources can transport the missing evidence to sensitive blocks; the transfer failure becomes the anomaly signal.

Reconstruction methods share two assumptions. First, the decoder can see the features it must reproduce, which permits a copying shortcut. Second, the target representations are selected by architectural convention. RD4AD [11] reconstructs multi-scale encoder representations through a one-class bottleneck, whereas the Dinomaly line [16, 17] reconstructs a fixed group of ViT blocks. Neither choice is tied to a measured property of the representation, and sensitive and insensitive layers are treated alike.

We test the backbone directly. Adjacent-layer cosine similarity is not smooth in depth. In DINOv2 ViT-L it drops sharply at 0|1, 7|8, 21|22 and 22|23, partitioning the 24 blocks into [1..7], [8..21], [22] and [23], with block 0 isolated before the first fault. Effective feature rank and the response to a local perturbation change at the same boundaries. The deepest blocks therefore carry semantic context but little local defect detail. These signatures are consistent with rank-collapse analyses of deep attention and transformer stacks [12, 28]. The layer-wise phase transitions in ViTs are consistent with terminal neural-collapse geometry [23], building on the general neural-collapse phenomenon [30].

We treat depth as a sequence of transitions [1, 20, 35]. A directed channel (s,t)(s,t) learns gs→tg_{s\to t} from block s to block t, while the backbone remains frozen. The residual 1−cos⁡(gs→t(fs),ft)1 - \cos(g_{s\to t}(f_s), f_t) is the part of the target state that the source cannot transport. The source and target therefore become explicit design choices. A deep block is useful as a source because it lacks local detail; a sensitive block is useful as a target because that missing detail becomes visible there.

The fault structure determines the roles. Block 1 is the shallow source, block 7 is the near target before the 7|8 fault, block 14 is the midpoint of [8..21], and blocks 21–23 are deep sources. Fig. 3 checks this assignment against ground-truth and synthetic anomalies. The curves remain sensitive at L7 and L14 and decay in the final segment. L7 remains the near target, while L14 supplies the mid-depth target. Each channel is scored independently, then the eight scores are averaged. A soft foreground prior can attenuate background residuals but never sets them to zero.

Directed transfer between selected patch embeddings was used by Costanzino et al. [8], with layer pairs chosen by ablation. We keep the directed transfer and derive the pairs and their direction from the backbone's fault structure. The same rule selects layers for ViT-L, ViT-B and RADIO-B.

Our contributions are:

  • a label-free layer-selection rule that detects adjacent-layer cosine faults, corroborated by effective-rank and local-sensitivity diagnostics;

  • a directed cross-layer predictor that turns asymmetric source-to-sensitive transfer failure into an anomaly score, with deep-to-sensitive channels as the principal signal and shallow-to-sensitive channels as complementary evidence;

  • a shared scoring and foreground-prior procedure that transfers across three backbones and three industrial benchmarks without per-category channel selection.

With the same predictor architecture and training-only calibration, image AUROC is 99.75 on MVTec-AD, 99.42 on VisA and 94.27 on Real-IAD. Real-IAD object-level AUROC is 96.26; at 256×256256 \times 256 pixel resolution, P-AUROC/P-AUPRO is 99.26/96.59.

References (42)