36
Convolutional Neural Networks Amin Mir Mohammad Javadi 1

Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Convolutional Neural Networks

Amin MirMohammad Javadi

1

Page 2: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Application

• Image recognition

• Completely dominated the machine vision space

• One of the hottest topics in AI today

• Tricky to understand

2

Page 3: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Why not Regular Neural Nets

• They don't scale well to full images.

• In CIFAR-10

๏ Images of size 32⨉32⨉3 ⟹ 3072 weights per neuron

• Larger images

๏ 200⨉200⨉3 ⟹ 120,000 weights

3

Page 4: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Why not Regular Neural Nets

• Input consists of images

• Neurons in layers arranged in three dimension:

๏ Width, height, depth

4

Page 5: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Why not Regular Neural Nets

5

Page 6: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Historical Overview• CNN’s are inspired by organization of animals visual cortex

• In 1998, Yann LeCun et al. presented first CNN

• Between 10 thousands of images, it gave only 82 case errors

6

Page 7: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

ImageNet Challenge

• ImageNet Large Scale Visual Recognition challenge(ILSVRC)

• As of 2016, over ten million of images have been hand-annotated

• Every year error rates fell to a few precent(25%,16% …)

7

Page 8: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

ConvNet Architecture• Convolution Layer

• ReLU Layer

• Pooling Layer

• Fully-Connected Layer

• Softmax

8

Page 9: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Convolution Layer• Neurons are not fully-connected

• Compute dot product

9

Page 10: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Convolution Layer

10

Page 11: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Convolution Layer• Several filters

11

Page 12: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Convolution Layer• Weights ⟹ Learnable Filter

12

Page 13: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Convolution Layer• Slide the filter over the width and height

• Like Convolution Operation

• Produces a 2-dimensional activation map

13

Page 14: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Convolution Layer• Example

14

Page 15: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Convolution Layer

15

Page 16: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Convolution Layer

16

Page 17: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

ReLU

• Rectified linear unit

• Applies an element-wise activation function

๏ y = max(0, X)

17

Page 18: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Pooling Layer• Performs a downsampling operation

• Progressively reduces the spatial size of activation maps

๏ Shrinks the number of parameters & computation

๏ Control overfitting

• Max pool with filters of size 2 and stride of 2

๏ reduces the spatial extent by half

18

Page 19: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Pooling Layer

19

Page 20: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Fully-Connected Layer• Fully-Connected

• No parameter sharing

• Using ReLU activation function instead of Sigmoid is common

20

Page 21: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Fully-Connected Layer

21

Page 22: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Softmax• Normalized exponential function

• Generalization of the logistic function

22

Page 23: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

CNN Architecture• Stack Conv/ReLU

• Periodically use Pool layers

23

Page 24: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

CNN in Practice

24

Page 25: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

VGGNet• VGGNet (Simonyan and

Zisserman 2014)

• 3⨉3 filters

• zero-padding of 1

• stride of 2

• 2⨉2 MAX POOLING with stride of 2

• 7.3% top five error

25

Page 26: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

VGGNet

26

Page 27: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

LeNet• 5 x 5 filter with stride of 1

• 2⨉2 MAX POOLING with stride of 2

27

Page 28: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Other Examples

• GoogleNet

• MSRA(Microsoft Research Asia)

• SqueezeNet

• And …

28

Page 29: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Toolbox and frameworks• Caffe

• Tensorflow

• CNTK(Microsoft)

• Theano

• and …

29

Page 30: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Showtime

• http://cs.stanford.edu/people/karpathy/convnetjs/demo/cifar10.html

• http://demo.caffe.berkeleyvision.org/

30

Page 31: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

DenseCap• Fei-Fei Li

• Andrej Karpathy

• Justin Johnson

• Dense Captioning

• a Convolutional Network

• a dense localization layer

• Recurrent Neural Network language

31

Page 32: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

DenseCap❝We introduce the dense captioning task, which requires a computer vision system to both localize and describe salient regions in images in natural language.❞

32

Page 33: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

33

Page 34: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Other Researches and Applications

• FaceApp

• JibJab

• Soccer Activity Recognition

• and …

34

Page 35: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Thanks everyone!

35

Page 36: Convolutional Neural NetworksWhy not Regular Neural Nets • They don't scale well to full images. • In CIFAR-10 ๏ Images of size 32⨉32⨉3 3072 weights per neuron • Larger

Any Question??!!

36