StructCore: Structure-Aware Image-Level Scoring for Training-Free Unsupervised Anomaly Detection
Authors: Joongwon Chae, Lihui Luo, Yang Liu, Runming Wang, Dongmei Yu, Zeming Liang, Xi Yuan, Dayan Zhang, +3 more
Organizations: Tsinghua University Shenzhen International Graduate School, Shenzhen, China · Ratel Soft · Affiliated Fifth Hospital, Wenzhou Medical University, Wenzhou, Zhejiang, China · Chinese Medicine Guangdong Laboratory
Max pooling is the de facto standard for converting anomaly score maps into image-level decisions in memory-bank-based unsupervised anomaly detection (UAD). However, because it relies on a single extreme response, it discards most information about how anomaly evidence is distributed and structured across the image, often causing normal and anomalous scores to overlap. We propose StructCore, a training-free, structure-aware image-level scoring method that goes beyond max pooling. Given an anomaly score map, StructCore computes a low-dimensional structural descriptor phi(S) that captures distributional and spatial characteristics, and refines image-level scoring via a diagonal Mahalanobis calibration estimated from train-good samples, without modifying pixel-level localization. StructCore achieves image-level AUROC scores of 99.6% on MVTec AD and 98.4% on VisA, demonstrating robust image-level anomaly detection by exploiting structural signatures missed by max pooling.
Figures & tables
Figure 1: Overview of the StructCore framework. Normal images are encoded by a frozen DINOv2 ViT-B/14 backbone using multi-layer skip feature extraction. Patch features from multiple layers are concatenated and compressed via a fixed random projection, followed by greedy coreset selection to construct a category-specific memory bank. At inference time, an optional routing bank selects a relevant memory subset for efficient nearest-neighbor matching, producing an anomaly score map. While the base image-level score is obtained by conventional max pooling, StructCore augments it with a structure-aware score computed from a low-dimensional descriptor of the anomaly map, calibrated using statistics from train-good samples. StructCore refines image-level decisions without altering pixel-level localization.
Component
Setting
Backbone
DINOv2 ViT-B/14 (frozen)
Input
resize 448×448 , center-crop 392×392
Layers
skip5: [−1,−3,−6,−9,−12] (concat fusion)
Projection
fixed random projection to D=512 (RP-512)
Memory bank
coreset ratio = 1% (default), 10% (robustness)
Patch scoring
kNN k=5 , mean over neighbors (squared ℓ2 )
Table 1: Paper-default configuration. We use a 1% coreset by default and report 10% as a robustness check.
Figure 2: Base vs. hybrid image scores illustrating where StructCore changes the image-level decision. The x-axis is the base score Sbase=max(S) and the y-axis is the final score Shyb=Sbase+λautoDstruct . Points are colored by ground-truth label. Thresholds τbase and τhyb are set to the 99.5% quantile of train-good scores. Shaded cross-over regions mark samples whose decisions differ between Sbase and Shyb (counts are shown in each panel).
Dataset
Method
Backbone
I-AUROC
P-AUROC
MVTec-AD [ 1 ]
CFA [ 40 ]
WideResNet-50
99.2
98.2
PaDiM [ 7 ]
WideResNet-50
95.5
97.3
PatchCore (max pooling) [ 9 ]
WideResNet-50
98.9
98.1
PatchCore + StructCore (struct only)
WideResNet-50
99.1
98.1
PatchCore + StructCore (hybrid)
WideResNet-50
99.2
98.1
Ours (DINOv2, max pooling)
DINOv2 ViT-B/14 (skip-layer)
98.7
98.2
Table 2: Average performance (Mean) on MVTec-AD. Each entry reports I-AUROC / P-AUROC . Results are only comparable within each backbone group. CFA/PaDiM/PatchCore follow their standard WideResNet-50 settings, while our variants use a frozen DINOv2 ViT-B/14 backbone with skip-layer fusion. Within the DINOv2 group, Base denotes max pooling on the same anomaly maps, and Struct/Hybrid modify only the image-level scoring (pixel-level metrics remain unchanged). For PatchCore-based runs in this table, the coreset ratio is set to 1%. Best results are highlighted in bold within each backbone group.
Dataset
Method
Image-level
Pixel-level
AUPRO
I-AUROC
I-AP
I-F1-max
P-AUROC
P-AP
P-F1-max
MVTec-AD [ 1 ]
RD4AD [ 3 ]
94.6
96.5
95.2
96.1
48.6
53.8
91.1
SimpleNet [ 41 ]
95.3
98.4
95.8
96.9
45.9
49.7
86.5
DeSTSeg [ 42 ]
89.2
95.5
91.6
93.1
54.3
50.9
64.8
UniAD [ 43 ]
96.5
98.8
96.2
96.8
43.4
49.5
90.7
ReContrast [ 44 ]
98.3
99.4
97.6
97.1
60.2
61.5
93.2
Table 3: Performance (%) on MVTec-AD and VisA. Our StructCore results are reported with a 1% coreset. Best results are in bold.
Coreset
Extract (ms)
kNN (ms)
Post (ms)
Total (ms)
FPS
GPU peak (MB)
1%
9.60
0.20
0.32
10.12
98.85
2333
5%
9.68
0.68
0.31
10.67
93.71
2459
10%
9.73
1.29
0.27
11.30
88.53
2619
Table 4: Scalability with memory-bank size on MVTec AD (RTX 3090, batch=16). “Extract” includes DINOv2 feature extraction and random projection; “kNN” is FAISS search; “Post” includes Gaussian blur and StructCore scoring. Coreset ratio controls the memory-bank size.
ϕ(S)
Base
Hybrid
Δ
– (Base only)
98.68
–
–
{σS}
98.68
99.57
+0.89
{topk_meanr}
98.68
99.57
+0.88
{TV}
98.68
99.07
+0.38
{σS,topk_meanr}
98.68
99.66
+0.97
{σS,TV}
98.68
99.55
+0.87
Table 5: Ablation of ϕ(S) components on MVTec AD (mean I-AUROC, %). Base uses max pooling; Hybrid uses Shyb=Sbase+λautoDstruct . Δ denotes the improvement over Base.
Distance
MVTec AD (15)
VisA (12)
ℓ1 (std)
0.9965 ± 0.0057
0.9743 ± 0.0347
Diagonal Mahalanobis
0.9962 ± 0.0059
0.9837 ± 0.0319
Chebyshev (std)
0.9960 ± 0.0060
0.9842 ± 0.0293
Manhattan
0.9934 ± 0.0108
0.9789 ± 0.0339
Euclidean
0.9927 ± 0.0117
0.9767 ± 0.0349
Chebyshev
0.9922 ± 0.0123
0.9761 ± 0.0351
Table 6: Ablation of structural distance for computing Dstruct (mean image-level AUROC, mean ± std over categories). Standardized variants (suffix _std ) normalize each dimension of ϕ(S) by the train-good standard deviation.
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
Category
Base
{σS}
{topk_meanr}
{TV}
{σS,topk_meanr}
{σS,TV}
{topk_meanr,TV}
{σS,topk_meanr,TV}
Bottle
100.00
100.00
100.00
100.00
100.00
100.00
100.00
100.00
Cable
92.71
99.04
98.41
94.77
99.23
98.97
98.35
99.10
Capsule
95.81
98.52
98.21
98.88
98.28
98.60
98.32
98.40
Hazelnut
100.00
100.00
100.00
100.00
100.00
100.00
100.00
100.00
Metal Nut
100.00
100.00
100.00
99.76
100.00
99.90
100.00
100.00
Pill
98.06
99.15
99.59
98.28
99.32
99.35
99.59
99.56
Appendix
Table 7: Per-category structural feature ablation on MVTec AD (image-level AUROC, %). Columns show image-level scoring variants: Base is max pooling; others are Hybrid scores with the indicated ϕ(⋅)
Category
Base (Max)
Struct (Ours)
Hybrid (Ours)
Pixel-level Metrics
AUROC
AP
F1-max
AUROC
AP
F1-max
AUROC
AP
F1-max
AUROC
AP
F1-max
AUPRO
Bottle
100.0
100.0
100.0
100.0
100.0
100.0
100.0
100.0
100.0
98.8
86.1
81.5
95.9
Cable
97.7
98.7
93.9
99.4
99.7
97.3
99.5
99.7
97.2
94.5
52.6
62.5
88.0
Capsule
95.6
99.0
96.8
97.8
99.4
98.6
97.8
99.5
98.2
98.3
59.7
56.8
94.5
Carpet
100.0
100.0
100.0
100.0
100.0
100.0
100.0
100.0
100.0
99.3
73.4
70.4
97.8
Grid
99.9
100.0
99.1
99.9
100.0
99.1
100.0
100.0
100.0
99.6
61.9
61.5
98.6
Appendix
Table 8: Detailed per-category performance on MVTec AD (1% coreset) . Best Image-level AUROC is highlighted in bold .
Category
Base (Max)
Struct (Ours)
Hybrid (Ours)
Pixel-level Metrics
AUROC
AP
F1-max
AUROC
AP
F1-max
AUROC
AP
F1-max
AUROC
AP
F1-max
AUPRO
Bottle
100.0
100.0
100.0
100.0
100.0
100.0
100.0
100.0
100.0
99.0
87.1
81.0
96.5
Cable
97.4
98.5
93.1
99.7
99.8
98.4
99.8
99.9
98.4
95.4
53.5
63.3
89.4
Capsule
97.5
99.4
98.6
98.3
99.6
98.2
98.4
99.6
98.6
98.6
61.0
58.1
95.5
Carpet
100.0
100.0
100.0
100.0
100.0
100.0
100.0
100.0
100.0
99.4
74.4
70.9
97.9
Grid
99.2
99.7
99.1
99.9
100.0
99.1
99.8
99.9
99.1
99.6
63.7
63.5
98.7
Appendix
Table 9: Detailed per-category performance on MVTec AD (10% coreset) .
Category
Base (Max)
Struct (Ours)
Hybrid (Ours)
Pixel-level Metrics
AUROC
AP
F1-max
AUROC
AP
F1-max
AUROC
AP
F1-max
AUROC
AP
F1-max
AUPRO
Candle
96.7
97.0
89.7
98.4
98.4
93.8
98.2
98.3
92.9
99.4
39.4
45.6
98.2
Capsules
98.9
99.4
96.5
96.8
97.8
93.8
98.6
99.1
97.5
99.3
62.9
64.0
97.7
Cashew
94.2
97.3
90.8
98.1
99.0
96.6
98.2
99.1
95.2
96.9
58.4
59.3
91.1
Chewinggum
99.4
99.7
98.0
99.3
99.7
99.0
99.6
99.8
99.0
99.4
75.6
69.8
98.1
Fryum
98.6
99.3
95.3
98.1
99.1
94.9
98.6
99.4
95.8
95.2
43.2
49.5
85.2
Appendix
Table 10: Detailed per-category performance on VisA (1% coreset) .
Category
Base (Max)
Struct (Ours)
Hybrid (Ours)
Pixel-level Metrics
AUROC
AP
F1-max
AUROC
AP
F1-max
AUROC
AP
F1-max
AUROC
AP
F1-max
AUPRO
Candle
96.3
96.7
90.9
97.9
98.0
93.5
97.9
98.0
92.8
99.6
40.6
47.4
98.6
Capsules
99.3
99.6
97.5
97.0
98.0
95.0
98.5
98.8
98.0
99.5
63.8
63.9
98.3
Cashew
96.6
98.3
94.0
98.2
99.0
97.6
98.6
99.2
97.5
93.7
52.2
55.6
83.7
Chewinggum
99.4
99.7
98.5
99.1
99.6
98.5
99.4
99.8
99.0
99.3
77.7
71.7
98.0
Fryum
99.1
99.6
96.6
97.8
98.9
96.0
99.1
99.6
96.5
95.7
43.3
48.8
86.1
Appendix
Table 11: Detailed per-category performance on VisA (10% coreset) .
Layer idx
MVTec (15)
VisA (12)
-1
98.58
80.75
-2
98.61
92.97
-3
98.78
95.91
-4
98.94
97.11
-5
98.94
96.65
-6
98.86
97.00
Appendix
Table 12: Single-layer depth sweep on MVTec AD and VisA. All settings are fixed: RP dim=256, k =5, with the indicated ϕ(⋅) Images are resized to 448 and center-cropped to 392. We report image-level AUROC (%).
Figure 3: Qualitative results on MVTec AD (all categories).
Figure 4: Qualitative results on VisA (all categories).
Tsinghua University Shenzhen International Graduate School, Shenzhen, China · Affiliated Fifth Hospital, Wenzhou Medical University, Wenzhou, Zhejiang, China · Chinese Medicine Guangdong Laboratory +1