Coder Social home page Coder Social logo

uw-loci / demo_wsi_superres Goto Github PK

View Code? Open in Web Editor NEW
20.0 5.0 5.0 9.84 MB

WSISR: Single image super-resolution for Whole slide Imaging using convolutional neural networks and self-supervised color normalization.

License: MIT License

Python 100.00%
whole-slide-imaging histopathology super-resolution whole-slide-image convolutional-neural-networks generative-adversarial-network deep-learning self-supervised-learning curriculum-learning single-image-super-resolution

demo_wsi_superres's Introduction

WSISR: Single image super-resolution for whole slide image using convolutional neural networks and self-supervised color normalization

This is the PyTorch implementation of using generative adversarial neural networks for single-image super-resolution in whole slide imaging. Paper. Medical Image Analysis.

Installation

Install anaconda/miniconda
Required packages

  $ conda env create --name wsisr --file env.yml
  $ conda activate wsisr

Install PyTorch-FID

Details regarding PyTorch-FID.
MacOS/Linux:

  $ pip install pytorch-fid

Windows:

  $ pip install git+https://github.com/mseitzer/pytorch-fid.git

Download TMA dataset and Fiji-ImageJ

  $ python download.py

Training

You will need GPU/CUDA support to run the training.

Training on upscaling compressed low-resolution image.

  $ python train_compress.py

Training on registered low-NA/high-NA image pairs.

  $ python train_paired.py

Arguments

[--batch-size]        # Size of the mini-batch                  default: (int) 32
[--patch-size]        # Size of extracted patch                 default: (int) 224
[--up-scale]          # Targeted upscale factor                 default: (float) 5
[--num-epochs]        # Number of training epochs               default: (int) 900
[--g-lr]              # Learning rate of generator              default: (float) 0.0001
[--d-lr]              # Learning rate of descriminator          default: (float) 0.00001
[--percep-weight]     # GAN loss weight                         default: (float) 0.001
[--run-from]          # Load weights from a previous run        default: None
[--start-epoch]       # Starting epoch for the curriculum       default: (int) 1
[--gan]               # Enable GAN training 1: on, 0: off       default: (int) 1
[--num-critic]        # Interval of descriminator training      default: (int) 1
[--test-interval]     # Epoch interval for FID score testing    default: (int) 50
[--print-interval]    # Epoch interval for output printing      default: (int) 10
[--dataset]           # Dataset folder name      		default: (str) TMA
[--in-folder]         # Low NA image folder name     		default: (str) low
[--out-folder]        # High NA image folder name      		default: (str) high
[--extension]         # Training image extension      		default: (str) jpg

Please check python argument help for more details.

Output

  1. Output images: the final output testing images will be stitched ('output/lr/', 'output/hr/', 'output/sr/') when the training completes. During the training, validation patches are printed in 'output/print/'.
  2. Model weights are saved in 'weights/'. Each run will create a separate folder. Use the folder name as the argument '--run-from' will load the corresponding weights.
  3. 1/2 of the epochs are used for curriculum learning where the mean of the upscale factor increases. Starting the epoch at 1/2 of the total epoch can skip the curriculum.
  4. Patches are randomly extracted from the TMA. GAN-based training can take very long time to converge.

Citation

Please use the following BibTeX entry.

@article{LI2021101938,
title = {Single image super-resolution for whole slide image using convolutional neural networks and self-supervised color normalization},
journal = {Medical Image Analysis},
volume = {68},
pages = {101938},
year = {2021},
issn = {1361-8415},
doi = {https://doi.org/10.1016/j.media.2020.101938},
author = {Bin Li and Adib Keikhosravi and Agnes G. Loeffler and Kevin W. Eliceiri}
}

demo_wsi_superres's People

Contributors

binli123 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

demo_wsi_superres's Issues

Low-cost scanner image of TMA

I downloaded the TMA dataset, but it contains only high-resolution (HR) images. Could the authors provide lower-cost scanned counterparts? 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.