RareCLIP: Rarity-Aware Online Zero-Shot Industrial Anomaly Detection
Abstract
Large vision-language models such as CLIP have made significant strides in zero-shot anomaly detection through prompt engineering. However, most existing methods typically process each test image individually, ignoring the practical rarity of abnormal patches in real-world scenarios. Although some batch-based approaches exploit the rarity by processing multiple samples concurrently, they generally introduce unacceptable latency for real-time applications. To mitigate these limitations, we propose RareCLIP, a novel online zero-shot anomaly detection framework that enables sequential image processing in real-time without requiring prior knowledge of the target domain. RareCLIP capitalizes on the zero-shot capabilities of CLIP and integrates a dynamic test-time rarity estimation mechanism. A key innovation of our framework is the introduction of a prototype patch feature memory bank, which aggregates representative features from historical observations and continuously updates their corresponding rarity measures. For each incoming image patch, RareCLIP computes a rarity score by aggregating the rarity measures of its nearest neighbors within the memory bank. Moreover, we introduce a prototype sampling strategy based on dissimilarity to enhance computational efficiency, as well as a similarity calibration strategy to enhance the robustness of rarity estimation. Extensive experiments demonstrate that RareCLIP attains state-of-the-art performance with 98.2% image-level AUROC on MVTec AD and 94.4% on VisA, while achieving a latency of 59.4 ms. Code is available at https://github.com/hjf02/RareCLIP.
Cite
Text
He et al. "RareCLIP: Rarity-Aware Online Zero-Shot Industrial Anomaly Detection." International Conference on Computer Vision, 2025.Markdown
[He et al. "RareCLIP: Rarity-Aware Online Zero-Shot Industrial Anomaly Detection." International Conference on Computer Vision, 2025.](https://mlanthology.org/iccv/2025/he2025iccv-rareclip/)BibTeX
@inproceedings{he2025iccv-rareclip,
title = {{RareCLIP: Rarity-Aware Online Zero-Shot Industrial Anomaly Detection}},
author = {He, Jianfang and Cao, Min and Peng, Silong and Xie, Qiong},
booktitle = {International Conference on Computer Vision},
year = {2025},
pages = {24478-24487},
url = {https://mlanthology.org/iccv/2025/he2025iccv-rareclip/}
}