Biologically Inspired Computation

24
Biologically Inspired Computation Some of the images in this lecture come from slides for a Course in Swarm Intelligence given at : Lecture 5: Introducing Swarm Intelligence contents: the behavior of natural swarms and flocks -- Reynold’s rules and swarm simulation.

description

Biologically Inspired Computation. Lecture 5: Introducing Swarm Intelligence contents: the behavior of natural swarms and flocks -- Reynold’s rules and swarm simulation. Some of the images in this lecture come from slides for a Course in Swarm Intelligence given at :. - PowerPoint PPT Presentation

Transcript of Biologically Inspired Computation

Page 1: Biologically Inspired Computation

Biologically Inspired Computation

Some of the images in this lecture come from slides for a Course in Swarm Intelligence given at :

Lecture 5: Introducing Swarm Intelligencecontents: the behavior of natural swarms and flocks -- Reynold’s rules and swarm simulation.

Page 2: Biologically Inspired Computation

Swarms, and how they might inspire usThere are some interesting things that come to mind when we think of swarms (flocks, schools, etc …):

• A swarm sometimes seems to behave as if it is an individual organism. Ants or wasps on a hunt for food, or on the attack, behave as if with a single mind, co-ordinating different actions with different parts of the swarm.

• But did you know that a jellyfish is actually a swarm? Slime moulds too.

• The way in which swarms in some species change direction is astoundingly well co-ordinated.

• The way in which swarms in some species avoid obstacles seems to be extremely well choreographed

• Why do I call a jellyfish a swarm, but not a human? Just like a slime mould, for example, we are a collection of a few trillion cells lumped together – so why is it that a plague of locusts exhibits swarm intelligence, but we don’t?.

Page 3: Biologically Inspired Computation

Other puzzling things that swarms do

• Termites build huge nests – how?? Is an individual termite clever enough to do this?

• Bees build hives, with complex internal structure -- same question.

How on earth can these things happen?GIVE THEM A LIVE EXAMPLE

Page 4: Biologically Inspired Computation
Page 5: Biologically Inspired Computation

Two simple rules: While continually wandering randomly: If you are empty-handed and encounter a disc, pick it up If you are carrying a disc and encounter another of the same colour, put yours down.

Emergent order arises from simple local rules.

Page 6: Biologically Inspired Computation

But we sometimes exhibit swarm behaviour too

Page 7: Biologically Inspired Computation

locusts ants

But we’re mainly interested in animals and insects

Because we mightlearn something

Page 8: Biologically Inspired Computation

Why does flocking/swarming occur so much in nature?

Energy savings: Geese in V formation have around a 70% greater range than in flying individually. Individuals can fly around 25% faster (why?).

Frightening and confusing predators; avoiding being “picked off”

Helping to catch prey: e.g. tuna school in a crescent shaped flockwith the concave part forward: This is thought to help channeltheir prey to the “focus”, andstop them from escaping

Page 9: Biologically Inspired Computation

It also maybe helps with migration

If we can assume that:– An individual has an idea, but not a perfect one, of where to

go … e.g. by itself it may go a few degrees off course.

– The “errors” of individuals are not correlated (i.e. they’re all wrong in a randomly different way)

– An emergent result of the flocking is that the flock’s direction is the average of its members’ directions.

Then: basic statistics can show that the error in the flocks direction is probably very small. About 1/sqrt(n) of the typical error of one of the n individuals.

Page 10: Biologically Inspired Computation

So …

Flocking occurs so much because it is clearly useful. But how do they do it so well? Individual ants are not clever enough to understand the benefits.

It comes down to: simple behaviours of individuals in a group can have useful emergent properties. A theme we will continue to see a lot …

Page 11: Biologically Inspired Computation

Another kinds of swarm behaviour is the dynamics and evolution of ideas as they get passed on and changed in social networks.

Page 12: Biologically Inspired Computation

The Adaptive Culture ModelRobert Axelrod has a well-known theory, “Axelrod’s Culture Model”,which explains how ideas spread in societies. Kennedy and Eberhart(a computer scientist and a social scientist respectively) altered thisinto the “Adaptive Culture Model”, which works like this:

If you think your neighbour is good, then be more like them.

And that’s basically it. But notice the important words, neighbour: you change yourself under the influence of people nearby good: in some way your neighbour is more optimal than you, otherwise why be like them? more like: this is vague, so you have freedom in how you change

This is actually a very good model for how culture and ideasspread quickly in societies. Everything from rumours to eatinghabits. I only hope this works with `green’ behaviour …

Page 13: Biologically Inspired Computation

Back to computer science …

From the CS viewpoint, the question is: How does this kind of , apparently organised, group behaviour emerge, without a central controller? Without (like we have) something like a brain in control of everything?

The emergent behaviour that we see arises purely as a result of individuals in the swarm processing information in their (fairly)immediate neighbourhood.

So, studying this in nature suggests how we can get co-ordinatedbehaviour from a group of individuals, without having to specifyany overall controller. This is very useful, for example, for designingcomputer networks. If one main machine was in control of the network,and that machine crashed, …

But so far that has not been a main success area for swarminspiration …

Page 14: Biologically Inspired Computation

Two main things that come from swarm inspiration:

Simulations of natural flocks. For the entertainment and gaming industries, for example.

Optimisation algorithms. Ants seem to find the shortest path to find food that may be quite distant from their nest. They do this via “stigmergy” – laying pheronomones on their path as they move. This has directly inspired the design of a very successful optimisation method.

Meanwhile, the adaptive culture model has led to a different,and also very successful, new optimisation algorithm

Page 15: Biologically Inspired Computation

Craig Reynolds and “Boids”Craig Reynolds is a computer graphics researcher, who revolutionised animation in games and movies with his classic paper :

Reynolds, C. W. (1987) Flocks, Herds, and Schools: A Distributed Behavioral Model, in Computer Graphics, 21(4) (SIGGRAPH '87 Conference Proceedings) pages 25-34.

This paper is examinable reading, available on my teaching page.

The story is:• before this paper, animations of flocks, swarms, groups, and so on, behaved nothing at all like the real thing. Nobody knew how to make it realistic. (we still have that problem with fire, explosions, and realistic human movement, etc …)• Reynold’s solved the problem by trying a very simple approach, which was inspired by a sensible view of how animals actually do it.

Page 16: Biologically Inspired Computation

The problem

We would like these to move like a realistic flock of starlings.(The heading of each one is suggested by where it’s pointing)But what’s wrong to start with?

Page 17: Biologically Inspired Computation

The problem

That’s better. Now what? Perhaps in the next timestep, theyshould all move the same small distance? They should all changetheir velocity in some way? What?

Page 18: Biologically Inspired Computation

Reynold’s Rules

Reynolds came up with three simple rules that solve thisProblem, resulting in entirely realistic flocking behaviour.

To explain them, we first need to consider the perceptual system ofan individual (which Reynolds called a boid).

For realistic movement, you need a realistic view of perception.E.g. a starling’s movement is not influenced at all by the flockmatesthat it cannot see – such as those out of its line of sight, or too faraway.

Page 19: Biologically Inspired Computation

A simple sensory system

This picture is from Reynold’s boids page.The green boid can see a certain amountahead, and is also aware of any flockmates within limits on either side (recall, birds tend to have eithers on the sidesof their heads.)

Two parameters, angle and distance,define the system. SO, this boid will onlybe influenced by those others it can senseaccording to these parameters.

Page 20: Biologically Inspired Computation

Rule 1: SeparationAt each iteration, a boidmakes an adjustment to itsvelocity according to thefollowing rule:

Avoid getting too close tolocal (the ones it is aware of) flockmates.

Page 21: Biologically Inspired Computation

Rule 2: AlignmentAt each iteration, a boidmakes an adjustment to match its velocity to the average of that of its local flockmates.

Page 22: Biologically Inspired Computation

Rule 3: CohesionAt each iteration, a boidmakes an adjustment to its velocity towards the centroid of its flockmates.

Page 23: Biologically Inspired Computation

Notes: It’s not quite as simple as that to get realistic behaviour

Need to define an appropriate distance for the perceptive range.What if this is too high, what if this is too small?

Reynold’s found that he had to be careful about how the vectors from the three rules get combined. It is not ideal to simply add them. Opposing “shouts” from two rules may cancel out, leading tothe third winning – in what scenarios might this be a problem?

Note that the cohesion rule is interesting – it leads to “bifurcating” around obstacles – a follow-the-leader approach to flocking would not achieve that.

The simple rules also realistically lead to “flash expansion” if started too close together.

Page 24: Biologically Inspired Computation

Next time:From the Adaptive Culture Model to Particle Swarm Optimisation