Coder Social home page Coder Social logo

oftarradiddle / illusionreconstruction Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kamitanilab/illusionreconstruction

0.0 0.0 0.0 4.12 MB

A reconstruction framework for materializing subjective experiences from brain signals

Shell 1.32% Python 98.68%

illusionreconstruction's Introduction

Contributors Forks Stargazers Issues


Reconstructing visual illusory experiences from human brain activity

Fan Cheng, Tomoyasu Horikawa, Kei Majima, Misato Tanaka, Mohamed Abdelhack, Shuntaro C. Aoki, Jin Hirano, Yukiyasu Kamitani
Paper · CCN2022 · bioRxiv

Our paper has been published in Science Advances !

Getting Started

Installation

Clone the repo:

git clone https://github.com/KamitaniLab/IllusionReconstruction.git

Build Environment

Step1: Navigate to the base directory and create the environment by running the following command.

conda env create -f env.yaml

Step2: Activate the environment.

conda activate brain_decoding-to-generator

Download Dataset

To utilize this project, you'll need to download the required dataset Figshare and organize the dataset appropriately. You can download the required data with the following commands.

fMRI data and image feature:

# In "data" directory:

# Training and test fMRI data
$ python download.py fmri_training
$ python download.py fmri_test

# Stimulus image features
$ python download.py stimulus_feature

Pre-trained generator:

# In "generator" directory:

# GAN
$ python download.py GAN

Dataset links

  • fMRI data (unpreprocessed, BIDS): OpenNeuro doi:10.18112/openneuro.ds004670.v1.0.1
  • Preprocessed fMRI data, timulus image features, and pretrained image generators: figshare doi:10.6084/m9.figshare.23590302

Usage

(1) To quickly test the reconstruction code, run:

./feature_decoding-to-generator_quick_test.sh

(2) To replicate main results of the paper, run:

Reconstruct from single-trial fMRI samples using GAN generator

./feature_decoding-to-generator.sh

Evaluate single-trial reconstructions from individual brain regions

./evaluation_line_color.sh

(3) In addition, to test results using diffusion generator, run:

./feature_decoding-to-generator_diffusion.sh

Example output figure

Example 1 (GAN): You can find the following figure in results/plots/quick_test. From left to right columns: stimulus (1), reconstruction from stimulus features (2), reconstruction from brain-decoded features (3-9 correspond to Subject 1-7; using fMRI sample averaged across trials)

Example 2 (diffusion): You can find the following figure in results/plots/. Each row shows the reconstructions from the same fMRI sample (a single trial of the stimulus) with different random seeds.

Citation

Cheng, F. L., Horikawa, T., Majima, K., Tanaka, M., Abdelhack, M., Aoki, S. C., Hirano, J., & Kamitani, Y. (2023) Reconstructing visual illusory experiences from human brain activity. Sci. Adv. 9, eadj3906. DOI: 10.1126/sciadv.adj3906

Contact

Fan Cheng - @LibraCheng - [email protected]

(back to top)

illusionreconstruction's People

Contributors

chengfanbrain avatar shuntaroaoki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.