deep feature learning for contour detection

37
Deep Feature Learning for Contour Detection Wei Shen (ๆฒˆไธบ) http://wei-shen.weebly.com/ Shanghai University Shanghai University 1 Vision And Learning SEminar (VALSE)

Upload: others

Post on 15-Oct-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Deep Feature Learning for Contour Detection

Deep Feature Learning for Contour Detection

Wei Shen (ๆฒˆไธบ) http://wei-shen.weebly.com/

Shanghai University

Shanghai University 1

Vision And Learning SEminar (VALSE)

Page 2: Deep Feature Learning for Contour Detection

Outline 2

Contour Detection Overview

Milestones

Our Work

Discussions

Page 3: Deep Feature Learning for Contour Detection

Introduction of Contour Detection 3

Reduce dimensionality of data

Preserve content information

Useful in applications such as

Object Detection Image Segmentation Sketch-based Image Search

Page 4: Deep Feature Learning for Contour Detection

Introduction of Contour Detection 4

Edge Detection

the characteristic changes in brightness, color, and texture

Contour Detection

The changes in pixel ownership from one object or surface to another

easy difficult

Page 5: Deep Feature Learning for Contour Detection

Challenge 5

To differentiate contour and non-contour is difficult, even for human beings!

Page 6: Deep Feature Learning for Contour Detection

Challenge 6

Confusion between contour and non-contour

changes caused by cluttered textures

changes correspond to object boundaries

Page 7: Deep Feature Learning for Contour Detection

Key Problems 7

Contour detection is usually formulated as a per-pixel classification problem

How to extract discriminative contour features?

How to learn a efficient contour classifier?

Page 8: Deep Feature Learning for Contour Detection

Perspective 8

Year 1990 2000 2004 2008

Learning Based

Contour Detection

Learning Based

Contour Detection

Edge Detection Edge Detection

Deep Learning

Based Contour

Detection

Deep Learning

Based Contour

Detection

8

2014

Page 9: Deep Feature Learning for Contour Detection

Outline 9

Contour Detection

Overview

Milestones Our Work

Discussions

Page 10: Deep Feature Learning for Contour Detection

Edge Detection 10

Use local differential template to compute gradient

121

000

121

FX

101

202

101

FY

22YXG

The original Sobel edge

Page 11: Deep Feature Learning for Contour Detection

Related Works 11

[1] J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8(6):679โ€“698, 1986 [2] R. Kimmel and A.M. Bruckstein (2003) "On regularized Laplacian zero crossings and other optimal edge integrators", International Journal of Computer Vision, 53(3) pages 225-243. [3] T. Lindeberg (1993) "Discrete derivative approximations with scale-space properties: A basis for low-level feature extraction", J. of Mathematical Imaging and Vision, 3(4), pages 349--376. [4] D. Ziou and S. Tabbone (1998) "Edge detection techniques: An overview", International Journal of Pattern Recognition and Image Analysis, 8(4):537โ€“559, 1998 [5] H. Farid and E. P. Simoncelli, Differentiation of discrete multi-dimensional signals, IEEE Trans Image Processing, vol.13(4), pp. 496--508, Apr 2004

[1] J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8(6):679โ€“698, 1986 [2] R. Kimmel and A.M. Bruckstein (2003) "On regularized Laplacian zero crossings and other optimal edge integrators", International Journal of Computer Vision, 53(3) pages 225-243. [3] T. Lindeberg (1993) "Discrete derivative approximations with scale-space properties: A basis for low-level feature extraction", J. of Mathematical Imaging and Vision, 3(4), pages 349--376. [4] D. Ziou and S. Tabbone (1998) "Edge detection techniques: An overview", International Journal of Pattern Recognition and Image Analysis, 8(4):537โ€“559, 1998 [5] H. Farid and E. P. Simoncelli, Differentiation of discrete multi-dimensional signals, IEEE Trans Image Processing, vol.13(4), pp. 496--508, Apr 2004

Page 12: Deep Feature Learning for Contour Detection

Learning Based Contour Detection 12

Learn a classifier to combine different features

Image Boundary Cues

Model

Pb

Brightness

Color

Texture

Cue Combination

Page 13: Deep Feature Learning for Contour Detection

Learning Based Contour Detection 13

Discriminative features

Spectral component (gPb - Arbelรกez et al. PAMI 11)

Sparse code gradients (SCG โ€“ Ren&Bo, NIPS 12)

Page 14: Deep Feature Learning for Contour Detection

Learning Based Contour Detection 14

Efficient Detector

Structured Forest (SE โ€“ Dollar&Zitnick ICCV 13, PAMI 15)

Page 15: Deep Feature Learning for Contour Detection

Related Works 15

[1] D. Martin, C. Fowlkes, J. Malik. Learning to Detect Natural Image Boundaries Using Local Brightness, Color, and Texture Cues. IEEE Trans. Pattern Anal. Mach. Intell. 26(5): 530-549 (2004) [2] P. Arbelaez, M. Maire, C. Fowlkes, J. Malik. Contour Detection and Hierarchical Image Segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 33(5): 898-916 (2011) [3] X. Ren. Multi-scale Improves Boundary Detection in Natural Images. ECCV (3) 2008: 533-545 [4] X. Ren, L. Bo. Discriminatively Trained Sparse Code Gradients for Contour Detection. NIPS 2012: 593-601 [5] J. Lim, C. Zitnick, P. Dollรกr. Sketch Tokens: A Learned Mid-level Representation for Contour and Object Detection. CVPR 2013: 3158-3165 [6] P. Dollรกr, C. Zitnick. Structured Forests for Fast Edge Detection. ICCV 2013: 1841-1848 [7] P. Dollรกr, Z. Tu, S. Belongie. Supervised Learning of Edges and Object Boundaries. CVPR (2) 2006: 1964-1971 [8] P. Arbelรกez, J. Pont-Tuset, J. Barron, F. Marquรฉs, J. Malik. Multiscale Combinatorial Grouping. CVPR 2014: 328-335

[1] D. Martin, C. Fowlkes, J. Malik. Learning to Detect Natural Image Boundaries Using Local Brightness, Color, and Texture Cues. IEEE Trans. Pattern Anal. Mach. Intell. 26(5): 530-549 (2004) [2] P. Arbelaez, M. Maire, C. Fowlkes, J. Malik. Contour Detection and Hierarchical Image Segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 33(5): 898-916 (2011) [3] X. Ren. Multi-scale Improves Boundary Detection in Natural Images. ECCV (3) 2008: 533-545 [4] X. Ren, L. Bo. Discriminatively Trained Sparse Code Gradients for Contour Detection. NIPS 2012: 593-601 [5] J. Lim, C. Zitnick, P. Dollรกr. Sketch Tokens: A Learned Mid-level Representation for Contour and Object Detection. CVPR 2013: 3158-3165 [6] P. Dollรกr, C. Zitnick. Structured Forests for Fast Edge Detection. ICCV 2013: 1841-1848 [7] P. Dollรกr, Z. Tu, S. Belongie. Supervised Learning of Edges and Object Boundaries. CVPR (2) 2006: 1964-1971 [8] P. Arbelรกez, J. Pont-Tuset, J. Barron, F. Marquรฉs, J. Malik. Multiscale Combinatorial Grouping. CVPR 2014: 328-335

Page 16: Deep Feature Learning for Contour Detection

Deep Learning Based Contour Detection

16

Use deep networks to extract contour features and predict contour map

Contour Patch Contour Patch Background

Patch Background

Patch

Feature map Feature map

Page 17: Deep Feature Learning for Contour Detection

Related Works 17

[1] J. J. Kivinen, C. K. I.Williams, and N. Heess. Visual boundary prediction: A deep neural prediction network and quality dissection. In Proc. AISTATS, pages 512โ€“521, 2014. [2] Y. Ganin and V. S. Lempitsky. N4-fields: Neural network nearest neighbor fields for image transforms. In Proc. ACCV, 2014. [3] W. Shen, X. Wang, Y. Wang, X. Bai, Z. Zhang. DeepContour: A Deep Convolutional Feature Learned by Positive-sharing Loss for Contour Detection. In Proc. CVPR, 2015. [4] G. Bertasius, J. Shi, L. Torresani. DeepEdge: A Multi-Scale Bifurcated Deep Network for Top-Down Contour Detection. In Proc. CVPR, 2015. [5] J.-J. Hwang, T.-L. Liu. Pixel-wise Deep Learning for Contour Detection. CoRR abs/1504.01989 (2015) [6] J.-J. Hwang, T.-L. Liu: Contour Detection Using Cost-Sensitive Convolutional Neural Networks. CoRR abs/1412.6857 (2014)

[1] J. J. Kivinen, C. K. I.Williams, and N. Heess. Visual boundary prediction: A deep neural prediction network and quality dissection. In Proc. AISTATS, pages 512โ€“521, 2014. [2] Y. Ganin and V. S. Lempitsky. N4-fields: Neural network nearest neighbor fields for image transforms. In Proc. ACCV, 2014. [3] W. Shen, X. Wang, Y. Wang, X. Bai, Z. Zhang. DeepContour: A Deep Convolutional Feature Learned by Positive-sharing Loss for Contour Detection. In Proc. CVPR, 2015. [4] G. Bertasius, J. Shi, L. Torresani. DeepEdge: A Multi-Scale Bifurcated Deep Network for Top-Down Contour Detection. In Proc. CVPR, 2015. [5] J.-J. Hwang, T.-L. Liu. Pixel-wise Deep Learning for Contour Detection. CoRR abs/1504.01989 (2015) [6] J.-J. Hwang, T.-L. Liu: Contour Detection Using Cost-Sensitive Convolutional Neural Networks. CoRR abs/1412.6857 (2014)

Page 18: Deep Feature Learning for Contour Detection

Outline 18

Contour Detection

Overview

Milestones

Our Work Discussions

Page 19: Deep Feature Learning for Contour Detection

Our Work 19

DeepContour: A Deep Convolutional Feature Learned by Positive-sharing

Loss for Contour Detection

Wei Shen, Xinggang Wang, Yan Wang, Xiang Bai, Zhijiang Zhang

IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 2015

Page 20: Deep Feature Learning for Contour Detection

Motivation 20

Why to apply CNN for contour detection?

Contour is hard to define

Contour data are sufficient for CNN training (millions

of local contour patches)

Page 21: Deep Feature Learning for Contour Detection

Problem Formulation 21

Given a color image patch ๐‘ฅ โˆˆ โ„๐‘›ร—๐‘›ร—3, our goal is to determine whether its center pixel is passed through by contours or not.

๐‘ฅ โˆˆ โ„๐‘›ร—๐‘›ร—3 โ†’ ๐‘ง โˆˆ 0,1

Q: Is a good idea to directly use CNN as a blackbox to address this binary classification problem?

Non-contour Contour

Page 22: Deep Feature Learning for Contour Detection

Obstacle 22

The large variations in the contour shapes

Solution: Partitioning contour patches into compact clusters to convert the binary classification problem to a multi- class classification problem

Ref: J. J. Lim, C. L. Zitnick, and P. Dollรกr. Sketch tokens: A learned mid-level representation for contour and object detection. CVPR, 2013.

Page 23: Deep Feature Learning for Contour Detection

Obstacle 23

How to define the loss function?

Q: Is softmax a good choice?

Softmax function penalizes the loss of each class equally

The losses for contour versus non-contour should be emphasized

Solution: Adding a regularized term to focus on the end goal of binary classification

Page 24: Deep Feature Learning for Contour Detection

24

Data Preparation

Pre-cluster contour patches according to their contour shapes.

Assign a label ๐‘ฆ to each contour patch ๐‘ฅ according to the pre-cluster index 1,โ€ฆ๐พ .

๐‘ฅ โˆˆ โ„๐‘›ร—๐‘›ร—3 โ†’ ๐‘ฆ โˆˆ 0,1,โ€ฆ๐พ

Negative Positive

Page 25: Deep Feature Learning for Contour Detection

25

Method

CNN Architecture

Loss Function

Let (๐‘Ž๐‘—๐‘–; ๐‘— = 1,โ€ฆ๐พ) be the output of unit ๐‘— in FC2 for a

image patch ๐‘ฅ๐‘—(๐‘–)

, the probability that the label is ๐‘— is

๐‘๐‘—(๐‘–)=exp(๐‘Ž๐‘™

(๐‘–))

exp(๐‘Ž๐‘™(๐‘–))๐พ

๐‘™=0

Page 26: Deep Feature Learning for Contour Detection

26

Method

๐ฝ = โˆ’1

๐‘š ๐Ÿ ๐‘ฆ ๐‘– = ๐‘— log ๐‘๐‘—

๐‘–

๐พ

๐‘—=0

๐‘š

๐‘–=1

โˆ’1

๐‘š ๐œ† ๐Ÿ ๐‘ฆ ๐‘– = 0 log ๐‘0

๐‘–+ ๐Ÿ ๐‘ฆ ๐‘– = ๐‘— log(1 โˆ’ ๐‘0

๐‘–)

๐พ

๐‘—=1

๐‘š

๐‘–=1

Softmax loss

Positive-sharing loss, the loss for positive class is shared among each pre-clustered contour classes

Page 27: Deep Feature Learning for Contour Detection

27

Method

To apply standard back-propagation to optimize the parameters of the network

๐œ•๐ฝ

๐œ•๐‘Ž0(๐‘–)=1

๐‘š๐œ† + 1 ๐Ÿ ๐‘ฆ ๐‘– = 0 ๐‘0

๐‘–โˆ’ 1 + (๐œ† + 1) ๐Ÿ ๐‘ฆ ๐‘– = ๐‘—

๐พ

๐‘—=1

๐‘0๐‘–

๐œ•๐ฝ

๐œ•๐‘Ž๐‘™(๐‘–)=1

๐‘š๐œ†๐Ÿ ๐‘ฆ ๐‘– = 0 + 1 ๐‘๐‘™

(๐‘–)โˆ’ ๐Ÿ ๐‘ฆ ๐‘– = ๐‘™ โˆ’ ๐œ† ๐Ÿ ๐‘ฆ ๐‘– = ๐‘—

๐พ

๐‘—=1

๐‘0๐‘–๐‘๐‘™๐‘–

1 โˆ’ ๐‘0๐‘–

Page 28: Deep Feature Learning for Contour Detection

28

Method

CNN model validation

๐›พ โˆˆ [โˆ’1,1], measuring the discrimination of the learned model between positive and negative samples.

The learned features of FC1 will be fed into structured forest to perform contour detection.

๐›พ =1

๐‘š ๐Ÿ ๐‘ฆ ๐‘– = 0 โˆ’ ๐Ÿ ๐‘ฆ ๐‘– > 0 (๐‘0

๐‘–โˆ’ (1 โˆ’ ๐‘0

๐‘–))

๐‘š

๐‘–=1

Page 29: Deep Feature Learning for Contour Detection

29

Experimental results

Deep Feature Visualization

Positive-sharing loss

Local gradient

Page 30: Deep Feature Learning for Contour Detection

Experim

ental resu

lts

30

Results on BSDS500

Page 31: Deep Feature Learning for Contour Detection

31

Experimental results

Results on BSDS500

Page 32: Deep Feature Learning for Contour Detection

32

Experimental results

Results on NYUD

Page 33: Deep Feature Learning for Contour Detection

33

Experimental results

Cross Dataset Generalization

DeepContour ODS OIS AP

BSDS/BSDS .76 .78 .80

NYU/BSDS .72 .74 .77

BSDS/NYU .59 .60 .53

NYU/NYU .62 .63 .57

SE [11] ODS OIS AP

BSDS/BSDS .74 .76 .78

NYU/BSDS .72 .73 .76

BSDS/NYU .55 .57 .46

NYU/NYU .60 .61 .56

SCG [39] ODS OIS AP

NYU/NYU .55 .57 .46

gPb [2] ODS OIS AP

NYU/NYU .51 .52 .37

Page 34: Deep Feature Learning for Contour Detection

34

Experimental results

Parameter Discussion

Page 35: Deep Feature Learning for Contour Detection

Outline 35

Contour Detection

Overview

Milestones

Our Work

Discussions

Page 36: Deep Feature Learning for Contour Detection

Discussions 36

Speed

Caffe โ€“ per-patch mean subtraction is the bottleneck

Accuracy

Limitation may caused by the confusing labels

Page 37: Deep Feature Learning for Contour Detection

Discussions 37

Thank you! Q&A