Deep Multi-Magnification Network for multi-class tissue segmentation of whole slide images

Related tags

Deep LearningDMMN
Overview

Deep Multi-Magnification Network

This repository provides training and inference codes for Deep Multi-Magnification Network published here. Deep Multi-Magnification Network automatically segments multiple tissue subtypes by a set of patches from multiple magnifications in histopathology whole slide images.

Prerequisites

  • Python 3.6.7
  • Pytorch 1.3.1
  • OpenSlide 1.1.1
  • Albumentations

Training

The main training code is training.py. The trained segmentation model will be saved under runs/ by default.

In addition to config, you may need to update the following variables before running training.py:

  • n_classes: the number of tissue subtype classes + 1
  • train_file and val_file: the list of training and validation patches
    • Slide patches must be stored as /path/slide_tiles/patch_1.jpg, /path/slide_tiles/patch_2.jpg, ... /path/slide_tiles/patch_N.jpg
    • The coresponding label patches must be stored as /path/label_tiles/patch_1.png, /path/label_tiles/patch_2.png, ... /path/label_tiles/patch_N.png
    • train_file and val_file must be formatted as
     /path/,patch_1
     /path/,patch_2
     ...
     /path/,patch_N
    
  • d: the number of pixels of each class in the training set for weighted cross entropy loss function

Note that pixels labeled as class 0 are unannotated and will not contribute to the training.

Inference

The main inference codes are slidereader_coords.py and inference.py. You first need to run slidereader_coords.py to generate patch coordinates to be segmented in input whole slide images. After generating patch coordinates, you may run inference.py to generate segmentation predictions of input whole slide images. The segmentation predictions will be saved under imgs/ by default.

You may need to update the following variables before running slidereader_coords.py:

  • slides_to_read: the list of whole slide images
  • coord_file: an output file listing all patch coordinates

In adition to model_path and out_path, you may need to update the following variables before running inference.py:

  • n_classes: the number of tissue subtype classes + 1
  • test file: the list of patch coordinates generated by slidereader_coords.py
  • data_path: the path where whole slide images are located

Please download the pretrained breast model here.

Note that segmentation predictions will be generated in 4-bit BMP format. The size limit for 4-bit BMP files is 232 pixels.

License

This project is under the CC-BY-NC 4.0 license. See LICENSE for details. (c) MSK

Acknowledgments

Reference

If you find our work useful, please cite our paper:

@article{ho2021,
  title={Deep Multi-Magnification Networks for multi-class breast cancer image segmentation},
  author={Ho, David Joon and Yarlagadda, Dig V.K. and D'Alfonso, Timothy M. and Hanna, Matthew G. and Grabenstetter, Anne and Ntiamoah, Peter and Brogi, Edi and Tan, Lee K. and Fuchs, Thomas J.},
  journal={Computerized Medical Imaging and Graphics},
  year={2021},
  volume={88},
  pages={101866}
}
Owner
Computational Pathology
Computational Pathology
[NAACL & ACL 2021] SapBERT: Self-alignment pretraining for BERT.

SapBERT: Self-alignment pretraining for BERT This repo holds code for the SapBERT model presented in our NAACL 2021 paper: Self-Alignment Pretraining

Cambridge Language Technology Lab 104 Dec 07, 2022
Breaking Shortcut: Exploring Fully Convolutional Cycle-Consistency for Video Correspondence Learning

Breaking Shortcut: Exploring Fully Convolutional Cycle-Consistency for Video Correspondence Learning Yansong Tang *, Zhenyu Jiang *, Zhenda Xie *, Yue

Zhenyu Jiang 12 Nov 16, 2022
My usage of Real-ESRGAN to upscale anime, some test and results in the test_img folder

anime upscaler My usage of Real-ESRGAN to upscale anime, I hope to use this on a proper GPU cuz doing this on CPU is completely shit 😂 , I even tried

Shangar Muhunthan 29 Jan 07, 2023
Udacity's CS101: Intro to Computer Science - Building a Search Engine

Udacity's CS101: Intro to Computer Science - Building a Search Engine All soluti

Phillip 0 Feb 26, 2022
LLVM-based compiler for LightGBM gradient-boosted trees. Speeds up prediction by ≥10x.

LLVM-based compiler for LightGBM gradient-boosted trees. Speeds up prediction by ≥10x.

Simon Boehm 183 Jan 02, 2023
Auto-Encoding Score Distribution Regression for Action Quality Assessment

DAE-AQA It is an open source program reference to paper Auto-Encoding Score Distribution Regression for Action Quality Assessment. 1.Introduction DAE

13 Nov 16, 2022
Deep Learning and Reinforcement Learning Library for Scientists and Engineers 🔥

TensorLayer is a novel TensorFlow-based deep learning and reinforcement learning library designed for researchers and engineers. It provides an extens

TensorLayer Community 7.1k Dec 27, 2022
Causal Imitative Model for Autonomous Driving

Causal Imitative Model for Autonomous Driving Mohammad Reza Samsami, Mohammadhossein Bahari, Saber Salehkaleybar, Alexandre Alahi. arXiv 2021. [Projec

VITA lab at EPFL 8 Oct 04, 2022
Akshat Surolia 2 May 11, 2022
This is the official repository of Music Playlist Title Generation: A Machine-Translation Approach.

PlyTitle_Generation This is the official repository of Music Playlist Title Generation: A Machine-Translation Approach. The paper has been accepted by

SeungHeonDoh 6 Jan 03, 2022
[CVPR 2021] Monocular depth estimation using wavelets for efficiency

Single Image Depth Prediction with Wavelet Decomposition Michaël Ramamonjisoa, Michael Firman, Jamie Watson, Vincent Lepetit and Daniyar Turmukhambeto

Niantic Labs 205 Jan 02, 2023
Hcpy - Interface with Home Connect appliances in Python

Interface with Home Connect appliances in Python This is a very, very beta inter

Trammell Hudson 116 Dec 27, 2022
The code for the NeurIPS 2021 paper "A Unified View of cGANs with and without Classifiers".

Energy-based Conditional Generative Adversarial Network (ECGAN) This is the code for the NeurIPS 2021 paper "A Unified View of cGANs with and without

sianchen 22 May 28, 2022
This git repo contains the implementation of my ML project on Heart Disease Prediction

Introduction This git repo contains the implementation of my ML project on Heart Disease Prediction. This is a real-world machine learning model/proje

Aryan Dutta 1 Feb 02, 2022
Rule-based Customer Segmentation

Rule-based Customer Segmentation Business Problem A game company wants to create level-based new customer definitions (personas) by using some feature

Cem Çaluk 2 Jan 03, 2022
classification task on dataset-CIFAR10,by using Tensorflow/keras

CIFAR10-Tensorflow classification task on dataset-CIFAR10,by using Tensorflow/keras 在这一个库中,我使用Tensorflow与keras框架搭建了几个卷积神经网络模型,针对CIFAR10数据集进行了训练与测试。分别使

3 Oct 17, 2021
[TPAMI 2021] iOD: Incremental Object Detection via Meta-Learning

Incremental Object Detection via Meta-Learning To appear in an upcoming issue of the IEEE Transactions on Pattern Analysis and Machine Intelligence (T

Joseph K J 66 Jan 04, 2023
AdelaiDet is an open source toolbox for multiple instance-level detection and recognition tasks.

AdelaiDet is an open source toolbox for multiple instance-level detection and recognition tasks.

Adelaide Intelligent Machines (AIM) Group 3k Jan 02, 2023
Official PyTorch code for "BAM: Bottleneck Attention Module (BMVC2018)" and "CBAM: Convolutional Block Attention Module (ECCV2018)"

BAM and CBAM Official PyTorch code for "BAM: Bottleneck Attention Module (BMVC2018)" and "CBAM: Convolutional Block Attention Module (ECCV2018)" Updat

Jongchan Park 1.7k Jan 01, 2023
Parametric Contrastive Learning (ICCV2021)

Parametric-Contrastive-Learning This repository contains the implementation code for ICCV2021 paper: Parametric Contrastive Learning (https://arxiv.or

DV Lab 156 Dec 21, 2022