File size: 2,353 Bytes
d1d4507
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
license: cc-by-nd-4.0
library_name: braindecode
base_model: PulpBio/TinyMyo
tags:
- braindecode
- pytorch
- safetensors
- emg
- semg
- tinymyo
- foundation-model
---

# TinyMyo (pretrained)

Weights of TinyMyo (Fasulo et al., 2026), the pretrained encoder (masked patch reconstruction on NinaPro DB6, NinaPro DB7 and emg2pose; up to 16 channels), for
[`braindecode.models.TinyMyo`](https://braindecode.org/stable/generated/braindecode.models.TinyMyo.html).
They are `pretraining/TinyMyo/TinyMyo.safetensors` of [PulpBio/TinyMyo](https://huggingface.co/PulpBio/TinyMyo)
(revision `bc14906`), converted to braindecode's parameter names by `convert.py`.

```python
from braindecode.models import TinyMyo

model = TinyMyo.from_pretrained("braindecode/tinymyo-pretrained", n_chans=8, n_outputs=4, n_times=1000)
```

The classification head (`final_layer`) is not part of the release: its input width depends on the number of channels, so `from_pretrained` builds it for your `n_chans` and `n_outputs`. Fine-tune or linear-probe before use.

## Intended input

Surface EMG windows of 1000 samples (`n_times=1000`). The authors pretrain on 20-450 Hz
band-passed signals with a 50 Hz notch, min-max normalized per channel; in fine-tuning they
band-pass at 20-90 Hz and z-score each channel.

## Changes from the original release

`convert.py` changes the format only:

- the `model.` prefix stripped and the parameter names mapped to braindecode's;
- the patch projection `Conv2d(1, D, (1, patch_size))` stored as the equivalent
  `Linear(patch_size, D)` weight;
- no head: the release has none;
- the pretraining-only mask token, reconstruction decoder and regressor not included.

No value is changed: braindecode's `TinyMyo` with these weights gives the outputs of the
original file bit for bit on CPU in float32.

## License and citation

CC BY-ND 4.0, as the original release; the weights are by the TinyMyo authors (ETH Zurich,
PULP platform). Please cite:

```bibtex
@article{fasulo2026tinymyo,
  author  = {Fasulo, Matteo and Spacone, Giusy and Ingolfsson, Thorir Mar and Li, Yawei and Benini, Luca and Cossettini, Andrea},
  title   = {{TinyMyo}: a Tiny Foundation Model for Flexible {EMG} Signal Processing at the Edge},
  journal = {IEEE Transactions on Biomedical Engineering},
  year    = {2026},
  doi     = {10.1109/TBME.2026.3736157},
}
```