CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Authors: Zhe Zhang
Mingxiu Cai
Hanxiao Wang
Gaochang Wu
Tianyou Chai
Xiatian Zhu
Venue: ICML 2025 poster (2025)
Keywords: Unsupervised anomaly detection
CostFilter-AD
3D matching cost volume
Generic post-processing
Primary area: applications->computer_vision
TL;DR: We introduce CostFilter-AD, a generic plug-in designed to reduce matching noise through cost filtering in unsupervised anomaly detection—a crucial challenge that impairs detection accuracy.

Abstract: Unsupervised anomaly detection (UAD) seeks to localize the anomaly mask of an input image with respect to normal samples.
Either by reconstructing normal counterparts (reconstruction-based) or by learning an image feature embedding space (embedding-based), existing approaches fundamentally rely on image-level or feature-level matching to derive anomaly scores. Often, such a matching process is inaccurate yet overlooked, leading to sub-optimal detection. To address this issue, we introduce the concept of cost filtering, borrowed from classical matching tasks, such as depth and flow estimation, into the UAD problem. We call this approach CostFilter-AD. Specifically, we first construct a matching cost volume between the input and normal samples, comprising two spatial dimensions and one matching dimension that encodes potential matches. To refine this, we propose a cost volume filtering network, guided by the input observation as an attention query across multiple feature layers, which effectively suppresses matching noise while preserving edge structures and capturing subtle anomalies. Designed as a generic post-processing plug-in, CostFilter-AD can be integrated with either reconstruction-based or embedding-based methods. Extensive experiments on MVTec-AD and VisA benchmarks validate the generic benefits of CostFilter-AD for both single- and multi-class UAD tasks. Code and models will be released at https://github.com/ZHE-SAPI/CostFilter-AD.

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Zhe Zhang' Mingxiu Cai Hanxiao Wang? 2 Gaochang Wu
Tianyou Chai Xiatian Zhu
Abstract
1. Introduction
Unsupervised anomaly detection (UAD) plays a critical role in industrial quality inspection (Wu al., 2024) by identify- ing anomalies at both image- and pixel-level using models trained solely on normal samples (Zhao, 2023; Chen et al., 2025). Being able to handle the scarcity and diversity of anomalies, as well as address the long-tai tail distribution of rare anomaly types through anomaly synthesis (Zhao, 2022) have been favored in particular. Existing approaches pre- dominantly follow a "single model per category" paradigm (Liu et al., 2023; Zhang al., 2023; Chen et al., 2022), while effective, they often result in higher training costs and reduced scalability as anomaly categories expand. Thus, multi-class UAD with a unified model has emerged as a more scalable approach (Lu et al., 2023; He et al., 2024b; Yao et al., 2024). However, the inherent challenges of this task persist due to the diverse characteristics of anomalies across categories, particularly for subtle anomalies around small areas, with low contrast, or proximity to normals, making the unified detection extremely challenging.
Unsupervised anomaly detection (UAD) seeks to localize the anomaly mask of an input image with respect to normal samples. Either by re- constructing normal counterparts (reconstruction- based) or by learning image feature embedding space (embedding-basedd existing approaches fundamentally rely on image-level or feature- level matching to derive anomaly scores. Of- ten, such a matching process inaccurate yet overlooked, leading to sub-optimal detection. To address this issue, we introduce the concept of cost filtering, borrowed from classical match- ing tasks, such depth and flow estimation, into the UAD problem. We call this approach CoxtFilter-AD. Specifically, we first construct a matching cost volume between the input and nor- mal samples, comprising two spatial dimensions and one matching dimension that encodes poten- tial matches. To refine this, propose cost volume filtering network, guided by the input observation as an attention query across multi- ple feature layers, which effectively suppresses matching noise while preserving edge structures and capturing subtle anomalies. Designed as a generic post-processing plug-in, CostFilter-AD can be integrated with either reconstruction-baser embedding- based methods. Extensive experi- ments on MVTec-AD and VisA benchmarks val- idate the generic benefits of CostFilter-Al AD for both single- and multi-class UAD tasks. Code and models will be relcased at https: //tp::://gtthb.. com/ //// SAP.---PPPPPP. htt.e/-saaa//csssrree--a--
Existing UAD methods can be broadly divided into two cate- gories in terms of model design. Reconstruction-bue based meth- ods detect anomalies by comparing residuals or similarities between inputs and their reconstructions. These methods focus on designing networks, such as UNet (Zhao, 2023), Transformer (Lu al., 2023), and Diffusion (Yao al., 2024), to address challenges like the "identical shortcut" is- sue and limited reconstruction capability (You et al., 2022). Such challenges often lead to reconstructions that either re- tain anomalies in a normal-like style or suffer from undesir- able spatial misalignments. On the other hand, embedding- based methods (Roth et al.. 2022; Damm al., 2025) oper- ate the assumption that models trained normal samples cannot effectively extract features deviating from the normal distribution. This enables these methods to separate anoma- lous features from normal clusters derived from pre-trained models. Both approaches typically incorporate synthetic anomalies (Zhao, 2022; Zhang et al., 2024; Chen et al., 2025) simulate real-world anomalies during training, en- abling unsupervised learning. In essence, deriving the final anomaly score map in both methods is about matching the input sample with templates (reconstructed or normal train- ing samples) at the image- or feature-level, with anomaly regions exhibiting relatively higher matching costs.
Sttte Key Laboratory Synthetical Automation for Process Industrics, Northeastemn University, Shenyang, China. M London, U.K. 'Surrey Institute for People-Centred Artificial Intelligence, and Centre for Vision, Speech and Signal Pro- cessing. University of Surrey, Guildford, U.K. Correspondence to: Gaochang Wu <wuge @ail. <<Eddyzzuxtt@ Saddyyzhuxt@gmailcoom. gmail.com>.
Xiatian Zhu
Proceedings of the 42nd International Conference Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Zipper
97-7 93.0
Blusy RiSeraapee
20.0
B4.3
EE0 100
Tile
80 Dy
$9.3
PCB
Febe
Casbewv
mhh577 92.5
85.51
m/h001 e:5
m:00 61
Image
Label
Glad
+Ows
Image level
Pixel level
A
+Ours
Image level
Pixel level
Figure 1. Comparison of multi-class UAD results. We present the visualization results and kernel density estimation curves (Parzen, 1962)
image- and pixel-level logits. Baseline results are highlighted yellow, while ours are shown green. Our model achieves superior performance by detecting anomalies with less noise and providing clearer distinction between normal and abnormal logits.
From a matching perspective, we observe that existing UAD methods often prioritize sample reconstruction, precise fea- ture learning, or the utilization of extensive feature banks, while neglecting the intrinsic noise with the matching re- sults. For instance, many approaches directly apply L2 norm (Lu et al., 2023; Li et al., 2024) or cosine similarity (He et al., 2024a;b; Damm et al., 2025; Yao et al., 2024) to compute anomaly score maps. Meanwhile, earlier methods like Draem (Zavrtanik et al., 2021) and JNLD (Zhao, 2022) rely on diseriminative networks that implicitly learn the matching process. However, as illustrated by the anomaly localization heatmaps and logits distributions in Fig. 1, such matching noise frequently blurs the boundaries between normal and anomalous regions, rendering simple threshold- ing of pixel- or image-level logits ineffective. This noise could arise from the unavoidable "identical shortcut" issue or the absence of ideal normal templates, or both (Cao et al., 2024). The significant yet overlooked impact of matching noise would hamper anomaly detection accuracy, especially for subtle or hard-to-detect anomalies.
Specifically, we utilize a pre-trained feature encoder to ex- tract multi-layer features from the input and templates, con- structing multi-layer matching cost volume through global matching across all pixels in the templates. This volume consists of two spatial dimensions, which localize elements in the input, and a matching dimension, which represents the matching scores. To refine this cost volume, we design a filtering network that progressively enhances anomaly detection in a coarse to fine manner. The refinement pro- cess leverages the integration of input image features and initial anomaly map
attention query, effectively suppressing matching noise while preserving edge struc- tures and capturing subtle anomalies. To further enhance the performance, we expand the matching range of the cost volume by incorporating multiple templates, including re- constructed normal images or normal samples from differ- ent views. Additionally, we design a class-aware adaptor that dynamically adjusts the segmentation loss using soft classification logits, prioritizing challenging samples and improving generalization across multiple classes.
Inspired by the concept of matching cost filtering (also known as cost volume filtering) from the fields like stereo matching (Hosni et al., 2012; Kendall et al., 2017), depth estimation (Kam et al., 2022). flow estimation (Gudovskiy al., 2022), and light field rendering (Wu al., 2025), reformulate anomaly detection as three-step paradigm: feature extraction, anomaly cost volume construction, and anomaly cost volume filtering. With this idea, we propose CostFilte-ADD, a generic post-processing plug-in for en- hancing the anomaly detection of both reconstruction- based and embedding-
Our contributions are as follows: (i) We rethink UAD via matching cost volume filtering to explicitly tackle the in- trinsic matching noise - an overlooked yet critical element with existing UAD methods. Under this perspective, we reformulate UAD with three-step pipeline: feature ex- traction, matching cost volume construction, and cost vol- ume filtering. (ii) We propose novel method, CostFilter- AD, characterized by employing multi-layer input observa- tions as attention queries to guide match denoising while preserving edge structures of subtle anomalies. Serving as a general plug-in, it can be seamlessly integrated with both reconstruction-based and embedding- methods. (iii) Extensive experiments show that our method achieves state-of-the the-a-r ahe performance under both multi-class and single-class UAD settings multiple benchmarks.
methods. Conceptually, we intro- duce matching cost volume address "what to match" and cost volume filtering network to address "how to fine," enabling adaptive noise suppression and more accurate matching between the input image and its corresponding templates.
2

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
(a) Input & Templates
(b) Feature extraction (c) Cast volume construction
(d) Cost volume filtering Detection result
3 x. M
X 3 3
2XCXX X xW
Irger
DI
Visualization
Reconstractrd tomplatios
Sampled templates
Feature encoder
Global similanity matching
Model
Seg
2
Imput
Similarit to abnormitty
Filtacing 3D U-Net
(DN) X xII W" A Anomaly cost volume
11 X W
II x W
Recon, besed
Embedd-basee
x
Class-aware adoptur
L H' x W"
Conv +NN
Motmul
Initial anomaly guddance
RCSA module
Ad
Projectors
Avgerage pooling
Sigmoid
Input feature guidance
Global min pooling
E Frozen
Visunlization of matching moise reduuction
(e) Dual-stream attention guidance
Concat
Figure Overview of our CostFilterADD We reformulate UAD as matching cost filtering process. (i) First, we employ a pre-trained encoder to extract features from both the imput image and the templates (reconstructed normal images randomly selected normal samples). (ii) Second, we construct an anomaly cost volume based on global similarity matching. (iii) Lastly, we learn a cost volume filtering network, guided by attention queries derived from the input features and an initial anomaly map, to refine the volume and generate the final detection results. (iv) Further, we integrate a class-aw aware adaptor to tackle class imbalance and enhance the ability to deal with multiple anomaly classes simultaneously.
2. Related Work
enhances feature representation via hierarchical vector quan- tization, and MambaAD (He et al., 2024a) employs a multi- scale decoder for better reconstruction. Despite these inno- vations, matching noise remains a critical but overlooked issue. To address this, we propose a novel patch-level match- ing cost volume filtering method that effectively reduces matching noise and refines anomaly detection, even when reconstructed images or feature embeddings are imperfect.
2.1. Unsupervised Anomaly Detection
UAD methods are broadly categorized as embedding-, reconstruction-, and synthesis-based methods (Cao et al., 2024). Embedding-baasee basedd methods utilize pre-trained mod- els for feature extraction, leveraging techniques like teacher- student networks (Deng & Li, 2022), distribution mod- eling (Defard et al., 2021; Li et al., 2023; Lee Choi, 2024), or memory banks (Roth et al., 2022; Bae et al., 2023), but often struggle with adaptability rare anoma- lies due reliance datasets like ImageNet (Deng al., 2009). Reconstruction-basse methods, including autoen- coders (Gong et al., 2019), GANs (Liang et al., 2023; Lv et al., 2024), transformers (You et al., 2022), diffusions (Zhang et al., 2023), and MoE (Meng et al., 2024), aim to rebuild normal patterns, but frequently contend with the "identical shorteut" issue. Synthesis-based methods gener- ate pixel- or feature-level pscudo anommales (Zhao, 2022: Chen et al., 2025) to approximate real-world distributions but remain constrained by domain gaps (Zhang et al., 2025; Wang et al., 2023). Additionally, discriminative networks (Zavrtanik et al., 2021; Zhao, 2023) compare image pairs to detect anomalies, yet matching noise remains unresolved.
2.2. Cost Volume Filtering in Vision Tasks
Cost volume filtering is a crucial technique in vision tasks, widely used to optimize local matching accuracy (Hosni et al., 2012). In stereo matching, cost volumes correlate left and right image features along the disparity dimension, cap- turing pixel-level similarities between two views (Kendall et al., 2017: Wang al., 2024). Similarly, in depth estima- tion,
volumes encode multi-view geometric relation- ships to produce accurate depth maps (Yang et al., 2021; Peng et al., 2022). When extended to motion analysis, opti- cal flow estimation employs cost volumes to represent pixel correspondences across consecutive frames, refining them to improve motion accuracy (Zhang et al., 2021; Garrepalli et al., 2023). These methods employ filtering to process the cost volume, refining matching correspondences and enhancing accuracy (Hosni et al., 2012).
Recent advancements in diffusion (He et al., 2024b) and foundation models (Caron et al., 2021) have greatly ad- vanced multi-class UAD. For instance, GLAD (Yao et al., 2024) enhances reconstruction with adaptive diffusion steps, while VPDM (Li et al., 2024) minimizes anomaly leak- age using vague prototypes. HVQ-Trans (Lu et al., 2023)
In this paper, we propose CostFilter-AD, a novel approach designed to refine feature matching between input and tem- plate images. Unlike prior works that focus exclusively on identifying similar patches for comparison (Lu et al., 2023;
3

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Yao al., 2024), our method captures anomaly awareness across diverse range of potential patches. Specifically, CostFilter-DD advances the SOTA approaches in two key ways: (i) by constructing a cost volume for anomaly detec- tion through pixel-wise matching across multiple templates, which enhances detection robustness; and (ii) by employing a cost volume filtering network that leverages multi-layer input observations guide noise suppression while preserv- ing critical edge information.
where eg is the noise predictor of the frozen diffusion model, and (ty is manually defined and inversely related to t.
Templates for embedding- baseed methods. The primary challenge of embedding -based methods lies in their sen- sitivity to feature matching noise, which arises from mis- alignments in size, texture, or views between the input and templates. Existing approaches (Roth al., 2022; Gu et al., 2023) tackle this problem by leveraging extensive memory banks search for suitable target templates. Alternatively, we redefine this challenge as a matching noise problem and propose solution that combines global matching with cost volume filtering. This approach enables us to use only a small number (N) of normal images as templates, effec- tively suppressing matching noise and eliminating the need for large memory banks.
3. Methodology
We reformulate anomaly detection as a three-step pipeline comprising image feature extraction, anomaly cost volume construction, and anomaly cost volume filtering, as illus- trated in Fig. 2. Given the absence of anomalous samples during unsupervised training, generate synthetic anoma- lous input images following the protocol outlined in GLAD (Yao et al., 2024). Similar to stereo matching and flow esti- mation tasks in computer vision, our method matches the input sample Is E R Hx3 (channel, height, and width) with its reconstructed normal image(s) or normal sample(s) from random views, as depicted in Fig. (a). For simplicity, refer to these reconstructed normal images and normal samples collectively Templates ZT. It is important to note that CostFilter-AD is designed to support matching single input sample with multiple templates.
3.1. Image Feature Extraction
We utilize the pre-trained DINO model (Caron et al., 2021) to extract image features from the input Is and templates Iy. This process generates a multi-layer input feature tensor Is E R xW' and N multi-layer template feature tensors fT of the same dimensions, as illustrated in Fig. 2 (b). Here, L represents the number of feature layers, C' denotes the feature channels, and H' and W' correspond to the spatial dimensions of the features.
Templates for reconstruction based methods. Recent ad- vancements have introduced Transformer- based methods (e.g., HQV-Trans (Lu et al., 2023)) and diffusion model- based methods (e.g., GLAD (Yao et al., 2024), DiAD (He et al., 2024b)) to reconstruct high-fidelity normal counter- parts for input samples. For Transformer- based reconstruc- tion methods, we set the number of templates N = 1.
3.2. Anomaly Cost Volume Construction
To ensure the generality of CostFilter-AD for both reconstruction-base and embedding- approaches, we perform global similarity matching across the spatial indices of each template feature. This process is defined as:
I' p v(j,,,11) = 11's11 11
(2)
Diffusion model-based reconstruction methods excel in multi-class UAD by using normal-style images from the final denoising step as templates for feature matching. How- ever, as shown in 1 they often suffer from matching noise (e.g. false negative/positive or blurry edges) due to imperfect reconstructions, reducing detection accuracy (see 6ig.6 for analysis). Frequency evolution (Yang et al., 2023) suggests that while the final denoising step is essential for fine-graie fine-grained detail, may introduce anomalies through the "identical shortcut." In contrast, intermediate reconstructions, which preserve low-frequency normal information, can offer complementary cues for capturing normal contours.
where f represents the feature vector at the i-th spatial index of the input image feature at layer E {1, L), fo.5d denotes the feature vector at the j-th spatial index of the n-th template feature (n E (1, NN) at layer I, and V E R Dx N (H(''x")) is the resulting similarity vol- ume with D = H' x W' denoting the matching dimension. Unlike methods that rely on local matching, such as using a single reference image or neirest- searches within memory bank, our approach performs global matching across all elements to comprehensively capture feature cor- relations, as illustrated in Fig. 2 (c).
To this end, during the training phase of CostFilter-AD, we sample N templates from different steps, including the final step. in the backward denoising process to enrich the feature representation. The reconstruction at step is:
Since a higher likelihood of anomalies in the input image is indicated by smaller similarity values, we convert the similarity volume into the desired anomaly cost volume C e
1
1,-00
(4e vI- ā. -,,, vor
C(j 1, = 1 V.i,n,,
(3)
4

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
where larger values indicate greater probability of anomaly presence. Furthermore, we merge the dimensions D and N into a single dimension since they both correspond to match- ing results. Additionally, we unfold and reformat H'W' into H' x W to represent the spatial dimensions, constructing an anomaly cost volume C' E (DDN)x H xw", Addition- ally, by applying global min pooling along the matching dimension of C. we obtain an initial multi-layer anomaly map M, which provides coarse estimation of anomalies.
formation and spatial resolution adjustment. This projector facilitates the concatenation (cat) of dual-stream guidance features with cost volume features along the channel dimen- sion. Additionally, a represents the sigmoid activation, conv denotes 3D convolution, while MP, AP, μ4, and max indicate global max pooling, global average pooling, channel-win mean, and channel max operations, respectively.
The inventiion-uuded features xt" are fed into the decoder layer-by- by-layer via skip connections, with dual-stream at- tention guidance further optimizing the decoding process. The detailed architecture of our RCSA module is illustrated in Fig. 5. In this way, the proposed dual-stream attention query guidance effectively strengthens global feature match- ing via residual channel attention and refines pixel-level anomaly localization via residual spatial attention, enabling progressive denoising and precise anomaly detection. More visualizations of the matching noise filtering are shown in Fig. 7 and Fig. 8.
3.3. Anomaly Cost Volume Filtering
Existing UAD methods often use a Gaussian filter to smooth anomaly score maps (Damm al., 2025; Yao al., 2024). However, shown in 1 these methods tend to pro- duce overly blurred results and fail to eliminate significant background noise. Instead of filtering the final score map, we propose filtering the intermediate anomaly cost volume using a 3D U-Net (Çiçek et al., 2016). This approach ef- fectively reduces matching noise while preserving the edge structures of subtle anomalies.
Class-aware adaptor. To enhance generalization across multiple anomaly classes, we propose a class-aware adaptor that dynamically guides the segmentation loss with sigmoid- activated soft logits. The adaptor aggregates deep cost vol- ume features via spatial average pooling and projects them onto multi-class classification logits via fully connected layer, enabling the segmentation head to prioritize challeng- ing samples and adapt to diverse anomaly characteristics.
Network input. As illustrated in Fig. 2 (d), the input to our 3D U-Net consists of the constructed anomaly matching cost volume C E (DN))XLXH xw", where the matching dimension DN corresponds to the channel dimension of the network, I. represents the depth dimension for capturing feature matching across multiple layers, and H' and W" are the spatial dimensions. Additionally, we incorporate the input feature fs and the initial anomaly map M as guidance for the filtering process.
3.4. Anomaly Detection Output Generation
As shown in Fig. 2 (d), following stereo matching (Wang et al., 2024), the filtered anomaly volume undergoes global min pooling along the matching dimension, followed by a convolutional layer and softmax to generate the normal- anomaly score map for localization, denoted as M softmax (conv(mi((z))) As for detection, the image-level score is the average of the top 250 values of the anomaly score map.
Dual-stream attention guidance. The anomaly cost vol- ume captures extensive global matching information for
anomaly detection but is prone to information loss and noise from reconstruction errors or feature misalignment (Fig. 6). To address this, we propose a dual-stream attention guid- ance mechanism (Fig. 2 (e)). The input image feature fs provides spatial guidance (SG) to preserve critical details like subtle anomaly edges, while the initial anomaly map M focuses the model's attention on matching dimensions (MG) most likely to detect anomalies. This approach en- ables the network to capture both global patterns and fine spatial anomaly details effectively.
3.5. Training and Inference
In this paper, we present our method as a plug-in solution for both reconstruction-basee and embedding- based methods. Anomaly volumes are constructed by matching input image features with outputs from frozen reconstruction models or features from randomly selected normal templates.
The dual-stream attention guidance is implemented via the residual channel-spatial attention (RCSA) module, inspired by (Woo et al., 2018) and integrated with residual connec- tions to retain subtle anomaly details, formulated as follows:
The matching cost filtering process is designed normal- abnormal segmentation task, where the generated anomaly score maps M are supposed to align with the synthesized anomaly masks M,. The training objective is defined as:
x¹ cat(æ;, (an(zi,h,MM h(M), ((F)),
29th = a (conv + cony of + 2/. (4)
CFocal (M,, (Ýx)) + LoE(Yo, Y) + + (Cson-lon (M, M.) + (ssM (5)
2/" (conv(cat(u(2?" max x."h + =f",
where x' denotes the anomaly cost volume feature at layer 1, processed by the guidance projector h for channel trans-
where Croca is the focal loss to addresses the normal-
5

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Table 1. Multi-class anomaly detectiio//occliiation results (image AUROC/pixel AUROC) on MVToc-AD. Models are evaluated across all categories without fine-tune tuninun with the best results highlighted in bold.
Category
PatchhCore
OmniAL
DiAD
VPDM
MambaaD
GLAD
GLAD+Ours HVQ Trans IVQ-Trans+Ours AnomalDF AnomalDF+Ours
Bottle
100 999.2 100 /99.2 99.7 98.4 100 / 99.6 100 /98.7 100 /98.4
99.8/97,
100 /98.3
100 /98.8
100 / /87.3
100 /99.1
Cable
95.6/93.6 98.2 94.8 / 96.8 97.8 / 98.1 98.8 /5.8 98.7
/9.4
98.0 96.3
99.0 98.1
99.8 /98.2
99.6 / 98.3
99.3 /98.1
Capsule
96.8 /8.0 95,20/955//// /9.9 89.0/ 97.1 97.0/ 98.8 94.4/ 98.4
96.5 66.5//9. 99.1
94.3 99.2
95.4 98.8
96.4 / 99.99
89.7 / 19.1
96,1 / 999.2
Hazelnut
99.3 9 (9..5 / 98.3 99.9/ / 98.7 100 /99.0 97.0/ 98.9
99.4 19.1
100 998.8
100 /99.2
99.9 / 99.6
100 /99.5
Object
Metal Nut
99.1 96.3 / 99.1 |9.1 97.3 98.9/ 96.0 99.9 96.7 99.9 /97.3
100 99.2
99.9 96.3
100 /97.9
100 / 196.7
100 /99.0
Pill
86.4 90.8 97.22/ (9.7 / 95.7 97.9 96.4 97.0 /9.4 94.4
/9.9
97.9/9788
95.8 19.1
96.9/96. /9.55
97.2 / 19.1
98.9 /98.4
Screw
94.2/ 98.9 88.0/ 98.0 90.7 97.9 95.5 / 99.3 94.7 /9.5 93.4 / 99.6
95.4 99.6
95.6 98.9
95.3 / 99.0
74.3 / 97.6
88.5/ /9.00
Toothbrush
100 99.88 100 /9.00 / 99.0 94.6 / 98.8 /9.0 99.7 / 99.2
99.7 99.1
93.6/ 98.6
100 /98,9
99.7 / 99.2
99.7 / 99.22
Transistor
98.9 / 92.3 93.8 / 93.3 99.8 / 95.1 99.7 / 97.9 100 /97.1 99.4/ 90.9
99.5 91.6
99.7 99.1
99.7 / 99.2
96.5 / 19588
97.8 97.5
Zipper
97.1 / 95.7 100 / /99.5 99.1 / 96.2 99.0 / 98.0 99.33 98.4 966.4 / 93.0
99.2 97.7
97.9 97.5
98.9 / 99.3
98.8 / 99.3
98.9 96.7
Carpet
97.0/ 98, / 991./99999999/ 98.6 100 / 98.88 99.8 /9.8 / 98.9
100 999
99.9/ 98.7
100 798.5
99.9 / 99.4
99.9 99.6
Texture
Grid
91.4 98.4 / 99.4 98.55 99.4498.55
96.6 98.6 98.0 100 999.2 95.1 / 98.1
100 999.5
97.0/97.0 97.0
09.3/98.3
98.2 / 997.8
100 999.5
Leather
100 / 99.2 99.0 99.3
99.8 99.3
100 98.8
99.2 100 99.4
99.7
100 /99.6
100 /98.8
100 999.3
100 / /99.7
100 /99.7
Tile
96.0 90.3 / 99.0 99.4 100 / 94.5
92.4
98.2 93.8 100 997.8
100 999.4
99.2
100 /95.0
100 198.5
100 /99.6
Wood
93.8 90.8 93.2/ 97.4 99.7 / 93.3 98.2 / 95.3
98.8
94.4 95.4/ 96.8
97.4/
97.2/
98.5 /4.3
97.9 99.66
98.9/ /98.2
Mean
96.4/95.7 97.2 98.3 97.2 96.8 98.4 / 97.8
/ 97.7 99.33 98.7/98.2
/8.3
99.0/98.0
96.8 / 19.1
98.5 /8.88
anomaly imbalance, Lson--oo refines anomaly region local- ization, LSSIM preserves structural consistency, and Len enhances multi-class classification. Notably, the parameter y in Freaa is adjusted y = "Yo oYY)) when the adap- tor classifies correctly, and y "To otherwise. Thus, the class-aware adaptor modulates y via its predicted logits Y: to enhance multi-class segmentation.
anomaly detection, we report image-level AUROC (I- AUROC), AUPRC (I-AP), and Flmax (l-F) For anomaly localization, we employ pixel-level AUROC (P- AUROC), AUPRC (P-AP), Flmax (P-FImax), and Area Under the Per- Reeiie--ovvelllee Curve (AUPRO). In the main text, we primarily report image/pixel AUROC, while other metrics are detailed in the appendix.
The inference process similarly constructs and filters the matching cost volume, yielding anomaly map M. To inte- grate with the baseline response, we compute a weighted sum X AMM + (1 - A) Maasseine for anomaly localization and detection, where x E [0, 1] compensates for potential scale differences between the two components.
Implementation details. To validate our method as a plug- in solution, we integrate with three recent multi-class UAD methods: GLAD (Yao et al., 2024) (diffusion-based), HVQ- Trans (Lu et al., 2023) (transformer-basee) and AnomalDF (Damm et al., 2025) (embedding-basee
under the full-shot setting, with full access to the training data set. We adhere to the original settings for a fair comparison.
(i) Input images are resized to 256 x 256 for GLAD and AnomalDF, and 224 x 224 for HVQ-Trans. (ii) For the first two baselines, three templates (N 3) are randomly selected either from 25 diffusion denoising steps or the same-category training set. For HVQ-Trans, N = 1 as it does not reconstruct inter- mediates. (iii) In our setting, AnomalDF (+Ours) refers to variant of AnomalyDINO that dynamically samples tem- plates from the full training set for each input, in contrast to the original fixed few-shot protocol with a static tem- plate pool, thereby achieving a trade-off between template diversity and memory efficiency. (iv) Multi-layer features (L = 4) are extracted using pre-trained DINO (Caron et al., 2021) with V/T-B/8 for GLAD and AnomalDF, and a pre- trained EfficientNet-B4. (Tan & Le, 2021) for HVQ-Trans. (v) To reduce memory usage, the anomaly cost volume is trimmed to the top D smallest channels as input for the first two baselines, aligning with HVQ-Trans, where the volume inherently has D channels with single template. (vi) We train our models from scratch for 40 epochs with batch size of 8, using the Adam optimizer initialized with a learning rate of x 10 (vii) The loss weight a is set to 0.1 by default.
4. Experimental Evaluation
Datasets. (1) MVTec-AD (Bergmann et al., 2019) is a widely used dataset for evaluating UAD models in indus- trial applications. It comprises 5,324 high-resolution images across 10 objects and 5 texture categories. Each category provides anomaly-free training samples and test images with various surface defects. (2) VisA (Zou et al., 2022) is a large-scale dataset comprising 10,821 high-resolution images spanning 12 subsets, including 9,621 normal and 1,200 anomalous images. It covers a wide range of sur- face defects (e.g., dents, scratches, color spots, and cracks) as well as structural anomalies such as misalignment and missing components. (3) MPDD (Jezek et al., 2021) is a challenging dataset consisting of 1,346 images from 6 metal part categories. It includes 888 normal training samples and 458 test images, with pixel-level annotations for anomaly regions. (4) BTAD (Mishra et al., 2021) comprises 2,830 images from three industrial categories for UAD.
Evaluation metrics. For a comprehensive evaluation, we adopt widely used metrics following prior works. For
6

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Table 2. Multi-class anomaly detection/localizatioo results (image AUROC/pixel AUROC) on VisA. Models are evaluated across all categories without fine-tuniee tine-tunin, with the best results highlighted in bold.
Category
JNLD
OmniAL
DiAD
VPDM
[MambaAD|
GLAD
GLAD+Ours (LAD=Ouu/HVQ-Trmm TrQn- HVQ-Trans-Oury AnomalDF AnomalDF+Ous
Complex
Strieture
PCB1
82.9/ 9097999977.7771 77.7/ 98.1 98.2/99.6 95.4 99.8 69.9/97.6
95.1/ 90.9/97.7
96.3799 99.3
87.4/ 99.3
91.8/9.
PCB2
79.1/95.081.0/9.. 914/
99.8
98.9
89.9
93.2/ 99.7
93.4 98.1
97.0/ 98.0
81.9/ 99.2
95.7 /98.0
PCB3
90.1 /94.7 / 96.7
94.5 /9.77
93.77
93.3 96.2
90.5797,4
88.5 98.2
89.8 97.7
87.4/ 96.5
94.0/98.
PCB4
96.2/97.5 /97.1 0122/997.99.3/97111999
(9.6 /9.66/97.///9// 99,9
99.9 98.6
99.0 99.4
99.4 99.3
99.3 / 98.1
98.7/97.8
96.7 /97.3
98.1 /9.9
Multiple Inseances
Macammn1
90.5 09..9/..992./9/86666..
/ 99.6
/9.6 99.5
193. 999.9
96.0 99.9
88.7 999.
93.7 /9.4 99.4
88.0/ /9.2
95.3 95.3/99.9 /9.99
Macuroni2
75.2 71.3/92.1 / 85.7 99.0
81.6
99.5
74.5 /99.5
79.7 99.6
84.6 / 98.1
88.3 / 98.5
75.9 75.9/96.3 /6699
62.2/99.7
Capsules
91.499.6990 99.9
59.22 97.3 79.5
99.1
91.8 /9.1
88.8 39.3
89.1 /99.0
74.8 / 98.4
80.1 / 97.6
93.6/ /9.00
88.5 / /9866
Candles
85.4/
/18..///5888/99 9t./9//4.....8/9/99///////////// 97.3 997.2 99.4
99.8
99.0
886.4
98.88
90.5 98.8
95.6 / 99.1
97.8 / 99.2
90.3 / 16.1
95.1 / 99.4
Single Instance
Cashew
82.5 /0.09//8888/99.0000055//9000 90.99/0...99999.... 99.0
/4..5 94.3
92.6/ 86.2
95.7 /33.5
92.2 98.7
94.1 / 99.3
95.1 / /99.2
96.0 / 99.6
Chewing gum
96.0/ 01..9/999449999000
//t0///999644/999999///9/99/99/9 94.7
99.0 /9.66
98.1
98.0
/..0/999. 99.6
99.4/ 99.7
99.1 18.11
99.3 99.5
98.0/ 99.3
99.1 / /99.7
Fryum
99..9...09...9.2..2. 89.8/ 97.6 92.0 98.6
96.9
96.9
97.2 19.88 98.0 98.9
97.7/97.3 /97.
97.1
8
93.4/ 99.1
06.9/97.9
Pipe Fryum
87.5 92.5 86.1 / /6.2 99.4 98.8
99.4
/8.7 99.1
97.5 /9.3
96.6 99.5
98.0/99.1
99.1 / 19.7
Mean
88.1 /9.1 N7.1/95.//87.8/9966 01..2287..996666 /t1.://996668888///88// 96. 94.2 9
98.5
990 9974
93.2 99.1
98.5
/ 98.6
90.5 /9..5
94.3 /9.2
Table Multi-class UAD evaluation across additional baselines and benchmarks using seven metrics, reporting category-wise mean results for each benchmark.
Table 4. Extended studies on single-class UAD with our models.
Imuge-level
Pixel-level
Benchmark Method
AU-ROC AP Flmax AU-ROC
AP Flmax AUPRO
Benchmurk
Method
AU-ROC
Invee-level level
AP Flmax
AU-ROC
Pixel-level
AP Flmax AUPRO
MVD
+Ours
Glad
99.0
99.3
99.7
99.7 98.3
98.2
98.7
98.9
66.2
63.8
63.7
65.0
96.4
95.2
UniAD
97.5
99.1
97.0
96.9
44.5
50.5
90.6
Glad
99.3
99.6
97.6
98.3
35.8
42.4
94.1
MVTec-D
+Ours
99.0
99.7
98.1
97.5
60.5
59.9
91.3
VisA
+Owrs
99.5
99.7
98.1
98.6
37.3
45.3
94.5
Dinomaly
99.6
99.8
99.0
98.3
68.7
68.7
94.6
+Ouns
99.7
99.8
99.1
98.4
68.9
68.9
94.8
method surpasses baselines by 4.9% 2.3% and 188%/1.7% respectively. We attribute this to the method's effective mitigation of matching noise, critical yet often overlooked challenge that broadly exists in reconstruction- and embedding based methods. These results highlight its strong generalization and superior performance across di- verse anomaly classes.
UniAD
91.5
93.6
88.5
98.0
32.7
38.4
76.1
+Ouns
92.1
94.0
88.9
98.6
34.0
39.0
86.4
VisA
Dinomaly
98.7
98.9
96.1
98.7
52.5
55.4
94.5
+Ouss
98.7
99.0
96.3
98.8
53.2
55.8
94.7
IIVQ Trans
86.5
87.9
96.9
26.4
30.5
88.0
+Ouss
93.1
95.4
90.3
97.5
34.1
37.0
82.9
MPDD
Dinomaly
97.3
98.5
95.6
99.1
60.0
59.8
96.7
+Ouss
97.5
98.5
95.8
99.2
60.2
59.9
96.7
HVQ-Thee Trans
90.9
97.8
96.7
43.2
48.7
75.6
Multi-class UAD on ViSA. Due to its complex anomaly types and diversity of data distribution, VisA poses more challenges in terms of anomaly detection. Table 2 enu- merates the results comparison of our methods and recent methods Specifically, we outperform the three baselines by 3.1 %/0.7%, 2.1 %/0. 1%, and 1..%%/1.7% respectively, with more metrics that can be referred to in Table 13 and Table 16. These results also validate the effectiveness, generalizability, and robustness of our proposed method.
+Ouns
93.3
97.3
47.0
50.2
76.2
BTAD
Dinomaly
95.4
98.5
95.5
97.9
70.1
68.0
76.5
+Ours
95.5
98.6
95.8
98.1
74.3
69.8
77.5
4.1. Quantitative Comparison
We reproduced the results of UniAD (You et al., 2022), GLAD, HVQ-Trans, AnomalDF, and Dinomaly (Guo et al., 2025), and integrated our method into these multi-class UAD baselines to validate its effectiveness. Moreover, we conducted a comprehensive comparison with various ad- vanced methods, including synthetic-basse based JNLD (Zhao, 2022), CNN-based OmniAL. (Zhao, 2023), diffusion-based DiAD (He et al., 2024b) and VPDM (Li et al., 2024), and Manba-based MambaAD (He et al., 2024a).
Multi-class UAD across more baselines and benchmarks. To further assess the generalizability of our plug-in design, we evaluate CostFilter-AD AD on broader set of recent multi- class UAD baselines and benchmarks, using seven compre- hensive metrics at both image and pixel levels. As sum- marized in Table we present category-wist mean results for each benchmark provide an overall performance per- spective; detailed per-class metrics are available in Table 9 to Table 20. Our method consistently improves perfor- mance across all baselines, datasets, and evaluation dimen- sions. For example, when integrated with Dinomaly (Guo et al., 2025), CostFilter-AD achieves AUROC scores of 99.6% 5% (image/pixel) on MVTec-AD, 98.8%/98.8.
Multi-class UAD on MVTec-AD, As shown in Table 1, integrating our method yields significant AUROC improve- ments of 1. 1.2% for GLAD, 1.0%/0.7% for HVQ-Trans, and 1.7% for AnomalDF in image- and pixel-level detection, achieving sfate-of-the-an results. More metrics in Table 9 to Table 12 further validate its effectiveness. Notably, in texture anomalies like the grid category, our
7

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Table Ablation studies of Glad+Ours on MVTee-AD. - depth/channel" refers to mapping the matching dimension into the depth/channel dimension of the 3D U-Net. Co denotes the volume uisng the final denoising step, Cx-1 indicates uisng N 1 intermediate steps. SG and MG denote dual-stream attention guidance. CF is focal loss, LCE corresponds to the class-aware adaptor, and Ls is the combination of LSSIM and LSatt-koa
Table 6. Evaluation of our models on various anomaly volumes.
Test
MV
VisA
Train
Recon.
Embed.
Recon.
Embed.
Recon.
98.7 /98.2
97.5,/ /9..14
93.2 /98.1
92.6,/ /9.00
Embed.
94.5,,
98.5 /98.8
85.6. / 99699.
94.3 /99.2
DN- | depth
DN channel
Hybrid
/8.87/98.1
98.61 99.91
93.1 /98.21
92.9 /99.31
Cp
CCE
Ls
Results
Col
CN-1
SG
MG
rectly adhering to stereo matching methods designed for local pixel-level matching, results drop to $7.8%/89.0%% 98,,
87.8/89.0
96.2/96.8
/
96.7/97.3
likely due to feature contamination caused by global match- ing across multiple templates. In contrast, mapping the matching correspondence into the channel dimension boosts detection performance effectively. (ii) Using Co. which re- lies on the final denoised image as a template, achieves 96.2% /9.6%% while incorporating N - 1 randomly selected intermediate denoised images further improves performance by 0.5%/0.5%. (iii The proposed dual-stream attention guidance mechanism significantly enhances the filtering net- work's 's learning. SG boosts spatial anomaly attention to 97. /97.5%9 while the initial anomaly map-guided atten- tion (MG) further improves channel matching, achieving 18.3%/97.8%% (iv) Loss functions: Focal loss serves as a fundamental loss, while LCE improves performance to 98.5% 55.5%%/98.0% Structural similarity and soft-loU losses en- hance structural consistency, and joint optimization yields a peak performance of 99.99 79.7%%9992 Overall, these findings underscore the complementary roles of each component and loss function in enhancing anomaly detection and localiza- tion, ensuring robustness and precision.
97.8/97.5
/
98.3/97.8
V
98.5/98.0
98.4/97.6
98.7/98.2
on VisA, 97.4% on MPDD, and 95.8% I 1% BTAD. We attribute these consistent gains to its ability to effectively filter matching noise that is widespread yet often overlooked, while preserving subtle anomaly structures and features across a wide range of anomaly categories.
Single-class UAD using our unified multi-class model. We further explored the "single model per category" paradigm by applying our unified multi-class model to filter anomaly volumes generated by category-specific diffusion models in GLAD (Yao et al., 2024). Notably, GLAD also of- fers single-class diffusion models with an image resolution of 256 x 256, which were utilized in this analysis. For sim- plicity, we employ our unified model without additional fine- tuning, and without training separate model for each class. As shown in Table 4, our method consistently enhances class- mean performance in both image-level detection and lixel-level localization across two benchmarks.
4.4. Further Analysis
Compatibility exploration with different template types. Given that the templates for anomaly cost volume construc- tion in this paper can originate from either multi-step recon- structions or randomly selected normal images, we further investigated the compatibility of our method across these dif- ferent templates. Table 6 reveals an inevitable performance decline when our embedding- OnomalDF+Ours) processes reconstruction-bant based anomaly volumes (Recon, from Glad), and vice versa, due to dis- tinct feature distribution differences between two anomaly volume types, as analyzed in Fig. 1. To address this, we trained a unified model (Hybrid) using anomaly volumes alternately sourced from both template types. The results show that the hybrid model matches or even surpasses the performance of our models tailored to individual types, high- lighting the robustness and compatibility of our method to di tifferent template types across multi-class anomalies.
4.2. Qualitative Comparison
We conducted qualitative experiments on the MVTec-AD and VisA benchmarks to assess the performance of our method against existing baselines. As illustrated in Fig. 3, existing methods often struggle with significant matching noise, impairing anomaly localization accuracy. In contrast, our method effectively mitigates this issue, enabling precise anomaly segmentation. Additionally, the appendix provides supplementary visualizations, including progressive noise reduction, comparative anomaly localization results, and kernel density estimations for image- and pixel-level logits.
model (Embed, i.e.,
4.3. A Ablation Studies on Each Component and Losses
To evaluate the contributions of each component and loss term in our method, we conducted ablation studies on the MV benchmark using the Glad+Ours setting. Ta- ble highlights the following key findings: (i) When di-
Time and memory efficiency. Table 7 presents a compar- ative analysis of computational efficiency across multiple baselines, reporting parameter count, FL.OPs, memory con-
8

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Scrwer
Deppt
Toofhhashh
PY282 Pipaligum Oparie hww Nor
Monnez POB]
Image
Tabel
Glad
GeDuus
HVQ-T
H+Ours
Image
Tabe
Glrd
G+Ours
#+Ouus
AromalDF
+
Figure 3. Qualitative comparison of multi-class anomaly localization between our method and GLAD (G), HVQ-Trans (H), and AnomalDF (A) AD (top 3 rows) and VisA (bottom 3 rows). By integrating with existing methods, our approach effectively mitigates matching noise (e.g., false negatives in PCB2, false positives in Pill, and blurred boundaries in Carpet), enhancing anomaly detection.
MV
Vis4
Table Comprehensive comparison of baselines and + Ours in terms of parameter size (#Params), computational cost (FLOPs),
Macammi Chvodngggam
Collcc
memory usage (Mem.), and per-image inference time (Inf.).
Toothbnnh
Method
AParams
FLOPs
Mem. (GB) laf. (s/magge)
/ +Ours
7.7M/ +43.0M
008.0/++26000
4.53 +0.56 0.01 / /+0.04
Glad/+Ours
1.3B +43.8M
+32.7
8.79 /+2.07
30.67
Trendetor
HVQ-Trans/+Ours
18.0M/ +43.0M
7.4G/+26600
4.78/4099
0.05 /
AnomsiDF/+Ous
21.0M +43.8M
4.9G/ /32.77
3.25 +0.82
0.31 /+0.32
Dinenaly/+Ous
/+3.6M
J04.7G/+14.3G 4.32
0+.1/50.05
Image
Label
Belore filusing
Aller filtsing
Image
Becore filtrring
Alber filtring
sumption, and per-image inference latency. All measure- ments were obtained with batch size of 1 on A100 GPU (40 GB), both with and without our method. The results demonstrate that our plug-in consistently improves perfor- mance while introducing only reasonable memory overhead and modest computational cost. Notably, the increase in memory usage minimal, and the additional inference la- tency remains low, particularly when compared to diffusion- based approaches. Minor variations in #Params stem from projecting matching features with different channel dimen- sions (e.g.. 196, 768, 1024) into a unified 96-dimensional space. By maintaining architectural compatibility and low integration overhead, our method enables efficient and ac- curate anomaly detection and localization, reinforcing its applicability real-world deployment scenarios.
Figure 4. Failure cases on MVTec-AD and VisA. Some subtle anomalies may lead inaccurate missed localization, poten- tially due to limited representation in the constructed cost volume.
these cases, indicating promising direction for future work.
5. Conclusion
We propose CostFilter-AD as generic post-processing plug- in for both reconstruction and embedding, to address the matching noise in unsupervised anomaly detection (UAD), critical challenge hindering precise anomaly detection. By proposing anomaly cost volume filtering, we reformulate UAD as a three-step pipeline: feature extraction, anomaly cost volume construction, and cost volume filtering, which effectively mitigates matching noise caused by the "identical shortcut" issue and the misalignment noise. Concurrently, we propose a dual-stream attention guidance that enhances global feature matching and spatial anomaly refinement via residual channel-spatial attention module, enabling progressive denoising and accurate detection. Extensive ex- periments on MVTec-AD and VisA benchmarks show that CostFilter-AD achieves significant improvements with min- imal computational overhead, excelling in both multi-class and single-class UAD tasks. This work offers a scalable and precise solution for anomaly detection, underscoring its practical value for real- world applications.
4.5. Failure Case Analysis
As illustrated Fig. 4, we present representative failure cases from six categories in MVTec-AD and VisA, demon- strating the results of our method before and after filtering. While our method effectively suppresses the matching noise, it mainly relies on the presence of anomaly-relevant signals in the cost volume. To address situations where such signals are limited due to low-resolution inputs or insufficient fea- ture extraction, we introduce input image features for spatial guidance. Nevertheless, recovery remains challenging in

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Acknowledgements
Conference on Computer Vision, pp. 37-54. Springer, 2025.
This work supported in part by the Research Program of the Liaoning Liaohe Laboratory under Grant No. LLL23ZZ- 05-01, in part by the Natural Science Foundation of Liaon- ing Province of China under Grant No. 2024-MSBA-42, in part by the Key Research and Development Program of
Chen, Y., Tian, Y., Pang, G., and Carneiro, G. Deep one- class classification via interpolated gaussian descriptor. In Proceedings of the AAAI Conference Artificial In- telligence, volume 36, pp. 383-33333333 392, 2022.
Liaoning Province under Grant No. 2023JH26/10200011,
Çiçek, Ö., Abdulkadir, A., Lienkamp. S., Brox, T., and Ronneberger, O. 3d u-net: learning dense volumetric segmentation from sparse annotation. In Medical Image Computing and Computer-Assisted Intervention, pp. 424- 432. Springer, 2016.
in part by the Science and Technology Major Project of Liaoning Province under Grant No. [024JH1/11700045 in part by the Fundamental Research Funds for the Central Universities under Grant No. N25YJS002, in part by the Major Program of the National Natural Science Foundation of China (NSFC) under Grant No. 61991404 and in part by the Program of China Scholarship Council 202306080142.
Damm, S., Laszkiewicz, M., Lederer, J., and Fischer, A. Anomalydino: Boosting patch-based few-shot anomaly detection with dinov2. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 1-9, 2025.
Impact Statement
This paper presents work whose goal is advance unsuper- vised anomaly detection through CostFilter-AD, a generic post-processing plug-in designed to address matching noise, which is widely present in existing methods. We reformulate anomaly detection as a three-step pipeline: feature extrac- tion, cost volume construction, and cost volume filtering, providing a scalable and precise solution. There are many potential societal consequences of our work, none of which we feel must be specifically highlighted here.
Defard, T., Setkov, A., Loesch, A., and Audigier, R. Padim: a patch distribution modeling framework for anomaly detection and localization. In International Conference on Puttern Recognition, pp. 475-489. Springer, 2021.
Deng, H. and Li, X. Anomaly detection via reverse distil- lation from one-class embedding. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9737-9746, 2022.
References
Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. Imagenet: A large-scale hierarchical image database. 2009 IEEE conference on computer vision and pattern recognition, pp. 248-244-2 288-255. Icee. 2009.
Bae, J., Lee, J.-H., and Kim, S. Pni: industrial anomaly de- tection using position and neighborhood information. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 6373-6383, 2023.
Garrepalli, R., Jeong, J., Ravindran, R. C., Lin, J. M., and Porikli, F. Dift: Dynamic iterative field transforms for memory efficient optical flow. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2220-222022222 2229, 2023.
Bergmann, P., Fauser, M., Sattlegger, D., and Steger, C. Mvtec ad-a comprehensive real-world dataset for un- supervised anomaly detection. In Proceedings of the IEEE/CVF conference computer vision and pattern recognition, pp. 9592-9600, 2019.
Gong, D., Liu, L., Le, V., Saha, B., Mansour, M. R., Venkatesh, S., and Hengel, A. v. d. Memorizing normality to detect anomaly: Memory- augmented deep autoencoder for unsupervised anomaly detection. In P Proceedings of the IEEE/CVF international conference on computer vi- sion, pp. 1705-1714, 2019.
Cao. Y.. Xu, X., Zhang. J., Cheng, Y., Huang, X., Pang, G., and Shen, W. survey on visual anomaly detec- tion: Challenge, approach, and prospect. arXiv preprint arXiv:2401.16402, 2024.
Gu, Z., Liu, L., Chen, X., Yi, R., Zhang, J., Wang, Y., Wang. C., Shu, A., Jiang, G., and Ma, L. Remembering normality: Memory-guided knowledge distillation for unsupervised anomaly detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 16401-16409, 2023.
Caron, M., Touvron, H., Misra, I., Jégou, H., Mairal, J., Bojanowski, P., and Joulin, A. Emerging properties in self-supervised vision transformers. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9650 (6000966,,220 2021.
Chen, Q., Luo, H., Lv, C., and Zhang, Z. A unified anomaly synthesis strategy with gradient ascent for in- dustrial anomaly detection and localization. European
Gudovskiy, D., Ishizaka, S., and Kozuka, K. Cflow-ad: Real-time unsupervised anomaly detection with localiza- tion via conditional normalizing flows. In Proceedings
10

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 98-107, 2022.
Li, Y., Feng, Y., Chen, B., Chen, W., Wang. Y., Hu, X., Sun, B., Qu, C.,, and Zhou, M. Vague prototype-oriented diffusion model for multi-class anomaly detection. In In- ternttionll Conference on Machine Learning, pp. 27771- 27790. PMLR, 2024.
Guo, J., Lu, S., Zhang, W., Chen, F., Li, H., and Liao, H. Dinomaly: The less more philosophy in multi-class unsupervised anomaly detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1-11,2025,
Liang, Y., Zhang, J., Zhao, S., Wu, R., Liu, Y., and Pan, S. Omni-frequency channel-selectine representations for unsupervised anomaly detection. IEEE Transactions on Image Processing, pp. 4327-4340, 2023.
He, H., Bai, Y., Zhang, J., He, Q., Chen, H., Gan, Z.., Wang. C., Li, X.,, Tian, G., and Xie, L. Mambaad: Exploring state space models for multi-class unsupervised anomaly detection, arXiv preprint arXiv:2404.06564, 2024a.
Lin, T.-Y,, Goyal, P., Girshick, R., He, K., and Dollár, P. Focal loss for dense object detection. In Proceedings of the IEEE International Conference on Computer Vision pp. 2980-2988, 2017.
He, H., Zhang, J., Chen, H., Chen, X., Li, Z., Chen, X., Wang, Y., Wang, C., and Xie, I.. A diffusion-basee frame- work for multi-class anomaly detection. In Proceedings of the AAAI Conference on Artificial Intelligence, vol- ume 38, pp. 8472-8480 2024b.
Liu, Z., Zhou, Y., Xu, Y., and Wang. Z. Simplenet: A simple network for image anomaly detection and localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10400-200411 2023.
Hosni, A., Rhemann, C., Bleyer, M., Rother, C., and Gelautz, M. Fast cost-volume filtering for visual cor- respondence and beyond. IEEE transactions on pattern analysis and machine intelligence, 3542):004-511, 2012.
Lu, R., Wu, Y., Tian, L., Wang, D., Chen, B., Liu, X., and Hu, R. Hierarchical vector quantized transformer for multi-class unsupervised anomaly detection. Advances in Neural Information Processing Systems, 36:8487-8500, 2023.
Jezek, S., Jonak, M., Burget, R., Dvorak, P., and Skotak, M. Deep learning- bassdd defect detection of metal parts: eval- uating current methods in complex conditions. In 2021 13th International congress on ultra modern telecommu- nications and control systems and workshops, pp. 66-71. IEEE, 2021.
Lv, W. Su, Q. Wan, H., Xu, H.,, and Xu, W. Contamination- resilient anomaly detection via adversarial learning on partially-observed normal and anomalous data. In Inter- national Conference Machine Learning, pp. 33575- 33593, 2024.
Kam, J., Kim, J., Kim, S., Park, J., and Lee, S. Costdenet: Cost volume based depth completion for a single rgb-d image. In European Conference on Computer Vision, pp- 257-274. Springer, 2022.
Meng, S., Meng, W., Zhou, Q., Li, S., Hou, W., and He, S. Moead: parameter-efficient model for multi-class anomaly detection. In European Conference Computer Vision, pp. 345-361. Springer, 2024.
Kendall, A., Martirosyan, H., Dasgupta, S., Henry, P., Kennedy, R., Bachrach, A., and Bry, A. End-to-end learn- ing of geometry and context for deep stereo regression. In Proceedings of the IEEE international conference on computer vision, pp. 66 66-75, 2017.
Mishra, P., Verk, R., Fornasier, D., Piciarelli, C., and Foresti, G. L. Vt-adl: A vision transformer network for image anomaly detection and localization. In 202/ IEEE 30th International Symposium on Industrial Electronics, pp. 01-06. IEEF, 2021.
Krizhevsky, A., Sutskever, I., and Hinton, G. E. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25: 1097-1105, 2012.
Parzen, E. On estimation of probability density function and mode. The annals of mathematical statistics, 33(3): 1065-1076, 1962.
Lee, M. and Choi, J. Text-guided variational image genera- tion for industrial anomaly detection and segmentation. In Proceedings of the IEEE/CVF Conference on Com- puter Vision and Pattern Recognition, pp. 26519-26528, 2024.
Peng. R., Wang, R., Wang, Z., Lai, Y., and Wang, R. Re- thinking depth estimation for milti-view stereo: A uni- fied representation. In Proceedings of the IEEF/CVF conference on computer vision and pattern recognition, pp. 8645-8654, 2022.
Li, Y., Chen, W., Chen, B., Wang, D., Tian, L., and Zhou, M. Prototype-oriented unsupervised anomaly detection for multivariate time series. In International Conference on Machine Learning, pp. 19407-19424. PMI.R, 2023.
Rahman, M. A. and Wang. Y. Optimizing intersection-over union in deep neural networks for image segmentation. In International symposium on visual computing, pp. 234- 244. Springer, 2016

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Roth, K., Pemula, L.,, Zepeda, J., Schölkopf, B., Brox, T., and Gehler, P. Towards total recall in industrial anomaly detection, In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 14318- 14328, 2022.
You, Z.,, Cui, L., Shen, Y., Yang, K., Lu, X., Zheng, Y., and Le, X. A unified model for multi-class anomaly detection. Advances in Neural Information Processing Systems, 35: 4571 17744 2022.
Zavrtanik, V., Kristan, M., and Skočaj, D. Draem-a discrim- inatively trained reconstruction embedding for surface anomaly detection. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 8330- 8339, 2021.
Tan, M. and Le, Q. Efficientnetv2: Smaller models and faster training. In International Conference on Machine Learning, pp. 10196-10106. PMLR, 2021.
Wang, W., Zhang, Z., Huang, J., and Wu, G. Prototype pseudo denoising domain adaptation network for image classification. In 2023 5th International Conference on Industrial Artificial Intelligence (IAT), pp. 1-6, 2023.
Zhang. F., Woodford, O. J., Prisacariu, V. A., and Torr, P. H. Separable flow: Learning motion cost volumes for optical flow estimation. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 10807- 10817, 2021.
Wang, Y., Wang, L., Li, K., Zhang, Y., Wu, D. O., and Guo, Y. Cost volume aggregation in stereo matching revisited: A disparity classification perspective. IEEE Transactions on Image Processing, pp. 6425-6438, 2024.
Zhang, X., Li, N.,, Li, J., Dai, T.. Jiang, Y., and Xia, S.-T. Unsupervised surface anomaly detection with diffusion probabilistic model. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 6782- 6791, 2023.
Wang, Z., Bovik, A. C., Sheikh, H. R., and Simoncelli, E. Image quality assessment: from error visibility to struc- tural similarity. IEEE transactions on image processing, 13(4):600-612, 2004.
Zhang, X., Xu, M., and Zhou, X. Realnet: A feature selec- tion network with realistic synthetic anomaly for anomaly detection. In Proceedings of the IEEE/CVE Conference on Computer Vision and Pattern Recognition, pp. 16699 16708, 2024.
Woo, S., Park, J., Lee, J.-Y., and Kweon, I. S. Cbam: Convolutional block attention module. In Proceedings of the European conference on computer vision (ECCV), pp. 3-19, 2018
Zhang, Z., Wu, G., Zhang, J., Zhu, X., Tao, D., and Chai, T. Unified domain adaptive semantic segmentation. IEEE Transactions on Pattern Analysis and Machine Intelli- gence, 47(8)66731-6748 2025. doi: 10. 10.11090 109///AA. 2025.3562999.
Wu, G., Zhang, Y., Deng, L., Zhang, J., and Chai, T. Cross- modal learning for anomaly detection in complex indus- trial process: Methodology and benchmark. IEEE Trans- actions on Circuits and Systems for Video Technology, pp- 1-14, 2024.
Zhao, Y. Just noticeable learning for unsupervised anomaly localization and detection. In 2022 IEEE International Conference on Multimedia and Expo, pp. 01-06. IEBE, 2022.
Wu, G., Zhou, Y., Fang, L., Liu, Y., and Chai, T. Geo- ni: Geometry-awan neural interpolation for light field rendering. IEEE Transactions on Pattern Analysis and Machine Intelligence, pp. 1-16, 2025. doi: 10. 109/ 255..22025.355405....
Zhao, Y. Omnial: A unified cnn framework for unsupervised anomaly localization. In Proceedings of the IEEF/CVF Conference on Computer Vision and Pattern Recognition, pp. 3924-3933, 2023.
Yang, J.. Alvarez, J. M., and Liu, M. Self-supervised learn- ing of depth inference for multi-view stereo. In Proceed- ings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7526-7534, 2021.
Zhong, Y., Zhang, Z., and Wu, G. A semi-supervised learning-based dynamic prediction method for semi- molten condition of fused magnesium furnace. In 2022 4th International Conference on Industrial Artificial In- telligence (IAI), pp. 1-6, 2022. doi: 10.1 199/1//7755 2022.99766 997.9997
Yang, X., Zhou, D., Feng, J., and Wang, X. Diffusion probabilistic model made slim. In Proceedings of the IEEE/CVF Conference on computer vision and pattern recognition, pp. 22552-22562, 2023.
Zou, Y., Jeong, J., Pemula, L., Zhang, D., and Dabeer, O. Spot-the-difference self-supervised pre-training for anomaly detection and segmentation. In European Con- ference Computer Vision, pp. 392-408. Springer, 2022.
Yao, H., Liu, M., Yin, Z., Yan, Z., Hong, X., and Zuo, W. Glad: Towards better reconstruction with global and local adaptive difffusion models for unsupervised anomaly detection. In European Conference on Computer Vision pp. 1-17. Springer, 2024.
12

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Appendix Overview
This appendix provides supplementary insights supporting the main manuscript, organized as follows:
Sec. A provides more implementation details.
Sec. visualizes challenges in diffusion-basee reconstruction and advancements enabled by our method.
Sec. C visualizes the progressive reduction of matching noise by our CostFilter-DD model.
Sec. provides evaluations of CostFilter-AD under multiple original AnomalyDINO full-shot settings.
Sec. E showcases comprehensive qualitative results for each category on the MVTec-AD dataset.
Sec. F showcases comprehensive qualitative results for each category on the VisA dataset.
Sec. G reports comprehensive per-category quantitative results on the MVTec-AD dataset.
Sec. H reports comprehensive per-category quantitative results on the VisA dataset.
Sec. I reports comprehensive per-category quantitative results on the BTAD dataset.
Sec. J reports comprehensive per-category quantitative results on the MPDD dataset.
A. More Implementation Details.
(i) AnomalDD/AAno::DDE-O0 as AnomalDF, where "F" denotes the full-shot setting. AnomalDINO explores two experimental settings: few-shot and full-shot. The few-shot setting assumes access to only few fixed normal templates per category, whereas the full-shot setting constructs a big memory bank of all normal template features from the training set. However, this full-shot approach incurs more storage overhead.
In this paper, we refer to the full-shot version of AnomalDINO (Damm et al., 2025)
To address this, we optimize global feature matching and denoising by leveraging limited selection of normal templates. During training, AnomalDF (+Ours) uses fixed number (N = 3) of templates per input image, randomly sampled from the full training set for each input, rather than drawn from a fixed template set as in the original few-shot setting of AnomalyDINO. Our dynamic sampling ensures the template pool covers the full training distribution; thus, we classify it as full-shot, offering a trade-off between template diversity and memory efficiency. During testing, for fairness, we evaluate AnomalDF (+Ours) using our dynamic 3-shot sampling protocol, reflected in the results reported in our submission.
(ii) Training setup. We train with a batch size of B = 8 and employ a PeducceLROnPlateee learning rate by half when the loss stagnates, ensuring stable convergence. For Eq. 5, the class-aware adaptor is configured with n = 3. For a fair comparison, we adopt the baseline configurations. Specifically, for GLAD and AnomalDF, we extract features from the 3rd, 6th, 9th, and 12th layers of pre-trained DINO model (Caron et al., 202 I), while for HVQ-Trans, we leverage features from the 1st, 5th, 9th, and 21st layers of pre-trained EfficientNet-Be. (Tan & Le, 2021). In the fourth decoder layer of the filtering network, 3D convolution along the depth dimension condenses the matching cost volume from I. 4 1. The resulting feature representation is then used to generate the normal-anomaly score map in Section 3.4.
scheduler, which reduces the
Additionally, the M used in the loss function (Eq. 5) represents the anomaly score map. Moreover, Lrocal refers to Focal Loss (Lin et al.. 2017), where the parameter y modulates the model's emphasis on hard-to-classify samples. Lsott-to represents Soft Intersection-ove--nniiii Loss (Rahman & Wang, 2016), refining anomaly localization through loU optimization. LSSIM corresponds to Structural Similarity Index Loss (Wang et al., 2004), ensuring spatial structural consistency. Lastly, LcF denotes Cross-Entropy Loss (Krizhevsky al., 2012), enhancing multi-class classification by mitigating entropy-based uncertainty.
(iii) Evaluation protocol. We adopt standard practice for qualitative visualization by plotting the abnormal map logits of a single image to ensure clearer comparisons. For quantitative evaluation and KDE logit curve generation, we normalize the normal-abnormal map logits across all images within category, improving detection robustness and comparability.
(iv) Utilization of imput/reeonstructeed features reconstruction- based methods. For reconstruction based UAD methods such as HVQ-Trans, UniAD, and Dinomaly, we construct the cost volume directly using both the input and
13

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
M
Avgpool
M Mean
CDnv33 Relu CD
f.
C
Conv3D
50
Maxpool
Max
Matching Channel
Spatial Resolution
MT
Transformation
S1
djjustment
Projector
Channel Concat
Mul
Add
Sigmoid
Figure 5. Design of the Residual Channel-Spaticn Attention (RCSA) module for dual-stream feature guidance.
reconstructed features, without decoding them back to the image domain. This design is based on the fact that these methods already produce semantically meaningful representations in latent space. In other words, we leverage the multi-layer decoder features directly for cost volume construction, instead of relying on an external pre-trained encoder (e.g., DINO) as done in GLAD+Ours and Fnorsl))+Ours.
(v) Residual Channel-Spatial Attention (RCSA) module. Fig. 5 illustrates the RCSA module (Eq. 4), which gen- erates two attention tensors: a channel attention tensor of shape (B, C", 1, 1, and spatial attention tensor of shape (B, 1, D', H', W"), where D' represents the depth of features at each layer. These tensors refine feature representations across both matching and spatial dimensions. The RCSA module enhances global feature matching via residual channel attention and improves pixel-level anomaly localization through residual spatial attention. Notably, the residual connections preserve anomaly-relevant features, facilitating progressive denoising and precise anomaly detection.
B. Challenges in GLAD: Visual Analysis and Comparison with Our Method
As discussed in the main text, the final anomaly score map in Unsupervised Anomaly Detection (UAD) relies on matching the input sample with normal templates. Despite advancements, anomaly regions often retain elevated matching noise. This section identifies key challenges in reconstruction-basse methods.
(i) Asymmetry in multi-class reconstruction induces significant matching noise artifacts. As shown in Fig. 6 (a), a unified multi-class model must reconstruct diverse anomalies, frequently distorting shape, texture, or orientation, resulting in asymmetric feature matching and significant matching noise artifacts. This issue also prevalent in embedding- based methods (Roth al., 2022; Damm et al., 2025; Zhong et al., 2022). Our approach mitigates it by leveraging input feature guidance within dual-stream attention, guiding the filtering model to focus on spatial structures while preserving edge details. This effectively enhances anomaly localization, making it compatible with both reconstruction-bast based and embedding -bsed models.
(ii) The "identical shortcut" issue weakens anomaly residual signals. Reconstruction-bast methods suffer from anomaly information leakage, known as the identical shortcut issue, where anomalies persist in reconstructed outputs. As shown in Fig. 6 (b), a hazelnut's 's small-hole anomaly remains visible after reconstruction, weakening residual anomaly signals and hindering detection. In contrast, the intermediate outputs of the multi-step denoising process primarily reconstruct low-frequency features (Yang et al., 2023) (e.g., normal structures) at earlier stages. As the reconstruction progresses, the identical shorteut issue may gradually reintroduce anomalous information, making anomalies more apparent in later steps. Motivated by this observation, our matching cost volume and filtering network integrate multi-step reconstruction results, significantly enhancing anomaly detection.
(iii) Widespread noise interference in matching between templates and input images. As shown in Fig. 6(c), the matching process inevitably introduces noise, despite anomalies being reconstructed as normal. In contrast, our cost volume filtering network effectively suppresses these noise artifacts, enhancing anomaly region localization.
C. Progressive Matching Noise Suppression via CostFilter-AD
Beyond the visualized coarse-to-fine noise suppression in Fig. 2 (lower-left), additional results are presented in Fig. 7 and Fig. 8, illustrating spatial anomaly features extracted by RCSA modules across the first three encoder and last three decoder layers. Following channel and spatial attention refinement, the most anomaly-relevan channel-identiffee by the highest attention weight-is indexed. The selected features are then depth-wise aggregated into a score map of resolution H' x W'
14

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
(a)
More
Erron: High noise level
Reconstruction Misalignment.
(b)
More accurate.
Misclassifying normal as anome lous, vice versa: High noise level.
Idlnitialll shorkuls: Anomolous details gradually emerging denoising.
More eccurale:
Inevilably, balching noise persisls,
recorsacnt Normal details gradually emerging as demoising:
Image
Label
Heal Map
Score Map
Hool. Map
Score Map
Intermedialle denoising slaps
Fizul Stop
Glad-Ours
Glad
Glad Reconstructions
Figure 6. Visualization of challenges in the diffusion-hased reconstraction model GLAD (Yao et al., 2024) and advancements enabled by our approach.
Enc1
Enc2
Erc3
Dec2
Dec3
Deo4
Output
Enc1
Enc2
Enc3
Dec2
Dec3
Dec4
Output:
Figure Progressive noise mitigation coarse-to-fine anomaly localization across filtering network layers. The first row illustrates the anomaly image, ground truth, and three templates from either embedding- based (screw) or rcconstruction-basee (hazelnut) methods. The subsequent rows depict the corresponding anomaly score maps and localization heatmaps.
Encl
Enc2
Emc3
Dec2
Dec3
Dec4
Output
Enc1
Enc2
Enc3
Dec2
Dec3
Dec4
Output
Figure Progressive noise mitigation and coarse-to- soose-tt--inn to-fine anomaly localization across filtering network layers. The first row illustrates the anomaly image, ground truth, and three templates from either reconstruction-basee (screw) embedding -based (hazelnut) methods. The subsequent rows depict the corresponding anomaly score maps and localization heatmaps.
15

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Table AnomalDF vs. Onurs under comprchensive setting on MVTee-AD and VisA.
ID
Dataset
Method
Resize
Temples
I-AUROC
I-AP
I-Flmax
P-AUROC
P-AP
P-Flmax
P-AUPRO
AnomalDF
256
3
96.8
98.6
97.1
98.1
61.3
60.8
93.6
2
+Ours
256
3
98.5
99.4
97.8
98.8
67.8
64.9
94.2
AnomalDF
256
Full
99.0
99.3
98.4
97.5
58.7
91.7
4
+Ours
256
Full
99.3
99.8
98.6
98.9
68.7
65.5
96.6
MV
AnomalDr
448
Full
99.3
99.7
98.8
97.9
61.8
92.9
+Ours
448
Full
99.5
99.8
98.9
99.0
72.4
68.4
95.4
AnomalDF
672
Full
99.5
99.8
99.0
98.2
64.3
95.0
+Ours
672
Full
99.6
99.9
99.0
99.1
74.4
69.7
96.3
AnomalDF
256
3
90.5
91.4
86.2
97.4
39.6
40.4
86.3
10
+Ours
256
3
94.3
95.1
90.6
99.2
44.6
45.5
84.5
11
AnomalDF
256
Full
94.6
95.7
90.9
98.3
44.3
86.7
+Ours
256
Full
95.5
96.3
91.5
99.4
45.9
46.6
87.0
VisA
13
AnomalDF
448
Full
97.2
97.6
93.7
98.7
50.5
95.0
+Ours
448
Full
97.4
97.7
93.8
99.4
42.2
53.6
95.2
15
AnomalDF
672
Full
97.6
97.2
94.3
98.9
53.8
96.1
+Ours
672
Full
97.8
98.0
94.6
99.4
47.6
54.5
96.4
which is subsequently upsampled to generate layer-wise anomaly detection heatmaps.
Using the serew as an example, our filtering network iteratively refines anomaly localization, whether based on randomly sampled normal templates with diverse orientations multi-step denoised images from reconstruction models. This refinement progresses from global to local scale while systematically suppressing matching noise at each layer.
D. Evaluation Under the Original AnomalyDINo Full-shot Settings
In our main paper, An and AnomalDF+Ours were trained with randomly sampled reference templates per input and resolution of 256 256, and evaluated using similarly limited number of templates, offering a trade-off between template diversity and memory efficiency. Exp. ID 1, 2, 9, and 10 in Table report the corresponding results.
In contrast, the original full-shot setting of AnomalyDINO (Damm et al., 2025) utilizes the entire training set reference templates and resizes images to larger resolution. To ensure fair and thorough comparison, we further conducted evaluations under the original full-shot setting of AnomalyDINO, Exp. ID 3 to 8 and Exp. ID 11 to 16 in Table report results on MV and VisA, respectively. Notably, to mitigate storage and compute overhead, we directly reuse the models trained in Exp. ID and 10, and test them under different resolutions and template amounts, without additional retraining. Despite this constraint, CostFilter-AD consistently improved the performance of AnomalyDINO across various resolutions and datasets. Remarkably, our method lower resolution (e.g., 448 448) may match outperform the original AnomalDF baseline at higher resolution (e.g., 672 x 672), demonstrating its effectiveness. These results highlight the scalability and generalization capability of our plug-in method, even under varied operational constraints.
E. Expanded Qualitative Analysis of Our Multi-class UAD Models on MVTec-AD
To provide more comprehensive validation of our method, we present additional KDE (Kernel Density Estimation) curves (Parzen, 1962) illustrating the distribution anomaly detection logits across 15 categories in the MVTec-AD dataset, which serves supplementary analysis to Fig. 1. As shown in Fig. 9, the green curves represent the logits distribution of our method (along with the boxplot), while the yellow curves correspond to the baselines. In each KDE curve, the left peak represents the normal feature distribution, whereas the right peak corresponds to anomalous features. Greater peak separation and reduced distribution overlap signify enhanced anomaly separability, improving detection performance.
Furthermore, we visualize anomaly detection heatmaps for each category and compare them against the three baseline methods, as shown in Fig. 10. These visualizations provide compelling evidence the effectiveness of our approach.
16

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
F. Expanded Qualitative Analysis of Our Multi-class UAD Models on VisA
Similarly, we visualize the KDE (Kernel Density Estimation) curves (Parzen, 1962) of anomaly detection logits across 12 anomaly categories the VisA dataset (Fig. 11). Additionally, we present anomaly detection heatmaps for each category and evaluate them against three competitive baselines (Fig. 12). Results demonstrate that our approach attenuates prevalent matching noise in existing methods, while achieving precise pixel-level localization and accurate image-level anomaly detection, further validating its robustness and generalizability.
G. Comprehensive Quantitative Analysis of Our Multi-class UAD Models on MVTec-AD
Table 9 to Table presents the image-level detection and pixel-level localization performance of our multi-class model on 15 MVTec-AD anomaly categories. Our method consistently enhances the three latest baselines including UniAD (You al., 2022), GLAD (Yao et al., 2024), HVQ-Trans (Lu al., 2023), AnomalDF (Damm et al., 2025), and Dinomaly (Guo et al., 2025), which achieves new late-of-the-art results.
H. Comprehensive Quantitative Analysis of Our Multi-class UAD Models on VisA
Table 13 to Table 16 summarize image-level detection and pixel-level localization results for our multi-class model on 12 anomaly categories in the VisA dataset. Our method consistently demonstrates superior anomaly detection performance across various evaluated categories, outperforming five baselines and achieving SOTA results across multiple metrics.
Comprehensive Quantitative Analysis of Our Multi-class UAD Models on BTAD
Table 17 and Table 18 report image-level detection and pixel-level localization performance on the BTAD dataset, which includes three distinct anomaly categories. Results are shown for our proposed multi-class UAD model as well as two representative baselines: UniAD (You al., 2022) and Dinomaly (Guo et al., 2025).
J. Comprehensive Quantitative Analysis of Our Multi-class UAD Models on MPDD
Table 19 and Table 20 summarize the image- and pixel-level performance of our multi-class UAD model compared to UniAD (You et al., 2022) and Dinomaly (Guo et al., 2025) on the MPDD dataset, which contains six challenging anomaly categories.
Table Multi-class anomaly localization results on MVTec-AD using L-AUROC/P-UROC metrics. The best and second-best results are bolded and underlined, respectively.
Method
UniAD+Our
GLAD
GLAD+Ouss
HVQ-Trans
HVQ- OVO-Traa++Ous
AnomalDF
AsomaDDFOOrs
Dinomaly
Disomaly +Our
Categosy L
2e
Ours
ECCV'21
Ours
NeuIPS
Ours
WACV
Ours
CVPR'25
Ours
Bottle
99.7
100.0/
99.8/97.
100.0/96.1
100.0/ /9.33
100.0/
100.0/
100.0/
Cable
95.2/97.4
99.2/97.2
98.7/93.4
98.0 96.3
99.5 / 98.2
99.8/ 99.2
99.6/ 98.3
99.3/98.2
100.0 / 98.2
100.0 98.4
Capsule
93.4/%.7
96.7
96.5/99. /9..1
94.3/ /9.2
95.4/98.6
98.4
89.7/99 /991
96.1 99.2
27.9/ 98.7
98.2 98.8
Hazelout
100.0/ 98.1
100.0/90 98.5
97.0 98.9
99.4 99.1
99.9 99.88
100.0/ 99.2
99.9 99.6
100.0/ 99.5
1
100.0/ 09.5
Olijett
Metal Not
99.7
99.6/ 94.6
/9.9/97.3
100.0 99.2
100.0 196.2
100.0 /97.9
100.0 /9.77
100.0 19.0
190.0/97.0
100.0/ / 97.4
Pill 94.8/96.2
96.8/97.
94.5/979
99.9/97.5
96.7 197.2
96.9/96.5
97.2 96.7
98.9 / 98.4
99.2 97.8
99.2 97.8
Screw
91.7/98.8
95.1 /9877
93.4 99.6
95.4/ 99.6
95.8 98.4
99.3/
74.3
99.0
98.4 99.6
9886 99.7
Toothbeush
98.9
99.7
99.7 /9.1
/98.5
99.2
99.2 99.2
100.0
Transistor
99.5/98.0
99.8/99.
99.4 /9.99
99.5/911
100.0 /98.3
100.0 /97.1
96.5 95.8
97.8 /7.5
99.1 993.2
99.1 /93.3
Zipper
96.2/97.7
99.9/97.7
99.2/97.7
/8.9
96.7
100.0/ / 99.2
100.0
Carpet
99.8/96.4
99.9/ 98.4
97.2 98.9
100.0 / /99.]
99.9/ 19877
100.0 / /98.5
99.9/ 99.4
99.9/ 99.6
99.8/ 99.3
99.9
Toxtures
Grid
/977/997.
99.9 99.7
95.1
100.0 9995
99.4/99.3
17777
100.0 /99.5
99.77 999.4
99.5
Leather
100.0 798.7
100.0/ / 99.4
99.5 / 99.2
100.0 /99.6
100.0 /98.8
100.0 / /99.3
100.0 / 99.77
100.0 999.7
100.0 / 99.3
100.0 / 99.
Tile
99.5 99.5/918
100.0/
100.0 /97.8
100.0 /9..4
99.1 192.8
100.0 95.00
100.0 /98.5
100.0 /99.6
100.0/
100.0 9W.
Wood
98.5/93.1
98.9 91.0
95.4/99.3
97.4 98.2
97.6/97.4
98.5
98.0 98.
99.0/ 98.8
99.9 97.6
99.9 99.77
Mean
97.5 /96.9
99.0 /7.55
97.5/97.3
98.7/98.3
97.9
99.0
96.8/
98.5 988.8
99.6 98..3
99.7/ 98.4
17

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Image/Pixel AUROC of Ours
Image/Pixel AUROC of Baseline
Wood
96
Zipper
Bottle
Cable
30.7
Hazelnut
100
Metal Nut
Pill
Screw
Toothbrush
Transistor
Carpet
Grid
Leather
Tile
583
Capsule
98.5
528
B53
Image level
Pixel level
Image level
Pixel level
Image level Pixel level
Glad/ +0urs
HVQ-T 40urs
AnomalDF / +0urs
Figure Quantitative comparison MVTec-AD using KDE curves image- and pixel-level anomaly logits, Each two-column pair (from left to right) compares GLAD, HVQ-Trans, and A with our method, where the first and second columns show image- and pixel-level APROC, respectively.
18

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Wood
Zipper
Bottle
Cable
Hazelnut
Metal Nut
Pill
Screw
Toothbrush
PARR 4009
PARR
KREE
Transistor
Carpet
Grid
Leather
Tile
Capsule
Image
Label
Glad
+Ours
Image
Label
HVQ-T
+Ours
Image
Label AnomalDF +Owrs
Figure 10. Quantitative examples of anomaly localization on MVTec-AD. The comparison is divided into three groups, each following the same left-to-right order: input anomaly, ground truth mask, anomaly map predicted by GLAD, HVQ-Trans, AnomalDE, and the anomaly map obtained with our method integrated.
19

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Image/Pixel AUROC of Our
Image/Pixel AUROC of Baseline
PCB1
583
PCB2
PCB3
PCB4
31.
Macaroni1
266
Macaroni2
Capsules
17
ES1
Candles
Cashew
532
Chewing gum
925
Fryum
11.
59
365
Pipe Fryum
Image level
Pixel level
Image level
Pixel level
Image level
Pixel level
Glad/ +Ours
HVQ-T +Owrs
AnomalDF
Figure 11. Quantitative comparison on VisA using KDE curves of image- and pixel-level anomaly logits. Fach two-column pair (from left right) compares GLAD, HVQ-HTVQaa Trans, and AF with our method, where the first and second columns show image- and pixel-level APROC, respectively.
20

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
PCB1
PCB2
PCB3
PCB4
Macaroni1
Macaroni2
Capsules
Candles
Cashew
Chewing gum
Fryum
Pipe Fryum
Image
Label
Glad
+0urs
Image
Label
HVQ-T
+Ours
Image
Label F +0urs
Figure 12. Quantitative examples of anomaly localization on VisA. The comparison is divided into three groups, each following the same left-to-right order: input anomaly, ground truth mask, anomaly map predicted GLAD, HVQ-Trans, AnomalDE, and the anomaly map obtained with our method integrated.
21

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Table 10. Multi-class anomaly detection and localization results on MVTec-AD using I-AP/P-AP metries.
Method +
UniAD
UniAD+Ours
GLAD
GLAD4Ours
HVQ-Trass
HVQ--Tam+Ours
AnomalDF
AnomslDF+OOus
Dinonaly
Dinomuly
Calegory 1
22
Ours
BOCV'24
Ours
NewrIPS'23
Ours
WACV
Ours
CVPR
Ours
Bottle
100.0/ 66.4
100.0/ / 81.2
100.0/ / 90.9
100.0/ 79.2
100.0/ 73.9
100.0/
100.0/87.3
100,0/ 85.9
10000/ 88.
100.0 / 888/88
Cable
47.3
99,5
91.2
98.8 / 64.1
99.7 / 54.2
99.8 58.00
99.8 / 69.3
99.6/ 72.3
100.0 66.7
100.0 67.3
Capsule
98.4444.5
99.2
99.27
53.1
99.07
99.6
99.7
Hazelout
100.0/ 54.6
100.0/ 704
98.2/68.0
99.6/75.8
100.0 63.1
100.0 72.4
99.9 79.0
100.0 / 77.6
100.0/ /1.9
100.0/ M1.9
Obijcts
Metal Not
50.7
99.9
100.0
100.0/ 93.1
100.0/
100.0/ 79.0
100.0/ 78.6
100.0/
100,0/
100,0/
Pill
99.0 44.3
99.0
99.0 73.9
99.6 69.5
99.4/57.3
99.47 59.6
99.5 78.6
99.8 99.8/26.2
99.2 75.9
99.2/ 75.8
Screw
97.1/29.1
93.1
96.0/47.8
96.6 40.8
98.3//28.6
98.3 /3.55
88.0 12.5
96.3/ 9
99.9 75.9
99.9/ 75.8
Touthbrush
96.9/ 38.3
99.6
99.9
99.9
96.1 /40.0
100.0
99.9
99.9 44.0
100,0
100.0/ 52.8
Transistor
68.3
99.7 61.9
99.2
99.3 02.3/62.5 62.5
100.0 744.1
100.0 76.6
96.1 62.4
97.4/ 73.2
98.4
98.5/ 59.6
Zipper
99.5
66.5666.5
99.7//41.0
100.0/79.3
100.0/
Carpet
09.9/ 50.7
100.0/ 60.5
99.1 72.2
100.0 788.6
100.0 57.6
100.0 /64.7
100.0/ 76.2
100.0/ / 81.6
100,0/ 68.5
100.0/ 68.6
Textures
Grid
100.0
25.7/22500
99.9 54.5
100.0/
Leather
100.0 3324
100.0/ 66.1
99.8 61.7
100.0 62.5
100.0 734.5
100.0 747.4
100.0 /60.2
100.0 /6.
100.0/11.9
100.0 52.4
Tile
99.8/42.1
100.0 68.0
100.0 70.3
100.0 /92.2
99.6/
100.0 /.56.
100.0 /76.4
100.0 :96.0
100.0/ 78.6
100.0/ 79.3
Wood
99.6/
95.7
98.5 70.6
99.2 77.1
99.2 39.9
99.5 7.52.4
99.3 72.7
99.3 88.11
100.0/ 73.0
100.0 73.2
Mean
99.1
99.7 60.5
/8.8
99.6 7..6//66 66.8
99.3
99.27
98.6/61.3 61.3
99.4/ 67.8
99.8 68.7
99.8 68.9
Table II. Multi-class anomaly detection and localization results MVTec-AD using I-Flmax/P FeelmaxxPP-Flmann Flmmxx metrics.
Method
UniAD
UniAD4Currs
GLAD
GlADD+Ous
HVQ-Thass
HVQ--Tanss+Urs
AnomalDF
AnomalDFaOurs
Dinomaly
Dinomaly=Ours
Categosy L
22
Ours
ECCV'24
Ours
NeurIPS223
Ours
WACV'25
Ous
CVPR'25
Ours
Bottle
100.0/ 73.7
100.0/ 75.5
99.2
100.0
100.0/77.6
100.0/
100.0/
100.0
100.0
Cable
$9.9/55.4
/9.8
93.3/
95.2/60.5 60.5
97.8 / 60.8
98.1 /6300
97.8/67.0
97.9/66.2
99.5 69.1
99.6 69.8
Capsulo
18.2
53.6/
96.8/51.2
95.5/51.
/88.3
93.1/
94.3/48.9
96.1/50 50.3
97.3
Hazelnut
100.0 $5.9
100.0/ 67.8
94.4/63.
97.2/69.
99.3 / 63.1
99.3/ 70.8
100.0/ 25.5
100.0/ 69.9
100.0 / 76.8
100.0 76.8
Objects
Metal Not
98.9/666 66.3
98.9/6 66.6
99.5/82.4
100 87.0
99.5 74.3
99.5 82.1
100.0/ 79.5
100.0 69.8
100.0/ / 86.9
100.0/ 86.9
Pill 93.6
96.8
94.6/ 69.9
98.6 69.0
95.9 62.1
96.9/61..
97.1 79.5
99.8 69.8
98 21.4
98.3/71.3
Screw
91.8/38.0
93.9/36.0
92.2/47.6
93.9/38.8
94.6 36.8
/4.5
87.27 19.4
88.4 36.0
95.9/ 59.6
96.1 59.6
Toothbrush
49.2
96.7 68.6
98.4/57..4
98.4/55.3
95.2 50.9
100.0/ 61.9
98.4/7..7
57.3
100.0/ 63.0
100.0 63.1
Transistor
97.5/
98.8/ 58.5
95.0/58.3
95.2
98.8 /22.1
100.0 /74.1
89.7/59.5 59.5
91.6/ 68.0
96.3 57.9
96.6/ 57.8
Zipper
99.2/ 63.1
/
97.9
97.97 54.2
100.0 25.4
100.0
Carpet
99.4/51.1
98.9/60 60.8
96.6/667.9
100.0 /72.5
/9.4/ 58.1
100.0 /63.3
/9.7
99.4/ 71.4
98.9/71.2
98.9/71.2
Textures
100.0 /9.4
/31.0/331.1
98.2
100.0
/.57.4
/
Leather
100.0 /34.1
100.0/ 62.2
98.4 /6.77
98.6 60.6
100.0 /.37.0
100.0 / /50.0
100.0 /57.4
100.0 /59..
100.0 53.6
100.0 53.9
Tile
99.8 50.2
100.0/
100.0 71.5
100.0
37.00
100.0 63.5
100.0
100.0 N8.6
100.0/
100.0/
Wood
99.6/41..2
/7.7
95.1 /
95.9 70.3
95.9 /45.6
97.5
98.4 65.4
98.3 73.1
99.2/ 68.72
99.2 99.2/68.7
Mean
97.01 50.5
98. 59.9
96.8/
97.8
97.4/
98.6 61.2
97.1 /60.8
/
99.0 68.7
99.1 68.9
22

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Table 12. Multi-class anomaly localization results on MVTec- AD using P-AURPO metrics.
Method
UniAD
UmiADeOurs
GLAD
Gl.AD&Ours
HVQ-Trans
HVQ-TrancDurs
AnomalDe
AnomalDF-sOurs
Dinomaly
Dinomalyy 4
Calagory
NeurIPS222
Ouss
ECCV'24
Ours
23
Ous
WACV'25
Ouss
CVPR
Ours
93.2
96.1
94.4
95.3
Cable
86,0
76.8
89.6
89.8
89.6
91.7
94.2
92.5
93.7
94.2
Capsule
91.1
60.0
96.1
93.1
89.9
92.9
92.5
92.8
97.3
97.1
Hazelnut
92.8
87.2
90.8
93.0
93.8
92.9
92.5
92.8
96.9
96.9
Objects
Metal Nut
82.4
87.2
94.2
96.3
90.6
93.3
94.7
96.2
97.5
97.5
95.3
96.1
95.8
Screw
94,9
60.0
96.7
96.4
92.3
95.4
89.4
92.9
98.3
98.3
Toothbrush
87.7
87.4
95.3
Transistor
94.3
87.4
86.5
85.8
94.8
93.7
84.2
86.0
75.9
76.5
Zipper
86.7
92.7
84.5
93.8
91.8
93.3
86.2
89.4
97.0
97.2
Carpet
94,4
89.0
95.3
94.8
95.4
98.1
97.5
97.7
Textures
Grid
91.9
95.3
92.7
97.5
90.3
93.4
90.0
96.9
96.9
97.1
97.1
97.9
97.0
96.9
97.7
97.5
97.5
Tile
79.0
86.6
96.8
97.8
82.6
85.5
96.7
96.5
90.9
90.7
Wood
85.7
86.0
86.3
90.8
87.1
90.0
93.4
93.5
93.8
93.8
Mean
90.6
92.8
91.5
94.1
94.8
Table 13. Multi-class anomaly detection and localization results VisA using I-AUROC/P-UROC metrics.
Method ->
UniAD
UniADoOurs
GLAD
GLADiOurs
HVQ- Trans
HVQ-Trans: Ours
AnomalDP
AnomalDF
Dinomaly
Dinomaly Ours
Calegory
Ne
Ours
ECCV'24
Ours
NeurlPS'23
Ours
WACV'25
Ours
CVPR'25
Ours
PCB1
95.1/98.9
95.4/ 99.4
69.9/97.6
90.9/97.7
95.2 99.5
96.3/99.3
87,4/99.3
91.8 99.7
99.0/ 99.5
99.1 99.5
Complex
Strndture
PCB2
96.7/93.0
/3.3
89.9 97,1
93.2/95.7
93.3 98.1
97.0 98.0
81,9/94.
95.7/98.0
99.2/ 98.0
99.4 98.1
PCB3
884/
89.67 98.3
93.3/ 96.2
90.5/97.4
89.0 09.0/98.2
89.8
87.4/
94.0798.9
98.8 98.4
98.8 98.5
PCB4
98.7/98.1
97.8
99.0 99.4
99.4/99.3
99.3 98.1
98.7/97.8
96.7
99.1
99.7 / 98.7
99,9 98.7
Macaronit
95.9/99.6
99.3
93.1
96.07
89.4/99)
93.7/99.4
88.0 98.2
99.9
99.6
98.0/ 99.7
Mulappe
Macaroni2
79.1/97.5
84.1 98.1
74.5 / /9..5
79.7/ 99.6
$4.6 / 98.1
88.3
/9.9
82.2
95.7 / 99.7
95.6/ 99.8
Capsules
76.9/95.9
08.8//9.3
76.0
80.1/97.6
/9..7
98.6
98.7
Candles
96.2/99.4
16.5 / 99.1
86.4/ 98.8
90.5 98.8
95.4/ / 99.1
97.8/9992
90.3 96.1
95.1 /.994
98.8 99.4
98.9 99.4
Cashew
$9.1/97.4
93.7/
94.1/99.3
/99.2
96.0
98.5
98.1 96.8
Single
Chewing gum
96.6/99.3
09.0 99.1
98.0 99.6
99.4 99.7
98.8/ 98.1
99.3 19.9999.5
98.0 99.3
99.1 7.96
99.7 99.1
99.7 99.2
Pryum
91.9/ 98.2
89.3 97.6
97.2 96.8
/7.1/97.3
87.6 97.7
94.9/97.7
93.4 96.1
06.9//9..
99.0 96.6
99.0 96.6
Pipe Fryum
98.9/98.9
97.4 99.1
98.1 98.9
95.8/ 99.3
97.1799 99.4
96.6/ 999.5
98.07 99.1
99.1 /99.7
99.2/ / 99.2
99.3/99.2
Mean 91.5/98.0
92.1 98.6
90.1 /97.4
98.2/
91.5/98.5
93,4/98.6
99.5
94.3/ 99.2
98.77 98.7
98.7
Table 14. Multi-class anomaly detection and localization results on VisA using I-AP/P-AP metries.
Method
UniAD
UniAD+Ours
GLAD
GLAD+Ours
HVQ-Trras
HVQ-TTrax- Trane+Ours
AnomalDF
AnomalDF
Dinomaly
Dinomaly
Categocy 1
NeurIPS 22
Ours
BCCV"24
Ours
NewrIPS'23
Ours
WACV'25
Ours
CVPR'25
Ours
PCB1
93.8/515
94,4 63.3
72.5 38.0
88.7 64.5
94.5 71.6
95.4
87,4/813
90.6 75.5
98.9 87.8
98.9/ 88.2
Complex
Stuuhire
PCB2
93.
92.0/
94.2/9.5
97.1/
96.2 13.1
99.2
PCB3
89.3 /3.8/23.8
90.2 18.7
94.0 25.0
90.7 22.4
89.4/ 18.0
25.5
90.2
94.5 30.7
98.8/41.0
99.0 41.4
PCD4
98.6/35.2
99.2
98.2 52.6
99.2 99.5
98.4 38.2
96.3/37.4
97.7 32.8
99.7 50.1
100.0/ 50.8
Macaronil
96.2/16.4
9.6
93.17
96.8 16.6
89.1
94.1/11.5
88.9/10.6
95.8 15.7
97.2/ 30.2
97.6 30.9
Multiple Instanccss
Macaroni2
80.0/4.6
/..7
73.8/7.0
81.4/6. 6.1
83.3
8.5
7.5./5
81.8//4.6
95.5 24.5
95.5 24.8
Capsules
27.4/2411
46.5
94.1
94.2 /5.3
54.0/ 49.8
90.0/45.9
96.4/43.3
93.0 30.0
99.0
99.2
Candles
96.4/37.2
97.0 21.3
88.2 29.3
91.6 29.7
28.6/ 18.6
98.0 29.9
90.2 28.1
95.9 36.9
98.8 83.8/43.0
99.0 43.8
Cashew
94.6/27.2
/4.77
96.4/ 29.2
97.9 17.44
96.4 58.6
97.5 64.6
97.6 60.2
97.8 88.0
99.4 62.5
99.4 63.0
Single Instance
Chewing gum
98.4/ 64.0
99.5 59.1
99.1 73.9
99.7 83.2
99.5 40.9
99.6 70.2
99.2/
99.6. 67.2
99.9 63.5
99.9 66.7
Fryum
96.1 /1.66
94.9 /
98.9 36,1
99.0 42.2
5.10
88.9/449.5
97.4/46.7
98:7 52.9
95.5% 52.0
99.8 51.9
Pipe Fryum
98.6/45.6
98.7
50.1
97.9 66.8
98.3 21.5
99.2/61.0
63.88
99.8
Mean
93.6
34.9
91.4 33.9
94.1 /4.7
93.4 35.5
95.27 41.4
91.4/39.6
95.1 /44.6
98.9
99.00 53.2
23

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Table 15. Multi-class anomaly detection and localization results VisA using L-Fllax/PP-Flmmm metrics.
Method
UniADiOOrs
GLAD
GluADiOurs
HVQ-Taas
HVQ-TanssOOrs
Anomal
Onrr
Dinomaly
Dinomaly:
Categoty
22
Ours
ECCV'24
Ours
NeurIPS'25
Ous
WACV
Ours
CVPR'25
Ours
9
91.6/63.7
26.67 80.2
Comples
Struction
PCB2
86.1 20.4
88.2 16.6
83.3/ 14,
87,9 14.1
88.8/ 16.5
92.0/21.1
76.2/
90.1/25.7
97.0/ 48.8
97.2 48,9
PCB3
81.5/29.1
83.1/25.0
87.6
84.5
81.1/22.7
/2.1
58.7/34.9
95.8 45.8
PCB4
98.5 38.7
97.6 35.6
98.0/ 52.0
97.07 50.1
97.0 36.0
97.1
91.0/ 30.8
93.1/35.2
98.07 52.8
98.2 53.4
Macaroni
90.3
19.4/19.2
89.8
86.1/19.9
86.7/19.7
79.5/17.3
96.2 39.8
Mullipple
Macaroni2
75 11.0
79.0
71.8/ 19.3
74.1 14,5
79.1 10.5
81.5/15.5
73.07 11.1
77.9/113
90.4/ 36.2
90.6 36.6
Capsules
78.07
77.1 50.5
85.9/53.3
87.3 54.7
78.0/ 54.0
79.4751.4
89.8/45.6
85.1
66.8
97.7 66.9
Candles
94.07 44.1
/33.4
73.8
83.3 35.3
88.6 28.6
92.5741.0
82.9 30.6
90.0 /3.22
95.5 /88.5
95.7 / 49.0
Cashew
37.3
91,9 49.7
90.5
92.8 58.7
91.1/61.0 61.0
91.5/66.1
92.0/ 60.3
94.2 8100
96.5 60.9
95.8 61.4
Single
Chewing gum
95.5761.2
97.5
95.5 69.6
98.0 75.9
97.0 41.6
96.9 64.7
97.5/
97.5 59.7
98.0 67.4
98.1 68.6
Fryum
55.3
87.4
94.8
95.0 44.8
85.8 56.0
$6.8/54.0
92.7/45.2
95.4/51.2
96.6 53.7
97.21 53.5
Pipe Fryum
93.9/3399
95.5
55.0
93.5/71.3
97.57 56.2
70.2
97.1 65.5
Mcan
38.573844
88.9/39.1
86.7/39..
89.2/43.7
88.1/39.6
89,3/45.0
86.2//1.1
90.6
96.1 / 155.1
96.3/ 55,8
Table 16. Multi-class anomaly localization results on VisA using P-AUPRO metries.
Method
UniAD
UniAD=Ours
GLAD
GLAD+Ours
HVQ-Trams
HVQ-TransOurs
AnomaiDF
AmomalDF+Ours
Dinonaly
DinomalyyOur
Category
NeurIPS'22
Ours
BCCV'24
Ours
25
Ours
WACV'25
Ours
CVPR
PCBI
82.5
89.5
88.3
82.7
90.4
88.3
82.8
77.9
95.2
95.2
Compples
PCB2
96.7
82.8
91.2
84.7
84.1
85.4
77.7
82.7
91.3
91.5
PCB3
96.5
79.3
94.2
92.2
79.9
75.6
79.7
74.5
94.7
94.8
83.9
94.9
94.7
84.4
79.7
94.1
Macuronil
99.6
95.7
99.1
99.0
93.9
96.1
90.2
91,9
96.1
96.8
Mullippe
Macaromi2
79.5
89.9
97.2
98.3
91.9
94.2
$4.8
97.9
98.6
98.8
Capsules
51.1
74.0
91.8
91.4
73.2
61,9
86.1
87.5
97.1
97.4
Candkas
93.1
95.3
92.8
93.0
94.5
95.2
94.1
76.9
95.3
95.3
Cashow
89,5
87.7
61.1
75.6
88.8
90.5
91.3
69.1
94,3
93.7
Single Indance
Chowing gum
80.9
79.8
92.5
92.0
77.7
88.5
85.7
89.4
88.4
88.4
Fryum
62.2
84.2
96.4
96.1
84.2
86.9
85.0
89.4
93.5
93.7
Pipe Hyum
86.0
94.1
98.0
98.3
93.7
94.5
94.7
97.8
95.6
95.5
Mean
76.1
86.4
91.5
91.5
86.4
36.8
86.3
86.3
94.5
94.7
Table 17. Multi-class anomaly localization results on BTAD using I-AUROC/--PP1- metrics.
Method +
Dinomaly
Dinomaly-Ours
HVQ-Trans
HVQ-Trans+Ours
Categary &
CVPR'25
Ours
2e
Ours
01
96.8 99888 94.9
97.0 / 98.9 95.8
96.9 / /98.8 8 94.9
98.1 99.4 96.9
89.7 9 93.9
89.7 98.4 93,9
79.8/95.99 92.8
81.7 /1.7/9700 /7.00 92.8
99.9/98.4 97.6
99.9 98.4 97.6
99.9 /98.8/ 96.8
99.9/ 99.6 98.4
Mean
95.4/98.51 99.55
95.5 / 98.6 95.8
90.9/97.8/ 94.8
93.3 98.6 96.0
Table 18. Multi-class anomaly localization results BTAD using
metries.
Method +
Dinomaly
Dinomaly=Ours
HIQQ Trans
IIQQ Trans+Ours
Category
CVPR'25
Ours
NeurlPS'2
Ours
01
97.1 /2.9 64.9772..4
97.3 66.9 (5.66/777 77.4
96.4 46.8 8 50.9 / 75.6
511/511//33///// 76.6
02
96.8 /2.77 68.4 59.4
97.0 77.0 70.4/599
94.6 48.8 55.2 15.2/555 55.8
4..0/441/512//55
03
99.7 /4.6/ / 71.9 97.8
99.9 78.8 73.5 99.3
99.0 34.1
/9.9
99.9/45.5 /5..5///55.. /5..6
Mcan
97.9 70.1 68.0/ 76.5
98.1 74.3 69.8 777.5
96.7 /43.2 48.7 775.6
97.3 50.2 76.2
24

---

CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering
Table 19. Multi-class anomaly localization results on MPDD using I-AUROC/I-PPI-F max metrics.
Method
Dimomaly
Dinemaly+Ours
IIQQ
ONQ-TransOOurs
Category
CVPR'25
Ours
NeurIPS'23
Ours
Bracket black
93.8 / 96.5 89.1
92.8/ 95.6/ 89.8
91.3/93.9/89/
95.3 96.9 95.3
95.3 95..
93.7 /
Bracket white
99.0 99.1 19477
99.0 99.1 94,9
79.2/ 82.6/227774 74.7
/93.0/ 85.2
Connector
100.0 / 100.0 100.0
100.0/ 100.0 100.0
89.3/ /
97.9/ /7.0/ /9.3
Metal plate
100.0 / 100.0 / 100.0
100.0/ 100.0 100.0
97.5 99.1 /95.8
98.6 /9.5 /97.3
Tobes
95.9 98.5 95.5
96.1 98.5 95.5
70.6 /
84.6 93.7 / 85.3
97.3 /98.5 95.6
98.5
87.9/
93.1 23.1/9954/900
Table 20. Multi-class anomaly localization results on MPDD using P-AUROC/P-APIP-FF -UPPO metrics.
Method
Dinomaly
Dinomaly+Ours
HVQ-TTaas
HVQ-Iran-QOus
Category L.
CVPR 25
Ours
NearIPS'23
Ours
Bracket black
99.4/37.5 47.1 98.3
/7.3/ 46.9 98.3
97.0/ 1.5.555////// /90.1
97.2/3.1/7.//87. /8.3
Bracket brown
98.2
96.7
98.2 50.2 48.8 96.5
08.3/31.55 36.7 88.6
11./31.1/3444//
Bracket white
99.4/1844 25.1 93.4
99.4 19.0 25.1 93.7
9..2/ /2.6 84.2
98.0/6.8/ 15.5 88.6
Connector
99.3/74.6/
19.55
99.3 74.5 69.2 97.6
16.6 /911
97.2. 28.8 33.8
Metal plate
99.6/97.7 92.3 97.7
99.5 97.7 92.4 97.7
96.6 73.6 74.4 86.6
98.4 88.1 82.1 84.6
Tuhes
/9.1/82.1 76.5 96.5
99.1 82.3 76.7 96..5
96.77 / /4.4/ 38.5 /8.55/% 87.5
96.2 47.0 / 48.6 86.9
/ 96.7
99.2
96.9 26.4
97.5 37.0/
25


Reviews:
[{"review_id": "r99kfd9SBc", "reviewer": "Reviewer_Yvmv", "summary": "The paper introduces the concept of cost volume filtering, combined ideas from stereo matching and depth estimation, into the field of unsupervised anomaly detection. This method addresses the often-overlooked matching noise issue, which is a common challenge in existing AD methods.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "**Q1**: The paper is supported by solid claims and motivations. It could be better if the authors could apply the proposed method plug-in design into multiple AD baselines.\n\n**A1**: Thanks! We apply our method to **UniAD** (NeurIPS'22) (**new add**), **GLAD** (ECCV'24), **HVQ-Trans** (NeurIPS'23), **AnomalDF** (WACV'25), **Dinomaly** [r1] (CVPR'25) (**new add**) on benchmarks **MVTec-AD**, **VisA**, **BTAD** (**new add**), and **MPDD** (**new add**). Please refer to Table R1 for category-averaged metrics, with detailed per-category metrics available in the link (https://anonymous.4open.science/r/ICML-ID8276/PDF.pdf).\n\n[r1] Jia Guo, et al. Dinomaly: The less is more philosophy in multi-class unsupervised anomaly detection. CVPR 2025.\n\n**Table R1**. Evaluation with more baselines on multiple benchmarks via 7 comprehensive metrics.\n|Dataset|Method|I-AUROC|I-AP|I-F1-max|P-AUROC|P-AP|P-F1-max|P-AUPRO|\n|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|\n|**MVTec-AD**|UniAD|97.5|99.1|97|96.9|44.5|50.5|90.6|\n||UniAD+Ours|99|99.7|98.1|97.5|60.5|59.9|91.3|\n||Dinomaly|99.6|99.8|99|98.3|68.7|68.7|94.6|\n||Dinomaly+Ours|99.7|99.8|99.1|98.4|68.9|68.9|94.8|\n|**VisA**|UniAD|91.5|93.6|88.5|98|32.7|38.4|76.1|\n||UniAD+Ours|92.1|94|88.9|98.6|34|39|86.4|\n||Dinomaly|98.7|98.9|96.1|98.7|52.5|55.4|94.5|\n||Dinomaly+Ours|98.7|99|96.3|98.8|53.2|55.8|94.7|\n|**MPDD**|HVQ-Trans|86.5|87.9|85.6|96.9|26.4|30.5|88.0|\n||HVQ-Trans+Ours|93.1|95.4|90.3|97.5|34.1|37.0|82.9|\n||Dinomaly|97.3|98.5|95.6|99.1|60|59.8|96.7|\n||Dinomaly+Ours|97.5|98.5|95.8|99.2|60.2|59.9|96.7|\n|**BTAD**|HVQ-Trans|90.9|97.8|94.8|96.7|43.2|48.7|75.6|\n||HVQ-Trans+Ours|93.3|98.6|96|97.3|47|50.2|76.2|\n||Dinomaly|95.4|98.5|95.5|97.9|70.1|68|76.5|\n||Dinomaly+Ours|95.5|98.6|95.8|98.1|74.3|69.8|77.5|\n\n**Q2**: It would be better if the authors also report metric such as PR, or AUPRC.\n\n**A2**: Thank you! We would like to clarify that AUPRC (i.e., the area under the precision-recall curve) has already been reported in Tables 7–10 of our submission, where we refer to it as I-AP (image-level AUPRC) and P-AP (pixel-level AUPRC), following the terminology adopted by Glad, AnomalDF, and Dinomaly. The AUPRC is computed by the **`average_precision_score`** function from **`sklearn.metrics`**. We will clarify this in the revised version to avoid confusion.\n\n**Q3**: Some of the SOTA methods have been missing in the paper.\n\n**A3**: Thank you! We acknowledge the importance of the SOTA methods you mentioned and will incorporate both citations and discussions in the revised version for a more thorough and balanced evaluation.\n\n**Q4**: The multiple steps may increase the difficulty of implementation. Could the authors provide how the model sensitive to architectures or hyper parameters selections.\n\n**A4**: Thanks!\n- To address potential concerns about implementation and reproducibility, we will release the full source code and model weights. \n\n- We have also conducted comprehensive ablation studies in Table 4 to examine the model's sensitivity to architectural choices. Specifically, we evaluate different cost volume constructions (DN→depth/channel), template selection strategies ($C_0$ vs. $C_{N-1}$), dual-stream attention (SG and MG), and class-aware adaptation (loss $\\mathcal{L}_s$). Results confirm that each component plays a vital role in achieving strong performance, validating their necessity and effectiveness.\n\n**Q5**: Also it would be valuable for authors to compute the complexity like inference/training time.\n\n**A5**: Thanks! We have provided the inference time and memory usage in Table 6 of the submission. These metrics, along with overall training time, are provided in Table R2 below. As shown, our method incurs reasonable computational overhead and minimal memory usage, while delivering notable performance improvements.\n\n**Table R2**. Complexity comparison of baselines and +Ours. ''-'' denotes training-free.\n|Method|Inference time (s/image)|Train time (h)|Memory (GB)|\n|:--:|:--:|:--:|:--:|\n|UniAD/+Ours|0.01/+0.04|14.78/+1.36|4.53/+0.56|\n|Glad/+Ours|3.96/+0.37|10.07/+4.95|8.79/+2.07|\n|HVQ-Trans/+Ours|0.05/+0.07|21.79/+5.18|4.78/+0.94|\n|AnomalDF/+Ours|0.31/+0.32|-/+17.31|3.25/+0.82|\n|Dinomaly/+Ours|0.11/+0.05|2.31/5.49|4.32/+1.11|\n\nWe sincerely appreciate your feedback and hope our response has addressed your concerns. If you have any additional questions, please let us know, and we will respond promptly.", "claims_and_evidence": "The paper is supported by solid claims and motivations. The paper provides extensive quantitative results on two benchmark datasets (MVTec-AD and VisA), and these results are complemented by qualitative visualizations and thorough ablation studies. However, the proposed method plug-in design can be applied in multiple different AD baselines. It could be better if the authors could apply this into multiple AD baselines.", "methods_and_evaluation_criteria": "The proposed methods and evaluation criteria are well aligned with the problem of unsupervised anomaly detection. \n\nHowever, the paper mainly reports results using AUC metrics for both image-level and pixel-level anomaly detection. It would be better if the authors also report metric such as PR, or AUPRC, where many other AD papers have benchmarked their methods using this metric given that AUC results are very high and close to saturation and PR curves are often more sensitive to changes in the precision-recall trade-off, particularly in imbalanced datasets where false positives or negatives have different impacts on precision and recall.", "theoretical_claims": "The paper primarily focuses on empirical validation and algorithmic design rather than on formal theoretical proofs.  There are no formal theorems or rigorous proofs provided to mathematically guarantee the properties of the proposed method. The authors rely on intuitive reasoning and extensive experimental validation to support their claims.", "experimental_designs_or_analyses": "The experimental design in the paper is generally sound and well thought out\nThe experiments are conducted on established datasets (MVTec-AD and VisA) which are widely recognized for anomaly detection. \nThe paper evaluates both multi-class and single-class anomaly detection scenarios, and the integration of the proposed CostFilter-AD as a plug-in for different base models (reconstruction-based and embedding-based) demonstrates its generality and robustness.", "relation_to_broader_scientific_literature": "Overall the paper present a decent and novel plug and play module for anomaly detection and show great performances. This can relates to broader impact in the field of anomaly detection.", "essential_references_not_discussed": "Some of the SOTA methods have been missing in the paper.\n\nLee, Mingyu, and Jongwon Choi. \"Text-guided variational image generation for industrial anomaly detection and segmentation.\" Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2024.\n\nChen, Yuanhong, et al. \"Deep one-class classification via interpolated gaussian descriptor.\" Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 36. No. 1. 2022.\n\nBae, Jaehyeok, Jae-Han Lee, and Seyun Kim. \"Pni: industrial anomaly detection using position and neighborhood information.\" Proceedings of the IEEE/CVF International Conference on Computer Vision. 2023.", "other_strengths_and_weaknesses": "the overall pipeline is quite complex. The multiple steps—from multi-layer feature extraction, cost volume construction, and 3D U-Net filtering, to dual-stream attention and class-aware adaptation—may increase the difficulty of implementation. Could the authors provide how the model sensitive to architectures or hyper-parameters selections. Also it would be valuable for authors to compute the complexity like inference/training time?", "other_comments_or_suggestions": "NA", "questions_for_authors": "Please see above for questions and concerns.", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "D3ydE8lJz5", "reviewer": "Reviewer_kyJ7", "summary": "This paper introduces cost filtering into unsupervised anomaly detection and multi-class anomaly detection. The authors offer a new perspective to differentiate the discrepancy between the input and templates. Their experiments appear to demonstrate the effectiveness of the proposed method.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "**Q1**: Missing the first multi-class anomaly detection work, UniAD, and a performance comparison.\n\n**A1**: Thanks for your reminding.\n\n- We fully recognize UniAD (NeurIPS'22) as a pioneering work in multi-class anomaly detection. In response, we have conducted extensive evaluations by integrating CostFilter-AD into UniAD, and will include both citation and performance comparisons in the revised paper.\n- As shown in Table R3, on MVTec-AD, this integration improves image-level AUROC/AUPRC/F1-max by +1.5\\%/+0.6\\%/+1.1\\%, and pixel-level AUROC/AUPRC/F1-max/AUPRO by +0.6\\%/+16\\%/+9.4\\%/+0.7\\%, respectively. On VisA, we observe gains of +0.6\\%/+0.4\\%/+0.4\\% at the image level and +0.6\\%/+1.3\\%/+0.6\\%/+10.3\\% at the pixel level.\n- Furthermore, we incorporated CostFilter-AD into Dinomaly (CVPR’25) and validated its effectiveness across more benchmarks. These consistent gains further highlight the effectiveness, flexibility, and generalizability of our method. Please refer to the link (https://anonymous.4open.science/r/ICML-ID8276/PDF.pdf) for more category-aware details.\n\n**Table R3**. Integration of our CostFilter-AD with UniAD and Dinomaly baselines.\n|Dataset|Method|I-AUROC|I-AP|I-F1-max|P-AUROC|P-AP|P-F1-max|P-AUPRO|\n|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|\n|**MVTec-AD**|UniAD|97.5|99.1|97|96.9|44.5|50.5|90.6|\n||UniAD+Ours|99|99.7|98.1|97.5|60.5|59.9|91.3|\n||Dinomaly|99.6|99.8|99|98.3|68.7|68.7|94.6|\n||Dinomaly+Ours|99.7|99.8|99.1|98.4|68.9|68.9|94.8|\n|**VisA**|UniAD|91.5|93.6|88.5|98|32.7|38.4|76.1|\n||UniAD+Ours|92.1|94|88.9|98.6|34|39|86.4|\n||Dinomaly|98.7|98.9|96.1|98.7|52.5|55.4|94.5|\n||Dinomaly+Ours|98.7|99|96.3|98.8|53.2|55.8|94.7|\n\n**Q2**: Besides detection performance, parameter efficiency is crucial. MOE-AD highlights this in multi-class detection. The authors should provide results to demonstrate the efficiency and effectiveness.\n\n**A2**: Thank you for highlighting the parameter efficiency. \n\n- MoE-AD presents an elegant solution by significantly reducing model size via recursive ViT blocks and MoE-based FFN selection, setting a strong benchmark for balancing accuracy and efficiency in resource-constrained scenarios. We will cite this excellent work in our revised paper and are excited to explore its potential synergy with CostFilter-AD in future work.\n\n- In response, we present a detailed comparison across multiple baselines and benchmarks (see Table R4), reporting parameters, FLOPs, memory usage, and inference time. In terms of **memory usage**, the increase is negligible. Regarding **computational overhead**, it remains relatively low compared to diffusion-based methods. For other approaches, the overhead can be further minimized by converting global matching into local matching, thereby optimizing the cost volume for more efficient computation. Regarding **efficiency**, our method provides notable performance gains with a reasonable increase in inference time.\n\n**Table R4**. Parameter efficiency comparison and performance gain of baselines/+Ours on MVTec-AD.\n|Method|#Params|FLOPs|Memory(GB)|Inference time (s/image)|I-AUROC|P-AUROC|\n|:--:|:--:|:--:|:--:|:--:|:--:|:--:|\n|UniAD/+Ours|7.7M/+43.0M|198.0G/207.8G|4.53/+0.56|0.01/+0.04|97.5/+1.5|96.9/+0.6|\n|Glad/+Ours|1.3B/+43.8M|>2.2T/261.3G|8.79/+2.07|3.96/+0.37|97.5/+1.2|97.3/+0.9|\n|HVQ-Trans/+Ours|18.0M/+43.0M|7.4G/207.8G|4.78/+0.94|0.05/+0.07|97.9/+1.1|97.4/+0.5|\n|AnomalDF/+Ours|21.0M/+43.8M|4.9G/261.3G|3.25/+0.82|0.31/+0.32|96.8/+1.7|98.1/+0.7|\n|Dinomaly/+Ours|132.8M/+43.6M|104.7G/114.6G|4.32/+1.11|0.11/+0.05|99.6/+0.1|98.3/+0.9|\n\nNotably, the #Params in our model varies slightly across different baselines. This is because we need to map the matching features, which have different #Channels (e.g., 196, 768, or 1024), into a unified 96-dimensional space.\n\n**Q3**: It would be beneficial if the authors could provide failure cases to enable a deeper analysis.\n\n**A3**: Thank you for the insightful suggestion. As illustrated in Fig. 1 (at link (https://anonymous.4open.science/r/ICML-ID8276/PDF.pdf)), we present representative failure cases from six categories in MVTec-AD and VisA, demonstrating the performance of our method before and after filtering.\n\nWhile our approach effectively reduces matching noise, its effectiveness depends on the presence of anomaly-relevant signals in the cost volume. If these signals are absent—due to low-resolution inputs or insufficient feature learning—the filtering process cannot recover them. In other words, as a denoising rather than a generative module, CostFilter-AD enhances existing features but cannot infer anomalies from missing evidence.\n\nWe appreciate your feedback and hope that our revisions address your concerns. If there are any remaining issues or questions, please let us know, and we will respond promptly.", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "Yes", "theoretical_claims": "Yes", "experimental_designs_or_analyses": "Yes", "relation_to_broader_scientific_literature": "This paper proposed a new approach to solve unsupervised anomaly detection.", "essential_references_not_discussed": "No", "other_strengths_and_weaknesses": "Strengths:\n\n1. This paper incorporates cost filtering into unsupervised anomaly detection, providing an interesting perspective that supplements the current literature on anomaly detection.\n\n2. The paper is well-organized with effective use of visual aids, allowing readers to follow the writing flow smoothly.\n\n3. The authors conduct extensive experiments to illustrate the effectiveness of their proposed method. The quantitative results highlight the method's effectiveness.\n\nWeaknesses:\n\n1. It is unclear why the authors neglect the first multi-class anomaly detection work, UniAD, and do not provide a performance comparison with it.\n\n2. The paper introduces a cost filtering network to model the discrepancy between input samples and templates, which may increase memory usage and computational overhead. Besides detection performance, parameter efficiency is also an important metric for evaluating an algorithm. MOE-AD [1] is a recent multi-class detection framework that emphasizes parameter efficiency. The authors should supplement their experiments to demonstrate the computational efficiency and effectiveness of their method.\n\n3. It would be beneficial if the authors could provide failure cases to enable a deeper analysis of the proposed method. This addition would offer valuable insights for the readers.\n\n[1] Meng, S., Meng, W., Zhou, Q., Li, S., Hou, W., & He, S. (2024). MoEAD: A Parameter-Efficient Model for Multi-class Anomaly Detection. European Conference on Computer Vision.", "other_comments_or_suggestions": "No", "questions_for_authors": "See Weaknesses", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "nHQCqCbdu9", "reviewer": "Reviewer_fSfi", "summary": "The paper proposes CostFilter-AD, a novel method for unsupervised anomaly detection (UAD) that leverages cost volume filtering. The approach addresses matching noise issues in existing UAD methods by constructing an anomaly cost volume and refining it with a filtering network.\n\n## Update after rebuttal\n\nThe authors addressed most of my concerns. I am just still a little worried about the computation overhead when the number of templets is large (e.g. AnomalyDINO fullshot). In addition, the improvement is relatively small when integrated on stronger backbones, e.g. AnomalyDINO-fullshot and Dinomaly\n\nI raise my score to weak accept.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "**Table R5**. AnomalDF (abbr. as ADF) /+Ours Comparison under a fair setting.\n|ID|Dataset|Method|Input size|#Templates|I-AUROC|I-AP|I-F1-max|P-AUROC|P-AP|P-F1-max|P-AUPRO|\n|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|\n|1|**MVTec-AD**|ADF|256|3|96.8|98.6|97.1|98.1|61.3|60.8|93.6|\n|2||+Ours|256|3|98.5|99.4|97.8|98.8|67.8|64.9|94.2|\n|3||ADF|256|Full|99.0|99.3|98.4|97.5|-|58.7|91.7|\n|4||+Ours|256|Full|99.3|99.8|98.6|98.9|68.7|65.5|96.6|\n|5||ADF|448|Full|99.3|99.7|98.8|97.9|-|61.8|92.9|\n|6||+Ours|448|Full|99.5|99.8|98.9|99.0|72.4|68.4|95.4|\n|7||ADF|672|Full|99.5|99.8|99.0|98.2|-|64.3|95.0|\n|8||+Ours|672|Full|99.6|99.9|99.0|99.1|74.4|69.7|96.3|\n|9|**VisA**|ADF|256|3|90.5|91.4|86.2|97.4|39.6|40.4|86.3|\n|10||+Ours|256|3|94.3|95.1|90.6|99.2|44.6|45.5|84.5|\n|11||ADF|256|Full|94.6|95.7|90.9|98.3|-|44.3|86.7|\n|12||+Ours|256|Full|95.5|96.3|91.5|99.4|45.9|46.6|87.0|\n|13||ADF|448|Full|97.2|97.6|93.7|98.7|-|50.5|95.0|\n|14||+Ours|448|Full|97.4|97.7|93.8|99.4|42.2|53.6|95.2|\n|15||ADF|672|Full|97.6|97.2|94.3|98.9|-|53.8|96.1|\n|16||+Ours|672|Full|97.8|98.0|94.6|99.4|47.6|54.5|96.4|\n\n**Q1**: Discrepancy between AnomalDF (AnomalyDINO) performance and reported results.\n\n**A1**: Thank you! The gap is primarily due to two factors:\n\n- **Number of templates**: In our experiments, we re-run AnomalyDINO using **3 randomly sampled images** from the training dataset as reference templates during testing. In contrast, the original full-shot setting of AnomalyDINO employed **the entire training dataset** as templates.\n- **Image resolution**: We resize images to **256×256**, whereas the original AnomalyDINO resized to **448×448**. Higher resolution allows the model to capture more details.\n\nAs shown in the Table R5, **under AnomalyDINO's full-shot setting**, we achieve image AUROC scores of 99.5 (MVTec-AD) and 97.4 (VisA), outperforming AnomalDF's 99.3/97.2.\n\n**Q2**: Clarification on the 3-shot setting: Is the AnomalDF+Ours actually few-shot?\n\n**A2**: The answer is No. The AnomalDF (+Ours) in our paper is full-shot, but differs from the original AnomalyDINO setting.\n\n- Training: AnomalDF (+Ours) uses a fixed number (N=3) of templates per input image, randomly sampled from the full training set for each input, rather than drawn from a fixed template set as in the original few-shot setting of AnomalyDINO. Our dynamic sampling ensures the template pool covers the full training distribution; thus, we classify it as full-shot, offering a trade-off between template diversity and memory efficiency.\n- Test: For fairness, we evaluate AnomalDF (+Ours) using our dynamic 3-shot sampling protocol, as reflected in the results reported in our submission.\n\n**Q3**: Storage overhead claim.\n\n**A3**: Thanks for your kindly reminding. We will carefully revise our statement on “storage overhead” to provide a more accurate and precise explanation.\n\n**Q4**: Evaluation of full-shot AnomalyDINO.\n\n**A4**: Following your advice, we tested under the original full-shot AnomalyDINO setting. In Table R5, Exp. 3–8 report results on MVTec-AD and Exp. 10–16 on VisA. CostFilter-AD **consistently improves** AnomalDF’s performance across all resolutions, with some cases (e.g., Exp. 6 vs. 7) showing that AnomalDF+Ours at lower resolutions matches or surpasses the baseline at higher resolutions.\n\nWe are integrating CostFilter-AD with PatchCore, similar to AnomalDF (+Ours), and will report it in the revised version.\n\n**Q5**: How to utilize the reconstructed features from HVQ-Trans.\n\n**A5**: Thanks! We directly use the input and reconstructed features from HVQ-Trans to construct the cost volume, without decoding them back to the image domain, as the HVQ-Trans already provides the necessary feature representations. This differs from Glad+Ours, which uses a pre-trained encoder to extract image features. We will state the implementation of HVQ-Trans+Ours more clearly in the revised vision.\n\n**Q6**: Following the above, can CostFilter-AD be ensembled on feature-reconstruction methods like RD4AD, UniAD, MambaAD, Dinomaly?\n\n**A6**: Yes! Similar to HVQ-Trans (+Ours), for feature-reconstruction-based methods, we bypass the feature encoder and directly construct the cost volume using both input and reconstructed features. We further validated it by integrating with UniAD and Dinomaly on MVTec-AD and VisA. SOTA results show CostFilter-AD's generalizability (see Table R7 below and the link (https://anonymous.4open.science/r/ICML-ID8276/PDF.pdf) for details).\n\n**Q7**: More datasets.\n\n**A7**: Thanks! We have extended our evaluation by integrating CostFilter-AD with HVQ-Trans and Dinomaly on two more datasets: BTAD and MPDD. As shown in Table R7 and the link (https://anonymous.4open.science/r/ICML-ID8276/PDF.pdf), we consistently improve baseline performance, validating effectiveness.\n\nWe sincerely appreciate your feedback and hope our response clarifies your concerns. If you have further questions, please feel free to let us know, and we'll be glad to clarify.", "claims_and_evidence": "No claims apart from the priority of performance.", "methods_and_evaluation_criteria": "The proposed method makes sense.", "theoretical_claims": "None", "experimental_designs_or_analyses": "The experimental setting follows the convention of UAD.", "relation_to_broader_scientific_literature": "In my assessment, this represents a framework similar to DRAEM (or DesTSeg), comprising two primary components: a normal-restoration network (analogous to the autoencoder in DRAEM) and a supervised segmentation network that segments anomalous based on two input images..", "essential_references_not_discussed": "No", "other_strengths_and_weaknesses": "Strengths:\n\nCostFilter-AD is designed as a general post-processing module, increasing its adaptability to different anomaly detection frameworks.\n\nWeaknesses and Questions:\n\n1. The reported performance of AnomalDF (AnomalyDINO) is notably inconsistent with published results. In its original paper, AnomalyDINO (essentially DINOv2+PatchCore) achieved 99.3/97.2 image-AUROC on MVTec-AD and Visa, respectively. However, this paper reports substantially lower scores of 96.8/90.5. Even with CostFilter-AD ensembling, the results only reach 98.5/94.3, still below the original benchmarks.\n\nUpon closer examination of the Appendix, I discovered the authors limited AnomalyDINO to merely 3 shots as normal supports, citing \"substantial storage overhead\" concerns for full-shot approaches. So it is actually few-shot?\n\nMoreover, the storage overhead claim appears questionable. Memory-bank methods like PatchCore and AnomalyDINO can operate effectively on standard laptops using the \"faiss\" package. The memory-bank storage requirements are comparable to the model size itself. Additionally, PatchCore already introduced coreset-subsampling specifically to reduce storage requirements and optimize nearest-neighbor search efficiency.\n\nI would recommend that the authors evaluate CostFilter-AD ensembled with full-shot implementations of both AnomalyDINO and PatchCore for a more accurate and fair comparison.\n\n2. HVQ-Trans is a feature-reconstruction method that reconstructs features of EfficientNet instead of original images. How to leverage the generated images from it? \n\n3. Following the above, can CostFilter-AD be ensembled on feature-reconstruction methods, such as RD4AD, UniAD, MambaAD, Dinomaly, etc.? Feature-reconstruction-based methods are the most popular branch in multi-class UAD.\n\n4. More datasets are suggested, such as Real-AD, BTAD, MPDD, etc.", "other_comments_or_suggestions": "Please see Weaknesses", "questions_for_authors": "Please see Weaknesses", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "c32OsSs2oL", "reviewer": "Reviewer_LUDM", "summary": "This paper presents a novel approach to unsupervised anomaly detection (UAD) called CostFilter-AD. Unlike traditional methods that suffer from inaccurate matching processes, this approach leverages cost volume filtering, a technique borrowed from depth and flow estimation tasks, to enhance detection accuracy. By constructing a matching cost volume and employing a filtering network, CostFilter-AD refines feature matching between input images and normal samples to effectively suppress noise while preserving critical edge information. It serves as a versatile post-processing plug-in that can be integrated with both reconstruction-based and embedding-based UAD methods. Extensive experiments demonstrate the superiority of CostFilter-AD in achieving state-of-the-art performance on multi-class and single-class UAD tasks.", "questions": "", "limitations": "", "rating": 2, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "**Q1:** The proposed method is simple, effective, and well-proven. Calculation cost and memory cost can be added.\n\n**A1:** Thank you for acknowledging our work's effectiveness and suggesting the inclusion of computational and memory costs. We include comparisons of parameter count, FLOPs, memory usage, inference time, and overall training time in Table R6, showing that CostFilter-AD introduces marginal overhead while consistently improving AD performance (Table R7).\n\n**Table R6**. Comparison of computational and memory costs. ''-'' denotes training-free.\n|Method|#Params|FLOPs|Memory(GB)|Inference time(s/image)|Train time(h)|\n|:--:|:--:|:--:|:--:|:--:|:--:|\n|UniAD/+Ours|7.7M/+43.0M|198.0G/207.8G|4.53/+0.56|0.01/+0.04|14.78/+1.36|\n|Glad/+Ours|1.3B/+43.8M|>2.2T/261.3G|8.79/+2.07|3.96/+0.37|10.07/+4.95|\n|HVQ-Trans/+Ours|18.0M/+43.0M|7.4G/207.8G|4.78/+0.94|0.05/+0.07|21.79/+5.18|\n|AnomalDF/+Ours|21.0M/+43.8M|4.9G/261.3G|3.25/+0.82|0.31/+0.32|-/+17.31|\n|Dinomaly/+Ours|132.8M/+43.6M|104.7G/114.6G|4.32/+1.11|0.11/+0.05|2.31/5.49|\n\n**Table R7**. Experimental comparison with baselines and +Ours.\n| Dataset|Method|I-AUROC|I-AP|I-F1-max|P-AUROC|P-AP|P-F1-max|P-AUPRO|\n|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|\n|**MVTec-AD**|UniAD|97.5|99.1|97|96.9|44.5|50.5|90.6|\n| |UniAD+Ours|99|99.7|98.1|97.5|60.5|59.9|91.3|\n| |Glad|97.5|98.8|96.8|97.3|58.8|59.7|92.8|\n| |Glad+Ours|98.7|99.6|97.8|98.2|66.8|64.4|94.1|\n| |HVQ-Trans|97.9|99.3|97.4|97.4|49.4|54.3|91.5|\n| |HVQ-Trans+Ours|99|99.7|98.6|97.9|58.1|61.2|93.2|\n| |AnomalDF|96.8|98.6|97.1|98.1|61.3|60.8|93.6|\n| |AnomalDF+Ours|98.5|99.4|97.8|98.8|67.8|64.9|94.1|\n| |Dinomaly|99.6|99.8|99|98.3|68.7|68.7|94.6|\n| |Dinomaly+Ours|99.7|99.8|99.1|98.44|68.9|68.9|94.8|\n|**VisA**|UniAD|91.5|93.6|88.5|98|32.7|38.4|76.1|\n| |UniAD+Ours|92.1|94|88.9|98.6|34|39|86.4|\n| |Glad|90.1|91.4|86.7|97.4|33.9|39.4|91.5|\n| |Glad+Ours|93.2|94.1|89.2|98.1|40.7|43.7|91.5|\n| |HVQ-Trans|91.5|93.4|88.1|98.5|35.5|39.6|86.4|\n| |HVQ-Trans+Ours|93.4|95.2|89.3|98.6|41.4|45|86.8|\n| |AnomalDF|90.5|91.4|86.2|97.4|39.6|40.4|86.3|\n| |AnomalDF+Ours|94.3|95.1|90.6|99.2|44.6|45.5|86.3|\n| |Dinomaly|98.7|98.9|96.1|98.7|52.5|55.4|94.5|\n| |Dinomaly+Ours|98.7|99|96.3|98.8|53.2|55.8|94.7|\n|**MPDD**|HVQ-Trans|86.5|87.9|85.6|96.9|26.4|30.5|88.0|\n||HVQ-Trans+Ours|93.1|95.4|90.3|97.5|34.1|37.0|82.9|\n| |Dinomaly|97.3|98.5|95.6|99.1|60|59.8|96.7|\n| |Dinomaly+Ours|97.5|98.5|95.8|99.2|60.2|59.9|96.7|\n|**BTAD**|HVQ-Trans|90.9|97.8|94.8|96.7|43.2|48.7|75.6|\n| |HVQ-Trans+Ours|93.3|98.6|96|97.3|47|50.2|76.2|\n| |Dinomaly|95.4|98.5|95.5|97.9|70.1|68|76.5|\n| |Dinomaly+Ours|95.5|98.6|95.8|98.1|74.3|69.8|77.5|\n\n**Q2:** Concern over the performance gaps compared to SOTA methods and some performance decrease.\n\n**A2:** Thank you for raising this concern. \n\nThe performance gains of our method is crystal clear. To address the confusion, we would like to provide the following clarifications:\n\n1. **Fair experimental setup**: All comparisons (baseline/+Ours) are conducted with identical image resolutions and template counts to ensure fair evaluation.\n\n2. **Comprehensive validation**: As shown in Table R7, CostFilter-AD was applied to a range of recent multi-class anomaly detection methods, including UniAD (NeurIPS’22), GLAD (ECCV’24), HVQ-Trans (NeurIPS’23), AnomalDF (WACV’25), and Dinomaly (CVPR’25). We evaluated these models on standard benchmarks such as MVTec-AD, VisA, MPDD, and BTAD. **Consistent improvements** were observed in category-averaged metrics, see the link (https://anonymous.4open.science/r/ICML-ID8276/PDF.pdf) for more details.\n\n3. **SOTA performance**: When integrated with Dinomaly, CostFilter-AD achieves the best performance across all evaluation metrics on the four benchmarks. For example, AUROC scores (image/pixel) reach 99.7%/98.4% on MVTec-AD, 98.7%/98.8% on VisA, 97.5%/99.2% on MPDD, and 95.5%/98.1% on BTAD.\n\n4. **Clarifying the performance gap**: The gap you mentioned arise from different settings in **image resolution** and **number of templates**, particularly between AnomalDF (+Ours) and AnomalyDino, also noted by Reviewer kyJ7. This discrepancy is due to our method using a lightweight configuration (224×224 resolution, 3 template images per test sample), whereas AnomalDF uses higher resolutions (448 or 672) and utilizes all training images as templates. Further details are in responses A2 and A3 to Reviewer kyJ7.\n\n5. **Category performance VS average performance**: While there may be minor fluctuations in performance within certain categories, our multi-class AD model substantially improves average metrics across datasets.\n\n6. **Strong qualitative support**: In our submission, we provide comprehensive qualitative results in Figures 1, 3, 5, 8, 9, 10, and 11, clearly demonstrating the effectiveness and adaptability of our method.\n\nWe sincerely hope that our clarifications can address your concerns. If have any remaining questions, please let us know, and we will do our best to address them.", "claims_and_evidence": "The strategy proposed by the author is simple and effective, and has been fully proved.", "methods_and_evaluation_criteria": "The experimental metrics adopted by the author are based on other experiments.\n If the comparison of the calculation cost and memory cost introduced by the current module can be added, the experiment will be more complete.", "theoretical_claims": "Although the method lacks mathematical proofs, its experiments and ablation studies investigate the existence and impact of matching noise.", "experimental_designs_or_analyses": "The experimental design and analysis are reasonable. The use of MVTec-AD and VisA datasets to validate both single-class and multi-class anomaly detection effectively demonstrates the method's strong generalization capability.", "relation_to_broader_scientific_literature": "The paper introduces the concept of matching cost filtering, which has been used in stereo matching (e.g, optical flow estimation) but has not been used in UAD.", "essential_references_not_discussed": "None", "other_strengths_and_weaknesses": "My biggest concern is the performance of the CostFilter-AD still shows some gaps compared to SOTA methods, and even it introduces some performance decrease.", "other_comments_or_suggestions": "None", "questions_for_authors": "See above.", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Meta-review: This paper received mixed scores, including three weak accepts and one weak reject. Most reviewers acknowledged that the proposed method is well-designed and that the experiments are thorough. Initially, reviewers raised several concerns, including the need for comparisons with additional baselines (Reviewers Yvmv and fSfi), validation on more datasets (Reviewer fSfi), computational efficiency (Reviewers Yvmv, kyJ7, and LUDM), fairness in comparisons (Reviewer fSfi), and the extent of performance gains (Reviewer LUDM). However, all of these concerns were fully addressed during the rebuttal. One reviewer noted that the performance still lags slightly behind some state-of-the-art methods. Nevertheless, they acknowledged that the performance could be further improved with more advanced backbone models, and that the contribution remains novel and significant. AC has also reviewed the paper, the reviewer comments, and the rebuttal, and agrees that the motivation is clear, the paper is well-written, and the experimental evaluation is solid. Therefore, the AC recommends acceptance. It is encouraged that all additional experiments and discussions presented in the rebuttal be incorporated into the final version.
Decision: Accept (poster)