Title
题目
MedIAnomaly: A comparative study of anomaly detection in medical images
MedIAnomaly:医学图像异常检测的对比研究
01
文献速递介绍
异常检测(AD)是一个基础的机器学习问题(钱德拉等人,2009;庞等人,2021),其旨在检测偏离预期正常模式的异常样本。它基于这样一个假设来运作:大量具有相似模式的正常样本易于获取,而具有多样且未知模式的异常样本难以全面收集。因此,现有的异常检测方法通常仅使用正常数据来训练模型。这减轻了对异常样本的需求,推动了异常检测在医学领域的应用,尤其是在罕见病识别和健康筛查中,因为异常样本在这些场景中通常既稀少又多样。以美国为例,超过7000种罕见病影响着3000多万人,尽管每种疾病单独影响的人数少于20万(约占人口的0.06%)。这些疾病的罕见性和多样性使得为每种疾病收集足够的样本来训练一个典型的监督模型变得不可行。这一事实使得异常检测成为辅助放射科医生从医学图像中识别潜在异常的合适解决方案。 众多研究(施莱格尔等人,2017,2019;毛等人,2020;谭等人,2021;施吕特等人,2022;蔡等人,2022)都致力于医学异常检测。然而,由于缺乏全面且公平的比较,一些结论并不清晰,这阻碍了该领域的发展。一方面,现有研究中使用不同的数据集或划分方式,这妨碍了结果的可重复性和可比性。结果,一些研究低估了基线水平并得出有偏差的结论。例如,有几篇论文(田等人,2021,2023;赵等人,2021,2022)在如Hyper - Kvasir(博尔格利等人,2020)或OCT2017(克曼尼等人,2018)等数据集上进行实验。然而,如表1所示,我们用3.2.1节中描述的默认设置实现的一个简单自动编码器(AE)在这些数据集上取得了近乎完美的性能。这表明这些数据集对于异常检测来说并不具有挑战性,因此在这些数据集上评估异常检测方法并不合适。另一方面,尽管许多方法属于同一范式,但缺乏统一的实现方式导致网络架构和训练技巧各异,从而造成不公平的比较。以基于重建的方法为例,fAnoGAN(施莱格尔等人,2019)在编码器和解码器中采用了带有多个卷积层的残差块(何等人,2016),AE - Flow(赵等人,2022)选择Wide ResNet - 50 - 2(扎戈鲁伊科和科莫达基斯,2016)作为编码器,而AE - U(毛等人,2020)使用没有任何特殊设计的普通卷积层。这些差异会干扰方法之间的比较,并导致结果不明确。总体而言,基于不合适的数据集或不一致的实现方式进行的比较是不合理的。为解决这些问题,医学异常检测领域迫切需要全面的数据集和统一的方法实现。 尽管已经有一些针对医学异常检测的综述和基准研究(费尔南多等人,2021;鲍尔等人,2021;拉戈吉安尼斯等人,2023;鲍等人,2023;蔡等人,2023a),但它们并未对方法进行全面且公平的比较。费尔南多等人(2021)对基于机器学习的医学异常检测技术及其应用和局限性进行了系统综述,但未进行实验。鲍尔等人(2021)在统一的数据集上比较了一系列基于医学重建的异常检测方法。然而,该比较仅局限于重建方法,并且实验仅在单一图像模态(脑部MRI)上进行。这可能导致结论不完整。此外,他们对私有数据集的使用也妨碍了结果的可重复性。蔡等人(2023a)在重新整理的数据集上评估了各种医学异常检测方法,但没有深入分析这些方法。鲍等人(2023)在重新整理的公共医学数据集上评估了一系列异常检测方法。然而,这些方法中的大多数最初是为工业应用而非医学领域设计的。 值得注意的是,拉戈吉安尼斯等人(2023)最近对多个数据集上的各种先进异常检测方法进行了详细分析。他们广泛研究了异常大小和强度的影响、有限训练数据的作用,以及自监督预训练对权重初始化和主干网络预训练的性能影响。然而,他们的分析没有全面涵盖一些虽非最新但具有代表性的方法,例如各种基于自动编码器的方法变体以及某些利用专门合成异常的自监督方法。此外,他们在分析同一范式内的方法时没有采用统一的网络架构。因此,典型方法中组件和网络架构的固有属性仍未得到探索。 与拉戈吉安尼斯等人(2023)不同,我们旨在通过在全面的数据集上进行比较并采用尽可能公平的网络配置,进一步研究典型方法中关键组件的作用和固有属性。这项工作的主要贡献总结如下: - 我们提出了一种常见异常检测方法的分类体系,涵盖基于重建的方法(图像重建和特征重建)、基于自监督学习的方法(单阶段和两阶段)以及基于特征参考的方法(知识蒸馏和特征建模)。并相应地进行了全面的文献综述。 - 我们收集了七个医学数据集,包含五种图像模态,以方便对异常检测进行评估。 - 我们使用收集到的数据集对三十种代表性方法进行了全面比较。此外,还分析了这些方法中所使用关键组件的作用。 - 通过实验和分析,我们突出了医学异常检测领域尚未解决的挑战和未来可能的发展方向。
Aastract
摘要
Anomaly detection (AD) aims at detecting abnormal samples that deviate from the expected normal patterns.Generally, it can be trained merely on normal data, without a requirement for abnormal samples, and therebyplays an important role in rare disease recognition and health screening in the medical domain. Despite theemergence of numerous methods for medical AD, the lack of a fair and comprehensive evaluation causesambiguous conclusions and hinders the development of this field. To address this problem, this paper buildsa benchmark with unified comparison. Seven medical datasets with five image modalities, including chestX-rays, brain MRIs, retinal fundus images, dermatoscopic images, and histopathology images, are curatedfor extensive evaluation. Thirty typical AD methods, including reconstruction and self-supervised learningbased methods, are involved in comparison of image-level anomaly classification and pixel-level anomalysegmentation. Furthermore, for the first time, we systematically investigate the effect of key components inexisting methods, revealing unresolved challenges and potential future directions.
异常检测(AD)旨在检测偏离预期正常模式的异常样本。通常,它仅需基于正常数据进行训练,无需异常样本,因而在医学领域的罕见病识别和健康筛查中发挥着重要作用。尽管已出现众多医学异常检测方法,但由于缺乏公平且全面的评估,导致结论模糊,阻碍了该领域的发展。为解决这一问题,本文构建了一个用于统一比较的基准。精心挑选了涵盖胸部X光、脑部MRI、眼底图像、皮肤镜图像和组织病理图像这五种图像模态的七个医学数据集,以进行广泛评估。三十种典型的异常检测方法(包括基于重建和自监督学习的方法)参与了图像级异常分类和像素级异常分割的比较。此外,我们首次系统地研究了现有方法中关键组件的作用,揭示了尚未解决的挑战和未来可能的发展方向。
Conclusion
结论
This paper presents a comprehensive benchmark for medical anomaly detection, incorporating seven datasets and a comparison of thirtytypical methods. Our extensive evaluation and analysis reveal severalkey findings and challenges to guide future research in this field.Firstly, in the absence of pre-training, reconstruction-based methods demonstrate greater robustness compared to SSL-based methods.Among the reconstruction-based methods, the simplest AE serves asa good baseline, delivering satisfactory performance across variousdatasets and near-perfect metrics on simple datasets like Hyper-Kvasirand OCT2017. Therefore, we strongly recommend researchers to include AE as a reference in their comparisons. Moreover, our resultshighlight the importance of latent space configuration and reconstruction error measurement in reconstruction methods, which display asubstantial impact on performance. Regarding latent space configuration, datasets with near OOD (e.g., local anomalies) tend to benefit fromvery small latent sizes. Among these datasets, the more complex onesexhibit increasing optimal values of latent size. Conversely, datasetswith far OOD (e.g., global semantic anomalies) benefit from large latentsizes. In terms of reconstruction error measurement, it is crucial toemploy a distance function that captures the anomaly-related semanticdifference rather than only low-level intensity difference. This is whyperceptual loss outperforms 𝓁2 loss by a significant margin on mostdatasets. However, the current strategies for latent space configurationand reconstruction error measurement are still sub-optimal, presentinga promising avenue for further investigation.Additionally, we observe that ImageNet pre-trained weights exhibithigh effectiveness and potency in medical AD. They are successfullyemployed in various ways, including distance measurement, input datatransformation, and direct feature extraction. Fine-tuning these weightson task-specific datasets to enhance performance remains an unresolvedchallenge. Furthermore, the recent advancements in vision-languagemodels (VLMs) offer new possibilities for leveraging these powerfulpre-trained models in AD.Lastly, we identify several special settings for AD, such as the oneclass semi-supervised setting and the zero-/few-shot setting, whichclosely align with real-world scenarios and warrant further exploration.Particularly, the significant progress in VLMs facilitates the development of zero-/few-shot methods for AD, which should attract moreattention in the future.Overall, our benchmark establishes a foundation for researchersin medical AD, providing insights into the typical methods. We hopethat this work will contribute to the development of more effectiveand robust AD methods, ultimately benefiting the medical domain inrecognizing rare diseases and improving health screening.
本文针对医学异常检测提出了一项全面的基准研究,纳入了七个数据集并对三十种典型方法进行了对比。我们通过广泛的评估和分析,揭示了若干关键发现和挑战,旨在为该领域的未来研究提供指导。 首先,在没有预训练的情况下,基于重建的方法比基于自监督学习(SSL)的方法表现出更强的鲁棒性。在基于重建的方法中,最简单的自动编码器(AE)可作为良好的基线,在各种数据集上均能提供令人满意的性能,且在Hyper-Kvasir和OCT2017等简单数据集上接近完美指标。因此,我们强烈建议研究人员在对比实验中纳入AE作为参考。此外,我们的研究结果强调了重建方法中潜在空间配置和重建误差度量的重要性,这些因素对性能有显著影响。关于潜在空间配置,近离群(OOD)数据集(如局部异常)往往受益于非常小的潜在空间尺寸;在这些数据集中,较复杂的数据集表现出最优潜在空间尺寸逐渐增大的趋势。相反,远离群数据集(如全局语义异常)则受益于较大的潜在空间尺寸。在重建误差度量方面,关键是要使用能够捕捉与异常相关的语义差异的距离函数,而不仅仅是低层的强度差异。这就是为什么在大多数数据集上,感知损失显著优于𝓁₂损失的原因。然而,当前的潜在空间配置和重建误差度量策略仍非最优,这为进一步研究提供了有前景的方向。 此外,我们观察到ImageNet预训练权重在医学异常检测中表现出高效性和有效性。它们通过多种方式成功应用,包括距离度量、输入数据变换和直接特征提取。但在特定任务数据集上对这些权重进行微调以提升性能仍是一个未解决的挑战。此外,视觉语言模型(VLMs)的最新进展为在异常检测中利用这些强大的预训练模型提供了新的可能性。 最后,我们指出了异常检测的几种特殊设置,如单类半监督设置和零/少样本设置,这些设置与现实场景密切相关,值得进一步探索。特别是,VLMs的显著进展促进了零/少样本异常检测方法的发展,这在未来应引起更多关注。 总体而言,我们的基准研究为医学异常检测领域的研究人员奠定了基础,提供了对典型方法的洞察。我们希望这项工作将有助于开发更有效和鲁棒的异常检测方法,最终在医学领域识别罕见疾病和改善健康筛查方面发挥作用。
Figure
图

Fig. 1. Overview of reconstruction-based anomaly detection. The reconstruction model is trained to minimize reconstruction loss on normal images. During inference, lesions inabnormal images are assumed unable to be reconstructed by the trained model, and in turn yield a high reconstruction error.
图1. 基于重建的异常检测概述 重建模型通过训练使正常图像的重建损失最小化。在推理阶段,异常图像中的病变被假定为无法被训练好的模型重建,进而产生较高的重建误差。

Fig. 2. The architecture of the proposed LW-CTrans. (a) It consists of a hybrid CNN and Transformer encoder, a multi-stage feature fusion module and a decoder. (b) Multi-PathConvolution. © Multi-View Pooling Transformer.
图2. 所提出的LW-CTrans网络架构图 (a) 整体架构由CNN与Transformer混合编码器、多阶段特征融合模块和解码器组成。 (b) 多路径卷积(MPConv)模块。 © 多视图池化Transformer(MVPFormer)模块。

Fig. 3. Examples of datasets deemed too simple for AD, including the Hyper-Kvasirand OCT2017 datasets.

Fig. 4. Statistics of slice indices in our processed BraTS2021 dataset. A central crop was performed before slice extraction, resulting in index 0 corresponding to index 50 of theoriginal volume and index 69 corresponding to index 119 of the original volume.
图4. 处理后的BraTS2021数据集切片索引统计 在切片提取前进行了中心裁剪,导致索引0对应原始体积的索引50,索引69对应原始体积的索引119。

Fig. 5. Examples of the collected datasets for AD. Samples enclosed by the green dashed circle are normal, while others are abnormal.
图5. 异常检测(AD)收集的数据集示例 绿色虚线圆圈内的样本为正常样本,其他为异常样本。

Fig. 6. Visualization of the compared image-reconstruction methods on typical abnormal images. The first row displays input abnormal images along with the abnormal regions(if available). The second rows depict reconstructed images and anomaly maps generated by each method. The third column of BraTS2021 dataset depicts binarized predictionsat operating points of ⌈ Dice ⌉
图6. 典型异常图像上基于图像重建方法的可视化对比 第一行显示输入异常图像及异常区域(若有)。第二行展示各方法生成的重建图像和异常图。BraTS2021数据集的第三列显示在操作点⌈Dice⌉下的二值化预测结果。

Fig. 7. Visualization of the compared methods (excluding image-reconstruction methods) on typical abnormal images. The first row presents the input abnormal images,while the subsequent rows depict the anomaly maps generated by each method
图7. 典型异常图像上对比方法(不含图像重建类方法)的可视化 第一行展示输入异常图像,后续行展示各方法生成的异常图。

Fig. 8. T-SNE visualization for the latent representations of AE on the seven datasets. The performance of OC-SVM built on the latent representations is presented in the formatAUC/AP
图8. 自动编码器(AE)在七个数据集上的潜在表征T-SNE可视化 基于潜在表征构建的单类支持向量机(OC-SVM)性能以AUC/AP格式呈现

Fig. 9. Distribution of pixel-level anomaly scores calculated in image-space and feature-space. Scores are normalized through division by the maximum value. Note the substantialdifference in the vertical scale of (a) and (b)
图9. 图像空间与特征空间中像素级异常分数分布 分数通过除以最大值进行归一化。注意(a)和(b)在垂直刻度上的显著差异 (a) 图像空间异常分数分布 (b) 特征空间异常分数分布

Fig. 10. T-SNE visualization of representations learned through synthetic data classification. (a) CutPaste; (b) AnatPaste.
图10. 通过合成数据分类学习的表征的T-SNE可视化 (a)CutPaste合成数据;(b)AnatPaste合成数据

Fig. 11. Intensity distribution of normal and abnormal pixels in BraTS2021 dataset.
图11. BraTS2021数据集中正常像素与异常像素的强度分布
Table
表

Table 1Performance (AUC) of our implemented AE and prevailing works onHyper-Kvasir and OCT2017 datasets. The details of AE (Our impl.) areshown in Section 3.2.1. Results∗ are taken from Tian et al. (2021, 2023),results† are taken from Zhao et al. (2022), and results‡ are taken fromZhao et al. (2021) (See also references Chen et al., 2022; Perera et al.,2019; Rudolph et al., 2021; Yu et al., 2021).
表 1 我们实现的自动编码器(AE)与主流方法在 Hyper-Kvasir 和 OCT2017 数据集上的性能(AUC)对比AE(我们的实现)的细节见第 3.2.1 节。结果∗取自 Tian 等人(2021, 2023),结果†取自 Zhao 等人(2022),结果‡取自 Zhao 等人(2021)(另见参考文献 Chen 等人,2022;Perera 等人,2019;Rudolph 等人,2021;Yu 等人,2021)。

Table 2Summary of the datasets
表2 数据集概述

Table 3Default configuration for AE in reconstruction methods.
表3 重建方法中自动编码器(AE)的默认配置

Table 4Default configuration for SSL methods. Note that the output layer is a single layer atthe end of the cls/seg head. It is omitted in this table for simplicity
表4 自监督学习(SSL)方法的默认配置 注:输出层为分类/分割头末端的单一图层,为简洁起见本表中省略。


Table 5Summary of AD methods involved in the experiments. img-rec: image-reconstruction; feat-rec: feature-reconstruction; 1-stage-c: one-stage classification; 1-stage-s: one-stagesegmentation. IN: ImageNet pre-trained. †Methods only support sample-wise anomaly score.
表 5 实验涉及的异常检测(AD)方法概述img-rec:图像重建;feat-rec:特征重建;1-stage-c:单阶段分类;1-stage-s:单阶段分割;IN:ImageNet 预训练;†方法仅支持样本级异常评分

Table 6Performance on image-level AnoCls. In each paradigm, the best results are highlighted in red, while the second- and third- best results are highlighted in blue. img-rec: imagereconstruction; feat-rec: feature-reconstruction; 1-stage-c: one-stage classification; 1-stage-s: one-stage segmentation. †Methods utilize ImageNet pre-trained weights.
表6 图像级异常分类(AnoCls)性能 在每个范式中,最佳结果用红色高亮,第二和第三优结果用蓝色高亮。img-rec:图像重建;feat-rec:特征重建;1-stage-c:单阶段分类;1-stage-s:单阶段分割;†方法使用ImageNet预训练权重。

Table 7Performance on pixel-level AnoSeg. In each paradigm, the best results are highlightedin red, while the second- and third- best results are highlighted in blue. img-rec:image-reconstruction; feat-rec: feature-reconstruction; 1-stage-s: one-stage segmentation.†Methods utilize ImageNet pre-trained weights
表7 像素级异常分割(AnoSeg)性能 在每个范式中,最佳结果用红色高亮,第二和第三优结果用蓝色高亮。img-rec:图像重建;feat-rec:特征重建;1-stage-s:单阶段分割;†方法使用ImageNet预训练权重。

Table 8Number of network parameters (#Params) and FLOPs of AE with different hyperparameter settings.
表8 不同超参数设置下自动编码器(AE)的网络参数数量(#Params)和浮点运算量(FLOPs)

Table 9Performance of AE with different input size. 64 × 64 is the baseline. [d] indicates that the latent size is the same as the baseline, while [r] indicates that the compression rate isthe same as the baseline
表 9不同输入尺寸下自动编码器(AE)的性能以 64×64 为基线。[d] 表示潜在特征尺寸与基线相同,[r] 表示压缩率与基线相同

Table 10Performance of AE with different block depth
表 10 不同网络块深度下自动编码器(AE)的性能

Table 11Performance of AE with different basic width.
表 11 不同基础宽度下自动编码器(AE)的性能

Table 12Performance of AE with different latent size. The best two results are marked in bold and underlined.
表 12 不同潜在特征尺寸下自动编码器(AE)的性能最优的两个结果用粗体和下划线标注

Table 13Performance of SOTA feature reference-based methods.
表13 基于特征参考的最先进(SOTA)方法性能

Table 14Performance of VLM-based methods (Zhou et al., 2023) under the zero-shot setting. *The performance of the officially released weights.
表14 基于视觉语言模型(VLM)的方法(Zhou等人,2023)在零样本设置下的性能 使用官方发布权重的性能