Lune

ICCV2025Top-tier venue

Salvaging the Overlooked: Leveraging Class-Aware Contrastive Learning for Multi-Class Anomaly Detection

Lei Fan, Junjie Huang, Donglin Di, Anyang Su, Tianyou Song, Maurice Pagnucco, Yang Song

Abstract

For anomaly detection (AD), early approaches often train separate models for individual classes, yielding high performance but posing challenges in scalability and resource management. Recent efforts have shifted toward training a single model capable of handling multiple classes. However, directly extending early AD methods to multiclass settings often results in degraded performance. In this paper, we investigate this performance degradation observed in reconstruction-based methods, identifying the key issue: inter-class confusion. This confusion emerges when a model trained in multi-class scenarios incorrectly reconstructs samples from one class as those of another, thereby exacerbating reconstruction errors. To this end, we propose a simple yet effective modification, called class-aware contrastive learning (CCL). By explicitly leveraging raw object category information (e.g., carpet or wood) as supervised signals, we introduce local CL to refine multiscale dense features, and global CL to obtain more compact feature representations of normal patterns, thereby effectively adapting the models to multi-class settings. Experiments across five datasets validate the effectiveness of our approach, demonstrating significant improvements and superior performance compared to state-of-the-art methods. Notably, ablation studies indicate that pseudo-class labels can achieve comparable performance.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

6 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • A Semantically Disentangled Unified Model for Multi-category 3D Anomaly Detection cites Towards Total Recall in Industrial Anomaly Detection
  • A Semantically Disentangled Unified Model for Multi-category 3D Anomaly Detection cites Supervised Contrastive Learning
  • Unsupervised Multi-View Visual Anomaly Detection via Progressive Homography-Guided Alignment cites Towards Total Recall in Industrial Anomaly Detection
  • SAGE: A Visual Language Model for Anomaly Detection via Fact Enhancement and Entropy-aware Alignment cites Towards Total Recall in Industrial Anomaly Detection
  • Supervised Contrastive Learning cites A Simple Framework for Contrastive Learning of Visual Representations
  • Supervised Contrastive Learning cites What Makes for Good Views for Contrastive Learning?
  • What Makes for Good Views for Contrastive Learning? cites A Simple Framework for Contrastive Learning of Visual Representations
  • CSI: Novelty Detection via Contrastive Learning on Distributionally Shifted Instances cites A Simple Framework for Contrastive Learning of Visual Representations
  • CSI: Novelty Detection via Contrastive Learning on Distributionally Shifted Instances cites Supervised Contrastive Learning
  • CSI: Novelty Detection via Contrastive Learning on Distributionally Shifted Instances cites What Makes for Good Views for Contrastive Learning?
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. Chain of World: World Model Thinking in Latent MotionFuxiang Yang, Donglin Di, Lulu Tang, Xuancheng Zhang et al.CVPR 2026 · 11 citations
  2. SAGE: A Visual Language Model for Anomaly Detection via Fact Enhancement and Entropy-aware AlignmentGuoxin Zang, Xue Li, Donglin Di, Lanshun Nie et al.ACM MM 2025 · 8 citations
  3. Visual Prompt-Agnostic EvolutionJunze Wang, Lei Fan, Dezheng Zhang, Weipeng Jing et al.ICLR 2026 · 4 citations
  4. A Semantically Disentangled Unified Model for Multi-category 3D Anomaly DetectionSuYeon Kim, Wongyu Lee, MyeongAh ChoCVPR 2026 · 3 citations
  5. Unsupervised Multi-View Visual Anomaly Detection via Progressive Homography-Guided AlignmentXintao Chen, Xiaohao Xu, Bozhong Zheng, Yun Liu et al.AAAI 2026 · 1 citation

Builds on28

  1. A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
  2. Supervised Contrastive LearningPrannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna et al.NeurIPS 2020 · 7,049 citations
  3. What Makes for Good Views for Contrastive Learning?Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan et al.NeurIPS 2020 · 1,631 citations
  4. Towards Total Recall in Industrial Anomaly DetectionKarsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard Schölkopf et al.CVPR 2022 · 1,301 citations
  5. CSI: Novelty Detection via Contrastive Learning on Distributionally Shifted InstancesJihoon Tack, Sangwoo Mo, Jongheon Jeong, Jinwoo ShinNeurIPS 2020 · 755 citations

Related papers

  1. One-for-All: Proposal Masked Cross-Class Anomaly DetectionXincheng Yao, Chongyang Zhang, Ruoqi Li, Jun Sun et al.AAAI 2023 · 42 citations
  2. Hierarchical Semantic Contrast for Scene-aware Video Anomaly DetectionShengyang Sun, Xiaojin GongCVPR 2023
  3. MaskAD: Parallel Masked Autoencoder for Multi-class Unsupervised Anomaly DetectionRuiying Lu, Gang Liu, Kang Li, Long Tian et al.AAAI 2026
  4. A Unified Model for Multi-class Anomaly DetectionZhiyuan You, Lei Cui, Yujun Shen, Kai Yang et al.NeurIPS 2022 · 585 citations
  5. Applying Contrastive Learning to Code Vulnerability Type ClassificationChen Ji, Su Yang, Hongyu Sun, Yuqing ZhangEMNLP 2024 · 6 citations
Dusk over the sea between two cliffs drawn in fine vertical lines