This project aims to develop and evaluate models for seizure detection using EEG data. It includes data cleaning, model training, and testing model robustness through challenging test cases. Additionally, it explores EEG signal reconstruction and augmentation using autoencoders and variational autoencoders (VAEs).
README.md
data/
data.csv
: original datasetdata_cleaned.csv
: cleaned datasethard_test_cases/
train.csv
test.csv
models/
CVAE/
class_embedding_model/
cvae_decoder_model/
autoencoder.h5
autoencoder_2d_dropout.h5
eda_and_cleaning.ipynb
baseline_detection_model.ipynb
generate_challenging_test_cases.ipynb
data_augmentation/
: recommend to use GPUtrain_autoencoder.ipynb
train_vae_and_conditional_vae.ipynb
data_augmentation_pipeline.ipynb
- Create environment
conda create --name seizuredetection python=3.10 -y
conda activate seizuredetection
pip install .
-
Download model files from Google Drive and put the
models/
folder in the project directory. -
Run the notebooks in sequence for a complete workflow:
- Start with
eda_and_cleaning.ipynb
to clean and preprocess the data. - Train baseline models using
baseline_detection_model.ipynb
. - Generate challenging test cases with
generate_challenging_test_cases.ipynb
. - Perform EEG signal reconstruction and augmentation with
train_autoencoder.ipynb
,train_vae_and_conditional_vae.ipynb
. - Augment signals and evaluate again with seizure dataset with
data_augmentation_pipeline.ipynb
.
- Start with
Description: This notebook performs initial data cleaning, transformations, and exploratory data analysis to prepare the dataset for modeling.
Output Files:
data/data.csv
: The original raw dataset.data/cleaned_data.csv
: The cleaned dataset focused on seizure data.
Description: Implements baseline models such as SVM, ANN, and Inception Nucleus. Performance is evaluated using standard metrics.
Description: This notebook generates challenging test cases to assess the robustness of seizure detection models.
Output Files:
data/hard_test_cases/train.csv
: Training data for hard test cases.data/hard_test_cases/test.csv
: Hard test cases for model evaluation.
Description: Trains an autoencoder model for EEG signal reconstruction.
Output Files:
- Trained autoencoder model.
Description: Trains both a Variational Autoencoder (VAE) and a Conditional VAE for EEG signal augmentation.
Output Files:
- Trained VAE and Conditional VAE models.
Description: Implements a synthetic data augmentation pipeline to generate variations of EEG signals using the following methods:
- Noise: Add noise to the data.
- Time Warping: Alters the temporal properties of the signal.
- Time Drifting: Add drift to simulate gradual shifts over time.
- Time Croping: Crop the time-series to 90% of its original length.
- Amplitude Scaling: Scales the amplitude of the signal.
- Autoencoder: Reconstructs or augments EEG signals.
- Conditional Variational Autoencoder (CVAE): Generates augmented data conditioned on specific labels.
Output: A function with original signals and augmentation methods as input, and reconstructed EEG signals as output.
The data augmentation pipeline evaluates seizure detection model performance after applying various augmentation techniques, ensuring robustness and accuracy across diverse datasets.
Feel free to reach out to authors for more details:
Naman Garg: [email protected]
Meixi Lu: [email protected]
Ramirez-Aristizabal, Adolfo: [email protected]