Swarm Behavior and Artificial Intelligence, Part 1

Stephen DeAngelis

May 29, 2012

In the first segment of this two-part series on swarm behavior and artificial intelligence, I want to set the stage for why studying swarm behavior is both intriguing and important. It might appear counterintuitive that animals, birds, fish, and insects can collectively make wise decisions or accomplishment amazing feats, but we see it all around us. Scientists want to know how they manage it. Let’s begin by looking at fish. An article in The Economist reported, “Human beings like to think of themselves as the animal kingdom’s smartest alecks. It may come as a surprise to some, therefore, that Iain Couzin of Princeton University believes they have something to learn from lesser creatures that move about in a large crowd.” [“Follow my leader,” 24 February 2011] Couzin noted that “groups of animals often make what look like wise decisions, even when most of the members of those groups are ignorant of what is going on.” The article asserted that “coming to that conclusion was not easy.” It explained:

“Before lessons can be drawn from critters perched on the lower rungs of the evolutionary ladder, their behaviour must first be understood. One way to do this is to tag them with devices that follow them around—motion-capture sensors, radio transmitters or global-positioning-system detectors that can put a precise figure on their movements. Unfortunately, it is impossible to tag more than a few individuals in a herd, flock or swarm. Researchers have therefore tended to extrapolate from these few results by using various computer models. Dr Couzin has done quite a bit of this himself. Most recently, he has modelled the behaviour of shoals of fish. He posited that how they swim will depend on each individual’s competing tendencies to stick close to the others (and thus move in the same direction as them) while not actually getting too close to any particular other fish. It turns out that by fiddling with these tendencies, a virtual shoal can be made to swirl spontaneously in a circle, just like some real species do.”

Couzin’s models obviously used a few simple rules that told his virtual fish how to behave (i.e., stay close to your neighbor, but not too close). As the article stated, “That is a start. But real shoals do not exist to swim in circles.” Even school children know that some animals, insects, birds and fish live in groups for protection and survival. As the article noted, “Their purpose is to help their members eat and avoid being eaten.” It continued:

“At any one time, however, only some individuals know about—and can thus react to—food and threats. Dr Couzin therefore wanted to find out how such temporary leaders influence the behaviour of the rest. He discovered that leadership is extremely efficient. The larger a shoal is, the smaller is the proportion of it that needs to know what is actually going on for it to feed and avoid predation effectively. Indeed, having too many leaders with conflicting opinions results in confusion. At least, that is true in the model. He is now testing it in reality.”

Following a leader blindly can lead to interesting results. I’m reminded the story about two gas company meter readers, a veteran and a trainee, who had parked their truck at the entrance of a cul de sac and were checking the gas meters of the homes on the street. Each meter reader took a side of the street and they met at the house at the end of the circle. At that point, the young trainee challenged the veteran to a foot race back to the truck. When they reached the truck, they turned around and saw a woman frantically running after them. “What’s the matter,” they asked her. “You tell me,” she replied. “When I saw two gas men running as fast as they could away from my house, I thought it was going to explode!” The woman’s survival instincts told her that she didn’t need to know what the problem was from which the gas men were supposedly running; she just knew that it was in her best interests to follow. That is how fish behave as well. The article continued:

“Tracking individual fish in a shoal is hard. Fortunately, advances in pattern-recognition software mean it is no longer impossible. Systems designed to follow people are now clever enough not only to track a person in a crowd, but also to tell in which direction his head is turned. Since, from above, the oval shape of a human head is not unlike the oblong body of a fish, this software can, with a little tweaking, follow piscine antics, too. Dr Couzin has been using a program developed by Colin Twomey, a graduate student at his laboratory, to track individual fish in a tank. The result is not just a model of shoaling fish, but a precise numerical representation of their actual movements and fields of vision. That means it is possible to investigate whether real-life fishy leaders have the same effect on a group as their virtual kin.”

The article pointed out that identifying a “leader” in a shoal of fish that all look alike can be daunting. The answer, therefore, was to create a leader — in Couzin’s case a “robot three-spined stickleback.” The article reported that real fish bought the ruse and followed the robot’s lead. The article concluded:

“If the models are anything to go by, the best outcome for the group—in this case, not being eaten—seems to depend on most members’ being blissfully unaware of the world outside the shoal and simply taking their cue from others. This phenomenon, Dr Couzin argues, applies to all manner of organisms, from individual cells in a tissue to (rather worryingly) voters in the democratic process. His team has already begun probing the question of voting patterns. But is ignorance really political bliss? Dr Couzin’s models do not yet capture what happens when the leaders themselves turn out to be sharks.”

Couzin was not the first researcher to lead a team that utilized the services of a robo-fish; that honor went to a team of researchers in England. The team from the University of Leeds also used a model of a three-spined stickleback fish. [“‘Robofish’ makes friends with biological cousins,” by Ben Coxworth, Gizmag, 30 June 2010]. The Leeds team was the first to “fool other fish into thinking [the robo-fist was] one of them.” An earlier article in The Economist stated that “simulating the behaviour of crowds of people, or swarms of animals, has both frivolous and important uses.” [“Model behaviour,” 5 March 2009] Obviously, it’s the important uses of a modelled swarm (or crowd) that interests business leaders. The article continued:

“Engineers and architects hope that they will be able to improve building safety by modelling how people behave in the event of a fire. The simulation of the behaviour of crowds of people and swarms of animals … is also being applied to many other unusual situations, from designing better closed-circuit television (CCTV) security systems to managing the traffic of ships in harbours. The same technology has also been used to improve the understanding of archaeological ruins and to model entire ecosystems in order to design wildlife-management strategies.”

The reason that computer models are becoming effective tools for studying swarm/crowd behavior is that virtual individuals (hundreds of thousands of them) can be given their “own desires, needs and goals, and the ability to perceive the environment and respond to the immediate surroundings in a believable way.” Large computer-generated battle scenes in the movie “Lord of the Rings” were created with software developed by Massive Software, based in Auckland, New Zealand. The “actors” in those scenes acted so realistically they caught the eye of an executive at Arup, an engineering firm. That executive, Nate Wittasek, the leader of Arup’s Los Angeles Fire Engineering Group, “realised that the same technology might be just what he had been looking for to model how people behave during a blaze—something that is increasingly being incorporated into the design of large buildings. Using computational models of crowds, it is possible to set up various scenarios and evaluate how the occupants move through the building.” The article noted that human behavior is “complex and often quite irrational.” For example, “when fleeing a fire people will often try to retrace their steps and leave the building by the way they came in, rather than heading for the nearest exit—even if it is much closer. Similarly, on hearing a fire alarm many people do absolutely nothing. It is only when they see direct evidence of a fire, such as smoke or flames, that they act, says Mr Wittasek.” The article continued:

“Mr Wittasek has been applying Massive’s crowd-modelling technology to building safety. … But for Arup’s purposes, several tweaks were added. In particular, agents were given the ability to find their way around an environment. … [In an evacuation scenario], the agents need to be able to remember their surroundings, and to plan routes accordingly, as they navigate the environment looking for a safe escape. … The result is Massive Insight, a software package that makes it possible to create agents and program their behaviour preferences using simple graphical tools. The agents do not look terribly exciting: they resemble simple stick figures that move through a three-dimensional environment. But what really matters is how they behave.”

Like fish in a shoal, Wittasek noted that “people who have hitherto ignored a fire alarm are more likely to respond if they see other people around them heading for the exits.” Another researcher involved in swarm/crowd research is “Demetri Terzopoulos, a computer scientist at the University of California in Los Angeles.” The article reported that “he is using agents to simulate the behaviour of commuters passing through Pennsylvania Station in New York. His agents have memory, but they also have a sense of time and the ability to plan ahead.” The article continued:

“Dr Terzopoulos’s research has shown that agents can simulate complex behaviours with great realism. Working with Qinxin Yu, a graduate student, Dr Terzopoulos has modelled how people behave in public when someone collapses. People crowd around to help, and some agents will even remember if they recently saw a police officer nearby, and run to get help, he says. Such realism is useful in the development of automated CCTV systems. Using real cameras for such research would raise privacy concerns, so he is making agent simulations available instead to researchers who are training cameras to detect unusual behaviour. Another intriguing application is to help archaeologists study ancient ruins. Using a model of the Great Temple of Petra in Jordan, Dr Terzopoulos has evaluated how it would have been used by the people who built it. He has concluded that the temple’s capacity had previously been greatly overestimated.”

The work being done at Massive Software, and by researchers like Dr. Terzopoulos, clearly demonstrates the link between swarm behavior and artificial intelligence. Logistics and maritime industry executives should be interested to know that Massive Software worked “with BMT Asia Pacific, a marine consultancy, to model the behaviour of the thousands of ships operating in Hong Kong harbour. This involves simulating the behaviour of the ships themselves, each of which may be under the control of several people, says Richard Colwill of BMT. And rather than assuming that everyone will adhere to the maritime traffic code, which determines who has right of way, it can incorporate acts of bravado and incompetence.”

The article notes that the technology can also be used to model animal behavior, like the fish studies noted earlier. The article concluded, “As agent software becomes better able to capture complex real-world behaviour, other uses for it are sure to emerge. Indeed, this could soon become a crowded field.” More tomorrow.