File size: 2,801 Bytes
ea8adc8
 
 
 
 
 
c0ea030
ea8adc8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e32cd75
ea8adc8
c0ea030
ea8adc8
 
 
 
 
 
 
 
 
 
e32cd75
ea8adc8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c0ea030
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ea8adc8
 
 
 
 
 
 
 
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
104
105
106
107
108
109
---
tags:
- braindecode
- eeg
- neuroscience
- brain-computer-interface
- bids
license: unknown
---

# EEG Dataset

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

## Dataset Information

| Property | Value |
|---|---:|
| Number of recordings | 1 |
| Dataset type | Windowed (from Raw object) |
| Number of channels | 26 |
| Sampling frequency | 250 Hz |
| Number of windows / samples | 48 |
| Total size | 19.22 MB |
| Storage format | zarr |
| BIDS compatible | Yes |

## Usage

To load this dataset::

    .. code-block:: python

        from braindecode.datasets import BaseConcatDataset

        # Load dataset from Hugging Face Hub
        dataset = BaseConcatDataset.pull_from_hub("username/dataset-name")

        # Access data
        X, y, metainfo = dataset[0]
        # X: EEG data (n_channels, n_times)
        # y: label/target
        # metainfo: window indices

## Using with PyTorch DataLoader

::

    from torch.utils.data import DataLoader

    # Create DataLoader for training
    train_loader = DataLoader(
        dataset,
        batch_size=32,
        shuffle=True,
        num_workers=4
    )

    # 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...

## BIDS-like Structure

This dataset follows a BIDS derivatives-like structure for compatibility with
neuroimaging tools while maintaining efficiency for deep learning:

```
derivatives/braindecode/
├── dataset_description.json    # BIDS dataset description
├── participants.tsv            # Subject-level metadata
├── dataset.zarr/               # Main data (optimized for training)
└── sub-<label>/
    └── eeg/
        ├── *_events.tsv        # Trial/window events
        ├── *_channels.tsv      # Channel information
        └── *_eeg.json          # Recording metadata
```

### Accessing BIDS Metadata

After loading the dataset, BIDS metadata is available:

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

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

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

## Dataset Format

This dataset is stored in **Zarr** format, optimized for:
- Fast random access during training (critical for PyTorch DataLoader)
- Efficient compression with blosc
- Cloud-native storage compatibility

For more information about braindecode, visit: https://braindecode.org