introduction to convolutional neural nets

70

Upload: shamane-siriwardhana

Post on 12-Apr-2017

621 views

Category:

Data & Analytics


1 download

TRANSCRIPT

Page 1: Introduction to Convolutional Neural Nets
Page 2: Introduction to Convolutional Neural Nets

Facebook!

Page 3: Introduction to Convolutional Neural Nets

Clarifai

Page 4: Introduction to Convolutional Neural Nets

Let’s reveal the mystery!

Page 5: Introduction to Convolutional Neural Nets

Neural Nets

Page 6: Introduction to Convolutional Neural Nets

What this can do!

Page 7: Introduction to Convolutional Neural Nets

Let’s start with a node

Page 8: Introduction to Convolutional Neural Nets

ArchitectureForward Pass•Calculating the loss

Page 9: Introduction to Convolutional Neural Nets

Backward Pass

•Backpropagation Algorithm

•Distributing Gradients

Page 10: Introduction to Convolutional Neural Nets

Optimizing

•Reducing the loss

•Updating the weight matrix

Page 11: Introduction to Convolutional Neural Nets

Updating weights

Loss FunctionUpdating weights

Page 12: Introduction to Convolutional Neural Nets

YOU CAN’T TRAINIF THERE ARE NO GRADIENTS

Page 13: Introduction to Convolutional Neural Nets

This went deeper!How ?With the help of two superheros!

Page 14: Introduction to Convolutional Neural Nets
Page 15: Introduction to Convolutional Neural Nets

Deep Neural Networks

Page 16: Introduction to Convolutional Neural Nets

What makes this special?

Page 17: Introduction to Convolutional Neural Nets

Hierarchical Feature Representation

Page 18: Introduction to Convolutional Neural Nets

Why this feature thing is so effective ?

Page 19: Introduction to Convolutional Neural Nets

Then what happened ?Deep Neural Nets became harder and harder to train!

DEEP NETS!

Y U NO EASY?

Page 20: Introduction to Convolutional Neural Nets

Number Of Parameters?

Page 21: Introduction to Convolutional Neural Nets

These nets are huge!

Millions of layers Millions of nodesBillions of parameters

BUT DON’T KNOW HOW MANY HIDDEN LAYERS / NODES TO

USE?

WHEN YOU WANT TO BUILD A NEURAL NET

Page 22: Introduction to Convolutional Neural Nets

Overfitting

Page 23: Introduction to Convolutional Neural Nets

Killing the training process

Neuron in a neural network

Sigmoid activation function

Page 24: Introduction to Convolutional Neural Nets

Too much connections ? What if we input some exact features!

Page 25: Introduction to Convolutional Neural Nets

Feature Engineering

Page 26: Introduction to Convolutional Neural Nets

Canny edge detection filter

Page 27: Introduction to Convolutional Neural Nets
Page 28: Introduction to Convolutional Neural Nets

How we see things ?

Page 29: Introduction to Convolutional Neural Nets

Important!

Not all pixels!

But patterns of pixels!

This is fast!

Right to left ?

Can you remember

Page 30: Introduction to Convolutional Neural Nets

NOT EVERYTHING

BUT IMPORTANT THINGS!

Page 31: Introduction to Convolutional Neural Nets

Can we design set of features for machines ??

No way!We may design some high level features!

But our machines deal with PIXELS!

Page 32: Introduction to Convolutional Neural Nets

What if we let the machine to extract it’s own features!

Page 33: Introduction to Convolutional Neural Nets

Wow that was nice :)

BRACE YOURSELVESCNN IS COMING

Page 34: Introduction to Convolutional Neural Nets

Imagenet Challenge

Page 35: Introduction to Convolutional Neural Nets
Page 36: Introduction to Convolutional Neural Nets

Step by step

ConvNets have one layer called CN layer after the input layer

This act as an automatic feature extractor

Page 37: Introduction to Convolutional Neural Nets

Additional Layers!Convolution layer

RELU layer (Nonlinearity)

Max pooling layer

Page 38: Introduction to Convolutional Neural Nets

Amazing local connectivity

Page 39: Introduction to Convolutional Neural Nets
Page 40: Introduction to Convolutional Neural Nets

Let’s go layerwise!

Page 41: Introduction to Convolutional Neural Nets

Convolutional Layer This is simply applying convolution to input pixels

Page 42: Introduction to Convolutional Neural Nets

Now! What is convolution?

Mathematical way

Page 43: Introduction to Convolutional Neural Nets

Easy way!

Page 44: Introduction to Convolutional Neural Nets

For an image

Page 45: Introduction to Convolutional Neural Nets

CONVOLUTION

EVERYWHERE

Page 46: Introduction to Convolutional Neural Nets

More generally...

Filter search for things in the image

When filter sees something similar to it’s orientation in an image it will fire up!

Page 47: Introduction to Convolutional Neural Nets

Image get transformed into something new !

We call this new image as a feature mapBecause it mapps some features from the original

image w.r.t to the filter!

Right - Feature map obtained by applying canny edge filter on an image

Page 48: Introduction to Convolutional Neural Nets

It’s not only a single filter!

Many filters searching for diffrent things!

How amazing!

So we will have different feature maps!

Page 49: Introduction to Convolutional Neural Nets

Simply each filter has it’s own task

Gabor filters are similar to those of the human visual system, and they have been found to be particularly appropriate for texture

representation and discrimination.

Page 50: Introduction to Convolutional Neural Nets

How filter weights looking at an image!

Page 51: Introduction to Convolutional Neural Nets

This is how it’s done!

Page 52: Introduction to Convolutional Neural Nets

Feature maps = Set of neurones

Page 53: Introduction to Convolutional Neural Nets

That’s convolution layer!But where’s the magic ?

Page 54: Introduction to Convolutional Neural Nets

All these filters are trainable!

Means ?

These are not man made filters! Look at the values of following filter kernels

Page 55: Introduction to Convolutional Neural Nets
Page 56: Introduction to Convolutional Neural Nets
Page 57: Introduction to Convolutional Neural Nets

What about the filter?

We can design size , channels of the filter

But not its values!

Each filter values is trainable weight

Page 58: Introduction to Convolutional Neural Nets

All in one!So every filter values is trainable

It’s like a set of weights !

But how ?

With backprop

Convolution is a perfectly differentiable function!

So we can learn it’s weight parameters

Page 59: Introduction to Convolutional Neural Nets
Page 60: Introduction to Convolutional Neural Nets

Reminder!

Page 61: Introduction to Convolutional Neural Nets
Page 62: Introduction to Convolutional Neural Nets

Then we apply some nonlinearity We apply rely on each point in the feature maps

Remember : These points in the feature maps are like neurons

This is like just forgetting the negative parts of the

Page 63: Introduction to Convolutional Neural Nets
Page 64: Introduction to Convolutional Neural Nets

So the orientation be like

Page 65: Introduction to Convolutional Neural Nets

Then the pooling layer

This is like a filter without parameters!

This is for subsample or to reduce the dimensions of the feature maps

Simply this will extract the most important features from the feature map

Page 66: Introduction to Convolutional Neural Nets

That’s basics! Lenet

Page 67: Introduction to Convolutional Neural Nets

So finally….

We can train these filter weights using backprop and some kind of optimization algorithms(Adam)

Here’s a such view of a trained filter

Page 68: Introduction to Convolutional Neural Nets
Page 69: Introduction to Convolutional Neural Nets

Motivation!

Page 70: Introduction to Convolutional Neural Nets

Q & A !