Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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:

@inproceedings{ozdil2026musculoskeletal,
  title={Musculoskeletal simulation of limb movement biomechanics in Drosophila melanogaster},
  author={Ozdil, Pembe Gizem and Ning, Chuanfang and Phelps, Jasper S and Wang-Chen, Sibo and Elisha, Guy and Ijspeert, Auke and Ramdya, Pavan},
  booktitle={The Fourteenth International Conference on Learning Representations},
  year={2026}
}

About

An imitation learning environment for musculoskeletal modeling of Drosophila melanogaster

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages