--- pretty_name: "MindEye: fMRI-to-Image Reconstruction Dataset" license: mit tags: - neuroscience - fMRI - brain-decoding - image-reconstruction - contrastive-learning - diffusion-models - CLIP - natural-scenes task_categories: - image-to-image - feature-extraction size_categories: - 10K90% accuracy** across multiple reconstruction metrics and **>93% top-1 retrieval accuracy**, marking a major breakthrough in neural decoding - πŸ”— Maps **fMRI brain activity to CLIP image embeddings** through **specialized contrastive learning frameworks** and **diffusion-based generative models** - 🎨 Combines **high-level semantic information** with **low-level perceptual features**, enabling **fine-grained decoding** that can distinguish between **highly similar images** (e.g., different zebras) - 🌍 Demonstrates scalability to **billion-image retrieval tasks** using **LAION-5B**, extending its impact to internet-scale benchmarks ![Example: Original stimulus (left) and MindEye reconstruction (right)](example_subject_01.png) **Figure:** Paired side-by-side example β€” **Left:** MS-COCO stimulus shown during scanning; **Right:** MindEye reconstruction (Subject 01) derived from `fmri_voxels` + `clip_embeddings`. --- ## πŸ“‘ Table of Contents - [Quickstart](#quickstart) - [Dataset Configurations](#dataset-configurations) - [nsd-brain-trials (Default)](#nsd-brain-trials-default) - [hcp-brain-trials](#hcp-brain-trials) - [clip-image-embeddings](#clip-image-embeddings) - [hcp-session-metadata](#hcp-session-metadata) - [Other Configurations](#other-configurations) - [Provenance & Processing](#provenance--processing) - [Intended Uses & Limitations](#intended-uses--limitations) - [Recommended Uses](#recommended-uses) - [Out-of-Scope Uses](#out-of-scope-uses) - [Known Limitations](#known-limitations) - [Bias & Fairness Considerations](#bias--fairness-considerations) - [Results](#results) - [Dataset Scale](#dataset-scale) - [Citation](#citation) - [License](#license) --- # πŸš€ Quickstart ```python from datasets import load_dataset # 1. Load the default NSD brain trials (streaming recommended for large configs) nsd_ds = load_dataset("medarc/fmri-fm", name="nsd-brain-trials", streaming=True, split="train") example = next(iter(nsd_ds)) print(f"Subject: {example['subject_id']}, Session: {example['session']}, NSD Image ID: {example['nsd_image_id']}") print(f"fMRI Data (first 5 values of first frame): {example['fmri_data'][0][:5]}") # 2. Load the supplementary HCP brain trials (streaming) hcp_ds = load_dataset("medarc/fmri-fm", name="hcp-brain-trials", streaming=True, split="train") hcp_example = next(iter(hcp_ds)) print(f"HCP Subject: {hcp_example['subject_id']}, Task: {hcp_example['task']}") # 3. Load CLIP image embeddings for all NSD stimuli (dense table, non-streaming) clip_ds = load_dataset("medarc/fmri-fm", name="clip-image-embeddings", split="train") print(f"Total embeddings: {len(clip_ds)}") print(f"Embedding vector length (first image): {len(clip_ds[0]['image_embeddings'])}") # 4. Load HCP session metadata metadata_ds = load_dataset("medarc/fmri-fm", name="hcp-session-metadata", split="train") meta_example = next(iter(metadata_ds)) print(f"Example Session Key: {meta_example['session_key']}") print(f"Number of voxels in session: {meta_example['n_voxels']}") ``` --- # πŸ“¦ Dataset Configurations --- ## πŸ”Ή nsd-brain-trials (Default) Contains the primary fMRI signals from the Natural Scenes Dataset, used as the main inputs for the MindEye model. | **Field Name** | **Type** | **Description** | |------------------|---------------------------|---------------------------------------------------------------------------------| | `subject_id` | `string` | Subject identifier (e.g., "subj01") | | `session` | `int32` | Scanning session number (1-40) | | `run` | `int32` | fMRI run number within session | | `fmri_data` | `sequence[sequence[float16]]` | Brain activity tensor | | `nsd_image_id` | `int32` | NSD image identifier (links to COCO dataset) | --- ## πŸ”Ή hcp-brain-trials Contains supplementary fMRI data from the Human Connectome Project (HCP) for various cognitive tasks. | **Field Name** | **Type** | **Description** | |------------------|---------------------------|---------------------------------------------------------------------------------| | `subject_id` | `string` | HCP subject identifier (6-digit code) | | `modality` | `string` | Imaging modality (`"tfMRI"` or `"rfMRI"`) | | `task` | `string` | HCP task name (RELATIONAL, SOCIAL, WM, etc.) | | `fmri_data` | `sequence[sequence[float16]]` | Brain activity tensor | | `trial_type` | `string` | Specific trial condition (relation, mental, etc.) | --- ## πŸ”Ή clip-image-embeddings Contains the target CLIP (ViT-L/14) image embeddings for the 73,000 NSD stimulus images. | **Field Name** | **Type** | **Description** | |-----------------------|---------------------------|---------------------------------------------------------------------------------| | `image_embeddings` | `sequence[sequence[float32]]` | CLIP ViT-L/14 embeddings for NSD images | --- ## πŸ”Ή hcp-session-metadata Detailed metadata for each fMRI session in the HCP dataset. | **Field Name** | **Type** | **Description** | |------------------|------------|-----------------------------------------------------| | `session_key` | `string` | Unique session identifier | | `subject_id` | `string` | HCP subject identifier | | `task` | `string` | HCP task name | | `n_voxels` | `int32` | Total voxels in session (77,763) | --- ## πŸ”Ή Other Configurations - **hcp-session-archives:** Raw .tar archives of preprocessed fMRI data from the HCP dataset. - **semantic-clusters:** Semantic cluster assignments for the 73k COCO/NSD images. - **brain-parcellations:** Brain atlas files (Schaefer 2018, Yeo 2011) used for feature engineering. - **hcp-task-mapping:** JSON file mapping HCP task conditions to numerical target IDs. --- # πŸ”¬ Provenance & Processing This dataset is constructed from two major sources: - **Natural Scenes Dataset (NSD)** - **Human Connectome Project (HCP)** The primary neuroimaging data was collected using a **7-Tesla (7T) fMRI scanner**. All fMRI data underwent rigorous preprocessing including: - **GLMsingle**: General Linear Model single-trial estimation - **Z-scoring**: Session-wise normalization of signals - **Brain parcellation**: Feature vectors constructed via atlases such as the **Schaefer 2018 (400 Parcels)** and **Yeo 2011 (7 Networks)**β€”reducing volumetric brain data into region-wise summaries suitable for machine learning tasks. --- # βœ… Intended Uses & Limitations ### Recommended Uses - **Neuroscience Research**: Understanding visual cortex representations, brain-computer interfaces, and neural mechanisms of visual perception - **Computer Vision**: Developing novel multimodal learning approaches between brain signals and visual data, contrastive learning research - **AI Model Development**: Training and benchmarking brain decoding models, diffusion-based reconstruction systems - **Medical Applications**: Research into locked-in syndrome communication, depression assessment through visual bias analysis, neurological disorder diagnosis --- ### Out-of-Scope Uses - ⚠️ **Clinical Diagnosis**: Not validated for medical diagnosis without extensive additional clinical validation and regulatory approval - ⚠️ **Cross-subject Generalization**: Models are subject-specific and do not generalize across individuals without additional training data - ⚠️ **Non-consensual Applications**: Requires active participant compliance; easily defeated by head movement, unrelated thinking, or non-compliance --- ### Known Limitations - **Subject Specificity**: Each participant requires individual model training with extensive fMRI data (up to 40 hours scanning) - **Compliance Requirement**: Non-invasive neuroimaging requires participant cooperation and cannot be used covertly - **Single-trial Degradation**: Performance significantly degrades when using single-trial vs. averaged responses --- # βš–οΈ Bias & Fairness Considerations - **Sampling Biases**: Limited to 4 participants, all capable of undergoing extensive MRI scanning. Geographic and cultural representation not specified. - **Image Distribution**: Images limited to MS-COCO natural scenes, which may not represent diverse visual experiences across cultures, environments, or individual visual preferences. - **Technical Access**: Requires expensive 7-Tesla MRI equipment and substantial computational resources, limiting accessibility and reproducibility across research groups. # πŸ“Š Results ![Representative reconstruction and retrieval results.](results.png) | **Category** | **Best Prior SOTA** | **MindEye** | |-------------------------|---------------------|-------------| | Pixel Correlation | 0.254 (Ozcelik) | **0.309** | | SSIM | 0.356 (Ozcelik) | **0.323** | | Image Retrieval (top-1)| 94.2% (Ozcelik) | **97.8%** | | Brain Retrieval (top-1)| 30.3% (Ozcelik) | **90.1%** | | CLIP Identification | 91.5% (Ozcelik) | **94.1%** | | Parameter Efficiency | 1.45B (Ozcelik LL) | **206M** | # πŸ“ Dataset Scale: - **Training samples**: 24,980 across 4 subjects (individual trials preserved) - **Test samples**: 982 (averaged across 3 repetitions per image) - **Voxels per subject**: 13,000-16,000 from nsdgeneral brain region # πŸ“– Citation Please cite: ``` @article{scotti2023reconstructing, title={Reconstructing the Mind's Eye: fMRI-to-Image with Contrastive Learning and Diffusion Priors}, author={Paul S. Scotti and Atmadeep Banerjee and Jimmie Goode and Stepan Shabalin and Alex Nguyen and Ethan Cohen and Aidan J. Dempster and Nathalie Verlinde and Elad Yundler and David Weisberg and Kenneth A. Norman and Tanishq Mathew Abraham}, journal={arXiv preprint arXiv:2305.18274}, year={2023}, url={[https://arxiv.org/abs/2305.18274v2}](https://arxiv.org/abs/2305.18274v2%7D) } ``` # πŸ“œ License ``` MIT License Copyright (c) 2022 MEDARC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ```