A simulated C. elegans with biophysically detailed neurons and muscle dynamics

We created an open-source model that simulates Caenorhabditis elegans in a closed-loop system, by integrating simulations of its brain, its physical body, and its environment. BAAIWorm replicated C. elegans locomotive behaviors, and synthetic perturbations of synaptic connections impacted neural control of movement and affected the embodied motor behavior.

The mission

In Caenorhabditis elegans, behaviors such as movement and foraging are driven by a coordinated, closed-loop interaction between its neural circuitry, muscular biomechanics, and real-time environmental feedback. Traditional models often isolate neural1 or physical components, missing the holistic brain–body–environment interactions that underpin complex behaviors2. Capturing this complexity in a biophysically detailed simulation remains challenging3, which highlights the need for fully integrative, closed-loop models that bridge neural networks, biomechanics and environmental feedback.

Our team — the Life Simulation Research Center at Beijing Academy of Artificial Intelligence (BAAI) — aims to develop such closed-loop biophysically detailed models4 (‘life models’ that accurately simulate an organism’s complex behavioral repertoire from its neural, biomechanical and environmental interactions). We use a scalable, multi-level approach that includes a multi-compartmental neural modelling methodology, where gap junctions, synapses and neurons are simulated in intricate detail within entire neural networks to produce biophysically accurate neural dynamics. In this study, we set out to develop an open-source model — BAAIWorm — that simulates an embodied C. elegans in a closed-loop system.

The solution

We developed BAAIWorm (a brain–body–environment model) as an open-source modular system to provide a versatile platform for investigating fundamental mechanisms of neural control in embodied behavior. BAAIWorm consists of two sub-models based on experimental data: a biophysically detailed neural network simulating the entire 302-neuron C. elegans neural system, and a lifelike model of its physical body surrounded by a 3D environment (Fig. 1). Each neuron in the network is represented as a multi-compartment model, simulating structural and functional neuron segments (dendrites, soma, axons) to accurately replicate C. elegans's electrophysiological properties, including detailed synapse and gap junction functions based on experimental data (Fig. 1, top left). The body model incorporates 96 muscle actuators (based on C. elegans anatomy but modeled in four 24-cell quadrants for computational symmetry) within a 3D fluid environment, where surface-level forces simulate thrust and drag, optimizing computational efficiency while reflecting life-like fluid–body interactions. Continuous sensory inputs from the environment (a food concentration gradient) dynamically influence neural computations, which in turn drive muscle contractions, creating a closed-loop feedback system that aligns BAAIWorm’s behavior with environmental cues (Fig. 1).

Fig. 1: BAAIWorm is an embodied Caenorhabditis elegans simulation.

figure 1

BAAIWorm integrates a biophysically detailed neural network model with a biomechanical body and 3D environment in a closed loop system of sensory stimulation and muscle activation. The neural network connects neurons via biologically detailed synapses and gap junctions on neurites, optimized for realistic neural dynamics by iteratively adjusting model parameters (such as connection weights, synaptic delay) to match observed electrophysiological properties in C. elegans. The body model, composed of 3,341 tetrahedrons (as the basic modeling element for the body structure) and 96 muscles, interacts with the 3D environment for real-time locomotion simulation. © 2024, Zhao, M. et al., CC BY-NC-ND 4.0.

Full size image

On the ‘eVolution’ platform we created, we used an ‘electronic-evolution’ approach to iteratively adjust model parameters to gradually improve behavioral alignment accuracy and ensure high biological plausibility. Indeed, BAAIWorm accurately simulated characteristic C. elegans behaviors such as zigzag locomotion, thereby validating its capacity to model brain–body–environment interactions that link neural activity to embodied behavior. To provide causal insights, we conducted synthetic perturbations by either altering synaptic and gap junction structural properties at specific locations or by altering connection weights across the C. elegans neural network, and then analyzed effects on movement patterns. Perturbation of BAAIWorm network organization, via either local or network-wide structural features, causally influenced coordinated movement outputs, which should inform in vivo exploration of how C. elegans’s network organization underpins its behavior.

The implications

We have advanced whole-organism simulation with BAAIWorm, designed for high biological plausibility and computational efficiency to explore embodied intelligence. The eVolution platform is adaptable to other organisms and offers this electronic-evolution capability to fine-tune model parameters until accurate behaviors are achieved in a broad range of biophysically detailed and embodied AI models inspired by neural dynamics5.

BAAIWorm currently includes simplified sensory inputs and essential model simplifications. Future enhancements are needed to accurately simulate more complex sensory responses and behaviors to expand its utility across more diverse experimental contexts. In its simulation of C. elegans’s well-mapped neural network and well-defined behaviors, BAAIWorm achieved biological plausibility within a closed-loop system to meet the challenge of ‘whole’ organism simulation.

As an early project of the Digital Life Initiative, BAAIWorm’s future development will incorporate additional C. elegans connectome and behavioral data based on this data-driven approach.

Lei Ma & Tiejun Huang, Beijing Academy of Artificial Intelligence, Beijing, China

Expert opinion

“This manuscript describes an impressive body of work to consolidate information on the physiology and anatomy of C. elegans into a computational model that links neuronal activity and interactions with the body and environment. Several advancements are presented at different scales, and the various developments fit together into a coherent picture. It complements other initiatives in the community to database experimental knowledge related to C. elegans and create data-driven simulations of the worm”. Padraig Gleeson, University College London, London, UK.

Behind the paper

Artificial general intelligence research today follows three main pathways: data-driven artificial neural network (ANN) models (OpenAI’s GPT series), reinforcement learning on ANNs (DeepMind’s DQN), and spiking neural network models or so-called brain-like approaches grounded in the ‘structure determines function’ principle. This third pathway, taken by the Life Simulation Research Center at BAAI, focuses on replicating neural structures and functions to deepen our understanding of intelligence.

Our model employs multi-compartment biophysical models to closely simulate the neural system, incorporating shared neuroanatomical data. We also utilize data-driven techniques (such as electrophysiological fitting) and reinforcement learning methods (behavioral imitation) to enhance model realism. Besides BAAIWorm, BAAI is also developing OpenComplex (an open-source protein or RNA modeling platform) and BAAIHeart (subcellular heart modeling). Looking ahead, we plan to extend this methodology beyond C. elegans, constructing digital twins of other model animals, to explore intelligence across biological scales. L.M. & T.H.

From the editor

“This work from Lei Ma and colleagues stood out to me because they develop an integrative model of C. elegans that combines the detailed simulation of neural networks with a biophysically realistic body and environmental interactions. The interplay of dynamic body–environment interactions and intricate simulations makes it possible to investigate how brain activity affects behavior in a closed-loop system.” Ananya Rastogi, Senior Editor, Nature Computational Science.

Home    新闻    A simulated C. elegans with biophysically detailed neurons and muscle dynamics