Contrast, Attend and Diffuse to Decode High-Resolution Images from Brain Activities

Jingyuan Sun, Mingxiao Li, Zijiao Chen, Yunhao Zhang, Shaonan Wang, Marie-Francine Moens

Abstract

Decoding visual stimuli from neural responses recorded by functional Magnetic Resonance Imaging (fMRI) presents an intriguing intersection between cognitive neuroscience and machine learning, promising advancements in understanding human visual perception and building non-invasive brain-machine interfaces. However, the task is challenging due to the noisy nature of fMRI signals and the intricate pattern of brain visual representations. To mitigate these challenges, we introduce a two-phase fMRI representation learning framework. The first phase pre-trains an fMRI feature learner with a proposed Double-contrastive Mask Auto-encoder to learn denoised representations. The second phase tunes the feature learner to attend to neural activation patterns most informative for visual reconstruction with guidance from an image auto-encoder. The optimized fMRI feature learner then conditions a latent diffusion model to reconstruct image stimuli from brain activities. Experimental results demonstrate our model's superiority in generating high-resolution and semantically accurate images, substantially exceeding previous state-of-the-art methods by 39.34% in the 50-way-top-1 semantic classification accuracy. Our research invites further exploration of the decoding task's potential and contributes to the development of non-invasive brain-machine interfaces.

Introduction

Decoding visual stimuli from brain activity—often colloquially referred to as "mind-reading"—is one of the most ambitious frontiers in cognitive neuroscience. By interpreting functional Magnetic Resonance Imaging (fMRI) data, researchers aim to reconstruct the images a subject is viewing. This task is not merely a technical feat; it is essential for understanding the human visual system and developing non-invasive brain-machine interfaces (BMIs).

However, fMRI data is notoriously difficult to work with. It is a "needle in a haystack" problem: the signal captures not only visual perception but also physiological noise (such as heartbeats and breathing), scanner interference, and unrelated cognitive processes. Furthermore, the relationship between a visual stimulus and the resulting neural activation is highly non-linear and spatially redundant. Previous attempts at decoding often resulted in blurry, unrecognizable images that failed to capture the semantic essence of the stimulus. This paper, presented at NeurIPS 2023, introduces a sophisticated framework that overcomes these hurdles through a two-phase learning approach and latent diffusion models.

Methodology: The Two-Phase Framework

The authors propose a Double-phase fMRI Representation Learning (FRL) framework designed to first denoise the brain signal and then align it with visual semantics.

Phase 1: Pre-training with DC-MAE

The first phase addresses the noise problem using a novel Double-contrastive Masked Auto-encoder (DC-MAE). Inspired by visual Masked Auto-encoders, this model masks a significant portion (up to 75%) of the fMRI signal and attempts to reconstruct the missing parts. Because fMRI data has high spatial redundancy—where neighboring voxels often show similar activity—this high masking rate forces the model to learn the underlying structural patterns of brain activity rather than simply memorizing noise.

The "double-contrastive" aspect involves two distinct losses: a cross-contrastive loss (comparing different masked versions of the same signal) and a self-contrastive loss (comparing the reconstructed signal to the original). This dual approach ensures the model learns robust, denoised representations from large-scale unlabeled fMRI data.

Phase 2: Cross-Modality Guidance

Once the fMRI encoder is pre-trained, it must be taught which neural patterns are actually relevant to vision. In this phase, the model is fine-tuned using an image auto-encoder. Through a cross-attention mechanism, the fMRI encoder learns to "attend" to specific image features. This guidance forces the feature learner to prioritize neural activations that are most informative for visual reconstruction, effectively filtering out cognitive "chatter" unrelated to the visual task.

Image Generation via Latent Diffusion

The final stage utilizes the optimized fMRI encoder to condition a Latent Diffusion Model (LDM). Unlike standard LDMs that use text prompts to generate images, this framework uses the decoded fMRI features to guide the denoising process. By conditioning the LDM on high-quality, denoised brain representations, the model can reconstruct high-resolution images that reflect the original stimulus.

Experimental Setup

The study utilized three major datasets to validate the framework:

  • HCP (Human Connectome Project): Used for large-scale pre-training of the fMRI feature learner to establish a baseline understanding of brain signal structure.
  • GOD (Generic Object Decoding): A benchmark dataset containing fMRI responses to images across 200 categories.
  • BOLD5000: A large-scale dataset featuring over 5,000 unique images from ImageNet, COCO, and Scenes.

Key Results and Insights

The framework achieved a massive leap in performance compared to existing methods. On the GOD dataset, the model reached a 50-way-top-1 semantic classification accuracy of 25.08%, representing a 39.34% improvement over the previous state-of-the-art (DC-LDM).

Beyond quantitative metrics, the qualitative results are striking. The reconstructed images are not merely "blobs" that mimic the layout of the original stimulus; they are semantically accurate. For instance, if a subject views an airplane, the model reconstructs a recognizable airplane, even if that specific category was not present in the training set. This suggests the model has learned a generalized mapping between neural patterns and visual concepts. Furthermore, the model demonstrated consistent performance across different subjects, indicating that the learned representations can generalize despite individual variations in brain anatomy.

Discussion and Limitations

While the results are groundbreaking, the authors identify several areas for improvement. The model occasionally exhibits a categorical bias, where it may lean toward more "common" categories found in the LDM's training data rather than the specific stimulus. Additionally, while high-level semantics are captured with high fidelity, fine-grained details—such as specific textures or exact species of an animal—can still be slightly inaccurate due to the inherently low signal-to-noise ratio of fMRI.

Future research will likely focus on reducing these biases and further refining the disentanglement of vision-related signals from other cognitive processes. Nevertheless, this work represents a significant step forward in our ability to translate the complex language of the human brain into clear, high-resolution visual information.

Reference: Sun, J., et al. (2023). Contrast, Attend and Diffuse to Decode High-Resolution Images from Brain Activities. 37th Conference on Neural Information Processing Systems (NeurIPS 2023).

Summary updated

BibTeX
@inproceedings{sun2023contrast,
  author = {Jingyuan Sun and Mingxiao Li and Zijiao Chen and Yunhao Zhang and Shaonan Wang and Marie-Francine Moens},
  title = {{Contrast, Attend and Diffuse to Decode High-Resolution Images from Brain Activities}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=YZSLDEE0mw},
}
Figure