GithubHelp home page GithubHelp logo

omagdy / 3drdn-cyclegan Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 1.0 19.16 MB

Deep CNN for performing 3D super resolution on CT/MRI scans

License: GNU General Public License v3.0

Python 99.32% Shell 0.68%
super-resolution deep-learning mri gan cyclegan ct-scans wgan-gp densenet 3d image-to-image-translation

3drdn-cyclegan's Introduction

3DRDN-CGAN

Introduction

This repository contains the implementation of my master thesis "Deep Learning for 3D Super-Resolution" in which a 3D CNN integrated in a Cycle-GAN architecture is used to perform super resolution on 3D models from CT/MRI scans.

Data Format Requirements

The image scans have to be in the 'nii' format and be placed in the 'data' directory where the program will recursively search through all folders there to gather all the images available.

Training

Use the command line to begin training on the dataset and select the model architecture as well as the training parameters like in the following example.

python main.py --model CYCLE-WGANGP-3DRLDSRN --learning_rate 5e-5 --batch_size 2 --lambda_adv 0.02 --epochs 100

The trained model parameters will be saved in the tensor_checkpoints directory after the training is done.

The following command can be used to check all possible input arguements and hyperparameters.

python main.py -h 

Contact

If you have any questions, please file an issue or reach me via email:

Omar Hussein: [email protected]

If my work is useful for your research, please consider citing it:

@article{article,
author = {Hussein, Omar and Sauer, Tomas},
year = {2021},
month = {07},
title = {Deep Learning for 3D Super-Resolution},
doi = {10.13140/RG.2.2.23152.58884}
}

3drdn-cyclegan's People

Contributors

dependabot[bot] avatar omagdy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

siddhi-lipare

3drdn-cyclegan's Issues

Error in valid_batch = [next(valid_dataset)]

Error:
how to solve this problem,
#Initial Random Slice Image Generation
valid_batch = [next(valid_dataset)]

Traceback (most recent call last):
File "main.py", line 26, in
main()
File "main.py", line 22, in main
LAMBDA_CYC, LAMBDA_IDT, CRIT_ITER, TRAIN_ONLY, MODEL)
File "F:\mazhiqiang\3DRDN-CycleGAN-main\training.py", line 86, in main_loop
valid_batch = [next(valid_dataset)]
File "C:\Users\user\anaconda3\envs\tensorflow-gpu2.6.0\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 4692, in next
return nest.map_structure(to_numpy, next(self._iterator))
File "C:\Users\user\anaconda3\envs\tensorflow-gpu2.6.0\lib\site-packages\tensorflow\python\data\ops\iterator_ops.py", line 761, in next
return self._next_internal()
File "C:\Users\user\anaconda3\envs\tensorflow-gpu2.6.0\lib\site-packages\tensorflow\python\data\ops\iterator_ops.py", line 747, in _next_internal
output_shapes=self._flat_output_shapes)
File "C:\Users\user\anaconda3\envs\tensorflow-gpu2.6.0\lib\site-packages\tensorflow\python\ops\gen_dataset_ops.py", line 2727, in iterator_get_next
_ops.raise_from_not_ok_status(e, name)
File "C:\Users\user\anaconda3\envs\tensorflow-gpu2.6.0\lib\site-packages\tensorflow\python\framework\ops.py", line 6941, in raise_from_not_ok_status
six.raise_from(core._status_to_exception(e.code, message), None)
File "", line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: Need minval < maxval, got 50 >= 14
[[{{node StatefulPartitionedCall/StatefulPartitionedCall/random_uniform_2}}]] [Op:IteratorGetNext]

Inference

Could you pleaes help me with the inference problem, I have no idea of how to inference the model which I have trained well. I could not find the ckpt.meta file.

Thank you !

Can you provide pretrained weights?

My hardware is insufficient for training and I want to try inference before I consider using it for research.
Is it possible to share your model weights or provide a pretrained model?

if I just want to generate thin slice CTs,how can I do?

Just remove the SCALING_FACTOR for x and y, and keep the SCALING_FACTOR for z, Will it work if I just want to generate thin slice CTs?
lr_image = tf.image.resize(blurred_image, [x//SCALING_FACTOR, y//SCALING_FACTOR], method=interpolation_method).numpy()
lr_image = np.rot90(lr_image, axes=(1,2))
lr_image = tf.image.resize(lr_image, [x//SCALING_FACTOR, z//SCALING_FACTOR], method=interpolation_method).numpy()
ups_lr_image = tf.image.resize(lr_image, [x//SCALING_FACTOR, z], method=interpolation_method).numpy()
ups_lr_image = np.rot90(ups_lr_image, axes=(1,2))

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.