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

EEGDash automatically caches the downloaded data in the .eegdash_cache folder of the current directory from which the script is called. This means that if you run the tutorial scripts, the data will only be downloaded the first time the script is executed.

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.7.dev177024734.tar.gz (73.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.7.dev177024734-py3-none-any.whl (58.6 kB view details)

Uploaded Python 3

File details

Details for the file eegdash-0.3.7.dev177024734.tar.gz.

File metadata

  • Download URL: eegdash-0.3.7.dev177024734.tar.gz
  • Upload date:
  • Size: 73.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.7.dev177024734.tar.gz
Algorithm Hash digest
SHA256 31d4fbb01af64c554abfb72fc97d849b02b30e51e5e41e76e251a32d8710c397
MD5 d22b01a3217cb453284d90030ddb3c41
BLAKE2b-256 1dd314afede164b04f2676eac045def03640b46a61c7fe0c8cb6cabcff5919fc

See more details on using hashes here.

File details

Details for the file eegdash-0.3.7.dev177024734-py3-none-any.whl.

File metadata

File hashes

Hashes for eegdash-0.3.7.dev177024734-py3-none-any.whl
Algorithm Hash digest
SHA256 119b7136d1cea89e58c91eb34ec7169be5eac4f373c63a82354fffc75ad22ef7
MD5 20c6bd8a70651487c488d1d45c77a0a3
BLAKE2b-256 9e8caf31395d180a24fdaf8c45a9d62d4717d24e79460b815a3069301e2aece8

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