Analyze and manipulate EEG data using PyEEGLab
Project description
PyEEGLab
Analyze and manipulate EEG data using PyEEGLab.
Introduction
PyEEGLab is a python package developed to define pipeline for EEG preprocessing for a wide range of machine learning tasks. It supports set of datasets out-of-the-box and allow you to adapt your preferred one.
How it Works
Here is a simple quickstart:
from pyeeglab import *
dataset = TUHEEGAbnormalDataset()
pipeline = Pipeline([
CommonChannelSet(),
LowestFrequency(),
ToDataframe(),
MinMaxCentralizedNormalization(),
DynamicWindow(8),
ToNumpy()
])
dataset = dataset.set_pipeline(preprocessing).load()
data, labels = dataset['data'], dataset['labels']
In this example, for each sample in the dataset, a common set of electrodes is selected, then downsampled to the lowest frequency and normalized using a min-max centralized approach. Each sample is then splitted in eight windows or frames.
This approach is quite usefull for tasks like artifact classification or seizure detection.
How to Install
PyEEGLab is distributed using the pip repository:
pip install PyEEGLab
If you use Python 3.6, the dataclasses package must be installed as backport of Python 3.7 dataclasses:
pip install dataclasses
If you need a bleeding edge version, you can install it directly from GitHub:
pip install git+https://github.com/AlessioZanga/PyEEGLab@develop
Out-Of-The-Box Supported Datasets
The following datasets will work upon downloading:
- Temple University Abnormal EEG Dataset
- Temple University Artifact EEG Dataset
- EEG Motor Movement/Imagery Dataset
How to Get a Dataset
WARNING (1): Retriving the TUH EEG Abnormal dataset require at least 65GB of free disk space.
WARNING (2): Retriving the TUH EEG Abnormal dataset require valid credentials, you can get your own at https://www.isip.piconepress.com/projects/tuh_eeg/html/request_access.php.
In the root directory of this project there is a Makefile, by typing:
make tuh_eeg_abnormal
you will trigger the dataset download.
Documentation
WIP: Documentation is currently Work-In-Progress, if you need additional info, please, contact me directly.
You can find the documentation at https://pyeeglab.readthedocs.io
Credits
If you use this code in your project use the citation below:
@misc{Zanga2019PyEEGLab,
title={PyEEGLab: A simple tool for EEG manipulation},
author={Alessio Zanga},
year={2019},
doi={10.5281/zenodo.3874461},
url={https://dx.doi.org/10.5281/zenodo.3874461},
howpublished={\url{https://github.com/AlessioZanga/PyEEGLab}},
}
Related publications
- "An Attention-based Architecture for EEG Classification" - https://doi.org/10.5220/0008953502140219
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.