Unsupervised out of distribution detection�in digital pathology
Gabriel Raya
30th November 2020
MSc. Thesis for the degree of Master of Science in Computing Science – Data Science specialization
Twan Van Laarhoven
Assistant professor - Data Science
Jasper Linmans
PhD Candidate - Uncertainty estimation
Deep Learning Success
Unsupervised out-of-distribution detection in digital pathology
3
Example: Handwritten Digit Recognition System
Unsupervised out-of-distribution detection in digital pathology
4
Model trained on MNIST
(in-distribution)
Smiley face
(out-distribution (OoD))
Demo: https://yumiw.csb.app/
Deep learning fails to OOD inputs
Unsupervised out-of-distribution detection in digital pathology
5
Pipeline: Protecting predictive models
Unsupervised out-of-distribution detection in digital pathology
6
Model trained on MNIST
Deep Learning
OOD detector
“4”
Out-of-distribution detection allows us to measure how a model generalizes to domain shift, detecting if the model knows what it knows!
Why deep learning fails to OOD inputs?
Unsupervised out-of-distribution detection in digital pathology
7
a) Neural Network (NN)
Predictive Uncertainty
Sources of uncertainty:
Unsupervised out-of-distribution detection in digital pathology
8
a) Neural Network (NN)
b) Ensembles of 50 NNs
c) NN trained using Adaptive scale Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) [Chen et al., 2014; Springenberg et al., 2016]
Predictive Uncertainty
Unsupervised out-of-distribution detection in digital pathology
9
Digital Pathology
Unsupervised out-of-distribution detection in digital pathology
10
Patient tissue samples
Glass slides
A WSI with healthy tissue
Digital Pathology
Labels are expensive!
Unsupervised out-of-distribution detection is a promising avenue!
Unsupervised out-of-distribution detection in digital pathology
11
Healthy tissue
Tumor tissue
OOD detection applications in pathology
Unsupervised out-of-distribution detection in digital pathology
12
Healthy tissue
Tumor tissue
Research question
Unsupervised out-of-distribution detection in digital pathology
13
Data
Unsupervised out-of-distribution detection in digital pathology
14
Methods
Unsupervised out-of-distribution detection in digital pathology
15
Random Prior Networks
Unsupervised out-of-distribution detection in digital pathology
16
On top, two predictors (green) were trained to fit two randomly generated priors (red). On the bottom, we obtain uncertainties from the difference between predictors and priors. Dots correspond
to training points xi
TEST vs X
Random Prior Networks
Unsupervised out-of-distribution detection in digital pathology
17
Doesn’t work!
Unsupervised out-of-distribution detection in digital pathology
18
Likelihood-based Deep Generative Model (DGM)
Unsupervised out-of-distribution detection in digital pathology
19
Likelihood-based Deep Generative Model (DGM)
Unsupervised out-of-distribution detection in digital pathology
20
VAE
Training: Healthy
Testing: Tumor
Variational Autoencoders (VAEs)
Unsupervised out-of-distribution detection in digital pathology
21
Samples generated by the VAE resembles the data distribution.
Variational Autoencoders
Unsupervised out-of-distribution detection in digital pathology
22
* Same phenomenon happens in autoregressive models and flow-based models [Nalisnick et al., 2018]
Why VAEs fails to OOD detection?
Unsupervised out-of-distribution detection in digital pathology
23
Epistemic uncertainty in VAEs
Unsupervised out-of-distribution detection in digital pathology
24
BVAEs requires doing Bayesian inference: Stochastic Gradient Hamiltonian Montecarlo1 instead of SGD
Why VAEs fails to OOD detection?
Unsupervised out-of-distribution detection in digital pathology
25
A 2-dimensional projection of a 100-dimensional Isotropic Gaussian.
Point with highest density
Samples concentrate here!
Typicality in VAEs
Unsupervised out-of-distribution detection in digital pathology
26
Points with highest density
Samples concentrate here!
Density of States Estimation (DoSE) [Morningstar et al., 2020]
Unsupervised out-of-distribution detection in digital pathology
27
Density of States Estimation (DoSE)
Unsupervised out-of-distribution detection in digital pathology
28
T1 | T2 | T3 | T4 | T5 |
160.1767 | 361.4301 | 201.2534 | 236.4269 | -384.114 |
97.28395 | 353.8612 | 256.5773 | 238.588 | -313.327 |
135.925 | 356.8224 | 220.8974 | 218.1117 | -333.544 |
196.5389 | 386.6683 | 190.1294 | 244.7873 | -424.759 |
237.7352 | 409.1786 | 171.4434 | 262.2122 | -467.235 |
186.4038 | 394.6253 | 208.2215 | 214.5554 | -367.506 |
... | … | ... | … | … |
... | … | ... | … | … |
94.06613 | 346.7294 | 252.6633 | 206.3037 | -302.648 |
One class SVM
Results
Unsupervised out-of-distribution detection in digital pathology
29
Results in Digital Pathology
Unsupervised out-of-distribution detection in digital pathology
30
Conclusions
Unsupervised out-of-distribution detection in digital pathology
31
Conclusions
Unsupervised out-of-distribution detection in digital pathology
32
Conclusions
Unsupervised out-of-distribution detection in digital pathology
33
Future work
Unsupervised out-of-distribution detection in digital pathology
34
Take home message
Unsupervised out-of-distribution detection in digital pathology
35
Questions?
Unsupervised out-of-distribution detection in digital pathology
36
References
Unsupervised out-of-distribution detection in digital pathology
37