EEG reconstruction · Five profiles
ZUNA · Core ML
Five profiles, each checked against the original.
The original ZUNA reconstruction model as five enumerated Core ML profiles, from a 14-channel EPOC X layout to 64 channels.
- Upstream
- Zyphra ZUNA · 380M
- Profiles
- 14, 16, 32, 64 channels
- Precision
- fp16, plus a 64-channel fp32 reference
- Parity
- 20-step diffusion vs PyTorch
- License
- Apache-2.0
- Updated
- 18 Aug 2026
Overview
ZUNA is Zyphra’s 380M-parameter masked diffusion autoencoder, trained on roughly two million channel-hours of public EEG. From a subset of channels and their positions it denoises, fills in dropped channels, and predicts new ones.
This release converts it into enumerated Core ML profiles, one fixed shape per channel count, so an app picks the profile that matches its headset.
Fig. 01 · Illustration
Fourteen electrodes, three missing
ZUNA takes the channels that were recorded, with their 3D positions, and estimates the ones that were not by iterative denoising.
5 cmTop view · t = 3.53 s
Seconds · synthetic, not recorded EEG
Profiles and parity
Every published profile was run against the original PyTorch weights for a 20-step diffusion loop and gated on the relative L2 error of the final latent. Lower-channel fp16 profiles are best for quick mobile validation; the fp32 profile is a high-fidelity reference.
Fig. 02 · Parity
Every profile, gated against PyTorch
Relative L2 error of the final latent after a 20-step diffusion loop, on a log scale. Lower is better.
14ch-fp16560 tokens · [1, 560, 32]
0.011380Pass
16ch-fp16640 tokens · [1, 640, 32]
0.006580Pass
32ch-fp161,280 tokens · [1, 1280, 32]
0.005629Pass
64ch-fp162,560 tokens · [1, 2560, 32]
0.004366Pass
64ch-fp322,560 tokens · [1, 2560, 32]
0.000002Pass
View as table
| Profile | MAE | Relative L2 | Gate | Result |
|---|---|---|---|---|
| 14ch-fp16 | 0.006258 | 0.011380 | 0.012 | Pass |
| 16ch-fp16 | 0.004843 | 0.006580 | 0.010 | Pass |
| 32ch-fp16 | 0.004189 | 0.005629 | 0.010 | Pass |
| 64ch-fp16 | 0.003265 | 0.004366 | 0.010 | Pass |
| 64ch-fp32 | 0.000001 | 0.000002 | 0.005 | Pass |
How it works
Fig. 03 · Inference
Encode once, denoise N times
Diagram of ZUNA inference, drawn for the 14-channel EPOC X profile. A five-second EEG window of C channels at 256 Hz, 1,280 samples per channel, in which T7, O2 and F4 were not recorded, is cut into tokens of 32 samples, 40 per channel, shape [1, C·40, 32]: 560 tokens for 14 channels. Each token carries an index, tok_idx = {x, y, z, t}: its electrode position in metres and its place in time; the tokens of the missing channels are masked and keep only their positions. The ZunaEncoder Core ML package encodes the tokens once, and its encoding is reused at every step. The ZunaDecoderStep package performs one denoising step on the latent z and returns v; the host applies the Euler update z ← z − dt·v; the new z goes back into the step, N times. ZunaDecoderStepUpdate folds the step and the update into one call. The parity checks use 20 steps. The final z is turned back into a [C, 1280] signal: measured channels denoised, missing channels estimated. Traces are synthetic.
EEG window
[C, 1280]
C channels × 1,280 samples: five seconds at 256 Hz. Drawn for the 14-channel EPOC X profile, with T7, O2 and F4 not recorded.
Tokenizeevery 32 samples
Tokens
[1, C·40, 32]
Forty tokens of 32 samples per channel; 560 for 14 channels. Each carries tok_idx = {x, y, z, t}. The rows of T7, O2 and F4 are masked: position only.
AF3 · token 12 of 40
- values
- 32 samples, 1.375–1.500 s
- x, y, z · position
- AF3: −0.034, 0.077, 0.021 m
- t
- 12 of 40 in time
Point at or tap any token, or use the arrow keys on the focused grid, to follow it instead
Tokens + tok_idx
Encode once, denoise N times
The encoder reads the tokens once. The decoder then denoises a latent z, one step per call. N is the host’s choice; the parity checks use 20.
ZunaDecoderStepUpdate folds the step and the update into one call.
Back to samplesz after N steps
Signal
[C, 1280]
z after N steps, back in samples: measured channels denoised; T7, O2 and F4 estimated from their positions.
measured, denoisedestimated
| Package | Role |
|---|---|
ZunaEncoder | Encodes the tokenized EEG context, once |
ZunaDecoderStep | One denoising step of the diffusion loop |
ZunaDecoderStepUpdate | A decoder step plus the Euler update, z ← z − dt · v, for a minimal host loop |
Input contract
- Sampling rate
- 256 Hz
- Window
- 5 seconds, 1,280 samples
- Tokens
- 40 per channel;
tok_idx= {x, y, z, t} - Positions
- 3D electrode coordinates are required
- Normalization
data_norm = 10, as upstream
Know the boundaries
- Throughput depends strongly on the number of diffusion steps; fewer steps are faster and coarser.
- Reconstructed channels are estimates, not measurements.
- Research and engineering use only; not validated for medical diagnosis, treatment, or clinical decisions.
About this page
Summarized from the public model card and its published files. Repository updated 18 Aug 2026; reviewed 26 Sep 2026. The Hugging Face card is the source of truth for licenses and current details.
Upstream: Zyphra / ZUNA