Skip to content
Scott Yang
Research

MIMIC-MJX

Emulating behavior to understand the brain

Neuromechanical emulation of animal behavior — massively parallel imitation learning in MuJoCo-MJX.

Talmo Lab · JAX · MuJoCo · pose-estimation · imitation-learning · biomechanics

Rendered body models of a hooded rat, a fruit fly, a stick insect, a translucent green C. elegans worm and a mouse forelimb with red muscles, posed on a blue checkered arena against black.
The five MIMIC-MJX body models, each posed from a frame of real motion.

Why study the whole loop?

How we picture behavior decides what we measure. Here are three pictures, each adding to the last.

1 of 3

Behavior as choices

The classic experiment treats behavior as a decision. A stimulus is shown, the animal reports a choice, and the brain is whatever links the two.

Brain central nervous system stimulus choice

2 of 3

Behavior as a feedforward process

Movement adds a chain. The brain sends motor commands to the body, the body exerts forces on the world, and we record what comes out at either end: neural activity at the top, movement at the bottom.

Brain central nervous system Body musculoskeletal system World external environment motor command force stimulus neural activity kinematics

3 of 3

Behavior as a sensorimotor loop

The chain is really a loop. The body reports back through proprioception, the world pushes back on the body, and what the animal senses next depends on what it just did. We can record the readouts, but the signals inside the loop stay largely hidden in a freely moving animal.

Brain central nervous system Body musculoskeletal system World external environment motor command force feedback proprioception stimulus neural activity muscle activations kinematics

Behavior has long been studied by opening this loop and looking at one piece at a time. It is time to close the loop and study it as a whole.

The approach: a digital twin

A digital twin closes the loop in simulation: a model brain, a model body and a model world, running together, in which every signal can be observed. That makes it possible to run virtual experiments that would be out of reach in a freely moving animal.

A twin is only useful if it matches the animal. That match spans several levels (brain, body, physics and behavior), and a virtual animal should align with the real one at most of them, depending on the question being asked.

MIMIC-MJX is a framework for building digital twins that learn the neural computations required to imitate the body language of real animals. Deep neural networks are trained to work like the brain: they observe what a biological movement looks like, and are rewarded for producing the control signals that drive a biomechanical body, through physics simulation, to move the way the real animal did.

Building on work from Google DeepMind and our collaborators at Harvard, we generalized the approach to work with any body model, adapted it to GPU-accelerated physics simulators, and validated it across behaviors, species and levels of biomechanical fidelity.

There is early evidence that modeling the loop brings us closer to the brain. In a virtual rat trained to imitate real rats, the activity of the network that produced the behavior predicted neural activity in the striatum better than any feature of the animal’s movement (Aldarondo et al., Nature, 2024).

The pipeline

MIMIC-MJX has two stages, each an open-source tool built on GPU-accelerated physics simulation.

Three panels joined by two arrows. First, 3D markerless motion capture of a rat. An arrow labelled stac-mjx leads to joint positions and angles of a biomechanical model. An arrow labelled track-mjx leads to a neural network controlling the biomechanical model.
From motion capture to a neural controller: stac-mjx registers the body model to the data, and track-mjx trains a network to drive it.
  1. STAC-MJX fits a body model to motion capture data. It is inverse kinematics on the GPU: markerless motion tracking goes in, and the pose of a physical body model comes out.
  2. track-mjx trains the control policies that imitate those movements, through motion imitation with deep reinforcement learning.
A rat, a fruit fly, a mouse forelimb, a worm and a stick insect, each beside its biomechanical model.

Together they cover rodent, fruit fly, mouse arm, stick insect and worm models. Controllers trained this way are also a starting point for task-driven behavior, through transfer learning from kinematic replay.

Why biomechanics matter

In a companion study, we trained neural control models to reproduce the movements of mice performing a dexterous reaching task. Models that controlled muscle-based actuators predicted recorded muscle activity better than models with less biologically realistic torque actuators: evidence that detailed biomechanics matter when modeling sensorimotor control (Leonardis et al., NeurIPS Workshop 2025).

Publication

MIMIC-MJX: Neuromechanical Emulation of Animal Behavior C. Y. Zhang*, Y. Yang*, A. Sirbu*, et al. Nature Methods (accepted in principle). * Equal contribution.

Code and data

Media on this page: Talmo Lab, from the MIMIC-MJX paper.