100
Introduction To Machine Learning and Deep Learning Ibrahim Amer TA at FCIS, Ain Shams University [email protected] 1

Introduction to machinel learning and deep learning

Embed Size (px)

Citation preview

Page 1: Introduction to machinel learning and deep learning

1

Introduction To Machine Learning and Deep Learning

Ibrahim AmerTA at FCIS,Ain Shams [email protected]

Page 2: Introduction to machinel learning and deep learning

2

Agenda

What is the computer? Introduction to machine learning Applications on machine learning Introduction to deep learning Convolutional Neural Networks How to build a computer to start deep learning Deep learning Tools Companies and deep learning

Page 3: Introduction to machinel learning and deep learning

3

What is computer?

A computer is a machine that understands zeros and ones only.

The computer can perform complex mathematical and arithmetic operations very fast.

It performs this using a combination of circuits and logic gates.

Page 4: Introduction to machinel learning and deep learning

4

Comment on the following

What is the result?

50 + 30 ?

Page 5: Introduction to machinel learning and deep learning

5

Comment on the following

What is the result?

58945 + 78954?

Page 6: Introduction to machinel learning and deep learning

6

Comment on the following

What is the result?

Page 7: Introduction to machinel learning and deep learning

7

Comment on the following

What do you see?

Page 8: Introduction to machinel learning and deep learning

8

Comment on the following

What do you see?

Page 9: Introduction to machinel learning and deep learning

9

Comment on the following

Can you write a program to compute the power ?

Page 10: Introduction to machinel learning and deep learning

10

Comment on the following

Can you write a program to recognize faces or recognize brands of cars?

Page 11: Introduction to machinel learning and deep learning

11

Conclusion

Computers are very powerful and accurate in calculations, they can perform any arithmetic operation faster than any human being.

Humans are faster and more accurate than computers in recognition tasks.

Do you know any one who could compute 787452665 * 75767487 in just seconds?

Are the machines capable recognize and to reach human level accuracy in recognition ?

Page 12: Introduction to machinel learning and deep learning

12

What is Machine Learning? “A computer program is said to learn from experience E with respect

to some task T and some performance measure P, if its performance on T, as measured by P, improves with experience E.” -- Tom Mitchell,

Carnegie Mellon University

Page 13: Introduction to machinel learning and deep learning

13

What is Machine Learning?

Machine learning is a discipline of AI It is a series of techniques that are used to make the computer smarter

. ML solves problems that cannot be solved by numerical means alone. Machine learning is empowering a lot of technologies used today. Among the different types of ML tasks, a crucial distinction is drawn

between supervised and unsupervised learning: Supervised machine learning: The program is “trained” on a pre-defined

set of “training examples”, which then facilitate its ability to reach an accurate conclusion when given new data.

Unsupervised machine learning: The program is given a bunch of data and must find patterns and relationships therein.

Page 14: Introduction to machinel learning and deep learning

14

Supervised Machine Learning

In the majority of supervised learning applications, the ultimate goal is to develop a finely tuned predictor function (sometimes called the “hypothesis”)

Given input data about a certain domain (say, square footage of a house), it will accurately predict some interesting value

In practice, x almost always represents multiple data points. So, for example, a housing price predictor might take not only square-footage (x1) but also number of bedrooms (x2), number of bathrooms (x3), number of floors (x4), year built (x5), zip code (x6), and so forth. Determining which inputs to use is an important part of ML design. However, for the sake of explanation, it is easiest to assume a single input value is used.

Page 15: Introduction to machinel learning and deep learning

15

So let’s say our simple predictor has this form:

Where and are constants. Our goal is to find the perfect values and to make our predictor work as well as possible.

To make our program learn and we should update them according to error analysis which is called mean square error.

The weights are updated using gradient decent algorithm

Page 16: Introduction to machinel learning and deep learning

16

Page 17: Introduction to machinel learning and deep learning

17

Page 18: Introduction to machinel learning and deep learning

18

Unsupervised Learning

Unsupervised learning typically is tasked with finding relationships within data.

There are no training examples used in this process.

Instead, the system is given a set data and tasked with finding patterns and correlations therein.

Examples: astronomical data analysis, social network analysis and cocktail party problem and news grouping

Page 19: Introduction to machinel learning and deep learning

19

Applications on machine learning

Spam filtering: Classifying emails as spam or non-spam

Weather forecast: Machine learning is applied in weather forecasting software to improve the quality of the forecast.

Anti-virus: Machine learning is used in Anti-virus software's to improve detection of malicious software on computer devices.

Personal Assistants: Siri & Cortana

Classifying a tumor as benign tumor or malignant tumor.

Page 20: Introduction to machinel learning and deep learning

20

Deep Learning

Deep Learning is a subfield of machine learning concerned with algorithms inspired by the structure and function of the brain called artificial neural networks.

Andrew Ng: “very large neural networks we can now have and … huge amounts of data that we have access to”

Andrew Ng: “for most flavors of the old generations of learning algorithms … performance will plateau. … deep learning … is the first class of algorithms … that is scalable. … performance just keeps getting better as you feed them more data”

Page 21: Introduction to machinel learning and deep learning

21

Deep Learning

Page 22: Introduction to machinel learning and deep learning

22

Deep Learning

Deep learning is set of techniques that in some cases could reach human accuracy in recognition !

The most common used and the most famous architecture is convolutional neural network.

There are some other techniques like: LSTM (Long Short Term Memory) Residual Neural Networks Autoencoders Generative Adversarial Networks.

We will focus on convolution neural networks.

Page 23: Introduction to machinel learning and deep learning

A toy ConvNet: X’s and O’sSays whether a picture is of an X or an O

X or OCNN

A two-dimensionalarray of pixels

Page 24: Introduction to machinel learning and deep learning

For example

CNN X

CNN O

Page 25: Introduction to machinel learning and deep learning

Trickier cases

CNN X

CNN Otranslation scaling weightrotation

Page 26: Introduction to machinel learning and deep learning

Deciding is hard

=?

Page 27: Introduction to machinel learning and deep learning

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 -1 -1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 1 -1 -1 -1-1 -1 1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 1 -1 -1-1 -1 -1 1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 -1 -1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

What computers see

=?

Page 28: Introduction to machinel learning and deep learning

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 X -1 -1 -1 -1 X X -1-1 X X -1 -1 X X -1 -1-1 -1 X 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 X -1 -1-1 -1 X X -1 -1 X X -1-1 X X -1 -1 -1 -1 X -1-1 -1 -1 -1 -1 -1 -1 -1 -1

What computers see

Page 29: Introduction to machinel learning and deep learning

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 -1 -1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 1 -1 -1 -1-1 -1 1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 1 -1 -1-1 -1 -1 1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 -1 -1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Computers are literal

=x

Page 30: Introduction to machinel learning and deep learning

ConvNets match pieces of the image =

=

=

Page 31: Introduction to machinel learning and deep learning

1 -1 -1-1 1 -1-1 -1 1

-1 -1 1-1 1 -11 -1 -1

1 -1 1-1 1 -11 -1 1

Features match pieces of the image

Page 32: Introduction to machinel learning and deep learning

1 -1 -1-1 1 -1-1 -1 1

-1 -1 1-1 1 -11 -1 -1

1 -1 1-1 1 -11 -1 1

Page 33: Introduction to machinel learning and deep learning

1 -1 -1-1 1 -1-1 -1 1

-1 -1 1-1 1 -11 -1 -1

1 -1 1-1 1 -11 -1 1

Page 34: Introduction to machinel learning and deep learning

1 -1 -1-1 1 -1-1 -1 1

-1 -1 1-1 1 -11 -1 -1

1 -1 1-1 1 -11 -1 1

Page 35: Introduction to machinel learning and deep learning

1 -1 -1-1 1 -1-1 -1 1

-1 -1 1-1 1 -11 -1 -1

1 -1 1-1 1 -11 -1 1

Page 36: Introduction to machinel learning and deep learning

1 -1 -1-1 1 -1-1 -1 1

-1 -1 1-1 1 -11 -1 -1

1 -1 1-1 1 -11 -1 1

Page 37: Introduction to machinel learning and deep learning

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

Page 38: Introduction to machinel learning and deep learning

Filtering: The math behind the match

1. Line up the feature and the image patch.2. Multiply each image pixel by the corresponding feature pixel.3. Add them up.4. Divide by the total number of pixels in the feature.

Page 39: Introduction to machinel learning and deep learning

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

1 x 1 = 1

Page 40: Introduction to machinel learning and deep learning

11 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

1 x 1 = 1

Page 41: Introduction to machinel learning and deep learning

1 11 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

-1 x -1 = 1

Page 42: Introduction to machinel learning and deep learning

1 1 11 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

-1 x -1 = 1

Page 43: Introduction to machinel learning and deep learning

1 1 11

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

-1 x -1 = 1

Page 44: Introduction to machinel learning and deep learning

1 1 11 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

1 x 1 = 1

Page 45: Introduction to machinel learning and deep learning

1 1 11 1 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

-1 x -1 = 1

Page 46: Introduction to machinel learning and deep learning

1 1 11 1 11

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

-1 x -1 = 1

Page 47: Introduction to machinel learning and deep learning

1 1 11 1 11 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

-1 x -1 = 1

Page 48: Introduction to machinel learning and deep learning

1 1 11 1 11 1 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

1 x 1 = 1

Page 49: Introduction to machinel learning and deep learning

1

1 1 11 1 11 1 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

1+1+1+1+1+1+1+1+19 =1

Page 50: Introduction to machinel learning and deep learning

11 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

1 x 1 = 1

Page 51: Introduction to machinel learning and deep learning

1 1 -11 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

-1 x 1 = -1

Page 52: Introduction to machinel learning and deep learning

1 1 -11 1 1-1 1 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtering: The math behind the match

Page 53: Introduction to machinel learning and deep learning

1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

1 1 -11 1 1-1 1 1

Filtering: The math behind the match

1+1−1+1+1+1−1+1+19 =.55

.55

1 1 -11 1 1-1 1 1

Page 54: Introduction to machinel learning and deep learning

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Convolution: Trying every possible match

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 55: Introduction to machinel learning and deep learning

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Convolution: Trying every possible match

=

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 56: Introduction to machinel learning and deep learning

1 -1 -1-1 1 -1-1 -1 1

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

=

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-1 -1 1-1 1 -11 -1 -1

1 -1 1-1 1 -11 -1 1

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.11 0.33 -0.77 1.00 -0.77 0.33 -0.11

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

=

=

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Page 57: Introduction to machinel learning and deep learning

Convolution layerOne image becomes a stack of filtered images

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

1 -1 -1-1 1 -1-1 -1 1

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-1 -1 1-1 1 -11 -1 -1

1 -1 1-1 1 -11 -1 1

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.11 0.33 -0.77 1.00 -0.77 0.33 -0.11

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Page 58: Introduction to machinel learning and deep learning

Convolution layerOne image becomes a stack of filtered images

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.11 0.33 -0.77 1.00 -0.77 0.33 -0.11

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Page 59: Introduction to machinel learning and deep learning

Pooling: Shrinking the image stack1. Pick a window size (usually 2 or 3).2. Pick a stride (usually 2).3. Walk your window across your filtered images.4. From each window, take the maximum value.

Page 60: Introduction to machinel learning and deep learning

1.00

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

maximum

Page 61: Introduction to machinel learning and deep learning

1.00 0.33

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

maximum

Page 62: Introduction to machinel learning and deep learning

1.00 0.33 0.55

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

maximum

Page 63: Introduction to machinel learning and deep learning

1.00 0.33 0.55 0.33

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

maximum

Page 64: Introduction to machinel learning and deep learning

1.00 0.33 0.55 0.33

0.33

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

maximum

Page 65: Introduction to machinel learning and deep learning

1.00 0.33 0.55 0.33

0.33 1.00 0.33 0.55

0.55 0.33 1.00 0.11

0.33 0.55 0.11 0.77

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

max pooling

Page 66: Introduction to machinel learning and deep learning

1.00 0.33 0.55 0.33

0.33 1.00 0.33 0.55

0.55 0.33 1.00 0.11

0.33 0.55 0.11 0.77

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.11 0.33 -0.77 1.00 -0.77 0.33 -0.11

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

0.33 0.55 1.00 0.77

0.55 0.55 1.00 0.33

1.00 1.00 0.11 0.55

0.77 0.33 0.55 0.33

0.55 0.33 0.55 0.33

0.33 1.00 0.55 0.11

0.55 0.55 0.55 0.11

0.33 0.11 0.11 0.33

Page 67: Introduction to machinel learning and deep learning

Pooling layerA stack of images becomes a stack of smaller images.

1.00 0.33 0.55 0.33

0.33 1.00 0.33 0.55

0.55 0.33 1.00 0.11

0.33 0.55 0.11 0.77

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.11 0.33 -0.77 1.00 -0.77 0.33 -0.11

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

0.33 0.55 1.00 0.77

0.55 0.55 1.00 0.33

1.00 1.00 0.11 0.55

0.77 0.33 0.55 0.33

0.55 0.33 0.55 0.33

0.33 1.00 0.55 0.11

0.55 0.55 0.55 0.11

0.33 0.11 0.11 0.33

Page 68: Introduction to machinel learning and deep learning

NormalizationKeep the math from breaking by tweaking each of the values just a bit.Change everything negative to zero.

Page 69: Introduction to machinel learning and deep learning

Rectified Linear Units (ReLUs)

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

0.77

Page 70: Introduction to machinel learning and deep learning

0.77 0

Rectified Linear Units (ReLUs)

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 71: Introduction to machinel learning and deep learning

0.77 0 0.11 0.33 0.55 0 0.33

Rectified Linear Units (ReLUs)

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 72: Introduction to machinel learning and deep learning

0.77 0 0.11 0.33 0.55 0 0.33

0 1.00 0 0.33 0 0.11 0

0.11 0 1.00 0 0.11 0 0.55

0.33 0.33 0 0.55 0 0.33 0.33

0.55 0 0.11 0 1.00 0 0.11

0 0.11 0 0.33 0 1.00 0

0.33 0 0.55 0.33 0.11 0 0.77

Rectified Linear Units (ReLUs)

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 73: Introduction to machinel learning and deep learning

ReLU layerA stack of images becomes a stack of images with no negative values.

0.77 0 0.11 0.33 0.55 0 0.33

0 1.00 0 0.33 0 0.11 0

0.11 0 1.00 0 0.11 0 0.55

0.33 0.33 0 0.55 0 0.33 0.33

0.55 0 0.11 0 1.00 0 0.11

0 0.11 0 0.33 0 1.00 0

0.33 0 0.55 0.33 0.11 0 0.77

0.33 0 0.11 0 0.11 0 0.33

0 0.55 0 0.33 0 0.55 0

0.11 0 0.55 0 0.55 0 0.11

0 0.33 0 1.00 0 0.33 0

0.11 0 0.55 0 0.55 0 0.11

0 0.55 0 0.33 0 0.55 0

0.33 0 0.11 0 0.11 0 0.33

0.33 0 0.55 0.33 0.11 0 0.77

0 0.11 0 0.33 0 1.00 0

0.55 0 0.11 0 1.00 0 0.11

0.33 0.33 0 0.55 0 0.33 0.33

0.11 0 1.00 0 0.11 0 0.55

0 1.00 0 0.33 0 0.11 0

0.77 0 0.11 0.33 0.55 0 0.33

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.11 0.33 -0.77 1.00 -0.77 0.33 -0.11

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

Page 74: Introduction to machinel learning and deep learning

Layers get stackedThe output of one becomes the input of the next.

Conv

olut

ion

ReLU

Pool

ing-1 -1 -1 -1 -1 -1 -1 -1 -1

-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

1.00 0.33 0.55 0.33

0.33 1.00 0.33 0.55

0.55 0.33 1.00 0.11

0.33 0.55 0.11 0.77

0.33 0.55 1.00 0.77

0.55 0.55 1.00 0.33

1.00 1.00 0.11 0.55

0.77 0.33 0.55 0.33

0.55 0.33 0.55 0.33

0.33 1.00 0.55 0.11

0.55 0.55 0.55 0.11

0.33 0.11 0.11 0.33

Page 75: Introduction to machinel learning and deep learning

Deep stackingLayers can be repeated several (or many) times.

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Conv

olut

ion

ReLU

Pool

ing

Conv

olut

ion

ReLU

Conv

olut

ion

ReLU

Pool

ing

1.00 0.55

0.55 1.00

0.55 1.00

1.00 0.55

1.00 0.55

0.55 0.55

Page 76: Introduction to machinel learning and deep learning

Fully connected layerEvery value gets a vote

1.00 0.55

0.55 1.00

0.55 1.00

1.00 0.55

1.00 0.55

0.55 0.55

1.00

0.55

0.55

1.00

1.00

0.55

0.55

0.55

0.55

1.00

1.00

0.55

Page 77: Introduction to machinel learning and deep learning

Fully connected layerVote depends on how strongly a value predicts X or O

XO

1.00

0.55

0.55

1.00

1.00

0.55

0.55

0.55

0.55

1.00

1.00

0.55

Page 78: Introduction to machinel learning and deep learning

Fully connected layerVote depends on how strongly a value predicts X or O

XO

0.55

1.00

1.00

0.55

0.55

0.55

0.55

0.55

1.00

0.55

0.55

1.00

Page 79: Introduction to machinel learning and deep learning

Fully connected layerFuture values vote on X or O

XO

0.9

0.65

0.45

0.87

0.96

0.73

0.23

0.63

0.44

0.89

0.94

0.53

Page 80: Introduction to machinel learning and deep learning

Fully connected layerFuture values vote on X or O

XO

0.9

0.65

0.45

0.87

0.96

0.73

0.23

0.63

0.44

0.89

0.94

0.53

Page 81: Introduction to machinel learning and deep learning

Fully connected layerFuture values vote on X or O

XO

0.9

0.65

0.45

0.87

0.96

0.73

0.23

0.63

0.44

0.89

0.94

0.53

.92

Page 82: Introduction to machinel learning and deep learning

Fully connected layerFuture values vote on X or O

XO

0.9

0.65

0.45

0.87

0.96

0.73

0.23

0.63

0.44

0.89

0.94

0.53

.92

Page 83: Introduction to machinel learning and deep learning

Fully connected layerFuture values vote on X or O

XO

0.9

0.65

0.45

0.87

0.96

0.73

0.23

0.63

0.44

0.89

0.94

0.53

.92

.51

Page 84: Introduction to machinel learning and deep learning

Fully connected layerFuture values vote on X or O

XO

0.9

0.65

0.45

0.87

0.96

0.73

0.23

0.63

0.44

0.89

0.94

0.53

.92

.51

Page 85: Introduction to machinel learning and deep learning

Fully connected layerA list of feature values becomes a list of votes.

XO

0.9

0.65

0.45

0.87

0.96

0.73

0.23

0.63

0.44

0.89

0.94

0.53

Page 86: Introduction to machinel learning and deep learning

Fully connected layerThese can also be stacked.

XO

0.9

0.65

0.45

0.87

0.96

0.73

0.23

0.63

0.44

0.89

0.94

0.53

Page 87: Introduction to machinel learning and deep learning

Putting it all togetherA set of pixels becomes a set of votes.

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Conv

olut

ion

ReLU

Pool

ing

Conv

olut

ion

ReLU

Conv

olut

ion

ReLU

Pool

ing

Fully

conn

ecte

d

Fully

conn

ecte

d XO

.92

.51

Page 88: Introduction to machinel learning and deep learning

88

How to build a computer to start deep learning ?

Deep learning techniques’ are resources hungry.

They require huge computing power to give you good performance.

Imagine we have 10 convolution layers of:

256 Conv Filters * Image(1000, 1000)

Page 89: Introduction to machinel learning and deep learning

89

How to build a computer to start deep learning ?

This is pretty huge !.

If you ran this on a CPU it would take 1 day to process 60 000 training images on I7 processor!

What if the network is deeper than 20 layers and more complex than 256 conv filters / layer?

The network in this case may take days or even weeks to finish!!

Page 90: Introduction to machinel learning and deep learning

90

So, what is the solution ?

In each layer in a CNN we are convolving the image with different filters.

What if we could convolve the image with different filters parallel in the same time?

The solution is to use GPU!

Page 91: Introduction to machinel learning and deep learning

91

Comment on the following

How many cores inside a CPU ?

How many cores inside a GPU?

Page 92: Introduction to machinel learning and deep learning

92

What are GPUs brands available out there? There are two famous companies:

Unfortunately, AMD GPUs can’t be used for deep learning.

Nvidia GPUs only can be used

That’s because Nvidia provides tools and support for deep learning geeks.

There is a library called NVIDIA Cuda Toolkit

Page 93: Introduction to machinel learning and deep learning

93

Page 94: Introduction to machinel learning and deep learning

94

Nvidia GPUs

Almost all Nvidia’s GPUs will do the job.

You must check if it is CUDA enabled or not.

You can check online. Just search for CUDA supported GPUs.

Some of CUDA supported GPUs: TITAN X, Geforce GTX 1080, Geforce GTX 1070, Geforce GTX 1060, Geforce GTX 1050, Geforce GTX 980, Geforce GTX 970, Geforce GTX 960, Geforce GTX 9xx M Series, Geforce GTX 6xx Series, Geforce GTX 6xx M Series.

You can always use your CPU if you don’t have Nvidia GPU or if you don’t have GPU at all!.

Page 95: Introduction to machinel learning and deep learning

95

Deep Learning Tools

After building your computer and configuring it for deep learning, you need the right tools and APIs to start coding

There are plenty of languages that can be used: Matlab Python C++ C# Java And so many…

Page 96: Introduction to machinel learning and deep learning

96

Deep Learning Tools

Deep learning frameworks: NVIDIA CUDA programming APIs. Tensorflow (Google’s library) for python. Theano for python. Torch (Facebook’s library) for Lua. Caffe for python. CNTK (Microsoft’s library) for python. Keras to simplify coding for tensorflow and theano.

Page 97: Introduction to machinel learning and deep learning

97

Deep Learning and Companies

Many Companies use deep learning on a daily basis.

Facebook: facebook auto tagger, videos and photos auto caption, post analyzer,

DeepMind (acquired by google): AlphaGo and many

Amazon

Page 98: Introduction to machinel learning and deep learning

98

Questions ?!

Page 99: Introduction to machinel learning and deep learning

99

References

Coursera’s Machine Learning course by Andrew Ng CS231n: Convolutional Neural Networks for Visual Recognition Setup a Deep Learning Environment on Windows (Theano & Keras

with GPU Enabled) ConvNets Visualization How do Convolutional Neural Networks work? Rana el Kaliouby, Co-founder, CEO at Affectiva Hussein Mehanna

Page 100: Introduction to machinel learning and deep learning

100

Thank you!