Introduction to
Artificial Intelligence
Prof. Dr. Tamer Kawady
Electrical Engineering Dept.
Umm Al-Qura University MAKKAH
Artificial Neural Networks
Human Inspired Biological System
Human Inspired Biological System
Human Inspired Biological System
Human Inspired Biological System
• A neuron receives input from other neurons (typically many thousands).
Inputs sum (approximately). Once input exceeds a critical level, the neuron discharges a spike - an
electrical pulse that travels from the body, down the axon, to the next neuron(s) (or other receptors).
• When the input exceeds a threshold the neuron sends an electrical spike that travels from the body, down the axon, to the next neuron(s)
• 200 billion neurons, 32 trillion synapses
• Element size: 10-6m
• Energy use: 25W
• Processing speed: 100 Hz
• Parallel, Distributed
• Fault Tolerant
• Learns: Yes
• Intelligent/Conscious:
• 1 billion bytes RAM but trillions of bytes on disk
• Element size: 10-9 m
• Energy watt: 30-90W (CPU)
• Processing speed: 109 Hz
• Serial, Centralized
• Generally not Fault Tolerant
• Learns: Some
• Intelligent/Conscious:
The Computer vs. The Brain
Neural networks technology is not trying to produce biological machine
but is trying to mimic
nature’s approach in order to
mimic some of nature’s
capabilities.
It resembles the brain in two respects:
1. Knowledge is acquired by the
network through a learning process.
2. Interneuron connection strengths
known as synaptic weight are used
to store the knowledge.
• A NN is a machine learning approach inspired by the way in which the brain performs a particular learning task:
• Knowledge about the learning task is given in the form of examples.
• Inter neuron connection strengths (weights) are used to store the acquired information (the training examples).
• During the learning process the weights are modified in order to model the particular learning task correctly on the training examples.
A Simple Artificial Neuron
The basic computational element (model neuron) is often called a node or unit. It receives input from some other units, or perhaps from an external source.
Each input has an associated weight w, which can be modified so as to model synaptic learning. The unit computes some function f of the weighted sum of its inputs
•Its output, in turn, can serve as input to other units.
•The function f is the unit's activation function.
In the simplest case, f is the identity function, and the unit's output is just its net input. This is called a linear unit.
●The bias b has the effect of applying a transformation to the weighted sum u
v = u + b
●The bias is an external parameter of the neuron. It can be modeled by adding an extra input.
●v is called induced field of the neuron
b w
x w
v
jm j
j
0
0
Input signal
Synaptic
Summing function Bias
b
Activation function Local
Field
v Outputy
x1
x2
xm
w2
wm w1
( )
Artificial Neuron
Input signal
Synaptic weights
Summing function
Activation function Local
Field
v Outputy
x1
x2
xm
w2
wm w1
( )
w0 x0 = +1
•Bias is an external parameter of the neuron. Can be modeled by adding an extra input.
b w
x w
v
m jj
j
0
0
●The choice of activation function determines the neuron model.
Examples:
●step function:
●ramp function:
●sigmoid function with z,x,y parameters
●Gaussian function:
2
2 exp 1 2
) 1
(
v v
) exp(
1 ) 1
(v z xv y
otherwise ))
/(
) )(
((
if
if )
(
c d a b c v a
d v b
c v a
v
c v b
c v v a
if
if )
(
c b
a
c d
b
a
Ramp Step
Sigmoid
Gaussian
1. Nonlinearity
2. Input-Output Mapping 3. Adaptivity
4. Very fast Response (parallel computation) 6. Fault Tolerance
7. Implementability
8. Uniformity of Analysis and Design 9. Neurobiological Analogy
Benefits of ANNs
The Perceptron
The Perceptron
• We can connect any number of McCulloch-Pitts neurons together in any way we like.
• An arrangement of one input layer of McCulloch-Pitts neurons feeding forward to one output layer of McCulloch-Pitts
neurons is known as a Perceptron.
Input layer of
source nodes
Output layer of
neurons
Single-layer Feedforward ANN
Input layer
Output layer
Hidden Layer
Multi-layer Feedforward ANN
• Logical AND
x1 x2 y
0 0 0
0 1 0
1 0 0
1 1 1
x1
x2
y 1
1
θ=2
Implementing Gate AND with Perceptron
• Logical OR
x1 x2 y
0 0 0
0 1 1
1 0 1
1 1 1
x1
x2
y 2
2
θ=2
Implementing Gate OR with Perceptron
• Logical NOT x1 y
0 1
1 0
x1
y -1 θ=2
2 bias
1
Implementing Gate NOT with Perceptron
Finding the Weights Analytically
• We have two weights w1 and w2 and the threshold q,
and for each training pattern we need to satisfy
The Perceptron
• Logical XOR
x1 x2 y
0 0 0
0 1 1
1 0 1
1 1 0
x1
x2
y
?
?
Implementing Gate XOR with Perceptron
Finding the Weights Analytically
• For the XOR network
• Clearly the second and third inequalities are incompatible with the fourth, so there is in fact no solution. We need more complex
networks, e.g. that combine together many simple networks, or use different activation/thresholding/transfer functions.
Implementing Gate XOR with Feedforward network
Summary of Applications
• Function approximation
• Pattern recognition
• Clasification
• Signal processing
• Modeling
• Control
• An important application of neural networks is pattern recognition. Pattern recognition can be implemented by using a feed-forward neural network that has been trained accordingly.
• During training, the network is trained to associate outputs with input patterns.
• When the network is used, it identifies the input pattern and tries to output the associated output pattern.
• The power of neural networks comes to life when a pattern that has no output associated with it, is given as an input.
• In this case, the network gives the output that corresponds to a taught input pattern that is least different from the given pattern.
Pattern Recognition
• Suppose a network is trained to recognize the patterns T and H. The associated patterns are all black and all white respectively as shown above.
Pattern Recognition
Since the input pattern looks more like a ‘T’, when the network classifies it, it sees the input closely resembling
‘T’ and outputs the pattern that represents a ‘T’.
Pattern Recognition
Pattern Recognition
The input pattern here closely resembles ‘H’ with
a slight difference. The network in this case
classifies it as an ‘H’ and outputs the pattern
representing an ‘H’.
Pattern Classification
• Speech Recognition and Speech Synthesis
• Classification of radar/sonar signals
• Remote Sensing and image classification
• Handwritten character/digits Recognition
• Credit card application screening
• Data mining, Information retrieval
Control, Time series, Estimation
• Machine Control/Robot manipulation
• Financial/Scientific/Engineering Time series forecasting.
• Inverse modeling of vocal tract
Optimization
• Traveling sales person
• Multiprocessor scheduling and task assignment
• VLSI placement and routing