statisticalmachinelearning(be4m33ssu) seminar1. … · 2017. 10. 13. · 5/10 example1:...

10
Statistical Machine Learning (BE4M33SSU) Seminar 1. Machine Learning Examples Czech Technical University in Prague

Upload: others

Post on 24-Jan-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: StatisticalMachineLearning(BE4M33SSU) Seminar1. … · 2017. 10. 13. · 5/10 Example1: ImageNet(visualobjectclassification) A“spin-off”: afullyconvolutionalnetworkforsemanticsegmentation

Statistical Machine Learning (BE4M33SSU)Seminar 1. Machine Learning Examples

Czech Technical University in Prague

Page 2: StatisticalMachineLearning(BE4M33SSU) Seminar1. … · 2017. 10. 13. · 5/10 Example1: ImageNet(visualobjectclassification) A“spin-off”: afullyconvolutionalnetworkforsemanticsegmentation

2/10Example 1: ImageNet (visual object classification)

� Training set: T m ={(xi,yi) ∈ X ×Y | i= 1, . . . ,m

}, where:

• X are images from ImageNet,

• Y is a set of output classes (ILSVRC 2012 defines |Y|= 1000 of them).

Page 3: StatisticalMachineLearning(BE4M33SSU) Seminar1. … · 2017. 10. 13. · 5/10 Example1: ImageNet(visualobjectclassification) A“spin-off”: afullyconvolutionalnetworkforsemanticsegmentation

3/10Example 1: ImageNet (visual object classification)

input

conv3-64

conv3-64

MP

conv3-128

conv3-128

MP

conv3-256

conv3-256

conv3-256

MP

conv3-512

conv3-512

conv3-512

MP

conv3-512

conv3-512

conv3-512

MP

FC-4096

FC-4096

FC–1000

softm

ax

1.7k 37k 74k 147k 295k 590k 590k 1.2M 2.4M 2.4M 2.4M 2.4M 2.4M 103M 16.7M 4M

3.2M 3.2M 1.6M 1.6M 800k 800k 800k 400k 400k 400k 100k 100k 100k 4096 4096 1000150k 800k 400k 200k 100k 25k 1000

224x2

24x3

224x2

24x64

112x1

12x64

112x1

12x128

56x56x128

56x56x256

28x28x256

28x28x512

14x14512

14x14x512

7x7

x512

1xx

1x4

096

1x1

x4096

1x1

x1000

activations

parameters

� Class of prediction strategies: VGGNet (Zisserman, et al., 2014), i.e. a convolutionalneural network with fixed structure. Note that a convolutional neural network with players is a function composition hθ(x) = (fpθp ◦f

p−1θp−1◦ . . .◦f 1

θ1)(x). Its outputs are

interpreted as class probabilities.� Loss function: negative log-likelihood of class probabilities (a.k.a. cross entropy)

`(yi,h(xi)) =−∑c∈Y

I{yi = c

}log(hc(x

i)).

� Learning approach: empirical risk minimisation, gradient descent

RT m(θ) =1

m

m∑i=1

`(yi,hθ(xi))→min

θ

Page 4: StatisticalMachineLearning(BE4M33SSU) Seminar1. … · 2017. 10. 13. · 5/10 Example1: ImageNet(visualobjectclassification) A“spin-off”: afullyconvolutionalnetworkforsemanticsegmentation

4/10Example 1: ImageNet (visual object classification)

� Results by VGGNet

� More details in lectures on deep learning

Page 5: StatisticalMachineLearning(BE4M33SSU) Seminar1. … · 2017. 10. 13. · 5/10 Example1: ImageNet(visualobjectclassification) A“spin-off”: afullyconvolutionalnetworkforsemanticsegmentation

5/10Example 1: ImageNet (visual object classification)

A “spin-off”: a fully convolutional network for semantic segmentation

Fully Convolutional Networks for Semantic Segmentation

Jonathan Long⇤ Evan Shelhamer⇤ Trevor DarrellUC Berkeley

{jonlong,shelhamer,trevor}@cs.berkeley.edu

Abstract

Convolutional networks are powerful visual models thatyield hierarchies of features. We show that convolu-tional networks by themselves, trained end-to-end, pixels-to-pixels, exceed the state-of-the-art in semantic segmen-tation. Our key insight is to build “fully convolutional”networks that take input of arbitrary size and producecorrespondingly-sized output with efficient inference andlearning. We define and detail the space of fully convolu-tional networks, explain their application to spatially denseprediction tasks, and draw connections to prior models. Weadapt contemporary classification networks (AlexNet [19],the VGG net [31], and GoogLeNet [32]) into fully convolu-tional networks and transfer their learned representationsby fine-tuning [4] to the segmentation task. We then de-fine a novel architecture that combines semantic informa-tion from a deep, coarse layer with appearance informationfrom a shallow, fine layer to produce accurate and detailedsegmentations. Our fully convolutional network achievesstate-of-the-art segmentation of PASCAL VOC (20% rela-tive improvement to 62.2% mean IU on 2012), NYUDv2,and SIFT Flow, while inference takes less than one fifth of asecond for a typical image.

1. Introduction

Convolutional networks are driving advances in recog-nition. Convnets are not only improving for whole-imageclassification [19, 31, 32], but also making progress on lo-cal tasks with structured output. These include advances inbounding box object detection [29, 12, 17], part and key-point prediction [39, 24], and local correspondence [24, 9].

The natural next step in the progression from coarse tofine inference is to make a prediction at every pixel. Priorapproaches have used convnets for semantic segmentation[27, 2, 8, 28, 16, 14, 11], in which each pixel is labeled withthe class of its enclosing object or region, but with short-comings that this work addresses.

⇤Authors contributed equally

96

384 256 4096409

6 21

21

backward/learning

forward/inference

pixelw

ise p

redict

ion

segmen

tatio

n g.t

.

256384

Figure 1. Fully convolutional networks can efficiently learn tomake dense predictions for per-pixel tasks like semantic segmen-tation.

We show that a fully convolutional network (FCN),trained end-to-end, pixels-to-pixels on semantic segmen-tation exceeds the state-of-the-art without further machin-ery. To our knowledge, this is the first work to train FCNsend-to-end (1) for pixelwise prediction and (2) from super-vised pre-training. Fully convolutional versions of existingnetworks predict dense outputs from arbitrary-sized inputs.Both learning and inference are performed whole-image-at-a-time by dense feedforward computation and backpropa-gation. In-network upsampling layers enable pixelwise pre-diction and learning in nets with subsampled pooling.

This method is efficient, both asymptotically and abso-lutely, and precludes the need for the complications in otherworks. Patchwise training is common [27, 2, 8, 28, 11], butlacks the efficiency of fully convolutional training. Our ap-proach does not make use of pre- and post-processing com-plications, including superpixels [8, 16], proposals [16, 14],or post-hoc refinement by random fields or local classifiers[8, 16]. Our model transfers recent success in classifica-tion [19, 31, 32] to dense prediction by reinterpreting clas-sification nets as fully convolutional and fine-tuning fromtheir learned representations. In contrast, previous workshave applied small convnets without supervised pre-training[8, 28, 27].

Semantic segmentation faces an inherent tension be-tween semantics and location: global information resolveswhat while local information resolves where. Deep feature

1

arX

iv:1

411.

4038

v2 [

cs.C

V]

8 M

ar 2

015

� uses transposed convolutions for up-sampling

� uses “transfer learning” from VGGNet

Page 6: StatisticalMachineLearning(BE4M33SSU) Seminar1. … · 2017. 10. 13. · 5/10 Example1: ImageNet(visualobjectclassification) A“spin-off”: afullyconvolutionalnetworkforsemanticsegmentation

6/10Example 2: licence plate recognition

Online app estimating the Travel Time for cars in Prague based on the number platerecognition: https://unicam.camea.cz/Discoverer/TravelTime3/map

Page 7: StatisticalMachineLearning(BE4M33SSU) Seminar1. … · 2017. 10. 13. · 5/10 Example1: ImageNet(visualobjectclassification) A“spin-off”: afullyconvolutionalnetworkforsemanticsegmentation

7/10Example 2: licence plate recognition

Input image x ∈ X of size [H×W ]

Model of synthetic license plate imagesA set of templates w = (wa|a ∈ A) for each character from A

0 1 9 A ZB... ...A segmentation y = (s1, . . . ,sL) ∈ Y(x), where s= (a,k), a ∈ A is a character code andk ∈ {1, . . . ,W} is a character position, together with templates w defines a synthetic image:

����U L K 6 8 3 9An admissible segmentation y ∈ Y(x) ensures that the templates are not overlapping and

that the synthetic image has the same width as the input image x:

k(s1) = 1 , W = k(sL)+ω(sL)−1 , and k(si) = k(si−1)+ω(si−1) , ∀i > 1

where ω : A→N are widths of the templates.

Page 8: StatisticalMachineLearning(BE4M33SSU) Seminar1. … · 2017. 10. 13. · 5/10 Example1: ImageNet(visualobjectclassification) A“spin-off”: afullyconvolutionalnetworkforsemanticsegmentation

��������U L K 6 8 3 9

⟨ ⟩,

8/10Example 2: licence plate recognition

� We want a classifier which outputs the segmentations y ∈ Y(x) defining a syntheticimage most similar (measured by correlation) to the input image x:

y = h(x;w) = argmax(s1,...,sL)∈Y(x)

L(y)∑i=1

ω(a(si))∑j=1

⟨col(x,j+k(si)−1

),col

(wa(si), j

)⟩︸ ︷︷ ︸

� Problem: How to construct the templates w = {wa|a ∈ A} so that the classifierh(x;w) predicts a segmentation with small Hamming distance to the correct one ?

� Solution: Select the templates w so that the classifier h(x;w) performs well on atraining set {(x1,y1), . . . ,(xm,ym)} and simultaneously control the over-fitting.

� More details during the lecture on the Structured Output Support Vector Machines.

Page 9: StatisticalMachineLearning(BE4M33SSU) Seminar1. … · 2017. 10. 13. · 5/10 Example1: ImageNet(visualobjectclassification) A“spin-off”: afullyconvolutionalnetworkforsemanticsegmentation

9/10Example 3: Joint segmentation & registration

Given: set of images, each containing an object instance, and a shape model

. . .,

. . .,

Task: segment & register each image to the reference frame (shape model)

� image x = {xi ∈ R3 | i ∈D′}, binary segmentation y = {yi ∈ {0,1} | i ∈D}

� shape model p(y) =∏i∈D pi(yi), with binomial distributions pi(yi = 0,1).

� appearance model pθ(xj | (Ty)j), j ∈D′, where

• T is an affine transformation,

• pθ0(xj | y′j = 0), pθ1(xj | y′j = 1) are two mixtures of Gaussians.

Page 10: StatisticalMachineLearning(BE4M33SSU) Seminar1. … · 2017. 10. 13. · 5/10 Example1: ImageNet(visualobjectclassification) A“spin-off”: afullyconvolutionalnetworkforsemanticsegmentation

10/10Example 3: Joint segmentation & registration

� loss function `(y,y′) =∑i∈D I{yi 6= y′i}, i.e. Hamming distance

(1) Segmentation for known T and θ: minimise expected Hamming distance between trueand estimated segmentation ⇒

y = hT,θ(x) = {hi(x) | i ∈D}

hi(x) = argmaxyi=0,1

pθ((T−1x)i | yi

)·pi(yi)

(2) How to estimate unknown T and θ? See lecture on the EM-Algorithm.