Long-Term EEG Partitioning for Seizure Onset Detection

Zheng Chen, Yasuko Matsubara, Yasushi Sakurai, Jimeng Sun

TL;DR

Standard deep learning models for seizure detection often suffer from noisy, flickering predictions over long EEG recordings, making it difficult to pinpoint exactly when a seizure begins. To resolve this, researchers developed SODor, a two-stage framework that treats seizure onset detection as a subsequence clustering problem. By enforcing temporal consistency and analyzing channel-wise correlations, SODor eliminates false alarms and accurately identifies clean state transitions from normal brain activity to a seizure.

What Problem Does This Paper Address?

Deep learning has excelled at classifying short segments (epochs) of EEG data as either "normal" or "seizure." However, when these models are applied to continuous, long-term recordings, they frequently suffer from abrupt misclassifications—randomly flipping labels back and forth within a single continuous state.

This flickering output creates a high rate of false alarms, making the system uninterpretable and frustrating for clinicians. To be clinically useful, a model must accurately identify the exact Seizure Onset (SO) timestamp. Pinpointing this transition is vital for localizing brain regions for surgical removal or timing neuromodulatory intervention devices. Existing fixes rely on empirical post-processing (like majority voting over a sliding window), which requires tedious, patient-specific manual tuning and completely ignores the underlying neural feature dynamics.

Figure 1: A visualization of 55 two-second epochs using an second-level classification method shows some unexpected abrupt misclassifications. This issue may lead to unexplain- able outcomes for clinicians.

Methods

SODor tackles the onset detection problem through a distinct two-stage pipeline:

  1. Second-Level Representation Learning: Instead of training a model to output a simple binary label for an entire EEG epoch, SODor uses a Graph Neural Network (GNN) with diffusion convolution and a Gated Recurrent Unit (GRU) to learn channel-wise logits (probabilities) for each short segment. A max-pooling layer selects the most prominent channel signal to compute the classification loss, ensuring that localized seizure markers are preserved.
  2. Sequence-Level Clustering and Segmentation: The sequence of channel-wise logits is treated as a multivariate time series and fed into a model-based subsequence clustering algorithm. This algorithm utilizes a block Toeplitz inverse covariance matrix formulation to capture time-invariant structural patterns. Crucially, the optimization objective includes a temporal consistency penalty that discourages rapid, unrealistic state switching. The points where the cluster assignments transition mark the exact seizure onsets.

Datasets

The authors evaluated SODor on three real-world scalp EEG datasets:

  • CHB-MIT: 844 hours of continuous scalp EEG from 22 patients, capturing 163 seizure episodes.
  • HUH (University of Helsinki): 21-channel scalp EEG data from 79 patients.
  • TUSZ (Temple University Hospital Seizure Corpus): A massive clinical benchmark containing 5,612 EEG recordings with 3,050 annotated seizures.

The framework was evaluated on both standard Seizure Onset (SO) detection and the more challenging Preictal Seizure Onset (PSO) prediction task (identifying the 5-minute warning window preceding a seizure).

Key Insights and Ideas

  • From Classification to Clustering: Shifting the paradigm from independent epoch classification to sequence-aware subsequence clustering naturally mirrors the continuous, state-based nature of human brain activity.
  • Logits as Interpretable Features: Instead of clustering uninterpretable latent embeddings, SODor clusters channel-wise probabilities. This preserves the physical identity of the EEG channels, allowing researchers to extract sparse precision matrices ($\Theta_k$) that map out how brain connectivity physically changes and becomes denser during a seizure.
  • The Power of Max-Pooling: Seizures often originate from localized, abnormal neural connections. The authors demonstrated that max-pooling across channels preserves these distinct regional markers far better than mean or weighted pooling, which tend to wash out localized signals.

Key Results

SODor significantly outperformed all baseline methods—including state-of-the-art GNN classifiers and traditional post-processing smoothers—across all three datasets.

  • Quantitative Improvements: On the CHB-MIT dataset, SODor achieved a Normalized Mutual Information (NMI) of 0.979, an Adjusted Rand Index (ARI) of 0.964, and an Accuracy (ACC) of 0.981. This represents a 5% to 11% accuracy improvement over standard classification and post-processing baselines.
  • Qualitative Performance: As shown in the paper's case studies, SODor successfully smoothed out random classification blips automatically, providing clean, distinct state boundaries that closely match clinical ground truth without requiring manual parameter tuning.

Limitations and Future Work

  • Fixed Cluster Counts: The current formulation requires pre-specifying the number of clusters ($K=2$ for onset detection, $K=3$ for preictal detection). While the authors note that statistical criteria like the Bayesian Information Criterion (BIC) can estimate $K$, an automated, dynamic state discovery mechanism would be more robust.
  • Two-Stage Training: Because the representation learning and clustering are handled sequentially, the feature extractor isn't directly optimized for the clustering objective. Developing a fully end-to-end joint optimization framework remains an open direction for future work.

Summary updated

Abstract

Deep learning models have recently shown great success in classifying epileptic patients using EEG recordings. Unfortunately, classification-based methods lack a sound mechanism to detect the onset of seizure events. In this work, we propose a two-stage framework, SODor, that explicitly models seizure onset through a novel task formulation of subsequence clustering. Given an EEG sequence, the framework first learns a set of second-level embeddings with label supervision. It then employs model-based clustering to explicitly capture long-term temporal dependencies in EEG sequences and identify meaningful subsequences. Epochs within a subsequence share a common cluster assignment (normal or seizure), with cluster or state transitions representing successful onset detections. Extensive experiments on three datasets demonstrate that our method can correct misclassifications, achieving 5\%-11\% classification improvements over other baselines and accurately detecting seizure onsets.
BibTeX
@inproceedings{chen2025long,
  author = {Zheng Chen and Yasuko Matsubara and Yasushi Sakurai and Jimeng Sun},
  title = {{Long-Term EEG Partitioning for Seizure Onset Detection}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i13.33557},
}
Figure