Brains and AIMiddleLesson 2975 min read

Simulating a brain from its wiring

Researchers built a computer model of the whole fly brain from the FlyWire map. It predicted which neurons drive behaviours such as feeding, and experiments confirmed some predictions.

Lesson in motion

In 60 seconds

Simulating a brain from its wiring

Researchers built a computer model of the whole fly brain from the FlyWire map. It predicted which neurons drive behaviours such as feeding, and experiments confirmed some…

1/5
In simple words
Think of dominoes set up on a floor. If you know exactly where every domino stands, you can guess which ones will fall when you push the first one. A brain model works a bit like this. Scientists know where every "domino" (neuron) is and which ones touch. They "push" the taste neurons in the computer and watch which neurons fall next.
Once the fly's wiring map existed, researchers asked a bold question: if we copy the wiring into a computer, can the model tell us something true about the real fly?
In 2024, researchers built a computational model of the whole fly brain from the FlyWire wiring. Each neuron in the model was a simple spiking neuron: it adds up its inputs and fires a spike when its voltage crosses a threshold (you will build one in lesson 5). The connections and their strengths came from the map.

How the model was used

  1. 1

    Copy the wiring

    Every neuron and connection from the map goes into the model.
  2. 2

    Choose a simple neuron model

    Each neuron gets the same simple rule for adding inputs and firing.
  3. 3

    Stimulate

    Switch on a group of sensory neurons in the computer, for example neurons that sense sugar.
  4. 4

    Watch

    See which other neurons become active, including neurons linked to a behaviour such as feeding.
  5. 5

    Test in real flies

    Experiments check whether the predicted neurons really matter for that behaviour.
The model predicted which neurons drive behaviours such as feeding. Some of these predictions were then confirmed in experiments with real flies. This is exciting because the model was built mainly from wiring, not from recordings of activity.

Excite or inhibit?

A wiring map says who connects to whom. A working model also needs to know if each connection excites the next neuron (makes it more likely to fire) or inhibits it (makes it less likely). Inhibition is very important: it lets the brain choose one action and block another.
Python: activity spreading through a made-up networkpython
import numpy as np

# MADE-UP network of 4 neurons. W[i, j] = weight from neuron i to j.
names = ["sugar", "relay", "block", "feed"]
W = np.array([
    [0, 1.2, 0,   0  ],   # sugar excites relay
    [0, 0,   0,   1.1],   # relay excites feed
    [0, 0,   0,  -2.0],   # block inhibits feed
    [0, 0,   0,   0  ],
])
x = np.array([1.0, 0, 0, 0])      # switch on "sugar"
for t in range(3):
    x = np.maximum(x, (x @ W >= 1.0).astype(float))
    print("step", t + 1, [n for n, a in zip(names, x) if a])
Try setting the "block" neuron to 1 at the start as well. The "feed" neuron then never switches on, because inhibition cancels the excitation.

Why this matters

What the model does not do
  • Copy every detail of real neurons
  • Learn or change with experience
  • Replace experiments on real flies
  • Prove that every prediction is right
What the model does well
  • Turn a huge map into testable predictions
  • Suggest which few neurons to test among thousands
  • Save time and effort in the lab
  • Show that wiring alone carries a lot of information
Watch out
Be careful with headlines. A model that matches some experiments is not a "digital fly" that thinks. Scientists describe exactly what was predicted and what was confirmed, and so should we.
Think about it. The model uses the same simple rule for every neuron, yet some of its predictions held up. What does that suggest about how much the wiring itself matters?

Watch and read more

Lab

A step rule that spreads activity through a made-up network, and a comparison of what happens when you stimulate sugar or water neurons.

~25 min

The problem

This runs in your browser. The network is made up, and much simpler than the real model.

  1. Run the starter. It defines a small network with a weight matrix W. Negative weights inhibit.
  2. Finish step(x): given a vector x of 0s and 1s (which neurons are active), return a new 0/1 vector where a neuron is active if its total input x @ W is at least THRESHOLD.
  3. Run it. run() keeps the stimulated neuron switched on and records every neuron that becomes active.
  4. Compare sugar_reached and water_reached. Does feed_motor switch on in each case? Which neuron explains the difference?

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.

Q1Change W[4, 5] from -1.0 to -0.1. What happens when you stimulate water_in, and what does that teach about wiring maps?Reveal

feed_motor gets 0.6 from inter_B and loses only 0.1 from inhib_C, so its input is 0.5, still below the threshold of 1.0, and it stays off. But if water also excited inter_A, the weak inhibition could no longer block feeding. The same wiring, with different strengths, can behave differently. A map that shows only who connects to whom is not enough; strengths and signs matter too.

Q2This toy model updates all neurons in fixed steps and uses 0/1 activity. Name two ways the real whole-brain model is richer.Reveal

The real model used spiking neurons whose voltage builds up over time and leaks away, so timing and the rate of spikes matter. It also used connection strengths taken from synapse counts across about 140,000 neurons, not a hand-made handful. Even so, it was still a simplification of real neurons.

Please sign in to continue.

Questions people ask

Is this a full simulation of a fly's mind?

No. It is a simplified model that uses the wiring and a simple rule for each neuron. It was used to predict specific things, and some predictions were confirmed. It does not capture everything a fly does or feels.

Why use simple neurons instead of very detailed ones?

Detailed models of every neuron would need many facts that nobody has measured yet, and far more computing. A simple model with the right wiring is easier to run, easier to understand, and its predictions can still be tested.

How do scientists test a prediction in a real fly?

In general, they use genetic tools to switch specific neurons on or off in living flies, and watch whether the behaviour changes. If switching on a predicted neuron makes the fly start a feeding action, that supports the prediction.

Could we do this for a human brain?

Not today. There is no complete map of a human brain at the level of single synapses, and it would be enormously larger than the fly's. Small brains are where these methods are being developed.

Lesson test

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

Sign in to take the test and save your progress