Stable Diffusion Rebuilds Seen Images From Brain Scans
Terminator Brain imaging By What The Future Newsroom · March 3, 2023 · 3 min read

Stable Diffusion Rebuilds Seen Images From Brain Scans

Researchers in Japan used Stable Diffusion to reconstruct images people had seen from fMRI data. Their approach connects signals from different visual brain regions to the model’s image and text encoders using simple linear models, and the team says the combined decoding produced the most accurate results.

Signals from brain scans can help generative AI recreate images a person has seen. Researchers at the Graduate School of Frontier Biosciences, Osaka University, and CiNet, NICT, Japan, used Stable Diffusion to reconstruct visual experiences from fMRI data, without training or fine-tuning the diffusion model itself.

“Reconstructing viewed images from brain scans modestly raises privacy concerns, though the study is limited to visual experiences in fMRI data.”Why it scores Terminator

Connecting brain signals to Stable Diffusion

The method relies on simple linear models trained to map fMRI signals from lower and upper visual brain regions to components of Stable Diffusion. The lower regions connect to the model’s image encoder, while the upper regions connect to its text encoder.

That division gives the reconstruction system two kinds of information to work with. The image side contributes visual composition, while the text side contributes semantic content—the meaning of what the person saw. The researchers report that combining the two forms of decoding produced the most accurate reconstructions.

The experiment used fMRI images from the Natural Scenes Dataset (NSD) to test whether the system could reconstruct what subjects had viewed. Results differed between subjects, and the team says those differences correlated with the quality of the fMRI images.

Reconstruction without retraining the generator

Many brain-decoding approaches use recorded fMRI data as input to a generative AI model. This study’s distinction is that it avoids training and fine-tuning the complex AI model used to generate images. Instead, the researchers train only the simpler models that connect brain signals to Stable Diffusion’s components.

The team says the resulting image quality is on par with the best current methods. That comparison matters because the approach aims to reach similar reconstruction quality while avoiding the need to train the generative models used by those methods.

Reconstructing a viewed image from fMRI is not the same as directly observing a person’s thoughts. The experiment focuses on visual experiences represented in scan data, and its results vary with the quality of those scans. Its scope, as described by the researchers, is a particular task: linking brain activity to images people saw.

A longer path of brain-to-image research

Researchers have explored AI-based brain decoding for years. In early 2018, a group of researchers from Japan demonstrated image reconstruction from fMRI recordings using a neural network. In 2019, another group reconstructed images from monkey neurons.

Later work explored other ways to interpret brain activity. Meta’s research group, led by Jean-Remi King, published work deriving text from fMRI data. In October 2022, a team at the University of Texas, Austin showed that GPT models could infer text describing the semantic content of video a person had seen, using fMRI scans.

In November 2022, researchers at the National University of Singapore, the Chinese University of Hong Kong, and Stanford University used MinD-Vis to show that diffusion models could reconstruct images from fMRI scans with significantly higher accuracy than approaches available at the time. Diffusion models power systems including Stable Diffusion, DALL-E, and Midjourney.

Using brain data to study diffusion models

The researchers also use models derived from fMRI data to examine Stable Diffusion itself. They investigate how semantic content is generated during the inverse diffusion process and what processes occur in the U-Net.

They are also quantitatively interpreting image transformations across different stages of diffusion. The aim is to use a biological perspective to improve understanding of diffusion models, which are widely used but remain poorly understood.

The work therefore has two linked directions: reconstructing visual experiences from brain scans, and using those reconstructions to examine how image generation unfolds inside a diffusion model. The researchers’ method connects these goals without requiring them to retrain Stable Diffusion.

Artificial intelligenceBrain imagingDiffusion models
← Back to the wire

Read next