通过残差对齐实现少样本异常检测,提升跨类别泛化能力。
Res$^2$CLIP: Few-Shot Generalist Anomaly Detection with Residual-to-Residual Alignment

- 将多模态对齐移至统一残差空间,消除特征偏差。
- 在多个数据集上显著优于现有方法,少样本下仍保持高精度。
- 适合需要快速适配新类别的工业异常检测场景。
少样本通用异常检测要求模型在不重新训练的情况下泛化到新类别,但在真实场景中面临样本稀缺和类别快速变化的挑战。现有基于CLIP的方法存在两大问题:粗粒度统一文本提示难以适应细粒度前景-背景差异,导致跨粒度不匹配;在辅助数据集上微调会破坏CLIP固有的开放世界泛化能力,引发跨类别泛化性能下降。为此,我们提出将多模态对齐完全转移到统一的残差空间,残差表示能自然消除区域间细粒度正常特征差异及类别特异性偏见,同时解决上述两个问题。基于此,我们设计了首个残差到残差对齐框架Res$^2$CLIP,该框架在CLIP的残差空间中对称地桥接视觉与文本模态,从残差视角发展出三个分支:基于文本提示的分支、基于视觉提示的分支,以及创新的残差到残差对齐分支。所有可学习优化均被限制在残差域内,残差对齐优化目标迫使模型关注相对异常偏差,而非优化类别特定特征。在多个数据集上的实验验证了架构的有效性。代码已公开于https://github.com/hito2448/Res2CLIP。
原文摘要 · Abstract (English)
Few-shot Generalist Anomaly Detection requires models to generalize to novel categories without retraining, posing significant challenges in real-world scenarios with scarce samples and rapidly changing categories. Existing CLIP-based methods face two major challenges: coarse-grained unified text prompts struggle to adapt to fine-grained foreground-background differences, causing cross-granularity mismatch; and fine-tuning on auxiliary datasets disrupts CLIP's inherent open-world generalization due to domain shift, leading to cross-category generalization degradation. To address these, we propose to shift multimodal alignment entirely into a unified residual space, where residual representations naturally eliminate fine-grained normal feature differences across regions and class-specific biases, simultaneously resolving both problems. Based on this insight, Res$^2$CLIP, the first residual-to-residual alignment framework that symmetrically bridges visual and text modalities within CLIP's residual space, is designed. The framework is developed from a residual perspective into three branches: a text prompt-based branch, a visual prompt-based branch, and a novel residual-to-residual alignment branch. All learnable optimizations are constrained within the residual domain, and the residual alignment optimization objectives are designed to force the model to focus on relative anomaly deviations rather than optimizing class-specific features. Experiments on multiple datasets demonstrate the effectiveness of our architecture. The code is available at https://github.com/hito2448/Res2CLIP.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。