Giter VIP home page Giter VIP logo

eeg_encoding's Introduction

Building and evaluating encoding models of EEG visual responses using DNNs

Here we provide the code to reproduce the results of our data resource paper:
"A large and rich EEG dataset for modeling human visual object recognition".
Alessandro T. Gifford, Kshitij Dwivedi, Gemma Roig, Radoslaw M. Cichy

If you experience problems with the code, please create a pull request or report the bug directly to Ale via email ([email protected]).

Please visit the dataset page for the data, paper, dataset tutorial and more.

Here you will find some useful videos on our EEG dataset.

Environment setup

To run the code first install Anaconda, then create and activate a dedicated Conda environment by typing the following into your terminal:

curl -O https://raw.githubusercontent.com/gifale95/eeg_encoding_model/main/environment.yml
conda env create -f environment.yml
conda activate eeg_encoding

Alternatively, after installing Anaconda you can download the environment.yml file, open the terminal in the download directory and type:

conda env create -f environment.yml
conda activate eeg_encoding

Data availability

The source, raw and preprocessed EEG dataset, the training and test images and the DNN feature maps are available on OSF. The ILSVRC-2012 validation and test images can be found on ImageNet. To run the code, the data must be downloaded and placed into the following directories:

  • Source EEG data: ../project_directory/eeg_dataset/source_data/.
  • Raw EEG data: ../project_directory/eeg_dataset/raw_data/.
  • Preprocessed EEG data: ../project_directory/eeg_dataset/preprocessed_data/.
  • Training and test images; ILSVRC-2012 validation and test images: ../project_directory/image_set/.
  • DNN feature maps: ../project_directory/dnn_feature_maps/pca_feature_maps.

Code description

  • 00_data_collection: Matlab (Psychtoolbox) code used for data collection.
  • 01_data_preparation: convert the source EEG data into raw EEG data, reformat the resting state data, and extract behavioral results.
  • 02_eeg_preprocessing: preprocess the raw EEG data.
  • 03_dnn_feature_maps_extraction: extract the feature maps of all images using four DNN architectures (AlexNet, ResNet-50, CORnet-S, MoCo), and downsample them using principal component analysis (PCA).
  • 04_synthesizing_eeg_data: synthesize the EEG responses to images through linearizing and end-to-end encoding models.
  • 05_synthetic_data_analyses: perform the correlation, pairwise decoding and zero-shot identification analyses on the synthetic EEG data.
  • 06_plotting: plot the analyses results.

Interactive dataset tutorial

Here you will find a Colab interactive tutorial on how to load and visualize the preprocessed EEG data and the corresponding stimuli images.

Cite

If you use any of our data or code, partly or as it is, please cite our paper:

Gifford AT, Dwivedi K, Roig G, Cichy RM. 2022. A large and rich EEG dataset for modeling human visual object recognition. NeuroImage, 264:119754. DOI: https://doi.org/10.1016/j.neuroimage.2022.119754

eeg_encoding's People

Contributors

gifale95 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.