The separation between training and deployment of machine learning models implies that not all scenarios encountered in deployment can be anticipated during training, and therefore relying solely on advancements in training has its limits. Out-of-distribution (OOD) detection is an important area that stress-tests a model's ability to handle unseen situations: Do models know when they don't know? Existing OOD detection methods either incur extra training steps, additional data or make nontrivial modifications to the trained network. In contrast, in this work, we propose an extremely simple, post-hoc, on-the-fly activation shaping method, ASH, where a large portion (e.g. 90%) of a sample's activation at a late layer is removed, and the rest (e.g. 10%) simplified or lightly adjusted. The shaping is applied at inference time, and does not require any statistics calculated from training data. Experiments show that such a simple treatment enhances in-distribution and out-of-distribution distinction so as to allow state-of-the-art OOD detection on ImageNet, and does not noticeably deteriorate the in-distribution accuracy. Video, animation and code can be found at: https://andrijazz.github.io/ash
翻译:分离训练和部署意味着在部署中不能预期所有场景,因此仅依赖于训练的进展存在其局限性。异域检测是一个重要领域,可以测试模型处理未见情况的能力:模型知道它们不知道吗?现有的OOD检测方法要么增加额外的训练步骤、额外的数据或对训练过的网络进行非平凡的修改。相比之下,在这项工作中,我们提出了一种极其简单的后处理、即时激活形状化方法ASH,在这种方法中,一个样本的一个后期层中大部分(例如90%)的激活被去除,剩余部分(例如10%)被简化或轻微调整。该形状化应用于推理时间,不需要从训练数据中计算任何统计数据。实验证明,这种简单的处理方法增强了内部和外部分布的区别,以允许在ImageNet上实现最先进的OOD检测,而且不会明显降低内部分布的准确性。视频、动画和代码可在以下网址中找到:https://andrijazz.github.io/ash。