Top Banner
Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications
48

Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

Dec 14, 2015

Download

Documents

Addison Guyse
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

Artificial Neural Networks

The BrainBrain vs. ComputersThe PerceptronMultilayer networksSome Applications

Page 2: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

2

Artificial Neural Networks

Other terms/names connectionist parallel distributed processing neural computation adaptive networks..

History 1943-McCulloch & Pitts are generally recognised

as the designers of the first neural network 1949-First learning rule 1969-Minsky & Papert - perceptron limitation -

Death of ANN 1980’s - Re-emergence of ANN - multi-layer

networks

Page 3: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

3

Brain and Machine

• The Brain– Pattern Recognition– Association– Complexity– Noise Tolerance

• The Machine– Calculation– Precision– Logic

Page 4: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

4

The contrast in architecture

• The Von Neumann architecture uses a single processing unit;– Tens of millions of operations

per second– Absolute arithmetic precision

• The brain uses many slow unreliable processors acting in parallel

Page 5: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

5

Features of the Brain

• Ten billion (1010) neurons• On average, several thousand

connections • Hundreds of operations per second• Die off frequently (never replaced)• Compensates for problems by

massive parallelism

Page 6: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

6

The biological inspiration

• The brain has been extensively studied by scientists.

• Vast complexity prevents all but rudimentary understanding.

• Even the behaviour of an individual neuron is extremely complex

Page 7: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

7

• Single “percepts” distributed among many neurons

• Localized parts of the brain are responsible for certain well-defined functions (e.g. vision, motion).

The biological inspiration

Page 8: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

8

The Structure of Neurons

Page 9: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

9

The Structure of Neurons

• Axons connect to dendrites via synapses.

• Electro-chemical signals are propagated from the dendritic input, through the cell body, and down the axon to other neurons

A neuron has a cell body, a branching inputstructure (the dendrIte) and a branching output structure (the axOn)

Page 10: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

10

• A neuron only fires if its input signal exceeds a certain amount (the threshold) in a short time period.

• Synapses vary in strength– Good connections allowing a large

signal– Slight connections allow only a weak

signal.

The Structure of Neurons

Page 11: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

11

Sj f(Sj) Xj

ao

a1

a2

an

+1wj0

wj1

wj2

wjn

The Artificial Neuron (Perceptron)

Page 12: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

12

A Simple Model of a Neuron (Perceptron)

• Each neuron has a threshold value• Each neuron has weighted inputs from other

neurons• The input signals form a weighted sum• If the activation level exceeds the threshold,

the neuron “fires”

w1jw2jw3j

wij

y1

y2

y3

yi

O

Page 13: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

13

An Artificial Neuron

• Each hidden or output neuron has weighted input connections from each of the units in the preceding layer.

• The unit performs a weighted sum of its inputs, and subtracts its threshold value, to give its activation level.

• Activation level is passed through a sigmoid activation function to determine output.

w1jw2jw3j

wij

y1

y2

y3

yi

f(x) O

Page 14: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

14

Supervised Learning Training and test data sets Training set; input & target

Page 15: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

15

Perceptron Training

Linear threshold is used. W - weight value t - threshold value

1 if wi xi >tOutput= 0 otherwise{ i=0

Page 16: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

16

Simple network

1 if wixi >toutput= 0 otherwise{ i=0

t = 0.0

Y

X

W1 = 1.5

W3 = 1

-1

AND with a Biased inputAND with a Biased input

W2 = 1

Page 17: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

17

Learning algorithm

While epoch produces an error

Present network with next inputs from epoch

Error = T – OIf Error <> 0 then

Wj = Wj + LR * Ij * Error

End IfEnd While

Page 18: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

18

Learning algorithm

Epoch : Presentation of the entire training set to the neural network. In the case of the AND function an epoch consists of four sets of inputs being presented to the network (i.e. [0,0], [0,1], [1,0], [1,1])

Error: The error value is the amount by which the value output by the network differs from the target value. For example, if we required the network to output 0 and it output a 1, then Error = -1

Page 19: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

19

Learning algorithm

Target Value, T : When we are training a network we not only present it with the input but also with a value that we require the network to produce. For example, if we present the network with [1,1] for the AND function the target value will be 1

Output , O : The output value from the neuron

Ij : Inputs being presented to the neuron

Wj : Weight from input neuron (Ij) to the output neuron

LR : The learning rate. This dictates how quickly the network converges. It is set by a matter of experimentation. It is typically 0.1

Page 20: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

20

Training Perceptrons

t = 0.0

y

x

-1W1 = ?

W3 = ?

W2 = ?

For AND

A B Output

0 0 0

0 1 0

1 0 0

1 1 1

•What are the weight values? What are the weight values?

•Initialize with random weight valuesInitialize with random weight values

Page 21: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

21

Training Perceptrons

t = 0.0

y

x

-1W1 = 0.3

W3 =-0.4

W2 = 0.5

I 1 I 2 I 3 Summation Output

-1 0 0 (-1*0.3) + (0*0.5) + (0*-0.4) = -0.3 0

-1 0 1 (-1*0.3) + (0*0.5) + (1*-0.4) = -0.7 0

-1 1 0 (-1*0.3) + (1*0.5) + (0*-0.4) = 0.2 1

-1 1 1 (-1*0.3) + (1*0.5) + (1*-0.4) = -0.2 0

For AND

A B Output

0 0 0

0 1 0

1 0 0

1 1 1

Page 22: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

22

Learning in Neural Networks

Learn values of weights from I/O pairs Start with random weights Load training example’s input Observe computed input Modify weights to reduce difference Iterate over all training examples Terminate when weights stop changing

OR when error is very small

Page 23: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

23

Decision boundaries

• In simple cases, divide feature space by drawing a hyperplane across it.

• Known as a decision boundary.• Discriminant function: returns different

values on opposite sides. (straight line)

• Problems which can be thus classified are linearly separable.

Page 24: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

24

Decision Surface of a Perceptron

+

++

+ -

-

-

-x1

x2

+

+-

-

x1

x2

• Perceptron is able to represent some useful functions• AND(x1,x2) choose weights w0=-1.5, w1=1, w2=1• But functions that are not linearly separable (e.g. XOR) are not representable

Linearly separable Non-Linearly separable

Page 25: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

25

Linear Separability

X1

X2

A

B

A

A

AA

AA

B

B

B

BB

B

B DecisionDecisionBoundaryBoundary

Page 26: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

26

Rugby players & Ballet dancers

2

1

50 120

Height (m)

Weight (Kg)

Rugby ?Rugby ?

Ballet?Ballet?

Page 27: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

27

Hyperplane partitions

• A single Perceptron (i.e. output unit) with connections from each input can perform, and learn, a linear separation.

• Perceptrons have a step function activation.

Page 28: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

28

Hyperplane partitions

• An extra layer models a convex hull– “An area with no dents in it”– Perceptron models, but can’t learn– Sigmoid function learning of convex

hulls– Two layers add convex hulls together– Sufficient to classify anything “sane”.

• In theory, further layers add nothing• In practice, extra layers may be

better

Page 29: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

29

Different Non-LinearlySeparable Problems

StructureTypes of

Decision RegionsExclusive-OR

ProblemClasses with

Meshed regionsMost General

Region Shapes

Single-Layer

Two-Layer

Three-Layer

Half PlaneBounded ByHyperplane

Convex OpenOr

Closed Regions

Arbitrary(Complexity

Limited by No.of Nodes)

A

AB

B

A

AB

B

A

AB

B

BA

BA

BA

Page 30: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

30

Multilayer Perceptron (MLP)

Output Values

Input Signals (External Stimuli)

Output Layer

AdjustableWeights

Input Layer

Page 31: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

31

Types of Layers

• The input layer.– Introduces input values into the network.– No activation function or other processing.

• The hidden layer(s).– Perform classification of features– Two hidden layers are sufficient to solve any

problem– Features imply more layers may be better

• The output layer.– Functionally just like the hidden layers– Outputs are passed on to the world outside the

neural network.

Page 32: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

32

Activation functions

• Transforms neuron’s input into output.• Features of activation functions:

• A squashing effect is required• Prevents accelerating growth of

activation levels through the network.

• Simple and easy to calculate

Page 33: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

33

Standard activation functions

• The hard-limiting threshold function– Corresponds to the biological

paradigm• either fires or not

• Sigmoid functions ('S'-shaped curves)

– The logistic function– The hyperbolic tangent (symmetrical)– Both functions have a simple

differential– Only the shape is important

(x) = 1

1 + e -ax

Page 34: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

34

Training Algorithms

• Adjust neural network weights to map inputs to outputs.

• Use a set of sample patterns where the desired output (given the inputs presented) is known.

• The purpose is to learn to generalize– Recognize features which are

common to good and bad exemplars

Page 35: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

35

Back-Propagation

• A training procedure which allows multi-layer feedforward Neural Networks to be trained;

• Can theoretically perform “any” input-output mapping;

• Can learn to solve linearly inseparable problems.

Page 36: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

36

Applications

• The properties of neural networks define where they are useful.– Can learn complex mappings from inputs to

outputs, based solely on samples– Difficult to analyse: firm predictions about

neural network behaviour difficult;• Unsuitable for safety-critical applications.

– Require limited understanding from trainer, who can be guided by heuristics.

Page 37: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

37

Neural network for OCR

feedforward network

trained using Back- propagation

A

B

E

D

C

Output Layer

Input Layer

Hidden Layer

Page 38: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

38

OCR for 8x10 characters

NN are able to generalise learning involves generating a partitioning of the input

space for single layer network input space must be linearly

separable what is the dimension of this input space? how many points in the input space? this network is binary(uses binary values) networks may also be continuous

8

10

8 8

1010

Page 39: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

39

Engine management

• The behaviour of a car engine is influenced by a large number of parameters– temperature at various points– fuel/air mixture– lubricant viscosity.

• Major companies have used neural networks to dynamically tune an engine depending on current settings.

Page 40: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

40

ALVINNDrives 70 mph on a public highway

30x32 pixelsas inputs

30 outputsfor steering

30x32 weightsinto one out offour hiddenunit

4 hiddenunits

Page 41: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

41

Signature recognition

• Each person's signature is different.• There are structural similarities which

are difficult to quantify.• One company has manufactured a

machine which recognizes signatures to within a high level of accuracy.– Considers speed in addition to gross shape.– Makes forgery even more difficult.

Page 42: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

42

Sonar target recognition

• Distinguish mines from rocks on sea-bed

• The neural network is provided with a large number of parameters which are extracted from the sonar signal.

• The training set consists of sets of signals from rocks and mines.

Page 43: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

43

Stock market prediction

• “Technical trading” refers to trading based solely on known statistical parameters; e.g. previous price

• Neural networks have been used to attempt to predict changes in prices.

• Difficult to assess success since companies using these techniques are reluctant to disclose information.

Page 44: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

44

Mortgage assessment

• Assess risk of lending to an individual.• Difficult to decide on marginal cases.• Neural networks have been trained to

make decisions, based upon the opinions of expert underwriters.

• Neural network produced a 12% reduction in delinquencies compared with human experts.

Page 45: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

45

Neural Network Problems

• Many Parameters to be set• Overfitting• long training times• ...

Page 46: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

46

Parameter setting

• Number of layers• Number of neurons

• too many neurons, require more training time

• Learning rate• from experience, value should be small

~0.1

• Momentum term• ..

Page 47: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

47

Over-fitting

• With sufficient nodes can classify any training set exactly

• May have poor generalisation ability.• Cross-validation with some patterns

– Typically 30% of training patterns– Validation set error is checked each

epoch– Stop training if validation error goes up

Page 48: Artificial Neural Networks The Brain Brain vs. Computers The Perceptron Multilayer networks Some Applications.

48

Training time

• How many epochs of training?– Stop if the error fails to improve (has

reached a minimum)– Stop if the rate of improvement drops below

a certain level– Stop if the error reaches an acceptable level– Stop when a certain number of epochs have

passed