This article was taken from the May 2013 issue of Wired magazine. Be the first to read Wired's articles in print before they're posted online, and get your hands on loads of additional content by <span class="s1">subscribing online.
The first thing to hit Iain Couzin when he walked into the Oxford lab where he kept his locusts was the smell, like a stale barn full of old hay. The second, third, and fourth things to hit him were locusts. The insects frequently escaped from their cages and flew into the faces of scientists and lab technicians.
The room was hot and humid, and the constant commotion of 20,000 critters produced a miasma of aerosolised insect exoskeleton. Many of the staff had to wear respirators to avoid developing severe allergies. "It wasn't the easiest place to do science," Couzin says.
In the mid-2000s that lab was, however, one of the only places on Earth to do the kind of science Couzin wanted. He didn't care about locusts per se -- Couzin wanted to study collective behaviour.
That's swarms, flocks, schools, colonies... anywhere the actions of individuals turn into the behaviours of a group. Biologists had already teased apart the anatomy of locusts in detail, describing their transition from wingless green loners at birth to flying black-and-yellow adults. But you could dissect one after another and still never figure out why they blacken the sky in kilometre-wide plagues. Few people had looked at how locusts swarm since the 60s -- it was, frankly, too hard. So no one knew how a small, chaotic group of stupid insects turned into a cloud of millions, united in one purpose.
Couzin would put groups of up to 120 young locusts into a sombrero-shaped arena he called the locust accelerator, letting them walk in circles around the rim for eight hours a day while an overhead camera filmed their movements and software mapped their positions and orientations. He eventually saw what he was looking for: at a certain density, the bugs would shift to cohesive, aligned clusters. And at a second critical point, the clusters would become a single marching army. Haphazard milling became rank-and-file -- a prelude to their transformation into black- and-yellow adults.
That's what happens in nature, but no one had ever induced these complex shifts in a laboratory -- at least not in animals. In 1995 a Hungarian physicist named Professor Tamás Vicsek and his colleagues devised a model to explain group behaviour with a simple, almost rudimentary condition: every individual moving at a constant velocity matches its direction to that of its neighbours within a certain radius. As this hypothetical collective becomes bigger, it flips from a disordered throng to an organised swarm, just like Couzin's locusts. It's a phase transition, like water turning to ice. The individuals have no plan. They obey no instructions. But with the right if-then rules, order emerges.
Couzin wanted to know what if-then rules produced similar behaviours in living things. "We thought that maybe by being close to each other, they could transfer information," he says. But they weren't communicating in a recognisable way. Some other dynamic had to be at work.
The answer turned out to be quite grisly. Every morning, Couzin would count the number of locusts he placed in the accelerator. In the evening, his colleague Dr Jerome Buhl would count them as he took them out. But Buhl was finding fewer individuals than Couzin said he had started with. "I thought I was going mad," Couzin says. "My credibility was at stake if I couldn't even count the right number of locusts."
When he replayed the video footage and zoomed in, he saw that the locusts were biting each other if they got too close.
Some unlucky individuals were completely devoured. Cannibalism, not co-operation, was aligning the swarm. Couzin figured out an elegant proof for the theory. "You can cut the nerve in their abdomen that lets them feel bites from behind, and you completely remove their capacity to swarm," he says.
Couzin's findings are an example of a phenomenon that has captured the imagination of researchers around the world. For more than a century people have tried to understand how individuals become unified groups. The hints were tantalising -- animals spontaneously generate the same formations that physicists observe in statistical models. There had to be underlying commonalities.
The secrets of the swarm hinted at a whole new way of looking at the world. But those secrets were hidden for decades. Science, in general, is a lot better at breaking complex things into tiny parts than it is at figuring out how tiny parts turn into complex things.
When it came to figuring out collectives, nobody had the methods or the maths. Now, thanks to new observation technologies, powerful software and statistical methods, the mechanics of collectives are being revealed. Indeed, enough physicists, biologists and engineers have got involved that the science itself seems to be hitting a density-dependent shift. Without leaders or an overarching plan, this collective of the collective-obsessed is finding that the rules that produce majestic cohesion out of local jostling turn up in everything from neurons to human beings. And the rules may explain everything from how cancer spreads to how the brain works and how armadas of robot-driven cars might someday navigate highways. The way individuals work together may actually be more important than the way they work alone.
Aristotle first posited that the whole could be more than the sum of its parts. Ever since, philosophers, physicists, chemists and biologists have periodically rediscovered the idea. But it was only in the computer age -- with the ability to iterate simple rule sets millions of times over -- that this hazy concept came into sharp focus.
For most of the 20th century, biologists and physicists pursued the concept along parallel but separate tracks.
Biologists knew that living things exhibited collective behaviour -- it was hard to miss -- but how they performed it was an open question. The problem was, before anyone could figure out how swarms formed, someone had to figure out how to do the observations. In a herd, all the wildebeest/bacteria/starlings look pretty much alike. Plus, they're moving fast through three-dimensional spaces. "It was incredibly difficult to get the right data," says Nigel Franks, a University of Bristol biologist and Couzin's thesis adviser. "You were trying to look at all the parts and the complete parcel at the same time." Physicists, on the other hand, had a different problem. Typically, biologists were working with collectives ranging in number from a few to a few thousand; physicists count groups of a few gazillion. The kinds of collectives that undergo phase transitions, like liquids, contain individual units counted in double-digit powers of ten. From a statistical perspective, physics and maths basically pretend those collectives are infinitely large. So again, you can't observe the individuals directly in any meaningful way. But you can model them.
[pullquote source="KeepInline]
A great leap forward came in 1970, when mathematician John Conway invented what he called the [link url="http://en.wikipedia.org/wiki/Conway's_Game_of_Life"]Game of Life[/link]. He imagined an Othello board, with game pieces flipping between black and white. The state of the markers -- called cells -- changed depending on the status of neighbouring cells. A black cell with one or no black neighbours "died" of loneliness, turning white. Two black neighbours: no change. Three, and the cell "resurrected," flipping from white to black. Four, and it died of overcrowding -- back to white. The board turned into a constantly shifting mosaic. Conway could play out these rules with an actual board, but when he and other programmers simulated the game digitally, Life got very complicated. At high speeds, with larger game boards, they were able to coax an astonishing array of patterns to evolve across their screens. Depending on the starting conditions, they got trains of cells that trailed puffs of smoke, or guns that shot out small gliders. At a time when most software needed complex rules to produce even simple behaviours, the Game of Life did the opposite. Conway had built a model of emergence -- the ability of his little black and white objects to self-organise into something new.
Sixteen years later, computer animator Craig Reynolds found a way to automate the animated movements of large groups His software, Boids, created virtual agents that mimicked a flock of birds. At its heart were three simple rules: move towards the average position of your neighbours, keep some distance from them and align with their average heading.
That's it.
Boids and its ilk infiltrated Hollywood in the 90s: it animated the penguins and bats of Batman Returns and its descendant, Massive, was used in the
Lord of the Rings trilogy. The flocks created by Boids suggested that real-world swarms might arise the same way -- not, as some had proposed, from top-down orders, mental templates of orderly flocks or telepathy. Complexity, as Aristotle suggested, could come from the bottom up.
The field was starting to take off. Vicsek, the Hungarian physicist, simulated his flock in 1995, and in the late 90s a German physicist and professor of sociology named Dirk Helbing programmed sims in which digital people spontaneously formed lanes on a crowded street and crushed themselves into fatal jams when fleeing from a threat like a fire -- just as real humans do. Helbing did it with simple "social forces." All he had to do was tell his virtual humans to walk at a preferred speed toward a destination, keep their distance from walls and one another and align with the direction of their neighbours. Hey presto: instant mob.
At the turn of the 21st century, research in biology and physics was starting to intersect. Cameras and computer-vision technologies could show the action of individuals in animal swarms, and simulations were producing lifelike results. Researchers were starting to be able to ask the key questions: were living collectives following rules as simple as those in the Game of Life or Vicsek's models? And if they were... how?
Before studying collectives, Couzin collected them.
Growing up in Scotland, he wanted pets, but because of his three brothers' various allergies, he was allowed only the most unorthodox ones. "I had snails at the back of my bed, aphids in my cupboard and stick insects in my school locker," he says. Anything that formed swarms fascinated him. "I remember seeing these fluid-like fish schools on television, watching them again and again, and being mesmerised. I thought fish were boring, but these patterns..." Couzin pauses, and you can almost see schooling fish looping behind his eyes; then he's back, "I've always been interested in patterns," he says simply.
When Couzin became a graduate student, he finally got his chance to work on patterns in Nigel Franks's lab in 1996.
Franks was trying to figure out how ant colonies organise themselves, and Couzin joined in. He would dab each bug with paint and watch them on video, replaying the recording over and over to follow different individuals. Couzin doubted it worked. He didn't believe the naked eye could follow the multitude of parallel interactions in a colony. So he turned to artificial ones. He learned to program a computer to track the ants -- and eventually to simulate entire animal groups. He was learning to study not the ants, but the swarm.
For a biologist, the field was a lonely one. "I thought there must be whole labs focused on this," Couzin says. "I was astonished to find that there weren't." What he found instead was Boids. In 2002 Couzin delved into the software and focused on its essential settings of attraction, repulsion and alignment. Then he messed with it. Turning up attraction and repulsion and with alignment turned off, his virtual swarm stayed loose and disordered. When Couzin upped the alignment, the swarm coalesced into a whirling doughnut, like a school of mackerel. When he increased the range over which alignment occurred even more, the doughnut disintegrated, its elements pointed in the same direction and started moving together, like a flock of migrating birds. In other words, all these shapes come from the same algorithms. "I began to view the simulations as an extension of my brain," Couzin says. "By allowing the computer to help me think, I could develop my intuition of how these systems worked."
By 2003, Couzin had a grant to work with locusts at Oxford. He was among the first to show physicists and biologists how their disciplines could fuse together. Studying animal behaviour "used to involve taking a notepad and writing, 'The big gorilla hit the little gorilla,'" says Vicsek. "Now there's a new era where you can collect data at millions of bits per second and then go to your computer and analyse it."
Today Couzin, 39, heads a lab at Princeton University, New Jersey. He has a broad face and cropped hair and an intense gaze behind his black-rimmed glasses. The 19-person team he leads is ostensibly part of the Department of Ecology and Evolutionary Biology and also includes physicists and mathematicians. They share an office with eight high-end workstations -- all named Hyron, the Cretan word for beehive, or swarm of bees, and powered by video-game graphics cards.
Locusts are forbidden in US research because of fears they'll escape and destroy crops. So when Couzin came to Princeton in 2007, he needed a new animal. He had done some work with fish, so visited a nearby lake with nets, waders and a willing team.
After hours of failure and very few fish, he approached some nearby fishermen. "I thought they'd know where the shoals would be, so I went over and saw tiny minnow-sized fish in their buckets, schooling like crazy." They were golden shiners -- unremarkable 7cm-long creatures that are "dumber than I could possibly have imagined," Couzin says. They're also cheap. He bought 1,000 of them for $70 (£45).
When Couzin enters the room where the shiners are kept, they press up against the front of their tanks in their expectation of food, losing any semblance of a collective. But as soon as he nets them out and drops them into a wide nearby pool, they school together. His team has injected coloured liquid and a jelling agent into their backs; the two materials congeal into a piece of gaudy plastic, making them visible from above. As they navigate courses in the pool, lights illuminate the plastic, while cameras film their movements. Couzin is using these shiners to move beyond just looking at how collectives form and begin to study what they can accomplish. What abilities do they gain?
[Quote"]Rules that produce majestic cohesion out of local jostling turn up everywhere[/pullquote]
For example, when Couzin flashes light over the shiners, they move, as one, to shadier patches, presumably because darkness equals safety for a fish whose main defensive weapon is to "run away." Behaviour like this is typically explained with the "many wrongs principle," first proposed by Bergman and Donner in 1964. Each shiner, the theory goes, makes an imperfect estimate about where to go, and the school, by interacting and staying together, averages these many slightly wrong estimations to get the best direction. The wisdom of crowds.
But in the case of shiners, Couzin's observations in the lab have shown that the theory is wrong. The school could not be pooling imperfect estimates, because the individuals don't make estimates of where things are darker at all. Instead they obey a simple rule: swim slower in shade. Once out of the light, all of them slow down and cluster together, like cars jamming on a motorway. "That's purely an emergent property," Couzin says. "The sensing ability really happens only at the level of the collective."
Other students of collectives have found similar feats of swarm intelligence. Every spring, honeybees leave their colonies to build new nests. Scouts return to the hive to convey the locations of real estate by dancing in figures of eight. The intricate dance steps encode distance and direction, but more importantly, they excite other scouts.
Thomas Seeley, a behavioural biologist at Cornell University, Ithaca, New York, used paint to mark bees that visited different sites. He found that those advocating one location ram their heads against colony mates that dance for another. If a dancer gets rammed often enough, it stops dancing. Once one party builds past a threshold of support, the entire colony flies off as one.
[pullquote source="]
House-hunting bees turn out to be a literal hive mind, composed of bodies. In the 80s cognitive scientists began to postulate that human cognition itself is an emergent process. In your brain, this thinking goes, different sets of neurons fire in favour of different options, exciting some neighbours into firing like the dancing bees and inhibiting others into silence, like the head-butting ones. This builds until a decision is made and the brain as a whole says, "Go right" or "Eat that chocolate bar."
The same dynamics can be seen in starlings. On winter evenings in UK skies, murmurations gather. If a falcon attacks, all the starlings dodge almost instantaneously, even those on the far side that haven't seen the threat. How can this be? Italian physicists Andrea Cavagna and Irene Giardina discovered their secret by filming thousands of starlings from a rooftop with three cameras and using a computer to reconstruct the birds' movements in three dimensions. In most systems where information gets transferred from individual to individual, the quality of that information degrades and corrupted every time it is relayed. But Cavagna found that the starlings' movements are united in a "scale-free" way. If one turns, they all turn. If one speeds up, they all speed up. The rules are simple: do what your half-dozen closest neighbours do without hitting them. But because the quality of the information the birds perceive about one another decays far more slowly than expected, the perceptions of any individual starling extend to the edges of the murmuration and the entire flock moves.
All these similarities seem to point to a grand unified theory of the swarm -- a fundamental ultra-calculus that unites the various strands of group behaviour. In one paper, Vicsek and a colleague wondered whether there might be "some simple underlying laws of nature (such as the principles of thermodynamics) that produce the whole variety of the observed phenomena."
Couzin has considered the same thing. "Why are we seeing this again and again?" he says. "There's got to be something deeper and more fundamental." Biologists are used to convergent evolution, like the streamlining of dolphins or echolocation in bats -- animals from separate lineages have similar adaptations. But convergent evolution of algorithms? Either all these collectives came up with different behaviours that produce the same outcomes -- head-butting bees, neighbour-watching starlings, light-dodging shiners -- or some basic rules underlie everything and the behaviours are the bridge from the rules to the collective.
Stephen Wolfram would probably say it's the underlying rules. The British mathematician and inventor of the Mathematica software wrote the book A New Kind of Science in 2002, which stated that emergent properties embodied by collectives came from simple programs that drove the complexity of snowflakes, shells, the brain, even the universe itself. He promised that his book would lead the way to uncovering those algorithms, but he never quite got there.
Couzin, on the other hand, is wary of claims that his theory field has hit upon the secret to life, the universe, and everything. "I'm very cautious about suggesting that there'll be an underlying theory that'll explain the stock market and neural systems and fish schools," he says. "There's a danger in thinking that one equation fits all." Physics predicts the interactions of his locusts, but the mechanism manifests through cannibalism. Maths didn't produce the biology; biology generated the maths.
Still, just about any system of individual units pumped with energy -- kinetic, thermal, whatever -- produces patterns. Metal rods organise into vortices when bounced around on a vibrating platform. In a petri dish, muscle proteins migrate in a unidirectional fashion when pushed by molecular motors. Tumours spawn populations of rogue, mobile cells that align with and migrate into surrounding tissues, following a subset of trailblazing leader cells. That looks like a migrating swarm; figure out its algorithms and maybe you could divert it from vital organs or stop its progress.
The same kind of rules apply when you step up the complexity. The retina, that sheet of light-sensing tissue at the back of the eye, connects to the optic nerve and brain. Michael Berry, a Princeton neuroscientist, mounts patches of retinas on electrodes and shows them videos, watching their electro-physiological responses. In this context, the videos are like the moving spotlights Couzin uses with his shiners and just as with the fish, Berry finds emergent behaviours with the addition of more neurons. "Whether the variable is direction, heading, or how you vote, you can map the mathematics from system to system," Couzin says.
In a lab that looks like an aircraft hangar, several kilometres from Princeton's main campus, assortments of submersibles are suspended from the ceiling. The air is cool, with a smell of chlorine thanks to a 75,000-litre water tank, six metres across and two metres deep, home to four sleek, cat-sized robots with dorsal and rear propellers that allow them to swim.
[Quote"]Physics predicts the interactions of his locusts, but the mechanism manifests through cannibalism. Maths didn't produce the biology; biology generated the maths.[/pullquote]
The robots are called belugas and they're designed to test models of collective behaviour. "We're learning about mechanisms in nature that I wouldn't have dreamt of designing," says engineer Naomi Leonard. She plans to release pods of underwater robots to collect data on temperature, currents, pollution and more. The robots can track moving gradients, avoid each other and keep far enough apart to avoid collecting redundant data -- just enough programming to unlock more complex abilities.
.
Today, however, it's not working. Three belugas are out of the tank so Leonard's team can tinker. The one in the water is on manual, driven by a thick gaming joystick. The controls are responsive, if leisurely, and daredevil manoeuvres are out of the question.
Leonard has a video of the robots working together, though, and it's much more convincing. The bots carry out missions with a feedback-controlled algorithm programmed into them, like finding the highest concentrations of oil in a simulated spill or collecting "targets" separately and then reuniting.
Building a successful robot swarm would show that the researchers have figured out something basic. Robot groups already exist, but most have sophisticated artificial intelligence or rely on orders from humans or computers. To Tamás Vicsek -- the physicist who created those flock simulations -- that's cheating.
He's trying to build quadcopters that flock like birds, relying only on knowledge of their neighbours' position, direction and speed. Vicsek wants them to chase down another drone, but so far he's had little success. "If we apply the rules developed by us and Iain, it doesn't work," Vicsek says. "They overshoot their mark, they don't slow down enough."
Another group of researchers is trying to pilot a flock of UAVs using network theories -- the same kind of rules that govern relationships on Facebook -- to communicate, while governing the flocking behaviour of the drones with a modified version of Boids. Yet another team is working on applying flocking behaviours to autonomous cars -- one of the fundamental emergent properties of a flock is collision avoidance, and one of the most important requirements of self-driving cars will be not to run into things.
So far, the belugas' biggest obstacle has been engineering. The robots' responses to commands are delayed. Small asymmetries in their hulls change the way each one moves.
Ultimately, dealing with that messiness might be the key to taking the study to the next level. Ever since the days of Boids, scientists have made big assumptions about how animals interact.
But animals are more than models. They sense the world. They communicate. They make decisions. These are the abilities that Couzin wants to channel. "I started off with these simple units interacting to form complex patterns, and that's fine, but real animals aren't that simple," Couzin says. He picks up a plastic model of a crow from his bookshelf. "Here we have a complex creature. It's getting to the point where we'll be able to analyse the behaviour of these animals in natural, three-dimensional environments." Step one might be to put a cheap Microsoft Kinect game system into an aviary, bathing the room in infrared and mapping the space.
Step two would be to take the same measurements in the real world. Every crow involved in a murder would carry miniature sensors that record its movements, along with the chemicals in its body, the activity in its brain and the images on its retina. Couzin could marry the behaviour of the cells and neurons inside each bird with the movements of the flock. It's a souped-up version of the locust accelerator -- combine real-world models with technology to get an unprecedented look at creatures that have been studied intensively as individuals but ignored as groups. "We could then understand how these animals gain information, communicate and make decisions," Couzin says. He doesn't know what he'll find, but that's the beauty of being part of the swarm: even if you don't know where you're going, you still get there.
Ed Yong wrote about the development of brain-hacking tools in issue 11.12
This article was originally published by WIRED UK