StructCore: Structure-Aware Anomaly Detection
- StructCore is a training-free, structure-aware approach designed for image-level anomaly detection in unsupervised settings.
- It replaces max pooling with a three-dimensional descriptor that captures score dispersion, tail concentration, and spatial roughness.
- Integrated as a drop-in module, StructCore boosts image-level AUROC on benchmarks like MVTec AD and VisA, while keeping pixel-level localization unchanged.
StructCore is a training-free, structure-aware image-level scoring method for unsupervised anomaly detection (UAD) that replaces max pooling as the map-to-score operator in memory-bank-based detectors without altering the underlying anomaly score map or the pixel-level localization pipeline. Given an anomaly map , it computes a low-dimensional structural descriptor that captures distributional and spatial characteristics, estimates train-good statistics for that descriptor, and produces a calibrated structural deviation score that can be combined with the conventional image-level score in a hybrid formulation. The method is designed as a drop-in module for pipelines such as PatchCore and, in the reported configuration, achieves image-level AUROC scores of on MVTec AD and on VisA while leaving pixel-level metrics unchanged (Chae et al., 19 Feb 2026).
1. Problem setting and the map-to-score bottleneck
In industrial visual inspection, UAD is typically posed as a one-class problem. Training uses only normal images of a given product category, whereas testing requires an image-level accept/reject decision and often pixel-level anomaly segmentation. Contemporary systems commonly use pretrained backbones such as DINOv2 ViT and are evaluated on benchmarks including MVTec AD and VisA with image-level AUROC and pixel-level AUROC as standard metrics.
A large family of practical UAD methods are memory-bank or retrieval-based methods, including SPADE, PaDiM, and PatchCore. Their standard pipeline extracts patch-level features with a frozen backbone, stores train-good patch features in a memory bank, computes nearest-neighbor-based patch anomaly scores at test time, and arranges those scores into a two-dimensional anomaly score map . In the base pipeline described for StructCore, if is a patch feature and is the memory bank, the patch score is
Collecting all patch scores yields
where is the flattened map.
The standard image-level aggregation rule is max pooling,
0
and the corresponding base score is
1
with 2 typically set to max pooling. The central limitation is that max pooling uses only one extreme value. It discards information about how many patches are anomalous, how scores are distributed, and how high-score regions are arranged spatially. The data explicitly notes that, with high-capacity backbones such as ViTs, normal images can contain spurious hot spots and real anomalies can manifest as broad but moderate score shifts rather than a single extreme spike. This suggests that the principal failure mode is not necessarily map quality but the lossy conversion from map to scalar (Chae et al., 19 Feb 2026).
2. Structural descriptor and structure-aware scoring
StructCore addresses this bottleneck by summarizing the anomaly map with a three-dimensional structural descriptor
3
Its three components are defined to capture global dispersion, tail concentration, and spatial roughness.
The first component is the standard deviation of the flattened score map,
4
This measures map heterogeneity. The supplied description states that anomalous images often increase dispersion because many high-score patches appear, whereas normal images tend to contain rare and isolated high responses.
The second component is the mean of the top-5 scores at a fixed ratio 6, with default 7, so 8: 9 This is a robust tail statistic: unlike the maximum, it reflects both the average magnitude and the extent of the extreme tail.
The third component is total variation,
0
with boundary handling as usual. Total variation measures spatial roughness: low TV corresponds to large smooth regions, while high TV corresponds to noisy and scattered responses.
The descriptor is intentionally minimal. No histograms, high-order moments, or connected-component analysis are used. This suggests that the method is deliberately positioned between scalar pooling rules and heavier spatial modeling: it preserves only the structural statistics that were empirically sufficient while keeping the added computation negligible (Chae et al., 19 Feb 2026).
3. Calibration by diagonal Mahalanobis distance
StructCore estimates train-good statistics category-wise. For each category, it computes 1 on train-good anomaly maps and estimates a mean vector 2 and per-dimension standard deviation vector 3: 4
At test time, StructCore computes a diagonal Mahalanobis distance,
5
where division is elementwise and 6 is a small constant for numerical stability. Equivalently, each descriptor component is z-scored and the resulting standardized vector is measured with an 7 norm.
The paper description explicitly motivates the diagonal choice rather than a full 8 covariance. With only three dimensions, the diagonal assumption captures scale differences, is numerically stable, and is easy to interpret. The struct-only image-level score is simply
9
This calibration step is the mechanism that makes the descriptor operational for anomaly detection. The raw descriptor components are not used as uncalibrated heuristics; instead, the method asks whether the current structural signature is atypical relative to the normal training distribution. A plausible implication is that the gain comes less from hand-crafted statistics per se than from transforming them into a category-specific deviation score anchored on train-good behavior (Chae et al., 19 Feb 2026).
4. Hybrid score, implementation pattern, and relation to pooling baselines
StructCore does not replace the anomaly map and does not modify patch-level localization. It replaces only the final image-level scalar. The base max-pooled score for an image 0 is
1
Because 2 and 3 live on different numerical scales, StructCore uses automatic scale matching. Let 4 and 5 be their train-good standard deviations. Then
6
and the final hybrid score is
7
Within the broader space of aggregation rules, max pooling is extremely simple and sensitive to small localized defects, but it is also sensitive to noise and spurious peaks. Average pooling uses all pixels but can drown small anomalies. Top-8 pooling averages over the largest 9 values, but remains a single uncalibrated scalar. StructCore can be viewed as
0
that is, max pooling plus a calibrated structural deviation. It therefore augments rather than replaces the standard extreme-value statistic.
The practical implementation pattern is correspondingly simple. Offline, one computes anomaly maps for train-good images, extracts 1, estimates 2, 3, and 4, and stores them per category. Online, one computes the usual anomaly map, forms 5, evaluates 6, and outputs 7. No extra gradient-based training is used, no labels beyond “normal” are required, and the same anomaly map can still be used for pixel-level segmentation. Optional Gaussian blur with 8 is part of the base pipeline before scoring, and the reported top-ratio is 9 (Chae et al., 19 Feb 2026).
5. Ablations, component roles, and compatibility with existing detectors
The reported ablations isolate the contribution of each structural component on MVTec AD. Using max pooling alone yields 0 image-level AUROC. Adding only 1 gives 2, adding only 3 gives 4, adding only 5 gives 6, and using the full descriptor 7 yields 8. The description also states that 9 and top-1% individually give 0 to 1 I-AUROC improvement over base on MVTec, while TV alone helps less but complements the others. The combined gain is reported as approximately 2 I-AUROC.
The paper further compares different distance functions for 3. Standardized 4, Chebyshev, and Mahalanobis all work similarly well on MVTec and VisA, whereas non-standardized distances are weaker. This indicates that the crucial ingredient is calibration with train-good statistics rather than the specific standardized metric.
StructCore is also presented as backbone-agnostic within the memory-bank-based setting. On PatchCore with WideResNet-50, base performance is 5 I-AUROC and 6 P-AUROC, while PatchCore plus StructCore reaches 7 I-AUROC and 8 P-AUROC. On DINOv2 ViT-B/14 skip-layer features, base performance is 9, struct-only is 0, and hybrid is 1, where the paired values denote image-level and pixel-level AUROC. The unchanged pixel metrics are central: StructCore modifies only image-level aggregation and leaves the localization map intact (Chae et al., 19 Feb 2026).
6. Experimental performance, robustness profile, and limitations
Using the default configuration of DINOv2 ViT-B/14, skip-layer features, and 2 coreset, StructCore Hybrid reports the following benchmark results.
| Dataset | Base image-level | StructCore Hybrid image-level |
|---|---|---|
| MVTec AD | 98.7 I-AUROC, 99.6 I-AP, 98.2 I-F1-max | 99.6 I-AUROC, 99.9 I-AP, 99.4 I-F1-max |
| VisA | 97.6 I-AUROC, 98.1 I-AP, 94.3 I-F1-max | 98.4 I-AUROC, 98.5 I-AP, 95.7 I-F1-max |
For both datasets, pixel-level metrics are reported as unchanged by StructCore: on MVTec AD, 3 P-AUROC, 4 P-AP, 5 P-F1-max, and 6 AUPRO; on VisA, 7 P-AUROC, 8 P-AP, 9 P-F1-max, and 0 AUPRO.
Per-category gains are strongest on difficult categories. On MVTec, Pill improves from 1 to 2, Screw from 3 to 4, Capsule from 5 to 6, and Cable from 7 to 8. On VisA, Cashew improves from 9 to 0 and PCB1 from 1 to 2. In categories where the base method is already near perfect, including Bottle, Hazelnut, and Leather, StructCore maintains 3 I-AUROC and does not degrade performance.
The description identifies the conditions in which StructCore is especially helpful: small but coherent anomalies, spatially distributed anomalies, and normal images with noisy spurious peaks. The qualitative interpretation is that some normal samples with high max scores move downward after structural calibration, while some anomalous samples with mediocre max scores move upward, reducing overlap between the two populations.
The runtime overhead is reported as negligible relative to feature extraction and kNN search. On MVTec AD with RTX 3090, batch size 4, and 5 coreset, feature extraction costs approximately 6 ms/image, kNN 7 ms, and post-processing including Gaussian blur and StructCore scoring 8 ms, for a total of approximately 9 ms/image or about 00 FPS. With 01 coreset, kNN rises to 02 ms while StructCore’s cost remains tiny.
The method’s limitations are explicit. It targets image-level scoring only and does not improve pixel-level localization. Its descriptor is intentionally minimal; richer spatial descriptors such as connected components, shape statistics, or multi-scale structure might capture additional information at higher complexity. Calibration is performed per category, so multi-category deployment requires routing to the appropriate memory bank and calibration parameters. Finally, a few categories show small decreases of approximately 03 to 04 AUROC, indicating that structural calibration is not uniformly beneficial in every setting even though the mean performance improves and worst-case category performance rises substantially. The paper points to richer low-cost structural descriptors, joint optimization of map generation and structural scoring, and extension to reconstruction-based or flow-based anomaly detection as future directions (Chae et al., 19 Feb 2026).