A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... ·...

16
A Particle Swarm Optimization (PSO) Primer With Applications Brian Birge

Transcript of A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... ·...

Page 1: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

A Particle Swarm Optimization (PSO) Primer

With Applications

Brian Birge

Page 2: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Overviewp Introduction

p Theory

p Applications

p Computational Intelligence

p Summary

Page 3: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Introductionp Subset of Evolutionary Computation

n Genetic Algorithmsn Evolutionary Programmingn Evolution Strategiesn Genetic Programming

p Behaviorally Inspiredn Developed out of attempts to model bird flocks and fish

schools

p Emergencen Complex behavior from simple rules

Page 4: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Theory - Qualitative Detailsp PSO Algorithm in a nutshellp Searches Hyperspace of Problem for Optimum

n Define problem to searchp How many dimensions?p Solution criteria?

n Initialize Populationp Random initial positionsp Random initial velocities

n Determine Global Best Positionn Determine Personal Best Positionn Update Velocity and Position Equations

Page 5: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Theory - Equationsp The Basic PSO algorithm consists of the

velocity:

p ..and position:

p i – particle indexp k – discrete time indexp v – velocity of ith particlep x – position of ith particlep p – best position found by ith particle (personal best)p G – best position found by swarm (global best, best of personal

bests)p γ1,2 – random numbers on the interval [0,1] applied to ith

particle

( ) ( ) ( )( ) ( )( )1 21i i i i i i iv k v k p x k G x kγ γ+ = + − + −

( ) ( ) ( )1 1i i ix k x k v k+ = + +

Page 6: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Theory - Equations ..p The Common PSO Algorithm

p φ - Inertia functionp α1,2 – Acceleration constants

p As training progresses using a decreasing linear inertia function, the influence of past velocity becomes smaller.

( ) ( ) ( ) ( )( ) ( )( )1 1 2 21i i i i i i iv k k v k p x k G x kφ α γ α γ + = + − + −

Page 7: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Applicationsp PSOt – A Matlab Toolbox

p Function Optimization

p Neural Net Trainingn Replacing Standard Backpropagation with PSO

p Engineering Examples

Page 8: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Applications - PSOt, A Matlab Toolboxp Matlab: scientific computing language run

in interpreter mode on a wide variety of operating systems.

p Toolbox: Suite of Matlab ‘plug-in’ programs developed by third parties.

p The PSOt includes:n Standalone MISO function optimizern Neural Net Toolbox ‘plug-in’ for training

Page 9: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Applications – Function Optimizationp Example: Schaffer’s ‘f6’

function

>> pso('f6',2,[-100,100;-100,100],0)

PSO: 1/2000 iterations, GBest = 0.499643.

PSO: 26/2000 iterations, GBest = 0.0858499.

PSO: 51/2000 iterations, GBest = 0.00197516.

PSO: 76/2000 iterations, GBest = 0.00197516.

PSO: 89/2000 iterations, GBest = 0.00197516.

ans =-4.400531404313024e-0024.527939759978006e-0031.975158000277422e-003

-20-10

010

20

-20

-10

0

10

200

0.2

0.4

0.6

0.8

1

-10 -5 0 5 10 15 20 25-40

-20

0

20

Pos dimension 1P

os d

imen

sion

2

0 10 20 30 40 50 60 70 8010

-3

10-2

10-1

100

epoch

Gbe

st v

alue

PSO: 2 dimensional prob search, Gbestval=0.0019752

Page 10: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Applications –Artificial Neural Network Trainingp Example of finding a neural net

approximation to XOR

TRAINPSO: 100/1000 epochs, gbest SSE = 0.428059141

mv = 4, iwt = 0.8537691795...

TRAINPSO: 225/1000 epochs, gbest SSE = 0.04639357585

mv = 4, iwt = 0.7953969313TRAINPSO: 250/1000 epochs, gbest SSE =

0.04454761798mv = 4, iwt = 0.7837224817

********* Reached Goal ********TRAINPSO: 256/1000 epochs, gbest SSE =

0.01641486174mv = 4, iwt = 0.7809206137

********* end of training ********

0 50 100 150 200 250 30010

-2

10-1

100

101

epoch

gbes

t

mv=4 inertia wt=0.78092, 9 dimensions, GbestVal= 0.01641486174

-10 -8 -6 -4 -2 0 2 4-4

-2

0

2

4

6

pos dim 1

pos

dim

9

Page 11: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Applications –Engineering Examplesp Human Tremor Analysisn PSO used to evolve neural network weightsn Neural network distinguishes between

p Subjects with Parkinson’s Disease, Essential Tremorp Normal Subjects

n 60 input, 12 hidden neurons, 2 outputsn 100% success with generalizationn Very fast human tremor classification with very

small computational hit.

Page 12: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Applications –Engineering Examples..p Ingredient Mix Optimization

n Refers to a mixture of ingredients used to grow production strains of micro-organisms that naturally secrete or manufacture something of interest.

n PSO provided optimized ingredient mix much better than then current state of the art

p Battery Pack State of Charge Estimationn PSO used in conjunction with Backpropagationn Important in development of electric and hybrid vehicle

technologyn PSO used to optimize training set for neural network in

addition to training.

Page 13: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Computational Intelligencep Artificial Intelligence

n A name for a paradigm in which people attempt to elicit intelligence from machines.

p Computational Intelligencen Practical adaptation concepts, paradigms, algorithms, and

implementations that enable or facilitate appropriate actions (intelligent behavior) in complex and changing environments.

p CI is different than AIn Deals well with complex, dynamic, poorly defined problems that AI has

problems with.

p Examplesn Neuro-Fuzzy controllersn ‘Alternatively’ trained neural netsn Evolution of Fuzzy-Expert Systems using PSO

Page 14: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Summaryp PSO is inspired but not based on animal

behavior.p A few simple rules result in complex

action, i.e. Emergence.p PSO is simple to code and has small

computational cost.p Successful in application to wide range of

engineering and computer science problems.

Page 15: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position:

Referencesp Birge, B., 2003, PSOt, A Particle Swarm Optimization Toolbox for Matlab,

IEEE Swarm Intelligence Symposium Proceedings, April 24-26

p Eberhart, R., Simpson, P., Dobbins, R., 1996, Computational Intelligence PC Tools, Academic Press, Inc., pp. 212-223.

p Haykin, S., 1999, Neural Networks, a Comprehensive Foundation, Second Edition, Prentice-Hall

p Houck, C., Joines, J., and Kay M., 1995, A Genetic Algorithm for Function Optimization: A Matlab Implementation, ACM Transactions on Mathematical Software, Submitted 1996

p Kennedy, J., Eberhart, R., 1995, Particle Swarm Optimization, from Proc. IEEE Int’l. Conf. on Neural Networks (Perth, Australia), IEEE Service Center, Piscataway, NJ, IV: 1942-1948

p Kennedy, J., Eberhart, R., Shi, Y., 2001, Swarm Intelligence, Academic Press, Inc.

Page 16: A Particle Swarm Optimization (PSO) Primerread.pudn.com/downloads49/sourcecode/math/168548... · Theory - Equations pThe Basic PSO algorithm consists of the velocity: p..and position: