Seizure Prediction in EEG Signals Using STFT and Domain Adaptation

Peizhen Peng, Yang Song, Yang Lü, Haikun WeiFrontiers in Neuroscience 2022 · DOI

TL;DR

This paper introduces a novel domain adaptation (DA) framework to solve the "patient-specificity" problem in epileptic seizure prediction. By combining Short-Time Fourier Transform (STFT) with an Adversarial Autoencoder (AAE) and minimizing inter-domain distances, the model learns universal, domain-invariant features that allow it to predict seizures in new patients with significantly higher accuracy than traditional methods.

What Problem Does This Paper Address?

The "holy grail" of seizure prediction is a device that works for any patient "out of the box." Currently, most prediction models are patient-specific: they must be trained on weeks or months of data from a single individual to be effective. This is because EEG signals exhibit massive inter-individual variability—what a "pre-seizure" state looks like in Patient A might look like normal resting state in Patient B.

In machine learning terms, this is a domain shift problem. When a model trained on one group of people (the source domain) is applied to a new person (the target domain), its performance usually plummets. This paper aims to bridge that gap using domain adaptation, creating a more "universal" predictor that requires minimal data from a new patient to function effectively.

Methods

The authors propose a multi-stage pipeline designed to extract features that are consistent across different brains:

  1. Feature Extraction (STFT): Raw EEG signals are messy. The researchers use the Short-Time Fourier Transform (STFT) to convert 1D time-series data into 2D time-frequency maps (spectrograms). This captures how different brain wave frequencies evolve over time, which is more informative for identifying the "preictal" (pre-seizure) state.
  2. Adversarial Autoencoder (AAE): These spectrograms are fed into an autoencoder. The goal is to compress the complex EEG data into a high-dimensional "embedding space."
  3. Distribution Alignment (MMD): To ensure the embedding space is "domain-invariant," the authors use Maximum Mean Discrepancy (MMD). This mathematical tool measures the distance between the distributions of different patients. By minimizing this distance during training, the model is forced to ignore patient-specific quirks and focus on shared seizure signatures.
  4. Adversarial Regularization: To prevent the model from overfitting to specific patients, they use a discriminator that forces the latent code to follow a Laplace prior.
  5. Clinical Simulation: Unlike many papers that use idealized data, this study mimics a realistic clinical scenario. They use a "Leave-one-out" strategy but include exactly one seizure from the "target" patient in the training set, simulating a patient who has just entered a clinic and provided a tiny amount of data.

Datasets

The model was validated on two major open-source EEG databases:

  • Freiburg Hospital Database: Contains intracranial EEG (iEEG) recordings from 21 patients. iEEG is recorded via electrodes placed directly on or in the brain, offering high signal-to-noise ratios.
  • CHB-MIT Database: Contains scalp EEG recordings from 22 pediatric patients. Scalp EEG is non-invasive but much noisier and more susceptible to artifacts (like muscle movement).

Key Insights and Ideas

  • Domain-Invariant Signatures: The core "aha" moment is that while raw EEG looks different across patients, there is a shared underlying manifold for the preictal state. By using MMD to "squish" different patient distributions together in high-dimensional space, the model can find these universal markers.
  • The Power of Adversarial Learning: The authors found that adversarial structures are particularly good at alleviating individual variability. The discriminator acts as a "quality control" mechanism that ensures the features being learned are generalized rather than specific to one person's anatomy.
  • MMD vs. The Rest: The study compared MMD against other distance measures like Standardized Euclidean and KL-divergence. MMD consistently provided a 3-4% boost in precision, suggesting it is a superior metric for aligning complex biological signals like EEG.

Key Results

The proposed model outperformed both conventional deep learning models (like CNNs) and other state-of-the-art domain adaptation methods (like MIDA or SIDA):

  • Intracranial EEG (Freiburg): Achieved an average sensitivity of 76% and a False Prediction Rate (FPR) of 0.19 per hour. This is a significant improvement over the 59% sensitivity seen in standard CNN approaches under the same cross-subject conditions.
  • Scalp EEG (CHB-MIT): Achieved an average sensitivity of 73% and an FPR of 0.24 per hour. While lower than iEEG (due to noise), it still represented a massive leap over conventional methods (which averaged ~51% sensitivity).
  • Robustness: Even for "outlier" patients where other models failed completely, this DA-based approach maintained a baseline level of predictive power.

Limitations and Future Work

  • The "Outlier" Problem: Despite the improvements, some patients (e.g., Pt 5 and Pt 11 in the Freiburg set) still showed subpar results. The authors suggest these individuals might have "complex internal modes" that even current DA techniques can't fully capture.
  • Scalp EEG Noise: The performance drop from intracranial to scalp EEG highlights that noise and artifacts remain a major hurdle for non-invasive wearable devices.
  • Interpretability: While the model predicts well, the "black box" nature of the AAE means we don't yet fully understand what specific neurophysiological features the model is identifying as domain-invariant. Future work could focus on "opening the box" to gain new neurological insights into epilepsy.

Summary updated

Abstract

Epileptic seizure prediction is one of the most used therapeutic adjuvant strategies for drug-resistant epilepsy. Conventional approaches commonly collect training and testing samples from the same patient due to inter-individual variability. However, the challenging problem of domain shift between various subjects remains unsolved, resulting in a low conversion rate to the clinic. In this work, a domain adaptation (DA)-based model is proposed to circumvent this issue. The short-time Fourier transform (STFT) is employed to extract the time-frequency features from raw EEG data, and an autoencoder is developed to map these features into high-dimensional space. By minimizing the inter-domain distance in the embedding space, this model learns the domain-invariant information, such that the generalization ability is improved by distribution alignment. Besides, to increase the feasibility of its application, this work mimics the data distribution under the clinical sampling situation and tests the model under this condition, which is the first study that adopts the assessment strategy. Experimental results on both intracranial and scalp EEG databases demonstrate that this method can minimize the domain gap effectively compared with previous approaches.
BibTeX
@inproceedings{peng2022seizure,
  author = {Peizhen Peng and Yang Song and Yang Lü and Haikun Wei},
  title = {{Seizure Prediction in EEG Signals Using STFT and Domain Adaptation}},
  booktitle = {Frontiers in Neuroscience},
  year = {2022},
  doi = {10.3389/fnins.2021.825434},
}
Figure