Git Product home page Git Product logo

longint1024 / complex-networks-release Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrsrl/complex-networks-release

0.0 0.0 0.0 8.17 MB

Implementation related to the paper "Complex-Valued Convolutional Neural Networks for MRI Reconstruction" by Elizabeth K. Cole et. al; Toolbox for complex-valued convolution and activation functions using an unrolled architecture.

Home Page: https://arxiv.org/abs/2004.01738

Python 98.44% Shell 1.56%

complex-networks-release's Introduction

Implementation related to the paper "Complex-Valued Convolutional Neural Networks for MRI Reconstruction" by Elizabeth K. Cole et. al: https://arxiv.org/abs/2004.01738

Complex-Valued MRI Reconstruction - Unrolled Architecture

Image Reconstruction using an Unrolled DL Architecture including Complex-Valued Convolution and Activation Functions

  • 2018 Elizabeth Cole, Stanford University ([email protected])
  • 2018 Joseph Y. Cheng, Stanford University
  • 2018 Feiyu Chen, Stanford University
  • 2018 Chris Sandino, Stanford University

Complex-Valued Utilities

If you are only interested in the complex-valued utilities, they are located in complex_utils.py. This includes complex-valued convolution, complex-valued transposed convolution, and the CReLU, modReLU, zReLU, and cardioid activation functions.

Setup

Make sure the python requirements are installed

pip3 install -r requirements.txt

The setup assumes that the latest Berkeley Advanced Reconstruction Toolbox is installed [1]. The scripts have all been tested with v0.4.01.

Data preparation

We will first download data, generate sampling masks, and generate TFRecords for training. The datasets downloaded are fully sampled volumetric knee scans from mridata [2]. The setup script uses the BART binary. In a new folder, run the follwing script:

python3 setup_mri.py -v

Training

The training can be ran using the following script in the same folder as the prepared data.

TYPE=complex
ITERATIONS=4
FEAT=256
ACTIVATION=cardioid
LOG_DIR="f"$FEAT"_g"$ITERATIONS
python3 train_loop.py \
    --train_dir $TYPE"_"$ACTIVATION \
    --mask_path masks \
    --dataset_dir data \
    --log_root $LOG_DIR \
    --shape_z 256 --shape_y 320 \
    --num_channels 8 \
    --batch_size 2 \
    --device 0 \
    --max_steps 50000 \
    --feat_map $FEAT \
    --num_grad_steps $ITERATIONS \
    --activation $ACTIVATION \
    --conv $TYPE

TYPE denotes the type of convolution; options include "real" or "complex".

ITERATIONS denotes the number of iterations in the unrolled architecture.

FEAT denotes the number of feature maps in each convolution layer.

ACTIVATION denotes the activation function used after each convolution layer; options include "relu", "crelu", "zrelu", "modrelu", and "cardioid" [3]. If running real convolution, the activation must be relu.

LOG_DIR indicates the directory checkpoints and training logs are saved to. You can view a tensorboard summary for this training run by running:

tensorboard --logdir=./

in this directory.

Various complex-valued utility functions are in complex_utils.py. This includes complex-valued convolution, complex-valued transposed convolution, and various complex-valeud activation functions such as CReLU, zReLU, modReLU, and cardioid.

Testing

Testing can be run using a similar script to training, found in test_script. One such example is:

TYPE=complex
ITERATIONS=4
FEAT=256
ACTIVATION=cardioid
LOG_DIR="f"$FEAT"_g"$ITERATIONS
python3 test_images.py \
    --train_dir $TYPE"_"$ACTIVATION \
    --mask_path masks \
    --dataset_dir data \
    --log_root $LOG_DIR \
    --shape_z 256 --shape_y 320 \
    --num_channels 8 \
    --batch_size 2 \
    --device 0 \
    --max_steps 50000 \
    --feat_map $FEAT \
    --num_grad_steps $ITERATIONS \
    --activation $ACTIVATION \
    --conv $TYPE

This script will run a deep learning reconstruction on a trained model with the specified parameters. It will also perform CS reconstructions using BART, and compute aggregate image metrics PSNR, SSIM, and NRMSE for each test image. Test images will be saved in a folder entitled "images" in the model directory.

References

  1. https://github.com/mrirecon/bart
  2. http://mridata.org
  3. https://arxiv.org/pdf/1705.09792.pdf

complex-networks-release's People

Contributors

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