# Unsupervised Continual Anomaly Detection with Contrastively-learned Prompt

arXiv: https://arxiv.org/abs/2401.01010 · HTML: https://mlsanity.com/paper/2401.01010/

## Key facts

- Cited by 31 papers in the map (data through 14 Oct 2026).
- Builds on 31 of its 45 references that are in the map.
- First posted on arXiv 2 Jan 2024.

## Builds on (most cited first, 30 of 31)

- [Adam: A Method for Stochastic Optimization](https://mlsanity.com/paper/1412.6980/) (2014)
- [Overcoming catastrophic forgetting in neural networks](https://mlsanity.com/paper/1612.00796/) (2016)
- [Learning to Prompt for Continual Learning](https://mlsanity.com/paper/2112.08654/) (2021)
- [Towards Total Recall in Industrial Anomaly Detection](https://mlsanity.com/paper/2106.08265/) (2021)
- [P-Tuning v2: Prompt Tuning Can Be Comparable to Fine-tuning Universally Across Scales and Tasks](https://mlsanity.com/paper/2110.07602/) (2021)
- [PaDiM: a Patch Distribution Modeling Framework for Anomaly Detection and Localization](https://mlsanity.com/paper/2011.08785/) (2020)
- [CutPaste: Self-Supervised Learning for Anomaly Detection and Localization](https://mlsanity.com/paper/2104.04015/) (2021)
- [DRAEM -- A discriminatively trained reconstruction embedding for surface anomaly detection](https://mlsanity.com/paper/2108.07610/) (2021)
- [Anomaly Detection via Reverse Distillation from One-Class Embedding](https://mlsanity.com/paper/2201.10703/) (2022)
- [Uninformed Students: Student-Teacher Anomaly Detection with Discriminative Latent Embeddings](https://mlsanity.com/paper/1911.02357/) (2019)
- [CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows](https://mlsanity.com/paper/2107.12571/) (2021)
- [Sub-Image Anomaly Detection with Deep Pyramid Correspondences](https://mlsanity.com/paper/2005.02357/) (2020)
- [Multiresolution Knowledge Distillation for Anomaly Detection](https://mlsanity.com/paper/2011.11108/) (2020)
- [A Unified Model for Multi-class Anomaly Detection](https://mlsanity.com/paper/2206.03687/) (2022)
- [FastFlow: Unsupervised Anomaly Detection and Localization via 2D Normalizing Flows](https://mlsanity.com/paper/2111.07677/) (2021)
- [VT-ADL: A Vision Transformer Network for Image Anomaly Detection and Localization](https://mlsanity.com/paper/2104.10036/) (2021)
- [Task-Free Continual Learning](https://mlsanity.com/paper/1812.03596/) (2018)
- [Same Same But DifferNet: Semi-Supervised Defect Detection with Normalizing Flows](https://mlsanity.com/paper/2008.12577/) (2020)
- [Deep Industrial Image Anomaly Detection: A Survey](https://mlsanity.com/paper/2301.11514/) (2023)
- [Student-Teacher Feature Pyramid Matching for Anomaly Detection](https://mlsanity.com/paper/2103.04257/) (2021)
- [CFA: Coupled-hypersphere-based Feature Adaptation for Target-Oriented Anomaly Localization](https://mlsanity.com/paper/2206.04325/) (2022)
- [Fully Convolutional Cross-Scale-Flows for Image-based Defect Detection](https://mlsanity.com/paper/2110.02855/) (2021)
- [DSR -- A dual subspace re-projection network for surface anomaly detection](https://mlsanity.com/paper/2208.01521/) (2022)
- [Real3D-AD: A Dataset of Point Cloud Anomaly Detection](https://mlsanity.com/paper/2309.13226/) (2023)
- [Pushing the Limits of Fewshot Anomaly Detection in Industry Vision: Graphcore](https://mlsanity.com/paper/2301.12082/) (2023)
- [PyramidFlow: High-Resolution Defect Contrastive Localization using Pyramid Normalizing Flow](https://mlsanity.com/paper/2303.02595/) (2023)
- [IM-IAD: Industrial Image Anomaly Detection Benchmark in Manufacturing](https://mlsanity.com/paper/2301.13359/) (2023)
- [Anomaly Detection with Conditioned Denoising Diffusion Models](https://mlsanity.com/paper/2305.15956/) (2023)
- [ReConPatch : Contrastive Patch Representation Learning for Industrial Anomaly Detection](https://mlsanity.com/paper/2305.16713/) (2023)
- [Anomaly localization by modeling perceptual features](https://mlsanity.com/paper/2008.05369/) (2020)

## Built on by (most cited first, 30 of 31)

- [A Survey on Visual Anomaly Detection: Challenge, Approach, and Prospect](https://mlsanity.com/paper/2401.16402/) (2024)
- [MANTA: A Large-Scale Multi-View and Visual-Text Anomaly Detection Dataset for Tiny Objects](https://mlsanity.com/paper/2412.04867/) (2024)
- [One-for-More: Continual Diffusion Model for Anomaly Detection](https://mlsanity.com/paper/2502.19848/) (2025)
- [Salvaging the Overlooked: Leveraging Class-Aware Contrastive Learning for Multi-Class Anomaly Detection](https://mlsanity.com/paper/2412.04769/) (2024)
- [Distribution Prototype Diffusion Learning for Open-set Supervised Anomaly Detection](https://mlsanity.com/paper/2502.20981/) (2025)
- [ReplayCAD: Generative Diffusion Replay for Continual Anomaly Detection](https://mlsanity.com/paper/2505.06603/) (2025)
- [Scale-Aware Contrastive Reverse Distillation for Unsupervised Medical Anomaly Detection](https://mlsanity.com/paper/2503.13828/) (2025)
- [A Survey on Foundation-Model-Based Industrial Defect Detection](https://mlsanity.com/paper/2502.19106/) (2025)
- [Continual-MEGA: A Large-scale Benchmark for Generalizable Continual Anomaly Detection](https://mlsanity.com/paper/2506.00956/) (2025)
- [Towards Fine-Grained Vision-Language Alignment for Few-Shot Anomaly Detection](https://mlsanity.com/paper/2510.26464/) (2025)
- [Towards an Incremental Unified Multimodal Anomaly Detection: Augmenting Multimodal Denoising From an Information Bottleneck Perspective](https://mlsanity.com/paper/2603.02629/) (2026)
- [ONER: Online Experience Replay for Incremental Anomaly Detection](https://mlsanity.com/paper/2412.03907/) (2024)
- [Prompt Engineering in Segment Anything Model: Methodologies, Applications, and Emerging Challenges](https://mlsanity.com/paper/2507.09562/) (2025)
- [Towards Continual Visual Anomaly Detection in the Medical Domain](https://mlsanity.com/paper/2508.18013/) (2025)
- [CKNN: Cleansed k-Nearest Neighbor for Unsupervised Video Anomaly Detection](https://mlsanity.com/paper/2408.03014/) (2024)
- [A Comprehensive Survey for Real-World Industrial Defect Detection: Challenges, Approaches, and Prospects](https://mlsanity.com/paper/2507.13378/) (2025)
- [GCR: Geometry-Consistent Routing for Task-Agnostic Continual Anomaly Detection](https://mlsanity.com/paper/2601.01856/) (2026)
- [Toward Long-Tailed Online Anomaly Detection through Class-Agnostic Concepts](https://mlsanity.com/paper/2507.16946/) (2025)
- [MECAD: A multi-expert architecture for continual anomaly detection](https://mlsanity.com/paper/2512.15323/) (2025)
- [Continual Visual Anomaly Detection on the Edge: Benchmark and Efficient Solutions](https://mlsanity.com/paper/2604.06435/) (2026)
- [Normality-Preserving Continual Industrial Anomaly Detection via Orthogonal LoRA Banks](https://mlsanity.com/paper/2606.02042/) (2026)
- [CL-Anomaly: Layer-Adaptive Mixture-of-Experts with Multimodal Large Language Model for Continual Learning in Anomaly Detection](https://mlsanity.com/paper/2607.02930/) (2026)
- [Normality Addition via Normality Detection in Industrial Image Anomaly Detection Models](https://mlsanity.com/paper/2407.19849/) (2024)
- [AdapTS: Lightweight Teacher-Student Approach for Multi-Class and Continual Visual Anomaly Detection](https://mlsanity.com/paper/2603.17530/) (2026)
- [Exploring Multimodal Prompts For Unsupervised Continuous Anomaly Detection](https://mlsanity.com/paper/2603.21562/) (2026)
- [Mixture Prototype Flow Matching for Open-Set Supervised Anomaly Detection](https://mlsanity.com/paper/2605.02438/) (2026)
- [Rethinking Continual Anomaly Detection on the Edge: Benchmarking Under Realistic Industrial Conditions](https://mlsanity.com/paper/2605.24251/) (2026)
- [DeCoFlow: Structural Decomposition of Normalizing Flows for Continual Anomaly Detection](https://mlsanity.com/paper/2606.26687/) (2026)
- [Towards Principled Continual Anomaly Detection: A Systematic Framework and Benchmark Scenarios](https://mlsanity.com/paper/2607.18289/) (2026)
- [Memory-Bounded Continuation of Greedy Sampling for Continual Anomaly Detection](https://mlsanity.com/paper/2608.15277/) (2026)

## Abstract (arXiv)

Unsupervised Anomaly Detection (UAD) with incremental training is crucial in industrial manufacturing, as unpredictable defects make obtaining sufficient labeled data infeasible. However, continual learning methods primarily rely on supervised annotations, while the application in UAD is limited due to the absence of supervision. Current UAD methods train separate models for different classes sequentially, leading to catastrophic forgetting and a heavy computational burden. To address this issue, we introduce a novel Unsupervised Continual Anomaly Detection framework called UCAD, which equips the UAD with continual learning capability through contrastively-learned prompts. In the proposed UCAD, we design a Continual Prompting Module (CPM) by utilizing a concise key-prompt-knowledge memory bank to guide task-invariant `anomaly' model predictions using task-specific `normal' knowledge. Moreover, Structure-based Contrastive Learning (SCL) is designed with the Segment Anything Model (SAM) to improve prompt learning and anomaly segmentation results. Specifically, by treating SAM's masks as structure, we draw features within the same mask closer and push others apart for general feature representations. We conduct comprehensive experiments and set the benchmark on unsupervised continual anomaly detection and segmentation, demonstrating that our method is significantly better than anomaly detection methods, even with rehearsal training. The code will be available at https://github.com/shirowalker/UCAD.
