Skip to content

About

Benchmarking framework for sEMG foundation models

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

Do sEMG Foundation Models Improve Cross-Subject Generalisation?

Code repository for paper submitted to the NeurIPS 2026 Workshop on Foundation Models for the Brain and Body.

Workshop

TL;DR

python -m venv emg-fm-bench
source emg-fm-bench/bin/activate

pip install --upgrade pip
pip install -r requirements.txt

chmod 755 setup.sh 
./setup.sh
python -m scripts.main +experiment=gesture_classification

Evironment setup

From virtual environment with python==3.12:

pip install -r requirements.txt

or using conda:

conda create --name emg-fm-bench python==3.12
conda activate emg-fm-bench
pip install -r requirements.txt

To freeze:

pip list --format=freeze > requirements.txt

Data Setup

All datasets are (optionally) downloaded and converted to a standardised HDF5 format. The HDF5_ROOT environment variable can optionally be used to define the location where datasets will be stored.

# Set the dataset root
export HDF5_ROOT="./data"
# Download and convert datasets:

# NinaPro DB5
python -m scripts.datasets.ninapro_db5 --download_data --segment_gestures

# EPN-612
python -m scripts.datasets.epn612 --download_data --segment_gestures

# UCI-EMG
python -m scripts.datasets.uci_emg --download_data

Alternatively, the location of the original and converted datasets can be specified as command line arguments.

Command line arguments:

  • --dataset_dir: The directory that the dataset is saved, or the directory to download to if --download_data is present
  • --download_data: if present, original dataset is downloaded and saved to either dataset_dir, or ${HDF_ROOT} / <dataset_name> if --dataset_dir is not specified
  • --output_dir: Directory to store the converted .hdf5 dataset. If absent, defaults to dataset_dir
  • --segment_gestures: Flag to segment the original dataset by gesture label (NinaPro DB5 and EPN-612)
  • --include_rest: Whether to segment and include the rest period between gestures as a "no_gesture" labelled signal (Ninapro DB5 Only)

Download Pretrained Models

python -m scripts.download_checkpoints

Run Experiments

With Hyra

Single GPU

python -m scripts.main +experiment=gesture_classification

Multi-GPU

python -m torch.distributed.run   --nproc_per_node=4 -m scripts.main +experiment=gesture_classification

License & Acknowledgments

This repository is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.

Model & Data Attributions

  • NeuroRVQ: Code adapted from original implementation under CC BY-NC 4.0.
  • PhysioWave & TinyMyo: Implementations included/adapted under their original open-source licenses (MIT / Apache 2.0).
  • Datasets: Downloaded and processed via scripts under their respective licenses (e.g., NinaPro DB5, EPN-612, and UCI-EMG under CC BY 4.0).

Citation

@inproceedings{raftery2026semg,
  title={Do sEMG Foundation Models Improve Cross-Subject Generalisation?},
  author={Raftery, William and Farina, Dario},
  booktitle={NeurIPS 2026 Workshop on Foundation Models for the Brain and Body},
  year={2026}
}

About

Benchmarking framework for sEMG foundation models

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages