Skip to content

Comparison of deep learning and graph-based models for EEG seizure detection on 97 patients. Evaluates CNNs, RNNs, and spatio-temporal GCNs to assess spatial modeling and robustness in epilepsy detection.

Notifications You must be signed in to change notification settings

theS3b/Graph-based-EEG-Analysis

Repository files navigation

📝 Abstract

Epilepsy affects over 50 million people worldwide, and accurate seizure detection is crucial for patient care. This study compares classical deep learning and graph-based approaches for detecting seizures from EEG signals recorded from 97 patients. Convolutional and recurrent models are evaluated against graph convolutional networks that encode electrode topology. The best classical model, a modified convolutional autoencoder, achieves a validation F1 score of 74.8 percent, while the best graph-based model, a spatio-temporal GCN, reaches 70.6 percent. Results show that spatial modeling improves robustness but compact convolutional models remain more effective.

Installation

Run Locally

  1. Install Pixi if not already done.

  2. Run the following in the root of the repository (requires cuda 12.2, same as the cluster):

    pixi install
  3. Clear the cache and reload VS Code window.

  4. You should find the kernel as the default kernel in VS Code.

EPFL Cluster

Using Pixi

  1. Install Pixi if not already done.

  2. Launch a compute node:

    Sinteract -t 12:00:00 -g gpu:1 -m 16G
  3. Run the following in the root of the repository to install dependencies (do that in the compute node):

    pixi install
  4. Clear the cache and reload VS Code window.

  5. You should find the kernel as the default kernel in VS Code.

Using Python Virtual Environment (not recommended)

If you prefer to use a Python virtual environment instead of Pixi, you can follow these steps. Note that this is not the recommended way, as Pixi provides a more robust and reproducible environment.

To set up the environment on the EPFL cluster, follow these steps:

# Be up to date
git pull

# Create a new environment (if not already done)
module purge
slmodules -r future
module load gcc python
python -m venv --system-site-packages venvs/graph-eeg

# Activate the virtual environment
source venvs/graph-eeg/bin/activate

# Install dependencies
python -m pip install --upgrade pip
pip install jupyter

# Install project dependencies (IMPORTANT: load first)
module load openmpi py-torch
pip install -r requirements.txt

Once the environment is created, you can use the following command to launch a jupyter lab session:

# Launch a compute node
Sinteract -t 12:00:00 -g gpu:1 -m 16G

# Start from clean environment
module purge

# Load the required modules
slmodules -r future
module load gcc python

# Load the environment
source venvs/graph-eeg/bin/activate
module load openmpi py-torch

# Launch jupyter lab
ipnport=$(shuf -i8000-9999 -n1)

##  in the foreground
jupyter lab --no-browser --port=$ipnport

##  in the background
nohup jupyter lab --no-browser --port=8888 &

To update the environment, you can run:

# Start from clean environment
module purge

# Load the required modules
slmodules -r future
module load gcc python

# Load the environment
source venvs/graph-eeg/bin/activate
# VERY IMPORTANT to first load the modules
module load openmpi py-torch

# Update the environment
pip install -r requirements.txt

About

Comparison of deep learning and graph-based models for EEG seizure detection on 97 patients. Evaluates CNNs, RNNs, and spatio-temporal GCNs to assess spatial modeling and robustness in epilepsy detection.

Resources

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •