Skip to content

gizemozd/FlyMimic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlyMimic 🪰

License: Apache-2.0 Python 3.10+ Issues



FlyMimic is the codebase for the imitation learning experiments in the paper:

Musculoskeletal simulation of limb movement biomechanics in Drosophila melanogaster

This repository hosts:

  • Musculoskeletal model of the fly legs with different joint passive properties
  • Motion capture data of fly walking behavior
  • RL tasks compatible with dm_control
  • Imitation learning training with PPO Stable Baselines3

Note

This repository focuses on imitation learning experiments and provides MuJoCo models converted from OpenSim. For the original muscle model development and parameter optimization in OpenSim, please refer to this repository.


Installation

To install flymimic, clone the repository:

git clone https://github.com/gizemozd/FlyMimic.git
cd FlyMimic

Then, create a virtual environment, and install the required dependencies:

conda create -n flymimic python=3.10
conda activate flymimic
pip install -e .

(Optional) To install the optional dependencies for visualization, run:

pip install -e ".[viz]"

To install the development dependencies, run:

pip install -e ".[dev]"

Quick Start

# Train a model
python scripts/train_muscle.py

# Evaluate the trained model
python scripts/eval_rollout.py

Training

To train a model with a custom configuration:

python scripts/train_muscle.py --config-name=train_arm

Evaluation

To evaluate a trained model:

python scripts/eval_rollout.py model_path=./logs/demo_model.zip

Note

You can download the other trained models from here.

Repository Structure

FlyMimic/
├── flymimic/
│   ├── assets/          # MuJoCo models and motion capture data
│   ├── config/          # Hydra configuration files
│   ├── env/             # Wrappers for dm_control
│   ├── evaluation/      # Evaluation tools
│   ├── tasks/           # RL environment tasks
│   ├── train/           # Training modules
│   └── utils/           # Utility functions
├── scripts/             # Training and evaluation scripts
└── logs/               # Training outputs and saved models

Citation

If you use flymimic in your research, please cite our paper:

@misc{ozdil2025musculofly,
      title={Musculoskeletal simulation of limb movement biomechanics in Drosophila melanogaster},
      author={Pembe Gizem Özdil and Chuanfang Ning and Jasper S. Phelps and Sibo Wang-Chen and Guy Elisha and Alexander Blanke and Auke Ijspeert and Pavan Ramdya},
      year={2025},
      eprint={2509.06426},
      archivePrefix={arXiv},
      primaryClass={q-bio.NC},
      url={https://arxiv.org/abs/2509.06426},
}

About

An imitation learning environment for musculoskeletal modeling of Drosophila melanogaster

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published