34
Semantic Image Segmentation with Deep Convolutional Nets and Fully Connected CRFs Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, Alan L. Yuille ICLR 2015 Carlos Feres & Mark Weber

Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Semantic Image Segmentation with DeepConvolutional Nets and Fully Connected CRFs

Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos,Kevin Murphy, Alan L. Yuille

ICLR 2015

Carlos Feres & Mark Weber

Page 2: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Outline

● Context

● Dense labeling challenge○ Increasing resolution○ Controlling the receptive field size

● Localization challenge○ Fully-connected CRFs○ Multi-scale prediction

● Experiments

● Comments

Page 3: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Context

● Can we use a CNN for this task?

Image classification Object localization Semantic segmentation

[1] Garcia-Garcia et al, A Review on Deep Learning Techniques Applied to Semantic Segmentation. arXiv:1704.06857v1

Page 4: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Context

● CNNs excel at classification/detection○ Spatial invariance helps build hierarchical abstractions of data

● CNNs perform poorly on low-level tasks ○ Needs precise location and details

● Reduction of signal resolution○ Information is not “dense”

● Spatial insensitivity (invariance)○ Exact outline of objects is lost

Page 5: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Dense labeling challenge

● Want CNNs with high spatial resolution & wide receptive field

● Increase spatial resolution○ Hole algorithm

● Adapt classification CNN for segmentation○ Redefine the CNN architecture○ Control the receptive field size

Page 6: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Increase spatial resolution

● How do CNNs lose resolution?

Input = 7x7 Output = 3x3

Convolution3x3 filters, stride = 2

loses “in-between” features

1 2 3 36 5 8 40 1 5 01 2 4 3

6 82 5

Max-pooling2x2 filters, stride = 2

loses 75% of activations

● Striding & max-pooling !!

Page 7: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Increase spatial resolution

● Possible solution: stride = 1 & remove pooling○ Requires larger kernels for same receptive field

● Computationally expensive & possible overfitting

conv poolconv

stride 4

RF 9

kern

el 5

RF 9

kern

el 9

stride 1

1 px in previous

layer

8 px in previous

layer

Page 8: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Increase spatial resolution

● Hole algorithm (atrous, dilated convolution)○ Large, sparse kernel (zeros in between values) = upsampled small kernel○ Complexity ~ # nonzero elements○ Arbitrary size receptive field

conv

RF 9

kern

el 9

stride 1

rate

4

1 px in previous

layer

rate

kern

el 3

Page 9: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Increase spatial resolution

● Example in 2D [2]:

[2] Chen et al, DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs. arXiv:1606.00915v2

Page 10: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Adapting CNN for segmentationVGG16

7x7x512 1x1xN

fully

connected

conv +

pooling

224x224x3

28x28xN

dilate

d conv,

3x3 ra

te 2,

no poolin

g1x1

conv,

no poolin

gProposed fully conv. CNN

28x28x4096

2 2 3 3 3

2 2 3 3

conv +

no poolin

g

3

bilinear

upsam

pling x8

224x224xNBased on slides from deepsystems.io

dilate

d conv,

7x7 ra

te 4

,

no poolin

g

1

1 1 1

1x1x40961x1x409614x14x512

28x28x512

112x112x6456x56x128 28x28x256 28x28x512

224x224x3 112x112x6456x56x128 28x28x256

28x28x4096

1 1

Page 11: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Further adjustments in 1st FC layer:● DeepLab-CRF kernel = 4, rate = 4, 4096 filters● DeepLab-CRF-4x4 kernel = 4, rate = 8, 4096 filters● DeepLab-CRF-LargeFOV kernel = 3, rate = 12, 1024 filters same performance as 7x7!

Controlling receptive field sizeDeepLab-CRF-7x7

224x224x3

dilate

d conv,

3x3 ra

te 2,

no poolin

g1x1

conv,

no poolin

g

28x28x4096

2 2 3 3

conv +

no poolin

g

3

bilinear

upsam

pling x8

224x224xN

dilate

d conv,

7x7 ra

te 4

,

no poolin

g

1

28x28x512

112x112x6456x56x128 28x28x256 28x28x512 28x28xN28x28x4096

1 1

bottleneck!

Page 12: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Dense labeling summary

Page 13: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Localization challenge

Score map (before softmax)

Belief map (after softmax)

Object is detectedOutline is inaccurate

Page 14: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Conditional Random Fields

● A set of variables (one per pixel)● Image ● We look for maximum a posteriori (MAP):

● Gibbs distribution:

[6] Krähenbühl and Koltun, Efficient Inference in Fully Connected CRFs with Gaussian Edge Potentials. arXiv:1210.5644v1

Page 15: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Fully-Connected CRFs

● (Gibbs) Energy:

Page 16: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

● Pairwise term ( , )○ Gaussian kernel for appearance

○ Gaussian kernel for smoothness

Gibbs Energy

● Unary term ( )○ CNN output

Page 17: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Mean Field Approximation

● Computing ( ) is hard● Choose family of distribution such that:

● Find ( ) that approximates ( ) best

=> Minimize KL-Divergence

Page 18: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Update rule

● Derived from KL-Divergence:

Page 19: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

New runtime:

● Kernel Size == constant

Gaussian Approximation

Issue:

● Kernel size == Image size

Page 20: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

CRF Summary

● Post-processing step

● Fully connected CRF consists of○ Unary terms (CNN outputs)○ Pairwise terms (encode global context)

● Mean Field Approximation for ( )

● Iterate until convergence

Page 21: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

CRF Results

Page 22: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Complete model (DeepLab v1)

adapted for segmentation

upsample image to original

resolution

refinesegmentation

Page 23: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Extension: Multiscale-prediction

dilate

d conv,

3x3 ra

te 2,

no poolin

g

1x1 conv,

no poolin

g

2 2 3 3

conv +

no poolin

g

3

bilinear

upsam

pling x8

dilate

d conv,

3x3 ra

te 12

,

no poolin

g

concatenate

1 1 1

Page 24: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Experiments

PASCAL VOC 2012 ‘val’(trained in augmented ‘train’)

PASCAL VOC 2012 ‘test’(trained in augmented ‘trainval’)

[3] Dai, He, and Sun. Convolutional feature masking for joint object and stuff segmentation.arXiv:1412.1283v4[4] Long, Shelhamer, and Darrel, Fully convolutional networks for semantic segmentation. arXiv:1411.4038v2

[5] Mostajabi, Yadollahpour and Shakhnarovich, Feedforward semantic segmentation with zoom-out features. arXiv:1412.0774v1

[3][4][5]

Page 25: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Experiments

● Field of view○ Modifications to first FC layer

Training in PASCAL VOC 2012 ‘val’

Page 26: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Experiments● CRF

image

ground-truth

DeepLab-CRF

Page 27: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Experiments● CRF: Success

image CNN CRF image CNN CRF

Page 28: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Experiments● CRF: Success

image CNN CRF image CNN CRF

Page 29: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Experiments● CRF: Failures

image CNN CRF image CNN CRF

Page 30: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Experiments

● Labeling IoU

PASCAL VOC 2012 ‘test’ (trained with ‘trainval’)

Page 31: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Comments

● Strengths○ Template to adapt classification CNNs for image segmentation○ Successful incorporation of methods from other disciplines○ Experiments with each individual modification allows to compare impact

● Weaknesses○ Two processes: CNN + postprocessing○ Paper is not self contained (need references a lot)○ Key concepts are not well explained (better in Deeplab v2 [2])

[2] Chen et al, DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs. arXiv:1606.00915v2

Page 32: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Thanks!Questions?

Page 33: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Appendix: Experiments

● Object boundaries○ Void label (regularly seen in boundaries)○ Mean IoU of pixels in narrow band (trimap)

trimap 2px trimap 10px

image ground-truth

Page 34: Semantic Image Segmentation with Deep ICLR 2015 ...yjlee/teaching/ecs289g-winter2018/DeepLab.pdfImage classification Object localization Semantic segmentation [1] Garcia-Garcia et

Appendix: Experiments

● Multi-scale features○ Modify kernel size of first FC layer and rate

DeepLab

DeepLab-MSc