Code Monkey home page Code Monkey logo

ct-super-resolution-mdrbgan's Introduction

CT super-resolution using multiple dense resudual blocks based GAN

This repository contains the PyTorch implementation of CT super-resolution using multiple dense residual block based GAN presented in [Zhang et al., 2020], with slight changes as recommended in [Gulrajani et al., 2017] and with architecture parameters adapted from [Ledig et al., 2017], in case they were not specified.

For the complete description of the implementation methods and experiments please refer to CT_super-resolution.


Dataset

The data used represent a subset of MosMed Covid-19 dataset. It consist in multiple chest CT scans of healthy and infected patients in .nii.gz 3D-format, with different number of scan slices and slices thickness.
The 3-dimensional CTs are splitted in slices and each slice is saved in .npy 2D-format.

Data path structure

The data directory should have the following structure:

.
├── Data
    ├── Test
    │   ├── *.npy
    ├── Train
    │   ├── *.npy
    ├── Validation
    │   ├── *.npy

Usage

1. Train

run python main.py

This will automatically start a Tensorboard session, with the following parameters:

--tb_port (specify the port number to be used by Tensorboard) 
--tb_logdir = 'runs' (directory to write logs to Tensorboard)  
--tb_plot_interval = 10 (interval for creating and writing generated CT images | the losses and PSNR scores are logged every <--log_interval> epochs)

Control the training by modifying the default values for the following parameters:

--device = cuda (train on cuda)  
--log_interval = 1 (print train & validation loss each epoch)
--checkpoint_interval = 100 (save trained model and optimizer parameters every 100 epochs)
--num_epochs = 500

2. Resume training

run python main.py --resume_training=true --restore_epoch=*

Resume training by specifying a valid value for --restore_epoch.

The model saved as Models/checkpoint_<restore_epoch>.pt will be loaded

3. Test

run python main.py --mode=test --restore_epoch=* --test_ct_names=*

Test the model saved at training epoch --restore_epoch on CT images specified.

--test_ct_names accepts a list of the CT images without the .npy extension.

for example, the CT image located at Data/Test/ct_sample1.npy will be passed as ct_sample1.

The model saved as Models/checkpoint_<restore_epoch>.pt will be loaded.


To Do

Add pre-processing code for CT scans *.nii.gz --> *.npy


Tools

PyTorch, Tensorboard

ct-super-resolution-mdrbgan's People

Contributors

gloria-m avatar niudunkule avatar dependabot[bot] 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.