swarm intelligence - École polytechnique fédérale de...

24
Swarm Intelligence Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press 1

Upload: others

Post on 20-May-2020

26 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Swarm Intelligence

Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press 1

Page 2: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Emergent Collective BehaviorSome animal societies display coordinated and purposeful navigation of several individuals (from tens to thousands).

Each individual uses only local information about the presence of other individuals and of the environment.

There is no predefined group leader.

SCHOOL OF FISHES

Flocking Schooling

2Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 3: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Emergent Collective Behavior

In some cases there is a leader and t i ti l l timore restrictive rules on relative

motion, but individuals still use local information to decide how to move.

PROCESSION OF COWSHerding

ProcessionsV-formations

3Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 4: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Swarm IntelligenceSwarm Intelligence is the emergent collective intelligence of groups of

simple individuals.

Main principles:

1) The swarm can solve complex problems that a single individual with simple abilities (computational or physical) could not solve.

2) The swarm is composed of several individuals, some of which may be lost or make mistake, but its performance is not affected.

3) Individuals in a swarm have local sensory information, perform simple actions, have little/no memory; they do not know the global state of the swarm or its goalstate of the swarm or its goal.

4Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 5: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Coordinated navigation of swarms

5Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 6: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Reynolds Flocking (1987)

Sensing: Boid perceives angle and distance of neighboring boids

1 S ti B id i t i i di t f th b id1. Separation: Boid maintains a given distance from other boids2. Cohesion: Boid moves towards center of mass of neighboring boids3. Alignment: Boid aligns its angle along those of neighboring boids

Laboratory of Intelligent Systems http://lis.epfl.ch 6

Page 7: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Examples of Character Animation

Emergent coordinated behavior. The approach is applicable to any type of animated characters in groups where behavior coordination is usedanimated characters in groups where behavior coordination is used.

The Lion King, 1994 (Walt Disney)

7Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 8: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Challenges of Swarm Intelligence

Find individual behavioral rules that result in desired swarm behaviorFind individual behavioral rules that result in desired swarm behavior (reverse engineering).

Fortunately, the challenge may be addressed because the behavioral rules are supposed to be relatively simple Often rules are hand-designed sometimessupposed to be relatively simple. Often rules are hand designed, sometimes are evolved.

Make sure the emergent behavior is stableMake sure the emergent behavior is stable.Dynamical systems theory may help to characterize and predict swarm behavior because a swarm can be described as a system of elements with negative and positive interactions that moves in space and time. However,negative and positive interactions that moves in space and time. However, non-linear interactions are still hard to model.

8Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 9: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Particle Swarm OptimizationParticle Swarm Optimization is an optimization algorithm inspired upon birds flocking to find the best food area.

FLOCK OF BIRDSA caricature scenario:The flock wants to find the area with the highest concentration of food (insects). Birds do not know where that area is, but each bird can shout to their neighbors h i t t it l tihow many insects are at its location. Birds also remember their own location where they found the highest concentration of food so farconcentration of food so far.

The flock is most likely to succeed when birds combine three strategies:1) Brave: keep flying in the same direction1) Brave: keep flying in the same direction2) Conservative: fly back towards its own best previous position3) Swarm: move towards its best neighbor

9Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 10: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

From Birds to ParticlesThe food concentration describes the search space of the optimization problem and the birds are the local solutions for that problem. They are called particles because they are very simple.problem. They are called particles because they are very simple.

A particle p is described by:p ys[] its position; e.g.: x, yv[] its velocity; e.g. (for discrete case) angle and distance of next stepf[] its performance; e.g.: value of the function at its location

10

f[] its performance; e.g.: value of the function at its locationCompanion slides for the book Bio-Inspired Artificial Intelligence: Theories,

Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 11: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Particle’s perception

A particle perceives performances and F( 12)Gbest=p13A particle perceives performances and

positions of neighboring particles.

It can also tell which is the best particle

F(p12)S(p12)

F( 13)It can also tell which is the best particle among its neighbors (gbest)

F(p13)S(p13)

F(pbest)S(pbest)A particle remembers the position where it

obtained the best performance so far (pbest)

11Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 12: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Particle’s actionsA particle computes the next position by taking into account a fraction of its current velocity v, the direction to its previous best location pbest, and the direction to the location of the best neighbor gbest. The movement towards other particles has some error.

fpbestspbest

errorrange

sp(t)

fgbests

range

sgbestvp(t)

sp(t+1)

vp(t+1)= a vp(t) + b R (spbest - sp(t)) + c R (sgbest – sp(t))

sp(t+1) = sp(t) + vp(t+1)

where a, b, c are learning constants between 0 and 1R is a random number between 0 and 1

12Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 13: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

InitializationSwarm size: Typically 20 particles for problems with dimensionality 2 - 200

Initial position of each particle: Random

Neighborhood topology: Global, geographical or social (list based)

Social neighborhoodGeographical neighborhood

128

37

Neighborhood size: Typically 3 to 5

456

Neighborhood size: Typically 3 to 5

Set max velocity to vmax; if v(t+1) is larger, clip it to vmax

Iterate until best solution is found or no further improvement

13Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 14: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

PSO vs. Artificial EvolutionAs in Artificial Evolution, PSO works with a population and some random factor to update solutions.

Contrary to Artificial Evolution, there is no generation change, no genome, and no competition among the individuals (rather cooperation)

A major issue in PSO is to transform the parameters of the problem j p pto be solved so that it can be encoded and searched by particles

The best applications found so far include the large class of TravelingThe best applications found so far include the large class of Traveling Salesman Problems and the optimization of neural network weights.

Reference: Kennedy and Eberhart (2001) Swarm Intelligence Morgan KauffmanReference: Kennedy and Eberhart (2001) Swarm Intelligence. Morgan Kauffman

Applet: http://www.projectcomputing.com/resources/psovis/

14Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 15: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Ant trails

15Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 16: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Stigmergy

The term indicates communication among individuals throughamong individuals through modification of the environment.

For example some ants leave aFor example, some ants leave a chemical (pheromone) trail behind to trace the path. The chemical d tidecays over time.

This allows other ants to find the path between the food and the nest. It also allows ants to find the shortest path among alternative p gpaths.

16Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 17: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Finding the Shortest Path

1) As they move, ants deposit pheromonepheromone

2) Pheromone decays in time3) Ants follow path with highest

pheromone concentrationpheromone concentration4) Without pheromone, equal

probability of choosing short or l thlong path

Shorter path allows higher number of passages and therefore pheromone level will be higher on shorter path.p

Ants will increasingly tend to choose shorter path. Goss et al. 1989, Deneubourg et al. 1990

17Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 18: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Ant Colony OptimizationAnt Colony Optimization is an algorithm developed by Dorigo et al. in 1994 inspired

i i i i fi d h

damagednode

upon stigmergic communication to find the shortest path in a network.

Typical examples are telephone, internet, and any problem that can be described as Travel Salesman Problem. Used/adopted pby British Telecom, MCI Worldcom, Barilla, etc.

Advantage of algorithm is that, as ants do, it allows dynamic rerouting through shortest path if one node is broken Most otherpath if one node is broken. Most other algorithms instead assume that the network is static.

18Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 19: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Ant Colony Optimization

ant krr

s(r,s) pheromone(r,s) length

Each ant generates a complete tour of nodes using probabilistic transition rule encouraging choice of edge with high pheromone and short distance

Pheromone level on each edge is updated by considering evaporation and deposit by each ant

Pheromone levels only of edges traveled by best ant are increased in inverse proportion to length of path.

Result is that edges that belong to short tours receive greater amount of pheromone

19

pCompanion slides for the book Bio-Inspired Artificial Intelligence: Theories,

Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 20: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Transition RuleFind a random number q between 0 and 1. If q is smaller than q0, then choose edge with largest amount of pheromone and shortest length , otherwise use probabilistic rule:

[(r,s)] [(r,s)]if J ( )

g p

pk (r,s)

[ ( , )] [( , )]

[(r,s)] [(r,s)]

sJk (r )

, if s Jk (r)

0 otherwise

A k i i i i i h b bili i lAnt k sitting on city r moves to city s with probability proportional to amount of pheromone and length of edge relative to all other cities connected to r that remain to be visited.

Choice of exponent determines importance of edge length with respect to pheromone.

20

p pCompanion slides for the book Bio-Inspired Artificial Intelligence: Theories,

Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 21: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Pheromone Level Update: Local

(r,s) (1 ) (r,s) 0

The pheromone level of each edge visited by an ant is decreased by a fraction (1- ) of its current level and increased by a fraction of ( ) y the initial level

21Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 22: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Pheromone Level Update: Global

(r s) (1 ) (r s) L1(r,s) (1 ) (r,s) L

When all ants have completed their tours, the length L of the shortest tour is found and the pheromone levels of only the edges of this shortest path are updated in inverse proportionedges of this shortest path are updated in inverse proportion to the path length.

22Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 23: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

Initialization

Use approximately 100 ants

Distribute them on random nodes

Initial pheromone level is equal for all edges and inversely proportional to number of nodes times estimated length of optimal path

0 L 10 n Lnn 1

2

Initial pheromone level

Importance of length over pheromone

q0 0.9

0 1Exploration threshold

over pheromone

0.1Pheromone update rate

23Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press

Page 24: Swarm Intelligence - École Polytechnique Fédérale de ...baibook.epfl.ch/slides/SwarmIntelligence.pdf · Swarm Intelligence Swarm Intelligence is the emergent collective intelligence

ACO PerformanceFinds best solution on “small” problems (up to 30 cities)

Finds good solutions on large problems compared to other techniquesFinds good solutions on large problems compared to other techniques

Finds best solution on large problems when coupled with other search techniquestechniques

Can operate on dynamic problems (e.g., node malfunctioning) that i f t tirequire fast rerouting

Dorigo and Stuetzle, 2005, MIT Press

24Companion slides for the book Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies by Dario Floreano and Claudio Mattiussi, MIT Press