运行在 macOS 桌面上的 3D 果蝇,由真实的 FlyWire 连接组驱动。
A 3D fruit fly on macOS desktop powered by the real FlyWire connectome

原始链接: https://github.com/DenisSergeevitch/desktop-fly

该项目将一只 3D 果蝇带到了你的 macOS 桌面。它由基于真实的 FlyWire v783 连接组的 1kHz 实时“漏电积分放电”(leaky-integrate-and-fire)模拟驱动。 这只果蝇的行为并非脚本动画,而是由 668 个神经元和 19,000 个突触连接所决定,包括行走、梳理、睡眠和受惊逃跑。它能与桌面环境互动,将窗口边缘视为物理凸起,将光标移动视为迫在眉睫的威胁。当你移动鼠标时,果蝇的视觉神经元(LC4/LPLC2)会处理这些运动;如果巨型纤维“指令”神经元放电,果蝇会在约 4 毫秒内起飞,重现真实的生物反应。 该应用程序包含一个交互式“大脑窗口”,可显示 23,210 个真实的神经元胞体位置,允许用户“光遗传学”地刺激特定神经回路,以观察果蝇随后的行为反应。它轻量且无需特殊权限,利用 macOS 的空闲 API 来感知活动和昼夜节律。通过将真实的突触连接映射到程序化的身体力学,该工具为理解生物大脑如何控制运动提供了一个独特且具有科学依据的窗口。 本项目开源(MIT 协议),地址为:[https://github.com/DenisSergeevitch/desktop-fly](https://github.com/DenisSergeevitch/desktop-fly)。

Hacker News 正在讨论一个开源新项目:该项目基于 FlyWire 连接组数据,在 macOS 桌面上模拟了一只 3D 果蝇。 尽管许多用户认为该项目在技术上十分引人入胜,但讨论很快转向了关于其准确性和伦理问题的争论。批评者认为该项目具有误导性,因为它利用连接组数据触发脚本行为,而非模拟真正的生物神经处理过程。由于该连接组缺乏活体果蝇实际的突触权重,一些用户指出这只是对结构的模拟,而非对功能的模拟。 该项目还引发了关于模拟生命伦理的哲学讨论。参与者探讨了是否应对数字生物产生同理心,一些人将这种模拟比作“幽灵配音”或生物“只读存储器(ROM)”。其他评论者提供了历史背景,提到了像“Body Electric”这样的早期项目;与此同时,一些开发者表示有兴趣将代码移植到浏览器,或将其集成到 NeuroMechFly 等物理仿真框架中。总的来说,社区内部观点不一:一方将其视为数字生物学领域的突破,另一方则认为它仅是一种象征性的呈现,而非具备感知能力的现实。
相关文章

原文

DesktopFly — a 3D fruit fly

A 3D fruit fly that lives on your macOS desktop — driven by a live spiking simulation of the real FlyWire connectome. It walks across your windows, grooms, sleeps, and decides to flee your cursor with the same neurons a real fly uses.

Live brain window: 23,210 real neuron positions, spikes flashing

The fly's brain window: 23,210 real neuron soma positions from FlyWire v783, with live spikes flashing at real neuron locations. The two glowing yellow markers are the Giant Fibers — the escape command neurons. Click any region to stimulate it.

  • 23,210 neuron soma positions (of 139,255 in FlyWire v783) render the rotating brain window, colored by super-class (FlyWire's coarse cell-type grouping).
  • A 668-neuron circuit with ~19,000 real synaptic connections (synapse counts, signed by neurotransmitter prediction) runs as a 1 kHz leaky-integrate-and-fire (LIF) simulation:
    • LC4 (104) + LPLC2 (210) looming-detector visual neurons
    • DNp01 / Giant Fiber (GF) (2) — the escape command neuron
    • DNa01 + DNa02 (4) steering neurons · DNp09 (2) forward walking
    • DNg11 (6) grooming · MDN (4) backward walking ("moonwalker")
    • DNp02/DNp04/DNp11 (6) escape-maneuver (wing) neurons
    • their 330 strongest partners, including ascending (proprioceptive) and sensory (wind) neurons
  • Escape is not scripted. Your cursor's approach becomes looming input to the real LC4/LPLC2 cells; the fly takes off only when the Giant Fiber actually spikes through its real synapses — ~1,200 synapses of feedforward inhibition push back, which is why slow approaches are tolerated and fast lunges trigger escape in ~4 ms, just like the real animal.

The body itself is procedural (FlyWire is a brain connectome — no body geometry exists), with a tripod gait, visible wing-beat, altitude-scaled flight, grooming, and sleep postures.

Requirements: macOS 13+, Xcode Command Line Tools (Swift 5.9+). No permissions or entitlements needed — everything it senses (cursor, window frames, clicks-as-taps, thermal state) is permission-free.

git clone https://github.com/DenisSergeevitch/desktop-fly.git
cd desktop-fly
./build.sh
./DesktopFly

A 🪰 item appears in the menu bar; quit from there. The fly wanders your desktop on a transparent, click-through overlay — it never intercepts your mouse or keyboard.

item effect
Pause / Resume freeze the world
Show/Hide Brain toggle the live brain window
Escape Test (loom) inject a looming stimulus, watch the GF fire
Move to Next Display hop the fly across monitors (shown when >1 display)
Add / Remove Fly extra flies (only fly #1 carries the brain)
Scare Flies startle everyone

The brain window is interactive: hovering pauses the rotation; clicking a region "optogenetically" stimulates the ~60 nearest circuit neurons for 400 ms. The fly's reaction is whatever the real network does downstream — click the Giant Fiber and it escapes; click DNg11 and it grooms; click one side's DNa01/02 and it turns.

How real neurons drive the body

body behavior driven by
escape takeoff DNp01 giant fiber spike
walk vs. rest, walking speed DNp09 rate
steering DNa01+DNa02 left−right rate difference
grooming DNg11 rate
backward scoot MDN burst
nervous darting LC4/LPLC2 population rate
wing-beat effort, threat wing-raise DNp02/04/11 rate
spontaneous takeoff whole-population arousal

The loop also closes body→brain: the gait rhythm feeds the circuit's real ascending (proprioceptive) neurons in phase with the legs, and fast cursor motion stimulates its sensory (wind) partners.

Desktop ecology (all permission-free macOS senses)

  • Window terrain: window top edges are ledges — the fly lands on them, walks along them, rides a window you drag, and startles when one closes under its feet.
  • Window looms: a window appearing near the fly feeds the looming pathway; the circuit decides whether to flee your dialogs.
  • Clicks are substrate taps; clicking next to the fly startles it through the wind→GF pathway. Typing is vibration (idle-time API — knows when keys were pressed, never which).
  • Circadian rhythm: dawn/dusk activity peaks, midday siesta, night quiescence. Sleep: idle at night → it sleeps, breathing slowly, with raised arousal threshold; it grooms after waking.
  • Temperature: flies are ectotherms — a hot Mac is a faster fly.

data/ ships with compact derived files. To rebuild them from the raw FlyWire Codex dumps (~60 MB download):

mkdir -p /tmp/flywire && cd /tmp/flywire
B=https://storage.googleapis.com/flywire-data/codex/data/fafb/783
curl -O "$B/classification.csv.gz" -O "$B/coordinates.csv.gz" \
     -O "$B/connections.csv.gz" -O "$B/consolidated_cell_types.csv.gz"
cd - && python3 etl.py /tmp/flywire
./DesktopFly --simtest        # circuit invariants: GF silent at rest, 4 ms loom latency, ...
./DesktopFly --behaviortest   # 17 end-to-end checks: stimulate neurons -> body reacts
./DesktopFly --snapshot f.png  # offscreen fly render
./DesktopFly --brainshot b.png # offscreen brain render

What's modeled vs. measured

Honesty section: the connectome gives wiring, not physiology. The LIF dynamics, neurotransmitter signs (ACh+, GABA−, Glu−), the gap-junction boost on LC→GF and wind→GF (documented electrical coupling), synaptic delays, and the sensory transduction (cursor → looming value) are standard modeling choices layered on the real graph. Everything downstream of the sensory neurons — who connects to whom, and how strongly — is FlyWire data.

Code is MIT. The files in data/ are derived from FlyWire (FAFB v783) and are CC BY-NC 4.0 — see data/DATA_LICENSE.md. If you use this, cite:

联系我们 contact @ memedata.com