Anomaly detection, the task of identifying unusual samples in data, often relies on a large set of training samples. In this work, we consider the setting of few-shot anomaly detection in images, where only a few images are given at training. We devise a hierarchical generative model that captures the multi-scale patch distribution of each training image. We further enhance the representation of our model by using image transformations and optimize scale-specific patch-discriminators to distinguish between real and fake patches of the image, as well as between different transformations applied to those patches. The anomaly score is obtained by aggregating the patch-based votes of the correct transformation across scales and image regions. We demonstrate the superiority of our method on both the one-shot and few-shot settings, on the datasets of Paris, CIFAR10, MNIST and FashionMNIST as well as in the setting of defect detection on MVTec. In all cases, our method outperforms the recent baseline methods.
翻译:异常检测是查明数据中异常样本的任务,通常依靠大量培训样本。在这项工作中,我们考虑在图像中设置几发异常检测,在培训中只提供几张图像。我们设计了一个等级分解模型,捕捉每张培训图像的多尺度补丁分布。我们通过图像转换和优化特定比例的补丁分来进一步体现我们的模型,以区分图像的真实和假补丁,以及这些补丁的不同变异。通过对各尺度和图像区域正确变异的补丁票进行汇总,取得了异常分数。我们展示了我们方法的优势,既表现在一发和几发环境中,表现在巴黎、CIFAR10、MNIST和FashionMNIST的数据集上,也表现在MVTec上的缺陷检测中。在所有情况下,我们的方法都超越了最近的基线方法。