EEG-Based Visual Brain Decoding
Temporally coherent video generation from neural signals using
Transformer Encoders, Multi-Path Conditioning, and Stable Diffusion.
Group 22 Members
Vipresh Gupta
B24412
Vishal Meena
B24413
Sarthak Kardam
B24404
Manan Sahni
B24397
Raghav Bansal
B24402
Shivam Gami
B24405
Shivam Singla
B24406
Kamesh Singh
B23317
Milan Jadav
B23134
Rishab Bagul
B24151
Decoding the Visual Cinema
Evolving Scenes
Our visual experiences are composed of continuously evolving scenes caused by the movement of objects and viewing perspective. To investigate the mechanism of our visual system, neuroimaging techniques (fMRI, MEG, EEG) are used to analyze brain activities.
The Temporal Resolution Gap
Recently, works have reconstructed high-quality two-second videos from single fMRI frames. However, limited by the low temporal resolution of fMRI, these lack the ability of capturing high dynamic changes. Thus, we propose video reconstruction from EEG signals.
The Semantic & Temporal Gap
Mapping low-dimensional neural signals to the high-dimensional pixel space of video frames requires overcoming the semantic gap between neural activity patterns and perceptual representations.
- Noisy Signals: EEG is notoriously noisy, non-stationary, and highly variable across subjects.
- Temporal Consistency: Generating video demands architectures that explicitly model cross-frame dependencies, absent from standard image models.
Abstract
Decoding human visual perception directly from brain activity stands as one of the most ambitious frontiers in computational neuroscience. This project, EEG2Video, proposes a novel multimodal Deep Learning pipeline for reconstructing dynamic visual stimuli (video) from non-invasive EEG signals.
Leveraging the SEED-DV dataset, raw 64-channel EEG recordings are transformed via STFT into frequency spectrograms and encoded through a Transformer Encoder. A novel Dynamic-Aware Noise Adding (DANA) module adaptively conditions latent vectors based on EEG-derived temporal motion labels. Video generation is performed using a fine-tuned Stable Diffusion v1.5 architecture augmented with a TemporalUNet backbone to ensure inter-frame coherence.
Why EEG over fMRI?
High Temporal Resolution
fMRI has excellent spatial resolution but poor temporal resolution (captures changes every ~2 seconds). EEG offers millisecond-level temporal resolution, making it uniquely suited for capturing the fast neural dynamics required for video reconstruction.
Accessibility & Portability
fMRI and MEG require massive, stationary, and expensive medical equipment. EEG is low-cost, portable, and non-invasive, paving the way for practical, real-world BCI applications outside clinical settings.
EEG Setup
State-of-the-Art Baseline
EEG2Video: Towards Decoding Dynamic Visual Perception from EEG Signals
Authors: Xuan-Hao Liu et al.
Conference: NeurIPS 2024
Dataset Used: SEED-DV (20 subjects, 1400 EEG-video pairs)
Architecture in Brief
A Seq2Seq Transformer that densely maps temporally-windowed EEG embeddings (extracted via a GLMNet) to video latents. It utilizes a Dynamic-Aware Noise-Adding (DANA) module and a fine-tuned inflated Stable Diffusion (Tune-A-Video) model guided by CLIP-aligned embeddings.
Key Contributions
- Introduced the first large EEG-video paired dataset (SEED-DV) with rich meta-annotation.
- Proposed GLMNet encoder combining global and local (occipital) EEG features.
- First to leverage EEG's high temporal resolution via Seq2Seq alignment for dynamic video reconstruction.
EEG2Video Results & Limitations
Reported Metrics (Full 40-class)
| Metric | EEG2Video (SOTA) |
|---|---|
| 2-way video semantic acc. | 79.8% |
| 40-way video semantic acc. | 15.9% |
| SSIM (pixel-level) | 0.256 |
Note: On 10-class subset, SSIM reaches 0.300.
Identified Limitations
- Single Session: Each subject recorded in only one session, lacking stable temporal neural patterns.
- Subject-Dependent Only: Cross-subject generalization is entirely unexplored (a major gap for EEG).
- Preliminary Quality: Overall reconstruction performance is preliminary (SSIM 0.256).
Related Works & Foundations
Neural Decoding from EEG
Early approaches were limited to binary classification (e.g., motor imagery). Recent advances enabled emotion recognition and coarse scene reconstruction, but full video decoding remained unexplored due to temporal complexity.
Latent Diffusion Models (LDMs)
Rombach et al. (2022) proposed LDMs as a computationally efficient alternative to pixel-space diffusion by operating in the compressed latent space of a pre-trained VAE, serving as our powerful generative base.
Tune-A-Video
Wu et al. (2023) demonstrated that image diffusion models can be adapted for video by injecting lightweight 1D temporal attention layers while freezing spatial weights, preserving rich visual priors without catastrophic forgetting.
CLIP and ViT Representations
Radford et al. and Dosovitskiy et al. proved that CLIP text encoders and Vision Transformers produce semantically rich embeddings. We leverage both modalities as complementary conditioning streams.
How We Differentiate
| Dimension | SOTA (EEG2Video) | Other Work (Tune-A-Video/LDM) | Our Implementation |
|---|---|---|---|
| Temporal Modeling | GLMNet + Seq2Seq | 1D Temporal Attention (Text to Video) | TemporalUNet (Interleaved 1D Attn) driven by EEG |
| Conditioning | CLIP primarily | Text prompts only | Tri-Path: Semantic (CLIP) + Structural (ViT) + DANA |
| Noise Initialization | Standard Gaussian | Standard Gaussian | DANA (Motion-conditioned variance based on dynamics) |
| Preprocessing | Global-Local Mixture | N/A | STFT Spectrograms + Transformer Encoder |
Dataset & Preprocessing
Preprocessing Steps
- 1. Bandpass Filtering: Zero-phase Butterworth (0.5–50 Hz) removes drift and high-frequency noise outside physiological EEG bands.
- 2. Artifact Removal: Independent Component Analysis (ICA) suppresses ocular (EOG) and muscular (EMG) artifacts.
- 3. Epoch Segmentation: Continuous recordings segmented into 500 time-step epochs time-locked to video stimuli.
- 4. Standardization: Per-channel z-score normalization ensures zero mean and unit variance.
SEED-DV Ground Truth Video
Full Pipeline Overview
A 5-stage hybrid deep learning architecture designed specifically for mapping noisy brain signals to temporally coherent video latents.
- 1. STFT Preprocessing & Tokenization
- 2. Transformer Encoder Base
- 3. Tri-Path Extraction (CLIP + ViT + Classifier)
- 4. DANA Latent Stabilization
- 5. TemporalUNet Generation & VAE Decode
Interactive Pipeline Architecture
Explore the high-resolution architecture diagram on our main website interface.
View Interactive Pipeline →Stage 1: Preprocessing (STFT)
Time-Frequency Representation
Raw 64-channel EEG signals are inherently noisy and complex in the time domain. We convert overlapping windows into Short-Time Fourier Transform (STFT) spectrograms.
This extracts power spectral density across standard frequency bands (Delta, Theta, Alpha, Beta, Gamma) into a structured 64 × 64 spatial representation.
Stage 2: Transformer Encoder
EEGNet-Inspired Backbone
4 Layers · 8 Attention Heads
The STFT maps are patchified and passed through a Vision Transformer style encoder. This captures global spatial-spectral relationships across different brain regions.
Acts as the foundation for the three downstream conditioning paths.
Stage 3a: Semantic Path (CLIP)
Semantic Alignment
A TextMLP maps the base EEG embedding into a CLIP-compatible text space. This ensures the generated video matches the high-level concept of what the subject was viewing.
Fix for Mode Collapse: We resolved early mode collapse by injecting raw GT text into the CLIP training alignment.
Cosine Alignment & Thresholding
We use Cosine Similarity loss during training to align the predicted embedding $z_e$ with the ground-truth text embedding $z_t$.
Samples with alignment meeting the threshold provide strong semantic guidance.
Stage 3b: Structural Path (ViT)
Spatial & Compositional Guidance
While CLIP provides semantic concepts ("a dog running"), the ViT path preserves structural layout and composition from the visual cortex signals.
Produces visual latents of shape 6 × 4 × 32 × 32 to guide the structural formation of the generated frames.
Stage 3c: Dynamic Classifier + DANA
Temporal Dynamics (Fast/Slow)
A binary classifier predicts the motion profile of the scene optimized via Cross-Entropy.
DANA Latent Stabilization
Brain signals are noisy. The DANA module adaptively modulates the VAE latents based on the dynamic classifier's output, preventing mode collapse.
Stage 4: TemporalUNet Generation
Frozen Spatial Backbone
Preserves SD v1.5 generative image priors
Trainable Temporal Attention
Interleaved 1D layers for inter-frame coherence
Diffusion Training Objective
Diffusion MSE ≈ 0.0005
Inference Algorithm
Algorithm 1: EEG2Video Inference
Training Loss Convergence
TemporalUNet Phase 4 Validation
The model closely approaches the architectural target of ≈0.0005 MSE over 5 epochs, validating tensor shape contracts and gradient flow.
Quantitative Metrics
Ablation Study
| Configuration | SSIM | PSNR | LPIPS |
|---|---|---|---|
| Full Model (DANA + ViT) | 0.6967 | 29.17 | 0.3526 |
| w/o DANA | 0.5459 | 20.14 | 0.4004 |
| w/o Vision Transformer | 0.4647 | 16.53 | 0.5400 |
Qualitative: GT vs Generated
Real-World Impact & Applications
Medical Rehabilitation
Brain-Computer Interfaces (BCIs) that can reconstruct perceptual states hold immense potential to revolutionize assistive communication for locked-in patients and individuals with severe motor disabilities.
Next-Gen Interaction
Robust visual decoding paves the way for direct thought-to-screen media generation and entirely new forms of seamless human-computer interaction in mixed reality environments.
Cognitive Neuroscience
Decoding the fast temporal dynamics of visual scenes deepens our fundamental understanding of the neural correlates of visual consciousness and how the brain processes continuous motion.
Limitations & Future Work
Current Limitations
- Synthetic Integration: Phase 4 architecture was validated using synthetic tensors; full end-to-end integration with real live EEG embeddings awaits Phase 5.
- Resolution Limits: Outputs are currently constrained to 128×128 px. Scaling to high-definition requires significantly more VRAM and compute.
- Frame Capacity: Current architecture generates 3-frame sequences; longer horizons need hierarchical modeling.
- Subject Variability: EEG signals vary wildly between subjects; personalized adaptation is currently missing.
Future Directions
- Phase 5 Integration: Full SEED-DV benchmarking combining visual and semantic paths from Sub-teams 3 & 4.
- Classifier-Free Guidance (CFG): Implementing CFG natively with EEG conditioning to boost generation fidelity.
- Resolution Scaling: Integrating cascaded diffusion or super-resolution latent upscalers.
- Subject Personalization: Implementing Few-Shot LoRA fine-tuning for specific subjects to combat variability.
Thank You
Questions & Discussion
Key References
- Liu, S., et al. (2024). EEG2Video: Towards Decoding Dynamic Visual Perception from EEG. NeurIPS.
- Wu, J.Z., et al. (2023). Tune-A-Video: One-Shot Tuning of Image Diffusion Models. ICCV.
- Rombach et al. (2022). High-Resolution Image Synthesis with Latent Diffusion Models. CVPR.
- Song, J., et al. (2021). Denoising Diffusion Implicit Models (DDIM). ICLR.
- Radford, A., et al. (2021). Learning Transferable Visual Models From Natural Language. ICML.
- Dosovitskiy, A., et al. (2021). An Image is Worth 16x16 Words: Vision Transformers. ICLR.