Table of Contents
Fetching ...

Epileptic Seizure Prediction Using Patient-Adaptive Transformer Networks

Mohamed Mahdi, Asma Baghdadi

Abstract

Epileptic seizure prediction from electroencephalographic (EEG) recordings remains challenging due to strong inter-patient variability and the complex temporal structure of neural signals. This paper presents a patient-adaptive transformer framework for short-horizon seizure forecasting. The proposed approach employs a two-stage training strategy: self-supervised pretraining is first used to learn general EEG temporal representations through autoregressive sequence modeling, followed by patient-specific fine-tuning for binary prediction of seizure onset within a 30-second horizon. To enable transformer-based sequence learning, multichannel EEG signals are processed using noise-aware preprocessing and discretized into tokenized temporal sequences. Experiments conducted on subjects from the TUH EEG dataset demonstrate that the proposed method achieves validation accuracies above 90% and F1 scores exceeding 0.80 across evaluated patients, supporting the effectiveness of combining self-supervised representation learning with patient-specific adaptation for individualized seizure prediction.

Epileptic Seizure Prediction Using Patient-Adaptive Transformer Networks

Abstract

Epileptic seizure prediction from electroencephalographic (EEG) recordings remains challenging due to strong inter-patient variability and the complex temporal structure of neural signals. This paper presents a patient-adaptive transformer framework for short-horizon seizure forecasting. The proposed approach employs a two-stage training strategy: self-supervised pretraining is first used to learn general EEG temporal representations through autoregressive sequence modeling, followed by patient-specific fine-tuning for binary prediction of seizure onset within a 30-second horizon. To enable transformer-based sequence learning, multichannel EEG signals are processed using noise-aware preprocessing and discretized into tokenized temporal sequences. Experiments conducted on subjects from the TUH EEG dataset demonstrate that the proposed method achieves validation accuracies above 90% and F1 scores exceeding 0.80 across evaluated patients, supporting the effectiveness of combining self-supervised representation learning with patient-specific adaptation for individualized seizure prediction.

Paper Structure

This paper contains 19 sections, 21 equations, 3 figures, 6 tables.

Figures (3)

  • Figure 1: Overall architecture of the proposed patient-specific seizure prediction framework. The pipeline consists of four main stages: (1) Noise-aware preprocessing using adaptive FFT-based filtering, (2) EEG tokenization with z-score normalization and quantization into 512 discrete levels, (3) Self-supervised GPT pre-training using next-token prediction with dual loss, and (4) Patient-specific supervised fine-tuning for 30-second horizon seizure prediction.
  • Figure 2: Training convergence — Training and validation loss/accuracy curves for three patient-specific fine-tuning runs. Both pretraining and fine-tuning were run for 5,000 steps; gradient accumulation and mixed precision were used to maximize effective batch size.
  • Figure 3: Representative alarm timeline and confidence curve -- Top: binary alarms (red) vs non-alarm (green) over time with ground-truth seizure windows highlighted in orange. Bottom: model seizure probability (confidence) over the same recording. Vertical axis shows probability in [0,1]; dashed line indicates decision threshold.