Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

On the use of Mahalanobis distance for out-of-distribution detection with neural networks for medical imaging

About

Implementing neural networks for clinical use in medical applications necessitates the ability for the network to detect when input data differs significantly from the training data, with the aim of preventing unreliable predictions. The community has developed several methods for out-of-distribution (OOD) detection, within which distance-based approaches - such as Mahalanobis distance - have shown potential. This paper challenges the prevailing community understanding that there is an optimal layer, or combination of layers, of a neural network for applying Mahalanobis distance for detection of any OOD pattern. Using synthetic artefacts to emulate OOD patterns, this paper shows the optimum layer to apply Mahalanobis distance changes with the type of OOD pattern, showing there is no one-fits-all solution. This paper also shows that separating this OOD detector into multiple detectors at different depths of the network can enhance the robustness for detecting different OOD patterns. These insights were validated on real-world OOD tasks, training models on CheXpert chest X-rays with no support devices, then using scans with unseen pacemakers (we manually labelled 50% of CheXpert for this research) and unseen sex as OOD cases. The results inform best-practices for the use of Mahalanobis distance for OOD detection. The manually annotated pacemaker labels and the project's code are available at: https://github.com/HarryAnthony/Mahalanobis-OOD-detection.

Harry Anthony, Konstantinos Kamnitsas• 2023

Related benchmarks

TaskDatasetResultRank
OOD DetectionMVTec Pill (Dissimilar)
AUROC71.36
90
OOD DetectionMVTec Metal Nut Dissimilar
AUROC0.669
90
OOD DetectionMVTec Pill (Similar)
AUROC73.18
90
OOD DetectionISIC Ink Artefacts (Similar)
AUROC77.4
70
OOD DetectionISIC Colour Chart Artefacts (Dissimilar)
AUROC0.9552
40
OOD DetectionISIC Colour Chart Artefacts Similar
AUROC97
40
OOD DetectionISIC Colour Chart Artefacts, Synth Dissimilar
AUROC94.48
40
OOD DetectionISIC Colour Chart Artefacts Synth Similar
AUROC0.9631
40
OOD DetectionISIC Ink Artefacts (Dissimilar)
AUROC63.71
40
OOD DetectionISIC Colour Chart Artefacts Similar (test)
AUROC0.9158
30
Showing 10 of 16 rows

Other info

Follow for update