Manuscript Offprint
arXiv:2611.08140Fault-Guided Cross-Layer Prediction for Unsupervised Anomaly Detection
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

(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 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 learns from block s to block t, while the backbone remains frozen. The residual 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 pixel resolution, P-AUROC/P-AUPRO is 99.26/96.59.
Directed prediction. Costanzino et al. [8] train forward and backward MLPs between a benchmark-selected layer pair and multiply their residuals as a bidirectional fail-safe, assuming that the selected inter-layer transition is invertible. Our measurements instead expose a segmented regime. The 0|1 fault isolates the initial block and identifies block 1 as the first stable shallow source, while participation collapses across the final segment after 21|22, with further compression at 22|23. The deepest blocks therefore no longer carry the fine local evidence needed to predict sensitive targets faithfully. We use both shallow and deep blocks as sources and sensitive blocks as targets. The fault structure determines these roles rather than benchmark ablation: L7 is the last sensitive block before the 7|8 fault, L14 is the midpoint of [8..21] with a participation-ratio tie-break, and block 0 is not used as a production endpoint. Forward and backward predictors remain distinct directed channels rather than being collapsed into a single symmetric bidirectional fail-safe design.
Embedding and synthesis methods. PatchCore [34] scores a coreset of normal patch features, and PaDiM [10] models each spatial position with a Gaussian. CutPaste [24], DRAEM [39], SimpleNet [25], GLASS [5] and EfficientAD [2] use synthetic anomalies, discriminative training or a lightweight student. These methods do not model directed relations along depth. A more detailed discussion of related work is provided in Appendix A.1.
3. Method
3.1. Overview
Given the normal images of one category, the pipeline contains a frozen feature extractor, eight directed predictors and a label-free scoring stage (Fig. 2). Every reported model is trained separately for one category; no multi-class objective or cross-category predictor parameters are used. We use DINOv2 ViT-L/14 with registers [9, 29]. Its parameters remain frozen. At 448², the 14 × 14 patch embedding uses stride 8 and padding 3, producing an overlapping 56 × 56 token grid (3136 tokens); the positional embedding is interpolated to the same grid. We keep blocks from the 24-block backbone (zero-based indices).
Each channel is an ordered pair , , implemented by a separate three-layer MLP with hidden width 512. A learnable source shortcut preserves information that lies close to :
where is initialised to 0.1 and trained jointly with the MLP. Source and target features have the same width in all evaluated backbones. The forward and backward pairs are listed in Table 1.
| branch | source block | target blocks |
|---|---|---|
| forward | 1 | 14, 7 |
| backward | 21, 22, 23 | 14, 7 |
Table 1. The eight directed channels. Both branches are trained jointly; the pairing rule is derived in Sec. 3.2 and the role of each direction is analysed in Sec. 3.3.
Objective and optimisation. For prediction , the token loss is
and the channel averages over the hardest 5% of tokens. This prevents well-modelled normal tokens from dominating a small defect. The loss averages within each direction and then weights the forward and backward branch means equally; an individual forward channel therefore has three times the weight of a backward channel. All coefficients are fixed across categories, datasets and backbones. We optimise only the predictors with AdamW (weight decay , learning rate , cosine schedule, feature batch size 8) [26]. The epoch budget is clip(round(), 10, 40); training stops after two epochs without 0.1% relative improvement, with a minimum of five epochs.
3.2. Fault Lines in the Backbone
We select layers without labels, masks or test images. For training images, let be the mean cosine similarity between block and block over positions and images. Across five categories and three datasets, it drops at four repeatable fault lines:
while the remaining boundaries lie between 0.85 and 0.93. We detect faults with relative tests and shared constants and . A boundary is a fault if
or if the drop into it is large relative to the whole sequence, for ,
The left endpoint 0|1 uses the same drop test in the opposite direction,

Figure 2. Pipeline overview. Training and inference share a frozen DINOv2 ViT-L/14 and eight directed predictors. Four cosine faults select six blocks; each MLP maps one source block to one target, and the loss averages the hardest 5% of tokens. The residual measures what the source cannot carry, and the predictor retains a trainable source shortcut . At test time, a training-only soft prior weights the residuals. The image score uses after median/spatial baselines, smoothing, high-pass filtering and top-0.2% pooling. Pixel localization bypasses these image-level branches and is evaluated at resolution as the direct mean of the eight residual maps.
For ViT-L, and ; ViT-B and RADIO use the same rule. The faults partition the 24 blocks into four stable segments
with block 0 isolated before the first fault. Two label-free diagnostics follow the same boundaries. The participation ratio peaks in the middle segment (34.5 at block 14 for cable) and falls to 10.7 at block 23. A synthetic local perturbation also produces a weaker and broader response in the deepest blocks. These signatures agree with rank-collapse analyses of deep attention and transformer stacks [12, 28]. The layer-wise phase transitions in ViTs further agree with terminal neural-collapse geometry [23, 30].
The layer sequence can also be viewed through a discrete-time analogy: block-recurrent, linearized, and dynamic-mode analyses model relations across ViT depth [1, 20, 35], while Koopman, neural-ODE, and stable-architecture formulations provide the broader dynamical-systems language [6, 7, 18, 31]. We use this only as an analysis analogy; each deployed transition remains a sep-
| backbone | detected faults | near target | mid target | deep band | source |
|---|---|---|---|---|---|
| ViT-L | 0|1, 7|8, 21|22, 22|23 | 7 | 14 | 21, 22, 23 | |
| ViT-B | 3|4, 9|10 | 3 | 7 | 10, 11 | |
| RADIO-B | 3|4, 9|10 | 3 | 7 | 10, 11 |
Table 2. Fault boundaries produced by the relative rule on the recorded cosine curves, together with the layer set they imply. The ViT-B and RADIO-B rows are the configurations used in the completed backbone-generalization experiments.
arately trained pointwise MLP. The rule transfers directly to 12-block backbones: ViT-B and RADIO-B both show a shallow notch at 3|4 and a late collapse, giving near target 3, mid target 7, and deep sources 10, 11 (Table 2). Only the layer indices change; the predictors, scoring and prior rules remain the same.
3.3. Directed Cross-Layer Prediction
Reconstruction residuals mix two effects: information lost in the bottleneck and the ability of the teacher representation to reproduce itself. A directed channel avoids the second effect. With depth treated as discrete time, the hidden states form a trajectory, and learns the transition from block s to block t pointwise over tokens. At inference, the residual measures the part of the target state that the source cannot transport. We use this as an analysis abstraction, not as a formal claim that a transformer block is an autonomous dynamical system.
3.4. Layer-Role Diagnostics
Two diagnostics, neither used at inference, check the inferred roles. For layer ,
where is the mean training feature at position . The sets and contain defect and normal positions. We compute once with test masks for diagnosis and once with synthetic occlusions as a label-free proxy. Both curves fall over blocks 21–23. Fig. 3 therefore keeps L7 and L14 as targets and 21–23 as sources. L7 is slightly weaker than L14 but sits immediately before the 7|8 fault, so it remains the near target; L14 is the mid-depth target. Participation ratio gives the same picture: the middle layers retain many feature directions, while the late layers become compact and insensitive.
For a segment , the mid target is the nearest integer to , with ties broken by participation ratio; this gives L14 for [8..21] in ViT-L and L7 for [4..9] in the 12-block backbones. The faults constrain the role regions rather than uniquely determine every endpoint. We fix block 1 as the shared shallow source, a design convention rather than a claim of uniqueness. Targets are fixed without test labels, and the ablation below tests nearby targets and alternative source counts.
3.5. Scoring: Dual Per-Image Baseline and Train-Calibrated High-Pass
Let be a channel's residual map after multiplication by the soft-prior weight from Eq. (16). We score the map with two complementary per-image baselines. Branch A removes a global offset using the median over all tokens:
Branch B removes a smooth spatial field estimated by a Gaussian:
This keeps narrow peaks from scratches and small holes while suppressing illumination drift. Both maps are then smoothed with a Gaussian ( ) and high-pass filtered:

Figure 3. Source/target placement from layer-wise defect separation. Blue uses ground-truth masks; orange uses synthetic anomalies. Shading shows standard deviation over five categories. L7 and L14 remain sensitive and serve as targets; separation falls over blocks 21–23, which serve as sources. L7 is kept as the near target because it is the last sensitive block before 7|8, not because it is the global maximum.
| quantity | symbol | value |
|---|---|---|
| high-pass strength | ||
| high-pass scale | 2.0 | |
| smoothing | - | Gaussian, |
| pooling ratio | - | top 0.2% ( ) |
| B-branch field | 4 | |
| global reliability | w | ; w = 0 for no mask or multi-object |
| multi-object test | - | connected components |
| prior floor | f | 0.7 if multi-object; else 0.1 if , else 0.7 |
| mask-off | - | prior not applied |
Table 3. Fixed inference values and training-only calibration rules. Thresholds are shared; , normalisation and the mask prior use only normal training images.
The mean of the largest 0.2% patches ( ) gives one channel score. The eight channel scores are averaged separately for A and B. Smoothing removes pixel noise; the high-pass suppresses low-frequency drift. Its strength is computed once per category from the first 25 normal training images in deterministic loader order:
followed by
Table 3 lists the fixed inference values and calibration rules.
When normal residuals are already high frequency, and the filter switches off. A low-frequency normal residual increases up to 0.75. The per-category values appear in the supplement.
3.6. Label-Free Soft Fusion
Lighting and contrast vary from image to image, so the correction has to be estimated per image. The A and B branches provide the two baselines above. A third global branch uses the soft-mask-weighted token mean of the residual and responds to whole-object shifts. We convert each branch to a z-score using the first 60 normal training images in deterministic loader order, then fuse:
where and is separate from the token weight . To estimate pose rigidity , we compute the foreground principal-axis angle of each training SAM-2 mask, double it to remove the sign ambiguity, and take the circular standard deviation. Rotating or texture categories therefore turn the global branch off. For multi-object categories (ncomp > 2), the global mean mixes several objects and often anti-correlates with a single-object defect, so we also set and retain floor 0.7.
3.7. Pixel-Level Localization Score
The pixel metric deliberately bypasses the image-level branches: it does not apply the foreground prior, the A/B median and spatial baselines, global fusion, DoG filtering or branch z-scores. Instead, the localization map is the equal mean of the eight raw directed residual maps; it is rasterized to , resized to , then smoothed by a Gaussian with and zero padding. Ground truth is resized directly to the same grid, and P-AUROC and P-AUPRO are computed over all test pixels. This common evaluation grid preserves the spatial defect response without adding a second, separately tuned localization pipeline.
3.8. Soft Foreground Prior
Unlike reconstruction, the pointwise residual has no bottleneck that compresses background variation. Foreground filtering is therefore part of the detector rather than an optional post-processing add-on. We train a foreground probe from SAM 2 [33] masks on normal training images. For the six blocks in , we use up to 50 cached masks in deterministic loader order, sample 800 patches per image with a fixed seed, fit an L2 logistic regression per block ( ), and keep the three blocks with the highest separation. A joint L2 probe on their concatenated features gives a foreground probability p per patch. The cap keeps calibration cost fixed when Real-IAD categories contain more than 1,000 normal images.
Before use, masks whose mean four-corner foreground coverage exceeds 0.5 are polarity-flipped; this guard is active for one VisA category. A separate fallback disables the probe when its training-side pseudo-mask AUC is below 0.60, and fewer than four cached masks also disable it. The AUC fallback did not trigger on the reported benchmarks. All checks use training images and pseudo-masks only.
The probe is trained on pseudo-masks, so p acts as a prior rather than a decision. The patch weight is
so background patches retain at least a fraction f of their residual. The prior can attenuate evidence but cannot erase a misclassified defect.
The floor depends on how often the model's top residual patches fall outside the predicted foreground. Let T contain the top-eight residual patches and let be the predicted foreground set:
averaged over the first 25 normal training images and both branches. A high can reflect either background distractors or an incomplete mask, which training data alone cannot distinguish. We use the contrastive floor only for accepted single-object masks; multi-object and unreliable masks retain . The fixed 0.40 threshold is an operational calibration, not an optimality result; the supplement lists its category decisions and calibration scope.
3.9. Reliability Gate
Pseudo-masks can miss a thin object or include textured background. From the first 25 training masks we compute foreground fraction, connected components, aspect ratio and foreground/background variance. The prior remains on for multi-object categories. Otherwise it is disabled when either rule holds:
Rule A catches a thin, small object with an implausible mask. Rule B catches masks with no usable foreground/background contrast. Both use training images and pseudo-masks only; the disabled categories are listed in the supplement.
4. Experiments
4.1. Experimental Settings
Datasets and experimental protocol. We evaluate on MVTec-AD [3] (15 categories), VisA [42] (12), and Real-
| method | S-AUROC | I-AUROC | P-AUPRO |
|---|---|---|---|
| PaDiM [10] | 91.2 | 80.3 | 81.8 |
| CFlow [14] | 89.8 | 82.5 | 90.5 |
| PatchCore [34] | 93.7 | 89.4 | 91.5 |
| SoftPatch [22] | 92.8 | 89.4 | 90.8 |
| SimpleNet [25] | 94.9 | 88.5 | 84.6 |
| DeSTSeg [41] | 94.0 | 86.9 | 81.5 |
| RD [11] | 83.7 | 87.1 | 93.8 |
| UniAD [38] | 88.1 | 82.9 | 86.1 |
| Ours, ViT-L, 252² | 95.10 | 92.21 | 93.86 |
Table 4. Real-IAD reference benchmark. S, I and PRO are sample AUROC, image AUROC and P-AUPRO. The first eight rows use the official 256-side protocol; our patch-aligned 252² run is an approximate resolution match. This table is used for benchmark-level calibration, not as a strict protocol-identical claim.
IAD [36] (30), training one model per category, averaging category scores, and also grouping Real-IAD by object across its five views (O-ROC).
Implementation. All datasets use a frozen DINOv2 ViT-L/14 at 448² with images enhanced at their native aspect ratio and resized directly to 448² without letterbox padding, while input synthesis and target scratch/noise synthesis are disabled, training and optimisation follow Sec. 3, the backbone, predictor architecture, channel pairs, loss weights, floor rule, and gate thresholds are shared, and category-specific calibration statistics for λ, branch normalisation, and the mask prior are computed only from normal training images.
Metrics. We use image-level AUROC as the primary score (I-ROC on Real-IAD), compute the pixel map for the refreshed 448² results as the equal mean of the eight raw residual maps before foreground weighting or image-level branch calibration, rasterized to 448², resized to 256², and smoothed by a 5 × 5 Gaussian with σ = 4 with ground truth evaluated on the same 256² grid, and report P-AUROC and P-AUPRO with the AUPRO false-positive limit at 0.3 from deterministic single runs, while category-level dispersion is reported in the supplement and training-seed variance is not estimated.
Additional portability tests on MPDD [21], BTAD [27], DAGM [37], and Kolektor Surface-Defect Dataset 2 (KSDD2) [4] are reported in Appendix A.10.
4.2. Comparison Results
We report the official Real-IAD low-resolution benchmark, a controlled Dinomaly2 comparison, and a backbone transfer test separately, since they answer different questions.
Table 4 is an approximate 252²/256 protocol comparison, not a state-of-the-art ranking; newer single-class methods use different Real-IAD protocols and are omitted. Table 5 controls backbone, setting and resolution.
Under the refreshed 448² protocol, our method leads on VisA image AUROC by 0.52 pp and on Real-IAD image AUROC by 2.29 pp. Dinomaly2 leads on MVTec-AD image AUROC by 0.10 pp, Real-IAD object AUROC by 0.37 pp, and both pixel metrics on all three datasets. The result is therefore an image-level advantage on two benchmarks, not a universal pixel-localization win. The 392² row is retained from the preceding matched run; only the 448² benchmark set was retrained for the refreshed geometry.
4.3. Ablation Study
We ablate on four categories (cable, screw, pcb1, macaroni2) with the production soft-gated scoring. The matched reference configuration has mean image AUROC 0.9902; every row of Table 6 changes one component while everything else stays fixed. These mechanism controls use the preceding locked checkpoints; the main 448² table is the independently refreshed run, so the ablation is interpreted within its matched family rather than as an absolute delta to the refreshed score.
Source identity has a smaller effect: equidistant and random sources stay within 0.33 pp, one and two deep sources lose 0.29 and 0.10 pp, and a fourth adds nothing. Target depth has a larger effect: replacing L7 loses 2.76 pp and a blind target loses 5.17 pp. A supplementary one-target scan changes half of the channels and shows a broad sensitive plateau; it supports a target segment, not a uniquely optimal block. The branch groups are not interchangeable: forward-only loses 2.39 pp, while backward-only loses 0.28 pp. Fusion gains at most 0.06 pp.
Per-channel analysis on five categories shows complementary specialization. Cable’s layout changes are almost solved by 1→14 alone (0.998), screw is strongest through deep-to-L7 (21→7, 0.990), and pcb1, macaroni2 and audiojack favor deep-to-L14 channels (best 0.993, 0.991 and 0.849). These are diagnostic per-channel measurements, not a rule for selecting channels per category; the exact table is in the supplement. The model keeps the same eight channels everywhere.
The complete ablation configurations and all measured results are provided in Appendix A.4.
4.4. Generalization across Backbones
We repeat layer selection on 12-block DINOv2 ViT-B/14 and RADIO-B [32]. Both have a shallow notch and a late collapse, and the same rule yields {1, 3, 7, 10, 11}. Only the layer indices change; the predictors, probe, scoring and floor rules remain the same. Table 7 reports the image-level comparison.
ViT-L remains strongest, ViT-B is close, and RADIO-B loses most on VisA. From ViT-L to ViT-B, image AUROC drops by 0.29, 0.38 and 0.26 pp on MVTec-AD, VisA and Real-IAD. RADIO-B loses 1.07 pp image AUROC on VisA.
The change from ViT-L to ViT-B is smaller than the change from ViT-B to RADIO-B. On Real-IAD, ViT-B
| dataset | method | 392² | 448² | ||||||
|---|---|---|---|---|---|---|---|---|---|
| I | O | P | PRO | I | O | P | PRO | ||
| MVTec-AD | ours | 99.70 | – | 97.30 | 95.94 | 99.75 | – | 98.46 | 95.97 |
| Dinomaly2 | 99.84 | – | 98.54 | 95.83 | 99.85 | – | 98.75 | 96.42 | |
| VisA | ours | 99.29 | – | 98.95 | 94.83 | 99.42 | – | 99.21 | 96.12 |
| Dinomaly2 | 99.05 | – | 99.21 | 95.90 | 98.90 | – | 99.39 | 96.64 | |
| Real-IAD | ours | 94.01 | 96.13 | 98.70 | 97.33 | 94.27 | 96.26 | 99.26 | 96.59 |
| Dinomaly2 | 92.67 | 96.61 | 99.24 | 96.26 | 91.98 | 96.63 | 99.43 | 96.79 | |
Table 5. Controlled Dinomaly2 comparison. I and O are image- and object-level AUROC; P and PRO are P-AUROC and P-AUPRO. Each pair uses the same resolution. Dinomaly2 uses its native center crop, whereas the refreshed ours run resizes the full image directly to 448²; its pixel maps and ground truth are compared on a common 256 × 256 grid. The 392² row is retained from the preceding matched protocol and is not part of the refreshed result.
| configuration | mean AUROC | Δ (pp) |
|---|---|---|
| reference (8 predictors, B3)branch group | 0.9902 | – |
| forward channels only | 0.9663 | −2.39 |
| all backward channels (BWD6)targets | 0.9874 | −0.28 |
| drop target (ONLY14) | 0.9866 | −0.36 |
| same-source 14→7 test (B7) | 0.9626 | −2.76 |
| targets in blind/far depth (FAR4) | 0.9386 | −5.17 |
| target block (TGTO) | 0.9795 | −1.07 |
| sources | ||
| one deep source {23} (B1) | 0.9873 | −0.29 |
| two deep sources {22, 23} (B2) | 0.9892 | −0.10 |
| four deep sources {20, 21, 22, 23} (B4) | 0.9902 | 0.00 |
| deep sources {8, 9, 10} | 0.9827 | −0.76 |
| equidistant sources (EQ8) | 0.9881 | −0.22 |
| random 8-channel pairing (RND8) | 0.9870 | −0.33 |
| fusionfused source/target groups (FALL2) | 0.9908 | +0.06 |
| patch resolution (Real-IAD six-category subset) | ||
| overlapping patch-8, stride 8 (ours) | 0.9350 | – |
| native patch-14, stride 14 | 0.9016 | −3.34 |
Table 6. Ablation on cable, screw, pcb1 and macaroni2 (mean image AUROC). Full channel sets and per-category results are in the supplement. The patch-resolution block uses six Real-IAD categories and is compared only within that subset.
| backbone | MVTec-AD I | VisA I | Real-IAD I/O |
|---|---|---|---|
| ViT-L/14 | 99.75 | 99.42 | 94.27 / 96.26 |
| ViT-B/14 | 99.46 | 99.04 | 94.01 / 96.02 |
| RADIO-B | 99.33 | 98.35 | 93.27 / 95.78 |
Table 7. Backbone generalization at 448² in image-level AUROC. The Real-IAD cell includes object-level AUROC (I/O). Pixel columns are omitted because their protocol was refreshed only for the final ViT-L run. The layer set changes only when the backbone changes.
keeps object AUROC within 0.24 pp of ViT-L. RADIO-B remains competitive on MVTec-AD, but it loses most on VisA. Because RADIO mixes several pretraining signals [32], we do not attribute this drop to one representa-
tion property. These comparisons keep the backbone fixed within each row and therefore isolate representation quality from layer selection.
Cost and operating regime. The backbone runs once and only the directed predictors and foreground probes are trained. The eight predictors share the same token dimension and hidden width, so inference consists of eight token-wise MLPs after one six-layer feature read. No test image updates the model, and no channel is selected from test performance. We do not claim an end-to-end efficiency ranking: wall-clock latency and peak memory were not measured under a controlled hardware protocol. SAM-2 is needed only to build training pseudo-masks. When masks are unavailable, the prior is disabled as a degraded fallback: removing it lowers image AUROC by 0.14, 1.05 and 3.71 pp on cable, pcb1 and macaroni2, respectively.
The mixed comparison with Dinomaly2 is useful for deployment choices. Our gains are largest at the image level on Real-IAD and VisA, while Dinomaly2 remains stronger in pixel ranking and on the nearly saturated MVTec-AD benchmark. Applications that need to decide whether a part is abnormal can therefore use the image-level score; pixel localization remains the weaker side of our method.
The main failure modes are also visible from the design. Multi-object scenes lose the global branch because its mean mixes unrelated objects. Thin objects can produce incomplete SAM-2 masks, which is why the reliability gate disables the prior when geometry or foreground/background contrast is implausible. Finally, the method assumes that a category has a stable normal training set; cross-category training would require recalibrating the background prior and the target-depth statistics.
4.5. Discussion
The fixed eight-channel set avoids label-dependent channel search and combines 1→14 reconfiguration, L7 fine structure and deep-to-L14 regional deviations. Using one or two deep sources instead of three costs 0.29 and 0.10 pp, while leaving the sensitive segment costs over 5 pp. Target depth therefore matters more than source identity, which mainly provides a robustness margin. Branch A corrects a per-image offset, and branch B removes a smooth spatial background. The global branch captures whole-part shifts but cannot localise, so it is excluded from the pixel metric; pixel scoring averages the eight residual maps directly.
The pointwise predictor cannot model cross-token information flow; its residual emphasises local mismatch, consistent with the strength on scratches and texture. Dinomaly2 reconstructs layer groups and is stronger in dense pixel ranking, whereas our score is stronger on image/object decisions. The two methods are complementary; a coarse-to-fine combination remains untested. The training-only foreground prior is gated and disabled when unreliable.
The main comparison uses direct square resizing. Its statistical limits remain: models are trained independently per category, and main results are deterministic single runs, so we do not interpret sub-percentage-point differences as stable category rankings. The supplement reports category dispersion, but training-seed variance, calibration-budget sensitivity and full cross-category training remain unestimated; the evidence therefore supports a mechanism-level gain from the fixed channel set, rather than universal per-class superiority or a claim that the calibration budgets are optimal.
Single-class scope and multi-category extension. We retain one model per category because the benchmark defines a separate one-class normal support for each category and because the high-pass strength, branch normalisation and foreground prior are estimated from category-specific normal images; pooling categories without explicit conditioning would mix several normal manifolds, so a change that is nominal for one object could become anomalous for another. Multi-category anomaly detectors are therefore complementary [15, 17, 19, 38, 40], but evaluating them requires a different protocol. The present choice also exposes the main extension cost: adding a new single category requires training its eight predictors and recalibrating the three category-specific statistics. A useful next test is a shared predictor with category-conditioned calibration or lightweight mixture-of-experts heads, evaluated on held-out-category and object-level protocols; full multi-category training and unseen-category transfer remain outside the scope of this paper.
5. Conclusion
Adjacent-layer cosine similarity reveals stable depth segments. Using deep and shallow blocks as sources and segment boundaries or midpoints as targets turns cross-layer transfer failure into an anomaly score. The rule and scorer work with ViT-L, ViT-B and RADIO-B. Against Dinomaly2, ours is stronger on VisA/Real-IAD image AU-
ROC; Dinomaly2 is stronger on MVTec image AUROC, Real-IAD object AUROC and all pixel metrics under the refreshed protocol. The foreground prior is training-only and gated. Pixel localization remains the main gap. A useful next test is to combine the pointwise score with regional layer-group reconstruction.
LLM Usage Statement
OpenAI Codex, DeepSeek, and Kimi were used to assist with English-language editing, manuscript organization, LaTeX formatting, figure and table preparation, and code-assisted aggregation of experimental results. The experimental data were produced by our implementation and verified by the authors. All technical claims, numerical results, figures, and citations were checked against the source code, logs, papers, and documentation. The authors take full responsibility for the content of the submission.
A. Supplementary Material
The main 448² table and per-category table use the refreshed direct-square, no-synthesis run. The four-category ablations, backbone-transfer rows, high-pass tables and mask-gate counts are matched mechanism studies from the preceding locked run. They are not used to compute absolute deltas against the refreshed main scores.
A.1. Extended Related Work
Reconstruction family. RD4AD [11] keeps a pretrained encoder frozen, fuses multi-scale teacher features into a compact one-class embedding, and uses a student decoder to reconstruct the teacher's multi-scale representations. DeSTSeg [41] adds a denoising student and a segmentation network to this skeleton. Dinomaly2 [16, 17] aggregates eight ViT blocks into a noisy MLP bottleneck and reconstructs grouped layer representations. Its over-generalisation argument is that strict layer-to-layer supervision can make the decoder too capable of restoring anomalous content. Loose Reconstruction therefore groups multiple encoder layers into semantic clusters, reconstructs the cluster sums, and randomly drops bottleneck activations.
This remedy changes how strongly the decoder is pushed to reproduce its input, but not what it is asked to predict. A block that is intrinsically insensitive to a defect can therefore retain a near-zero residual. In contrast, our deep-to-sensitive channels make a deep source predict a sensitive target it cannot faithfully represent. Insensitivity then determines the anomaly signal instead of suppressing it.
Embedding and synthesis families. PatchCore [34] stores a coreset of nominal patch features and uses nearest-neighbour distance, while PaDiM [10] models each spatial position with a Gaussian and scores by Mahalanobis distance. Synthetic-anomaly methods include CutPaste [24], DRAEM [39], SimpleNet [25] and GLASS [5]; EfficientAD distils a lightweight student from a teacher. Their performance is tied to the realism of the synthetic defects or the capacity of the student, and none models directed relations along depth.
Benchmarks and backbone context. MVTec-AD [3] contains 15 single-view categories, VisA [42] contains more complex products with multiple objects, and Real-IAD [36] contains 30 categories captured from five views. MANTA [13] targets tiny defects with high-resolution multi-view captures. We use the per-category single-class protocol throughout and also report object-level Real-IAD AUROC by grouping the five views of each object. The frozen DINov2 backbone family supplies the features on which the fault structure is measured.
A.2. Per-Category High-Pass Calibration
Tables 8–10 list the high-pass strength produced by the training-only calibration described in the main paper's scoring section. Each value follows directly from and the category's own . The filter switches off on 13 of 15 MVTec-AD categories, while VisA pcb3 and Real-IAD switch reach the maximum of 0.75.
A.3. Calibration, Statistical Scope, and Comparison Boundaries
Sampling for training-only calibration. All calibration quantities use normal training images only. The A/B/global z-score uses the first 60 images in deterministic loader order. The high-pass coefficient uses the first 25 normal training images, while the mask-gate statistics use the first 25 cached masks. The foreground probe uses up to 50 cached masks, samples 800 patches per image with a fixed seed, and fits an L2 logistic regression with . The mask-generation stage samples at most 50 images with fixed seed 555, so production runs use at most 50 masks per category. These caps keep calibration cost fixed for Real-IAD categories that contain more than 1,000 normal images. We did not perform a sensitivity study over the 25/50/60/800 sample budgets, so they should be read as fixed implementation choices rather than tuned optima.
Thresholds and category adaptation. The fault detector, channel set, MLP architecture, top-0.2% pooling, floor values and gate thresholds are shared across datasets. Three quantities adapt to a category: is a differentiable function of its training residual spectrum; the branch statistics are normalised on its training images; and the mask prior is fitted from its training pseudo-masks. The floor threshold separates observed training-only values of 0.266 and 0.421, and the reliability-gate constants were then held across all 57 main categories. We also swept the BC threshold over [0.2, 0.6] using the paired and predictions available for the 27 mask-on/off categories. The MVTec mean changes by less than 0.01 pp over this range, and the VisA mean varies by at most 0.056 pp. The choice is therefore operationally stable on this diagnostic set, although it should not be interpreted as a formal held-out optimality result: a high can indicate either background distractors or an incomplete mask, and the reliability gate is the primary safeguard for the latter.
Category dispersion. Table 11 reports the mean and standard deviation over categories for the refreshed production ViT-L/14 results. These values describe heterogeneity across object categories, not variance over repeated training seeds. In particular, the Real-IAD image-level standard deviation is 3.51 pp across 30 categories, so its aggregate gap should not be interpreted as a uniform improvement on every object.
| category | λ | ρ |
|---|---|---|
| bottle | 0.000 | 0.7960 |
| cable | 0.000 | 0.7123 |
| capsule | 0.000 | 0.6818 |
| carpet | 0.000 | 0.5752 |
| grid | 0.000 | 0.6649 |
| hazelnut | 0.000 | 0.7785 |
| leather | 0.000 | 0.6567 |
| metal_nut | 0.000 | 0.7784 |
| pill | 0.000 | 0.7353 |
| screw | 0.000 | 0.7108 |
| tile | 0.000 | 0.5972 |
| toothbrush | 0.282 | 0.8301 |
| transistor | 0.000 | 0.6601 |
| wood | 0.000 | 0.6282 |
| zipper | 0.001 | 0.8001 |
Table 8. MVTec-AD high-pass calibration.
| category | λ | ρ |
|---|---|---|
| candle | 0.000 | 0.6455 |
| capsules | 0.631 | 0.8673 |
| cashew | 0.000 | 0.7130 |
| chewinggum | 0.000 | 0.7926 |
| fryum | 0.604 | 0.8644 |
| macaroni1 | 0.596 | 0.8635 |
| macaroni2 | 0.689 | 0.8735 |
| pcb1 | 0.199 | 0.8212 |
| pcb2 | 0.209 | 0.8223 |
| pcb3 | 0.750 | 0.9047 |
| pcb4 | 0.266 | 0.8284 |
| pipe_fryum | 0.000 | 0.7461 |
Table 9. VisA high-pass calibration.
Baseline and mechanism controls not completed. The reference Real-IAD table is retained for benchmark calibration, not as a protocol-identical ranking. We did not reproduce all recent single-class detectors or run a separate layer-group reconstruction model with our complete scoring pipeline. Such a control is necessary to quantify how much of the result is attributable to the cross-layer residual versus the shared post-processing. Our existing patch-resolution, direction, target-depth and source-count controls isolate parts of this question, but they do not replace that experiment. We also report no repeated-seed variance, wall-clock efficiency, F1 at a fixed operating threshold, or a qualitative failure gallery. These omissions define the quantitative scope of the current submission.
Ablation breadth and loss weighting. The controlled component ablation uses cable, screw, pcb1 and macaroni2; the extra classes in the per-channel discussion are diagnostic examples, not part of the controlled mean. We did not repeat every ablation configuration across all 57 main categories. The training objective averages the two forward channels and six backward channels within their respective directions, then weights the two direction means equally. This is intentional branch balancing, but it gives each forward channel three times the per-channel weight of a backward channel; the forward-only and backward-only rows quantify the resulting trade-off.
A.4. Complete Ablation Results
Table 12 gives the exact channel set behind every abbreviation used in the main ablation. BWD4 is the historical four-channel subset obtained by dropping source block 23; BWD6 contains all six backward channels. A missing entry denotes that the corresponding branch is disabled.
| category | λ | ρ |
|---|---|---|
| audiojack | 0.651 | 0.8695 |
| bottle_cap | 0.000 | 0.7186 |
| button_battery | 0.745 | 0.8795 |
| end_cap | 0.530 | 0.8566 |
| eraser | 0.000 | 0.6983 |
| fire_hood | 0.295 | 0.8315 |
| mint | 0.000 | 0.7479 |
| mounts | 0.000 | 0.7212 |
| pcb | 0.666 | 0.8710 |
| phone_battery | 0.000 | 0.7546 |
| plastic_nut | 0.000 | 0.7961 |
| plastic_plug | 0.000 | 0.7693 |
| porcelain_doll | 0.089 | 0.8095 |
| regulator | 0.000 | 0.7076 |
| rolled_strip_base | 0.000 | 0.6996 |
| sim_card_set | 0.000 | 0.6583 |
| switch | 0.750 | 0.8885 |
| tape | 0.000 | 0.7068 |
| terminalblock | 0.000 | 0.7178 |
| toothbrush | 0.066 | 0.8071 |
| toy | 0.000 | 0.7842 |
| toy_brick | 0.125 | 0.8133 |
| transistor1 | 0.459 | 0.8490 |
| u_block | 0.000 | 0.7732 |
| usb | 0.644 | 0.8686 |
| usb_adaptor | 0.000 | 0.6860 |
| vcpill | 0.322 | 0.8344 |
| wooden_beads | 0.502 | 0.8536 |
| woodstick | 0.154 | 0.8165 |
| zipper | 0.000 | 0.7934 |
Table 10. Real-IAD high-pass calibration.
| dataset | I-AUROC | O-AUROC | P-AUROC | P-AUPRO |
|---|---|---|---|---|
| MVTec-AD | - | |||
| VisA | - | |||
| Real-IAD |
Table 11. Category-level mean ± standard deviation for the production ViT-L/14 model. Standard deviations are computed over categories, not repeated runs.
Table 12. Exact source-to-target sets for the reported ablation configurations.
| configuration | forward channels | backward channels |
|---|---|---|
| Ours (8) | ||
| forward-only | - | |
| BWD4 | - | |
| BWD6 | - | |
| B1 | ||
| B2 | ||
| B3 (= Ours) | ||
| B4 |
| configuration | forward channels | backward channels |
|---|---|---|
| B7 | ||
| B8 | ||
| ONLY14 | ||
| EQ8 | ||
| RND8 | ||
| FAR4 | ||
| deep-source control | ||
| TGT0 | ||
| FALL2 | ||
| MEAN / MEDIAN | Same eight production channels; only score aggregation changes. | |
Table 13 reports every measured configuration on the four fixed categories. All rows use the production soft-gated scoring and differ from the matched reference in exactly one design variable. Table 14 further reports the per-category results for the backward-direction and source-count subsets.
Table 13. Complete four-category ablation results. I-ROC is reported as a fraction; is relative to the matched no-input-injection reference (NOINP).
| group | configuration | mean I-ROC | (pp) |
|---|---|---|---|
| reference | NOINP | 0.9902 | - |
| control | F8NOINP | 0.9901 | -0.02 |
| direction | forward-only | 0.9663 | -2.39 |
| BWD4 | 0.9868 | -0.34 | |
| BWD6 | 0.9874 | -0.28 | |
| source | A0 | 0.9901 | -0.01 |
| B1 | 0.9873 | -0.29 | |
| B2 | 0.9892 | -0.10 | |
| B4 | 0.9902 | 0.00 | |
| E1 | 0.9903 | +0.01 | |
| EQ8 | 0.9881 | -0.22 | |
| deep-source control | 0.9827 | -0.76 | |
| SRCS2B | 0.9865 | -0.37 | |
| RND8 | 0.9870 | -0.33 | |
| target | A1 | 0.9893 | -0.10 |
| A2 | 0.9895 | -0.07 | |
| B7 | 0.9626 | -2.76 | |
| B8 | 0.9676 | -2.27 | |
| T10 | 0.9885 | -0.17 | |
| T12 | 0.9894 | -0.08 | |
| T16 | 0.9899 | -0.04 | |
| T18 | 0.9860 | -0.43 | |
| TNear3 | 0.9880 | -0.22 | |
| TMid18 | 0.9845 | -0.57 | |
| TGT0 | 0.9795 | -1.07 | |
| TGT2 | 0.9881 | -0.21 | |
| FAR4 | 0.9386 | -5.17 | |
| ONLY14 | 0.9866 | -0.36 | |
| fusion | F0 | 0.9901 | -0.01 |
| configuration | cable | screw | pcb1 | macaroni2 | mean |
|---|---|---|---|---|---|
| BWD6 | 0.9888 | 0.9904 | 0.9969 | 0.9733 | 0.9874 |
| B1 (1 deep source) | 0.9981 | 0.9873 | 0.9927 | 0.9711 | 0.9873 |
| B2 (2 deep sources) | 0.9972 | 0.9902 | 0.9970 | 0.9722 | 0.9892 |
| B4 (4 deep sources) | 0.9951 | 0.9918 | 0.9980 | 0.9758 | 0.9902 |
Table 14. Per-category results for the new direction and deep-source-count ablations. B3 is the production reference (three deep sources) with mean 0.9902. Adding a fourth source matches B3, so accuracy saturates at the production set.
| group | configuration | mean I-ROC | (pp) |
|---|---|---|---|
| F01 | 0.9899 | -0.03 | |
| F78 | 0.9901 | -0.01 | |
| F8 | 0.9896 | -0.06 | |
| F1416 | 0.9900 | -0.02 | |
| F2122 | 0.9900 | -0.02 | |
| F2123 | 0.9882 | -0.20 | |
| F2223 | 0.9899 | -0.03 | |
| FALL | 0.9888 | -0.14 | |
| FALL2 | 0.9908 | +0.06 |
A.5. Per-Channel Specialization
Table 15 reports image-level AUROC when each directed channel is scored alone. The five categories cover structural layout changes (cable), fine geometry (screw), circuit patterns (pcb1), multi-object texture (macaroni2), and a small mixed-domain object (audiojack). The best channel changes with the anomaly type while the eight-channel set stays fixed.
The winning channel depends on the anomaly type rather than depth alone. Cable is nearly solved by the forward 1→14 path, whereas screw benefits most from deep information returned to the near target L7. The circuit and multi-object categories instead favor deep-to-L14 mappings. Audiojack is the hardest of the five and also peaks at 23→14. This variation is the empirical basis for retaining a fixed set of roles instead of choosing one layer pair for every category.
A.6. Foreground-Prior Ablation
Table 16 compares the production foreground weighting with the same score when . The checkpoint, test images, eight channels and post-processing remain fixed; only the foreground weight changes. A category whose reliability gate disables the mask has identical values in the two columns by construction.
The effect is not uniform: cable changes by only 0.14 pp, while pcb1 and macaroni2 gain 1.05 and 3.71 pp. The foreground prior is therefore a structural component of the pointwise-residual detector, not optional post-processing. The gate determines when the component is safe to apply.
A.7. Mechanism-Control Pilot
Table 17 compares the cross-layer 21→14 map with two alternative objectives under the same normal tokens, training steps, foreground gate and post-processing. The ordinary reconstruction head reconstructs through a bottleneck; the grouped head reconstructs from the mean of and . All three heads have 1.58M parameters.
Cross-layer prediction is useful where fine local evidence is difficult to transport, but the results do not support universal superiority over reconstruction. A Real-IAD extension is still required before making a dataset-level claim.
A.8. Marginal Target-Layer Sensitivity on VisA
This experiment measures the marginal sensitivity of one target group in the complete eight-channel model; it does not rank target blocks in isolation. Scan A replaces the four channels targeting with channels targeting , while retaining the four channels targeting . Scan B performs the converse: it replaces the four channels and retains the four channels. Each point therefore changes exactly half of the predictor set, with training settings fixed. We evaluate VisA pcb1 and macaroni2, the two categories used for layer analysis. The curves show mean image AUROC and the bands span the two category values; Fig. 4 reports the resulting curves.
| category | 1→14 | 1→7 | best deep→14 | best deep→7 | mean |
|---|---|---|---|---|---|
| cable | 0.9981 | 0.9875 | 0.9893 (23→14) | 0.9920 (21→7) | 0.9985 |
| screw | 0.9283 | 0.9524 | 0.9889 (22→14) | 0.9902 (21→7) | 0.9920 |
| pcb1 | 0.9818 | 0.9889 | 0.9927 (23→14) | 0.9862 (23→7) | 0.9918 |
| macaroni2 | 0.9286 | 0.9811 | 0.9907 (23→14) | 0.9893 (23→7) | 0.9915 |
| audiojack | 0.7852 | 0.8358 | 0.8485 (23→14) | 0.8393 (21→7) | 0.8486 |
Table 15. Per-channel image AUROC on five diagnostic categories. “Best” is selected only for display within each category; the deployed model always uses all eight channels. The table illustrates channel specialization and is not used for per-category selection. The final mean column evaluates all eight channels together.
| category | gate | prior off | prior on | Δ (pp) |
|---|---|---|---|---|
| cable | ON | 0.9971 | 0.9985 | +0.14 |
| screw | OFF | 0.9920 | 0.9920 | 0.00 |
| pcb1 | ON | 0.9813 | 0.9918 | +1.05 |
| macaroni2 | ON | 0.9544 | 0.9915 | +3.71 |
Table 16. Image-level AUROC with and without the foreground prior. The prior is required for accepted masks and can be decisive when background evidence competes with a defect. The reliability gate keeps it disabled when the training mask is unreliable.
| category | cross 21→14 | recon 14 | grouped recon |
|---|---|---|---|
| cable | 0.9648 | 0.9565 | 0.9515 |
| screw | 0.9553 | 0.9076 | 0.9129 |
| pcb1 | 0.9658 | 0.9602 | 0.9630 |
| macaroni2 | 0.9637 | 0.9806 | 0.9813 |
Table 17. Mechanism-control pilot under matched head capacity and identical scoring. Cross-layer prediction wins on cable, screw and pcb1, while reconstruction is stronger on macaroni2. This is a four-category local pilot, not the full six-category study, and it motivates a complementary rather than universal claim.

Figure 4. Marginal target sensitivity on VisA. Each scan replaces four channels associated with one target while retaining the four channels associated with the other. Dotted lines mark the production targets and . The broad plateaus show robustness inside the sensitive segment; they are not evidence that or is a uniquely optimal block. The point is omitted because its checkpoint is unavailable under the locked protocol.
Scan A varies from 98.24 to 98.66 and stays essentially tied with the fixed reference at 98.67. Scan B peaks at
98.76 around blocks 11–12 and then declines; moving to blocks 18 and 20 loses 0.64 and 0.93 percentage points relative to the reference. The plateau is partly expected because the untouched target group still contributes four channels, so the figure should be read as a marginal-substitution test. Used this way, it supports two bounded claims. First, the full predictor set does not require a category-specific search for a unique target block. Second, the target still has to remain in the sensitive depth segment: the broad plateau disappears near the late collapse, consistent with the larger loss of the blind-target control in the main text.
A.9. Patch-Resolution Control
Table 18 reports the matched per-category and mean results. The patch-resolution control removes the overlapping stride-8 patchization used by the production model and instead uses the native DINov2 14 × 14 patch embedding with stride 14. At 448² this produces a 32 × 32 token grid instead of 56 × 56. We retain the six selected transformer blocks, the same eight directed source-target channels, the MLP predictor and the same scoring pipeline; the mask probe and floor calibration are re-fitted on the native token grid. Because this control was run on six Real-IAD categories, we compare it only with the production model on the identical six-category subset.
| category | patch-8 | native-14 | Δ (pp) |
|---|---|---|---|
| bottle_cap | 97.84 | 93.54 | −4.30 |
| button_battery | 93.83 | 88.46 | −5.37 |
| end_cap | 91.89 | 88.17 | −3.72 |
| eraser | 96.31 | 92.93 | −3.38 |
| fire_hood | 93.48 | 91.71 | −1.77 |
| mounts | 87.63 | 86.13 | −1.50 |
| mean | 93.50 | 90.16 | −3.34 |
Table 18. Image-level AUROC for the patch-resolution control on six Real-IAD categories. patch-8 is the overlapping stride-8 tokenization; native-14 uses DINov2's native patch embedding. Removing the overlapping patchization lowers the matched mean by 3.34 pp.
A.10. Additional Dataset Results
Table 19 reports the four additional datasets evaluated with the same ViT-L/14, 448², MLP, mask-head and scoring protocol: MPDD [21], BTAD [27], DAGM [37], and Kolektor Surface-Defect Dataset 2 (KSDD2) [4]. The official BTAD-02 normal training split contains unidentified anomalies; we retain it for comparability [16, 22]. For DAGM, files listed under Train/Label are excluded from normal training. KSDD2 has no ground-truth anomaly masks in the current release, so we report only image-level AUROC and mark the pixel columns unavailable when ground truth is absent.
These results are a portability check, not a matched-baseline ranking: we did not retrain baselines for BTAD, DAGM or KSDD2 and therefore do not compare quoted literature numbers across different protocols. MPDD has a matched Dinomaly2 run: the refreshed model leads by 0.45 pp in image AUROC but trails by 1.08 pp in P-AUROC and 1.38 pp in P-AUPRO (ours: 98.27/98.24/95.73; Dinomaly2: 97.82/99.32/97.11). We use the additional datasets as a portability check, not as evidence for a universal accuracy advantage.
Table 19. Per-category results on the additional datasets. All values are percentages; pixel metrics use the same 256 × 256 evaluation grid as the refreshed main experiments.
| dataset | category | I-AUROC | P-AUROC | P-AUPRO |
|---|---|---|---|---|
| MPDD | bracket_black | 92.75 | 99.16 | 98.42 |
| bracket_brown | 97.13 | 94.26 | 93.13 | |
| bracket_white | 99.78 | 99.59 | 94.86 | |
| connector | 100.00 | 97.82 | 93.17 | |
| metal_plate | 100.00 | 99.53 | 97.98 | |
| tubes | 99.95 | 99.10 | 96.82 | |
| BTAD | 01 | 100.00 | 98.52 | 89.78 |
| 02 | 88.80 | 97.22 | 61.56 | |
| 03 | 99.59 | 99.91 | 99.42 |
| dataset | category | I-AUROC | P-AUROC | P-AUPRO |
|---|---|---|---|---|
| DAGM | Class1 | 100.00 | 89.69 | 81.81 |
| Class2 | 100.00 | 99.71 | 99.69 | |
| Class3 | 100.00 | 95.93 | 94.27 | |
| Class4 | 100.00 | 99.42 | 98.49 | |
| Class5 | 100.00 | 97.97 | 95.91 | |
| Class6 | 100.00 | 99.16 | 98.20 | |
| Class7 | 100.00 | 96.92 | 95.30 | |
| Class8 | 100.00 | 99.16 | 99.34 | |
| Class9 | 100.00 | 99.99 | 99.96 | |
| Class10 | 100.00 | 99.94 | 99.85 | |
| KSDD2 | ksdd2 | 97.13 | – | – |
| MPDD mean | 98.27 | 98.24 | 95.73 | |
| BTAD mean | 96.13 | 98.55 | 83.59 | |
| DAGM mean | 100.00 | 97.79 | 96.28 | |
| KSDD2 | 97.13 | – | – |
A.11. Mask-Gate and Floor Decisions
Table 20 lists the deployment decisions from the training-only mask gate. The floor column counts categories ultimately assigned 0.1 versus 0.7; categories without enough SAM2 masks do not receive a foreground prior.
| dataset | categories | mask ON | gate OFF | no mask | |
|---|---|---|---|---|---|
| MVTec-AD | 15 | 7 | 3 | 5 | 2 |
| VisA | 12 | 11 | 1 | 0 | 9 |
| Real-IAD | 30 | 30 | 0 | 0 | 2 |
Table 20. Mask-gate and floor assignments for the production ViT-L/14 runs. Gate-off categories are capsule, screw and transistor on MVTec-AD, and pcb3 on VisA. Real-IAD is gate-on for all 30 categories.
A.12. Per-Category Production Results
Table 21 reports the category-level production results.
Table 21. Per-category ViT-L/14 results for the refreshed 448² run. I, O, P and PRO denote image AUROC, object AUROC, P-AUROC and P-AUPRO.
| dataset | category | I (O) | P | PRO |
|---|---|---|---|---|
| MVTec-AD | bottle | 100.00 | 99.20 | 97.70 |
| cable | 99.55 | 98.69 | 95.79 | |
| capsule | 99.16 | 98.79 | 97.69 | |
| carpet | 100.00 | 99.43 | 98.35 | |
| grid | 100.00 | 99.44 | 96.78 | |
| hazelnut | 100.00 | 99.55 | 98.11 | |
| leather | 100.00 | 99.37 | 98.68 | |
| metal_nut | 100.00 | 98.48 | 96.68 | |
| pill | 99.67 | 96.86 | 97.94 | |
| screw | 99.04 | 99.45 | 97.15 | |
| tile | 100.00 | 97.07 | 92.72 | |
| toothbrush | 100.00 | 98.97 | 96.82 | |
| transistor | 99.33 | 95.63 | 82.00 | |
| wood | 99.65 | 97.01 | 96.40 | |
| zipper | 99.84 | 98.96 | 96.79 | |
| VisA | candle | 99.05 | 99.66 | 97.35 |
| capsules | 99.98 | 99.48 | 98.52 | |
| cashew | 99.76 | 99.06 | 95.79 |
| dataset | category | I (O) | P | PRO |
|---|---|---|---|---|
| chewinggum | 99.96 | 99.49 | 93.31 | |
| fryum | 99.56 | 96.35 | 92.52 | |
| macaroni1 | 100.00 | 99.81 | 97.12 | |
| macaroni2 | 98.60 | 99.86 | 98.75 | |
| pcb1 | 99.34 | 99.73 | 97.42 | |
| pcb2 | 99.01 | 99.45 | 94.81 | |
| pcb3 | 99.11 | 99.49 | 95.59 | |
| pcb4 | 98.62 | 98.98 | 94.86 | |
| pipe_fryum | 100.00 | 99.20 | 97.36 | |
| Real-IAD | audiojack | 94.50 (94.28) | 99.74 | 97.92 |
| bottle_cap | 97.99 (98.84) | 99.89 | 98.84 | |
| button_battery | 94.10 (95.26) | 99.39 | 96.05 | |
| end_cap | 91.85 (95.74) | 99.69 | 98.78 | |
| eraser | 96.38 (96.87) | 99.86 | 99.15 | |
| fire_hood | 93.93 (95.87) | 99.73 | 96.91 | |
| mint | 85.98 (89.63) | 98.90 | 91.27 | |
| mounts | 87.78 (99.30) | 99.66 | 97.33 | |
| pcb | 93.49 (93.97) | 99.64 | 98.23 | |
| phone_battery | 95.35 (95.20) | 99.83 | 98.68 | |
| plastic_nut | 95.33 (98.56) | 99.89 | 99.46 | |
| plastic_plug | 93.83 (96.73) | 99.26 | 96.57 | |
| porcelain_doll | 92.55 (96.35) | 99.08 | 95.77 | |
| regulator | 92.12 (94.90) | 99.74 | 98.02 | |
| rolled_strip_base | 99.53 (99.43) | 99.86 | 99.31 | |
| sim_card_set | 96.56 (96.97) | 99.74 | 97.52 | |
| switch | 98.65 (99.33) | 98.87 | 98.68 | |
| tape | 98.65 (99.88) | 99.88 | 99.10 | |
| terminalblock | 98.71 (98.77) | 99.86 | 99.50 | |
| toothbrush | 87.76 (97.30) | 95.04 | 81.48 | |
| toy | 90.96 (91.42) | 95.68 | 93.05 | |
| toy_brick | 90.54 (91.51) | 98.67 | 89.18 | |
| transistor1 | 96.92 (99.14) | 99.55 | 98.20 | |
| u.block | 95.73 (98.63) | 99.75 | 98.22 | |
| usb | 95.12 (96.26) | 99.26 | 98.40 | |
| usb_adaptor | 91.71 (94.74) | 99.62 | 97.34 | |
| vcpill | 95.96 (99.06) | 99.22 | 93.42 | |
| wooden_beads | 94.11 (92.70) | 99.66 | 96.14 | |
| woodstick | 92.18 (91.23) | 99.67 | 96.88 | |
| zipper | 99.70 (99.97) | 99.24 | 98.19 |
References
[1] Nishant Suresh Aswani and Saif Eddin Jabari. Dynamic mode decomposition along depth in vision transformers. arXiv preprint arXiv:2605.07556, 2026. 2, 4
[2] Kilian Batzner, Lars Heckler, and Rebecca König. EfficientAD: Accurate visual anomaly detection at millisecond-level latencies. In IEEE Winter Conf. Appl. Comput. Vis. (WACV), pages 127–137, 2024. 3
[3] Paul Bergmann, Michael Fauser, David Sattlegger, and Carsten Steger. MVTec AD – a comprehensive real-world dataset for unsupervised anomaly detection. In CVPR, pages 9592–9600, 2019. 2, 6, 10
[4] Jakob Božič, Domen Tabernik, and Danijel Skočaj. Mixed supervision for surface-defect detection: From weakly to fully supervised learning. Computers in Industry, 129:103459, 2021. 7, 16
[5] Qiyu Chen, Huiyuan Luo, Chengkan Lv, and Zhengtao Zhang. A unified anomaly synthesis strategy with gradient ascent for industrial anomaly detection and localization. In ECCV, pages 37–54, 2024. 3, 10
[6] Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David K. Duvenaud. Neural ordinary differential equations. In Advances in Neural Information Processing Systems, 2018. 4
[7] Matthew J. Colbrook and Alex Townsend. Rigorous data-driven computation of spectral properties of koopman operators for dynamical systems. Communications on Pure and Applied Mathematics, 77(1):221–283, 2024. 4
[8] Alex Costanzino, Pierluigi Zama Ramirez, Giuseppe Lisanti, and Luigi Di Stefano. Learning to be a transformer to pinpoint anomalies. IEEE Access, 13:109624–109637, 2025. arXiv:2407.04092. 2
[9] Timothée Darcet, Maxime Oquab, Julien Mairal, and Piotr Bojanowski. Vision transformers need registers. In ICLR, 2024. 3
[10] Thomas Defard, Aleksandr Setkov, Angelique Loesch, and Romaric Audigier. PaDiM: A patch distribution modeling framework for anomaly detection and localization. In ICPR, pages 475–489, 2021. 3, 7, 10
[11] Hanqiu Deng and Xingyu Li. Anomaly detection via reverse distillation from one-class embedding. In CVPR, pages 9737–9746, 2022. 2, 7, 10
[12] Yihe Dong, Jean-Baptiste Cordonnier, and Andreas Loukas. Attention is not all you need: Pure attention loses rank doubly exponentially with depth. In Int. Conf. Mach. Learn. (ICML), pages 2793–2803, 2021. 2, 4
[13] Lei Fan, Dongdong Fan, Zhiguang Hu, Yiwen Ding, Donglin Di, Kai Yi, Maurice Pagnucco, and Yang Song. MANTA: A large-scale multi-view and visual-text anomaly detection dataset for tiny objects. In CVPR, pages 25518–25527, 2025. 10
[14] Denis Gudovskiy, Shun Ishizaka, and Kazuki Kozuka. CFLOW-AD: Real-time unsupervised anomaly detection with localization via conditional normalizing flows. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 98–107, 2022. 7
[15] Jia Guo, Shuai Lu, Lize Jia, Weihang Zhang, and Huiqi Li. ReContrast: Domain-specific anomaly detection via contrastive reconstruction. In NeurIPS, pages 10721–10740, 2023. 2, 9
[16] Jia Guo, Shuai Lu, Lei Fan, Zelin Li, Donglin Di, Yang Song, Weihang Zhang, Wenbing Zhu, Hong Yan, Fang Chen, Huiqi Li, and Hongen Liao. Dinomaly2: A unified framework for unsupervised image anomaly detection. arXiv preprint arXiv:2510.17611, 2025. 2, 10, 16
[17] Jia Guo, Shuai Lu, Weihang Zhang, Fang Chen, Huiqi Li, and Hongen Liao. Dinomaly: The less is more philosophy in multi-class unsupervised anomaly detection. In CVPR, pages 20405–20415, 2025. 2, 9, 10
[18] Eldad Haber and Lars Ruthotto. Stable architectures for deep neural networks. Inverse Problems, 34(1):014004, 2018. 4
[19] Haoyang He, Yuhu Bai, Jiangning Zhang, Qingdong He, Hongxu Chen, Zhenye Gan, Chengjie Wang, Xiangtai Li, Guanzhong Tian, and Lei Xie. MambaAD: Exploring state space models for multi-class unsupervised anomaly detection. In NeurIPS, pages 71162–71187, 2024. 2, 9
[20] Mozes Jacobs, Thomas Fel, Richard Hakim, Alessandra Brondetta, Demba Ba, and T. Andy Keller. Block-recurrent dynamics in vision transformers. arXiv preprint arXiv:2512.19941, 2025. 2, 4
[21] Stepan Jezek, Martin Jonak, Radim Burget, Pavel Dvorak, and Milos Skotak. Deep learning-based defect detection of metal parts: Evaluating current methods in complex conditions. In International Congress on Ultra Modern Telecommunications and Control Systems and Workshops (ICUMT), pages 66–71, 2021. 7, 16
[22] Xi Jiang, Jianlin Liu, Jinbao Wang, Qiang Nie, Kai Wu, Yong Liu, Chengjie Wang, and Feng Zheng. SoftPatch: Unsupervised anomaly detection with noisy data. In NeurIPS, pages 15433–15445, 2022. 7, 16
[23] Anantha Padmanaban Krishna Kumar. Mechanisms of non-monotonic scaling in vision transformers. arXiv preprint arXiv:2511.21635, 2025. 2, 4
[24] Chun-Liang Li, Kihyuk Sohn, Jinsung Yoon, and Tomas Pfister. CutPaste: Self-supervised learning for anomaly detection and localization. In CVPR, pages 9664–9674, 2021. 3, 10
[25] Zhikang Liu, Yiming Zhou, Yuansheng Xu, and Zilei Wang. SimpleNet: A simple network for image anomaly detection and localization. In CVPR, pages 20402–20411, 2023. 3, 7, 10
[26] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In ICLR, 2019. 3
[27] Pankaj Mishra, Riccardo Verk, Daniele Fornasier, Claudio Piciarelli, and Gian Luca Foresti. VT-ADL: A vision transformer network for image anomaly detection and localization. In IEEE International Symposium on Industrial Electronics (ISIE), pages 1–6, 2021. 7, 16
[28] Lorenzo Noci, Sotiris Anagnostidis, Luca Biggio, Antonio Orvieto, Sidak Pal Singh, and Aurélien Lucchi. Signal propagation in transformers: Theoretical perspectives and the role of rank collapse. In NeurIPS, pages 27198–27211, 2022. 2, 4
[29] Maxime Oquab, Timothée Darcet, Théo Moutakanni, Huy Vo, Marc Szafraniec, Vasil Khalidov, Pierre Fernandez, Daniel Haziza, Francisco Massa, Alaaeldin El-Nouby, Mahmoud Assran, Nicolas Ballas, Wojciech Galuba, Russell Howes, Po-Yao Huang, Shang-Wen Li, Ishan Misra, Michael Rabbat, Vasu Sharma, Gabriel Synnaeve, Hu Xu, Hervé Jégou, Julien Mairal, Patrick Labatut, Armand Joulin, and Piotr Bojanowski. DINOv2: Learning robust visual features without supervision. Transactions on Machine Learning Research, 2024. 3
[30] Vardan Papyan, X. Y. Han, and David L. Donoho. Prevalence of neural collapse during the terminal phase of deep learning training. Proceedings of the National Academy of Sciences, 117(40):24652–24663, 2020. 2, 4
[31] Christophe Patyn and Geert Deconinck. A concise introduction to Koopman operator theory and the Extended Dynamic Mode Decomposition. arXiv preprint arXiv:2410.02766, 2024. 4
[32] Mike Ranzinger, Greg Heinrich, Jan Kautz, and Pavlo Molchanov. AM-RADIO: Agglomerative vision foundation model – reduce all domains into one. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12490–12500, 2024. 7, 8
[33] Nikhila Ravi, Valentin Gabeur, Yuan-Ting Hu, Ronghang Hu, Chaitanya Ryali, Tengyu Ma, Haitham Khedr, Roman Rädle, Chloe Rolland, Laura Gustafson, Eric Mintun, Junting Pan, Kalyan Vasudev Alwala, Nicolas Carion, Chao-Yuan Wu, Ross Girshick, Piotr Dollár, and Christoph Feichtenhofer. SAM 2: Segment anything in images and videos. In ICLR, 2025. 6
[34] Karsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard Schölkopf, Thomas Brox, and Peter Gehler. Towards total recall in industrial anomaly detection. In CVPR, pages 14318–14328, 2022. 3, 7, 10
[35] Dmitriy Shopkhoev, Ammar Ali, Magaiuya Zhussip, Valentin Malykh, Stamatios Lefkimmiatis, Nikos Komodakis, and Sergey Zagoruyko. Replaceme: Network simplification via depth pruning and transformer block linearization. In NeurIPS, pages 22092–22122, 2025. 2, 4
[36] Chengjie Wang, Wenbing Zhu, Bin-Bin Gao, Zhenye Gan, Jiangning Zhang, Zhihao Gu, Shuguang Qian, Mingang Chen, and Lizhuang Ma. Real-IAD: A real-world multi-view dataset for benchmarking versatile industrial anomaly detection. In CVPR, pages 22883–22892, 2024. 2, 7, 10
[37] M. Wieler and T. Hahn. Weakly supervised learning for industrial optical inspection. DAGM Symposium, Competition Track, 2007. 7, 16
[38] Zhiyuan You, Lei Cui, Yujun Shen, Kai Yang, Xin Lu, Yu Zheng, and Xinyi Le. A unified model for multi-class anomaly detection. In NeurIPS, pages 4571–4584, 2022. 2, 7, 9
[39] Vitjan Zavrtanik, Matej Kristan, and Danijel Skočaj. DRAEM – a discriminatively trained reconstruction embedding for surface anomaly detection. In ICCV, pages 8330–8339, 2021. 3, 10
[40] Jiangning Zhang, Xuhai Chen, Yabiao Wang, Chengjie Wang, Yong Liu, Xiangtai Li, Ming-Hsuan Yang, and Dacheng Tao. Exploring plain ViT features for multi-class unsupervised visual anomaly detection. Computer Vision and Image Understanding, 253:104308, 2025. 2, 9
[41] Xuan Zhang, Shiyu Li, Xi Li, Ping Huang, Jiulong Shan, and Ting Chen. DeSTSeg: Segmentation guided denoising student-teacher for anomaly detection. In CVPR, pages 3914–3923, 2023. 2, 7, 10
[42] Yang Zou, Jongheon Jeong, Latha Pemula, Dongqing Zhang, and Onkar Dabeer. SPot-the-Difference self-supervised pre-training for anomaly detection and segmentation. In ECCV, pages 392–408, 2022. 2, 6, 10