Papers
Topics
Authors
Recent
Search
2000 character limit reached

StructCore: Structure-Aware Anomaly Detection

Updated 5 July 2026
  • 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 SRH×WS \in \mathbb{R}^{H \times W}, it computes a low-dimensional structural descriptor ϕ(S)R3\phi(S) \in \mathbb{R}^3 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 99.6%99.6\% on MVTec AD and 98.4%98.4\% 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 SS. In the base pipeline described for StructCore, if zpRDz_p \in \mathbb{R}^D is a patch feature and Mc^={mp,i}\mathbf{M}_{\hat{c}} = \{m_{p,i}\} is the memory bank, the patch score is

sp=1ki=1kzpmp,i22.s_p = \frac{1}{k} \sum_{i=1}^{k} \left\lVert z_p - m_{p,i} \right\rVert_2^2.

Collecting all patch scores yields

SRH×W,sRHW,S \in \mathbb{R}^{H \times W}, \qquad s \in \mathbb{R}^{HW},

where ss is the flattened map.

The standard image-level aggregation rule is max pooling,

ϕ(S)R3\phi(S) \in \mathbb{R}^30

and the corresponding base score is

ϕ(S)R3\phi(S) \in \mathbb{R}^31

with ϕ(S)R3\phi(S) \in \mathbb{R}^32 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

ϕ(S)R3\phi(S) \in \mathbb{R}^33

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,

ϕ(S)R3\phi(S) \in \mathbb{R}^34

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-ϕ(S)R3\phi(S) \in \mathbb{R}^35 scores at a fixed ratio ϕ(S)R3\phi(S) \in \mathbb{R}^36, with default ϕ(S)R3\phi(S) \in \mathbb{R}^37, so ϕ(S)R3\phi(S) \in \mathbb{R}^38: ϕ(S)R3\phi(S) \in \mathbb{R}^39 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,

99.6%99.6\%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 99.6%99.6\%1 on train-good anomaly maps and estimates a mean vector 99.6%99.6\%2 and per-dimension standard deviation vector 99.6%99.6\%3: 99.6%99.6\%4

At test time, StructCore computes a diagonal Mahalanobis distance,

99.6%99.6\%5

where division is elementwise and 99.6%99.6\%6 is a small constant for numerical stability. Equivalently, each descriptor component is z-scored and the resulting standardized vector is measured with an 99.6%99.6\%7 norm.

The paper description explicitly motivates the diagonal choice rather than a full 99.6%99.6\%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

99.6%99.6\%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 98.4%98.4\%0 is

98.4%98.4\%1

Because 98.4%98.4\%2 and 98.4%98.4\%3 live on different numerical scales, StructCore uses automatic scale matching. Let 98.4%98.4\%4 and 98.4%98.4\%5 be their train-good standard deviations. Then

98.4%98.4\%6

and the final hybrid score is

98.4%98.4\%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-98.4%98.4\%8 pooling averages over the largest 98.4%98.4\%9 values, but remains a single uncalibrated scalar. StructCore can be viewed as

SS0

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 SS1, estimates SS2, SS3, and SS4, and stores them per category. Online, one computes the usual anomaly map, forms SS5, evaluates SS6, and outputs SS7. 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 SS8 is part of the base pipeline before scoring, and the reported top-ratio is SS9 (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 zpRDz_p \in \mathbb{R}^D0 image-level AUROC. Adding only zpRDz_p \in \mathbb{R}^D1 gives zpRDz_p \in \mathbb{R}^D2, adding only zpRDz_p \in \mathbb{R}^D3 gives zpRDz_p \in \mathbb{R}^D4, adding only zpRDz_p \in \mathbb{R}^D5 gives zpRDz_p \in \mathbb{R}^D6, and using the full descriptor zpRDz_p \in \mathbb{R}^D7 yields zpRDz_p \in \mathbb{R}^D8. The description also states that zpRDz_p \in \mathbb{R}^D9 and top-1% individually give Mc^={mp,i}\mathbf{M}_{\hat{c}} = \{m_{p,i}\}0 to Mc^={mp,i}\mathbf{M}_{\hat{c}} = \{m_{p,i}\}1 I-AUROC improvement over base on MVTec, while TV alone helps less but complements the others. The combined gain is reported as approximately Mc^={mp,i}\mathbf{M}_{\hat{c}} = \{m_{p,i}\}2 I-AUROC.

The paper further compares different distance functions for Mc^={mp,i}\mathbf{M}_{\hat{c}} = \{m_{p,i}\}3. Standardized Mc^={mp,i}\mathbf{M}_{\hat{c}} = \{m_{p,i}\}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 Mc^={mp,i}\mathbf{M}_{\hat{c}} = \{m_{p,i}\}5 I-AUROC and Mc^={mp,i}\mathbf{M}_{\hat{c}} = \{m_{p,i}\}6 P-AUROC, while PatchCore plus StructCore reaches Mc^={mp,i}\mathbf{M}_{\hat{c}} = \{m_{p,i}\}7 I-AUROC and Mc^={mp,i}\mathbf{M}_{\hat{c}} = \{m_{p,i}\}8 P-AUROC. On DINOv2 ViT-B/14 skip-layer features, base performance is Mc^={mp,i}\mathbf{M}_{\hat{c}} = \{m_{p,i}\}9, struct-only is sp=1ki=1kzpmp,i22.s_p = \frac{1}{k} \sum_{i=1}^{k} \left\lVert z_p - m_{p,i} \right\rVert_2^2.0, and hybrid is sp=1ki=1kzpmp,i22.s_p = \frac{1}{k} \sum_{i=1}^{k} \left\lVert z_p - m_{p,i} \right\rVert_2^2.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 sp=1ki=1kzpmp,i22.s_p = \frac{1}{k} \sum_{i=1}^{k} \left\lVert z_p - m_{p,i} \right\rVert_2^2.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, sp=1ki=1kzpmp,i22.s_p = \frac{1}{k} \sum_{i=1}^{k} \left\lVert z_p - m_{p,i} \right\rVert_2^2.3 P-AUROC, sp=1ki=1kzpmp,i22.s_p = \frac{1}{k} \sum_{i=1}^{k} \left\lVert z_p - m_{p,i} \right\rVert_2^2.4 P-AP, sp=1ki=1kzpmp,i22.s_p = \frac{1}{k} \sum_{i=1}^{k} \left\lVert z_p - m_{p,i} \right\rVert_2^2.5 P-F1-max, and sp=1ki=1kzpmp,i22.s_p = \frac{1}{k} \sum_{i=1}^{k} \left\lVert z_p - m_{p,i} \right\rVert_2^2.6 AUPRO; on VisA, sp=1ki=1kzpmp,i22.s_p = \frac{1}{k} \sum_{i=1}^{k} \left\lVert z_p - m_{p,i} \right\rVert_2^2.7 P-AUROC, sp=1ki=1kzpmp,i22.s_p = \frac{1}{k} \sum_{i=1}^{k} \left\lVert z_p - m_{p,i} \right\rVert_2^2.8 P-AP, sp=1ki=1kzpmp,i22.s_p = \frac{1}{k} \sum_{i=1}^{k} \left\lVert z_p - m_{p,i} \right\rVert_2^2.9 P-F1-max, and SRH×W,sRHW,S \in \mathbb{R}^{H \times W}, \qquad s \in \mathbb{R}^{HW},0 AUPRO.

Per-category gains are strongest on difficult categories. On MVTec, Pill improves from SRH×W,sRHW,S \in \mathbb{R}^{H \times W}, \qquad s \in \mathbb{R}^{HW},1 to SRH×W,sRHW,S \in \mathbb{R}^{H \times W}, \qquad s \in \mathbb{R}^{HW},2, Screw from SRH×W,sRHW,S \in \mathbb{R}^{H \times W}, \qquad s \in \mathbb{R}^{HW},3 to SRH×W,sRHW,S \in \mathbb{R}^{H \times W}, \qquad s \in \mathbb{R}^{HW},4, Capsule from SRH×W,sRHW,S \in \mathbb{R}^{H \times W}, \qquad s \in \mathbb{R}^{HW},5 to SRH×W,sRHW,S \in \mathbb{R}^{H \times W}, \qquad s \in \mathbb{R}^{HW},6, and Cable from SRH×W,sRHW,S \in \mathbb{R}^{H \times W}, \qquad s \in \mathbb{R}^{HW},7 to SRH×W,sRHW,S \in \mathbb{R}^{H \times W}, \qquad s \in \mathbb{R}^{HW},8. On VisA, Cashew improves from SRH×W,sRHW,S \in \mathbb{R}^{H \times W}, \qquad s \in \mathbb{R}^{HW},9 to ss0 and PCB1 from ss1 to ss2. In categories where the base method is already near perfect, including Bottle, Hazelnut, and Leather, StructCore maintains ss3 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 ss4, and ss5 coreset, feature extraction costs approximately ss6 ms/image, kNN ss7 ms, and post-processing including Gaussian blur and StructCore scoring ss8 ms, for a total of approximately ss9 ms/image or about ϕ(S)R3\phi(S) \in \mathbb{R}^300 FPS. With ϕ(S)R3\phi(S) \in \mathbb{R}^301 coreset, kNN rises to ϕ(S)R3\phi(S) \in \mathbb{R}^302 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 ϕ(S)R3\phi(S) \in \mathbb{R}^303 to ϕ(S)R3\phi(S) \in \mathbb{R}^304 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).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to StructCore.