Git Product home page Git Product logo

pytorch_similarity's Introduction

PyTorch Similarity Measure

This is a PyTorch implementation of similarity measure for 1D, 2D and 3D inputs, including:

  • Normalized cross correlation
  • Gradient correlation
  • Gradient difference

For example, the gradient correlation was used in MR-to-CT synthesis using CycleGAN.

@inproceedings{hiasa2018cross,
  title={Cross-modality image synthesis from unpaired data using CycleGAN},
  author={Hiasa, Yuta and Otake, Yoshito and Takao, Masaki and Matsuoka, Takumi and Takashima, Kazuma and Carass, Aaron and Prince, Jerry L and Sugano, Nobuhiko and Sato, Yoshinobu},
  booktitle={International Workshop on Simulation and Synthesis in Medical Imaging},
  pages={31--41},
  year={2018},
  organization={Springer}
}

Let's consider following toy problem, a situation where circles are clear in domain A while unclear in domain B. On the other hand, the square is unclear in the domain A and clear in the domain B.

Note that each domain has the variations in the number, position and size of objects.

In this case, the loss function value of CycleGAN may converge even if it learns either intensity or shape transformation. That is, it is not guaranteed that CycleGAN retains the original input shape.

Gradient correlation is one of the solutions for maintaining the original shape within unsupervised manner.

Gradient correlation

The gradient correlation (GC) [Penney et al.] has been used as a similarity measure in the medical image registration, which is defined by the normalized cross correlation of the image gradient between two images.

These figures show the correlation map for two examples. In the above aligned example, there is high correlation around the face contour (Blue color).

Installation

  • Install from this repository
git clone https://github.com/yuta-hi/pytorch_similarity
cd pytorch_similarity
python setup.py install

pytorch_similarity's People

Contributors

yuta-hi avatar

Watchers

 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.