Skip to main content

Out of Distribution Detection for Medical Images

  • 1037 Accesses

Part of the Lecture Notes in Computer Science book series (LNIP,volume 12959)


Neural network architectures behave in unpredictable ways when testing on inputs which do not resemble their training data. It is valuable to detect any out-of-distribution (OOD) inputs to make any overseers aware of the limitations of the model’s output. To address this need, a large number of methods for detecting OOD inputs have been proposed and tested on small datasets such as CIFAR10, SVHN, or LSUN. The purpose of this study is to determine the effectiveness of different methods for OOD detection on the domain of medical images. We investigate three common OOD detection methods (Maximum Softmax Probability, Confidence Branch, and Outlier Exposure) and report their effectiveness on widely used medical image datasets. We find that OOD detection metrics are volatile and can have large changes in performance in a short amount of training steps. Moreover, we also observe that OOD detection is sensitive to the choice of hyperparameters. Our code is reproducible at this link (


  • Out of distribution detection
  • Medical image processing
  • Deep learning

This is a preview of subscription content, access via your institution.

Buying options

USD   29.95
Price excludes VAT (USA)
  • DOI: 10.1007/978-3-030-87735-4_10
  • Chapter length: 10 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
USD   54.99
Price excludes VAT (USA)
  • ISBN: 978-3-030-87735-4
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
Softcover Book
USD   69.99
Price excludes VAT (USA)
Fig. 1.
Fig. 2.


  1. Bendale, A., Boult, T.: Towards open set deep networks. arXiv:1511.06233 [cs], November 2015.

  2. California Healthcare Foundation, EyePACS: Diabetic Retinopathy Detection (2015).

  3. Cao, T., Huang, C.W., Hui, D.Y.T., Cohen, J.P.: A benchmark of medical out of distribution detection (2020)

    Google Scholar 

  4. DeVries, T., Taylor, G.W.: Learning confidence for out-of-distribution detection in neural networks. arXiv preprint arXiv:1802.04865 (2018)

  5. Gal, Y., Ghahramani, Z.: Dropout as a bayesian approximation: representing model uncertainty in deep learning, October 2016.

  6. Gao, L., Wu, S.: Response score of deep learning for out-of-distribution sample detection of medical images. J. Biomed. Inform. 107, 103442 (2020).

    CrossRef  Google Scholar 

  7. Halabi, S.S., et al.: The RSNA pediatric bone age machine learning challenge. Radiology 290(2), 498–503 (2019)

    CrossRef  Google Scholar 

  8. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385 (2015)

  9. Hendrycks, D., Gimpel, K.: A baseline for detecting misclassified and out-of-distribution examples in neural networks. In: International Conference on Learning Representations (2016)

    Google Scholar 

  10. Hendrycks, D., Mazeika, M., Dietterich, T.: Deep anomaly detection with outlier exposure. In: International Conference on Learning Representations (2018)

    Google Scholar 

  11. Henriksson, J., Berger, C., Borg, M., Tornberg, L., Raman Sathyamoorthy, S., Englund, C.: Performance analysis of out-of-distribution detection on trained neural networks. Inform. Softw. Technol. 130, 106409 (2021).

    CrossRef  Google Scholar 

  12. Ioffe, S., Szegedy, C.: Batch normalization: accelerating deep network training by reducing internal covariate shift. arXiv:1502.03167 [cs], March 2015.

  13. Johnson, A.E., et al.: MIMIC-CXR-JPG, a large publicly available database of labeled chest radiographs. arXiv preprint arXiv:1901.07042 (2019)

  14. Kingma, D.P., Ba, J.: Adam: a method for stochastic optimization, January 2017.

  15. Krizhevsky, A.: Learning multiple layers of features from tiny images. University of Toronto (2009)

    Google Scholar 

  16. Krizhevsky, A., Sutskever, I., Hinton, G.E.: ImageNet classification with deep convolutional neural networks. In: NIPS (2012)

    Google Scholar 

  17. Lakshminarayanan, B., Pritzel, A., Blundell, C.: Simple and scalable predictive uncertainty estimation using deep ensembles, November 2017.

  18. Lecun, Y., Bottou, L., Bengio, Y., Haffner, P.: Gradient-based learning applied to document recognition. Proc. IEEE 86(11), 2278–2324 (1998).

    CrossRef  Google Scholar 

  19. Lee, K., Lee, H., Lee, K., Shin, J.: Training confidence-calibrated classifiers for detecting out-of-distribution samples. In: International Conference on Learning Representations (2018)

    Google Scholar 

  20. Li, X., Lu, Y., Desrosiers, C., Liu, X.: Out-of-distribution detection for skin lesion images with deep isolation forest. In: Liu, M., Yan, P., Lian, C., Cao, X. (eds.) MLMI 2020. LNCS, vol. 12436, pp. 91–100. Springer, Cham (2020).

    CrossRef  Google Scholar 

  21. Liang, S., Li, Y., Srikant, R.: Enhancing the reliability of out-of-distribution image detection in neural networks. In: International Conference on Learning Representations (2018)

    Google Scholar 

  22. Linmans, J., van der Laak, J., Litjens, G.: Efficient out-of-distribution detection in digital pathology using multi-head convolutional neural networks. In: Arbel, T., Ben Ayed, I., de Bruijne, M., Descoteaux, M., Lombaert, H., Pal, C. (eds.) Proceedings of the Third Conference on Medical Imaging with Deep Learning. Proceedings of Machine Learning Research, vol. 121, pp. 465–478. PMLR, 06–08 July 2020.

  23. Nguyen, A., Yosinski, J., Clune, J.: Deep neural networks are easily fooled: high confidence predictions for unrecognizable images. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 427–436 (2015)

    Google Scholar 

  24. Rajpurkar, P., et al.: MURA: large dataset for abnormality detection in musculoskeletal radiographs. arXiv preprint arXiv:1712.06957 (2017)

  25. Roady, R., Hayes, T.L., Kemker, R., Gonzales, A., Kanan, C.: Are open set classification methods effective on large-scale datasets? Plos One 15(9) (2020).

  26. Wang, N., Chen, C., Xie, Y., Ma, L.: Brain tumor anomaly detection via latent regularized adversarial network. CoRR abs/2007.04734 (2020).

  27. Wu, J., Zhang, Q., Xu, G.: Tiny ImageNet challenge. Technical report, Stanford University (2017)

    Google Scholar 

  28. Yu, F., Seff, A., Zhang, Y., Song, S., Funkhouser, T., Xiao, J.: LSUN: construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365 (2015)

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to Oliver Zhang .

Editor information

Editors and Affiliations

1 Electronic supplementary material

Below is the link to the electronic supplementary material.

Supplementary material 1 (pdf 298 KB)

Rights and permissions

Reprints and Permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Verify currency and authenticity via CrossMark

Cite this paper

Zhang, O., Delbrouck, JB., Rubin, D.L. (2021). Out of Distribution Detection for Medical Images. In: , et al. Uncertainty for Safe Utilization of Machine Learning in Medical Imaging, and Perinatal Imaging, Placental and Preterm Image Analysis. UNSURE PIPPI 2021 2021. Lecture Notes in Computer Science(), vol 12959. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-87734-7

  • Online ISBN: 978-3-030-87735-4

  • eBook Packages: Computer ScienceComputer Science (R0)