无需训练数据即可高效检测分布外样本,方法简单且效果领先。
Frustratingly Easy Feature Reconstruction for Out-of-Distribution Detection
- 通过分类器权重正交分解提取类别已知子空间,映射特征并计算重构误差。
- 在多个基准上达到领先性能,且不依赖训练数据访问。
- 适合数据隐私敏感场景,代码开源可复现。
分布外(OOD)检测有助于模型识别训练类别之外的数据,对安全应用至关重要。尽管基于特征的后处理方法可通过评估特征空间中的差异来解决该问题,且无需修改网络参数,但通常需要访问训练数据,这在某些数据隐私场景下不适用。本文提出一种简单而有效的后处理方法——基于分类器的特征重构(ClaFR),从子空间投影角度出发:首先对分类器权重进行正交分解,提取类别已知子空间;然后将原始数据特征映射至该子空间,获得新表示;最后通过计算子空间内的特征重构误差确定OOD分数。相比现有方法,本方法无需访问训练数据,在多个OOD基准上实现领先性能。代码已开源:https://github.com/Aie0923/ClaFR。
原文摘要 · Abstract (English)
Out-of-distribution (OOD) detection helps models identify data outside the training categories, crucial for security applications. While feature-based post-hoc methods address this by evaluating data differences in the feature space without changing network parameters, they often require access to training data, which may not be suitable for some data privacy scenarios. This may not be suitable in scenarios where data privacy protection is a concern. In this paper, we propose a simple yet effective post-hoc method, termed Classifier-based Feature Reconstruction (ClaFR), from the perspective of subspace projection. It first performs an orthogonal decomposition of the classifier's weights to extract the class-known subspace, then maps the original data features into this subspace to obtain new data representations. Subsequently, the OOD score is determined by calculating the feature reconstruction error of the data within the subspace. Compared to existing OOD detection algorithms, our method does not require access to training data while achieving leading performance on multiple OOD benchmarks. Our code is released at https://github.com/Aie0923/ClaFR.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。