Manuscript Offprint
arXiv:2609.37730Spatiotemporal Hyperedges for EEG Seizure Detection and Prediction
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Seizure detection and prediction from EEG are clinically important but challenging because seizures are rare, temporally localized, and propagate as coordinated events across multiple channels. Recent dynamic graph neural networks model this by running a temporal model over a sequence of per-time-step pairwise channel edges. However, this pairwise construction misses the spatiotemporal coupling that constitutes a seizure, at substantial training cost. We propose HyBrain, which summarizes spatiotemporal EEG evidence through a small set of soft hyperedges rather than pairwise edges. A per-channel Mamba backbone produces one token per (channel, second), and a spatiotemporal hyperedge block pools these tokens into shared group embeddings through soft memberships and broadcasts them back. The same encoder serves three downstream tasks: window-based detection, one-second point-wise detection, and preictal seizure prediction. On TUSZ and CHB-MIT, HyBrain achieves the best AUROC on every reported setting against ten baselines, with the largest gap on long-clip preictal prediction. It also matches the most efficient baselines in training time and peak GPU memory. A qualitative analysis shows that even a single learned hyperedge cleanly captures the preictal → ictal → postictal trajectory on a real seizure clip.
1 Introduction
Epilepsy affects approximately 50 million people worldwide, and timely recognition of seizure activity is critical for preventing injuries and life-threatening complications . In clinical practice, seizure monitoring is performed on continuous multi-channel electroencephalography (EEG), a long and high-dimensional time series in which seizures occupy only brief intervals scattered across hours to days of recording . Reliably surfacing these rare events from large-scale streaming biosignal data is impractical for manual review, making automated EEG seizure detection a long-standing problem at the intersection of biomedical informatics and time-series data mining .
Three families of methods have shaped EEG seizure modeling. Early models treat EEG as a multi-channel time series and
Sheo Yon Jhin
School of Computing
Korea Advanced Institute of Science and Technology
Daejeon, Republic of Korea
Nabil Imam
School of Computational Science and Engineering
Georgia Institute of Technology
Atlanta, GA, USA

Figure 1: Membership of one spatiotemporal hyperedge over the channel-time tokens of a 60s TUSZ clip. The membership regime shifts across phases (dashed lines), coupling the tokens of each phase into a distinguishable group-level embedding. This emerges because our model learns hyperedges well-suited for seizure detection.
apply CNNs or RNNs along the time axis only, leaving the relations among electrodes implicit [2, 20]. A second line constructs a static pairwise graph over channels and runs a GNN on top, capturing electrode relations but not how they change during a seizure [6, 30]. To capture time-varying connectivity, recent methods introduce dynamic graph neural networks (GNNs) that replace the static adjacency with a pairwise channel graph at each time step [23, 25, 29]. These models see both spatial and temporal variation, but each relation is still defined between two channels within the same time step. A heavier subfamily further applies a temporal model to the per-time-step edge sequence [13, 18], explicitly tracking how each pairwise edge evolves over time. However, this still does not directly model cross-time, cross-channel coupling, such as one channel at one time influencing another channel at a later time. It also decomposes a multi-channel seizure event into many bilateral edge trajectories and requires retaining edge-level activations over time, which increases the computational and memory cost of the graph pipeline.
Both authors contributed equally to this research.
We address these limitations with HyBrain, which learns a small set of spatiotemporal hyperedges over channel-time tokens. This formulation models channel-time coupling and group-level interaction directly, and does not require dense per-time-step pairwise graphs. The encoder follows a node → hyperedge → node flow. A per-channel Mamba backbone [14] first produces one token per (channel, second) pair. A spatiotemporal hyperedge block then pools all NT tokens into shared group embeddings through soft memberships, and broadcasts the same group embeddings back to every token weighted by its own memberships, so each token absorbs the group-level context relevant to it (cf. Figure 1). A Set-Transformer-style Pooling by Multi-head Attention (PMA) readout [21] finally aggregates the updated tokens for each task head. This design summarizes the entire channel-time field through group embeddings rather than reconstructing it from per-time-step pairwise edges.
We evaluate HyBrain on TUSZ [27] and CHB-MIT [28] across three tasks: window-based detection, one-second point-wise detection, and preictal seizure prediction. The same encoder supports all three tasks because HyBrain learns task-relevant hyperedge memberships over channel-time tokens, while only the lightweight readout head is changed for each task (cf. Figure 1).
Our contributions are:
(1) We introduce learnable hyperedges over channel-time tokens that model cross-time and cross-channel coupling without pairwise decomposition.
(2) We use the same encoder for window-based detection, point-wise detection, and preictal prediction by learning task-relevant hyperedge memberships, with only the readout head changed per objective.
(3) Against ten baselines, HyBrain achieves the best AUROC across all reported detection and prediction settings on TUSZ and CHB-MIT, with the largest gain on long-clip preictal prediction, while matching the most efficient baselines in time and memory.
Code is available at https://github.com/hhyy0401/seizure.
2.1 EEG Deep Learning Models
Sequential and static-graph models. Sequential models treat EEG as a multi-channel time series and apply CNNs or RNNs mainly along the temporal axis, with EEGNet [20] as a general-purpose backbone and CNN-LSTM [2] as an early seizure-focused variant. Static-graph approaches for EEG seizure detection make electrode topology explicit through a fixed adjacency: TGCN [6] introduced this idea with a hand-designed spatial graph, while self-supervised graph neural networks [30] added contrastive pretraining to alleviate label scarcity. A recent line instead pretrains large EEG foundation models on broad corpora and finetunes them on downstream clinical EEG tasks, including BIOT [36], LaBraM [17], and EEGPT [32].
Dynamic GNNs. Because a seizure unfolds as a time-varying pattern of inter-channel coordination, a dedicated line of EEG seizure detection dynamically updates the channel graph within each EEG clip. DCRNN [23] pairs a diffusion-convolutional RNN with a per-clip k-NN correlation graph, EvolveGCN [25] evolves GCN parameters across time steps with a recurrent network, and GraphS4mer [29] relearns the graph at each within-clip segment and combines it with a structured state-space backbone [14, 15]. Recent state-of-the-art models further track temporal dynamics over edge sequences, for example with a per-edge GRU in GRU-GCN [13] or a per-edge Mamba in EvoBrain [18]. However, these methods still use pairwise edges as the basic relational unit, so higher-order coordination among multiple channels and its temporal consistency are only modeled indirectly through sequential updates or stacked layers.
Hypergraph learning. Hypergraphs extend ordinary graphs by connecting multiple nodes with one hyperedge, making them suitable for high-order group interactions. Prior hypergraph neural networks, including HGNN [11], HyperGCN [35], and AllSet [5], usually use fixed incidences from predefined groups or k-NN features. In EEG, STHGCN [22] applies this idea to emotion recognition by constructing separate spatial and temporal hypergraphs over EEG features. HyBrain instead learns input-conditioned hyperedges jointly over the channel-time grid, using a small fixed hyperedge budget for each clip.
2.2 EEG Seizure Tasks
Point-wise seizure detection. Clinical EEG datasets such as TUSZ [27] annotate seizure onset and offset at one-second resolution, and detectors are expected to localize these transitions, not just classify entire clips. Classical seizure-detection systems reflected this directly, combining point-wise scoring at one-second resolution with event-level scoring based on onset latency and false-alarm rate per hour [1, 28, 33], and early deep-learning detectors preserved this resolution through CNN-RNN or temporal GCN backbones with per-second outputs [7, 26]. The recently proposed SzCORE benchmark [8] likewise lists both point-wise and event-level scoring among its recommended evaluation metrics. Many recent dynamic-GNN detectors [18, 29], by contrast, adopt coarser supervision and assign a single binary label per 12 s or 60 s window, leaving the available second-level annotations unused at training time. We complement this line by re-introducing point-wise detection as a first-class training objective, and report per-second results alongside the window-level ones.
Seizure prediction. Seizure prediction differs from detection in that the discriminative evidence is diffuse and distributed across channels, evolving slowly over the preictal window rather than concentrated in a clearly ictal interval. Unlike point-wise detection, prediction is usually formulated as distinguishing preictal from interictal EEG under a specified seizure prediction horizon and seizure occurrence period [4, 34]. Early prediction studies and clinical reviews emphasized patient-specific preictal dynamics, early-warning time, and false-alarm burden as central challenges for deployable systems [12, 19, 24]. Recent deep-learning work has further revisited this setting as an early-warning task rather than only a detection problem [18, 31]. Prediction therefore provides a complementary evaluation setting to detection. Rather than recognizing ictal patterns that are already expressed, the model must infer a latent preictal state from subtle changes in

Figure 2: Overview of HyBrain. A multi-channel EEG clip is first converted into one-second channel-time spectral tokens using a per-channel short-time Fourier transform (STFT). The channel-time token encoder then processes each channel independently with a Mamba backbone and adds a learnable channel embedding to preserve channel identity. The spatiotemporal hyperedge aggregation block pools all channel-time tokens into learnable hyperedge embeddings through soft memberships and broadcasts the resulting group-level context back to the tokens, capturing high-order cross-channel and cross-time interactions. A temporal attention layer further refines intra-channel temporal dependencies, producing the shared representation G. Finally, task-specific heads adapt this shared representation to window-based seizure detection, point-wise seizure detection, and preictal seizure prediction.
ongoing background activity. This setting tests whether HyBrain can aggregate weak evidence over long clips through learned channel-time hyperedges.
3 Proposed Methods
3.1 Problem Formulation
We represent each EEG clip as a tensor , where is the number of EEG channels, is the number of one-second time steps, and is the dimension of the per-second short-time Fourier transform (STFT) feature. A clip of length seconds has time steps, and denotes the spectral feature of channel at second .
Following standard epileptological convention, we refer to time intervals as ictal during an annotated seizure, preictal immediately preceding seizure onset, postictal immediately following seizure offset, and interictal otherwise.
On this shared input, we study three binary tasks.
(1) Window-based detection predicts , indicating whether the clip overlaps with seizure interval.
(2) Point-wise detection predicts , where if the -th second overlaps with a seizure.
(3) Seizure prediction predicts , the binary classification between interictal (normal) and preictal states, where the preictal state is defined as the s window immediately before each seizure onset [18].
All tasks use the same encoder to map X into a channel-time representation , and task-specific heads produce either a clip-level logit or per-second logits.
3.2 Overall Workflow
Figure 2 shows the detailed design of our method, HyBrain. The overall workflow is as follows:
(1) A per-channel STFT converts each channel into a sequence of one-second spectral features.
(2) In the Channel-time Token Encoder, a per-channel Mamba backbone [14] encodes these features into one token per (channel, second) pair, augmented with a learnable channel embedding.
(3) In the Spatiotemporal Hyperedge Aggregation block, a small set of learnable hyperedges pools the channel-time tokens into group embeddings through soft memberships and broadcasts them back to every token, capturing high-order interactions across channels and time without explicit dynamic graph construction.
(4) A Temporal Attention layer then refines long-range temporal dependencies, producing the shared representation .
(5) Task-Specific Heads based on PMA-style channel readouts [21] adapt G to window-based detection, point-wise detection, and seizure prediction.
3.3 Channel-Time Token Encoding
Each EEG channel is first converted into a one-second spectral sequence by a per-channel STFT, yielding per (channel, second) pair (preprocessing details in Section 4.1). We then encode temporal dynamics within each EEG channel. For each channel , the spectral sequence is processed by a stack of Mamba layers [14], each a selective state-space module that mixes information along the temporal axis only. Let , where is a learnable linear map that lifts the spectral features to the hidden dimension , and denotes layer normalization. At layer , a latent state evolves under a selective recurrence and the token is updated by a residual layer-norm:
where the coefficients depend on and follow Mamba's HiPPO-initialized form [14]. Setting yields the backbone output . Because the recurrence is per-channel, the channels are processed independently and no cross-channel mixing happens at this stage. To preserve channel identity before hyperedge aggregation, we add a learnable channel embedding as a channel positional embedding:
3.4 Spatiotemporal Hyperedge Aggregation
Seizure events often appear as channel-to-channel coupling that may carry a temporal lag. We therefore introduce a spatiotemporal hyperedge block that proceeds in three steps: it first learns soft token-to-hyperedge memberships, then aggregates the tokens into hyperedge embeddings, and finally updates each token by broadcasting the incident hyperedges back.
We flatten into NT channel-time tokens , where each corresponds to one channel at one time step, and introduce learnable hyperedge queries , where is the number of latent hyperedges and each represents one latent spatiotemporal hyperedge. For token and hyperedge , the soft membership is
where is the sigmoid activation. We use sigmoid rather than softmax across hyperedges so that a token can belong to multiple hyperedges, supporting overlapping spatiotemporal patterns.
Given the memberships, each hyperedge embedding is the membership-weighted average of its assigned tokens, and each token is updated by broadcasting the incident hyperedge embeddings back with the same weights:
Here forms a group-level representation of one coordinated spatiotemporal pattern, and encodes the group-level spatiotemporal context associated with token .
We then fuse the original and updated tokens through a post-norm residual block:
where is a learnable linear map and is the activation. Intuitively, provides the local channel-time evidence at position , while injects the global, hyperedge-aggregated spatiotemporal context, so that the post-norm residual incorporates the two views.
We stack such blocks and denote the resulting tensor by . We then add a temporal attention layer to capture residual long-range dependencies within each channel.
Here, denotes multi-head self-attention along the time axis with weights shared across channels, and is a gate coefficient. The output is used as the shared representation for downstream readout modules.
3.5 Task-Specific Heads and Training Objective
The shared representation G is passed to task-specific heads. All heads use a PMA-style channel readout [21] followed by a linear classifier, where the difference is whether the temporal axis is pooled before the readout or preserved for per-second prediction.
For window-based detection and seizure prediction, we use the same clip-level readout:
Here, denotes average pooling over time, is the task-specific linear classifier, and is a raw logit. The two tasks use different labels, and , and are trained separately with binary cross-entropy on the sigmoid of the logit.
For point-wise detection, we keep the temporal axis and apply the PMA channel readout independently at each time step:
with PMA parameters shared across all time steps. To encode the temporal contiguity of seizure labels directly into the objective, we add a small adjacent-frame logit-smoothness regularizer:
Using logit-space differences preserves informative gradients under confident predictions, while penalizing only consecutive differences allows sharp label transitions at seizure onset and offset.
3.6 Theoretical Analysis
We show that HyBrain’s hyperedge block induces an input-adaptive global mixing operator of rank at most over all channel-time tokens, and compare its compute and activation-memory cost against representative edge-stream dynamic-GNN baselines.
Setup. A dynamic pairwise GNN over N EEG channels and T time steps maintains an adjacency at every time step, with up to pairwise edges per time step. Recent edge-stream variants further apply a temporal model along the edge sequence: GRU-GCN [13] uses a per-edge GRU, and EvoBrain [18] uses a per-edge Mamba. HyBrain instead applies a single hyperedge block with shared hyperedges to the flattened NT channel-time tokens.
PROPOSITION 3.1 (RANK- GLOBAL MIXING OF CHANNEL-TIME TOKENS). Fix the soft memberships from Eq. (4), and
Table 1: Per-sample asymptotic cost of representative spatiotemporal interaction blocks.
| Method | Compute | Activation memory |
|---|---|---|
| GRU-style edge stream [13] | ||
| Mamba-style edge stream [18] | ||
| HyBrain hyperedge block |
let . The aggregate-and-broadcast step in Eq. (5) acts on the channel-time tokens as
The induced operator , with and , satisfies two properties:
(1) Global support. Under sigmoid memberships, for all , so for every pair of channel-time tokens.
(2) Low-rank global interaction. factors through the hyperedges via , so .
PROOF. Substituting the hyperedge embedding into the broadcast update gives
Thus , where and . Therefore . Since sigmoid memberships are strictly positive for finite inputs, for all .
Proposition 3.1 shows that the hyperedge block couples every pair of channel-time tokens in one step, while routing the interaction through only shared hyperedges. Table 1 compares the resulting per-sample asymptotic cost against the two edge-stream variants used by the strongest baselines. Compared with a Mamba-style edge stream, the edge-stream-to-hyperedge compute ratio scales as , so the hyperedge block is cheaper whenever the number of pairwise edges per time step exceeds the effective hyperedge budget . For dense pairwise graphs with , this yields a compute improvement of and an edge-related activation-memory reduction of approximately when the membership tensor dominates the hyperedge state. For sparse graphs with , where is the average number of pairwise edges per node, the edge-stream-to-hyperedge compute ratio becomes , and the corresponding relation-related activation-memory ratio is approximately under the same dominance assumption.
Empirically, these claims are checked in three places. The effectiveness of the hyperedge coupling itself is tested in Section 5.1. The memory and runtime advantage is evaluated in Section 5.2. The sufficiency of a small is verified by the hyperedge sensitivity study in Section 5.4.
4 Experiments
4.1 Experimental Settings
Datasets and preprocessing. We evaluate on TUSZ [27] and CHB-MIT [28], using 12 s and 60 s clip settings for window-based experiments and following the data splits and evaluation protocol of EvoBrain [18]. For the input feature, raw EEG is resampled to 200 Hz, segmented into non-overlapping 1-second windows per channel, and each window is mapped to its log-magnitude STFT over the positive frequency bins. An -second clip therefore yields . For each subject, per-channel STFT mean and standard deviation are computed on the training split and used to normalize all splits.
For point-wise detection, we derive a per-second label for each clip, where iff the -th 1-second window overlaps any annotated seizure interval. The window-level label is recovered as .
Tasks. We evaluate three EEG seizure-analysis tasks: window-based seizure detection, point-wise seizure detection, and preictal seizure prediction. In window-based detection, each W-second clip () is labeled positive if it overlaps with any annotated seizure interval. In point-wise detection, each one-second frame is labeled using seizure onset and offset annotations, so models are evaluated at one-second temporal resolution. In seizure prediction, clips are classified as preictal or interictal. Preictal clips are drawn from the s window before seizure onset, and the interictal pool is constructed by discarding all seizure-labeled segments and excluding a s buffer around every seizure boundary so that preictal evidence does not contaminate the negative class. Following EvoBrain [18], we report prediction on TUSZ only, since CHB-MIT's smaller scale and highly patient-specific pediatric preictal signal are insufficient for cross-patient prediction.
Prediction sampling. To match the fixed clip grid used by all models, we accept a clip as preictal iff its full span lies within the strict s preictal window for 12 s clips, and within a clip-length search window before the buffer for 60 s clips. For tractability and to keep F1 meaningful, we subsample interictal clips per patient to at most that patient's number of preictal clips, using a fixed seed and applying the same procedure to train, dev, and test splits.
Metrics. We use AUROC and F1 score as primary metrics, following EvoBrain [18]. Quantitative results are averaged over three random seeds. We report test AUROC at the checkpoint with the highest dev AUROC, and test F1 at the threshold that maximizes dev F1.
Hyperparameters. We select hyperparameters by dev AUROC. For HyBrain, we grid search the learning rate, weight decay, dropout, hidden dimension , and the temporal-attention gate . The search space, the selected per-task values, and the shared optimization settings are listed in Appendix B. Unless otherwise specified, baseline hyperparameters follow their original implementations or the EvoBrain protocol.
Table 2: Window-based seizure detection performance on TUSZ and CHB-MIT. Mean ± std across three seeds. The best result is highlighted in bold, and the second-best is underlined. Time denotes wall-clock seconds per training epoch on a single A6000, and Memory denotes peak GPU memory during training, reported in MB.
| Method | Time (s/ep.) | Memory (MB) | TUSZ (12 s) | TUSZ (60 s) | CHB-MIT (12 s) | |||
|---|---|---|---|---|---|---|---|---|
| AUROC | F1 | AUROC | F1 | AUROC | F1 | |||
| LSTM | 31.30 | 88.0 | ||||||
| CNN-LSTM | 29.90 | 1208.1 | ||||||
| BIOT | 86.07 | 1850.7 | ||||||
| LaBraM | 212.9 | 3576.7 | ||||||
| EEGPT | 151.2 | 1022.1 | ||||||
| EvolveGCN | 72.89 | 62.3 | ||||||
| DCRNN | 240.2 | 71.2 | ||||||
| GraphS4mer | 30.29 | 340.4 | ||||||
| GRU-GCN | 31.13 | 4605.5 | ||||||
| EvoBrain | 57.99 | 3981.7 | ||||||
| Ours () | 29.10 | 332.2 | ||||||
| Ours () | 29.70 | 332.5 | ||||||
| Ours () | 30.32 | 332.8 | ||||||
Training. All models follow the EvoBrain [18] training setting, STFT preprocessing, 1:1-balanced training sampler, and the window-based runs. For point-wise detection, all baselines are adapted with a shared per-timestep readout head so that they emit one logit per second.
Baselines. We compare against ten baselines covering the three families reviewed in Section 2.2.
(1) Sequential models. LSTM [16] (2 layers, hidden 64) and CNN-LSTM [2] (2D conv-pool over channel×frequency, 2-layer LSTM).
(2) EEG foundation models. BIOT [36], LaBraM [17], and EEGPT [32], each finetuned from the released checkpoint with a linear classification head. LaBraM and EEGPT take raw EEG, BIOT uses its native spectrogram patches.
(3) Dynamic GNNs. EvolveGCN [25], DCRNN [23] ( k-NN correlation graph), GraphS4mer [29], GRU-GCN [13], and EvoBrain [18].
Point-wise baselines. Existing seizure detection baselines (EvoBrain, DCRNN, GRU-GCN, LSTM, CNN-LSTM, BIOT) are originally designed for window-level classification, i.e., they emit a single binary prediction per -second clip. To enable a fair comparison on the point-wise detection task, we adapt each baseline by replacing its terminal readout, typically a last-timestep aggregation followed by a fully connected classifier, with a time-shared per-timestep prediction head. Concretely, the backbone is kept intact and produces a hidden tensor of shape , after which the same linear projection and node aggregation are applied independently at every timestep, yielding logits. We denote these point-wise variants as Dense-EvoBrain, Dense-DCRNN, etc. This minimal modification preserves every learnable component of the original architecture and isolates the contribution of the dense temporal supervision from broader architectural changes.
Environments. All experiments are conducted on a workstation equipped with NVIDIA RTX A6000 GPUs (48GB VRAM); every reported timing is measured on a single A6000. Our implementation is in PyTorch 2.5.1 with CUDA 12.1, Python 3.10, on Ubuntu 20.04 LTS.
4.2 Seizure Detection and Prediction
Window-based Detection. Window-based seizure detection is the standard benchmark setting for recent EEG seizure models, where each fixed-length EEG clip is assigned a single seizure/non-seizure label. As shown in Table 2, HyBrain attains the highest AUROC on all three benchmarks (TUSZ 12 s, TUSZ 60 s, and CHB-MIT 12 s), and its F1 is comparable to the top method across settings (e.g., within 0.01 of EvoBrain at TUSZ 12 s and GRU-GCN at TUSZ 60 s). Against these strongest dynamic-GNN baselines, HyBrain matches GRU-GCN's training time (29.1 vs. 31.1 s/epoch), runs about faster than EvoBrain (29.1 vs. 58.0 s/epoch), and uses roughly an order of magnitude less peak GPU memory than either baseline. Detailed runtime and memory measurements are reported in Table 6, and the accuracy-efficiency trade-off is visualized in Figure 3.
Point-wise Detection. The point-wise (per-second) setting is the stricter benchmark, since the model must localize seizure activity within a clip rather than emit a single clip-level label. Without smoothness regularization, HyBrain is already the strongest or second-strongest on AUROC across all three benchmarks (Table 3). Adding the temporal smoothness penalty further improves performance. Specifically, HyBrain achieves the highest AUROC on every benchmark and the highest F1 on CHB-MIT. Dense-EvoBrain remains marginally ahead only on TUSZ 12 s F1.
Three architectural choices explain HyBrain's effectiveness on per-second prediction. First, the per-channel Mamba backbone preserves the time axis end-to-end, so per-second logits are read off a per-time-step representation rather than reconstructed from a clip-level summary at the readout. Second, the spatiotemporal hyperedge block concentrates cross-channel seizure evidence into a small set of group embeddings, so each per-second decision draws on a focused, coordinated context instead of averaging
Table 3: Point-wise (per-second) seizure detection on TUSZ (12 s, 60 s) and CHB-MIT (12 s). All baselines are paper architectures adapted with a per-timestep readout head, trained with dense BCE on per-second labels.
| Method | Time (s/ep.) | Memory (MB) | TUSZ (12 s) | TUSZ (60 s) | CHB-MIT (12 s) | |||
|---|---|---|---|---|---|---|---|---|
| AUROC | F1 | AUROC | F1 | AUROC | F1 | |||
| Dense-LSTM | 28.5 | 415 | ||||||
| Dense-CNN-LSTM | 29.5 | 1804 | ||||||
| Dense-BIOT | 111.5 | 3889 | ||||||
| Dense-GRU-GCN | 30.0 | 5419 | ||||||
| Dense-DCRNN | 937.0 | 886 | ||||||
| Dense-EvoBrain | 69.0 | 3515 | ||||||
| Ours | 33.0 | 521 | ||||||
| + () | 33.5 | 521 | ||||||
| + () | 33.0 | 521 | ||||||
| + () | 32.0 | 521 | ||||||
Table 4: Seizure prediction (preictal vs. interictal binary classification) on TUSZ.
| Method | 12 s | 60 s | ||
|---|---|---|---|---|
| AUROC | F1 | AUROC | F1 | |
| LSTM | ||||
| CNN-LSTM | ||||
| BIOT | ||||
| LaBraM | ||||
| EEGPT | ||||
| EvolveGCN | ||||
| DCRNN | ||||
| GraphS4mer | ||||
| GRU-GCN | ||||
| EvoBrain | ||||
| Ours () | ||||
| Ours () | ||||
| Ours () | ||||
over every channel. Third, temporal attention further refines the per-second logits by enforcing consistency along the time axis.
Seizure Prediction. Seizure prediction, which aims to forewarn an oncoming seizure from the preictal EEG window for abortive medication or closed-loop stimulation [19, 24], is the hardest of the three tasks. As shown in Table 4, most baselines remain near chance on TUSZ 12 s and reach only the low-to-mid AUROC range on TUSZ 60 s. On TUSZ 60 s, HyBrain () extends substantial leads on both AUROC and F1 over every baseline, including dynamic-GNN methods that match it on detection. On TUSZ 12 s, it still attains the highest AUROC, with F1 comparable to the best baseline.
The preictal signal is weak, distributed across channels, and changes gradually over the 60 s interval before onset. In pairwise dynamic graphs, this pattern is represented through many edge-level trajectories, which can make the relevant preictal structure difficult to distinguish from interictal variability. A spatiotemporal hyperedge instead pools the full 60 s window across both channel and time into a single group embedding, so the discriminative signal is collected in one place rather than reassembled from pieces. The 12 s setting captures only a fraction of this window and serves as a short-context stress test rather than the
Table 5: Hyperedge block ablation on TUSZ window-based detection. rows are changes versus the best HyBrain configuration per column.
| Method | TUSZ 12 s | TUSZ 60 s | ||
|---|---|---|---|---|
| AUROC | F1 | AUROC | F1 | |
| HyBrain () | ||||
| HyBrain () | ||||
| HyBrain () | ||||
| w/o hyperblock (vs. best) | ||||
| (vs. best) | -1.1 pt | -5.1 pt | -4.2 pt | -9.2 pt |
| w/o Mamba | ||||
| (vs. best) | +0.1 pt | -1.1 pt | -2.0 pt | -2.7 pt |
primary clinical operating window, which is why absolute numbers stay low across all methods even though HyBrain still leads.
5 Additional Analyses
We analyze HyBrain along four axes. We first isolate the contribution of the spatiotemporal hyperedge block (Section 5.1) and quantify its accuracy–efficiency trade-off against baselines (Section 5.2). We then visualize what the hyperedges learn on a representative seizure clip (Section 5.3) and study its sensitivity to the number of hyperedges (Section 5.4).
5.1 Ablation Study
To isolate the contribution of the spatiotemporal hyperedge aggregation block, we remove Eqs. (4)–(6) of Section 3.4 (soft membership , hyperedge aggregation and broadcast , and the post-residual mixing), keeping the rest of the encoder intact. “w/o Mamba” replaces the per-channel Mamba encoder with a GRU in the per-task best configuration ( for 12 s, for 60 s), keeping all else unchanged.
Table 5 reports the effect on TUSZ window-based detection. Removing the block drops 1.1 pt AUROC and 5.1 pt F1 on TUSZ 12 s, and 4.2 pt AUROC and 9.2 pt F1 on TUSZ 60 s, against the best HyBrain configuration on each task. The cost is larger on the 60 s setting, where the longer clip exposes more cross-channel and cross-time structure for the block to model. Swapping the backbone costs less than removing the hyperedge block (Table 5):
Table 6: Computational efficiency of seizure detection on TUSZ 60 s. Inference denotes average milliseconds per EEG segment. Memory-cost values above 1 indicate higher cost than ours, whereas values below 1 indicate lower cost.
| Method | Time (s/ep.) | Infer. (ms/seg.) | Memory (MB) | Memory cost |
|---|---|---|---|---|
| LSTM | 31.30 | 0.013 | 88.0 | 0.26× |
| CNN-LSTM | 29.90 | 0.264 | 1208.1 | 3.63× |
| BIOT | 86.07 | 3.264 | 1850.7 | 5.56× |
| LaBraM | 212.9 | 9.429 | 3576.7 | 10.75× |
| EEGPT | 151.2 | 4.425 | 1022.1 | 3.07× |
| EvolveGCN | 72.89 | 0.691 | 62.3 | 0.19× |
| DCRNN | 240.2 | 3.869 | 71.2 | 0.21× |
| GraphS4mer | 30.29 | 0.181 | 340.4 | 1.02× |
| GRU-GCN | 31.13 | 2.340 | 4605.5 | 13.84× |
| EvoBrain | 57.99 | 4.781 | 3981.7 | 11.96× |
| HyBrain () | 29.10 | 0.216 | 332.2 | 1.00× |
| HyBrain () | 29.70 | 0.219 | 332.5 | 1.00× |
| HyBrain () | 30.32 | 0.218 | 332.8 | 1.00× |
the hyperedge aggregation, not the backbone, is the critical component. This supports the efficiency-effectiveness argument in Section 3.6: its value scales with the channel-time grid, and the PMA readout alone cannot replace it.
5.2 Effectiveness of HyBrain
Table 6 and Figure 3 examine the accuracy-efficiency trade-off on TUSZ 60 s detection, where HyBrain achieves state-of-the-art performance. Excluding LSTM as a basic recurrent baseline, only GraphS4mer matches HyBrain's efficiency on both axes (1.00× time, 1.02× memory, relative to HyBrain ( )). Every other baseline is substantially worse than HyBrain on at least one of the two axes. The largest gaps appear in the edge-stream dynamic-GNN baselines, where the edge-level temporal model is the dominant memory bottleneck. As Section 3.6 explains, GRU-GCN and EvoBrain must retain one edge activation per pairwise edge at every time step, whereas HyBrain bypasses dynamic graph construction entirely and stores only one membership weight per token-hyperedge pair. Empirically, the measured total GPU memory ratios are 13.84× (GRU-GCN) and 11.96× (EvoBrain). The same bottleneck appears at inference time: HyBrain reduces per-segment latency by up to 95.5% relative to these edge-stream baselines. Large pretrained encoders (BIOT, LaBraM, EEGPT) are both memory-intensive (3.07–10.75×) and slow to train (2.84–7.02×). The lighter dynamic-GNN baselines, EvolveGCN and DCRNN, use less memory than HyBrain (0.19×, 0.21×), but pay for it with 2.40× and 7.92× longer training time. Together, these choices yield state-of-the-art AUROC on TUSZ 60 s at substantially lower compute and memory cost than the competitive baselines.
5.3 Visualization: From Pairwise Relations to Spatiotemporal Hyperedges
Figure 4 visualizes the membership of one learned hyperedge on a TUSZ 60 s clip spanning the preictal → ictal → postictal trajectory. The membership exhibits fluctuating preictal bursts before the annotated onset, transitions to a sustained and spatially broad pattern during the ictal interval, and is suppressed after the annotated offset. This three-phase membership pattern constitutes a compact, phase-discriminative signature from a single hyperedge.

Figure 3: Accuracy-efficiency plots on TUSZ 60 s detection, showing AUROC versus training time per epoch (left) and peak GPU memory (right).
Figure 5 provides a pairwise EvoBrain visualization for comparison. EvoBrain represents EEG connectivity through pairwise channel graphs at selected time points, so each visualization shows relations only within a fixed temporal slice. In contrast, HyBrain learns memberships over channel-time tokens, so a single hyperedge can trace a coordinated spatiotemporal pattern across the preictal, ictal, and postictal trajectory. This representation is more compact than a per-time-step pairwise graph and preserves cross-time structure that pairwise visualizations decompose.
5.4 Hyperedge Sensitivity
Figure 6 examines how performance varies with the number of hyperedges on the TUSZ 60 s detection task. Across , AUROC remains within [0.868, 0.908] and F1 within [0.537, 0.636], with maximum spreads of 0.040 and 0.099.
This stability indicates that the seizure-relevant structure on TUSZ is captured by a few coordinated channel-time groups. A single learnable hyperedge () already captures the phase-discriminative behavior shown in Figure 4, and gives the best 60 s result within a narrow, stable performance range. This robustness across supports the efficiency argument in Section 3.6: HyBrain retains global channel-time reach through a low-rank hyperedge representation, so it can model seizure-related coordination without scaling up to many pairwise edges or many latent groups.
6 Conclusion
We proposed HyBrain, a lightweight encoder that replaces per-time-step pairwise graph construction with a small set of learnable spatiotemporal hyperedges over channel-time tokens. On TUSZ and CHB-MIT, the same encoder reaches state-of-the-art

(a) Preictal → ictal → postictal topomap

(b) Preictal → ictal → postictal heatmap
Figure 4: Membership of one learned hyperedge on a TUSZ 60 s clip that traverses the full preictal → ictal → postictal trajectory. (a) Per-channel topomaps for each phase. (b) Membership over time. Dashed lines mark the labeled ictal interval.

Figure 5: EvoBrain’s pairwise EEG connectivity visualization across interictal, preictal, and ictal states, shown alongside Figure 4 for comparison.

Figure 6: Sensitivity of HyBrain to the number of hyperedges on TUSZ 60 s detection. Left: AUROC. Right: F1.
AUROC on window-based detection, one-second point-wise detection, and preictal seizure prediction. The largest margin appears on long-clip prediction, and HyBrain uses up to an order of magnitude less peak GPU memory than the edge-stream dynamic-GNN baselines. A single learned hyperedge remains active across the entire preictal → ictal → postictal trajectory, which indicates that one group embedding suffices to support both detection and prediction. These results indicate that a compact spatiotemporal hyperedge formulation can match or exceed edge-stream dynamic GNNs on EEG seizure tasks at substantially lower computational cost, particularly when the seizure-relevant signal is distributed across channels rather than concentrated in clearly separable pairwise relations.
A Additional Hyperedge Visualizations
Across clips and seizure subtypes, we observe the same qualitative pattern as in Figure 4. Preictal segments show a mild, laterally focused rise in membership, ictal segments become broadly active across channels, and postictal segments retain a decaying residual structure that remains distinguishable from the interictal baseline.
B Hyperparameters
For HyBrain, we grid search learning rate , weight decay , dropout , hidden dimension (the feature width of the Mamba backbone and hyperedge layers), and the temporal-attention gate , selecting by dev AUROC. The selected hidden dimension is ( for 12 s window detection on both datasets), with for detection and for prediction. The learning rate is ( for CHB-MIT 12 s window detection and for 12 s point-wise detection), and the weight decay is . Dropout is 0.2 on TUSZ and 0.1 on CHB-MIT for window-based detection, and 0.0 otherwise. All models are trained with Adam and gradient clipping 5 for up to 40 epochs, with early stopping on dev AUROC using patience 5. Training batch sizes are 128 for TUSZ 12 s window detection, 64 for prediction, and 32 otherwise, and the test batch size is 64.
References
[1] Nabeel Ahammad, Thasneem Fathima, and Paul Joseph. 2014. Detection of epileptic seizure event and onset using EEG. BioMed research international 2014, 1 (2014), 450573.
[2] David Ahmedt-Aristizabal, Tharindu Fernando, Simon Denman, Lars Petersson, Matthew J Aburn, and Clinton Fookes. 2020. Neural memory networks for seizure type classification. In 2020 42nd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC). IEEE, 569–575.
[3] Gregory K Bergey, Martha J Morrell, Eli M Mizrahi, Alica Goldman, David King-Stephens, Dileep Nair, Shraddha Srinivasan, Barbara Jobst, Robert E Gross, Donald C Shields, et al. 2015. Long-term treatment with responsive brain stimulation in adults with refractory partial seizures. Neurology 84, 8 (2015), 810–817.
[4] Hsiang-Han Chen and Vladimir Cherkassky. 2020. Performance metrics for online seizure prediction. Neural Networks 128 (2020), 22–32.
[5] Eli Chien, Chao Pan, Jianhao Peng, and Olgica Milenkovic. 2022. You are allset: A multiset function framework for hypergraph neural networks. In ICLR.
[6] Ian C Covert, Balu Krishnan, Imad Najm, Jiening Zhan, Matthew Shore, John Hixson, and Ming Jack Po. 2019. Temporal graph convolutional networks for automatic seizure detection. In Machine learning for healthcare conference. PMLR, 160–180.
[7] Jeff Craley, Christophe Jouny, Emily Johnson, David Hsu, Raheel Ahmed, and Archana Venkataraman. 2022. Automated seizure activity tracking and onset zone localization from scalp EEG using deep neural networks. PloS one 17, 2 (2022), e0264537.
Preictal
Ictal

0.52
0.50
0.48
Hyperedge membership
(a) Preictal → ictal topomap (clip 359)
Preictal
Ictal

0.52
0.50
0.48
Hyperedge membership
(c) Preictal → ictal topomap (clip 3907)
Ictal
Postictal

0.52
0.50
0.48
Hyperedge membership
(e) Ictal → postictal topomap (clip 547)
Ictal
Postictal

0.52
0.50
0.48
Hyperedge membership
(g) Ictal → postictal topomap (clip 3937)
Ictal
Postictal

0.52
0.50
0.48
Hyperedge membership
(i) Ictal → postictal topomap (clip 4303)

(b) Preictal → ictal heatmap (clip 359)
Channel
preictal
ictal

(d) Preictal → ictal heatmap (clip 3907)
Channel
postictal

(f) Ictal → postictal heatmap (clip 547)
Channel
ictal
postictal

(h) Ictal → postictal heatmap (clip 3937)
Channel
ictal
postictal

(j) Ictal → postictal heatmap (clip 4303)
Figure 7: Additional learned-hyperedge visualizations on TUSZ 60 s test clips. Rows (a)-(b) and (c)-(d) show preictal → ictal transitions; rows (e)-(f), (g)-(h), and (i)-(j) show ictal → postictal transitions. In every preictal → ictal example, the membership rises sharply across channels before or at the annotated onset; in every ictal → postictal example, the membership decays through the annotated offset.
[8] Jonathan Dan, Una Pale, Alireza Amirshahi, William Cappelletti, Thorir Mar Ingolfsson, Xiaying Wang, Andrea Cossettini, Adriano Bernini, Luca Benini, Sándor Beniczky, et al. 2025. SzCORE: A seizure community open-source research evaluation framework for the validation of EEG-based automated seizure detection algorithms. Epilepsia 66, S3 (2025), 14–24.
[9] Orrin Devinsky, Dale C Hesdorffer, David J Thurman, Samden Lhatoo, and George Richerson. 2016. Sudden unexpected death in epilepsy: epidemiology, mechanisms, and prevention. The Lancet Neurology 15, 10 (2016), 1075–1088.
[10] Jerome Engel. 2013. Seizures and epilepsy. Vol. 83. Oxford University Press.
[11] Yifan Feng, Haoxuan You, Zizhao Zhang, Rongrong Ji, and Yue Gao. 2019. Hypergraph neural networks. In AAAI.
[12] Kais Gadhoumi, Jean-Marc Lina, Florian Mormann, and Jean Gotman. 2016. Seizure prediction for therapeutic devices: A review. Journal of neuroscience methods 260 (2016), 270–282.
[13] Jianfei Gao and Bruno Ribeiro. 2022. On the equivalence between temporal and static equivariant graph representations. In ICML.
[14] Albert Gu and Tri Dao. 2023. Mamba: Linear-time sequence modeling with selective state spaces. arXiv preprint arXiv:2312.00752 (2023).
[15] Albert Gu, Karan Goel, and Christopher Ré. 2022. Efficiently modeling long sequences with structured state spaces. In ICLR.
[16] Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation 9, 8 (1997), 1735–1780.
[17] Wei-Bang Jiang, Liming Zhao, and Bao-Liang Lu. 2024. Large brain model for learning generic representations with tremendous EEG data in BCI. In ICLR.
[18] Rikuto Kotoge, Zheng Chen, Tasuku Kimura, Yasuko Matsubara, Takufumi Yanagisawa, Haruhiko Kishima, and Yasushi Sakurai. 2025. Evobrain: Dynamic multi-channel eeg graph modeling for time-evolving brain networks. Advances in Neural Information Processing Systems 38 (2025), 144514–144543.
[19] Levin Kuhlmann, Klaus Lehnertz, Mark P Richardson, Björn Schelter, and Hitten P Zaveri. 2018. Seizure prediction—ready for a new era. Nature Reviews Neurology 14, 10 (2018), 618–630.
[20] Vernon J Lawhern, Amelia J Solon, Nicholas R Waytowich, Stephen M Gordon, Chou P Hung, and Brent J Lance. 2018. EEGNet: a compact convolutional neural network for EEG-based brain-computer interfaces. Journal of neural engineering 15, 5 (2018), 056013.
[21] Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. 2019. Set transformer: A framework for attention-based permutation-invariant neural networks. In International conference on machine learning. PMLR, 3744–3753.
[22] Menghang Li, Min Qiu, Li Zhu, and Wanzeng Kong. 2023. Feature hypergraph representation learning on spatial-temporal correlations for EEG emotion recognition. Cognitive Neurodynamics 17, 5 (2023), 1271–1281.
[23] Yaguang Li, Rose Yu, Cyrus Shahabi, and Yan Liu. 2018. Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting. In ICLR.
[24] Florian Mormann, Ralph G Andrzejak, Christian E Elger, and Klaus Lehnertz. 2007. Seizure prediction: the long and winding road. Brain 130, 2 (2007),
314–333.
[25] Aldo Pareja, Giacomo Domeniconi, Jie Chen, Tengfei Ma, Toyotaro Suzumura, Hiroki Kanezashi, Tim Kaler, Tao Schardl, and Charles Leiserson. 2020. Evolvegcn: Evolving graph convolutional networks for dynamic graphs. In AAAI.
[26] Khaled Saab, Jared Dunnmon, Christopher Ré, Daniel Rubin, and Christopher Lee-Messer. 2020. Weak supervision as an efficient approach for automated seizure detection in electroencephalography. NPJ digital medicine 3, 1 (2020), 59.
[27] Vinit Shah, Eva Von Weltin, Silvia Lopez, James Riley McHugh, Lillian Veloso, Meysam Golmohammadi, Iyad Obeid, and Joseph Picone. 2018. The temple university hospital seizure detection corpus. Frontiers in neuroinformatics 12 (2018), 83.
[28] Ali Hossam Shoeb. 2009. Application of machine learning to epileptic seizure onset detection and treatment. Ph. D. Dissertation. Massachusetts Institute of Technology.
[29] Siyi Tang, Jared A Dunnmon, Qu Liangqiong, Khaled K Saab, Tina Baykaner, Christopher Lee-Messer, and Daniel L Rubin. 2023. Modeling multivariate biosignals with graph neural networks and structured state space models. In Conference on health, inference, and learning. PMLR, 50–71.
[30] Siyi Tang, Jared A Dunnmon, Khaled Saab, Xuan Zhang, Qianying Huang, Florian Dubost, Daniel L Rubin, and Christopher Lee-Messer. 2021. Self-supervised graph neural networks for improved electroencephalographic seizure analysis. arXiv preprint arXiv:2104.08336 (2021).
[31] Nhan Duy Truong, Anh Duy Nguyen, Levin Kuhlmann, Mohammad Reza Bonyadi, Jiawei Yang, Samuel Ippolito, and Omid Kavehei. 2018. Convolutional neural networks for seizure prediction using intracranial and scalp electroencephalogram. Neural networks 105 (2018), 104–111.
[32] Guagnyu Wang, Wenchao Liu, Yuhong He, Cong Xu, Lin Ma, and Haifeng Li. 2024. Eegpt: Pretrained transformer for universal and reliable representation of eeg signals. NeurIPS (2024).
[33] Scott B Wilson, Mark L Scheuer, Cheryl Plummer, Bryan Young, and Steve Pacia. 2003. Seizure detection: correlation of human experts. Clinical Neurophysiology 114, 11 (2003), 2156–2164.
[34] M Winterhalder, T Maiwald, HU Voss, R Aschenbrenner-Scheibe, J Timmer, and A Schulze-Bonhage. 2003. The seizure prediction characteristic: a general framework to assess and compare seizure prediction methods. Epilepsy & Behavior 4, 3 (2003), 318–325.
[35] Naganand Yadati, Madhav Nimishakavi, Prateek Yadav, Vikram Nitin, Anand Louis, and Partha Talukdar. 2019. Hypergcn: A new method for training graph convolutional networks on hypergraphs. Advances in neural information processing systems 32 (2019).
[36] Chaoqi Yang, M Westover, and Jimeng Sun. 2023. Biot: Biosignal transformer for cross-data learning in the wild. NeurIPS (2023).