Datasets:

Tasks:
Other
Modalities:
Audio
Languages:
English
ArXiv:
License:
File size: 4,734 Bytes
8b66b2b
 
04e058a
 
 
 
4085d4e
 
 
 
73a65af
04e058a
 
 
73a65af
 
 
04e058a
 
73a65af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
04e058a
73a65af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
04e058a
 
 
 
 
 
 
 
73a65af
 
4085d4e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
04e058a
 
4085d4e
 
 
 
 
 
 
 
 
04e058a
 
 
 
 
 
 
 
 
 
 
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
language:
- en
license: cc-by-nc-4.0
task_categories:
- other
---

# LibriBrain (Sherlock Holmes 1–7)

[Paper](https://huggingface.co/papers/2506.02098) | [Code](https://github.com/neural-processing-lab/pnpl)

This repository contains the LibriBrain data organised by book: MEG recordings (`.h5`), event annotations (`.tsv`), and the audiobook stimulus audio (`.wav`). 

LibriBrain was first open-sourced as part of the [2025 PNPL Competition](https://libribrain.com/).

In addition, LibriBrain is used as a fine-tuning dataset in the paper ["MEG-XL: Data-Efficient Brain-to-Text via Long-Context Pre-Training"](https://huggingface.co/papers/2602.02494) to evaluate word decoding from brain data.

## Sample Usage
The easiest way to get started with the dataset is using the [pnpl Python library](https://github.com/neural-processing-lab/pnpl). There, the following two datasets are available:

### LibriBrainSpeech
This wraps the LibriBrain dataset for use in speech detection problems.
```python
from pnpl.datasets import LibriBrainSpeech

speech_example_data = LibriBrainSpeech(
    data_path="./data/",
    partition="train"
)

sample_data, label = speech_example_data[0]

# Print out some basic info about the sample
print("Sample data shape:", sample_data.shape)
print("Label shape:", label.shape)
```

### LibriBrainPhoneme
This wraps the LibriBrain dataset for use in phoneme classification problems.
```python
from pnpl.datasets import LibriBrainPhoneme

phoneme_example_data = LibriBrainPhoneme(
    data_path="./data/",
    partition="train"
)
sample_data, label = phoneme_example_data[0]

# Print out some basic info about the sample
print("Sample data shape:", sample_data.shape)
print("Label shape:", label.shape)
```

### Usage in MEG-XL
To fine-tune the MEG-XL model on the LibriBrain dataset for word decoding, you can use the following command from the [official repository](https://github.com/neural-processing-lab/MEG-XL):

```bash
python -m brainstorm.evaluate_criss_cross_word_classification \
  --config-name=eval_criss_cross_word_classification_libribrain \
  model.criss_cross_checkpoint=/path/to/your/checkpoint.ckpt
```

Note: For the MEG-XL repo, you will need to adjust the dataset paths in the configuration files to point to your local download of the data. The pnpl library includes automatic downloads from HuggingFace.


## Repository structure

Data are organised into seven top-level directories:

- `Sherlock1/`
- `Sherlock2/`
-- `Sherlock7/`

Each `Sherlock{i}` directory contains:

- `Sherlock{i}/derivatives/events/` — event annotation files (`.tsv`)
- `Sherlock{i}/derivatives/serialised/` — MEG recordings (`.h5`)
- `Sherlock{i}/stimuli/audio/` — stimulus audio (`.wav`)

## Stimulus audio (LibriVox)

The spoken-audio stimuli are derived from **LibriVox** public-domain recordings of the first seven Sherlock Holmes books (recording versions linked below). The stimuli are provided in this repository as WAV files converted from the LibriVox downloads.

### LibriVox source URLs (recording versions)

1. https://librivox.org/a-study-in-scarlet-version-6-by-sir-arthur-conan-doyle/
2. https://librivox.org/the-sign-of-the-four-version-3-by-sir-arthur-conan-doyle/
3. https://librivox.org/the-adventures-of-sherlock-holmes-version-4-by-sir-arthur-conan-doyle/
4. https://librivox.org/the-memoirs-of-sherlock-holmes-by-sir-arthur-conan-doyle-2/
5. https://librivox.org/the-hound-of-the-baskervilles-version-4-by-sir-arthur-conan-doyle/
6. https://librivox.org/the-return-of-sherlock-holmes-by-sir-arthur-conan-doyle-2/
7. https://librivox.org/the-valley-of-fear-version-3-by-sir-arthur-conan-doyle/

### Audio format

The WAV files in this repository are:
- WAV (PCM), mono (1 channel), 22,050 Hz, 16-bit signed integer PCM

Example conversion command (SoX):

```bash
sox "INPUT_FROM_LIBRIVOX.mp3" -c 1 -r 22050 -b 16 "OUTPUT.wav"
```

### Citation

If you use this dataset, please cite the LibriBrain paper:

```bibtex
@article{ozdogan2025libribrain,
  author    = {Özdogan, Miran and Landau, Gilad and Elvers, Gereon and Jayalath, Dulhan and Somaiya, Pratik and Mantegna, Francesco and Woolrich, Mark and Parker Jones, Oiwi},
  title     = {{LibriBrain}: Over 50 Hours of Within-Subject {MEG} to Improve Speech Decoding Methods at Scale},
  year      = {2025},
  journal   = {NeurIPS, Datasets \& Benchmarks Track},
  url       = {https://arxiv.org/abs/2506.02098},
}
```

If you use this data with the MEG-XL framework, please also cite:

```bibtex
@article{jayalath2026megxl,
  title={{MEG-XL}: Data-Efficient Brain-to-Text via Long-Context Pre-Training},
  author={Jayalath, Dulhan and Jones, Oiwi Parker},
  journal={arXiv preprint arXiv:2602.02494},
  year={2026}
}
```