docs: update README to enhance model overview, configuration, and deployment details
808a02d unverified | license: cc-by-nd-4.0 | |
| language: | |
| - en | |
| tags: | |
| - emg | |
| - bio-signals | |
| - foundation-model | |
| base_model: | |
| - PulpBio/TinyMyo | |
| # TinyMyo: Tiny Foundation Model for EMG Signal Processing | |
| <div align="center"> | |
| <img src="https://raw.githubusercontent.com/MatteoFasulo/BioFoundation/refs/heads/TinyMyo/docs/model/logo/TinyMyo_logo.png" alt="TinyMyo Logo" width="400" /> | |
| </div> | |
| <p align="center"> | |
| <a href="https://github.com/pulp-bio/BioFoundation"><img src ="https://img.shields.io/github/stars/pulp-bio/BioFoundation?color=ccf" alt="Github"></a> | |
| <a href="https://creativecommons.org/licenses/by-nd/4.0/"><img src="https://img.shields.io/badge/License-CC_BY--ND_4.0-lightgrey.svg" alt="License"></a> | |
| <a href="https://arxiv.org/abs/2512.15729"><img src="https://img.shields.io/badge/arXiv-2512.15729-b31b1b.svg" alt="Paper"></a> | |
| </p> | |
| ## ๐ Overview | |
| **TinyMyo** is a lightweight, Transformer-based foundation model designed specifically for surface electromyography (sEMG) signal processing. Unlike large-scale models, the TinyMyo family (including the 3.6M parameter base model and the ultra-compact 1.9M parameter **TinyssimoMyo**) is purpose-built for **ultra-low-power edge deployment**. It enables real-time motor intent decoding, neuromuscular assessment, and human-machine interaction directly on microcontrollers like the GAP9. | |
| ## โ๏ธ Model Configuration | |
| * **Base model:** 8-layer bidirectional Transformer encoder. | |
| * **TinyssimoMyo:** 4-layer compact variant. | |
| * **Embedding dimension:** 192. | |
| * **Attention heads:** 3. | |
| * **Temporal patch size:** 20 samples. | |
| * **Default input:** 16 channels ร 1000 samples. | |
| * **Maximum channels:** 16. | |
| * **Tokenization:** Channel-independent patching with 50 temporal patches per channel and 800 tokens for the default input. | |
| * **Position encoding:** Rotary Position Embeddings (RoPE), with temporal positions reset for each channel. | |
| * **Training objective:** Self-supervised masked patch reconstruction. | |
| ## ๐ง Model Architecture | |
| TinyMyo uses channel-independent patch embeddings followed by a bidirectional | |
| Transformer encoder. Tokens are ordered channel-major, while RoPE positions reset | |
| for each channel so flattening does not introduce a false temporal distance between | |
| channels. The learned channel embedding identifies a channel slot; it does not | |
| encode physical electrode coordinates. | |
| For deployment, the family can be paired with offline liveness analysis, | |
| multi-level memory tiling, and INT8 fixed-point execution. See the paper and model | |
| card for deployment measurements. | |
| ## โก Deployment (GAP9 MCU) | |
| TinyMyo is designed for resource-constrained deployment on platforms such as the | |
| GAP9 MCU. The repository does not treat deployment measurements as model | |
| configuration; see the [paper](https://arxiv.org/abs/2512.15729) and the | |
| [Hugging Face model card](https://huggingface.co/PulpBio/TinyMyo) for current results. | |
| ### TinyMyo (3.6M Parameters) | |
| * 8-layer encoder configuration. | |
| ### TinyssimoMyo (1.9M Parameters) | |
| * 4-layer compact configuration. | |
| ## ๐ ๏ธ Getting Started | |
| TinyMyo is part of the [BioFoundation](https://github.com/pulp-bio/BioFoundation) ecosystem. | |
| ### Prerequisites | |
| Install the required dependencies from the [BioFoundation repository](https://github.com/pulp-bio/BioFoundation). | |
| ### Loading & Fine-tuning | |
| Fine-tune a pretrained checkpoint using the BioFoundation training entry point: | |
| ```bash | |
| python run_train.py +experiment=TinyMyo_finetune pretrained_safetensors_path={*.safetensors} | |
| ``` | |
| Available checkpoint groups include pretraining, DB5, EPN-612, UCI EMG, and DB8. | |
| Use the matching configuration and checkpoint for each task. The released | |
| classification labels are: | |
| | Dataset | Input channels | Classes | Label convention | Checkpoint | | |
| | :--- | ---: | ---: | :--- | :--- | | |
| | NinaPro DB5 | 16 | 53 | 52 gestures + resting | `DB5/DB5_finetune_5sec.safetensors` | | |
| | EPN-612 | 8 | 6 | 5 gestures + hand relaxed | `EPN612/EPN_finetune_5sec.safetensors` | | |
| | UCI EMG | 8 | 6 | Dataset-specific six-class gesture labels | `UCI_EMG/UCI_finetune_5sec.safetensors` | | |
| | NinaPro DB8 | 16 | 5 | Regression outputs | `DB8/DB8_finetune_500ms.safetensors` | | |
| The model configuration must match the checkpoint, especially `in_chans`, | |
| `num_classes`, and `task`. The built-in BioFoundation `TinyMyo_finetune` | |
| experiment currently points to UCI EMG data and can be launched from a | |
| BioFoundation checkout with: | |
| ```bash | |
| python -u run_train.py +experiment=TinyMyo_finetune \ | |
| model.in_chans=8 \ | |
| pretrained_safetensors_path=/absolute/path/to/TinyMyo/UCI_EMG/UCI_finetune_5sec.safetensors | |
| ``` | |
| DB5, EPN-612, and DB8 require matching dataset-specific data-module settings | |
| in BioFoundation before training. Benchmark results | |
| and the latest experimental protocols are maintained in the paper and model card. | |
| ## ๐ License & Citation | |
| This model is licensed under **CC BY-ND 4.0**. If you find TinyMyo useful in your research, please cite our paper: | |
| ```bibtex | |
| @misc{fasulo2026tinymyotinyfoundationmodel, | |
| title={TinyMyo: a Tiny Foundation Model for Flexible EMG Signal Processing at the Edge}, | |
| author={Matteo Fasulo and Giusy Spacone and Thorir Mar Ingolfsson and Yawei Li and Luca Benini and Andrea Cossettini}, | |
| year={2026}, | |
| eprint={2512.15729}, | |
| archivePrefix={arXiv}, | |
| primaryClass={eess.SP}, | |
| url={https://arxiv.org/abs/2512.15729}, | |
| } | |
| ``` | |