Self-Supervised Transformers for fMRI representation

Itzik Malkiel, Gony Rosenman, Lior Wolf, Talma Hendler

Abstract

We present TFF, which is a Transformer framework for the analysis of functional Magnetic Resonance Imaging (fMRI) data. TFF employs a two-phase training approach. First, self-supervised training is applied to a collection of fMRI scans, where the model is trained to reconstruct 3D volume data. Second, the pre-trained model is fine-tuned on specific tasks, utilizing ground truth labels. Our results show state-of-the-art performance on a variety of fMRI tasks, including age and gender prediction, as well as schizophrenia recognition. Our code for the training, network architecture, and results is attached as supplementary material.

Introduction

Functional Magnetic Resonance Imaging (fMRI) captures the Blood Oxygen Level Dependent (BOLD) signal, providing a 4D window into brain activity over time. However, analyzing this data is notoriously difficult: it is high-dimensional, extremely noisy, and datasets are often small due to high acquisition costs.

Traditionally, researchers handle this complexity through parcellation—grouping voxels into predefined regions based on anatomical atlases. While this reduces dimensionality, it risks losing fine-grained information and relies on the assumption that these atlases are perfectly accurate for every individual. The Transformer Framework for fMRI (TFF) seeks to move toward "end-to-end" learning, where a model processes the entire unparcellated volume to extract more meaningful neurological biomarkers.

Methods

The TFF architecture is a hybrid model combining 3D Convolutional Neural Networks (CNNs) with Transformers. A 3D CNN encoder first compresses individual 3D fMRI frames into feature vectors. These vectors are treated as a sequence and fed into a Transformer, which learns temporal dependencies across the scan.

The TFF architecture showing pre-training and fine-tuning phases.

The framework employs a two-phase training strategy:

  1. Self-Supervised Pre-training: The model is trained to reconstruct the original 3D volumes from a compressed representation. To ensure stability, this happens in two stages: first training the CNN encoder-decoder, then inserting and training the Transformer.
  2. Fine-tuning: The decoder is removed, and a task-specific head (classification or regression) is added to a special [CLS] token at the start of the sequence.

Beyond standard L1 reconstruction loss, the authors use an Intensity Loss (focusing on high-variance voxels likely representing the BOLD signal) and a Perceptual Loss (using a pre-trained VGG network to ensure anatomical correctness).

Results

The model was evaluated on several major datasets, including the Human Connectome Project (HCP) for age and gender prediction, and the COBRE and CNP datasets for schizophrenia diagnosis. TFF consistently outperformed existing state-of-the-art models like ST-GCN (Spatio-Temporal Graph Convolutional Networks) and Deep-fMRI.

Performance comparison on the HCP dataset for gender prediction.

Key performance metrics include:

  • Gender Prediction (HCP): Achieved 93.9% balanced accuracy, a significant improvement over the previous state-of-the-art of ~82%.
  • Age Prediction (HCP): Reduced the Mean Absolute Error to 2.73 years, a 23% relative improvement in normalized error over baselines.
  • Schizophrenia Recognition: On the CNP dataset, TFF reached 88.2% accuracy, outperforming ST-GCN (82.3%) and Deep-fMRI (76.5%).

Discussion and Conclusion

A critical insight from this work is the necessity of self-supervised pre-training; without it, models often fail to converge on smaller clinical datasets. By bypassing traditional atlases, TFF discovers spatial features that are more predictive than predefined neuroanatomical regions.

While the model is highly accurate, its computational intensity remains a challenge due to the 4D nature of the data. Future work could involve pre-training on massive multi-site datasets and improving clinical interpretability by visualizing the Transformer's attention maps to identify brain regions prioritized for specific diagnoses.

Summary updated

BibTeX
@inproceedings{malkiel2022self,
  author = {Itzik Malkiel and Gony Rosenman and Lior Wolf and Talma Hendler},
  title = {{Self-Supervised Transformers for fMRI representation}},
  booktitle = {MIDL},
  year = {2022},
  url = {https://openreview.net/forum?id=0ZNbiLvTPem},
}
Figure