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

Reconstructing images from brain activity is a notoriously difficult task due to the noisy, complex nature of functional Magnetic Resonance Imaging (fMRI) data. In a significant leap for cognitive neuroscience and machine learning, researchers have introduced a novel two-phase representation learning framework that extracts clean visual signals from the brain. By conditioning a latent diffusion model on these refined signals, the framework generates high-resolution, semantically accurate images, beating previous state-of-the-art methods by nearly 40% in semantic accuracy.

The "Mind-Reading" Challenge

Decoding and reconstructing the exact visual stimuli a person is looking at based solely on their fMRI data is incredibly difficult for two main reasons:

  1. Low Signal-to-Noise Ratio: fMRI scanners pick up not just the brain's reaction to a picture, but also physiological noise, scanner artifacts, and the subject's unrelated wandering thoughts.
  2. Complex Visual Processing: The brain's visual processing pipeline is highly non-linear.

Previous attempts using traditional regression or early deep learning models (like GANs) struggled to disentangle the actual visual signal from the background noise, resulting in blurry, semantically meaningless, or highly distorted images.

A Three-Step Decoding Pipeline

To mitigate these challenges, the authors propose a pipeline that separates the denoising of brain signals from the actual image generation:

Two-phase fMRI representation learning framework
  1. Phase 1: Double-Contrastive Masked Auto-Encoder (DC-MAE): To learn robust fMRI representations, an fMRI encoder is pre-trained on a large dataset of unlabeled brain scans (like the Human Connectome Project). Portions of the fMRI data are masked out, and the model must reconstruct them. The authors apply two contrastive losses: a cross-contrastive loss (comparing differently masked versions of the same scan) and a self-contrastive loss (comparing the masked prediction to the unmasked original). This forces the model to ignore individual noise and learn core brain activation patterns.
  2. Phase 2: Cross-Modality Guidance: The fMRI encoder is then fine-tuned using paired fMRI-image data. Using a cross-attention mechanism, a pre-trained image Masked Auto-Encoder provides pixel-level guidance to the fMRI encoder. Essentially, the image data teaches the fMRI model which specific neural activations actually matter for visual processing.
  3. Image Generation via Latent Diffusion: Finally, the optimized fMRI encoder is frozen and used as a conditioning input for a pre-trained Latent Diffusion Model (LDM). The LDM takes the refined brain signals and generates the final high-resolution image.

Key Insights

  • Masking fits fMRI perfectly: fMRI data has high "spatial redundancy" (adjacent brain voxels often show similar signals). Masking out large chunks forces the network to understand the underlying global brain state rather than memorizing local noise.
  • Brain signals need a translator: You cannot simply plug raw fMRI data into an image generator. By using cross-attention with an image encoder, the model creates a bridge between the biological modality (brain waves) and the computational modality (pixels).
  • Leveraging Diffusion Priors: Because fMRI-to-image datasets are relatively small, training a generative model from scratch is prone to failure. Translating fMRI data into a latent space understood by a pre-trained Stable Diffusion model allows the system to leverage vast prior knowledge of natural images.

Remarkable Results

The model was evaluated on specialized datasets like GOD (Generic Object Decoding) and BOLD5000, which contain fMRI data from subjects viewing thousands of images.

Quantitative and qualitative comparison with state-of-the-art methods
  • Massive Quantitative Leap: On the GOD dataset, the proposed model achieved a 39.34% relative improvement in 50-way-top-1 semantic classification accuracy compared to the previous state-of-the-art (DC-LDM).
  • Qualitative Superiority: Visually, the generated images are stunningly coherent. While baseline models like SS-AE produced vague blobs, and IC-GAN produced distorted textures, this model successfully generates clear, recognizable subjects (e.g., an airplane, a bird, a stop sign) that semantically match the ground truth images the human subjects were viewing.
  • Robustness: The model consistently outperformed baselines across multiple different human subjects, proving the architecture generalizes well across different individuals' brain topologies.

Limitations and Future Work

Despite the impressive results, the authors note a few limitations. The model suffers from a slight categorical bias, likely inherited from the massive datasets used to pre-train the Latent Diffusion Model. Furthermore, while excellent at capturing high-level semantics (e.g., "this is a picture of a bird"), it sometimes fails to reconstruct fine-grained details like exact posture or specific backgrounds. This is likely because human subjects often imagine multiple things or let their minds wander during data collection, creating noisy features. Future work will focus on minimizing data bias and improving the extraction of fine-grained details from fMRI signals.

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