Research map / Detection and segmentation / CNN features
DFM: Differentiable Feature Matching for Anomaly Detection
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes DFM, which turns nearest-neighbor feature matching into a differentiable pooling-based Feature Matching Network so the feature extractor (via adapters) and matching head can be trained end-to-end for anomaly detection.
Problem
Feature-matching anomaly detection methods use frozen or self-supervised feature extractors and handcrafted matching, so extraction and matching are optimized separately, giving suboptimal features for anomaly detection.
Approach
Reformulates nearest-neighbor matching as a matrix operation followed by two pooling stages (min then max), inserts learnable modulate layers before the pooling, treats the memory bank as trainable parameters, and fine-tunes adapters in the CLIP ViT so that gradients flow from anomaly scores back to the feature extractor; trained with a two-stage iterative schedule using SVDD-style and deviation-s
Key results
- In continual anomaly detection on MVTec AD, DFM-PatchCore reaches 96.9% instance AUROC and 51.1% pixel AP, versus 93.0% and 45.6% for UCAD.
- In 2-shot few-shot setting on MVTec AD, DFM-PatchCore improves I-AUROC over PatchCore (85.4 baseline in ablation to 92.7 with full method) per ablation.
- Ablation on 2-shot setting: FMN alone raises I-AUROC from 85.43 to 88.39 and iterative training of FMN and adapters reaches 92.73.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| replace PatchCore matching with DFM feature matching | PatchCore · MVTec AD continual, average | Instance AUROC: 66.9 -> 96.9 | Helped |
| replace PatchCore matching with DFM feature matching | PatchCore · MVTec AD continual, average | Pixel AP: 18.1 -> 51.1 | Helped |
| add DFM feature matching to CFA | CFA · MVTec AD continual | Instance AUROC: 93.0 -> 96.2 | Helped |
| add DFM feature matching to CFA | CFA · MVTec AD continual | Pixel AP: 45.6 -> 48.0 | Helped |
| add DFM feature matching to PatchCore | PatchCore · MVTec AD few-shot, 2 shots | Instance AUROC: 87.8 -> 95.0 | Helped |
| add FMN while keeping the backbone frozen (ablation) | PatchCore · MVTec AD 2-shot | Instance AUROC: 85.43 -> 88.39 | Helped |
| add FMN while keeping the backbone frozen (ablation) | PatchCore · MVTec AD 2-shot | Pixel AUROC: 95.87 -> 95.02 | Hurt |
| add adapters without FMN (ablation) | PatchCore · MVTec AD 2-shot | Instance AUROC: 85.43 -> 91.73 | Helped |
| add adapters without FMN (ablation) | PatchCore · MVTec AD 2-shot | Pixel AUROC: 95.87 -> 96.17 | Helped |
| jointly optimize FMN and adapters without iterative training (ablation) | PatchCore · MVTec AD 2-shot | Instance AUROC: 85.43 -> 84.27 | Hurt |
| jointly optimize FMN and adapters without iterative training (ablation) | PatchCore · MVTec AD 2-shot | Pixel AUROC: 95.87 -> 90.23 | Hurt |
| add iterative training of FMN and adapters (ablation) | PatchCore · MVTec AD 2-shot | Instance AUROC: 84.27 -> 92.73 | Helped |
Surprising findings
- Jointly training FMN and adapters without the two-stage iterative schedule degrades performance (I-AUROC 84.27 vs 85.43 frozen baseline).
Limitations
- Training memory and inference memory are higher than PatchCore.
- Joint end-to-end optimization is unstable without the two-stage iterative training schedule.
Experimental setup
Datasets: MVTec AD VisA CutPaste synthetic anomalies
Benchmarks: MVTec AD VisA
Metrics: I-AUROC P-AUROC P-AP Forgetting Measure FPS memory consumption
Baselines: PatchCore SPADE PaDiM CFA DNE UCAD GraphCore WinCLIP RegAD
Builds on: PatchCore UCAD CutPaste SPADE SVDD
Closest papers by meaning
- ResAD: A Simple Framework for Class Generalizable Anomaly Detection (NeurIPS 2024 · similarity 0.84)
- Scalable, Explainable and Provably Robust Anomaly Detection with One-Step Flow Matching (NeurIPS 2025 · similarity 0.84)
- CostFilter-AD: Enhancing Anomaly Detection through Matching Cost Filtering (ICML 2025 · similarity 0.84)
- Generating and Reweighting Dense Contrastive Patterns for Unsupervised Anomaly Detection (AAAI 2024 · similarity 0.83)
- Normal-Abnormal Guided Generalist Anomaly Detection (NeurIPS 2025 · similarity 0.83)
- RealNet: A Feature Selection Network with Realistic Synthetic Anomaly for Anomaly Detection (CVPR 2024 · similarity 0.83)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
