A window into the fruit fly's nervous system

Scientists at EPFL have developed an implantation technique that allows unprecedented optical access to the “spinal cord” of the fruit fly, Drosophila melanogaster. This work can potentially lead to breakthroughs in the fields of neuroscience, artificial intelligence, and bio-inspired robotics.
An implanted Drosophila melanogaster fruit fly (foreground) interacting with an intact one (background). Credit: Alain Herzog (EPFL)

Understanding biological motor control requires the ability to record neural activity while animals are behaving,” says Professor Pavan Ramdya at EPFL’s School of Life Sciences. “We have a billion neurons in the human spinal cord – a massive system – and we can’t manipulate neurons in a human the way that we can with animals. Drosophila, the fruit fly, is a very small organism in which one can genetically manipulate and image the activity of nearly the entire motor circuitry in behaving animals.”

For years, Ramdya’s research has focused on digitally recapitulating the principles underlying Drosophila motor control. In 2019, his group published DeepFly3D, a deep-learning based motion-capture software that uses multiple camera views to quantify the 3D limb movements of behaving flies. In 2021, Ramdya’s team revealed LiftPose3D, a method for reconstructing 3D animal poses from 2D images taken from a single camera. These efforts were complemented by his publication in 2022 of NeuroMechFly, a first morphologically accurate digital “twin” of Drosophila.

But there are always more challenges ahead, especially in this field that lies at the interface between biology, neuroscience, computer science, and robotics. The aim is not to just to map and understand the nervous system of an organism – an ambitious task in and of itself – but also to discover how to develop bio-inspired robots that are as agile as flies.

“The obstacle that we had before this work,” says Ramdya, “was that we could only record fly motor circuits for a short period of time before the animal’s health deteriorated.”

Therefore, Ramdya teamed up with Professor Selman Sakar at EPFL’s School of Engineering to develop tools for monitoring Drosophila neural activity for longer periods of time, up to the insect’s entire lifespan. This project was spearheaded by Laura Hermans, a PhD student that has been co-supervised by both Ramdya and Sakar.

The surgical procedure by which the new V-shaped implant is inserted into the fruit fly’s thorax to allow optical access to its ventral nerve cord. Credit: Laura Hermans (EPFL)

A window into the ventral nerve cord

“We developed microengineered devices that provides optical access to the animal’s ventral nerve cord,” says Herman, referring to the fly’s equivalent of the spinal cord. “We then surgically implanted these devices into the fly’s thorax,” she continues. “One of these devices, an implant, allows us to move the fly’s organs aside to reveal the ventral nerve cord below. We then seal the thorax with a transparent microfabricated window. Once we have flies with these devices, we can record the fly’s behavior as well as its neural activity across a wide range of experiments over long timespans.”

The purpose behind all of these tools is to allow scientists to observe an individual animal over long periods of time. They can now perform experiments that extend beyond only a few hours and can even cover the fly’s entire lifespan. “For example, we can study how an animal’s biology adapts during disease progression,” says Hermans. “We can also study changes in neural circuit activity and structure during aging, The fly’s ventral nerve cord is ideal because it hosts the animal’s motor circuitry, allowing us to study how locomotion evolves over time or after injury.”

The implant

“As engineers, we crave for such well-defined technical challenges,” says Selman Sakar. “Pavan’s group has developed a dissection technique to remove the organs from the fly that block the field of view and visualize the ventral nerve cord. However, the flies can only survive for a few hours after the surgery. We were convinced that an implant has to be placed within the thorax. There are analogous techniques for visualizing the nervous system of bigger animals such as rats. We got inspiration from these solutions and started to think about the miniaturization issue.”

The early prototypes tried to address the challenge of safely move and retain the fly’s organs aside to uncover the ventral nervous cord, while allowing the fly to survive post-surgery.

“For this challenge you need someone who can approach a problem with both a life sciences and engineering perspectives –this highlights the importance of Laura’s [Hermans] and Murat’s [Kaynak] work,” says Sakar.

The early implants were rigid, and very few flies survived the procedure. Trying to improve survival rates without sacrificing the imaging quality posed a challenge that took several design iterations. In the end, the winner was a simple, yet effective prototype: a V-shaped compliant implant that can safely move the fly’s organs aside, uncover the ventral cord, and allow the researchers to seal the hole on the cuticle with a “barcoded thoracic window”, which allows them to observe the ventral nerve cord and make measurements of the neuronal activity as the fly goes about its daily life.

“Considering the animal-to-animal variations in anatomy, we had to find a safe and adaptive solution,” says Sakar. “Our implant addresses this particular need. Together with the development of proper tissue micromanipulation tools and a 3D nanoprinted compliant stage for mounting animals during repeated imaging sessions, we provide a complete versatile toolkit for neuroscience research.”

An open road

The achievement is an example of the open and interdisciplinary research typical of EPFL. “Since day one we have been very open with sharing the technology,” says Sakar. “The idea here is to quickly disseminate the tools and methods so that we can facilitate both further development of the technology and the discovery process that they offer in many domains of research. A number of groups would like to, I think, explore our technology.”

“By studying the fly, we believe that understanding something relatively simple can lay the groundwork for understanding more complicated organisms,” says Ramdya. “When you learn mathematics, you don't dive into linear algebra; you learn how to add and subtract first. Additionally, for robotics, it would be fantastic to understand how even a “simple” insect works.”

The next step for the team is to use their new methodology to unravel the mechanisms of Drosophila movement control. “Biological systems are really unique compared to artificial systems in that they can dynamically modulate, for example, the excitability of neurons or the strength of synapses,” Ramdya adds. “So in order to understand what makes biological systems so agile, you need to be able to observe this dynamism. In our case, we’d like to look at how, for example, motor systems respond over an animal's lifetime to aging or during recovery following injury.”

More Information


  • Swiss National Science Foundation (SNSF)
  • European Research Council (Horizon 2020)
  • Boehringer Ingelheim Fonds
  • Mexican National Council for Science and Technology (CONACYT)
  • EPFL


Laura Hermans, Murat Kaynak, Jonas Braun, Victor Lobato-Ríos, Chin-Lin Chen, Adam Friedberg, Semih Günel, Florian Aymanns, Mahmut Selman Sakar, Pavan Ramdya, Microengineered devices enable long-term imaging of the ventral nerve cord in behaving adult Drosophila, Nature Communications, 25 August 2022