U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation...

24
U-Net: Convolutional Networks for Biomedical Image Segmentation Ing. Milan Nฤ›mรฝ PhD candidate FEL ฤŒVUT, 7. 12. 2018

Transcript of U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation...

Page 1: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

U-Net: Convolutional

Networks for Biomedical

Image SegmentationIng. Milan Nฤ›mรฝ

PhD candidate

FEL ฤŒVUT, 7. 12. 2018

Page 2: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Outline

1. Artificial neural networks

2. Convolutional neural networks (classification)

3. Convolutional neural networks (segmentation)

1. Sliding-window setup

2. U-Net

Page 3: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Artificial neural networks

Perceptron model

๐‘ฆ ๐‘ฅ = ๐‘ ๐‘–๐‘”๐‘› ๐‘ค. ๐‘ฅ + ๐‘

Artificial Neural Network

โ€ข Hidden layers

โ€ข Non-linear activation

function (tanh, sigmoid)

โ€ข Cost function

โ€ข Back-propagation algorithm

Page 4: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Artificial neural networks

Artificial Neural Network

โ€ข Hidden layers

โ€ข Non-linear activation

function (tanh, sigmoid)

โ€ข Cost function

โ€ข Back-propagation algorithm

Multi-class classification

Activation function โ€“ softmax

๐‘๐‘— =exp(๐‘ฅ๐‘—)

ฯƒ๐‘˜ exp(๐‘ฅ๐‘˜)

Cost function โ€“ cross entropy

๐ถ = โˆ’

๐‘—

๐‘‘๐‘—log(๐‘๐‘—)

๐‘‘๐‘— - target probability for output unit j

๐‘๐‘— - probability output for j

Page 5: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Convolutional Neural Networks (CNN)

(Krizhevsky et al., 2012)

Winner of ImageNet Large Scale Visual

Recognition Challenge (ILSVRC) 2012

1.2 M high-resolution training images

50k validation images

150k testing images

1000 classes

Page 6: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Convolutional Neural Networks (CNN)

(Krizhevsky et al., 2012) - AlexNet

Winner of ImageNet Large Scale Visual

Recognition Challenge (ILSVRC) 2012

1.2 M high-resolution training images

50k validation images

150k testing images

1000 classes

Page 7: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Convolutional Neural Networks (CNN)

(Krizhevsky et al., 2012)

Convolution

= application of a filter

Page 8: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Convolutional Neural Networks (CNN)

(Krizhevsky et al., 2012)

โ€ข Rectified Linear Units (ReLUs)

โ€ข Non-saturating nonlinearity

โ€ข ๐‘“ ๐‘ฅ = max(0, ๐‘ฅ)

โ€ข Traininig on multiple GPUs

โ€ข 5 conv layers

โ€ข 3 fully-connected

โ€ข output โ€“ 1000-way softmax

Page 9: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Convolutional Neural Networks (CNN)

(Krizhevsky et al., 2012)

60 M parameters

But overfitting

Data augmentation

Dropout โ€“ Learning Less to Learn Better

Page 10: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Convolutional Neural Networks (CNN)

(Krizhevsky et al., 2012)

60 M parameters

But overfitting

Data augmentation

Dropout โ€“ Learning Less to Learn Better

Page 11: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances
Page 12: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Convolutional Neural Networks (CNN) โ€“

AlexNet performance

Canziani, A., Paszke, A., & Culurciello, E. (2016). An analysis of deep neural network

models for practical applications. arXiv preprint arXiv:1605.07678.

Page 13: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Convolutional Neural Networks -

Segmentation

(Ciresan et al., 2012)

Neuronal structures

Electron microscopy (EM) images

Segment neuron membranes

CNN as pixel classifier

ISBI 2012 EM Segmentation Challenge

Page 14: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Convolutional Neural Networks -

Segmentation

โ€ข 1-4 stages of conv and max-pooling layes

โ€ข Several fully connected layers

โ€ข Softmax activation function

Page 15: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Convolutional Neural Networks -

Segmentation

30 images at 512x512

~50k membrane pixels per image

~50k non-memberane pixels per images

=> 3 M training examples

+ data augmentation (mirroring and rotating)

Foveation

Nonuniform sampling

Page 16: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

โ€ข Core i7 3.06 GHz, 24 GB RAM and

four GTX 580 graphic cards

โ€ข GPU acceleration by a factor of 50

โ€ข One epoch

โ€ข N1 โ€“ 170 min

โ€ข N4 โ€“ 340 min

โ€ข 30 epochs => several days

Page 17: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Convolutional Neural Networks โ€“

Segmentation (Sliding-window setup)

Drawbacks

1. Separate runs for each patch +

overlapping patches => slow

2. Localization accuracy vs. the use

of context

Page 18: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

U-net architecture

Page 19: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

U-net architecture

Data augmentation

Separation of touching objects

Page 20: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

U-net architecture

Data augmentation

Separation of touching objects ๐‘ค ๐‘ฅ = ๐‘ค๐‘ ๐‘ฅ + ๐‘ค0 โˆ™ exp(โˆ’(๐‘‘1(๐‘ฅ) + ๐‘‘2(๐‘ฅ))

2

2๐œŽ2)

Balances class

frequencies

Distance to

the border of

the nearest

cell

Distance to

the border of

the second

nearest cell

Page 21: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

U-net architecture

Data augmentation

Separation of touching objects ๐‘ค ๐‘ฅ = ๐‘ค๐‘ ๐‘ฅ + ๐‘ค0 โˆ™ exp(โˆ’(๐‘‘1(๐‘ฅ) + ๐‘‘2(๐‘ฅ))

2

2๐œŽ2)

Balances class

frequencies

Distance to

the border of

the nearest

cell

Distance to

the border of

the second

nearest cell

๐ธ =

๐‘ฅโˆˆฮฉ

๐‘ค ๐‘ฅ log(๐‘๐‘™ ๐‘ฅ (๐‘ฅ))Cross entropy loss

function

๐‘๐‘˜ ๐‘ฅ = exp ๐‘Ž๐‘˜ ๐‘ฅ / ๐‘˜โ€ฒ=1

๐พ

exp(๐‘Ž๐‘˜โ€ฒ(๐‘ฅ))Soft-max activation

function

Page 22: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

U-net

โ€ข Training time: 10 h

Sliding-window

technique

Page 23: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

Demonstration - Finding and Measuring Lungs

in CT Data

?

Notebook:

https://www.kaggle.com/tore

gil/a-lung-u-net-in-

keras/notebook

Page 24: U-Net: Convolutional Networks for Biomedical Image ...ย ยท U-net architecture Data augmentation Separation of touching objects = ๐‘ + 0โˆ™exp(โˆ’ (๐‘‘1( )+๐‘‘2( ))2 2๐œŽ2) Balances

References

[1] Ronneberger, O., Fischer, P., & Brox, T. (2015, October). U-net:

Convolutional networks for biomedical image segmentation. In International

Conference on Medical image computing and computer-assisted intervention

(pp. 234-241). Springer, Cham.

[2] Ciresan, D., Giusti, A., Gambardella, L. M., & Schmidhuber, J. (2012).

Deep neural networks segment neuronal membranes in electron microscopy

images. In Advances in neural information processing systems (pp. 2843-

2851).

[3] Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). Imagenet

classification with deep convolutional neural networks. In Advances in neural

information processing systems (pp. 1097-1105).