r/Simulated • • 6d ago

Interactive Simulated a C. elegans connectome with 302 neurons & serotonin foraging dynamics to run in real-time on a smartwatch.

497 Upvotes

63 comments sorted by

188

u/Cognitive_Spoon 6d ago

I'm just a tomagachi running on an alien fridge, aren't I?

39

u/UselessRutabaga 6d ago

If that’s all I am whoever owns my fridge needs to step it up

21

u/bodyaz 5d ago

At least my worm gets free virtual bacteria every few seconds, we are not

5

u/scoshi Blender 5d ago

There's a folk song line in there:

"Oh, I'm just a Tomagachi on the Smart (Watch|Fridge) of life..."

One Prairie Home Companion had a song on it "I'm just a bug on the windshield of life", and that melody has stuck in my head since.

2

u/bodyaz 5d ago

Haha I love this!

in this thread, u/Skeletorfw actually shared a link to research showing C. elegans has sound/vibration sensitivity through body-wall transducers... so if you sing this folk song loud enough, the worm might actually feel/hear you through the watch glass

1

u/2Terrapin 5d ago

I really miss A Prairie Home Companion, especially after it Chris Thile took it over. I got to go to a taping once when the show came to LA and it was extraordinary. I wish they’d bring it back. It deserves another run, it’s a classic piece of uniquely American art.

4

u/bodyaz 5d ago

I still have to guess if the fridge door is open or closed!?

62

u/risbia 5d ago

Black Mirror horror

Also it's pretty cute how he's eating the numbers

34

u/bodyaz 5d ago

I just hope it won't end up as Black Mirror S1E1..

The dots in the numbers are actually virtual bacteria (the standard C. elegans diet). They spread a virtual scent gradient on the screen, which gets projected straight to the chemotaxis neurons as a "smell field potential".

A neurochemistry module monitors hunger levels and regulates neurotransmitters/neuromodulators, which activate or suppress specific behaviors, by changing impulses decay and trashholder. So when serotonin drops, the worm goes full hunting mode!

6

u/Phytor 5d ago

Black Mirror S1E1

Just don't start programming a pig and you should be fine

11

u/Skeletorfw 5d ago edited 5d ago

Weirdly we can say for certain that it's not a male! The males have one many* more neurons so this must be a hermaphrodite

17

u/bodyaz 5d ago

Haha absolute truth, man!
Males actually have 385 neurons because they need all that extra neural hardware for f*cking around!

I actually thought about adding a male option since the dataset is available, but Garmin heap memory can barely handle one connectome. So even if I code him in, he’s gonna be so lonely on that wrist with no one to pair with!

So yep, officially running a self-sufficient, single-mom worm in a Petri dish on my watch

5

u/Skeletorfw 5d ago

Oh that's so fun! My undergraduate dissertation was an audiosensitivity in c elegans so I had to get very much into the connectome (admittedly like 11 years ago now).

It would be cool to chuck in touch sensitivity as it's pretty well characterised, though I'd need to go back over my old work to remember exactly which neurons are responsible for it.

5

u/bodyaz 5d ago

Wait, audio sensitivity in C. elegans?! That's awesome! Definitely going down a rabbit hole researching that tonight...

I actually come from a traditional IT/dev background, so neural modeling is still pretty fresh and mind-blowing for me.

For the nose tap, I’m directly targeting the ASH nociceptive/sensory pair. Literally pushing this snippet into the engine right now:

engine.injectInput(Neural.ConnectomeData.N_ASHL, tapSignal + randShift, false);
engine.injectInput(Neural.ConnectomeData.N_ASHR, tapSignal - randShift, false);

If you ever dig up your old dissertation notes and remember any cool pathways to map, feel free to toss ideas my way!

5

u/Skeletorfw 5d ago

Yeah there wasn't much research at the time, but people have since gone much harder on the subject. Amusingly it seems like the theoretical mechanism I proposed for audiosensitivity (that the body wall was acting as a tympanum and the proprioceptors going down the wall acting as transducers, similar to a lacewing ear) was correct as there are some papers that took it further!

This research paper was based off my original study, though it seems like I got some of the analysis backwards when I was an undergrad lol: https://journals.biologists.com/jeb/article/221/15/jeb178947/383/Vibration-sensitivity-found-in-Caenorhabditis

I'll definitely keep an eye on this project as you continue to work on it. Is there any way you can release it for others?

3

u/bodyaz 5d ago

That is mind-blowing! Wow respect for digging that deep into C. elegans, I know roundworm has light sensors, but audiosensitivity and body-wall transducers! Going to your paper is an awesome read!

just wrapped up a fresh update!

  • Nose Tap Interaction: As everyone requested, you can now physically tap the touchscreen right in front of its head to trigger its ASH sensory neurons and watch the immediate reversal reflex (not perfect sometimes)!
  • Worm Vitals: Added a real-time neurochemistry monitor right on the display showing key neurotransmitters and modulators:
    • h: Hunger
    • d: Dopamine
    • s: Serotonin
    • o: Octopamine
    • p: FLP-11 peptide

You can grab and download it for Garmin devices on the Connect IQ store here:https://apps.garmin.com/apps/345890da-a9d1-43d4-9c6f-8bc35ee9b19f

Would love to know what you think once you try it out

20

u/SanoKei 6d ago

that is such a wonderful idea

7

u/bodyaz 5d ago

Thanks! Still a lot to do though, need to map more neurons to the actual watch environment/sensors. When it's fully connected, the result should be sick!

2

u/SanoKei 5d ago

I would love to see that!

3

u/bodyaz 5d ago

Thank you! It's already live!

You can download on the Connect IQ store: https://apps.garmin.com/apps/345890da-a9d1-43d4-9c6f-8bc35ee9b19f

Just pushed a fresh update today with nose taps and the real-time neurochemistry HUD, so you can see all its internal states right on the wrist. Give it a try and let me know what you think

10

u/Skeletorfw 5d ago edited 5d ago

Oh you chose a hermaphrodite to simulate! Would be interesting also giving the option to use the male connectome (a few more neurons).

Also you could probably make it relatively easy to interact with the nose touch sensors by touching the screen. If you did you'd probably be able to get it to do the hard-touch behaviour (reversing about 2 body lengths when poked on the nose).

I would totally have this on my watch with some more interactivity lol.

7

u/bodyaz 5d ago

yeah, my initial dream was to build a whole colony, at least Mom + the f*cker

385 neurons (83 more!), not just one extra! Most of those are crammed into the tail specifically for mating. Garmin RAM would literally cry trying to run both at once. Plus, a lone male on a watch with zero females (whatever how we can name it, at least it has a vulva) around would just be depressing...

About nose touch you know it! Touch sensors (mechanoreceptors) are actually already mapped in the code. Right now they guard the screen borders. If it hits the edge, a nose hook fires to turn it around. Without that safeguard, the worm would escape into virtual infinity within minutes and never come back

Next step for touch models: tapping right near its head will fire the avoidance reflex for an immediate reversal. You'll literally be able to poke the little guy on your wrist and watch it back off in real-time!

3

u/Skeletorfw 5d ago

I live for this all! Out of interest did you hook up all the mec receptors or just the TRN ones? They'll all be in the connectome of course, but only the TRNs are needed for navigation iirc

3

u/bodyaz 5d ago

For screen borders I map FLPL / FLPR, plus randomly picking between SMDDL, SMDDR, SMDVL, SMDVR, URYVL, and URYVR. And like I mentioned, ASH gets injected for the hard nose taps.

Honestly, I'm still not 100% sure I'm doing it all properly since neural modeling is new to me!

If you have suggestions, I’d love to hear them! Will definitely re-check my mapping index tonight to see if I missed any key pathways

8

u/TalkingRaccoon 5d ago

A what?

10

u/bodyaz 5d ago

a tiny, real microscopic worm brain living inside my watch, literally 302 simulated neurons reacting to touch, getting hungry, and hunting virtual bacteria on the screen 

8

u/aitonft 5d ago

302 neurons and the little thing still made it onto a smartwatch. This is a wonderfully overqualified watch face.

3

u/bodyaz 5d ago

Haha "overqualified" is not watchface, it's all about this amazing worm

Why settle for a boring step counter when you can have a biological existential crisis right on your wrist?

6

u/radarsat1 5d ago

devs

3

u/bodyaz 5d ago

human peak civilization right here...probably

6

u/Mechaninerd 5d ago

I wonder if we're all just living in some guys watch

2

u/bodyaz 5d ago

Don't touch your nose just in case, or you might trigger a sensory reversal reflex...

3

u/very_large_bird 5d ago

Something about a project that’s way too impressive for what it is. Love this!

2

u/bodyaz 5d ago

Haha, thank you so much! That is honestly the best compliment!

Back in my first year at university, I actually built a worm farm simulation on an old USSR 8-bit computer that was incompatible with pretty much everything. Obviously, it had no neural network back then just a simplified 'genetic' competition between worm species. So squeezing a full biological connectome onto a smartwatch face years later is definitely over-engineered, but that’s half the fun
why I am doing simulated worms all the time...hm

11

u/Unique_Suit3789 6d ago

torturing a digital being on my wrist! Is pretty cool but also definitely very strange

14

u/Voelkar 5d ago

Relax, thats like saying running any program is torture for the code. It is still not artifical intelligence, not conscious and definitely doesnt feel pain or emotions

6

u/bodyaz 5d ago

I feel pretty weird about it myself, but it's also ridiculously cool!

So ... technically, every time he (she? they? ze? xe?) bumps his nose on my screen border, he is running an exact biological signal of "get me outta here!"

Which actually opens up a deep question - where is the line where simple code execution starts turning into emergent self-awareness and actual suffering? Biology is a simple physics and chemistry, chemistry is a simple physics for sure, quantum actions based on four (+-1) forces, pretty simple, mathematics ... better to avoid dive so deep into this topic )
but definitely we have a conscious

5

u/Voelkar 5d ago

Ehhhh not quite. Biological signals are just processing loops, a reflex simulation doesn't mean awareness. Simulating a neuron's signal is like simulating gravity in a physics engine: the computer model calculates the math, but the watch doesn't actually get heavy. So no, there is no consciousness here

2

u/bodyaz 5d ago

Fair enough, mathematically it’s just matrix multiplication and lookup tables - my watch isn't gaining weight from gravity simulations either!

But just to play devil's advocate for a second: where does the magic number start? If 302 neurons isn't consciousness, is it 302^2? 2^302?

Our human consciousness runs on roughly 8.6×10^10 neurons. Though looking at world politics lately, it definitely feels like some elected presidents are operating on significantly fewer than that! 

3

u/Siegecow 5d ago

>But just to play devil's advocate for a second: where does the magic number start? If 302 neurons isn't consciousness, is it 302^2? 2^302?

It doesn't start. No increase of simulated watch gravity will ever make your real watch heavier.

You can quantify and simulate every aspect of the physical/biological function of an animal bladder but it will never produce real urine. You cant quantify an inherently qualitative experience.

1

u/bodyaz 5d ago

If this watch face ever produces real worm urine, I think Garmin's RAM optimization will be the least of my concerns...

This is literally Chinese Room argument in a nutshell.

Obviously a simulated bladder won't produce real urine. If the main metric of success is liters of urine, a real cow definitely wins over any Chinese Room - unless someone actually manages to drag the cow into the room with them

2

u/moistiest_dangles 5d ago

Yeah but consciousness isn't gravity. At some point we will certainly be able to simulate a human brain, and doing so without ethical considerations will 100% lead to unimaginable horrors.

1

u/Voelkar 5d ago

One day, yes, but not today. I was making an analogy, obviously it wont be the same 😅

2

u/costinmatei98 5d ago

That is cool and cute, but I feel like battery life goes from 2 days to 6 hours...

9

u/bodyaz 5d ago

I honestly can't even remember the last time I plugged in the watch charger, but I initialized the worm on Sept 25th (4 days ago) and I'm still sitting at 44%. So looks like having a biological brain inside actually IMPROVES battery life, or he found another power source in there

Jokes aside - nah, it really doesn't kill it. Obviously it consumes a tiny bit more than a completely dead screen showing just static numbers, but because all physics and neural loops are pure algebra almost without heavy trig, the CPU is not busy 100%.

3

u/costinmatei98 5d ago

Oh that's awesome then! Great job on not slop-coding it (ai or not). I have had so many "simple" watch faces completely killing my battery for no reason that I'm always skeptical when something cool like this comes out. Seriously impressive!

4

u/bodyaz 5d ago

Thankyou! It is motivate me so much, I am doing unusual watch faces, love to wear on my wrist a piece of human beans achievements science or technology
if you love staff like it: I did Game Of Life and small Go (6x6 - corners for round screen) playable watchface (your opponent is BNN directly on your wrist, but honestly it still play like a shit)

2

u/xtoc1981 5d ago

question is this something we can install ourself ?

4

u/bodyaz 5d ago

Yep!
It's live on the Connect IQ store: https://apps.garmin.com/en-US/apps/345890da-a9d1-43d4-9c6f-8bc35ee9b19f

Give it a try and let me know your thoughts on how else we could map these 302 neurons to everyday watch contexts/sensors to make it even more interactive

Also, if you're on a touchscreen Garmin, give it a couple of hours, I'm pushing an update very soon with a nose/head tap feature for direct touch interaction!

2

u/xtoc1981 5d ago

Damn, i've an amazfit watch, though it was some opensource thing :) I would port it over. But np, i'll try it some day. Thanks and nice of those who own a garmin for sure

1

u/bodyaz 5d ago

Thanks man! Appreciate the support!

Garmin's Monkey C and severe memory limits forced me to write everything from scratch, but the core engine logic itself is pretty portable! Who knows, maybe once the C. elegans connectome engine matures a bit more, I’ll open-source the core math/engine so people can port it to Amazfit, Wear OS, and other platforms.

Hope you get to try it out on a Garmin someday

2

u/divinorwieldor 5d ago

Augh, it’s not compatible with the fenix 6 (but it does accept fenix 6X damn). I was so excited to give it a try ;-;

I’ve never had the time to tinker with garmin apps. Is the device compatibility decided by garmin or something you set?

2

u/bodyaz 5d ago

Thanks for the interest! And sorry for the disappointment with the fenix 6!

To answer your question: Device compatibility is set by the developer, but it’s completely constrained by Garmin’s strict hardware limits.

As an indie dev, I only own my personal watch and occasionally ask friends to test on other models. According to the Garmin SDK docs and simulator, in the fenix 6 family, only the 6X model provides over 120 KB of RAM for Watch Faces - the others phenix 6 and 6S are less
More over I have added nose tap functionality and worm vital monitor and...now it is too big even for 6X (((

That said, I’m still actively optimizing memory and have a couple of ideas to squeeze the C. elegans engine down even further. My goal is to eventually fit the little guy onto the standard fenix 6 as well! Stay tuned

1

u/taplife-dev 2d ago

install the worm

2

u/FUCKING_HATE_REDDIT 5d ago

/u/mrsluds your old teacher would be so happy :')

2

u/bodyaz 5d ago

Oh yes! Many thanks to my school computer science teacher
Actually I did a first worms farm on my first year in university, of course it was not NN based on 8-bit ussr computer

2

u/Bebealex 5d ago

Un curious, would it be possible to have the same thing as a wallpaper for desktop, a standalone app or even in browser?

Any way to just "let it do it's thing" in the background I should say. It's soothing :-)

2

u/bodyaz 5d ago

Totally! Technically, it's 100% possible.

If a tiny 302-neuron biological engine can run on a low-power smartwatch with barely any RAM, running it on a modern laptop or web browser is a piece of cake performance-wise.

The connectome math is completely platform-agnostic, so someone could easily wrap this logic into a WebGL canvas or desktop live wallpaper. It really does have that relaxing bio-aquarium feel when it's just doing its thing

2

u/cheshsky 4d ago

Amazing that you can just make that happen on a watch these days.

1

u/bodyaz 4d ago

Thanks! I often catch myself thinking the exact same thing: it’s mind-blowing how much humanity had to invent: from boolean algebra and semiconductors to satellite networks and electron microscope just to allow this tiny 302 (311)-neuron creature to live inside a digital world on our wrists. Worth every bit of tech

1

u/GerardWayAndDMT 5d ago

You did what?

1

u/bodyaz 4d ago

Yup, you heard that right! I embedded a full biological simulation of the C. elegans roundworm right onto a Garmin watch.

All 311 (canonical 302 + some extra) neurons, synapses, muscle segments (actually not yet), and chemotaxis behavior - running in real-time, right on your wrist.

And since worm neurochemistry uses the exact same core neurotransmitters as we do (serotonin, dopamine, GABA...), I'm actually planning a future update with a special button to introduce a little cosmic molecule (mostly with 3 letters abbreviation) into her virtual petri dish. Just to see how her neural network reacts to a proper transcendental trip!