Unit 5
Unit 5
Approach for
Image Processing
UNIT-5
Artificial Neural Networks
Computational models inspired by the human
brain:
Algorithms that try to mimic the brain.
10
Artificial Neuron Model
Artificial Neuron Model
Bias
Artificial Neuron Model
Bias
Activation functions
Activation functions
Perceptron
wi wi + wi
where wi = (t – o) xi
Where:
t = c(x) is target value
o is perceptron output
is small constant (e.g., 0.1) called learning
rate
Can prove it will converge
If training data is linearly separable
Gradient descent
Derivation of gradient descent
Gradient descent
- Error (for all training examples.):
output units
Feedforward networks
These compute a series of
transformations hidden units
Typically, the first layer is the
input and the last layer is the
input units
output.
Recurrent networks
These have directed cycles in their
connection graph. They can have
complicated dynamics.
More biologically realistic.
Artificial Neuron Network
Different Network Topologies
Single layer feed-forward networks
Input layer projecting into the output layer
Single layer
network
Input Output
layer layer
Different Network Topologies
Multi-layer feed-forward networks
One or more hidden layers. Input projects only from
previous layers onto a layer.
2-layer or
1-hidden layer
fully connected
network
Input Hidden Output
layer layer layer
Different Network Topologies
Multi-layer feed-forward networks
Recurrent
network
Input Output
layer layer
How to Decide on a Network Topology?
Algorithm for learning ANN
Initialize the weights (w0, w1, …, wk)
81
How A Multi-Layer Neural Network Works?
The inputs to the network correspond to the attributes measured for
each training tuple
Inputs are fed simultaneously into the units making up the input layer
They are then weighted and fed simultaneously to a hidden layer
The number of hidden layers is arbitrary, although usually only one
The weighted outputs of the last hidden layer are input to units making
up the output layer, which emits the network's prediction
The network is feed-forward in that none of the weights cycles back to
an input unit or to an output unit of a previous layer
From a statistical point of view, networks perform nonlinear regression:
Given enough hidden units and enough training samples, they can
closely approximate any function
83
Defining a Network Topology
85
Neural Network as a Classifier
Weakness
Long training time
Require a number of parameters typically best determined empirically,
e.g., the network topology or “structure.”
Poor interpretability: Difficult to interpret the symbolic meaning behind
the learned weights and of “hidden units” in the network
Strength
High tolerance to noisy data
Ability to classify untrained patterns
Well-suited for continuous-valued inputs and outputs
Successful on a wide array of real-world data
Algorithms are inherently parallel
Techniques have recently been developed for the extraction of rules
from trained neural networks
86
Artificial Neural Networks (ANN)
Input
nodes Black box
X1 X2 X3 Y
1 0 0 0 Output
1 0 1 1
X1 0.3 node
1 1 0 1
1 1 1 1 X2 0.3
0 0 1 0
Y
0 1 0 0
0 1 1 1 X3 0.3 t=0.4
0 0 0 0
It has the ability to learn, recall, and generalize from the given
data by suitable assignment and adjustment of weights.
The main features of Back propagation are the iterative, recursive and efficient
method through which it calculates the updated weight to improve the network
until it is not able to perform the task for which it is being trained.
Now, how error function is used in Back propagation and how Back propagation
works?
Forward Pass
To find the value of H1 we first multiply the input value from the weights
as
Back Propagation Algorithm
H1=x1×w1+x2×w2+b1
H1=0.05×0.15+0.10×0.20+0.35
H1=0.3775
H2=x1×w3+x2×w4+b1
H2=0.05×0.25+0.10×0.30+0.35
H2=0.3925
To find the value of y1, we first multiply the input value i.e., the
outcome of H1 and H2 from the weights as
y1=H1×w5+H2×w6+b2
y1=0.593269992×0.40+0.596884378×0.45+0.60
y1=1.10590597
y2=0.593269992×0.50+0.596884378×0.55+0.60
y2=1.2249214
Back Propagation Algorithm
To calculate the final result of H1, we performed the sigmoid
function as
Our target values are 0.01 and 0.99. Our y1 and y2 value is not matched
with our target values T1 and T2.
Now, we will find the total error, which is simply the difference between the
outputs from the target outputs. The total error is calculated as
Back Propagation Algorithm
Now, we will back propagate this error to update the weights using a
backward pass.
Back Propagation Algorithm
Backward pass at the output layer
To update the weight, we calculate the error correspond to each weight with the
help of a total error. The error on weight w is calculated by differentiating total
error with respect to w.
From equation two, it is clear that we cannot partially differentiate it with respect
to w5 because there is no any w5. We split equation one into multiple terms so
that we can easily differentiate it with respect to w5 as
Back Propagation Algorithm
Now, we calculate each term one by one to differentiate Etotal with respect to
w5 as
Back Propagation Algorithm
Now, we will back propagate to our hidden layer and update the weight w1, w2,
w3, and w4 as we have done with w5, w6, w7, and w8 weights.
Now, we will calculate the updated weight w1new with the help of the
following formula
Back Propagation Algorithm
We have updated all the weights. We found the error 0.298371109 on the network
when we fed forward the 0.05 and 0.1 inputs. In the first round of Back propagation,
the total error is down to 0.291027924. After repeating this process 10,000, the
total error is down to 0.0000351085.
At this point, the outputs neurons generate 0.159121960 and 0.984065734 i.e.,
nearby our target value when we feed forward the 0.05 and 0.1.
Convolutional Neural Network
Convolutional Neural Network
Convolution
Convolutional Neural Network
Convolution Properties
Convolutional Neural Network
ConvNet
ConvNet architectures for images:
Practical matters