Massoli Fabio Valerio, Falchi Fabrizio, Kantarci Alperen, Akti Seymanur, Ekenel Hazim Kemal, Amato Giuseppe
IEEE Trans Neural Netw Learn Syst. 2022 Jun;33(6):2313-2323. doi: 10.1109/TNNLS.2021.3130074. Epub 2022 Jun 1.
Anomalies are ubiquitous in all scientific fields and can express an unexpected event due to incomplete knowledge about the data distribution or an unknown process that suddenly comes into play and distorts the observations. Usually, due to such events' rarity, to train deep learning (DL) models on the anomaly detection (AD) task, scientists only rely on "normal" data, i.e., nonanomalous samples. Thus, letting the neural network infer the distribution beneath the input data. In such a context, we propose a novel framework, named multilayer one-class classification (MOCCA), to train and test DL models on the AD task. Specifically, we applied our approach to autoencoders. A key novelty in our work stems from the explicit optimization of the intermediate representations for the task at hand. Indeed, differently from commonly used approaches that consider a neural network as a single computational block, i.e., using the output of the last layer only, MOCCA explicitly leverages the multilayer structure of deep architectures. Each layer's feature space is optimized for AD during training, while in the test phase, the deep representations extracted from the trained layers are combined to detect anomalies. With MOCCA, we split the training process into two steps. First, the autoencoder is trained on the reconstruction task only. Then, we only retain the encoder tasked with minimizing the L distance between the output representation and a reference point, the anomaly-free training data centroid, at each considered layer. Subsequently, we combine the deep features extracted at the various trained layers of the encoder model to detect anomalies at inference time. To assess the performance of the models trained with MOCCA, we conduct extensive experiments on publicly available datasets, namely CIFAR10, MVTec AD, and ShanghaiTech. We show that our proposed method reaches comparable or superior performance to state-of-the-art approaches available in the literature. Finally, we provide a model analysis to give insights regarding the benefits of our training procedure.
异常现象在所有科学领域中都普遍存在,它可能表示由于对数据分布的了解不完整或某个未知过程突然起作用并扭曲观测结果而导致的意外事件。通常,由于此类事件的罕见性,为了在异常检测(AD)任务上训练深度学习(DL)模型,科学家们仅依赖“正常”数据,即非异常样本。这样,就让神经网络推断输入数据背后的分布。在这种背景下,我们提出了一种名为多层单类分类(MOCCA)的新颖框架,用于在AD任务上训练和测试DL模型。具体而言,我们将我们的方法应用于自动编码器。我们工作中的一个关键新颖之处在于对手头任务的中间表示进行显式优化。实际上,与将神经网络视为单个计算块的常用方法不同,即仅使用最后一层的输出,MOCCA明确利用了深度架构的多层结构。在训练期间,针对AD对每一层的特征空间进行优化,而在测试阶段,将从训练层提取的深度表示进行组合以检测异常。使用MOCCA,我们将训练过程分为两个步骤。首先,仅在重建任务上训练自动编码器。然后,我们仅保留负责在每个考虑的层上最小化输出表示与参考点(无异常训练数据质心)之间的L距离的编码器。随后,我们在推理时组合在编码器模型的各个训练层提取的深度特征以检测异常。为了评估使用MOCCA训练的模型的性能,我们在公开可用的数据集(即CIFAR10、MVTec AD和上海科技数据集)上进行了广泛的实验。我们表明,我们提出的方法达到了与文献中现有最先进方法相当或更优的性能。最后,我们提供了一个模型分析,以深入了解我们训练过程的优点。