Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Use-Case Problem Statement
Using Artificial Neural Network, we need to figure out, if the bank notes are real or fake?
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Use-Case Problem Statement
Using Artificial Neural Network, we need to figure out, if the bank notes are real or fake?
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Use-Case Data Set
Data were extracted from images that were taken from genuine and forged banknote-like specimens. The final images
have 400x 400 pixels. Due to the object lens and distance to the investigated object gray-scale pictures with a resolution
of about 660 dpi were gained. Wavelet Transform tool were used to extract features from images.
• Variance of Wavelet Transformed image
• Skewness of Wavelet Transformed image
• Curtosis of Wavelet Transformed image
• Entropy of image
Features
1 – Real, 0 - Fake
Label
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Use-Case Implementation Steps
Start
Read the
Dataset
Define features
and labels
Divide the dataset into two
parts for training and testing
TensorFlow data structure for
holding features, labels etc..
Implement the model
Train the model
Reduce MSE (actual output –
desired output)
End
Repeat the process to
decrease the loss
Pre-processing of dataset
Make prediction on the test
data
Agenda
▪ Why Neural Networks?
▪ Motivation Behind Neural Networks
▪ What Are Neural Networks?
▪ Single Layer Perceptron
▪ Multi Layer Perceptron
▪ Implementation Of The Use-Case
▪ Applications Of Neural Networks
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Why Neural Network?
We will begin by looking at the reason behind the introduction of Neural Networks
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Problem Before Neural Networks
• Unless the specific steps that the computer needs to follow are known the computer cannot solve a
problem.
• This restricts the problem solving capability of conventional computers to problems that we already
understand and know how to solve.
The computer follows
a set of instructions in
order to solve a
problem
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
After Neural Networks
With Neural Networks computers can do things that we don't exactly know how to do.
Neural Networks learn
by example. They cannot
be programmed to
perform a specific task
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Motivation Behind Neural
Networks
Let’s see the motivation behind Artificial Neural Network.
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Motivation Behind Neural Networks
Neuron
Dendrite: Receives signals from
other neurons
Cell Body: Sums all the inputs
Axon: It is used to transmit
signals to the other cells
The building block of a neural net is the neuron. An artificial neuron works much the same
way the biological one does.
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
What Are Artificial Neural
Networks?
Now is the correct time to understand Artificial Neural Networks
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
What Are Artificial Neural Networks?
Artificial Neural Networks (ANNs) are computing systems inspired by the biological neural
networks that constitute animal brains. Such systems learn (progressively improve performance) to
do tasks by considering examples, generally without task-specific programming.
Training
Where is dog
in this pic?
Input
Without Neural Network
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
What Are Artificial Neural Networks?
Artificial Neural Networks (ANNs) are computing systems inspired by the biological neural
networks that constitute animal brains. Such systems learn (progressively improve performance) to
do tasks by considering examples, generally without task-specific programming.
Training
There is one
dog in this pic
Input
With Neural Network
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
How It Works?
Let’s focus on how Neural networks work?
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
How Artificial Neural Networks Work?
To get started, I'll explain artificial neuron called a perceptron.
X1
X2
Xn
Processing
Element
S = Xi Wi
Y
W1
W2
Wn
Y1
Y2
Yn
F(S)
Summation
Transfer
Function
Outputs
Artificial Neuron Biological Neuron
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Modes In Perceptron
Using ModeTraining Mode
In the training mode, the
neuron can be trained to fire
(or not), for particular input
patterns
In the using mode, when a
taught input pattern is
detected at the input, its
associated output becomes
the current output
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Activation Functions
Let’s look at various types of Activation Functions
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Activation Function
Step Function Sigmoid Function
Sign Function
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Perceptron Training With Analogy
Let’s understand this with an analogy
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Perceptron Learning Algorithm – Beer Analogy
Suppose you want to go to a beer festival happening near your house. So your decision will depend
on multiple factors:
1. How is the weather?
2. Your wife is going with you?
3. Any public transport is available?
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Inputs
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Output
Output
‘O’
1
0
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Let’s Prioritize Our Factors
X1 = 1 Output =1
Suppose for you the most important factor is weather, if it is not good you will definitely don’t go. Even if
the other two inputs are high. If it is good than definitely you will go.
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Assign Weights
Now, let’s assign weights to our three inputs
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Assign Weights
W1 = 6, W2 = 2, W3 = 2
Threshold = 5
W1 = 6, W2 = 2, W3 = 2
Threshold = 3
It will fire when weather is good and won’t fire if
weather is bad irrespective of the other inputs
It will fire when either x1 is high or the other two
inputs are high
W1 = Weight associated with input X1
W2 = Weight associated with input X2
W3 = Weight associated with input X3
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Multilayer Perceptron – Artificial
Neural Network
Now, let’s look at multilayer perceptron
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Multilayer Perceptron – Artificial Neural Network
As you know our brain is made up of millions of neurons, so a Neural Network is really just a composition of
perceptrons, connected in different ways and operating on different activation functions.
Input Layer
Hidden Layer 1
Hidden Layer 2
Output Layer
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Example Of Artificial Neural
Networks
Let’s see an example where an Artificial Neural Network is used for image recognition
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Artificial Neural Network - Example
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Training A Neural Network
Let’s see how to train a Neural Network or a Multilayer Perceptron
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Training A Neural Network
The most common deep learning algorithm for supervised training of the multi-layer perceptrons is known as
backpropagation. In it, after the weighted sum of inputs and passing through the activation function we propagate
backwards and update the weights to reduce the error (desired output – model output). Consider the below example:
Input Desired Output
0 0
1 1
2 4
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Training A Neural Network
Input Desired Output Model Output
(W=3)
0 0 0
1 2 3
2 4 6
Let’s consider the initial value of the weight as 3 and see the model output
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Training A Neural Network
Input Desired
Output
Model Output
(W=3)
Absolute Error Square Error
0 0 0 0 0
1 2 3 1 1
2 4 6 2 4
Now, we will see the error (Absolute and Square)
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Training A Neural Network
Input Desired
Output
Model
Output
(W=3)
Absolute
Error
Square
Error
Model
Output
(W=4)
0 0 0 0 0 0
1 2 3 1 1 4
2 4 6 2 4 8
Let’s update the weight value and make it as 4
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Training A Neural Network
Input Desired
Output
Model
Output
(W=3)
Absolute
Error
Square
Error
Model
Output
(W=4)
Square
Error
0 0 0 0 0 0 0
1 2 3 1 1 4 4
2 4 6 2 4 8 16
Still there is error, but we can see that error has increased
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Training A Neural Network
W Error
W Error
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Training A Neural Network
Square
Error
Weight
Decrease
Weight
Increase
Weight
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Use-Case Implementation Steps
Start
Read the
Dataset
Define features
and labels
Divide the dataset into two
parts for training and testing
TensorFlow data structure for
holding features, labels etc..
Implement the model
Train the model
Reduce MSE (actual output –
desired output)
End
Repeat the process to
decrease the loss
Pre-processing of dataset
Make prediction on the test
data
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Applications Of Neural Networks
Modelling and Diagnosing the
Cardiovascular System
Electronic noses
Neural Network In Medicine Neural Network In Business
Marketing
Credit Evaluation
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Session In A Minute
Why Neural Networks? What is Neural Network? What is Perceptron?
What is Multi Layer Perceptron? Training Of Multi Layer Perceptron Use-Case Implementation
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Artificial Neural Network Tutorial | Deep Learning With Neural Networks | Edureka

Artificial Neural Network Tutorial | Deep Learning With Neural Networks | Edureka

  • 1.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Use-Case Problem Statement Using Artificial Neural Network, we need to figure out, if the bank notes are real or fake?
  • 2.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Use-Case Problem Statement Using Artificial Neural Network, we need to figure out, if the bank notes are real or fake?
  • 3.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Use-Case Data Set Data were extracted from images that were taken from genuine and forged banknote-like specimens. The final images have 400x 400 pixels. Due to the object lens and distance to the investigated object gray-scale pictures with a resolution of about 660 dpi were gained. Wavelet Transform tool were used to extract features from images. • Variance of Wavelet Transformed image • Skewness of Wavelet Transformed image • Curtosis of Wavelet Transformed image • Entropy of image Features 1 – Real, 0 - Fake Label
  • 4.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Use-Case Implementation Steps Start Read the Dataset Define features and labels Divide the dataset into two parts for training and testing TensorFlow data structure for holding features, labels etc.. Implement the model Train the model Reduce MSE (actual output – desired output) End Repeat the process to decrease the loss Pre-processing of dataset Make prediction on the test data
  • 5.
    Agenda ▪ Why NeuralNetworks? ▪ Motivation Behind Neural Networks ▪ What Are Neural Networks? ▪ Single Layer Perceptron ▪ Multi Layer Perceptron ▪ Implementation Of The Use-Case ▪ Applications Of Neural Networks
  • 6.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Why Neural Network? We will begin by looking at the reason behind the introduction of Neural Networks
  • 7.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Problem Before Neural Networks • Unless the specific steps that the computer needs to follow are known the computer cannot solve a problem. • This restricts the problem solving capability of conventional computers to problems that we already understand and know how to solve. The computer follows a set of instructions in order to solve a problem
  • 8.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. After Neural Networks With Neural Networks computers can do things that we don't exactly know how to do. Neural Networks learn by example. They cannot be programmed to perform a specific task
  • 9.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Motivation Behind Neural Networks Let’s see the motivation behind Artificial Neural Network.
  • 10.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Motivation Behind Neural Networks Neuron Dendrite: Receives signals from other neurons Cell Body: Sums all the inputs Axon: It is used to transmit signals to the other cells The building block of a neural net is the neuron. An artificial neuron works much the same way the biological one does.
  • 11.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. What Are Artificial Neural Networks? Now is the correct time to understand Artificial Neural Networks
  • 12.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. What Are Artificial Neural Networks? Artificial Neural Networks (ANNs) are computing systems inspired by the biological neural networks that constitute animal brains. Such systems learn (progressively improve performance) to do tasks by considering examples, generally without task-specific programming. Training Where is dog in this pic? Input Without Neural Network
  • 13.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. What Are Artificial Neural Networks? Artificial Neural Networks (ANNs) are computing systems inspired by the biological neural networks that constitute animal brains. Such systems learn (progressively improve performance) to do tasks by considering examples, generally without task-specific programming. Training There is one dog in this pic Input With Neural Network
  • 14.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. How It Works? Let’s focus on how Neural networks work?
  • 15.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. How Artificial Neural Networks Work? To get started, I'll explain artificial neuron called a perceptron. X1 X2 Xn Processing Element S = Xi Wi Y W1 W2 Wn Y1 Y2 Yn F(S) Summation Transfer Function Outputs Artificial Neuron Biological Neuron
  • 16.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Modes In Perceptron Using ModeTraining Mode In the training mode, the neuron can be trained to fire (or not), for particular input patterns In the using mode, when a taught input pattern is detected at the input, its associated output becomes the current output
  • 17.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Activation Functions Let’s look at various types of Activation Functions
  • 18.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Activation Function Step Function Sigmoid Function Sign Function
  • 19.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Perceptron Training With Analogy Let’s understand this with an analogy
  • 20.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Perceptron Learning Algorithm – Beer Analogy Suppose you want to go to a beer festival happening near your house. So your decision will depend on multiple factors: 1. How is the weather? 2. Your wife is going with you? 3. Any public transport is available?
  • 21.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Inputs
  • 22.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Output Output ‘O’ 1 0
  • 23.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Let’s Prioritize Our Factors X1 = 1 Output =1 Suppose for you the most important factor is weather, if it is not good you will definitely don’t go. Even if the other two inputs are high. If it is good than definitely you will go.
  • 24.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Assign Weights Now, let’s assign weights to our three inputs
  • 25.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Assign Weights W1 = 6, W2 = 2, W3 = 2 Threshold = 5 W1 = 6, W2 = 2, W3 = 2 Threshold = 3 It will fire when weather is good and won’t fire if weather is bad irrespective of the other inputs It will fire when either x1 is high or the other two inputs are high W1 = Weight associated with input X1 W2 = Weight associated with input X2 W3 = Weight associated with input X3
  • 26.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Multilayer Perceptron – Artificial Neural Network Now, let’s look at multilayer perceptron
  • 27.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Multilayer Perceptron – Artificial Neural Network As you know our brain is made up of millions of neurons, so a Neural Network is really just a composition of perceptrons, connected in different ways and operating on different activation functions. Input Layer Hidden Layer 1 Hidden Layer 2 Output Layer
  • 28.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Example Of Artificial Neural Networks Let’s see an example where an Artificial Neural Network is used for image recognition
  • 29.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Artificial Neural Network - Example
  • 30.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Training A Neural Network Let’s see how to train a Neural Network or a Multilayer Perceptron
  • 31.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Training A Neural Network The most common deep learning algorithm for supervised training of the multi-layer perceptrons is known as backpropagation. In it, after the weighted sum of inputs and passing through the activation function we propagate backwards and update the weights to reduce the error (desired output – model output). Consider the below example: Input Desired Output 0 0 1 1 2 4
  • 32.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Training A Neural Network Input Desired Output Model Output (W=3) 0 0 0 1 2 3 2 4 6 Let’s consider the initial value of the weight as 3 and see the model output
  • 33.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Training A Neural Network Input Desired Output Model Output (W=3) Absolute Error Square Error 0 0 0 0 0 1 2 3 1 1 2 4 6 2 4 Now, we will see the error (Absolute and Square)
  • 34.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Training A Neural Network Input Desired Output Model Output (W=3) Absolute Error Square Error Model Output (W=4) 0 0 0 0 0 0 1 2 3 1 1 4 2 4 6 2 4 8 Let’s update the weight value and make it as 4
  • 35.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Training A Neural Network Input Desired Output Model Output (W=3) Absolute Error Square Error Model Output (W=4) Square Error 0 0 0 0 0 0 0 1 2 3 1 1 4 4 2 4 6 2 4 8 16 Still there is error, but we can see that error has increased
  • 36.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Training A Neural Network W Error W Error
  • 37.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Training A Neural Network Square Error Weight Decrease Weight Increase Weight
  • 38.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Use-Case Implementation Steps Start Read the Dataset Define features and labels Divide the dataset into two parts for training and testing TensorFlow data structure for holding features, labels etc.. Implement the model Train the model Reduce MSE (actual output – desired output) End Repeat the process to decrease the loss Pre-processing of dataset Make prediction on the test data
  • 39.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Applications Of Neural Networks Modelling and Diagnosing the Cardiovascular System Electronic noses Neural Network In Medicine Neural Network In Business Marketing Credit Evaluation
  • 40.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved. Session In A Minute Why Neural Networks? What is Neural Network? What is Perceptron? What is Multi Layer Perceptron? Training Of Multi Layer Perceptron Use-Case Implementation
  • 41.
    Copyright © 2017,edureka and/or its affiliates. All rights reserved.