Effective OOD detection is crucial for reliable machine learning models, yet most current methods are limited in practical use due to requirements like access to training data or intervention in training. We present a novel method for detecting OOD data in deep neural networks based on transformation smoothness between intermediate layers of a network (BLOOD), which is applicable to pre-trained models without access to training data. BLOOD utilizes the tendency of between-layer representation transformations of in-distribution (ID) data to be smoother than the corresponding transformations of OOD data, a property that we also demonstrate empirically for Transformer networks. We evaluate BLOOD on several text classification tasks with Transformer networks and demonstrate that it outperforms methods with comparable resource requirements. Our analysis also suggests that when learning simpler tasks, OOD data transformations maintain their original sharpness, whereas sharpness increases with more complex tasks.
翻译:有效的分布外(OOD)检测对于可靠的机器学习模型至关重要,然而当前大多数方法由于需要访问训练数据或干预训练过程等限制,在实际应用中受到局限。我们提出一种基于深度神经网络中间层之间变换平滑性的OOD数据检测新方法(BLOOD),该方法适用于无需访问训练数据的预训练模型。BLOOD利用分布内(ID)数据的层间表示变换比OOD数据对应变换更平滑的趋势——我们在Transformer网络上通过实验验证了这一特性。我们在多个文本分类任务上使用Transformer网络评估BLOOD,证明其性能优于资源需求相当的方法。我们的分析还表明,在学习较简单任务时,OOD数据的变换保持其原有的锐度,而随着任务复杂度增加,锐度会相应提升。