Coder Social home page Coder Social logo

medmnist-experiments's Introduction

MedMNIST Experiments

Training and evaluation scripts to reproduce both 2D and 3D experiments in our MedMNIST paper, including PyTorch, auto-sklearn, AutoKeras and Google AutoML Vision together with their weights ;)

Code Structure

Installation and Requirements

This repository is working with MedMNIST official code and PyTorch.

  1. Setup the required environments and install medmnist as a standard Python package:

     pip install medmnist
    
  2. Check whether you have installed the latest version:

     >>> import medmnist
     >>> print(medmnist.__version__)
    
  3. The code requires common Python environments for machine learning; Basically, it was tested with

  • Python 3 (Anaconda 3.6.3 specifically)

  • PyTorch==1.3.1

  • autokeras==1.0.15

  • auto-sklearn==0.10.0

  • tensorflow==2.3.0

    Higher (or lower) versions should also work (perhaps with minor modifications).

  1. For MedMNIST3D, our code additionally requires ACSConv. Install it through pip via the command bellow:

     pip install git+git://github.com/M3DV/ACSConv.git
    

    Then you can check use the cool 2.5D, 3D and ACS model convertor as follows:

    from torchvision.models import resnet18
    from acsconv.converters import ACSConverter
    # model_2d is a standard pytorch 2D model
    model_2d = resnet18(pretrained=True)
    B, C_in, H, W = (1, 3, 64, 64)
    input_2d = torch.rand(B, C_in, H, W)
    output_2d = model_2d(input_2d)
    
    model_3d = ACSConverter(model_2d)
    # once converted, model_3d is using ACSConv and capable of processing 3D volumes.
    B, C_in, D, H, W = (1, 3, 64, 64, 64)
    input_3d = torch.rand(B, C_in, D, H, W)
    output_3d = model_3d(input_3d)
  2. Download the model weights and predictions from Zenodo.

    • weights_*.zip:
      • PyTorch, AutoKeras and Google AutoML Vision are provided for MedMNIST2D.
      • PyTorch and AutoKeras are provided for MedMNIST3D.
      • If you are using PyTorch model weights, please note that the ResNet18_224 / ResNet50_224 models are trained with images resized to 224 x 224 by PIL.Image.NEAREST.
      • Snapshots for auto-sklearn are not uploaded due to the embarrassingly large model sizes (lots of model ensemble).
    • predictions.zip: We also provide all standard prediction files by PyTorch, auto-sklearn, AutoKeras and Google AutoML Vision, which works with medmnist.Evaluator. Each file is named as {flag}_{split}_[AUC]{auc:.3f}_[ACC]{acc:.3f}@{run}.csv, e.g., bloodmnist_test_[AUC]0.997_[ACC]0.957@autokeras_3.csv.

medmnist-experiments's People

Contributors

threesrr avatar duducheng 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.