Giter Site home page Giter Site logo

yangsenwxy / zoommil Goto Github PK

View Code? Open in Web Editor NEW

This project forked from histocartography/zoommil

0.0 0.0 0.0 630 KB

ZoomMIL is a multiple instance learning (MIL) method that learns to perform multi-level zooming for efficient Whole-Slide Image (WSI) classification.

License: MIT License

Python 100.00%

zoommil's Introduction

ZoomMIL

ZoomMIL is a multiple instance learning (MIL) method that learns to perform multi-level zooming for efficient Whole-Slide Image (WSI) classification. This repository contains the PyTorch code to reproduce the results of our corresponding paper Differentiable Zooming for Multiple Instance Learning on Whole-Slide Images.

Overview

Installation

histocartography

This code relies on functionality from the histocartography library. To install it, simply clone the github repository and add the path to your PYTHONPATH:

git clone https://github.com/histocartography/histocartography.git
export PYTHONPATH="<PATH>/histocartography:$PYTHONPATH"

conda environment

Create a conda environment and install the required packages from the provided environment.yml:

git clone https://github.com/histocartography/zoommil.git && cd zoommil
conda env create -f environment.yml
conda activate zoommil

Install pytorch:

conda install -n zoommil pytorch==1.10.1 torchvision==0.11.2 cudatoolkit=11.1 -c pytorch -c conda-forge

Preprocessing also requires the OpenSlide library. On Linux, you can install it with

conda install -n zoommil -c conda-forge conda-forge/linux-64::openslide-python

Please check the documentation for more information.

Getting started

After cloning the repository and creating the conda environment, you can follow the steps below to get started.

Datasets

We evaluated ZoomMIL on three publicly available datasets:

The train/val/test splits for all datasets can be found here.

Preprocessing

Whole-slide images (e.g., from the BRIGHT dataset) can be preprocessed (tissue masking + patch feature extraction) as .h5 files:

python bin/preprocess.py --out_path <PATH_TO_PREPROCESSED_DATA> --in_path <PATH_TO_DOWNLOADED_DATA> --mode features --dataset BRIGHT

To only extract patches (without features), select the mode patches:

python bin/preprocess.py --out_path <PATH_TO_PREPROCESSED_DATA> --in_path <PATH_TO_DOWNLOADED_DATA> --mode patches --dataset BRIGHT

Training & testing

Adapt the paths in your config file, then run train.py to run the training and testing for ZoomMIL. This script expects WSIs that have been preprocessed as patch features.

python bin/train.py --config_path zoommil/config/sample_config.json

Citation

If you use this code, please consider citing our work:

@inproceedings{thandiackal2022zoommil,
  title={Differentiable Zooming for Multiple Instance Learning on Whole-Slide Images},
  author={Thandiackal, Kevin and Chen, Boqi and Pati, Pushpak and Jaume, Guillaume and Williamson, Drew FK and Gabrani, Maria and Goksel, Orcun},
  booktitle = {The European Conference on Computer Vision (ECCV)},
  year={2022}
}

zoommil's People

Contributors

kevthan 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.