Classification of Epileptic iEEG using Topological Machine Learning
Authors: Sunia Tanweer, Narayan Puthanmadam Subramaniyam, Firas A. Khasawneh
Organizations: Department of Mechanical Engineering, Michigan State University, East Lansing, 48823, MI, USA. · Department of Computational Mathematics, Science and Engineering, Michigan State University, East Lansing, 48823, MI, USA. · Faculty of Medicine and Health Technology, Tampere University, Tampere, Finland. · A.I.Virtanen Insttute of Molecular Sciences, University of Eastern Finland, Kuopio, Finland.
Epileptic seizure detection from EEG signals remains challenging due to the high dimensionality and nonlinear, potentially stochastic, dynamics of neural activity. In this work, we investigate whether features derived from topological data analysis (TDA) can improve the classification of brain states in preictal, ictal and interictal iEEG recordings from epilepsy patients using multichannel data. We analyze data from 55 patients, significantly larger than many previous studies that rely on patient-specific models. Persistence diagrams derived from iEEG signals are vectorized using several TDA representations, including Carlsson coordinates, persistence images, and template functions. To understand how topological representations interact with modern machine learning pipelines, we conduct a large-scale ablation study across multiple iEEG frequency bands, dimensionality reduction techniques, feature representations, and classifier architectures. Our experiments show that dimension-reduced topological representations achieve up to 80% balanced accuracy for three-class classification. Interestingly, classical machine learning models perform comparably to deep learning models, achieving up to 79.17% balanced accuracy, suggesting that carefully designed topological features can substantially reduce model complexity requirements. In contrast, pipelines preserving the full multichannel feature structure exhibit severe overfitting due to the high-dimensional feature space. These findings highlight the importance of structure-preserving dimensionality reduction when applying topology-based representations to multichannel neural data.
Figures & tables
Figure 1: Sublevel Persistence on 1D signals.
Figure 2: Overview of the two classification pipelines considered in this study: (a) Dimension-reduced and (b) Multichannel preserving channel-wise features.
Rank
Accuracy
Band
Dim Red
Feature
Classifier
1
80.00%
Low Gamma
FA
Carlsson
Conv1DMLP
2
79.17%
Beta
FA
Carlsson
Logistic Regression
3
77.78%
Delta
LLE
Carlsson
Logistic Regression
4
77.78%
Delta
LLE
Carlsson
LinearSVC
5
77.08%
Beta
FA
Carlsson
LinearSVC
6
73.67%
Alpha
NMF
Polynomial Template
MLP (sklearn)
Table 1: Top 10 performing configurations in the dimension-reduced pipeline.
Figure 3: Comparison of balanced accuracy between classical machine learning models and deep learning models across all configurations.
Figure 4: Comparison of balanced accuracy between frequency bands across all configurations.
Figure 5: Comparison of balanced accuracy between dimensionality reduction techniques across all configurations.
Figure 6: Comparison of balanced accuracy between various feature sets across all configurations.
Electroencephalography (EEG) is a critical tool for monitoring brain activity and diagnosing neurological disorders such as epilepsy. However, learning meaningful representations from raw EEG signals remains challenging due to limited annotations, substantial inter-subject variability, and complex temporal dynamics. Recent EEG foundation models (FMs) have demonstrated promising performance through transformer-based architectures and large-scale self-supervised pretraining, yet they often incur substantial computational costs and exhibit diminishing returns with increasing model and dataset scale, limiting their practicality in clinical settings. To address these challenges, we propose EEGDM, a diffusion-based EEG representation learning framework. Specifically, EEGDM introduces a Structured State-Space Model for Diffusion Pretraining (SSMDP) that effectively captures long-range temporal dependencies through generative diffusion training on unlabeled EEG data. The representations are subsequently leveraged for downstream tasks via our Latent Fusion Module (LFM), which integrates multi-layer latent features of SSMDP. We evaluate EEGDM on three EEG benchmarks spanning EEG event classification (TUEV), seizure detection (CHB-MIT), and seizure classification (IIIC). Compared with existing state-of-the-art methods, including EEG FMs, EEGDM achieves competitive performance across diverse tasks and datasets, exceeding existing methods in most cases while requiring substantially fewer samples for both pretraining and downstream adaptation. These results demonstrate that diffusion-based learning can unlock more discriminative EEG representations, with direct implications for epilepsy diagnosis and management. Our source code and pretrained checkpoints are publicly available at: https://github.com/jhpuah/EEGDM.
Jia Hong Puah, Sim Kuan Goh, Ziwei Zhang +6
School of Artificial Intelligence and Robotics, Xiamen University Malaysia · School of Energy and Chemical Engineering, Xiamen University Malaysia · Department of Biomedical Engineering, Universiti Malaya +3
Persistent homology (PH) -- the conventional method in topological data analysis -- is computationally expensive, requires further vectorization of its signatures before machine learning (ML) can be applied, and captures information along only the spatial axis. For time series data, we propose Euler Characteristic Surfaces (ECS) as an alternative topological signature based on the Euler characteristic (χ) -- a fundamental topological invariant. The ECS provides a computationally efficient, spatiotemporal, and inherently discretized feature representation that can serve as direct input to ML models. We prove a stability theorem guaranteeing that the ECS remains stable under small perturbations of the input time series. We first demonstrate that ECS effectively captures the nontrivial topological differences between the limit cycle and the strange attractor in the Rössler system. We then develop an ECS-based classification framework and apply it to five benchmark biomedical datasets (four ECG, one EEG) from the UCR/UEA archive. On ECG5000, our single-feature ECS classifier achieves 98% accuracy with O(n+R⋅T) complexity, compared to 62% reported by a recent PH-based method. An AdaBoost extension raises accuracy to 98.6%, matching the best deep learning results while retaining full interpretability. Strong results are also obtained on TwoLeadECG (94.1%) and Epilepsy2 (92.6%).
National Institute of Technology, Department of Physics, Ravangla, 737139, India · George Washington University, Data science program, Washington, DC, 20052, USA · Montana Technological University, Department of Mathematical Sciences, Butte, 59701, USA
Deep learning for EEG-based seizure detection faces critical challenges: severe annotation scarcity and extreme class imbalance, where ictal events comprise less than 10% of clinical recordings. We present DiffEEG, a 9.6M-parameter self-supervised foundation model that addresses both limitations through denoising diffusion pre-training and reinforcement learning (RL)-based fine-tuning. Pre-trained on 1.3M unlabeled segments from the Temple University Hospital Seizure Corpus (TUHSZ), DiffEEG learns generic neural representations via a 1D U-Net with multi-head self-attention. For downstream adaptation, a reinforced decision layer employs policy gradient optimization to directly maximize F1-score, prioritizing sensitivity to rare seizure events over overall accuracy. Under strict patient-wise evaluation (279 patients, Leave-One-Fold-Out), DiffEEG achieves 61% accuracy and 59% F1 for 4-class seizure subtyping, and 81% accuracy with 85% weighted F1 for binary detection, maintaining clinically viable seizure recall (59%) despite extreme imbalance (6.7% prevalence). Segment-level evaluation establishes an upper bound of 97.6% accuracy, confirming strong architectural capacity. DiffEEG demonstrates that diffusion-based pre-training combined with metric-aware reinforcement learning enables clinically deployable seizure monitoring with minimal labeled data requirements.
Abdulkader Helwan, Lina Abou-Abbas, Hussein El Amouri +2
Department of Electrical and Computer Engineering, Lebanese American University, Byblos, Lebanon · Institute of Applied Artificial Intelligence, TÉLUQ University, Montreal, Canada