English
tinymyo
emg
bio-signals
foundation-model
MatteoFasulo commited on
Commit
808a02d
ยท
unverified ยท
1 Parent(s): 33db364

docs: update README to enhance model overview, configuration, and deployment details

Browse files
Files changed (1) hide show
  1. README.md +60 -34
README.md CHANGED
@@ -23,57 +23,82 @@ base_model:
23
  </p>
24
 
25
  ## ๐Ÿ“– Overview
26
- **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 **TinyissimoMyo**) 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.
27
-
28
- ## ๐Ÿš€ Key Highlights
29
- * **Generalist Foundation:** Pre-trained on a massive, heterogeneous corpus of >480 GB of EMG data (NinaPro DB6/7, EMG2Pose) using self-supervised masked reconstruction.
30
- * **Edge-Ready:** The first EMG foundation model demonstrated on an ultra-low-power MCU (GAP9), achieving sub-100ms inference for real-time applications.
31
- * **Highly Efficient:** Just 3.6M parameters (1.9M for TinyissimoMyo), ensuring low latency and high energy efficiency (~45 mJ per inference).
32
- * **Versatile:** Achieves state-of-the-art (SoA) performance across hand gesture classification, kinematic regression, and speech processing.
 
 
 
 
 
 
33
 
34
  ## ๐Ÿง  Model Architecture
35
- * **Core:** 8-layer bidirectional Transformer encoder (4-layer for TinyissimoMyo).
36
- * **Embeddings:** 192-dimensional latent space with 3 attention heads.
37
- * **Tokenization:** Channel-independent patching (20 samples per patch) utilizing Rotary Position Embeddings (RoPE) to preserve temporal alignment across channels without spurious cross-channel ordering.
38
- * **Deployment:** Optimized via offline liveness analysis, multi-level memory tiling, and INT8 fixed-point quantization for resource-constrained hardware execution.
39
-
40
- ## ๐Ÿ“Š Performance Benchmarks
41
-
42
- | Task | Dataset | Metric | TinyMyo Result |
43
- | :--- | :--- | :--- | :--- |
44
- | **Gesture Classification** | NinaPro DB5 | Accuracy | **87.98%** |
45
- | **Gesture Classification** | EPN-612 | Accuracy | **96.57%** |
46
- | **Gesture Classification** | UCI EMG | Accuracy | **97.10%** |
47
- | **Gesture Classification** | Generic Neuromotor Interface | CLER | **0.142** |
48
- | **Kinematic Regression** | NinaPro DB8 | MAE | **8.8ยฐ** |
49
- | **Speech Synthesis** | Gaddy | WER | **33.54%** |
50
- | **Speech Recognition** | Gaddy | WER | **33.95%** |
51
 
52
  ## โšก Deployment (GAP9 MCU)
53
- TinyMyo bridges the gap between high-performance deep learning and stringent wearable constraints. We provide two variants to balance the accuracy-latency trade-off:
 
 
 
54
 
55
  ### TinyMyo (3.6M Parameters)
56
- * **Inference Time (5s window):** 0.785 s
57
- * **Energy Consumption:** 44.91 mJ
58
- * **Power Envelope:** 57.18 mW
59
 
60
- ### TinyissimoMyo (1.9M Parameters)
61
- * **Inference Time (5s window):** 0.496 s
62
- * **Inference Time (1s window):** **0.089 s** *(Sub-100ms regime, ideal for real-time prosthetic control)*
63
 
64
  ## ๐Ÿ› ๏ธ Getting Started
65
- TinyMyo is part of the[BioFoundation](https://github.com/pulp-bio/BioFoundation) ecosystem.
66
 
67
  ### Prerequisites
68
  Install the required dependencies from the [BioFoundation repository](https://github.com/pulp-bio/BioFoundation).
69
 
70
  ### Loading & Fine-tuning
71
- You can easily fine-tune the pre-trained weights for your specific task:
72
 
73
  ```bash
74
  python run_train.py +experiment=TinyMyo_finetune pretrained_safetensors_path={*.safetensors}
75
  ```
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  ## ๐Ÿ“œ License & Citation
78
  This model is licensed under **CC BY-ND 4.0**. If you find TinyMyo useful in your research, please cite our paper:
79
 
@@ -84,6 +109,7 @@ This model is licensed under **CC BY-ND 4.0**. If you find TinyMyo useful in you
84
  year={2026},
85
  eprint={2512.15729},
86
  archivePrefix={arXiv},
87
- primaryClass={eess.SP}
 
88
  }
89
- ```
 
23
  </p>
24
 
25
  ## ๐Ÿ“– Overview
26
+ **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.
27
+
28
+ ## โš™๏ธ Model Configuration
29
+ * **Base model:** 8-layer bidirectional Transformer encoder.
30
+ * **TinyssimoMyo:** 4-layer compact variant.
31
+ * **Embedding dimension:** 192.
32
+ * **Attention heads:** 3.
33
+ * **Temporal patch size:** 20 samples.
34
+ * **Default input:** 16 channels ร— 1000 samples.
35
+ * **Maximum channels:** 16.
36
+ * **Tokenization:** Channel-independent patching with 50 temporal patches per channel and 800 tokens for the default input.
37
+ * **Position encoding:** Rotary Position Embeddings (RoPE), with temporal positions reset for each channel.
38
+ * **Training objective:** Self-supervised masked patch reconstruction.
39
 
40
  ## ๐Ÿง  Model Architecture
41
+ TinyMyo uses channel-independent patch embeddings followed by a bidirectional
42
+ Transformer encoder. Tokens are ordered channel-major, while RoPE positions reset
43
+ for each channel so flattening does not introduce a false temporal distance between
44
+ channels. The learned channel embedding identifies a channel slot; it does not
45
+ encode physical electrode coordinates.
46
+
47
+ For deployment, the family can be paired with offline liveness analysis,
48
+ multi-level memory tiling, and INT8 fixed-point execution. See the paper and model
49
+ card for deployment measurements.
 
 
 
 
 
 
 
50
 
51
  ## โšก Deployment (GAP9 MCU)
52
+ TinyMyo is designed for resource-constrained deployment on platforms such as the
53
+ GAP9 MCU. The repository does not treat deployment measurements as model
54
+ configuration; see the [paper](https://arxiv.org/abs/2512.15729) and the
55
+ [Hugging Face model card](https://huggingface.co/PulpBio/TinyMyo) for current results.
56
 
57
  ### TinyMyo (3.6M Parameters)
58
+ * 8-layer encoder configuration.
 
 
59
 
60
+ ### TinyssimoMyo (1.9M Parameters)
61
+ * 4-layer compact configuration.
 
62
 
63
  ## ๐Ÿ› ๏ธ Getting Started
64
+ TinyMyo is part of the [BioFoundation](https://github.com/pulp-bio/BioFoundation) ecosystem.
65
 
66
  ### Prerequisites
67
  Install the required dependencies from the [BioFoundation repository](https://github.com/pulp-bio/BioFoundation).
68
 
69
  ### Loading & Fine-tuning
70
+ Fine-tune a pretrained checkpoint using the BioFoundation training entry point:
71
 
72
  ```bash
73
  python run_train.py +experiment=TinyMyo_finetune pretrained_safetensors_path={*.safetensors}
74
  ```
75
 
76
+ Available checkpoint groups include pretraining, DB5, EPN-612, UCI EMG, and DB8.
77
+ Use the matching configuration and checkpoint for each task. The released
78
+ classification labels are:
79
+
80
+ | Dataset | Input channels | Classes | Label convention | Checkpoint |
81
+ | :--- | ---: | ---: | :--- | :--- |
82
+ | NinaPro DB5 | 16 | 53 | 52 gestures + resting | `DB5/DB5_finetune_5sec.safetensors` |
83
+ | EPN-612 | 8 | 6 | 5 gestures + hand relaxed | `EPN612/EPN_finetune_5sec.safetensors` |
84
+ | UCI EMG | 8 | 6 | Dataset-specific six-class gesture labels | `UCI_EMG/UCI_finetune_5sec.safetensors` |
85
+ | NinaPro DB8 | 16 | 5 | Regression outputs | `DB8/DB8_finetune_500ms.safetensors` |
86
+
87
+ The model configuration must match the checkpoint, especially `in_chans`,
88
+ `num_classes`, and `task`. The built-in BioFoundation `TinyMyo_finetune`
89
+ experiment currently points to UCI EMG data and can be launched from a
90
+ BioFoundation checkout with:
91
+
92
+ ```bash
93
+ python -u run_train.py +experiment=TinyMyo_finetune \
94
+ model.in_chans=8 \
95
+ pretrained_safetensors_path=/absolute/path/to/TinyMyo/UCI_EMG/UCI_finetune_5sec.safetensors
96
+ ```
97
+
98
+ DB5, EPN-612, and DB8 require matching dataset-specific data-module settings
99
+ in BioFoundation before training. Benchmark results
100
+ and the latest experimental protocols are maintained in the paper and model card.
101
+
102
  ## ๐Ÿ“œ License & Citation
103
  This model is licensed under **CC BY-ND 4.0**. If you find TinyMyo useful in your research, please cite our paper:
104
 
 
109
  year={2026},
110
  eprint={2512.15729},
111
  archivePrefix={arXiv},
112
+ primaryClass={eess.SP},
113
+ url={https://arxiv.org/abs/2512.15729},
114
  }
115
+ ```