Zyphra が EEG 基盤モデル「ZUNA1.1」を Apache 2.0 で公開
Zyphra は、0.5 秒から 30 秒までの可変長入力に対応し、任意の電極配置でノイズ除去や信号再構成を可能にするオープンソース EEG ファウンデーションモデル「ZUNA1.1」を Apache 2.0 ライセンスで公開した。
キーポイント
可変長入力と柔軟なチャネル対応の実現
従来の固定セグメント処理から脱却し、0.5 秒から 30 秒までの任意の長さの入力を処理可能に。また、電極配置に依存しないアーキテクチャにより、4 電極ヘッドバンドから 256 電極キャップまであらゆるレイアウトに対応する。
空間位置に基づくトークン化と生成能力
各チャンネルのデータに 3D スカルの座標 (x, y, z) と時間インデックスを付与したロータリ位置符号化を採用。これにより、記録されていない頭皮上の位置における信号も予測・生成し、任意チャネルアップサンプリングを実現している。
学習効率とトレーニング手法の革新
異なる長さのセグメントをバッチ内で効率的にパッキングする「Flex attention」技術を採用し、1 つのモデルで短時間スニペットから長時間ストッチまで再構成なしで処理可能にした。
オープンソース化と研究利用への貢献
3.8 億パラメータのモデルを Hugging Face で公開し、Apache 2.0 ライセンスの下で商用・非営利問わず研究利用が許可されている。また、ブラウザ上で動作する無料の EEG プレイグラウンドも提供している。
多様な学習タスクとデータ拡張
ZUNA1.1 は単一のドロップアウトパターンから、チャンネル・時間・空間・散在型を含む4種類の複雑な欠損パターンを学習に導入し、より現実的な脳領域欠損への対応力を高めています。
高品質なデータフィルタリングとコーパス拡大
録音全体レベルからチャンネル・秒単位の詳細な品質スコア評価へ移行したことで、利用可能な公的 EEG データを約 200 万時間から 350 万時間に増加させました。
柔軟性と精度の両立
入力長を固定 5 秒から 0.5〜30 秒へ拡張しても、再構成誤差は同等かそれ以上であり、特に脳領域ベースの実用的なテストでは先行モデルや古典的手法を上回る性能を発揮します。
重要な引用
ZUNA1.1 accepts variable-length inputs from 0.5 to 30 seconds.
Because position, not array index, tells the model where a channel sits, ZUNA is channel-agnostic.
One model therefore serves a 0.5 s snippet and a 30 s stretch without reconfiguration.
"ZUNA1.1 trains on four [dropout patterns]... clustering gaps in space and time." (より現実的な欠損パターンへの対応)
"ZUNA1.1 outperforms both spherical-spline and ZUNA1 there." (脳領域ベースのテストでの優位性)
"segment_sec is 5.0, so the 0.5–30 s range needs setting explicitly."
影響分析・編集コメントを表示
影響分析
この発表は、脳波解析におけるデータの前処理や拡張のハードルを大幅に下げ、特に実験環境が異なる多様な研究データを統合・解析する際の標準的なツールとなり得る。可変長入力とチャネル非依存性という技術的飛躍により、臨床現場から基礎研究まで幅広い領域でリアルタイムな信号処理やシミュレーションの可能性を広げる。
編集コメント
脳波データのノイズや欠損に悩む研究者にとって、柔軟な入力を許容するこのモデルは実用性の高いツールとなるでしょう。特に Apache 2.0 ライセンスでの公開は、産業応用を含めた広範な開発を後押しする意義深い動きです。
今週、Zyphra は Apache 2.0 ライセンスの下で「ZUNA1.1」を公開しました。この EEG(脳波)基盤モデルは、任意のチャネル構成に対応し、データの再構築、ノイズ除去、アップサンプリングを実現します。これは Zyphra が以前にオープンソース化した ZUNA1 をベースに開発されたものです。
今回の主な進化は、精度の飛躍的な向上ではなく「柔軟性」にあります。実際の脳波記録は常にノイズが多く、セッションの長さは一定ではありません。また、測定中にチャネルがノイズを帯びたり切断されたりすることも珍しくありません。使用する電極の数も、4 電極のヘッドバンドから 256 チャンネルの研究用キャップまで様々です。従来の ZUNA1 は固定された 5 秒間のセグメントしか処理できませんでしたが、ZUNA1.1 では 0.5 秒から 30 秒までの可変長入力をサポートしています。
ZUNA1.1 とは何か?
その柔軟性を理解するには、まずこのモデルが何をするものかを知る必要があります。
ZUNA1.1 は、スカルプ EEG(頭皮脳波)信号を対象とした、380M パラメータのマスク付き拡散オートエンコーダーです。入力された一部のチャネルデータから既存の脳波セグメントやチャネルのノイズを除去し、欠落しているデータを復元します。さらに、頭上の物理的な座標情報に基づいて、存在しない新しいチャネル信号も予測することが可能です。
パラメータ数は ZUNA1 と同じです。コンシューマー向けの GPU で動作可能であり、多くのワークロードでは CPU でも十分な性能を発揮します。モデルの重みは Hugging Face に、推論および前処理コードは GitHub に公開されています。インストールは pip install zuna で完了します。また、Zyphra はブラウザ上で利用できる無料の EEG プレイグラウンドも提供しており、これらはすべて研究利用を目的として無償で配布されています。
アーキテクチャの仕組み
この柔軟性の根幹にあるのが「トークナイゼーション」です。
ZUNA は、トランスフォーマーエンコーダー・デコーダーを基盤とした拡散オートエンコーダーです。各チャネルの信号は 0.125 秒(サンプリング周波数 256Hz の場合 32 サンプル)ごとにスライスされ、連続値を持つトークンとして扱われます。これらのトークンは、チャネル順に時間軸に沿って並べられます。
ここで重要なのが位置エンコーディングです。各トークンは、電極の 3D スカルプ座標(x, y, z)と粗い時間インデックス(t)を含む 4 次元ロータリー位置エンコーディングを保持します。モデルがチャネルの位置を把握するのは配列のインデックスではなく、物理的な位置情報だからです。この仕組みにより ZUNA はチャネル構成に依存せず、任意の電極レイアウトを受け入れることができます。さらに、記録されたことのない位置でも信号を生成することが可能で、これによって場所に基づく任意のチャネルアップサンプリングが可能になります。
エンコーダーは信号を潜在表現(latent)に圧縮し、その潜在変数は適応型 RMS ノルムを通じてデコーダーを制御します。デコーダーは整流フロー(rectified-flow)の目的関数を用いて訓練されます。ZUNA1.1 では、追加された正規化層などにより、学習の安定性を高めるためのアーキテクチャ上の改良が施されました。
ZUNA1 からの変更点
アーキテクチャ自体は大きく変わっていません。主な違いは訓練プロセスにあります。
- 可変長入力(0.5〜30 秒):ZUNA1.1 は、トレーニング例ごとにサンプリングされたセグメント長を 0.125 秒ごとのトークングリッドにスナップします。この長さは非常に短いものから長いものまで 4 つのビンに分類され、その中からランダムに選ばれます。特に最も一般的な運用ポイントとなる 1.5〜10 秒の範囲は過剰サンプリングされています。トークン数が可変であるため、Zyphra は固定されたバジェット上限まで、1 つのバッチ内に複数のセグメントをパッキングします。サンプル認識型のマスクを用いた Flex Attention(フレックスアテンション)により、異なるサンプル間のトークンが相互に注意を向けるのを防ぎます。これにより、再設定を行うことなく、0.5 秒のスニペットから 30 秒のストッチまで、単一のモデルで幅広く対応することが可能になります。
- より多様な再構成タスクのミックス:ZUNA1 は一様なランダムな全チャンネルドロップアウトという 1 つのパターンでのみ学習していましたが、ZUNA1.1 では 4 つの異なるパターンを組み合わせます。最初の手法は、スパースなマウンテージや死んだ電極をカバーするための「全チャンネルドロップアウト」です。2 つ目は、すべてのチャンネルで短い時間区間を削除する手法です。3 つ目は、特定のチャンネルのみからその区間を削除し、空間的・時間的にギャップをクラスタリングさせるものです。そして 4 つ目は、欠損値を個々のポイントに散らす手法です。
- 品質を考慮した前処理と、より大規模なコーパス
ZUNA1 は録音全体レベルでチャネルの品質判定を行っていたため、利用可能な信号まで捨ててしまうという課題がありました。一方、ZUNA1.1 ではチャネルごとに、かつ秒単位で品質スコアを算出し、ロード時に閾値を設定します。これにより、公開されている EEG データの corpus は約 200 万チャネル時間から約 350 万チャネル時間に拡大されました。
Zyphra チームはさらに、録音ごとに 2 つのフィルタバリアントを事前計算しています。1 つは 0.1〜45 Hz のバンドパスフィルタ、もう 1 つは 0.01 Hz のハイパスフィルタにノッチフィルタを組み合わせたものです。
前処理戦略間での一般化が可能であることは、ベンチマーク結果として示された事実というより、明確な目標として掲げられています。
結果
つまり、柔軟性を追求したことで精度が犠牲になったのかどうかが問われます。
検証用タスク(ホールドアウト)において、ZUNA1.1 は ZUNA1 と同等かそれ以上の再構成 NMSE を達成しました。両モデルとも、MNE で使われる古典的な球面スプライン補間法を明確に上回っています。公平な比較のために、これらの評価セットではすべて 5 秒間のサンプルを使用しています。
Zyphra はまた、領域ベースのテストも実施しました。これはある脳領域からの電極データを削除し、残りの 7 つの電極データから再構成するものです。この設定は、ランダムにチャネルを欠落させる手法よりも現実的です。その結果、ZUNA1.1 は球面スプライン法および ZUNA1 を上回る性能を示しました。
インタラクティブな解説
これらの仕組みを具体的に理解してもらうため、以下のデモではパイプラインの全体像をアニメーションで示しています。
ZUNA1 と ZUNA1.1 の比較
これらのリリースの主な違いは、アーキテクチャではなく学習プロセスにあります。
| 属性 | ZUNA1 | ZUNA1.1 |
|---|---|---|
| パラメータ数 | 380M | 380M |
| アーキテクチャ | Transformer エンコーダー–デコーダー型拡散オートエンコーダー | 同じ構造に、追加の正規化層を追加 |
| 入力長 | 固定 5 秒 | 0.5〜30 秒(0.125 秒グリッドにスナップ) |
| トークン | 0.125 秒 / 32 サンプル (256Hz) | 同じ |
| 位置エンコーディング | (x, y, z, t) 上の 4D RoPE | 同じ |
| デコーダーの目的関数 | Rectified flow | Rectified flow |
| 学習時のドロップアウト手法 | 1 種(全チャンネルをランダムに均一選択) | 4 種(チャンネル、時間軸、チャンネル×時間軸、散在型) |
| 学習データセット | ~2M チャンネル・時間 | ~3.5M チャンネル・時間 |
| 品質フィルタリング | 録音全体レベル | 読み込み時にチャンネルごと・秒ごとにスコア評価 |
| プリプロセッシングのバリエーション | シングル | 2 種(0.1–45 Hz バンドパス; 0.01 Hz ハイパス+ノッチフィルタ) |
| ライセンス | Apache 2.0 | Apache 2.0 |
| 再構成 NMSE | ベースライン | 同等以上 |
実際に動かすには、reconstruct_fif を使用します。これは .pt ファイルを経由する従来の手順を踏まずに、直接 .fif ファイルを処理できます。なお、従来の 4 ステップパイプラインも併用可能です。
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
segment_sec=5.0, # window length; default is 5.0, not the full 30 s
montage="standard_1020", # fallback, used only if the file has no positions
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)
sample_steps=50, # diffusion steps; note: not "diffusion_sample_steps"
)
デフォルト値に注意してください。segment_sec は 5.0 に設定されているため、0.5〜30 秒の範囲を扱うには明示的な指定が必要です。電極位置はファイル自体から読み込まれます。montage 引数は、ファイル内に位置情報がない場合のみフォールバックとして使用され、3D 座標を持たないチャネルは除外されます。
再構成の対象となるのは、結合された集合です。これは、ファイル内の MNE が定義する不良チャネルや BAD_ アノテーションに、上記で指定した項目をすべて加えたものになります。出力先には 2 つのディレクトリが作成されます。full_reconstruction/ にはモデルによる再構成結果が全域に保存され、hybrid/ には元のデータと推測されたセルのみを補完したデータ、および _mask.npz が格納されます。
(function(){
window.addEventListener('message', function(e){
if(e.data && e.data.mtpReqCard && e.data.height){
var f=document.getElementById('mtp-reqcard-frame');
if(f){ f.style.height=e.data.height+'px'; }
}
});
})();
使用例と具体案
マスキング機能が柔軟になったことで、いくつかの実用的なパターンが利用可能になりました。
死んだ電極の処理:repair_channels=["Cz"] を指定して、周囲の電極からそのチャンネルを再構築します。
試行中のモーションアーティファクトの除去:bad_segments=[(10, 11, "C3")] を渡すことで、特定のチャンネル上の特定の区間だけをクリーンアップできます。
ヘッドバンドのアップサンプリング:4 つの電極を入力として与え、標準的な 10-05 配置の追加位置をリクエストします。
UI ベースのクリーニング:mask_dir を通じてファイルごとのマスク情報を提供し、ターゲットに統合します。
モデルの重み、GitHub リポジトリ、技術詳細についてはこちらをご覧ください。また、Twitter でフォローしたり、15 万人以上の ML 専門家が参加する SubReddit に加入したり、ニュースレターを購読することもおすすめです。あ、Telegram も利用可能です!
GitHub リポジトリや Hugging Face ページ、製品リリース、ウェビナーなどのプロモーションで提携をご希望の方は、こちらからご連絡ください。
本記事「Zyphra Releases ZUNA1.1: An Apache 2.0 EEG Foundation Model With Variable-Length Inputs From 0.5 To 30 Seconds」は、MarkTechPost で最初に公開されました。
原文を表示
This week, Zyphra released ZUNA1.1 under the Apache 2.0 license. The EEG foundation model reconstructs, denoises, and upsamples data across arbitrary channel layouts. It builds on ZUNA1, the Zyphra’s earlier open EEG foundation model.
The main change is flexibility, not a jump in raw accuracy. Real EEG recordings are messy. Sessions vary in length, and channels go noisy or drop out mid-session. Montages range from four-electrode headbands to 256-channel research caps. ZUNA1 processed only fixed five-second segments. ZUNA1.1 accepts variable-length inputs from 0.5 to 30 seconds.
What is ZUNA1.1?
To understand that flexibility, start with what the model does.
ZUNA1.1 is a 380M-parameter masked diffusion autoencoder for scalp-EEG signals. Given a subset of channels, it denoises existing EEG segments and channels. It reconstructs missing ones. It also predicts novel channel signals given physical coordinates on the scalp.
The parameter count is unchanged from ZUNA1. It runs on a consumer GPU and works acceptably on CPU for many workloads. Weights sit on Hugging Face; inference and preprocessing code sit on GitHub. Install with pip install zuna. Zyphra also hosts a free browser EEG Playground, and ships all of this for research use only.
How The Architecture Works
That flexibility rests on tokenization.
ZUNA is a transformer encoder–decoder diffusion autoencoder. It slices each channel into 0.125 second segments, which is 32 samples at 256 Hz. Each segment becomes a continuous-valued token. Tokens are serialized in channel × time order.
The positional encoding is the key idea. Each token carries a 4D rotary positional encoding over (x, y, z, t). That is the electrode’s 3D scalp coordinate along with its coarse-time index. Because position, not array index, tells the model where a channel sits, ZUNA is channel-agnostic. It accepts any electrode layout, and can generate signals at positions never recorded. That capability enables arbitrary channel upsampling by location.
The encoder compresses the signal into a latent. That latent conditions the decoder via adaptive-RMS norm. The decoder is trained with a rectified-flow objective. ZUNA1.1’s architectural changes targeted training stability, such as added normalization layers.
What Changed From ZUNA1
Since the architecture stayed close, the differences come from training.
- Variable-length inputs (0.5–30 seconds): ZUNA1.1 samples a segment length per training example, snapped to the 0.125 s token grid. Lengths are drawn across four bins, from very short to long. The middle 1.5–10 s range is oversampled, since it is the most common operating point. Because token counts vary, Zyphra packs multiple segments per batch up to a fixed budget. Flex attention with a sample-aware mask stops tokens attending across samples. One model therefore serves a 0.5 s snippet and a 30 s stretch without reconfiguration.
- A richer mixture of reconstruction tasks: ZUNA1 trained on one dropout pattern: uniformly random whole channels. ZUNA1.1 trains on four. The first is whole-channel dropout, covering sparse montages and dead electrodes. The second removes short time stretches across every channel. The third removes those stretches from only some channels, clustering gaps in space and time. The fourth scatters missing values across individual points.
- Quality-aware preprocessing and a bigger corpus: ZUNA1 made channel-quality calls at the whole-recording level, discarding usable signal. ZUNA1.1 instead computes a per-channel, per-second quality score, thresholded at load time. That grew the corpus from roughly 2M to roughly 3.5M channel-hours of public EEG data. Zyphra team also precomputes two filter variants per recording: a 0.1–45 Hz bandpass, and a 0.01 Hz highpass along with notch. Generalizing across preprocessing strategies is a stated goal, not a benchmarked result.
The Results
Consequently, the question is whether flexibility cost accuracy.
On held-out tasks, ZUNA1.1 reaches better or essentially the same reconstruction NMSE as ZUNA1. Both clearly outperform classical spherical-spline interpolation from MNE. For fair comparison, those evaluation sets used exactly five-second samples.
Zyphra also ran a region-based test. Electrodes from one brain region are deleted, then reconstructed from the remaining seven. That setup is more realistic than random channel dropping. ZUNA1.1 outperforms both spherical-spline and ZUNA1 there.
Interactive Explainer
To make those mechanics concrete, the demo below animates the pipeline end to end.
(function(){
window.addEventListener('message', function(e){
if(e.data && e.data.mtpZuna && e.data.height){
var f = document.getElementById('mtp-zuna11-frame');
if(f){ f.style.height = e.data.height + 'px'; }
}
});
})();
ZUNA1 vs ZUNA1.1
Taken together, the releases differ mostly in training, not architecture.
AttributeZUNA1ZUNA1.1
Parameters380M380M
ArchitectureTransformer encoder–decoder diffusion autoencoderSame, plus extra normalization layers
Input lengthFixed 5 s0.5–30 s, snapped to 0.125 s grid
Token0.125 s / 32 samples at 256 HzSame
Positional encoding4D RoPE over (x, y, z, t)Same
Decoder objectiveRectified flowRectified flow
Dropout schemes in training1 (uniform random whole-channel)4 (channel, time, channel×time, scattered)
Training corpus~2M channel-hours~3.5M channel-hours
Quality filteringWhole-recording levelPer-channel, per-second score at load time
Preprocessing variantsSingleTwo (0.1–45 Hz bandpass; 0.01 Hz highpass + notch)
LicenseApache 2.0Apache 2.0
Reconstruction NMSEBaselineEqual or better
Running It
Turning to practice, reconstruct_fif runs directly on .fif files with no .pt round-trip. The older four-step pipeline still ships alongside it.
Copy CodeCopiedUse a different Browser
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
segment_sec=5.0, # window length; default is 5.0, not the full 30 s
montage="standard_1020", # fallback, used only if the file has no positions
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)
sample_steps=50, # diffusion steps; note: not "diffusion_sample_steps"
)
Note the defaults. segment_sec is 5.0, so the 0.5–30 s range needs setting explicitly. Electrode positions are read from the file itself. The montage argument is only a fallback when positions are absent, and channels without 3D coordinates are dropped.
The reconstruction target is a union. It combines the file’s own MNE bad channels and BAD_ annotations with anything requested above. Two directories are written. full_reconstruction/ holds model output everywhere. hybrid/ keeps the original and infills only inferred cells, plus a _mask.npz.
(function(){
window.addEventListener('message', function(e){
if(e.data && e.data.mtpReqCard && e.data.height){
var f=document.getElementById('mtp-reqcard-frame');
if(f){ f.style.height=e.data.height+'px'; }
}
});
})();
Use Cases With Examples
Because masking is now flexible, several practical patterns open up.
Dead electrode: Mark repair_channels=["Cz"] to rebuild the channel from its neighbours.
Motion artifact in a trial: Pass bad_segments=[(10, 11, "C3")] to clean one span on one channel.
Headband upsampling: Feed four electrodes, then request extra standard_1005 positions.
UI-driven cleaning: Supply per-file masks via mask_dir, unioned into the target.
Check out the Model weight, GitHub Repo and Technical details. Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.
Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.? Connect with us
The post Zyphra Releases ZUNA1.1: An Apache 2.0 EEG Foundation Model With Variable-Length Inputs From 0.5 To 30 Seconds appeared first on MarkTechPost.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み