Brains and AIMiddleLesson 2965 min read

FlyWire: mapping a whole fly brain

In 2024 the FlyWire team published a complete wiring map of an adult fruit fly brain. Learn how it was built with electron microscopes, AI and many human proofreaders.

Lesson in motion

In 60 seconds

FlyWire: mapping a whole fly brain

In 2024 the FlyWire team published a complete wiring map of an adult fruit fly brain. Learn how it was built with electron microscopes, AI and many human proofreaders.

1/5
In simple words
Imagine cutting a very thick book into thousands of pages and photographing each page. Now imagine the book is a fly's brain, far smaller than a grain of rice, and each "page" is thinner than anything you can see. To draw the map, you follow each neuron from one photo to the next, like following a single noodle through a huge plate of noodles. A computer did most of the following, and people checked and fixed its mistakes.
The fruit fly, Drosophila melanogaster, is the small fly you may see near ripe bananas and mangoes. Scientists have studied it for more than a century. It can walk, fly, smell, taste, see, find food, court a mate and learn. Yet its brain is tiny.
In October 2024, the FlyWire consortium, a large team of scientists and volunteers, published in the journal Nature a complete wiring map of the brain of an adult female fruit fly. It contains about 140,000 neurons and tens of millions of synaptic connections.

How the map was made

  1. 1

    Thin slices

    The brain of one fly was cut into extremely thin slices.
  2. 2

    Electron microscope images

    Each slice was photographed with an electron microscope, which shows details far smaller than a light microscope can.
  3. 3

    AI tracing

    AI models found the edges of neurons in the images and joined the pieces from slice to slice. They also detected the synapses.
  4. 4

    Human proofreading

    Many people, including trained scientists and citizen scientists, checked the AI's work and fixed wrong joins and breaks.
  5. 5

    Open data

    The finished map was shared openly, so anyone can explore it.

Why AI needed human help

The AI tracing was fast, but it made mistakes. Two kinds are common in this sort of work:
MistakeWhat happensEffect on the map
MergeTwo different neurons are joined into oneOne fake neuron with connections it does not really have
SplitOne neuron is broken into piecesMissing connections, and fragments that look like small neurons
Human proofreaders looked at the 3D shapes, spotted these errors and fixed them. Because the images were shared online, many people could help, including volunteers who were not professional scientists. This is called citizen science.

What scientists do with the map

  • Follow a pathway, for example from taste neurons towards the neurons that control feeding.
  • Group neurons into cell types with similar shapes and connections.
  • Compare the left and right sides of the brain.
  • Build computer models of the whole brain, as you will see in lesson 3.

Adding up connections

The raw data lists synapses. To study connections, scientists usually add up how many synapses link each pair of neurons. Many analyses then ignore very weak links, because a few detected synapses may be errors. The code below shows this idea with made-up numbers.
Python: adding up made-up synapse records with pandaspython
import pandas as pd

# MADE-UP synapse records, only for practice.
rows = [("taste_1", "relay", 3), ("taste_1", "relay", 4),
        ("taste_2", "relay", 2), ("relay", "feed_cmd", 9)]
df = pd.DataFrame(rows, columns=["pre", "post", "synapses"])
pairs = df.groupby(["pre", "post"], as_index=False)["synapses"].sum()
print(pairs)
Note
The map comes from one fly. Brains of the same species share a lot, but they also differ between individuals. Scientists compare maps from more than one animal to learn which features are common.
Real example
A college student in Bhubaneswar opens the FlyWire Codex website on her laptop. She searches for neurons that respond to taste, and clicks through to see where they send their connections. The same data that the research teams used is open to her, for free.
Do this
You can explore the real data yourself at FlyWire Codex. Start with one neuron and look at its inputs and outputs.

Watch and read more

Lab

A pandas analysis of made-up synapse records: summed connections, a strength filter, and the strongest input to a neuron.

~20 min

The problem

This runs in your browser. All data is made up.

  1. Run the starter. It shows a table of made-up synapse records. The same pair of neurons can appear on more than one row.
  2. Make pairs: one row per (pre, post) pair, with synapses added up. Hint: groupby and sum.
  3. Make strong: only the pairs with at least MIN_SYNAPSES synapses.
  4. Set top_input to the name of the neuron that sends the most synapses in total to "feed_cmd".
  5. Look at the raw rows: which neuron has the single biggest row into "feed_cmd"? Why is that a different answer?

Practice lab

Edit the code and run it. Python runs in your browser — nothing is sent to our server.

Output

No output. Add print(...) to see values.

You are done when

Hard questions

Try to answer before you reveal. If you can answer these, you understood the lesson.

Q1Why might a very low threshold, such as 1 synapse, make a connectome analysis less reliable?Reveal

Automatic synapse detection makes some mistakes, and a single detected synapse between two neurons may be an error. With a threshold of 1, those errors count as real connections and can create fake pathways. A higher threshold removes most such noise, but it can also drop some real weak connections, so results should be checked with more than one threshold.

Q2The FlyWire map comes from one female fly. What questions can it not answer on its own?Reveal

It cannot show how much brains differ between individual flies, or between males and females, or how a brain changes with age and experience. For that, scientists need maps from more animals and experiments on living flies. One careful map is a reference, not the final word.

Please sign in to continue.

Questions people ask

Why a fruit fly and not a mouse?

A fly brain is small enough to map completely with today's tools, yet the fly does many complex things. A mouse brain has far more neurons, so a complete map of it is a much bigger job.

Did AI do all the work?

No. AI did most of the first tracing, which would have taken people far too long by hand. But humans proofread the results and fixed many errors. The map needed both.

Is the map perfect?

No map of this size is perfect. Some small errors remain, and some kinds of connections are hard to see in the images. The team shared the data openly so that others can check it and improve it.

Can I use the data for a school or college project?

Yes, the data is openly browsable online. Check the site's current terms for how to use and credit it.

Lesson test

5 questions. Get 3 right (60%) to pass and complete this lesson.

Sign in to take the test and save your progress