Skip to main content
Flies use visual cues to finesse their mental maps of the environment. Two new studies use virtual reality to show how. 
Janelia Senior Group Leader, Janelia Research Campus Investigator, Harvard Medical School
Flies use visual cues to finesse their mental maps of the environment. Two new studies use virtual reality to show how. 


In a circular arena, a fruit fly navigates a virtual landscape illuminated by black and blue lights. The fly is tethered in place, able to flap its wings but not move its head. Images on the wall rotate to give the illusion of movement.

This is no insect carnival ride, though. It’s a setup that researchers at the Howard Hughes Medical Institute’s Janelia Research Campusexternal link, opens in a new tab are using to study how fruit flies get their bearings and build mental maps of the world.

Now, two studies carried out independently at Janelia and Harvard Medical School show how a fly’s neural compass uses visual cues to refine the insect’s sense of orientation. Flies’ mental maps are surprisingly malleable, suggest both studies, published November 20, 2019, in the journal Nature.

Scientists can actually rewrite the insects’ sense of direction by tinkering with their neural compass. And with just a few pieces of visual information, flies can build a new map of their surroundings.Theoretical studies have explained how spatial maps in the brain might adjust to new visual objects, says Yvette Fisher, an HHMI Hanna Gray Fellow and the lead author on the Harvard studyexternal link, opens in a new tab. “But nobody had seen it at the mechanistic level.”

The findings give new insight into how brains can build a stable map of a scene while also remaining flexible enough to adapt to new scenarios, says Sung Soo Kim, a neuroscientist at the University of California, Santa Barbara who led the study at Janeliaexternal link, opens in a new tab. The work also has implications for how other animals navigate in the wild, adds Fisher, from insects like ants and dung beetles to mammals like mice – and maybe even humans.


Sense of direction

Like humans, flies can quickly orient themselves using landmarks in their environment, building a mental map of the scenery around them.

Flies have a ring of “compass neurons” in their brain that reflect the fly’s orientation in space, Janelia Senior Group Leader Vivek Jayaramanexternal link, opens in a new tab and his lab had shown in past research. When a fly is facing a particular direction, there’s a bump of activity in neurons somewhere around the ring. As the fly turns, the bump moves to reflect the fly’s new orientation, like a compass needle spinning to consistently point north.  

These compass neurons respond to the fly turning even in pitch darkness – but adding visual cues gives flies an even better sense of direction, says Jayaraman. “The question is, how does the compass keep the two sources of information, the turns and visual cues, in sync?”

One proposed explanation is that each visual neuron touches every compass neuron in the ring.  Some connections are stronger than others; their relative strength builds up a map in the fly’s brain. Repeatedly seeing a landmark in a particular orientation will strengthen some links between compass neurons and the visual neurons that deliver information about the world.


In this explanation, the connections are malleable – able to change in strength over time in response to a change in scenery. If a key landmark appears in a different position, for example, some connections will weaken and others will strengthen accordingly, updating the fly’s mental map. It’s a complicated idea to test in wild animals. But with flies in the lab, scientists now can.

Fisher and her colleagues in HHMI Investigator Rachel Wilson’s lab at Harvard put flies into a virtual reality arena and recorded their brain activity as they wandered. In the dark, flies eventually lost their sense of direction — the compass “bump” didn’t match the direction the fly was pointing in. But shining a single bright light on the arena wall as a guidepost allowed the compass to keep its accuracy.

Then, Fisher and her colleagues added a second light, directly across the arena from the first. In this new visual environment, some neurons became chattier, while others grew quieter. After a few minutes, they removed the second visual cue, returning the fly to the original scene. The brain had re-interpreted that original environment, they found: The compass now pointed in a different direction. And the neurons that were particularly talkative in the altered environment had changed the connections they’d made with visual neurons – a sign that the fly could update its map over time.

Rewritable maps

Meanwhile, Jayaraman, Kim, and their colleagues at Janelia were also seeing signs of flexible mapping of more complex visual scenes. They put flies into a different virtual reality arena, tethering the insects in place in the grapefruit-sized chamber but giving them the illusion of flying. Over time, flies linked the positioning of key visual features in the scene to certain compass neurons, the team showed. Seeing those visual cues activated the compass neurons and told the fly what direction it was heading.

“The relationship becomes stronger as the fly repeats this experience, strengthening connections between neurons over time,” says Kim, who did this research as an associate at Janelia. And importantly, flies could do this anew in a different visual setting.

“One of the beautiful things about this circuit is that it has allowed us to rigorously test models that were theorized twenty or thirty years ago,” says Ann Hermundstadexternal link, opens in a new tab, one of the theoretical neuroscientists at Janelia who collaborated with Kim and Jayaraman.  “We can now make predictions about just how flexible the compass should be to quickly handle new settings, and can test these predictions with new experiments.”

For example, Kim showed that flies didn’t always need to turn in a full circle to make a map. Just turning through part of the scene was enough. What’s more, he could actually flip the fly’s internal compass using a technique called optogenetics to manipulate individual neurons. Now, neurons that once made the fly think it was turning to the right instead moved the compass to the left. Over time, a fly could make a new map of the virtual reality arena – only backwards.


Navigation involves a kind of learning that hasn’t been widely studied at the circuit level, Harvard’s Wilson says. It’s different from teaching animals that the sound of a bell, for example, brings some sort of reward. Instead, the fly explores an environment and learns on its own as it goes.

Scientists have linked this kind of learning to certain brain regions in mammals, Wilson says, but it’s been difficult to study exactly how it works in complicated mammalian brains. “This is a really concrete illustration of how brain cells can learn things from the bottom up, without a teacher.”



Sung Soo Kim, Ann M. Hermundstad, Sandro Romani, L. F. Abbott, and Vivek Jayaraman. “The generation of stable heading representations in diverse visual scenesexternal link, opens in a new tab,” Nature. Published online November 20, 2019. Doi: 10.1038/s41586-019-1767-1.

Yvette E. Fisher, Jenny Lu, Isabel D’Alessandro, and Rachel I. Wilson. “Sensorimotor experience remaps visual input to a heading direction networkexternal link, opens in a new tab,” Nature. Published online November 20, 2019. Doi: 10.1038/s41586-019-1772-4.