Code repository for paper submitted to the NeurIPS 2026 Workshop on Foundation Models for the Brain and Body.
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_classificationFrom virtual environment with python==3.12:
pip install -r requirements.txtor using conda:
conda create --name emg-fm-bench python==3.12
conda activate emg-fm-bench
pip install -r requirements.txtTo freeze:
pip list --format=freeze > requirements.txtAll 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_dataAlternatively, the location of the original and converted datasets can be specified as command line arguments.
--dataset_dir: The directory that the dataset is saved, or the directory to download to if--download_datais 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)
python -m scripts.download_checkpointspython -m scripts.main +experiment=gesture_classificationpython -m torch.distributed.run --nproc_per_node=4 -m scripts.main +experiment=gesture_classificationThis repository is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.
- 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).
@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}
}