Training Auxiliary Prototypical Classifiers for Explainable Anomaly Detection in Medical Image Segmentation

Wonwoo Cho, Jeonghoon Park, Jaegul ChooWACV 2023

Introduction

Deep learning models for medical image segmentation, typically based on Fully Convolutional Networks (FCNs), often exhibit overconfidence when encountering Out-of-Distribution (OoD) data. In clinical practice, a model trained on data from one scanner or hospital may fail when deployed in a different environment due to variations in noise, viewpoints, or artifacts. These "silent failures" pose significant risks, as clinicians may unknowingly rely on inaccurate segmentations. Existing uncertainty estimation methods, such as Deep Ensembles, are computationally intensive and often lack interpretability. This work introduces an auxiliary prototypical classifier designed to detect anomalies and provide visual explanations without compromising segmentation performance.

Methodology

The proposed framework integrates an auxiliary module into the intermediate layers of a standard segmentation network, such as a U-Net. This module performs two primary functions: prototypical clustering and distance-based anomaly scoring.

Overview of the proposed framework and the prototypical clustering mechanism.

Prototypical Clustering

Instead of directly mapping features to labels, the model learns a latent space where features of each anatomical class (e.g., left ventricle, myocardium) are clustered around a central "prototype." During training, an attraction loss pulls in-distribution features toward their respective class prototypes, while a repulsion loss pushes outliers away. This class-aware approach allows the model to understand that anomalies look different depending on the anatomical structure being analyzed.

Anomaly Detection and Outlier Exposure

To detect anomalies, the system calculates the Mahalanobis distance between input feature maps and the learned prototypes. Features that fall significantly outside the established clusters are flagged as OoD. To improve robustness, the authors employ "Outlier Exposure" (OE), using heavily transformed training images (rotated, flipped, or distorted) as synthetic outliers to teach the model the boundaries of the "normal" distribution.

Experimental Setup

The method was evaluated on two distinct medical imaging tasks:

  1. Cardiac Segmentation: Utilizing the M&Ms (Multi-Centre, Multi-Vendor) dataset. Models were trained on specific vendors (In-Distribution) and tested on others (OoD), as well as on long-axis views.
  2. Prostate Segmentation: Utilizing the PROSTATEx dataset for training (transversal T2w scans) and testing against PROMISE12 or sagittal-view scans as OoD.

Results and Discussion

The auxiliary prototypical classifier significantly outperformed baseline methods like Monte Carlo Dropout (MCDO) and standard Deep Ensembles in anomaly detection tasks. For instance, on the M&Ms dataset, the proposed method achieved an AUROC of 0.8319 for vendor-based anomalies, a substantial improvement over MCDO's 0.6006. It also demonstrated a much lower False Positive Rate (FPR@TPR95), reducing the likelihood of false alarms in a clinical setting.

Explainability through Score Maps

A key contribution of this work is the generation of per-pixel distance maps, which serve as "explanation maps." These heatmaps highlight specific regions that the model perceives as anomalous.

Qualitative results showing input images and corresponding score maps for various anomaly types.

As shown in the qualitative results, the model effectively identifies irregular textures and rare anatomical structures. Interestingly, the maps often highlight the apical and basal slices of the heart, which are anatomically complex and frequently under-represented in training data, providing clinicians with valuable context regarding the model's uncertainty.

Performance Maintenance

Crucially, the addition of the auxiliary module does not degrade the primary segmentation task. Quantitative analysis showed that the Dice scores remained stable or even improved slightly compared to baseline models, addressing a common concern that safety-critical modules might interfere with core model accuracy.

Conclusion

This paper presents a robust, "plug-and-play" solution for anomaly detection in medical image segmentation. By leveraging intermediate features and class-aware prototypes, the model provides both high detection sensitivity and intuitive visual explanations. Future work will explore the extension of this framework to 3D volumetric data and investigate the impact of different synthetic outlier generation strategies.

Summary updated

BibTeX
@inproceedings{cho2023training,
  author = {Wonwoo Cho and Jeonghoon Park and Jaegul Choo},
  title = {{Training Auxiliary Prototypical Classifiers for Explainable Anomaly Detection in Medical Image Segmentation}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2023},
  url = {https://openreview.net/forum?id=E1MTxIG3zq6},
}
Figure