BrainBERT: Self-supervised representation learning for intracranial recordings

Christopher Wang, Vighnesh Subramaniam, Adam Uri Yaari, Gabriel Kreiman, Boris Katz, Ignacio Cases, Andrei Barbu

BrainBERT is a novel Transformer-based model that applies the highly successful "BERT" recipe from natural language processing to intracranial brain recordings. By pretraining on unannotated neural activity, BrainBERT creates a reusable representation that allows researchers to decode complex neural signals with unprecedented accuracy and minimal data. Crucially, it generalizes to new subjects and reveals the "intrinsic dimensionality" of different brain regions.

The Challenge of Decoding Neural Data

Neuroscientists face a frustrating tradeoff when trying to "read" the brain. Linear decoders are the gold standard because they are explainable: if a linear model can decode a signal, we know that information is explicitly represented in that brain area. However, linear models are often too weak to handle the noise and complexity of raw neural data.

Conversely, Deep Neural Networks (DNNs) are powerful but require massive amounts of labeled data—a rarity in clinical settings. They also act as "black boxes," making it hard to tell if the brain is actually performing the computation or if the decoder is just finding a clever shortcut. Furthermore, most models are subject-specific. If an electrode is moved by a few millimeters or a new patient is introduced, researchers usually have to start training from scratch.

Introducing BrainBERT

To overcome these limitations, researchers introduced BrainBERT, a Transformer encoder architecture inspired by NLP models like BERT and audio models like wav2vec 2.0.

Overview of the BrainBERT pipeline

The BrainBERT methodology relies on several key innovations:

  1. Super-Resolution Inputs: Instead of raw voltage, the model converts neural signals into spectrograms. It specifically uses "Superlets," a technique that provides high resolution across different frequencies. This is crucial because brain signals are "fractal," meaning similar patterns appear at different scales.
  2. Masked Modeling: During pretraining, the model processes large amounts of unlabeled data. It randomly hides (masks) portions of the spectrogram and attempts to reconstruct them based on the surrounding context. This forces the model to learn the underlying "grammar" of neural activity.
  3. Content-Aware Loss: Neural signals are often sparse, consisting of short bursts of activity. To prevent the model from simply "predicting zeros," the authors developed a loss function that prioritizes accurately reconstructing high-activity segments.
  4. Linear Probing: Once pretrained, the Transformer's weights are frozen, and a simple linear layer is added on top to perform specific downstream tasks, such as detecting when a sentence starts.

Datasets and Evaluation

The study utilized a unique dataset of intracranial field potential recordings (SEEG) from 10 subjects with epilepsy. While their brain activity was recorded, subjects watched feature-length movies (e.g., Thor: Ragnarok, Spider-Man: Homecoming). This yielded a massive scale of data: 43.7 hours of recordings across 1,688 electrodes.

The model was then evaluated on four downstream tasks: Sentence onset detection, Speech vs. Non-speech discrimination, Pitch classification, and Volume classification.

Key Insights and Results

BrainBERT demonstrates that neural context matters. Just as a word's meaning depends on its surrounding sentence, a neural spike's meaning depends on the activity surrounding it. BrainBERT successfully captures this temporal context, acting as a "foundation model" for the brain. It can be pretrained once on a large pool of patients and then used "off-the-shelf" for a new patient with electrodes in entirely different positions.

The performance improvements are substantial:

  • Massive Accuracy Boost: On the "Speech vs. Non-speech" task, BrainBERT achieved an AUC of 0.93, compared to just 0.58 for a standard linear decoder.
  • Sample Efficiency: Because the model already "understands" the structure of brain data from pretraining, it needs very few labeled examples. BrainBERT reached higher accuracy with only 150 training examples than a standard DNN could achieve with 1,000 examples.
  • Robust Generalization: In "hold-one-out" tests, the model performed almost as well on subjects it had never seen before as it did on those included in the pretraining set, suggesting it learns universal features of human brain activity.
Decoding performance comparison across brain regions

Additionally, the authors used BrainBERT to measure the Intrinsic Dimensionality (ID) of computations in different brain areas. They found that the frontal and temporal lobes—areas associated with high-level language and reasoning—have higher intrinsic dimensionality than other regions. This provides a new way to map brain function without needing a specific task.

Limitations and Future Work

While groundbreaking, the current model was trained on subjects passively watching movies. It remains to be seen how well it generalizes to active tasks, such as motor control or intentional speech. Furthermore, the work relies on invasive intracranial recordings. Future iterations might explore whether these self-supervised techniques can be adapted for non-invasive methods like EEG or MEG, despite their lower signal-to-noise ratios.

Ultimately, the authors suggest that training even larger versions of BrainBERT on 24/7 continuous hospital recordings could "unlock the brain" in the exact same way that massive language models unlocked natural language processing.

Summary updated

BibTeX
@inproceedings{wang2023brainbert,
  author = {Christopher Wang and Vighnesh Subramaniam and Adam Uri Yaari and Gabriel Kreiman and Boris Katz and Ignacio Cases and Andrei Barbu},
  title = {{BrainBERT: Self-supervised representation learning for intracranial recordings}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=xmcYx_reUn6},
}
Figure