Manuscript Offprint

arXiv:2609.02582

EEG-based Visual Retrieval and Reconstruction: From Neurally Visible Optimal Layer to Hierarchical Diffusion Generation

Minyi Wang, Zhenqin Wu, Rihui Li

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Minyi Wang, Zhenqin Wu and Rihui Li

Abstract—Decoding visual perception from electroencephalography (EEG) is important for non-invasive brain-computer interfaces (BCIs). However, most existing visual decoding pipelines directly align EEG features with semantic features from pretrained vision models. Those EEG signals carry information at more than one level and this practice disregards the varying neural visibility of different visual components in EEG signals, leading to cross modal mismatches and incomplete information use. In this work, we address this limitation through layer-wise contrastive learning. For each subject, the intermediate CLIP layer that maximizes retrieval performance is selected as the Neural Visibility Optimal Layer (NVOL). Built on NVOL, a hierarchical framework couples retrieval and generation through a shared intermediate representation. The retrieval branch fuses multi-NVOL features, aligns them to image embeddings via contrastive learning, and applies cross-domain similarity local scaling (CSLS) at test time to mitigate hubness. The generation branch reconstructs subject-specific NVOL features from EEG using a conditional diffusion prior, maps them to CLIP space through a lightweight adapter, and drives a pretrained Stable Diffusion XL model. Experimental validation on THINGS-EEG showed that, NVOL-based retrieval achieves 78.1% mean Top-1 accuracy in 200-way retrieval, rising to 86.4% with CSLS. Two-stage NVOL-to-semantic reconstruction also outperforms single-stage final-layer diffusion on semantic and structural metrics. By aligning EEG with layer-wise neural visibility rather than fixed high-level semantics, the proposed framework improves both retrieval accuracy and image reconstruction in EEG-based visual decoding.

Index Terms—electroencephalography, visual decoding, image retrieval, image generation, neural visibility

I. INTRODUCTION

Visual perception supports humans' recognition and interaction with the external environment. A central question in neuroscience and brain-computer interface (BCI) research is whether visual neural signal can be decoded into machine-readable representations [1], [2]. With the development of visual-language models [3], [4], researchers can build human-computer interaction systems that can directly read and understand the visual signals of the brain. These systems may clarify how the brain represents external visual input and may also support practical BCI applications outside the laboratory.

Visual decoding first requires appropriate neural recordings. Although functional magnetic resonance imaging (fMRI) provides high spatial resolution and has long been a primary tool for visual decoding [5], it is costly, temporally limited, and difficult to deploy in portable or real-time settings [6]. Electroencephalography (EEG) offers higher temporal resolution, portability, and lower cost [7], although scalp recordings are noisy and spatially coarse, so extracting stable visual representations from EEG remains a core methodological challenge [8].

EEG-based visual decoding has moved beyond image classification to object-level decoding and image reconstruction [9], [10]. Large EEG datasets combined with deep learning have improved decoding accuracy [11]. Diffusion-based priors have reconstructed natural images from fMRI and magnetoencephalography(MEG) [12]–[14], and similar paradigms are now being adapted to EEG despite its lower spatial resolution and higher noise. However, as reconstruction becomes a primary goal [10], it remains poorly defined how visual information is organized across representational levels in scalp EEG and which levels support reliable alignment with computational vision models [10], [15].

Prior studies suggested that EEG does not encode visual features uniformly across the hierarchy [16]. Global structure linked to low-frequency components is relatively stable in scalp recordings, whereas high-level semantic information shows lower neural visibility [15]. Most EEG visual decoding methods still follow a vision-language style pipeline: they use contrastive learning to align EEG features with image features from a pretrained vision model, and they take the final-layer semantic embedding as the target [17]. This ignores the hierarchical nature of visual processing in the brain. The resulting highly compressed features may match poorly with the multiscale information available in scalp EEG. In EEG2Vision, reducing the number of electrodes dropped category decoding accuracy from 89% to 38%, while reconstruction quality changed only modestly [18]. In structure-guided diffusion models, explicit structural cues improved both low-level visual attributes and semantic content [19].

This work was supported by the Science and Technology Development Fund of the Macao SAR (0016/2024/RIB1), Guangdong Provincial Natural Science Foundation (2025A1515010539), and the University of Macau (MYRG-GRG2024-00296-ICI, and MYRG-CRG2024-00022-ICI). (Corresponding author: Rihui Li.)

Minyi Wang is with the Centre for Cognitive and Brain Sciences, Institute of Artificial Intelligence and Brain Sciences, University of Macau, Taipa, Macau S.A.R. 999078, China (e-mail: minyiwang11@gmail.com).

Zhenqin Wu is with the School of Biomedical Engineering and the School of Computing and Data Science, The University of Hong Kong, Hong Kong SAR (e-mail: zqwu@cs.hku.hk).

Rihui Li is with the Centre for Cognitive and Brain Sciences, Institute of Artificial Intelligence and Brain Sciences, University of Macau, Taipa, Macau S.A.R. 999078, China, and also with the Department of Biomedical Engineering, Faculty of Engineering, University of Macau, Taipa, Macau S.A.R. 999078, China (e-mail: rihuli@um.edu.mo).

Recent work has added structural guidance [19], built staged coarse- and fine-grained semantic representations [20], or used two-stage diffusion pipelines that keep low-level detail but weaken semantic coherence. Staged representation learning that separates coarse- and fine-grained semantics reached 84.6% zero-shot decoding accuracy on THINGS-EEG, 21.4% points above the baseline [15], [20]. EEG retrieval systems trained with InfoNCE-style objectives can improve cross-modal alignment [21], but high-dimensional embeddings often show hubness, where a few classes dominate nearest-neighbor lists [22]. Generation methods also tend to reuse EEG features learned for retrieval; when retrieval is unstable, reconstruction can suffer as well. These observations suggest that EEG decoding needs visual layers that are more neurally visible, retrieval calibration that reduces hubness, and a shared hierarchical representation for both retrieval and generation [15], [20], [22], [23].

In this study, we built a unified hierarchical alignment framework that places retrieval and generation in a shared feature space. Instead of the final semantic layer, we aligned EEG with intermediate layers of the vision encoder. Our main contributions are as follows.

  • We examined EEG-image alignment from shallow to deep layers and found that the best alignment depth varied across participants, but remained in intermediate layers.

  • We fused multiple neurally visible layers rather than forcing a single alignment target, with the aim of improving representational capacity and interpretability.

  • We built a unified retrieval-generation pipeline (EEG → neurally visible optimal layer → final layer). The retrieval branch trained an EEG encoder with contrastive learning and applied CSLS at test time to reduce hubness. The generation branch reconstructed neurally visible features with a diffusion prior and mapped them to the final CLIP layer through a lightweight adapter for SDXL image generation.

References (58)