Source-linked AI summary
MontageFlow: Physically Valid High Fidelity EEG Generation
Sudarshan Regmi, Nabaraj Subedi, Arvind Pillai, Yu Yvonne Wu, Yuliang Chen, Michael V. Heinz, Lisa Marsch, Nicholas C. Jacobson, Andrew Campbell
TL;DR
Clinical EEG generation faces scarce labeled data, while existing generators often overlook montage identities. MontageFlow constrains outputs to valid EEG and conditions generation on a physiological state vector; across three benchmarks, it improves TS-FID by 1.6–3.6× over the strongest baseline with perfect physical validity.
Problem
Method
MontageFlow restricts flow-matching outputs to the valid montage subspace and conditions generation on a learned physiological state vector.
Source: §1 · pp. 1–2Results
Across TUSZ, TUEV, and TUAB, MontageFlow improves TS-FID by 1.6–3.6× over the strongest baseline while achieving a montage index of exactly 0.
Source: §1 · p. 2Takeaways & Limitations
The findings suggest that physical validity and fidelity need not trade off when known physical laws are built into an EEG generator.
Source: §9 · p. 9MontageFlow uses unprojected Gaussian noise during training but projected noise at sampling, an empirical choice without a theoretical explanation.
Source: LIMITATIONS · p. 10
Abstract
from arXiv · showhide
Generative modeling offers a promising solution to the scarcity of labeled clinical electroencephalography (EEG) data under strict privacy constraints. Although recent generative models report substantial improvements in generation fidelity, we show that these gains conceal a categorical failure. EEG is not an arbitrary multichannel signal: each channel records the voltage difference between two scalp electrodes. So, real recordings satisfy exact linear identities among their channels. Current generators invariably violate these identities, yet this has gone unnoticed. We therefore propose MontageFlow, a flow-matching model that enforces these identities by restricting its output to signals that satisfy them. We find that ensuring validity improves fidelity too. Furthermore, to retain the EEG characteristics that oversmoothing washes out, we also condition the model on a physiological state vector encoded from the whole EEG window. For generation, this vector is drawn from a prior fitted in latent space. Across 3 large-scale benchmarks, our model improves TS-FID by 1.6-3.6$\times$ over the closest rival while ensuring validity.
1 INTRODUCTION
MontageFlow addresses the scarcity and privacy constraints of labeled clinical EEG data by generating signals that obey montage identities. It combines montage-constrained outputs with learned window-level conditioning for high-fidelity EEG generation.
- The benchmark montage’s sixteen electrode pairs and two independent loops impose two linear constraints, so valid channel values lie in a fourteen-dimensional subspace.MontageFlow parameterizes its output within this subspace, excluding invalid signals without an additional tuning hyperparameter.Source: §1 · p. 1
- Real EEG channels satisfy exact linear identities because each records a voltage difference between electrode pairs, but current generators violate them.Standard evaluation metrics do not explicitly measure montage violations, so improved distributional fidelity alone does not guarantee physical validity.Source: §1 · p. 1
- A physiological state vector encoded from each EEG window conditions the flow-matching decoder, mitigating oversmoothing and helping preserve low-energy transients and heavy-tailed amplitudes.At sampling time, the vector is drawn from a prior fitted in the encoder’s latent space.Source: §1 · p. 2
- Enforcing validity improves fidelity, lowering TS-FID on all six splits by 7 to 51 points.Source: §1 · p. 2
- Across TUSZ, TUEV, and TUAB, MontageFlow improves TS-FID by 1.6–3.6× over the strongest baseline, with a montage index of exactly 0.Source: §1 · p. 2
2 PRELIMINARIES
Bipolar EEG channels are electrode-potential differences, so shared endpoints in the montage impose exact linear identities at every time point. Standard flow matching does not guarantee that generated EEG satisfies these identities.
Bipolar montage geometry
- Channels 1–4 and 9–12 share endpoints Fp1 and O1, while channels 5–8 and 13–16 share Fp2 and O2, yielding two equal path sums at every time point.Each path sum equals the potential difference between its endpoints.Source: §2 · p. 2, Figure 1 · p. 3
Montage constraint
- The two path identities are encoded as Ax(τ) = 0; the montage-valid channel vectors form ker A, a 14-dimensional subspace of R16.The two rows of A are linearly independent, so rank(A) = 2.Source: §2 · p. 2
Standard flow matching
- Standard linear flow matching interpolates Xt = tX + (1 − t)E and regresses the target velocity X − E, but its unconstrained velocity does not ensure montage-valid outputs.Generation starts from Gaussian noise, and the montage constraint is not guaranteed along the learned trajectory.Source: §2 · pp. 2–3
3 MONTAGEFLOW
MontageFlow enforces EEG montage validity by projecting its starting noise and predicted velocity into the valid subspace. It conditions generation on a learned global latent state to preserve variation across EEG windows.
Montage projector
- The montage projector cancels each linear-identity violation by distributing it equally across the eight channels involved, mapping windows into the valid subspace.It applies the projection column-wise, so A(PX) = 0 for any window X.Source: §3 · p. 3
Projected velocity
- Training uses an L1 velocity-matching objective with flow time sampled as sigmoid(z), where z follows a normal distribution with mean −0.8 and standard deviation 0.82.The velocity network is conditioned on flow time, class label, and the perturbed latent.Source: §3 · pp. 3–4
Validity by construction
- MontageFlow guarantees montage validity by projecting both Gaussian initialization and predicted velocity into ker A.The projected velocity and start state ensure the generated sample satisfies the montage constraints.Source: §3 · pp. 3–4
Latent conditioning
- To mitigate oversmoothing of EEG amplitude and rhythm variation, MontageFlow conditions velocity on a 256-dimensional latent encoded from the clean target window.During training, Gaussian noise with a uniformly sampled scale perturbs the latent, and the encoder is trained jointly with the velocity network.Source: §3 · p. 4
Latent prior
- After joint training, a class-conditional rectified-flow prior is fitted to encoded training latents and labels, then sampled to provide generation-time conditioning.Conditioning both the prior and velocity network on the class label preserves the latent-label dependence observed in training.Source: §3 · p. 4
4 EXPERIMENTAL SETUP
The experiments use three TUH EEG corpora, assess fidelity, physical validity, and cross-channel structure, and compare MontageFlow with five baselines. The setup also specifies the model architecture, training, prior fitting, and sampling procedure.
4 EXPERIMENTAL SETUP
- Experiments use TUAB, TUEV, and TUSZ, preprocessed into 16-channel windows on a bipolar montage at 200 Hz.The corpora cover abnormal/normal classification, six event types, and seizure/background classification, respectively.Source: §4 · p. 5, Table 1 · p. 5
- TS-FID measures spectral fidelity (lower is better), montage index measures physical validity (0 is perfect; 1 is typical of independent channels), and shape correlation measures cross-channel structure (higher is better).TS-FID uses FFT magnitudes and is blind to physical validity.Source: §4 · p. 5
- The baselines are EEG-GAN, vanilla diffusion (Ho et al., 2020), vanilla flow matching (Lipman et al., 2023), JET (Wang et al., 2026), and JET×.Source: §4 · p. 5
- The 156M-parameter model uses a causal Transformer encoder and DiT-B decoder, trained for ∼160k steps before prior fitting and 50-step Euler sampling.The encoder projects to a 256-dimensional latent; the decoder has 130M parameters and uses adaLN conditioning on timestep, class label, and latent h. The prior is fit on the encoded training split for 12k steps.Source: §4 · p. 5
5 RESULTS
Across three datasets, MontageFlow achieves the lowest TS-FID and exact montage validity, most closely matches real cross-channel shape correlation, and improves downstream classifier utility.
Generation quality and physical validity
- 1.6–3.6× lower TS-FID than the strongest baseline in each setting, MontageFlow also achieves a montage index of exactly 0.The strongest baseline is a vanilla diffusion or flow-matching model sharing MontageFlow’s backbone; only real recordings, MontageFlow, and MontageDiff achieve an index of exactly 0.Source: Table 2 · p. 5, §5 · p. 5
Channel relationship
- 0.955–0.990 shape correlation makes MontageFlow closest to the real-data reference across all three corpora.Vanilla models score 0.93–0.96, while JET scores near 0 and JET× scores 0.91–0.95.Source: Table 3 · p. 6, §5 · p. 6
Downstream utility
- 0.632 to 0.716 average accuracy shows MontageDiff improves vanilla diffusion, while MontageFlow outperforms vanilla flow matching on all three corpora.The classifier is trained on 5,000 generated windows per class and tested on real windows; results are averaged over three seeds.Source: Table 4 · p. 6, §5 · p. 6
6 ABLATIONS AND ANALYSES
The ablations show that projection both enforces physical validity and improves fidelity. Further analyses identify how conditioning and training choices affect fidelity, signal amplitude, and computational cost.
Incremental ablation with respect to vanilla flow matching
- Projection makes every generated window physically valid and lowers TS-FID by a further 7–51 points across all six splits.In the incremental ablation, velocity parameterization lowers TS-FID by 31–47 on every split; cross-channel attention lowers it by 1–12 on TUSZ and 21–29 on TUEV and TUAB; latent conditioning adds the largest reduction, 62–92; and latent perturbation adds 11–15 on TUSZ and TUEV and about 5 on TUAB.Source: Table 5 · p. 6, §6 · p. 6
Is post-hoc projection enough?
- 80.7 TS-FID points: training with projection beats inference-only projection on TUAB (59.9 vs. 140.6).Training with projection also performs better on all five physiological metrics; TUSZ and TUEV show the same fidelity trend. The authors hypothesize unconstrained training wastes capacity representing invalid signals.Source: Table 6 · p. 6, §6 · p. 7
Projected training noise
- Projecting training noise worsens test TS-FID by 21.9 on TUSZ, 11.2 on TUEV, and 35.2 on TUAB.The authors hypothesize that unprojected noise regularizes training and makes the velocity network more robust.Source: §6 · p. 7
Latent conditioning mitigates oversmoothing
- With latent conditioning, generated windows retain 78–84% of real median amplitude, versus 42–52% without it.Without the latent, generated windows collapse to a flat average; Figure 3 compares representative real and generated TUAB samples.Source: §6 · p. 7, Figure 3 · p. 7
Conditioning the prior on the label
- Conditioning the prior on class improves test TS-FID by 6.9 points on TUEV, versus 1.1 on TUSZ and 1.5 on TUAB.The approach samples h from pψ(h | y) using the same label y passed to the decoder, rather than sampling from the marginal prior independently of y; TUEV has six classes, while TUSZ and TUAB have two each.Source: §6 · p. 7
The regression loss (L1 versus L2)
- L1 yields lower test TS-FID than L2 on all three datasets; using L2 raises it by 4.0 on TUSZ, 7.9 on TUEV, and 34.4 on TUAB.The passage notes that L1 places less emphasis on large residuals than squared-error L2 regression.Source: §6 · p. 7
Computational cost
- MontageFlow generates at nearly vanilla-model speed (76 vs. 74 ms per window), while its encoder raises training-step time by about 40%.MontageFlow and MontageDiff add a 26M-parameter encoder; sampling the latent adds about 2–3 ms per window. JET and JET× are cheaper with coarser patches, while EEG-GAN generates fastest but trains slowest.Source: §6 · p. 7
7 PHYSIOLOGICAL DIAGNOSTICS
Across five physiological diagnostics, MontageFlow is closest to real EEG on average; qualitative checks show how well it reproduces spectral, temporal-envelope, and heavy-tailed amplitude characteristics.
7 PHYSIOLOGICAL DIAGNOSTICS
- Below about 12 Hz, MontageFlow follows real EEG’s spectral shape and alpha peak; above 12 Hz, its power falls below real EEG, though its median remains within real-window shading.Vanilla flow matching has less power at almost every frequency and exaggerates the alpha peak on TUEV.Source: §7 · p. 8
- MontageFlow preserves the flat real median amplitude envelope at 82–91% of its level and reproduces TUEV’s rise near 2.5 s.Its spread across windows is similar to real EEG; vanilla flow matching has about half the real amplitude and barely shows the TUEV rise.Source: §7 · p. 8
- Above 100 µV, MontageFlow retains 60–70% of real probability mass versus 3–12% for vanilla flow matching, and its amplitude density follows the real curve through the tails.The real clinical EEG amplitude distribution is heavy-tailed, preserving extremes associated with transient events such as spikes.Source: §7 · p. 8
- MontageFlow is closest to real EEG on average across five diagnostics, scoring 0.35 versus 0.56 for the next-best method, MontageDiff.No method is closest on every metric.Source: Table 8 · p. 8, §7 · p. 8
8 RELATED WORKS
Prior EEG work is dominated by task-specific prediction, while EEG generation is comparatively underexplored; existing generators lack physical validity, motivating MontageFlow’s constrained generation.
EEG models
- Expert-labeled EEG is scarce because annotation requires limited neurologist expertise, seizures are rare, and access is constrained by patient privacy.Seizures account for less than 0.1% of the TUH EEG archive; even the largest public EEG corpus required HIPAA de-identification before release.Source: §8 · p. 9
- Deep EEG models are predominantly discriminative and task-specific, and even pretrained foundation models typically need labeled-data fine-tuning or linear probing.Examples include EEGNet’s compact CNN, EEG Conformer’s convolution and self-attention, and graph neural networks used for seizure detection and classification.Source: §8 · p. 9
- Hand-crafted EEG augmentation is task-dependent and may alter semantics or violate montage identities, while synthetic seizure EEG has supported comparable detector performance with lower re-identification risk.The synthetic-seizure finding is from Pascual et al. (2021).Source: §8 · p. 9
Generative modeling
- EEG-GAN, Shu et al. (2025), and JET (Wang et al., 2026) generate EEG, but none ensures physical validity; MontageFlow does.EEG-GAN produces low-fidelity samples and trains slowly, while JET requires dataset-specific tuning of auxiliary-loss weights.Source: §8 · p. 9
- Time-series generators use generic inductive biases, while existing constrained methods address general feasible sets rather than EEG’s fixed linear equality constraint.MontageFlow applies a closed-form projector during both training and sampling.Source: §8 · p. 9
- Generative modeling progressed from GANs to diffusion and flow matching, with flow matching learning a velocity field from noise to data.GAN training can be unstable and prone to mode collapse, whereas diffusion uses a stable non-adversarial objective; with Gaussian noise, diffusion and flow matching mainly differ in noise-level weighting.Source: §8 · p. 9
9 CONCLUSION · Appendix
MontageFlow generates physically valid EEG by restricting outputs to the valid-signal subspace and conditioning on a physiological state vector. Across three large-scale EEG corpora, it improves TS-FID over the strongest baseline while maintaining perfect physical validity.
9 CONCLUSION
- Across three publicly available large-scale EEG corpora, MontageFlow improves TS-FID by 1.6–3.6× over the strongest baseline with perfect physical validity.Source: §9 · p. 9
- Current EEG generators synthesize physically invalid signals, which MontageFlow rules out by restricting outputs to the subspace of valid signals.Source: §9 · p. 9
- MontageFlow conditions its flow-matching decoder on a physiological state vector, and enforcing validity during training also improves fidelity with latent conditioning.Source: §9 · p. 9
- The study is restricted to EEG, though MontageFlow may apply to other electrical recordings such as ECG; results suggest known physical laws need not force a validity–fidelity tradeoff.Source: §9 · p. 9
LIMITATIONS
- Sampling projects initial noise, but training uses unprojected Gaussian noise because it empirically scores better on TS-FID and physiological metrics; the authors offer no theoretical explanation.Source: LIMITATIONS · p. 10
AI USE STATEMENT
- The authors used generative AI for coding, diagram drawing, writing polish, related-work discovery, and LaTeX code, and take responsibility for the final content.Source: AI USE STATEMENT · p. 10
A METRIC DEFINITIONS · B QUALITATIVE SAMPLES
This section defines the evaluation metrics and describes how generated EEG windows compare with real recordings and baselines. MontageFlow reproduces background rhythms across three corpora, though its TUSZ traces are smoother than real EEG.
A METRIC DEFINITIONS
- TS-FID, shape correlation, and physiological metrics compare the whole split with one generated window per real window, whereas the montage index uses generated windows only; real recordings score 0 on the montage index..Source: A METRIC DEFINITIONS · p. 14
- TS-FID is the Fréchet distance between Gaussian fits to real and generated window features, computed from lower-half Fourier magnitudes that are pooled, log-transformed, and standardised within each window.The features are frequency-pooled to at most 256 bins and channels pooled to 4 groups; the method follows Wang et al. (2026).Source: A METRIC DEFINITIONS · p. 14
- The montage index averages normalized absolute residuals between channel-chain sums required to agree by the montage constraints; 0 is physically valid and 1 is typical of independent Gaussian channels.For each window, the residual is averaged over time and divided by the RMS of the 8 involved channels; scores are averaged over windows and both constraints, then normalized by about 2.257.Source: A METRIC DEFINITIONS · p. 14
- Shape correlation measures whether generated and real windows couple the same channel pairs, by correlating the off-diagonal entries of their average per-window channel-correlation matrices.Each matrix is the average of 16×16 per-window Pearson channel-correlation matrices.Source: A METRIC DEFINITIONS · p. 14
- Physiological metrics compare generated and real per-window scalar distributions using interquartile-range-normalized 1-Wasserstein distance, with lower values better; measures include spectral slope, energy, variance, frequency content, and amplitude drift.PSD slope is fitted to each channel’s Welch spectrum over 1–40 Hz and averaged over channels; a signal that is too smooth has a steeper slope. The frequency-content measure is scale-free, and drift detects amplitude ramps or decay.Source: A METRIC DEFINITIONS · p. 14
B QUALITATIVE SAMPLES
- MontageFlow reproduces background rhythms across all three corpora, but its TUSZ traces are visibly smoother than real EEG; vanilla diffusion and flow matching are too quiet, while JET is over-regular.The TUSZ smoothness matches the high-frequency attenuation noted in Figure 4; JET traces rise and fall with a fixed rhythm.Source: B QUALITATIVE SAMPLES · p. 14, Figure 5 · p. 15
C CHANNEL-WISE ANALYSIS · D POST-HOC PROJECTION ON ALL CORPORA · E MONTAGEDIFF
Channel-wise analyses show that MontageFlow preserves key EEG patterns more closely than vanilla flow matching, while training through the projector wins every cell across the three test corpora. MontageDiff applies montage projection and latent conditioning to diffusion and produces windows that remain valid by construction.
C CHANNEL-WISE ANALYSIS
- The channel-wise power, amplitude, and distribution curves report medians over 2,000 windows per channel, revealing errors that averaging across sixteen channels could hide.The amplitude curves are flat for real EEG and MontageFlow, indicating no channel drift.Source: C CHANNEL-WISE ANALYSIS · pp. 16–17
- MontageFlow reproduces real alpha-power channel patterns on all three corpora, while vanilla flow matching has less power at almost every frequency and exaggerates TUEV’s alpha peak.Above 12 Hz, MontageFlow’s spectrum generally falls below real EEG but stays within the real shading.Source: C CHANNEL-WISE ANALYSIS · p. 16, Figure 6 · p. 16
- MontageFlow matches real channel-amplitude rankings across all three corpora at 81–95% of real levels, while vanilla flow matching reaches 44–72%.Every envelope is flat for real EEG and MontageFlow; real EEG has the largest amplitudes on Fp1–F7, Fp2–F8, Fp1–F3, and Fp2–F4, and the smallest on T6–O2, C3–P3, and C4–P4.Source: C CHANNEL-WISE ANALYSIS · p. 17, Figure 7 · p. 17
- Above 100 µV, MontageFlow retains 43–94% of real probability mass per channel, versus at most 18% for vanilla flow matching.On TUAB and TUEV, both real EEG and MontageFlow have their heaviest tails on Fp1–F7, Fp2–F8, Fp1–F3, and Fp2–F4.Source: C CHANNEL-WISE ANALYSIS · p. 18, Figure 8 · p. 18
D POST-HOC PROJECTION ON ALL CORPORA
- Training through the projector wins every cell in the post-hoc projection comparison across all three corpora on the test split.The supplied passage does not report the individual cell values.Source: Table 9 · p. 19, D POST-HOC PROJECTION ON ALL CORPORA · p. 19
E MONTAGEDIFF
- MontageDiff adapts denoising diffusion with a linear noise schedule of T = 1000 steps, projecting predicted noise and training with an ℓ1 loss.The model predicts the noise added to a clean window; its backbone, encoder, latent prior, and training settings are shared with MontageFlow.Source: E MONTAGEDIFF · p. 19
- MontageDiff starts generation from projected noise and takes 50 deterministic DDIM steps; each update stays in ker A, so the final window is valid by construction.The projected prediction and the current sample both lie in ker A, and their linear-combination update therefore remains there.Source: E MONTAGEDIFF · p. 19