TinyMyo / README.md
MatteoFasulo's picture
refactor: EMG processing scripts and documentation
45d17fb
metadata
license: cc-by-nd-4.0
language:
  - en
model-index:
  - name: TinyMyo
    results:
      - task:
          type: gesture-classification
        dataset:
          type: ninapro_db5
          name: Ninapro DB5
        metrics:
          - name: acc@1
            type: acc@1
            value: 0.8941
            verified: false
          - name: f1
            type: f1
            value: 0.7797
            verified: false
      - task:
          type: gesture-classification
        dataset:
          type: epn612
          name: EPN-612
        metrics:
          - name: acc@1
            type: acc@1
            value: 0.9674
            verified: false
          - name: f1
            type: f1
            value: 0.9674
            verified: false
      - task:
          type: gesture-classification
        dataset:
          type: uci_emg
          name: UCI-EMG
        metrics:
          - name: acc@1
            type: acc@1
            value: 0.9756
            verified: false
          - name: f1
            type: f1
            value: 0.9755
            verified: false
      - task:
          type: gesture-classification
        dataset:
          type: gni_meta_rl
          name: Generic Neuromotor Interface (Discrete Gesture)
        metrics:
          - name: CLER
            type: classification-error-rate
            value: 0.153
            verified: false
      - task:
          type: kinematic-regression
        dataset:
          type: ninapro_db8
          name: Ninapro DB8
        metrics:
          - name: MAE
            type: mean-absolute-error
            value: 8.77
            verified: false
          - name: RMSE
            type: root-mean-square-error
            value: 13.35
            verified: false
          - name: R2
            type: r2
            value: 0.62
            verified: false
      - task:
          type: speech-synthesis
        dataset:
          type: gaddy_silent_speech
          name: Gaddy Silent Speech (MFCC to Audio)
        metrics:
          - name: WER
            type: word-error-rate
            value: 0.3354
            verified: false
      - task:
          type: speech-recognition
        dataset:
          type: gaddy_silent_speech
          name: Gaddy Silent Speech (EMG to Text)
        metrics:
          - name: WER
            type: word-error-rate
            value: 0.3395
            verified: false
tags:
  - emg
  - bio-signals
  - foundation-model
TinyMyo Logo

TinyMyo: a Tiny Foundation Model for Flexible EMG Signal Processing at the Edge

Github License Paper

TinyMyo is a 3.6M-parameter Transformer foundation model for surface EMG (sEMG), optimized for ultra-low-power edge deployment (GAP9 MCU). It demonstrates state-of-the-art performance across gesture classification, kinematic regression, and speech synthesis.


πŸš€ Quick Start

TinyMyo is built as a specialized model within the BioFoundation framework.

1. Requirements

  • Preprocessing: Dependencies for data scripts are in scripts/requirements.txt.
  • BioFoundation: Full framework requirements for training/inference are in the GitHub repository.

2. Preprocessing

Process raw datasets into HDF5 format:

python scripts/db5.py --data_dir $DATA_PATH/raw/ --save_dir $DATA_PATH/h5/ --seq_len 200 --stride 50

See scripts/README.md for all dataset commands.

3. Fine-tuning

python run_train.py +experiment=TinyMyo_finetune pretrained_safetensors_path=/path/to/base.safetensors

🧠 Architecture & Pretraining

  • Core: 8-layer Transformer encoder (192-dim embeddings, 3 heads).
  • Tokenization: Channel-independent patching (20 samples/patch) with RoPE.
  • Data: Pretrained on >480 GB of EMG (NinaPro DB6/7, EMG2Pose).
  • Specs: 3.6M parameters, 4.0 GFLOPs.

🎯 Benchmarks

Task Dataset Metric TinyMyo
Gesture NinaPro DB5 Accuracy 89.41%
Gesture EPN-612 Accuracy 96.74%
Gesture UCI EMG Accuracy 97.56%
Regression NinaPro DB8 MAE 8.77Β°
Speech Gaddy (Speech Synthesis) WER 33.54%
Speech Gaddy (Speech Recognition) WER 33.95%

⚑ Edge Performance (GAP9 MCU)

  • Inference: 0.785 s
  • Energy: 44.91 mJ
  • Power: 57.18 mW

πŸ“œ License & Citation

Weights are licensed under CC BY-ND 4.0. See LICENSE for details.

@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},
}