用SVD分析ViT内部表示,生成可解释的异常检测图谱。
SVD-Based Typicality Maps for Out-of-Distribution Detection in Vision Transformers

- 通过SVD提取关键特征向量,构建每层内在的紧凑表示。
- 在CIFAR-100上实现媲美现有方法的异常检测性能。
- 无需重新训练或暴露于异常数据,适合模型诊断与部署监控。
我们提出一种分析视觉变换器(ViTs)内部表示的方法,利用其学习参数的几何特性。对每个仿射层的权重矩阵进行奇异值分解(SVD),并将激活投影到主要右奇异向量上,得到各层固有的紧凑表示。在每一层上拟合类条件密度模型,生成每类的典型性得分,并沿网络深度堆叠为典型性图:二维总结类证据在网络中的演化过程。基于这些图,我们推导出两个后处理异常检测分数:原型对齐分数(PAS),衡量与类参考原型模式的一致性;多层软投票(MLSV)分数,捕捉跨层共识而无需存储原型。在针对CIFAR-100微调的ViT-B/16上,所提分数在不需重训练或异常数据暴露的情况下,实现了具有竞争力的检测性能。
原文摘要 · Abstract (English)
We present a method for analyzing the internal representations of Vision Transformers (ViTs) exploiting the geometry of their learned parameters. Each affine layer's weight matrix is factored via Singular Value Decomposition (SVD), and activations are projected onto the leading right singular vectors to obtain compact, layer-intrinsic representations. A class-conditional density model is then fitted at each layer, producing per-class \emph{typicality scores} that are stacked across depth into \emph{typicality maps}: two-dimensional summaries of how class-specific evidence evolves through the network. From these maps, we derive two post-hoc scores for Out-Of-Distribution (OOD) detection: a \emph{Prototype Alignment Score} (PAS), measuring agreement with class reference prototype patterns, and a \emph{Multi-Layer Soft Voting} (MLSV) score, capturing cross-layer consensus without stored prototypes. On ViT-B/16 fine-tuned on CIFAR-100, the proposed scores achieve competitive detection performance without retraining or OOD exposure.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。