Visual Decoding and Reconstruction via EEG Embeddings with Guided Diffusion

How to decode human vision through neural signals has attracted a long-standing interest in neuroscience and machine learning. Modern contrastive learning and generative models improved the performance of visual decoding and reconstruction based on functional Magnetic Resonance Imaging (fMRI). However, the high cost and low temporal resolution of fMRI limit their applications in brain-computer interfaces (BCIs), prompting a high need for visual decoding based on electroencephalography (EEG). In this study, we present an end-to-end EEG-based visual reconstruction zero-shot framework, consisting of a tailored brain encoder, called the Adaptive Thinking Mapper (ATM), which projects neural signals from different sources into the shared subspace as the clip embedding, and a two-stage multi-pipe EEG-to-image generation strategy. In stage one, EEG is embedded to align the high-level clip embedding, and then the prior diffusion model refines EEG embedding into image priors. A blurry image also decoded from EEG for maintaining the low-level feature. In stage two, we input both the high-level clip embedding, the blurry image and caption from EEG latent to a pre-trained diffusion model. Furthermore, we analyzed the impacts of different time windows and brain regions on decoding and reconstruction. The versatility of our framework is demonstrated in the magnetoencephalogram (MEG) data modality. The experimental results indicate that our EEG-based visual zero-shot framework achieves SOTA performance in classification, retrieval and reconstruction, highlighting the portability, low cost, and high temporal resolution of EEG, enabling a wide range of BCI applications. Our code is available at https://github.com/ncclab-sustech/EEG_Image_decode.

Paper

Similar papers

Peer review

Reviewer gPm45/10 · confidence 4/52024-07-09

Summary

This paper presents an end-to-end EEG-based visual decoding framework that includes two stages: a brain encoder for EEG feature extraction and a "generator" for producing reconstructed images. The experiments demonstrate effective results in retrieval, classification, and reconstruction tasks across two datasets, suggesting potential applications for real-time brain-computer interfaces.

Strengths

The research demonstrates the feasibility of using non-invasive EEG signals for image decoding as using fMRI techniques. The analysis provides a valuable reference for EEG feature extraction. The paper highlights three primary contributions: (1) an EEG-image decoding framework, (2) a novel EEG encoder, and (3) a two-stage EEG-to-image generation strategy that leverages both low- and high-level visual information.

Weaknesses

The paper's novelty in the context of brain-image decoding methodologies is not distinctly clear. 1. The pipeline, which includes a contrastive learning-driven encoder and a diffusion-based decoder, is already well-established in the field. 2. The ATM encoder, which incorporates channel-wise attention, spatial convolution, and temporal convolution, does not significantly differ from previous studies, such as mentioned in the introduction, Benchetrit et al. and Song et al. 3. The method for disentangling low- and high-level features within the framework is unclear, particularly how the VAE is supposed to provide low-level image features. The evaluation section contains many conclusions that conflict with scientific validity, which may cause serious misleading. 1. How can we get clear reconstruction results with only 50 ms signals after the onset as in Figure 7c? The visual stimuli haven’t reached V1 in such a short time. 2. We know the temporal cortex is strongly related to object recognition. But in Figure 8b, the temporal channels contribute very small. Based on that, should we think the retrieval task was based on some low-level information? 3. The visual response is very quick after the onset, finished before 200 ms. It cannot be thought of as visual responses at 500 ms after the onset on Page 7 Line 182, and contained within 200-400 ms on Page 9 Line 246. 4. On page 9 Line 251, It can’t be concluded that EEG is better than MEG in visual tasks where the paradigms used for these two datasets were different.

Questions

1. The paper mentions selecting the highest test accuracy during the training process as the statistical result. It would be more rigorous to test the model only once after it is fully trained. 2. In the framework illustrated in Figure 2, which input to the diffusion process is most critical for image generation—the reconstructed output after VAE, the image embedding transferred from EEG, or the generated caption? 3. How does the model ensure that it captures low-level features after the VAE encoder? 4. What is the impact of the pre-trained language and generative models on the final performance? 5. Could you provide more details about the cross-subject settings described in P3L91? Specifically, what roles do the subject token and shared token in Figure 3 play, and do they enhance cross-subject capability? 6. Figure 11a seems to show no significant correlation between text and EEG features. Could you comment on this observation?

Rating

5

Confidence

4

Soundness

2

Presentation

3

Contribution

3

Limitations

Yes. The authors adequately addressed the limitations and future works.

Reviewer gPm42024-08-13

Response to authors

Thanks for your kind reply. I still have concerns: 1) Q7, Why not use a validation set? It's not convincing to use test sets in training processing. 2) Q9, what are the gains of low-level features from VAE for the overall framework, if they are pixel-level representations after CLIP alignment, instead of low-level features defined in vision?

Authorsrebuttal2024-08-13

Response to Reviewer gPm4

We appreciate the reviewer's thoughtful feedback and recognize the significance of the highlighted concerns. (1) Thank you for your suggestion. We will add the results on the validation set in the official version of the paper. In fact, we initially considered that if we adopt the same approach as in [1], that is, to divide a small number of trials in the training set as the validation set for evaluating the model, this may violate the zero-shot task setting. Different from those classification and retrieval tasks with known categories, due to our unique processing form (in a dataset with a total of 1864 categories, we use 1654 categories of samples as the training set and the remaining 200 categories as the test set), so we hope to always evaluate the performance of the model in a zero-shot form. Our original approach was to train the models of different encoders for a sufficient number of rounds (30 epochs in the experiment) to ensure model convergence, and test them on the test set in the last 10 epochs. Since all models use the same evaluation method, and we strictly control the random seed and ensure that the data is not leaked, the final evaluation results are also unbiased. (2) This is another interesting question. First of all, our statement has some typo. What we want to express is "The low-level and high-level here refer to the representation that obtained from the pixel-level after VAE alignment with or the semantic-level after CLIP alignment with". Past work [2] has found that in the denoising stage of the early diffusion model, z signals (corresponding to the VAE latent in our framework) dominated prediction of fMRI signals. And during the middle step of the denoising process, zc predicted activity within higher visual cortex much better than z. However, please note that this is only an analysis based on decoding accuracy. These analyses do not have a strong neuroscience causal relationship. We still cannot conclude that the low-level features of fMRI are modeled by VAE. From our experimental results, the more VAE latent is used in the denoising process, the more certain the overall reconstructed image is and the less details it has. Conversely, the more details it has. Therefore, the contribution of VAE latent and clip latent to reconstruction tends to be a balance relationship. Our future work should focus on achieving more brain-like decoding, paying attention to both well low-level and high-level reconstruction, rather than maintaining an either-or relationship between the two. **Reference** [1] Song Y, Liu B, Li X, et al. Decoding Natural Images from EEG for Object Recognition[C]//The Twelfth International Conference on Learning Representations. [2] Takagi Y, Nishimoto S. High-resolution image reconstruction with latent diffusion models from human brain activity[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2023: 14453-14463

Authorsrebuttal2024-08-14

Thank you for your further suggestive comments

We further explain the question (1) you have raised. We added the performance of different EEG encoders on the test set with batch sizes of 16 and 1024 in the anonymous code (https://anonymous.4open.science/r/Visual_Reconstruction-AC56). It can be seen that all methods gradually converge with the increase of training epochs and present a performance value with very small variance on the test set. Therefore, **Figure 5c** and **Figure 5d** of this article use the epoch with the highest test set accuracy in the same total epochs, under the statistics of multiple random seeds. The results in **Table 7** are the average test set accuracy of the last 10 epochs after training convergence. In the **one-page pdf** file we uploaded, there is a more comprehensive performance of each subject's data for reference.

Authorsrebuttal2024-08-14

Response to Reviewer gPm4

Sorry to bother you. We are about to run out of time to respond. We have made complements and explanations for this work with the help of all the reviews. We would be grateful if you could confirm whether the rebuttal meets your expectations and if there is any other suggestion. Thank you once again for your time and insightful comments!

Reviewer 4xL43/10 · confidence 4/52024-07-10

Summary

The paper presents a end-to-end EEG-based visual reconstruction zero-shot framework, featuring the Adaptive Thinking Mapper (ATM) and a two-stage EEG-to-image generation strategy. This method achievies state-of-the-art performance in classification, retrieval, and reconstruction tasks, and significantly advancing the field of brain-computer interfaces.

Strengths

1.Comprehensive EEG experiments, encompassing retrieval, classification, and visual stimulus reconstruction. 2.Cross-subject considerations.

Weaknesses

1.The manuscript has several significant deficiencies. First, its motivation is based on the signal differences between EEG and fMRI, concluding that EEG's performance limitations are due to constraints in decoding and reconstruction frameworks. However, the proposed EEG encoder merely adds a Channel Attention layer compared to NICE [1], with no detailed explanation provided. Additionally, the loss function in Section 2.4 is taken directly from [2], demonstrating a lack of originality. Furthermore, the visual reconstruction framework shows no substantial difference from existing fMRI methods [3,4], as it also utilizes pre-trained stable diffusion models and their variants, with minor differences, such as the incorporation of Sdedit [5], being tricks to enhance generation quality. Thus, the manuscript fails to substantiate its claims and contributions convincingly. 2.The processing of visual information in the brain involves multiple stages and typically takes around 100-150 milliseconds to reach higher visual areas where complex processing occurs. EEG signals at 50 milliseconds are likely still within the retina and optic nerve stages. Thus, the generation of images from 50ms EEG signals, as shown in Figure 7, contradicts established neuroscience principles. This suggests that the visual stimulus reconstruction framework heavily relies on the image generation model, which may have limited significance for the field of neuroscience. [1] Song, Yonghao, et al. "Decoding Natural Images from EEG for Object Recognition." arXiv preprint arXiv:2308.13234 (2023). [2] Benchetrit, Yohann, Hubert Banville, and Jean-Rémi King. "Brain decoding: toward real-time reconstruction of visual perception." arXiv preprint arXiv:2310.19812 (2023). [3] Chen, Zijiao, et al. "Seeing beyond the brain: Conditional diffusion model with sparse masked modeling for vision decoding." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2023. [4] Lu, Yizhuo, et al. "Minddiffuser: Controlled image reconstruction from human brain activity with semantic and structural diffusion." Proceedings of the 31st ACM International Conference on Multimedia. 2023. [5] Meng, Chenlin, et al. "Sdedit: Guided image synthesis and editing with stochastic differential equations." arXiv preprint arXiv:2108.01073 (2021).

Questions

I have no quentions, please see the weaknesses.

Rating

3

Confidence

4

Soundness

1

Presentation

2

Contribution

2

Limitations

Yes

Reviewer zVcP6/10 · confidence 4/52024-07-12

Summary

The study proposes an end-to-end EEG\MEG-to-image reconstruction framework, consisting of a tailored brain encoder ATM to project neural signals into the shared subspace as the clip embedding, and a two-stage image generation block. The model achieves successful cross-subject EEG\MEG decoding and SOTA performance in classification, retrieval, and reconstruction.

Strengths

1. The paper is well-organized and nicely written. 2. The experiments are comprehensive and convincing.

Weaknesses

1. I think some parts of the model and implementation have not been clarified very well: * I think it hasn’t been clarified in the main text whether the main results (starting from 3.2 to 3.5) show within-subject or cross-subject performance, unless I missed something. Adding some notices in figure\table captions or some summarizing sentences at the beginning of each section might be helpful. * What model is inside the frozen “VAE image encoder” for low-level image generation in Figure 2? Also, what diffusion model is this study conditioning on? Is it built and retained from a pre-trained model (like stable diffusion), or was it trained from scratch by the authors? * I think the authors didn’t introduce the “image2text” component (BLIP2), unless I missed it. 2. There are two recent EEG-to-image reconstruction works that this study has not discussed or compared. While it is understandable that the authors did not compare them, as they are still preprints and use different datasets, it might be beneficial to discuss them in the related work section given the limited literature in this field: * Bai, Yunpeng, et al. "Dreamdiffusion: Generating high-quality images from brain eeg signals." arXiv preprint arXiv:2306.16934 (2023). * Lan, Yu-Ting, et al. "Seeing through the brain: image reconstruction of visual perception from human brain signals." arXiv preprint arXiv:2308.02510 (2023). For other minor comments please see Questions.

Questions

1. For low-level metrics, in Mindeye, Ozcelik et al.’s, and other fMRI-to-image reconstruction works, they usually provide PixCorr values. I wonder why this metric wasn't included here. 2. For Figure 4, the plots are impressive, but it would be helpful to include numerical indications of the downstream task performances, such as 0.7 or 0.8. This would provide a clearer understanding of how well the model is performing. 3. Could the author elaborate more on the functioning of the shared token and subject tokens?

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

The authors have adequately discussed the limitations.

Authorsrebuttal2024-08-12

Response to Reviewer zVcP

Thank you to the reviewer for the impressive questions and suggestions. We are very grateful to the reviewer for pointing out the technical details that were not clarified in our article. The content presented in this article is quite comprehensive and sufficient, but we sincerely hope the reviewer to pay further attention to our innovation and unique contributions: 1. Technically, we consider the positional relationship between channels and the modeling of the time dimension, so we introduce a channel-wise patch embedding and feedforward neural network in the time dimension (Figure 3). EEG data is different from fMRI, which requires sufficiently effective feature extraction and neuroscience-specific inductive paranoia to maximize the performance expectations of decoding - we have achieved state-of-the-art on different tasks (Figure 4). Finally, in the uploaded pdf file, we provide comprehensive evaluation results. 2. In terms of scientific insights, based on strong performance, we further provide analysis results of different dimensions such as time distribution (Figure 7), spatial distribution (Figure 8), representation distribution (Figure 11) and concept distribution (Figure 12), which strongly proves the effectiveness, scalability, interpretability and causality of our framework for EEG decoding and reconstruction. 3. In terms of potential impact, our work enhances the interpretability of the model on existing neural decoding tasks as much as possible, including decoding of cognitive concept foundations (Figure 12) and revealing neural mechanisms (Figure 8). Furthermore, we focus on the study of causal relationships. In order to understand the reasons for the high decoding accuracy, we conducted a number of spatial-temporal ablation experiments, compared and demonstrated in detail the corresponding viewpoints in EEG decoding and neuroscience. In addition, in order to prove the effectiveness of the results, future work will focus on the verification of real-world applications - we are collecting enough EEG data from different subjects for full parameter or efficient parameter fine tuning to further verify the effectiveness of our framework. 4. We have updated codes in the anonymous code link (https://anonymous.4open.science/r/Visual_Reconstruction-AC56), and all codes provided in the review area will be refined and be public after the anonymous phase. And we provided examples of reconstructing images with different random seeds for growing windows across time scales (README.md). From the two example stimulus images provided, the reconstructed images show uncertainty between 0 to 50 ms and 0 to 250 ms because the stimulus has just arrived at the primary visual cortex and it takes time for the brain to react and be captured, the reconstructed image during this period shows uncertainty (probably due to noise unrelated to the stimulus). Here, since the prior of natural images is added to the two-stage framework, high quality images can be reconstructed even from 0 to 50 ms and 0 to 250 ms. Then, with the accumulation of visual stimulus information, the semantics of the reconstructed images gradually become clear. After 500 ms, the images decoded by EEG tend to be stable, which means that there may be no new information added.

Reviewer asin6/10 · confidence 3/52024-07-14

Summary

This paper proposes a learning framework to decode images from EEG signals. It introduces a tailored brain encoder, the Adaptive Thinking Mapper, which projects neural signals to the clip embedding space. Subsequently, a two-stage image generation strategy is applied to produce images, progressing from blurry to high-quality reconstructions. This is an interesting and innovative work.

Strengths

* This paper is easy to understand, and it is an interesting work exploring EEG to image decoding.

Weaknesses

* Some experimental settings were not very clearly illustrated. For instance, in Section 3.1, it is mentioned that the experiments were trained on an EEG dataset and tested on an MEG dataset. How did you align the channel heterogeneity? Is it a zero-shot approach? * Table 1 is a bit confusing to me. It would be helpful to clarify and explain the experimental settings of these additional datasets. * Although EEG has a fast response, the design of the proposed framework does not seem to leverage motivations related to EEG data. It would be better to demonstrate the effectiveness of the proposed framework compared to existing fMRI-image decoding methodologies. For instance, you could replace the EEG encoder with an fMRI encoder and test whether the framework can outperform existing methodologies.

Questions

* Is the spider plot in Figure 4 showing normalized performance? Please clarify. * Please address my queries in the Weakness section:

Rating

6

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

I agree with the limitation regarding the cross-subject performance drop. Future work could consider incorporating existing cross-subject generalization efforts from the EEG domain to address this issue.

Reviewer zVcP2024-08-11

Thank you for the rebuttal

Thank you for the detailed explanations! I will maintain my current score.

Authorsrebuttal2024-08-12

Sincere Request for Feedback on Response Clarifications and Explanations

Dear Chairs and Reviewers, Thanks for the insightful questions and suggestions to our manuscript. Could you please provide feedback on our responses to your questions? We are sincerely eager to know if our answers have addressed your concerns. Additionally, are there any further comments or insights you might have regarding our work? Your input is crucial for us to enhance the quality of our submission, and we greatly appreciate your guidance and time. Best wishes, Paper Authors

Authorsrebuttal2024-08-14

Response to Reviewer 4xL4

Thank you for your comments and feedback! **Q1:  ”Its motivation is based on the signal differences between EEG and fMRI, concluding that EEG's performance limitations are due to constraints in decoding and reconstruction frameworks. ”** Although fMRI plays an important role in neuroimaging research, fMRI has low temporal resolution, bulky and non-portable equipment, high cost, and is non-invasive but limited by the magnetic field environment. So fMRI-based work is almost impossible to apply in practice, and this have hindered the development of the brain-computer interface (BCI). This motivates us to propose a zero-shot visual decoding and reconstruction framework that can be proven effective on Image-EEG datasets. Our manuscript provides an empirical guidance on practical BCI applications. We hope that the BCI and neuroscience communities pay more attention to the implementation of similar technologies and real data rather than overfitting only on existing fMRI datasets. **Q2: “However, the proposed EEG encoder merely adds a Channel Attention layer compared to NICE [1], with no detailed explanation provided. Additionally, the loss function in Section 2.4 is taken directly from [2], demonstrating a lack of originality. Furthermore, the visual reconstruction framework shows no substantial difference from existing fMRI methods [3,4], as it also utilizes pre-trained stable diffusion models and their variants, with minor differences, such as the incorporation of Sdedit [5], being tricks to enhance generation quality. Thus, the manuscript fails to substantiate its claims and contributions convincingly.”** Neural network model structures, including image reconstruction strategies, are often inductive biased. On the one hand, researchers in the BCI community have been using spatial-temporal convolutional models to process EEG signals since EEGNet. On the other hand, the open source of StableDiffusion allows us to leverage models like CLIP that were trained with massive datasets as a teacher to guide the training of our brain models where we have a relative scarcity of data. Although it utilizes existing machine learning techniques , we demonstrate for the first time that EEG-based zero-shot visual decoding and reconstruction can be competitive with fMRI. Previous published work either focused on the EEG image decoding, or reconstructed images of known categories on small-scale and controversial datasets; or focused on the fMRI based image decoding and reconstruction, to achieve advanced performance on the fMRI datasets. Our work has introduced joint subject training for cross-subject evaluation, which is expected to solve the problem of decreased decoding performance due to subject differences when the amount of training data is sufficient. To the best of our knowledge, this is the first work to simultaneously achieve state-of-the-art performance on downstream zero-shot retrieval, classification, and reconstruction tasks on a dataset of the size of THINGS-EEG. **Q3: “The processing of visual information in the brain involves multiple stages and typically takes around 100-150 milliseconds to reach higher visual areas where complex processing occurs. EEG signals at 50 milliseconds are likely still within the retina and optic nerve stages. Thus, the generation of images from 50ms EEG signals, as shown in Figure 7, contradicts established neuroscience principles. This suggests that the visual stimulus reconstruction framework heavily relies on the image generation model, which may have limited significance for the field of neuroscience.”** We have updated codes in the anonymous code link (https://anonymous.4open.science/r/Visual_Reconstruction-AC56). And we provided examples of reconstructing images with different random seeds for growing windows across time scales (README.md). From the two example stimulus images provided, the reconstructed images show uncertainty between 0 to 50 ms and 0 to 250 ms because the stimulus has just arrived at the primary visual cortex and it takes time for the brain to react and be captured, the reconstructed image during this period shows uncertainty (probably due to noise unrelated to the stimulus). Here, since the prior of natural images is added to the two-stage framework, high quality images can be reconstructed even from 0 to 50 ms and 0 to 250 ms. Then, with the accumulation of visual stimulus information, the semantics of the reconstructed images gradually become clear. After 500 ms, the images decoded by EEG tend to be stable, which means that there may be no new information added. Combined with Figure 7, the random seed image reconstruction example figure linked to the anonymous code we provided, and Figure 29 in Appendix H.1, we can see that these results just confirm the previous research and are consistent with the priors of neuroscience.

Area Chair YBnx2024-08-14

please respond to the extensive rebuttal

Reviewer 4xL4 please respond to the extensive rebuttal provided by the authors.

Yun Wang92024-12-26

Overlapped time window between trials?

The EEG dataset presented stimuli for 100ms with a SOA of 200ms. Why do the trials use the time window from 0-1000ms? Will this cause overlapped signals between trials?

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC