File size: 2,267 Bytes
258bb68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
tags:
- braindecode
- eeg
- neuroscience
- brain-computer-interface
- deep-learning
license: unknown
---

# EEG Dataset

This dataset was created using [braindecode](https://braindecode.org), a deep
learning library for EEG/MEG/ECoG signals.

## Dataset Information

| Property | Value |
|----------|------:|
| Recordings | 1 |
| Type | Continuous (Raw) |
| Channels | 26 |
| Sampling frequency | 250 Hz |
| Total duration | 0:06:26 |
| Windows/samples | 96,735 |
| Size | 19.22 MB |
| Format | zarr |

## Quick Start

```python
from braindecode.datasets import BaseConcatDataset

# Load 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
```

## Training with PyTorch

```python
from torch.utils.data import DataLoader

loader = DataLoader(dataset, batch_size=32, shuffle=True, num_workers=4)

for X, y, metainfo in loader:
    # X: [batch_size, n_channels, n_times]
    # y: [batch_size]
    pass  # Your training code
```

## BIDS-inspired Structure

This dataset uses a **BIDS-inspired** organization. Metadata files follow BIDS
conventions, while data is stored in Zarr format for efficient deep learning.

**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

**Data storage:**
- `dataset.zarr/` - Zarr format (optimized for random access)

```
sourcedata/braindecode/
β”œβ”€β”€ dataset_description.json
β”œβ”€β”€ participants.tsv
β”œβ”€β”€ dataset.zarr/
└── sub-<label>/
    └── eeg/
        β”œβ”€β”€ *_events.tsv
        β”œβ”€β”€ *_channels.tsv
        └── *_eeg.json
```

### Accessing Metadata

```python
# Participants info
if hasattr(dataset, "participants"):
    print(dataset.participants)

# Events for a recording
if hasattr(dataset.datasets[0], "bids_events"):
    print(dataset.datasets[0].bids_events)

# Channel info
if hasattr(dataset.datasets[0], "bids_channels"):
    print(dataset.datasets[0].bids_channels)
```

---

*Created with [braindecode](https://braindecode.org)*