# Contextual Affinity Distillation for Image Anomaly Detection

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

## Key facts

- Cited by 18 papers in the map (data through 14 Oct 2026).
- Builds on 29 of its 41 references that are in the map.
- First posted on arXiv 6 Jul 2023.

## Builds on (most cited first, 29 of 29)

- [Deep Residual Learning for Image Recognition](https://mlsanity.com/paper/1512.03385/) (2015)
- [Distilling the Knowledge in a Neural Network](https://mlsanity.com/paper/1503.02531/) (2015)
- [Generative Adversarial Networks](https://mlsanity.com/paper/2203.00667/) (2022)
- [Feature Pyramid Networks for Object Detection](https://mlsanity.com/paper/1612.03144/) (2016)
- [Fully Convolutional Networks for Semantic Segmentation](https://mlsanity.com/paper/1411.4038/) (2014)
- [Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles](https://mlsanity.com/paper/1612.01474/) (2016)
- [Wide Residual Networks](https://mlsanity.com/paper/1605.07146/) (2016)
- [Pyramid Scene Parsing Network](https://mlsanity.com/paper/1612.01105/) (2016)
- [Deep Anomaly Detection with Outlier Exposure](https://mlsanity.com/paper/1812.04606/) (2018)
- [Towards Total Recall in Industrial Anomaly Detection](https://mlsanity.com/paper/2106.08265/) (2021)
- [Memorizing Normality to Detect Anomaly: Memory-augmented Deep Autoencoder for Unsupervised Anomaly Detection](https://mlsanity.com/paper/1904.02639/) (2019)
- [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)
- [A Unifying Review of Deep and Shallow Anomaly Detection](https://mlsanity.com/paper/2009.11732/) (2020)
- [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)
- [Deep Learning for Anomaly Detection: A Survey](https://mlsanity.com/paper/1901.03407/) (2019)
- [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)
- [Structured Knowledge Distillation for Dense Prediction](https://mlsanity.com/paper/1903.04197/) (2019)
- [Learning Memory-guided Normality for Anomaly Detection](https://mlsanity.com/paper/2003.13228/) (2020)
- [Improving Unsupervised Defect Segmentation by Applying Structural Similarity to Autoencoders](https://mlsanity.com/paper/1807.02011/) (2018)
- [FastFlow: Unsupervised Anomaly Detection and Localization via 2D Normalizing Flows](https://mlsanity.com/paper/2111.07677/) (2021)
- [PANDA: Adapting Pretrained Features for Anomaly Detection and Segmentation](https://mlsanity.com/paper/2010.05903/) (2020)
- [Channel-wise Knowledge Distillation for Dense Prediction](https://mlsanity.com/paper/2011.13256/) (2020)
- [Towards Visually Explaining Variational Autoencoders](https://mlsanity.com/paper/1911.07389/) (2019)
- [DSR -- A dual subspace re-projection network for surface anomaly detection](https://mlsanity.com/paper/2208.01521/) (2022)
- [Iterative energy-based projection on a normal data manifold for anomaly localization](https://mlsanity.com/paper/2002.03734/) (2020)
- [G2D: Generate to Detect Anomaly](https://mlsanity.com/paper/2006.11629/) (2020)

## Built on by (most cited first, 18 of 18)

- [A Survey on Visual Anomaly Detection: Challenge, Approach, and Prospect](https://mlsanity.com/paper/2401.16402/) (2024)
- [Towards Generic Anomaly Detection and Understanding: Large-scale Visual-linguistic Model (GPT-4V) Takes the Lead](https://mlsanity.com/paper/2311.02782/) (2023)
- [SAM-LAD: Segment Anything Model Meets Zero-Shot Logic Anomaly Detection](https://mlsanity.com/paper/2406.00625/) (2024)
- [CSAD: Unsupervised Component Segmentation for Logical Anomaly Detection](https://mlsanity.com/paper/2408.15628/) (2024)
- [Dual-Modeling Decouple Distillation for Unsupervised Anomaly Detection](https://mlsanity.com/paper/2408.03888/) (2024)
- [Revisiting Deep Feature Reconstruction for Logical and Structural Industrial Anomaly Detection](https://mlsanity.com/paper/2410.16255/) (2024)
- [SALAD -- Semantics-Aware Logical Anomaly Detection](https://mlsanity.com/paper/2509.02101/) (2025)
- ["Stones from Other Hills can Polish Jade": Zero-shot Anomaly Image Synthesis via Cross-domain Anomaly Injection](https://mlsanity.com/paper/2501.15211/) (2025)
- [An Evidence-Based Post-Hoc Adjustment Framework for Anomaly Detection Under Data Contamination](https://mlsanity.com/paper/2510.21296/) (2025)
- [Detecting Abnormal Operations in Concentrated Solar Power Plants from Irregular Sequences of Thermal Images](https://mlsanity.com/paper/2406.16077/) (2024)
- [UniSLAD: A Unified Framework for Structural and Logical Industrial Visual Anomaly Detection](https://mlsanity.com/paper/2606.20768/) (2026)
- [Separating Novel Features for Logical Anomaly Detection: A Straightforward yet Effective Approach](https://mlsanity.com/paper/2407.17909/) (2024)
- [Tuned Reverse Distillation: Enhancing Multimodal Industrial Anomaly Detection with Crossmodal Tuners](https://mlsanity.com/paper/2412.08949/) (2024)
- [Risk-Based Thresholding for Reliable Anomaly Detection in Concentrated Solar Power Plants](https://mlsanity.com/paper/2503.19146/) (2025)
- [Learning local and global prototypes with optimal transport for unsupervised anomaly detection and localization](https://mlsanity.com/paper/2508.12927/) (2025)
- [TMUAD: Enhancing Logical Capabilities in Unified Anomaly Detection Models with a Text Memory Bank](https://mlsanity.com/paper/2508.21795/) (2025)
- [Generalist Multi-Class Anomaly Detection via Distillation to Two Heterogeneous Student Networks](https://mlsanity.com/paper/2509.24448/) (2025)
- [Physic-HM: Restoring Physical Generative Logic in Multimodal Anomaly Detection via Hierarchical Modulation](https://mlsanity.com/paper/2512.21650/) (2025)

## Abstract (arXiv)

Previous works on unsupervised industrial anomaly detection mainly focus on local structural anomalies such as cracks and color contamination. While achieving significantly high detection performance on this kind of anomaly, they are faced with logical anomalies that violate the long-range dependencies such as a normal object placed in the wrong position. In this paper, based on previous knowledge distillation works, we propose to use two students (local and global) to better mimic the teacher's behavior. The local student, which is used in previous studies mainly focuses on structural anomaly detection while the global student pays attention to logical anomalies. To further encourage the global student's learning to capture long-range dependencies, we design the global context condensing block (GCCB) and propose a contextual affinity loss for the student training and anomaly scoring. Experimental results show the proposed method doesn't need cumbersome training techniques and achieves a new state-of-the-art performance on the MVTec LOCO AD dataset.
