Anomaly detection (AD) is a crucial machine learning task that aims to learn patterns from a set of normal training samples to identify abnormal samples in test data. Most existing AD studies assume that the training and test data are drawn from the same data distribution, but the test data can have large distribution shifts arising in many real-world applications due to different natural variations such as new lighting conditions, object poses, or background appearances, rendering existing AD methods ineffective in such cases. In this paper, we consider the problem of anomaly detection under distribution shift and establish performance benchmarks on three widely-used AD and out-of-distribution (OOD) generalization datasets. We demonstrate that simple adaptation of state-of-the-art OOD generalization methods to AD settings fails to work effectively due to the lack of labeled anomaly data. We further introduce a novel robust AD approach to diverse distribution shifts by minimizing the distribution gap between in-distribution and OOD normal samples in both the training and inference stages in an unsupervised way. Our extensive empirical results on the three datasets show that our approach substantially outperforms state-of-the-art AD methods and OOD generalization methods on data with various distribution shifts, while maintaining the detection accuracy on in-distribution data.
翻译:异常检测(AD)是一项关键的机器学习任务,旨在从一组正常的训练样本中学习模式,识别测试数据中的异常样本。大多数现有的AD研究假定训练和测试数据来自同一数据分布,但由于不同的自然变化(例如新的光照条件、物体姿态或背景外观),测试数据可能存在大的分布转移,在许多实际应用中使现有的AD方法失效。本文考虑异常检测中的分布偏移问题,并在三个广泛使用的AD和外部分布(OOD)泛化数据集上建立性能基准。我们证明了目前最先进的OOD泛化方法简单适应AD设置无法有效工作,因为缺乏有标记的异常数据。我们进一步介绍了一种新颖的鲁棒AD方法,通过在无监督的方式下最小化训练和推断阶段内分布偏移从而将不同的分布转移融合到一起。我们在三个数据集上进行了广泛的实证结果,表明我们的方法在具有不同分布转移的数据上显著优于最先进的AD方法和OOD泛化方法,同时保持对训练数据的检测准确性。