diff --git a/README.md b/README.md index 158fe424f1f1010b9cb7b0327fcffc78b8c0f4f4..99ed0a4304d341edf5bc5a2f079bf6a6c81901e7 100644 --- a/README.md +++ b/README.md @@ -4,105 +4,105 @@ tags: - eeg - neuroscience - brain-computer-interface -- bids +- deep-learning license: unknown --- # EEG Dataset -This dataset was created using [braindecode](https://braindecode.org), a library for deep learning with EEG/MEG/ECoG signals. +This dataset was created using [braindecode](https://braindecode.org), a deep +learning library for EEG/MEG/ECoG signals. ## Dataset Information | Property | Value | -|---|---:| -| Number of recordings | 1 | -| Dataset type | Windowed (from Epochs object) | -| Number of channels | 26 | +|----------|------:| +| Recordings | 1 | +| Type | Windowed (from Epochs object) | +| Channels | 26 | | Sampling frequency | 250 Hz | -| Number of windows / samples | 48 | -| Total size | 0.03 MB | -| Storage format | zarr | -| BIDS compatible | Yes | +| Windows/samples | 48 | +| Size | 0.03 MB | +| Format | zarr | -## Usage +## Quick Start -To load this dataset:: - - .. code-block:: python +```python +from braindecode.datasets import BaseConcatDataset - from braindecode.datasets import BaseConcatDataset +# Load from Hugging Face Hub +dataset = BaseConcatDataset.pull_from_hub("username/dataset-name") - # Load dataset from Hugging Face Hub - dataset = BaseConcatDataset.pull_from_hub("username/dataset-name") +# Access a sample +X, y, metainfo = dataset[0] +# X: EEG data [n_channels, n_times] +# y: target label +# metainfo: window indices +``` - # Access data - X, y, metainfo = dataset[0] - # X: EEG data (n_channels, n_times) - # y: label/target - # metainfo: window indices +## Training with PyTorch -## Using with PyTorch DataLoader +```python +from torch.utils.data import DataLoader -:: +loader = DataLoader(dataset, batch_size=32, shuffle=True, num_workers=4) - from torch.utils.data import DataLoader +for X, y, metainfo in loader: + # X: [batch_size, n_channels, n_times] + # y: [batch_size] + pass # Your training code +``` - # Create DataLoader for training - train_loader = DataLoader( - dataset, - batch_size=32, - shuffle=True, - num_workers=4 - ) +## BIDS-inspired Structure - # Training loop - for X, y, metainfo in train_loader: - # X shape: [batch_size, n_channels, n_times] - # y shape: [batch_size] - # metainfo shape: [batch_size, 2] (start and end indices) - # Process your batch... +This dataset uses a **BIDS-inspired** organization. Metadata files follow BIDS +conventions, while data is stored in Zarr format for efficient deep learning. -## BIDS-like Structure +**BIDS-style metadata:** +- `dataset_description.json` - Dataset information +- `participants.tsv` - Subject metadata +- `*_events.tsv` - Trial/window events +- `*_channels.tsv` - Channel information +- `*_eeg.json` - Recording parameters -This dataset follows a BIDS derivatives-like structure for compatibility with -neuroimaging tools while maintaining efficiency for deep learning: +**Data storage:** +- `dataset.zarr/` - Zarr format (optimized for random access) ``` -derivatives/braindecode/ -├── dataset_description.json # BIDS dataset description -├── participants.tsv # Subject-level metadata -├── dataset.zarr/ # Main data (optimized for training) +sourcedata/braindecode/ +├── dataset_description.json +├── participants.tsv +├── dataset.zarr/ └── sub-