37
ImageNet ImageNet Classification Classification with with Deep Deep Convolutional Convolutional Neural Neural Networks Networks Networks Networks Alex Alex Krizhevsky Krizhevsky, , Ilya Ilya Sutskever Sutskever, Geoffrey E. Hinton , Geoffrey E. Hinton

ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Embed Size (px)

Citation preview

Page 1: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

ImageNetImageNet Classification Classification

withwith

Deep Deep ConvolutionalConvolutional Neural Neural

NetworksNetworksNetworksNetworks

Alex Alex KrizhevskyKrizhevsky, , IlyaIlya SutskeverSutskever, Geoffrey E. Hinton, Geoffrey E. Hinton

Page 2: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

MotivationMotivationClassification goals:

•Make 1 guess about the label (Top-1 error)

•Make 5 guesses about the label (Top-5 error)

No

Bounding

Box

Page 3: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

DatabaseDatabase

ImageNet�15M images

�22K categories

�Images collected from Web

�RGB Images

�Variable-resolution�Variable-resolution

�Human labelers (Amazon’s Mechanical Turk crowd-sourcing)

ImageNet Large Scale Visual Recognition Challenge

(ILSVRC-2010) �1K categories

�1.2M training images (~1000 per category)

�50,000 validation images

�150,000 testing images

Page 4: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Strategy Strategy –– Deep LearningDeep Learning

“Shallow” vs. “deep” architectures

reference : http://web.engr.illinois.edu/~slazebni/spring14/lec24_cnn.pdf

Learn a feature hierarchy all the way from pixels to classifier

Page 5: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Neuron Neuron -- PerceptronPerceptron

x1

x2

Input(raw pixel)

w1

Weights

x2

x3

xd

f

w2

w3

wd

Output: f(w*x+b)

reference : http://en.wikipedia.org/wiki/Sigmoid_function#mediaviewer/File:Gjl-t(x).svg

Page 6: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

MultiMulti--Layer Neural NetworksLayer Neural Networks

� Nonlinear classifier

� Learning can be done

by gradient descent

Input

Layer

Hidden

Layer

Output

Layer

by gradient descent

� Back-Propagation

algorithm

Page 7: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Feed Forward Operation Feed Forward Operation input layer:

d features

x(1)

x(2)

hidden layer: output layer:m outputs, one for

each class

z1

wji vkj

x

x(d)

bias unit

zm

Page 8: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Notation for WeightsNotation for Weights� Use wji to denote the weight between input

unit i and hidden unit j

x(i)

wji

hidden unit jinput unit i

wjix(i) yj

� Use vkj to denote the weight between hidden

unit j and output unit k

vkj

output unit khidden unit j

yjzkvkjyj

Page 9: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Notation for ActivationNotation for Activation

� Use neti to denote the activation and hidden unit j

hidden unit j

yj

( )∑=

+=

d

i

jji

i

j wwxnet

1

0

� Use net*k to denote the activation at output unit k

∑=

+=

HN

j

kkjjk vvynet1

0

*

output unit k

zj

Page 10: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Network TrainingNetwork Training

MNN with weightsinput sample xp

1. Initialize weights wji and vkj randomly but not to 0

2. Iterate until a stopping criterion is reached

output

=z

z M1

MNN with weights

wji and vkj

input sample xp

choose p

Compare output z with the desired target t;

adjust wji and vkj to move closer to the goal

t (by backpropagation)

output

=m

z

z M

Page 11: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

BackPropagationBackPropagation� Learn wji and vkj by minimizing the training error

� What is the training error?

� Suppose the output of MNN for sample x is z and the target

(desired output for x ) is t

( ) ( )∑ −=

m

ccztvwJ

21,� Error on one sample:

( ) ( ) ( )( )∑∑= =

−=

n

i

m

c

i

c

i

cztvwJ

1 1

2

2

1,� Training error:

� Use gradient descent:

( ) ( ) ( )( )t

w

ttwJww ∇−=

+

η1

( ) ( )=

00,wv random

repeat until convergence:

( ) ( ) ( )( )t

v

ttvJvv ∇−=

+

η1

( ) ( )∑=

−=

c

ccztvwJ

12,� Error on one sample:

Page 12: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

BackPropagationBackPropagation: Layered Model: Layered Model( )∑=

+=

d

i

jji

i

j wwxnet

1

0

activation athidden unit j

( )jj netfy =output at hidden unit j

∑=

+=

HN

j

kkjjk vvynet1

0

*activation at output unit k

( )*kk

netfz =activation at output unit k

( ) ( )∑=

−=

m

c

ccztvwJ

1

2

2

1,objective function

kjv

J

chain

rule

jiw

J

chain

rule

Page 13: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

BackPropagationBackPropagation of Errorsof Errors( ) ( ) ( ) ( )

kj

m

k

kkk

i

j

ji

vnetfztxnetfw

J∑=

′−′−=∂

1

* ( ) ( )jkkk

kj

ynetfztv

J *'−−=

error

z1

unit junit i

� Name “backpropagation” because during training, errors propagated back from output to hidden layer

zm

Page 14: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Learning CurvesLearning Curves

cla

ssif

ica

tio

n e

rro

r

training time

cla

ssif

ica

tio

n e

rro

r

� this is a good time to stop training, since after this time we start to overfit

� Stopping criterion is part of training phase, thus validation data is part of the training data

� To assess how the network will work on the unseen examples, we still need test data

Page 15: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

MomentumMomentum� Gradient descent finds only a local minima

� not a problem if J(w) is small at a local minima. Indeed, we do not wish to find w

s.t. J(w) = 0 due to overfitting

J(w)

reasonable local minimum

global minimum

reasonable local minimum

� problem if J(w) is large at a local

minimum w

J(w)

global minimum

bad local minimum

Page 16: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

MomentumMomentum� Momentum: popular method to avoid local minima and

also speeds up descent in plateau regions� weight update at time t is

( ) ( ) ( ) ( )111

−+ ∆+

−+= tttw

Jww αηα

� add temporal average direction in which weights have been moving recently

( ) ( ) ( )1−−=∆

tttwww

� at α = 0, equivalent to gradient descent

� at α = 1, gradient descent is ignored, weight update continues in the direction in

which it was moving previously (momentum)

� usually, α is around 0.9

( ) ( ) ( ) ( )111

−+ ∆+

∂−+= ttt

ww

ww αηα

previous directionsteepest descent

direction

Page 17: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

11D ConvolutionD Convolution

Page 18: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Neural 1D Convolution Neural 1D Convolution

ImplementationImplementation

Page 19: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

22D Convolution MatrixD Convolution Matrix

reference : http://en.wikipedia.org/wiki/Kernel_(image_processing)

Page 20: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

ConvolutionalConvolutional FilterFilter

reference : http://cs.nyu.edu/~fergus/tutorials/deep_learning_cvpr12/fergus_dl_tutorial_final.pptx

InputFeature Map

.

.

.

Page 21: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

ArchitectureArchitecture

•Trained with stochastic gradient descent on two NVIDIA GPUs for about a

week (5~6 days)

•650,000 neurons, 60 million parameters, 630 million connections

•The last layer contains 1,000 neurons which produces a distribution over

the 1,000 class labels.

Page 22: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

ArchitectureArchitecture

Page 23: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

ArchitectureArchitecture

Page 24: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

ArchitectureArchitecture

Page 25: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

ResponseResponse--Normalization LayerNormalization Layer

� : the activity of a neuron computed by applying kernel i at

position (x, y)

� The response-normalized activity is given by

� N : the total # of kernels in the layer

� n : hyper-parameter, n=5

� k : hyper-parameter, k=2

� α : hyper-parameter, α=10^(-4)

� β : hyper-parameter, β =0.75

� This aids generalization even though ReLU don’t require it.

� This reduces top-1 error by 1.4 , top-5 error rate by 1.2%

Page 26: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Pooling LayerPooling Layer

◦ Non-overlapping / overlapping regions

◦ Sum or max

Max

reference : http://cs.nyu.edu/~fergus/tutorials/deep_learning_cvpr12/fergus_dl_tutorial_final.pptx

Sum

Reduces the error rate of top-1 by 0.4% and top-5 by 0.3%

Page 27: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

ArchitectureArchitecture

Page 28: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

First Layer First Layer Visualization Visualization

Page 29: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

ReLUReLU

Page 30: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Learning ruleLearning rule

� Use stochastic gradient descent with a batch size of 128 examples,

momentum of 0.9, and weigh decay of 0.0005

� The update rule for weight w was

� i : the iteration index

� : the learning rate, initialized at 0.01 and reduced three times prior to

termination

� : the average over the i-th batch Diof the derivative of the

objective with respect to w

� Train for 90 cycles through the training set of 1.2 million images

Page 31: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Fighting Fighting overfittingoverfitting -- inputinput

� This neural net has 60M real-valued parameters and 650,000 neurons

� It overfils a lot therefore train on five 224x224 patches extracted randomly from 224x224 patches extracted randomly from 256x256 images, and also their horizontal reflections

Page 32: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Fighting Fighting overfittingoverfitting -- DropoutDropout� Independently set each hidden unit activity to zero with 0.5

probability

� Used in the two globally-connected hidden layers at the net's

output

� Doubles the number of iterations required to converge

reference : http://www.image-net.org/challenges/LSVRC/2012/supervision.pdf

Page 33: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Results Results -- ClassificationClassification

� ILSVRC-2010 test set

� ILSVRC-2012 test set

Page 34: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Results Classification Results Classification

Page 35: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

Results Results RetrivalRetrival

Page 36: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

The EndThe End

Thank you for your attention

Page 37: ImageNet Classification with Deep Deep Convolutional …rita/visual_recog_course/talks/ImageNet... · ImageNet Classification with Deep Deep Convolutional Convolutional Neural Neural

ReferncesRefernces

� www.cs.toronto.edu/~fritz/absps/imagenet.pd

� https://prezi.com/jiilm_br8uef/imagenet-classification-with-deep-convolutional-neural-networks/

� sglab.kaist.ac.kr/~sungeui/IR/.../second/201454� sglab.kaist.ac.kr/~sungeui/IR/.../second/20145481오은수.pptx

� http://alex.smola.org/teaching/cmu2013-10-701/slides/14_PrincipalComp.pdf

� Hagit Hel-or (Convolution Slide)

� http://www.cs.haifa.ac.il/~rita/ml_course/lectures/NN.pdf