Published February 6, 2025 | Version 1.0.0
Dataset Open

SeizyML: Feature Dataset with Accompanying Code for Seizure Detection Model Reproducibility

  • 1. ROR icon Tufts University

Description

Abstract

This repository contains the code, data, and pre-trained models necessary to reproduce the experiments and figures presented in the accompanying paper (doi: 10.1007/s12021-025-09719-4). In the paper we introduce SeizyML an open-software that use uses interpretable machine learning models to detect seizures from EEG recordings.

Summary

The central script, run_experiments.py, orchestrates model training and processing. All trained models and score files are also included to allow figure reproduction without model training.

  1. This archive contains features calculated from chronic LFP/EEG recordings in a mouse model of temporal lobe epilepsy which were obtained as part of the study described here.
  2. Additionally, this archive contains features obtained from the CHB-MIT dataset.
  3. Finally, this archive contains the code to reproduce figures from the accompanying paper (doi: 10.1007/s12021-025-09719-4 - A description of how the features were extracted is also included here).
  4. These features can also be used to compare the performance of other models with the machine learning models described in the accompanying paper.

Usage Instructions

1. Publication figures can be reproduced by running the figure related scripts as all trained models and score files are included in the trained_models folder.

For example

python figure4_post_processing.py

2. To run specific experiments or reproduce figures, execute the script with one of the available tasks as an argument:

python run_experiments.py <task_name>

Task Name Description Related Figures
per_file Trains models using per-file normalization Figures 2-4, Supp. Fig. 4
all_file Trains models using all-file normalization Figure 2
time_plots Generates time-based prediction plots Figure 3, Supp. Fig. 3
post_processing Applies post-processing to model outputs Figure 4
train_size Evaluates models with varying training set sizes Figure 5
permute_labels Trains models with permuted labels to test robustness Figure 5
small_models_permute Evaluates small dataset models with permuted labels Figure 5-6
gnb_one_feature Trains Gaussian Naive Bayes models using a single feature Supp. Fig. 5
norm_comps_mouse
Compares normalization techniques (mouse data) Figure 7
norm_comps_chb_mit
Compares normalization techniques (CHB-MIT dataset) Figure 7

Dependencies

Dependencies include:

  1. Python 3.9-3.11
  2. Numpy
  3. Pandas
  4. Seaborn
  5. tqdm
  6. Scipy
  7. Scikit-learn
  8. joblib
  9. statsmodels

An example requirements.txt file with our full environment details is also included.

Directory Structure / Contents

├── figure2_factor_comparisons.py            # Script to generate Figure 2
├── figure3_seizure_predictions_time.py    # Script to generate Figure 3
├── figure4_post_processing.py                 # Script to generate Figure 4
├── figure5_model_robustness.py              # Script to generate Figure 5
├── figure6_feature_importance.py            # Script to generate Figure 6
├── figure7_norm_comparisons.py             # Script to generate Figure 7
├── supp_figure_4_pac_sgd.py                    # Script for Supplementary Figure 4
├── supp_figure_5_gnb_one_feature.py      # Script for Supplementary Figure 5
├── run_experiments.py                              ## Main script for training and validation experiments
├── requirements.txt
├── data
│   ├── features_chbmit                    # EEG features from the CHB-MIT dataset
│   ├── features_mouse
│   │   ├── train                                 # Mouse training data features
│   │   └── test                                  # Mouse test data features
│   └── trained_models                     # Pre-trained models/files for reproducibility
├── sz_utils
│   ├── compile_features.py
│   ├── compile_features_chbmit.py
│   ├── feature_selection.py
│   ├── post_processing.py
│   ├── seizure_match.py
│   ├── test_scores.py
│   └── time_plots.py
└── training
    ├── grid_search.py
    ├── train_gnb_one_feature.py
    ├── train_models_basic.py
    ├── train_models_norm_comps.py
    ├── train_models_permute_labels.py
    ├── train_models_train_size.py
    ├── train_small_models_permute_labels.py
    └── train_test_chbmit.py

Contact

For questions regarding the code, data, or reproducibility, please contact the corresponding author of the paper.

Files

seizyml_features_and_code.zip

Files (2.0 GB)

Name Size Download all
md5:3c26b954b850fb93227e4a66526d0add
2.0 GB Preview Download

Additional details

Software

Programming language
Python
Development Status
Active