DeepImageReconstruction

Data and demo codes for Shen, Horikawa, Majima, and Kamitani (2019) Deep image reconstruction from human brain activity. PLoS Comput. Biol. http://dx.doi.org/10.1371/journal.pcbi.1006633.

  • 所有者: KamitaniLab/DeepImageReconstruction
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Deep Image Reconstruction

Data and demo code for Shen, Horikawa, Majima, and Kamitani (2019) Deep image reconstruction from human brain activity. PLOS Computational Biology.
The preprint is availabe at bioRxiv (Shen et al., 2017, Deep image reconstruction from human brain activity).

Requirements

Usage

Preparation

  1. Download data files from figshare (see data/README.md).
  2. Download Caffe networks (see net/README.md).

DNN feature decoding from brain activity

You can skip the feature decoding from brain activity since we provide the decoded DNN features used in the original paper (see data/README.md).

We used the same methodology in our previous study for the DNN feature decoding (Horikawa & Kamitani, 2017, Generic decoding of seen and imagined objects using hierarchical visual features, Nat Commun.).
Python code for the DNN feature decoding is available at GitHub:KamitaniLab/dnn-feature-decoding.

Image reconstruction from decoded CNN features

We provide seven scripts that reproduce main figures in the original paper.

  • 1_reconstruct_natural_image.py
    • Reconstructing natural images from the CNN features decoded from the brain with deep generator network (DGN); reproducing results in Figure 2.
  • 2_reconstruct_natural_image_without_DGN.py
    • Reconstructing natural images from CNN features decoded from the brain without deep generator network (DGN); reproducing results in Figure 3A.
  • 3_reconstruct_natural_image_different_combinations_of_CNN_layers.py
    • Reconstructing natural images from CNN features decoded from the brain with different combinations of CNN layers; reproducing results in Figure 4.
  • 4_reconstruct_shape_image.py
    • Reconstructing colored artificial shapes from CNN features decoded from the brain; reproducing results in Figure 6A.
  • 5_reconstruct_shape_image_different_ROI.py
    • Reconstructing colored artificial shapes from CNN features decoded from multiple visual areas in the brain; reproducing results in Figure 7A.
  • 6_reconstruct_alphabet_image.py
    • Reconstructing alphabetical letters shapes from CNN features decoded from the brain; reproducing results in Figure 6B.
  • 7_reconstruct_imagined_image.py
    • Reconstructing imagined image from CNN features decoded from the brain; reproducing results in Figure 8.

Data

Notes

Enable back-propagation in the DNNs

In the demo code, we use pre-trained VGG19 and pre-trained deep generator network (DGN) (Dosovitskiy & Brox, 2016, Generating Images with Perceptual Similarity Metrics based on Deep Networks. arXiv.).
To enable make back-propagation, the following line should be added to the prototxt files (the file describes the configuration of the DNN):

force_backward: true

Get DNN features before ReLU

In our study, we defined DNN features of conv layers or fc layers as the output immediately after the convolutional or fully-connected computation (i.e., before applying the Rectified-Linear-Unit (ReLU)).
However, as default setting of the pre-trained DNNs, ReLU operation is an in-place computation, which will override the DNN features we need.
To In order to use the DNN features before the ReLU operation, you need to modify the prototxt file as below (taking the VGG19 prototxt file as an example).

Original:

layers {
  bottom: "conv1_1"
  top: "conv1_1"
  name: "relu1_1"
  type: RELU
}

Modified:

layers {
  bottom: "conv1_1"
  top: "relu1_1"
  name: "relu1_1"
  type: RELU
}

主要指標

概覽
名稱與所有者KamitaniLab/DeepImageReconstruction
主編程語言Python
編程語言Python (語言數: 2)
平台
許可證
所有者活动
創建於2017-12-26 02:37:06
推送於2023-07-03 09:57:13
最后一次提交2023-07-03 18:57:12
發布數1
最新版本名稱v1.0.0 (發布於 )
第一版名稱v1.0.0 (發布於 )
用户参与
星數278
關注者數26
派生數61
提交數52
已啟用問題?
問題數10
打開的問題數6
拉請求數2
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?