Skip to main content

EEG data for machine learning

Project description

EEG-Dash

PyPI version Docs

License: GPL-2.0-or-later Python versions Downloads

To leverage recent and ongoing advancements in large-scale computational methods and to ensure the preservation of scientific data generated from publicly funded research, the EEG-DaSh data archive will create a data-sharing resource for MEEG (EEG, MEG) data contributed by collaborators for machine learning (ML) and deep learning (DL) applications.

Data source

The data in EEG-DaSh originates from a collaboration involving 25 laboratories, encompassing 27,053 participants. This extensive collection includes MEEG data, which is a combination of EEG and MEG signals. The data is sourced from various studies conducted by these labs, involving both healthy subjects and clinical populations with conditions such as ADHD, depression, schizophrenia, dementia, autism, and psychosis. Additionally, data spans different mental states like sleep, meditation, and cognitive tasks. In addition, EEG-DaSh will incorporate a subset of the data converted from NEMAR, which includes 330 MEEG BIDS-formatted datasets, further expanding the archive with well-curated, standardized neuroelectromagnetic data.

Featured data

The following HBN datasets are currently featured on EEGDash. Documentation about these datasets is available here.

DatasetID Participants Files Sessions Population Channels Is 10-20? Modality Size
ds005505 136 5393 1 Healthy 129 other Visual 103 GB
ds005506 150 5645 1 Healthy 129 other Visual 112 GB
ds005507 184 7273 1 Healthy 129 other Visual 140 GB
ds005508 324 13393 1 Healthy 129 other Visual 230 GB
ds005510 135 4933 1 Healthy 129 other Visual 91 GB
ds005512 257 9305 1 Healthy 129 other Visual 157 GB
ds005514 295 11565 1 Healthy 129 other Visual 185 GB

A total of 246 other datasets are also available through EEGDash.

Data format

EEGDash queries return a Pytorch Dataset formatted to facilitate machine learning (ML) and deep learning (DL) applications. PyTorch Datasets are the best format for EEGDash queries because they provide an efficient, scalable, and flexible structure for machine learning (ML) and deep learning (DL) applications. They allow seamless integration with PyTorch’s DataLoader, enabling efficient batching, shuffling, and parallel data loading, which is essential for training deep learning models on large EEG datasets.

Data preprocessing

EEGDash datasets are processed using the popular braindecode library. In fact, EEGDash datasets are braindecode datasets, which are themselves PyTorch datasets. This means that any preprocessing possible on braindecode datasets is also possible on EEGDash datasets. Refer to braindecode tutorials for guidance on preprocessing EEG data.

EEG-Dash usage

Install

Use your preferred Python environment manager with Python > 3.9 to install the package.

  • To install the eegdash package, use the following command: pip install eegdash
  • To verify the installation, start a Python session and type: from eegdash import EEGDash

Data access

To use the data from a single subject, enter:

from eegdash import EEGDashDataset

ds_NDARDB033FW5 = EEGDashDataset(
    {"dataset": "ds005514", "task":
     "RestingState", "subject": "NDARDB033FW5"}, 
     cache_dir="."
)

This will search and download the metadata for the task RestingState for subject NDARDB033FW5 in BIDS dataset ds005514. The actual data will not be downloaded at this stage. Following standard practice, data is only downloaded once it is processed. The ds_NDARDB033FW5 object is a fully functional braindecode dataset, which is itself a PyTorch dataset. This tutorial shows how to preprocess the EEG data, extracting portions of the data containing eyes-open and eyes-closed segments, then perform eyes-open vs. eyes-closed classification using a (shallow) deep-learning model.

To use the data from multiple subjects, enter:

from eegdash import EEGDashDataset

ds_ds005505rest = EEGDashDataset(
    {"dataset": "ds005505", "task": "RestingState"}, target_name="sex", cache_dir=".
)

This will search and download the metadata for the task 'RestingState' for all subjects in BIDS dataset 'ds005505' (a total of 136). As above, the actual data will not be downloaded at this stage so this command is quick to execute. Also, the target class for each subject is assigned using the target_name parameter. This means that this object is ready to be directly fed to a deep learning model, although the tutorial script performs minimal processing on it, prior to training a deep-learning model. Because 14 gigabytes of data are downloaded, this tutorial takes about 10 minutes to execute.

Automatic caching

By default, EEGDash caches downloaded data under a single, consistent folder:

  • If EEGDASH_CACHE_DIR is set in your environment, that path is used.
  • Else, if MNE’s MNE_DATA config is set, that path is used to align with other EEG tooling.
  • Otherwise, .eegdash_cache in the current working directory is used.

This means that if you run the tutorial scripts, the data will only be downloaded the first time the script is executed and reused thereafter.

Education -- Coming soon...

We organize workshops and educational events to foster cross-cultural education and student training, offering both online and in-person opportunities in collaboration with US and Israeli partners. Events for 2025 will be announced via the EEGLABNEWS mailing list. Be sure to subscribe.

About EEG-DaSh

EEG-DaSh is a collaborative initiative between the United States and Israel, supported by the National Science Foundation (NSF). The partnership brings together experts from the Swartz Center for Computational Neuroscience (SCCN) at the University of California San Diego (UCSD) and Ben-Gurion University (BGU) in Israel.

Screenshot 2024-10-03 at 09 14 06

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.

Source Distribution

eegdash-0.3.9.dev182388821.tar.gz (87.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eegdash-0.3.9.dev182388821-py3-none-any.whl (71.6 kB view details)

Uploaded Python 3

File details

Details for the file eegdash-0.3.9.dev182388821.tar.gz.

File metadata

  • Download URL: eegdash-0.3.9.dev182388821.tar.gz
  • Upload date:
  • Size: 87.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eegdash-0.3.9.dev182388821.tar.gz
Algorithm Hash digest
SHA256 35cce8a0346cf660774d747f9d132839317335ec1087271a766ee432c86e2b84
MD5 f65cca9819b7fafe05714191ff3b94a2
BLAKE2b-256 6a2eaa2ac93513351b905004afa3c8d0fb66392cd10352dd66f645b4c5e62f94

See more details on using hashes here.

File details

Details for the file eegdash-0.3.9.dev182388821-py3-none-any.whl.

File metadata

File hashes

Hashes for eegdash-0.3.9.dev182388821-py3-none-any.whl
Algorithm Hash digest
SHA256 f42eeb5fd65dd1a5421ab8e4348cf7465675cba62ea0082433ffd71f2001f3da
MD5 c5edc262f66dc8d2c15bb11711c9a6cd
BLAKE2b-256 05d4b9df1225037abbb4f396c0774cd2f2d54b2d4102d01ebb69027e8e3f359c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page