Johannes Hofmanninger
many slides by Georg Langs
Medical University of Vienna Department for Biomedical Imaging and Image-guided Therapy Computational Imaging Research Lab www.cir.meduniwien.ac.at
Unsupervised learning in medical imaging Discovering phenotypes and - - PowerPoint PPT Presentation
Unsupervised learning in medical imaging Discovering phenotypes and detecting anomalies Johannes Hofmanninger many slides by Georg Langs Medical University of Vienna Department for Biomedical Imaging and Image-guided Therapy Computational
Johannes Hofmanninger
many slides by Georg Langs
Medical University of Vienna Department for Biomedical Imaging and Image-guided Therapy Computational Imaging Research Lab www.cir.meduniwien.ac.at
CIR Lab Department of Biomedical Imaging and Image Guided Therapy Medical University of Vienna
www.cir.meduniwien.ac.at
Johannes Hofmanninger www.cir.meduniwien.ac.at
2
Johannes Hofmanninger www.cir.meduniwien.ac.at
3
Johannes Hofmanninger www.cir.meduniwien.ac.at
4
Johannes Hofmanninger www.cir.meduniwien.ac.at
5
2015 Olaf Ronneberger et al.
U-NET
Johannes Hofmanninger www.cir.meduniwien.ac.at
6
Johannes Hofmanninger www.cir.meduniwien.ac.at
7
Inject unlabelled data to improve representation
Have a small set of labelled data to train classification [Thomas Schlegl et al.]
Johannes Hofmanninger www.cir.meduniwien.ac.at
8
unsupervised fashion: objective is to become very good at representing the data
visual problems: the lower the layer, the easier the transfer
pretrained network, and the optimize for a specific problem
Figures from Gonzales & Woods Chap 13
Johannes Hofmanninger www.cir.meduniwien.ac.at
9
[Schlegl et al. MICCAI-MCV 2014]
Johannes Hofmanninger www.cir.meduniwien.ac.at
10
Internal Medicine / Oncology, Dep. Surgery, Dep. Biomed. Imag. & Img-guided Th., Molecular and Gender Imaging
Multi-modal, multi-parametric imaging Breast lesion detection and segmentation Probability map Computational segmentation
Johannes Hofmanninger www.cir.meduniwien.ac.at
11
Johannes Hofmanninger www.cir.meduniwien.ac.at
12
Now
Prediction
Image/report s Lab reports
Clinical informatio n
Johannes Hofmanninger www.cir.meduniwien.ac.at
13
Treatment
Prediction
Image/report s Lab reports
Clinical informatio n
Johannes Hofmanninger www.cir.meduniwien.ac.at
14
Johannes Hofmanninger www.cir.meduniwien.ac.at
15
Time
[Vogl et al. 2015]
OCT-Scan Macula Edema
Johannes Hofmanninger www.cir.meduniwien.ac.at
16
Data we observe Future we want to predict
Johannes Hofmanninger www.cir.meduniwien.ac.at
17
Predict if recurrence
Predict time to recurrence to ensure timely treatment
Predicting recurrence and time of recurrence
Signatures
Vogl 2017, Bogunovic 2017
Johannes Hofmanninger www.cir.meduniwien.ac.at
18
Predicting recurrence and time of recurrence
Signatures
Most informative region: predictive signature of response Vogl 2017, Bogunovic 2017
Identify predictive markers
Johannes Hofmanninger www.cir.meduniwien.ac.at
19
Integrate multivariate data: we need AI to link observation to prediction
Treatment Imaging Genomics Clinical information …
Johannes Hofmanninger www.cir.meduniwien.ac.at
20
Treatment decision We give a name to this set of
decision making In supervised learning we use known diagnosis, or markers as labels
Johannes Hofmanninger www.cir.meduniwien.ac.at
21
Johannes Hofmanninger www.cir.meduniwien.ac.at
22
Johannes Hofmanninger www.cir.meduniwien.ac.at
23
not very reliable
even with experts can be low
assess or detect
patterns/names is hard to replicate
Curtesy Helmut Prosch, results: Walsh S et al. Thorax. 2016 Jan;71(1):45-51.
Johannes Hofmanninger www.cir.meduniwien.ac.at
24
response paths
Johannes Hofmanninger www.cir.meduniwien.ac.at
25
One patient Identifying predictive markers in heterogeneous clinical routine data
Johannes Hofmanninger www.cir.meduniwien.ac.at
26
Langs et al. 2018 Radiologe
Johannes Hofmanninger www.cir.meduniwien.ac.at
27
Ian Goodfellow 2016 - GAN Tutorial - https://arxiv.org/abs/1701.00160
Johannes Hofmanninger www.cir.meduniwien.ac.at
28
29
from a distribution:
distribution:
𝑞𝑒𝑏𝑢𝑏 𝑞𝑛𝑝𝑒𝑓𝑚 𝑞𝑛𝑝𝑒𝑓𝑚 𝑞𝑛𝑝𝑒𝑓𝑚
Johannes Hofmanninger www.cir.meduniwien.ac.at
A distribution in the data / observation space:
30
from a distribution:
distribution:
𝑞𝑒𝑏𝑢𝑏 𝑞𝑛𝑝𝑒𝑓𝑚 𝑞𝑛𝑝𝑒𝑓𝑚 𝑞𝑛𝑝𝑒𝑓𝑚
A distribution in the data / observation space:
Johannes Hofmanninger www.cir.meduniwien.ac.at
31
A distribution in the data / observation space: 𝑞𝑒𝑏𝑢𝑏
from a distribution:
distribution:
𝑞𝑒𝑏𝑢𝑏 𝑞𝑛𝑝𝑒𝑓𝑚 𝑞𝑛𝑝𝑒𝑓𝑚 𝑞𝑛𝑝𝑒𝑓𝑚
Johannes Hofmanninger www.cir.meduniwien.ac.at
32
A distribution in the data / observation space: 𝑞𝑒𝑏𝑢𝑏
from a distribution:
distribution:
𝑞𝑒𝑏𝑢𝑏 𝑞𝑛𝑝𝑒𝑓𝑚 𝑞𝑛𝑝𝑒𝑓𝑚 𝑞𝑛𝑝𝑒𝑓𝑚
Johannes Hofmanninger www.cir.meduniwien.ac.at
parameters, we choose the parameters to maximize the likelihood of the training examples
33
𝜄
𝑗=1 𝑛
model distribution parameters of the model training examples
A distribution in the data / observation space: 𝑞𝑒𝑏𝑢𝑏
Johannes Hofmanninger www.cir.meduniwien.ac.at
parameters, we choose the parameters to maximize the likelihood of the training examples
34
𝜄
𝑗=1 𝑛
A distribution in the data / observation space: 𝑞𝑒𝑏𝑢𝑏
𝜄
𝑛 𝑗=1
In practice …. log-space:
Johannes Hofmanninger www.cir.meduniwien.ac.at
35
Explicit density Implicit density Maximum likelihood
Johannes Hofmanninger www.cir.meduniwien.ac.at
generate samples from its density
36
Explicit density Implicit density Maximum likelihood
Generator
Johannes Hofmanninger www.cir.meduniwien.ac.at
37
Observations Model distribution
Johannes Hofmanninger www.cir.meduniwien.ac.at
38
Taxonomy following I. Goodfellow 2016
Explicit density Implicit density Maximum likelihood Approximate density Variational Markov Chain Tractable density Markov Chain Direct
Johannes Hofmanninger www.cir.meduniwien.ac.at
39
Explicit density Implicit density Maximum likelihood Approximate density Variational Markov Chain Tractable density Markov Chain Direct
Variational Autoencoder
Taxonomy following I. Goodfellow 2016
Johannes Hofmanninger www.cir.meduniwien.ac.at
40
Taxonomy following I. Goodfellow 2016
Explicit density Implicit density Maximum likelihood Approximate density Variational Markov Chain Tractable density Markov Chain Direct
GAN
Johannes Hofmanninger www.cir.meduniwien.ac.at
Ian Goodfellow 2016 - GAN Tutorial - https://arxiv.org/abs/1701.00160
Johannes Hofmanninger www.cir.meduniwien.ac.at
41
Johannes Hofmanninger www.cir.meduniwien.ac.at
42
Johannes Hofmanninger www.cir.meduniwien.ac.at
43
Figure from [Guo et al. 2017]
High-dimensional Image representation Low dimensional representation (bottleneck neurons) Encoder Decoder 𝑦 𝑦 𝑦 𝑁𝑇𝐹(𝑦, 𝑦 ) Loss function
Johannes Hofmanninger www.cir.meduniwien.ac.at
44
Layerwise pretraining Finetuning
Johannes Hofmanninger www.cir.meduniwien.ac.at
45
[Schlegl et al. MICCAI-MCV 2014]
Johannes Hofmanninger www.cir.meduniwien.ac.at
46
47
Input Output autoencoder (30 dim) Output PCA (30 dim) Figure from [Hinton & Salakhutdinov Science 2006]
Johannes Hofmanninger www.cir.meduniwien.ac.at
48
Figure from [Hinton & Salakhutdinov Science 2006]
Look at the code layer
Johannes Hofmanninger www.cir.meduniwien.ac.at
49
Johannes Hofmanninger www.cir.meduniwien.ac.at
Loss function: 𝑁𝑇𝐹 𝑦, 𝑦 + 𝛾 𝐿𝑀(𝑟𝑘(𝑨 𝑦) 𝑂(0,1))
𝑘
reconstruction property of latent space
Generative Model we can sample new cases
Johannes Hofmanninger www.cir.meduniwien.ac.at
50
Goodfellow et al. 2014 NIPS - arXiv:1406.2661 Ian Goodfellow 2016 - GAN Tutorial - arXiv:1701.00160
Johannes Hofmanninger www.cir.meduniwien.ac.at
51
52
has a latent prior in the z space 𝑨 ∼ 𝑞𝑨(𝑨), 𝑨 ∈ 𝒶
Generator: G
Johannes Hofmanninger www.cir.meduniwien.ac.at
53
Generator: G How do we train it to become good at sampling? Game: The Generator generates fakes The Discriminator has to tell fakes and real examples apart
Johannes Hofmanninger www.cir.meduniwien.ac.at
54
Generator: G
Discriminator: D
Johannes Hofmanninger www.cir.meduniwien.ac.at
55
Latent variable Observed variable
𝜄(𝐸) Discriminator: D Parameters: Cost function: 𝐾(𝐸)(𝜄(𝐸), 𝜄(𝐻)) 𝜄(𝐻) Generator: G Parameters: Cost function: 𝐾(𝐻)(𝜄(𝐸), 𝜄(𝐻))
e.g., image real or faked image Decision: is the input real or fake
Both, generator and discriminator are differentiable
Johannes Hofmanninger www.cir.meduniwien.ac.at
Discriminator: D Parameters: Cost function:
56
𝜄(𝐸) 𝐾(𝐸)(𝜄(𝐸), 𝜄(𝐻)) 𝜄(𝐻) Generator: G Parameters: Cost function: 𝐾(𝐻)(𝜄(𝐸), 𝜄(𝐻))
The discriminator learns to discriminate between real examples and generated samples . Minimize J(D) through changing 𝜄(𝐸)
Johannes Hofmanninger www.cir.meduniwien.ac.at
Discriminator: D Parameters: Cost function:
57
𝜄(𝐸) 𝐾(𝐸)(𝜄(𝐸), 𝜄(𝐻)) 𝜄(𝐻) Generator: G Parameters: Cost function: 𝐾(𝐻)(𝜄(𝐸), 𝜄(𝐻))
Its primary purpose is to provide the cost function of the generator with a reward function to evaluate its quality
Johannes Hofmanninger www.cir.meduniwien.ac.at
Discriminator: D Parameters: Cost function:
58
𝜄(𝐸) 𝐾(𝐸)(𝜄(𝐸), 𝜄(𝐻)) 𝜄(𝐻) Generator: G Parameters: Cost function: 𝐾(𝐻)(𝜄(𝐸), 𝜄(𝐻))
The generator learns to generate samples that are hard to discern from real examples. Its cost function is penalized by the discriminator.
Johannes Hofmanninger www.cir.meduniwien.ac.at
Generator: G Parameters: Cost function: Discriminator: D Parameters: Cost function:
59
𝜄(𝐸) 𝐾(𝐸)(𝜄(𝐸), 𝜄(𝐻)) 𝜄(𝐻) 𝐾(𝐻)(𝜄(𝐸), 𝜄(𝐻))
2 minibatches of samples:
generating x
Two gradient steps:
generated from real data
be e.g., 𝜄(𝐸) 𝜄(𝐻) 𝐾(𝐻) 𝐾(𝐻) = −𝐾(𝐸)
Johannes Hofmanninger www.cir.meduniwien.ac.at
60
Random samples in z space Generated “faked”
Real examples x real / fake
(Sampled from prior)
𝜄(𝐻)
𝜄(𝐸) 𝑊(𝜄(𝐸), 𝜄(𝐻))
A minimax game using a value function
Johannes Hofmanninger www.cir.meduniwien.ac.at
61
This is a game, where each player wishes to minimize the cost function that depends on parameters of both players, while only having control over its own parameters. The solution to this game is a Nash equilibrium A Nash equilibrium is a tuple so that is a local minimum w.r.t. , and is a local minimum w.r.t.
(𝜄(𝐸), 𝜄(𝐻))
𝐾(𝐸) 𝜄(𝐸) 𝐾(𝐻) 𝜄(𝐻)
Johannes Hofmanninger www.cir.meduniwien.ac.at
62
Figure from Goodfellow et al. 2014 Generative Adversarial Nets arXiv:1406.2661
Init Updated D Updated G Equilibrium
Johannes Hofmanninger www.cir.meduniwien.ac.at
63
Goodfellow et al. 2014; Radford et al. 2015
z
4x4x1024 8x8x512 16x16x256 32x32x128 64x64x3
x
DeConv DeConv DeConv DeConv
d
Generator Discriminator
Johannes Hofmanninger www.cir.meduniwien.ac.at
64
[Goodfellow et al. 2014 Generative Adversarial Nets] Figure from [Karras et al. 2017]
Johannes Hofmanninger www.cir.meduniwien.ac.at
65
Radford et al. 2015
In z-space, vector arithmetic is feasible to some extent
Johannes Hofmanninger www.cir.meduniwien.ac.at
both the generator and the discriminator
66
Johannes Hofmanninger www.cir.meduniwien.ac.at
67
Generator Discriminator
Johannes Hofmanninger www.cir.meduniwien.ac.at
68
Odena et al. 2016 - Conditional image synthesis - arXiv:1610.09585
Johannes Hofmanninger www.cir.meduniwien.ac.at
www.cir.meduniwien.ac.at Georg Langs
Isola et al. 2016 Image to Image Translation - https://arxiv.org/abs/1611.07004
the generator and discriminator
Encoder - decoder
U-net style skip connections
Discriminator
69
70
Isola et al. 2016 Image to Image Translation - https://arxiv.org/abs/1611.07004
https://phillipi.github.io/pix2pix/
Johannes Hofmanninger www.cir.meduniwien.ac.at
71
Metz et al. 2016 Instead of covering the entire data distribution, the generator has extremely reduced output diversity … hopping from one narrow area to the next while the discriminator catches up Arjovsky et al. 2017
Johannes Hofmanninger www.cir.meduniwien.ac.at
divergence, we use an approximation of the earth movers distance
manifold, divergence can saturate, and gradients can vanish
approximation does not suffer from this
72
Arjovsky et al 2017 - Theory - arXiv:1701.04862 Figure from Arjovsky et al 2017 Wasserstein GAN - arXiv:1701.07875v3
Johannes Hofmanninger www.cir.meduniwien.ac.at
https://www.cir.meduniwien.ac.at/team/thomas-schlegl Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Work by Thomas Schlegl et al.
Johannes Hofmanninger www.cir.meduniwien.ac.at
73
74
Unseen data Anomalies
Normal data Look at residual
Johannes Hofmanninger www.cir.meduniwien.ac.at
75
Generator G
z
G(z) µ(x)
Anomalous Normal
z
G(z) µ(x)
Query image Generated image
Loss
backpropagation
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
76
Query image
Residual loss ℒ𝑆 𝒜Γ
ℒ𝑆 𝒜𝛿
G
z
G(z)
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
77
Discrimination loss ℒ𝐸
𝒜Γ
ℒ𝐸
𝒜𝛿 = −log 𝐸 𝐻 𝒜
Query image
D
G
z
G(z)
ℒ𝐸
𝒜𝛿
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
78
Query image
Discrimination loss ℒ𝐸 𝒜Γ ℒ𝐸 𝒜𝛿 D
G
z
G(z)
Feature matching [Salimans et al., 2016] Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
79
Combined loss ℒ 𝒜𝛿 = 1 − 𝜇 ∙ ℒ𝑆 𝒜𝛿 + 𝜇 ∙ ℒ𝐸 𝒜𝛿
Query image
D
G
z
G(z)
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
Detection of anomalous images
Detection of anomalous regions within images
80
𝒚𝑆 = 𝒚 − 𝐻 𝒜Γ
A(x)=(1-λ)∙R(x)+λ∙D(x) ‘anomalous’ ‘normal’
?
𝒚 𝒚𝑆 𝐻 𝒜Γ
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
81
Preprocessing Input data
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
82
iter 1
epoch 3 epoch 5 epoch 10 epoch 20
iter 1.000 iter 16.000
epoch 1 Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
83
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
84
Training set (normal) Test set (normal) Test set (diseased)
Generated image Query image
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
85
Training set (normal) Test set (normal) Test set (diseased)
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
86
Anomalous
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
87
Normal
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
88
ROC Residual score Discrimination score
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
89
ROC
PD
D
GANR
G D
aCAE
D CAE
[Pathak et al., 2016]
G D
AnoGAN
Schlegl et al. IPMI 2017 - https://arxiv.org/abs/1703.05921
Johannes Hofmanninger www.cir.meduniwien.ac.at
Johannes Hofmanninger www.cir.meduniwien.ac.at
90
identify robust marker patterns
Johannes Hofmanninger www.cir.meduniwien.ac.at
91
Johannes Hofmanninger www.cir.meduniwien.ac.at
92
>4TB CT/MR Data
Johannes Hofmanninger www.cir.meduniwien.ac.at
93
Hofmanninger et al. 2017
Johannes Hofmanninger www.cir.meduniwien.ac.at
94
Hofmanninger et al. 2017
Johannes Hofmanninger www.cir.meduniwien.ac.at
95
9
… in clinical data: imaging + semantic information.
Johannes Hofmanninger www.cir.meduniwien.ac.at
96
[Thomas Schlegl et al.]
Johannes Hofmanninger www.cir.meduniwien.ac.at
97
structured information from unstructured reports
findings only based on imaging data an reports
Hofmanninger, Langs 2015
Johannes Hofmanninger www.cir.meduniwien.ac.at
98
Algorithm
Image information can be used to capture variability in the data
Hofmanninger, Langs 2015
Johannes Hofmanninger www.cir.meduniwien.ac.at
99
Expert
Hofmanninger, Langs 2015
Image information can be used to capture variability in the data
Johannes Hofmanninger www.cir.meduniwien.ac.at
100
Semantic re-mapping of features improves retrieval accuracy. It links the visual representation closer to diagnostically relevant categories
[Hofmanninger et al. CVPR 2015]
Johannes Hofmanninger www.cir.meduniwien.ac.at
101
Johannes Hofmanninger www.cir.meduniwien.ac.at
102
Query Neirest neighbors
Query Neirest neighbors
Johannes Hofmanninger www.cir.meduniwien.ac.at
103
Volumes leading to highest activation in bottleneck-neurons Deep stacked autoencoder
Johannes Hofmanninger www.cir.meduniwien.ac.at
104
5000 mapped into a metric space based on visual cues in volumetric lung-CT
Hofmanninger et al. 2016
Johannes Hofmanninger www.cir.meduniwien.ac.at
105
Hofmanninger et al.
Johannes Hofmanninger www.cir.meduniwien.ac.at
106
Terms in reports
Data-driven signatures of individuals reveal clusters of patients
Hofmanninger et al. 2016, Hofmanninger et al. 2017
N = 5000 chest CT volumes
Johannes Hofmanninger www.cir.meduniwien.ac.at
107
Johannes Hofmanninger www.cir.meduniwien.ac.at
108
109
Johannes Hofmanninger www.cir.meduniwien.ac.at
Cystic fibrosis Other specified disease of pancreas Effusion Phenotype I Phenotype II Survival Acute respiratory failure Atelectasis Ground glass opacity Pneumonia Chronic kidney dis. LUTX Congestion Acute renal failure Sepsis
Johannes Hofmanninger www.cir.meduniwien.ac.at
110
disposal
response
Johannes Hofmanninger www.cir.meduniwien.ac.at
111
112
Johannes Hofmanninger www.cir.meduniwien.ac.at