< all projects

marsfly

The FlyWire fruit fly connectome driving a simulated fly in MuJoCo, evolved to fly in thin Martian air.

status
Experiment
role
Builder
when
2026
kind
Research

Private code. Happy to walk through it on a call.

the TSPL2 that prints this label
SIZE 101.6 mm, 50.8 mm
GAP 3 mm, 0 mm
DIRECTION 1
CLS
TEXT 32,28,"4",0,1,1,"marsfly"
TEXT 32,92,"2",0,1,1,"Research"
TEXT 32,124,"2",0,1,1,"2026"
BARCODE 32,196,"128",120,0,0,1,2,"https://ansh.bhalala.org/projects/marsfly"
PRINT 1,1

marsfly started as a question I couldn't let go of: if you took a real insect brain and asked it to fly somewhere new, what would it have to learn?

How it works

  • The brain is the FlyWire connectome of the fruit fly: 138,639 neurons and about 15.1 million connections, mapped by the FlyWire project.
  • The body is flybody, a fruit fly model for the MuJoCo physics engine.
  • The connectome drives the body, and an evolutionary loop tunes it for flight in Martian air.

First results

  • A full-brain step runs in about 3.1 ms on my laptop's GPU.
  • The first experiment showed lift scaling with air density. At Martian density the fly gets about 4% of the lift-to-weight it has on Earth, so the interesting part is everything it would have to change to fly at all.

It's a side project and very much in progress. The connectome and the body model are other people's work; the experiment is mine.

Built with

  • Python
  • MuJoCo
  • flybody
  • FlyWire connectome