Brain-to-Image Generation: Reconstructing Visual Stimuli from EEG using Generative Adversarial Networks
Organizations: BITS Pilani, India
Abstract
Reconstructing visual stimuli from electroencephalography (EEG) is difficult because scalp measurements have high temporal but limited spatial resolution, and paired EEG-image datasets remain small relative to modern generative-model training corpora. We present a reproducible single-subject baseline on THINGS-EEG2 that first tests the more defensible question of whether EEG can retrieve the viewed stimulus in a visual embedding space. A compact temporal-spatial convolutional encoder maps repetition-averaged EEG (63 by 250) to provided 512-dimensional ViT-B/32 image features. Model selection uses a concept-disjoint validation split, and final evaluation uses the official 200-image, 200-concept test gallery. Across three training seeds, the model obtains 12.83 +/- 0.58%, 39.17 +/- 1.76%, and 58.00 +/- 1.73% image recall at 1, 5, and 10 (mean +/- sample standard deviation), compared with analytical chance levels of 0.5%, 2.5%, and 5.0%. A session-balanced ablation shows that averaging more test repetitions generally improves ranking. Applying the Subject 01 model to the other nine subjects without adaptation causes a sharp performance drop, exposing subject specificity. We further report exploratory stress tests of direct conditional generators trained without external visual weights: single-subject and ten-subject variants produce noise-dominated outputs, with early validation improvements reversing after one to four epochs. Finally, we distinguish direct reconstruction from semantic rendering with a pretrained diffusion prior. The results support above-chance coarse semantic decoding under a closed-set, repetition-averaged protocol, but do not support faithful recovery of stimulus pixels.
Figures & tables
| Partition | Images | Concepts | Repetitions/image |
|---|---|---|---|
| Optimization | 14,890 | 1,489 | 4 |
| Validation | 1,650 | 165 | 4 |
| Official test | 200 | 200 | 80 |
| Stage | Operation | Output channels | Temporal width |
|---|---|---|---|
| Input | EEG tensor | 63 | 250 |
| Temporal | Conv2D, kernel | 32 | 250 |
| Spatial | grouped Conv2D, kernel | 64 | 250 |
| Pool 1 | average pool | 64 | 62 |
| Separable | depthwise , pointwise | 128 | 62 |
| Pool 2 | average pool | 128 | 15 |
| Setting | Value | Setting | Value |
|---|---|---|---|
| Optimizer | AdamW | Batch size | 128 |
| Learning rate | Weight decay | ||
| Epoch budget | 12 | Dropout | 0.35 |
| Temperature | 0.07 | Cosine weight | 0.25 |
| Gradient clip | 1.0 | Validation fraction | 0.10 |
| Metric | Model | 95% CI | Chance | Shuffled EEG |
|---|---|---|---|---|
| Recall@1 | 13.5% | [9.4, 18.9] | 0.5% | 0.5% |
| Recall@5 | 41.0% | [34.4, 47.9] | 2.5% | 2.0% |
| Recall@10 | 59.0% | [52.1, 65.6] | 5.0% | 3.5% |
| Seed | R@1 | R@5 | R@10 | Median rank |
|---|---|---|---|---|
| 42 | 13.5% | 41.0% | 59.0% | 8 |
| 7 | 12.5% | 39.0% | 59.0% | 8 |
| 21 | 12.5% | 37.5% | 56.0% | 9 |
| Aggregate | % | % | % |
| Repetitions | R@1 | R@5 | R@10 | Median rank | Mean rank |
|---|---|---|---|---|---|
| 4 | 9.0% | 24.5% | 37.0% | 19 | 35.87 |
| 8 | 15.0% | 31.5% | 47.5% | 12 | 26.28 |
| 20 | 15.5% | 36.0% | 48.0% | 11 | 20.45 |
| 40 | 13.5% | 38.0% | 56.0% | 9 | 17.76 |
| 80 | 13.5% | 41.0% | 59.0% | 8 | 17.11 |
| Subj. | R@1 | R@5 | R@10 | Med. | Subj. | R@1 | R@5 | R@10 | Med. |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 13.5 | 41.0 | 59.0 | 8 | 6 | 4.5 | 11.5 | 19.0 | 39 |
| 2 | 4.0 | 16.0 | 24.5 | 28 | 7 | 1.0 | 10.5 | 18.5 | 42 |
| 3 | 2.0 | 10.5 | 18.5 | 48 | 8 | 3.0 | 13.5 | 20.5 | 40 |
| 4 | 4.5 | 14.0 | 22.5 | 31 | 9 | 2.0 | 8.5 | 16.5 | 46 |
| 5 | 2.5 | 9.0 | 15.5 | 40 | 10 | 5.0 | 20.0 | 33.5 | 21 |