Giter VIP home page Giter VIP logo

moabarar / nemar Goto Github PK

View Code? Open in Web Editor NEW
165.0 3.0 25.0 164.47 MB

[CVPR2020] Unsupervised Multi-Modal Image Registration via Geometry Preserving Image-to-Image Translation

License: Other

Python 97.16% Shell 1.51% MATLAB 1.33%
multimodal registartion stn image-to-image-translation multi-modal multi-modal-learning affine-transformation deformable-transformation deep-learning cnn pytorch image-registration cvpr2020 multimodal-image-registration

nemar's Introduction

NeMAR - Neural Multimodal Adversarial Registration

This is the official implementation of:
Unsupervised Multi-Modal Image Registration via Geometry Preserving Image-to-Image Translation.

missing
Registration output during 50 training epochs

Getting started

This repository is based on the implementation of Pix2pix. We recommened getting yourself familiar with the former framework. Here we provide a basic guidline on how to use our code.


(Step 1) Preparing your data

You need to implement your own dataset. The dataset should implement the template proivded by in base_dataset.py. Invoking 'getitem' of your dataset should return the following template dictionay:

{'A': tensor_image_modality_a,
 'B': tensor_image_modality_b}

Where tensor_image_modality_[a/b] is the tensor of the image from modality A and modality B respectively.
The name convention use is [whatever-name-you-want]_dataset.py - this is important in order to be able to define your dataset using strings.


(Step 2) Train NeMAR model

Here we provide a list of flags that could be used during the training of our model. The flags are categorized into STN related flags and general training flags

  • --stn_type: train an affine based registration ('affine') or a deformation field based registration network ('unet').
  • --stn_cfg: you can define the network architecture via a configuration string (default is 'A'). See example configuration in unet_stn.py and in affine_stn.py.
  • --stn_no_identity_init: set if you WANT to start with a random transformation.
  • --stn_bilateral_alpha: the alpha value used in the bilateral filtering term (see paper).

Training related flags (beside the base flags used by Pix2Pix/CycleGAN):

  • --multi_res: you can train NeMAR with multi-resoultion discriminators (similar to pix2pixHD). We believe this could be use-full when working with high-resolution images.
  • --lambda_smooth: the lambda used for the regularization term of the stn.
  • --lambda_recon: the lambda used for the reconstruction loss.
  • --lambda_GAN: the lambda used for the GAN loss

Enabling Tensorboard

We provide an option to write training stats using tensorboard. To enable tensorboard visualizer, you need to set the flag --enable_tbvis. This will create a tensboard log-file in the directory "<checkpoints_dir>/<exp_name>/<exp_name>_tensorboard_logs". The tensorboard visualizer class reports (1) mean transformation offsets in x,y direction, (2) network weights, (3) losses. These values are written to tensorboard logfile each epoch. The following flags can be used when tbvis is enabled

  • --tbvis_iteration_update_rate if you want to write in iteration resolution set --tbvis_iteration_update_rate to positive number.
  • --tbvis_disable_report_offsets: set if you don't want to save the mean transformation offsets.
  • --tbvis_disable_report_weights: set if you don't want to save the network weights.

Citation

If you use this repository - please cite:

@InProceedings{Arar_2020_CVPR,
author = {Arar, Moab and Ginger, Yiftach and Danon, Dov and Bermano, Amit H. and Cohen-Or, Daniel},
title = {Unsupervised Multi-Modal Image Registration via Geometry Preserving Image-to-Image Translation},
booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2020}
}

Since this repository is based on Pix2Pix & CycleGan framework - make sure you cite these two awesome papers:

@inproceedings{CycleGAN2017,
 title={Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networkss},
 author={Zhu, Jun-Yan and Park, Taesung and Isola, Phillip and Efros, Alexei A},
 booktitle={Computer Vision (ICCV), 2017 IEEE International Conference on},
 year={2017}
 }


@inproceedings{isola2017image,
 title={Image-to-Image Translation with Conditional Adversarial Networks},
 author={Isola, Phillip and Zhu, Jun-Yan and Zhou, Tinghui and Efros, Alexei A},
 booktitle={Computer Vision and Pattern Recognition (CVPR), 2017 IEEE Conference on},
 year={2017}
}

nemar's People

Contributors

moabarar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar

nemar's Issues

pretrained model

Hi,

Would you mind releasing your self-trained model,please?

test.py is missing?

Really interesting work! I would love to try it out...
But it seems test.py is missing? (as pointed out also in #2)

can not find unet_stn.py

Hi,
I want to try a deformation field based registration network,but I did not find unet_stn.py,can you release it?

extremely grateful !

test code

hi,is there no registration test code here?

Question re quality of generated images

Thanks for your paper and offering this code. I'm building on your code and modifying it for a different domain that has lower frequency textures than the plant images you used. I was wondering, how did the quality of your generated visible and/or thermal images turn out? I don't recall (and sorry if you reported it and I didn't see it), in your paper, if you reported FID scores or other metrics about the quality of the generated images. Thanks!

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.