modulsx
/

Safetensors
File size: 3,666 Bytes
4b36c2c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: apache-2.0
---


# ZUNA1.1: EEG Foundation Model

[![PyPI](https://img.shields.io/pypi/v/zuna?label=pypi&logo=pypi&logoColor=white)](https://pypi.org/project/zuna/) [![GitHub](https://img.shields.io/badge/GitHub-Zyphra%2Fzuna-blue?logo=github)](https://github.com/Zyphra/zuna) [![Join our Discord](https://img.shields.io/discord/1304567558682443806?label=Join%20our%20Discord&logo=discord&logoColor=black)](https://discord.gg/ZF7BCgjAcC) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Zyphra/zuna/blob/main/LICENSE)


![ZUNA1.1 EEG reconstruction demo](https://cdn-uploads.huggingface.co/production/uploads/656560f5995cc49553e2ee41/ZUgCK--yfQxrKuhM1Dwsw.gif)


ZUNA1.1 is a 380M-parameter masked diffusion autoencoder trained to reconstruct, denoise, and upsample scalp-EEG signals. Given a subset of EEG channels, ZUNA can:

- **Denoise** existing EEG segments and channels
- **Reconstruct** missing EEG segments and channels
- **Predict** novel channel signals given physical coordinates on the scalp

Compared to the original ZUNA1, ZUNA1.1 supports variable sequence-length masking (up to windows of 30 seconds). In addition to full channel reconstruction, users can now select specific segments to clean due to our new, flexible dropout training scheme.

At 380M parameters, ZUNA1.1 is lightweight enough to run on a consumer GPU and can be used on CPU for many workloads. ZUNA1.1 is released under the highly permissive Apache 2.0 license.

We have also provided a free inference service on [Zyphra Cloud](https://cloud.zyphra.com/) for researchers to test the model's capabilities, no code required.

## Getting Started

Install with pip — model weights download automatically from this repo on first use:

```bash
pip install zuna
```

Reconstruct `.fif` files directly — denoise, fill missing channels, and upsample the montage in one call:

```python
from zuna import reconstruct_fif

reconstruct_fif(
    input_dir="fif_in",
    output_dir="fif_out",
    figures_dir="figures",
    gpu_device=0,                            # GPU id, or "" for CPU
    repair_channels=["Cz"],                  # channel(s) to fully reconstruct
    target_channel_count=["Fz", "Pz"],       # add/upsample new channels by name (or an int for auto)
    bad_segments=[(5, 6), (10, 11, "C3")],   # mark time spans bad (all channels, or one)
)
```

The reconstruction target is the **union** of the file's own MNE bad channels + `BAD_` annotations plus anything you request above. For the full tutorial, all options, and the API reference, see the **[GitHub repository](https://github.com/Zyphra/zuna)**.

Prefer no install? Run ZUNA1.1 in your browser on [Zyphra Cloud](https://cloud.zyphra.com/).

## Citation

A technical whitepaper is coming soon. If you find ZUNA useful in your work, please cite accordingly.

Organizations or researchers interested in collaborating with Zyphra to improve future versions for specific needs or use cases should contact bci@zyphra.com.

## Disclaimer

This software and related services ("Services") are provided for research use only and are not intended for use in the diagnosis, cure, mitigation, treatment, or prevention of any disease or health condition. The Services have not been validated for any medical or clinical use. The information provided through the Services is for general informational purposes only and is not a substitute for any professional medical or healthcare advice. We do not warrant that any information provided through the Services is accurate, complete, or useful to you. Any reliance you place on such information is strictly at your own risk.