Our work investigates out-of-distribution (OOD) detection as a neural network output explanation problem. We learn a heatmap representation for detecting OOD images while visualizing in- and out-of-distribution image regions at the same time. Given a trained and fixed classifier, we train a decoder neural network to produce heatmaps with zero response for in-distribution samples and high response heatmaps for OOD samples, based on the classifier features and the class prediction. Our main innovation lies in the heatmap definition for an OOD sample, as the normalized difference from the closest in-distribution sample. The heatmap serves as a margin to distinguish between in- and out-of-distribution samples. Our approach generates the heatmaps not only for OOD detection, but also to indicate in- and out-of-distribution regions of the input image. In our evaluations, our approach mostly outperforms the prior work on fixed classifiers, trained on CIFAR-10, CIFAR-100 and Tiny ImageNet. The code is publicly available at: https://github.com/jhornauer/heatmap_ood.
翻译:我们的工作将分布外检测视为神经网络输出解释问题。我们学习一种热图表示方法,用于检测分布外图像,同时可视化图像中的分布内和分布外区域。基于训练好的固定分类器,我们训练一个解码器神经网络,根据分类器特征和类别预测,生成分布内样本零响应热图和分布外样本高响应热图。我们的主要创新在于分布外样本的热图定义——即与最近分布内样本的归一化差异。该热图作为区分分布内与分布外样本的边界。我们的方法不仅生成用于分布外检测的热图,还能指示输入图像中的分布内和分布外区域。在评估中,我们的方法在CIFAR-10、CIFAR-100和Tiny ImageNet上训练的固定分类器任务中,总体性能优于先前工作。代码已公开于:https://github.com/jhornauer/heatmap_ood。