Giter Site home page Giter Site logo

hudiscount / cspr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from urmagicsmine/cspr

0.0 0.0 0.0 1.73 MB

Code of paper 'Advancing 3D Medical Image Analysis with Variable Dimension Transform based Supervised 3D Pre-training'

Shell 0.44% C++ 1.71% Python 94.85% Cuda 3.00%

cspr's Introduction

Advancing 3D Medical Image Analysis with Variable Dimension Transform based Supervised 3D Pre-training

PWC

Introduction

This is an implementation of our paper Advancing 3D Medical Image Analysis with Variable Dimension Transform based Supervised 3D Pre-training.

Modified from mmclassification.

Support 3D ResNet pre-training with 2D natural-image dataset.

Installation

Please refer to install.md for installation.

Data preparation

Download ImageNet dataset and put it as the following structure:

data
  ├──imagenet
        ├── get_meta.sh
        ├── meta
        │   ├── val.txt
        │   ├── test.txt
        │   ├── train.txt
        ├── val
        │   ├──ILSVRC2012_val_00000001.JPEG
        │   ├──ILSVRC2012_val_00000002.JPEG
        │   ├── ...
        ├── test
        │   ├──ILSVRC2012_test_00000001.JPEG
        │   ├──ILSVRC2012_test_00000002.JPEG
        │   ├── ...
        └── train
              └── n10148035
              │    ├── n10148035_10034.JPEG
              │    ├── n10148035_10371.JPEG
              │    ├── ...
              └── n11879895
              │    ├── ...
              └── ...

Pre-train a 3D model on ImageNet dataset

Run this script to pre-train a 3D-ResNet-18 model on ImageNet dataset. It will take around 7 days on 8 Titan XP GPUs.

bash pre_train.sh

Pre-trained Model

We provide models pre-trained on ImageNet dataset which can be used for different 3D medical image analysis tasks.

The pre-trained 3D-ResNet-18 model can be downloaded from BaiduYun(verification code: 865y) or GoogleDrive.

We also provide pretrained models of other compared methods for convenience, which can be avaliable at BaiduYun(verification code: 1ezg) or GoogleDrive. Note that the first convolution layer of some pretrained models are with input channels of 3(same as imagenet pretrained models), which is inconsistent with 1-channel CT slice input. To fully use the pretrained weights, we averaged the parameters of the first conv layer so that it can take 1-channel input data. These models are end with suffixes like _med1channel.pth.

Transfer to other tasks

Classification

LIDC-Classification

Data split can be found in data/lidc.

bash tools/dist_train.sh configs/LIDC_Cls_configs/resnet18_3d_BN_b32x4_LIDC_cos_smoo.py $NUM_GPUS

Segmentation

Data split can be found in medseg/data.

We provide a implementation modified from mmsegmentation for segmentation experiments on BCV, LIDC and LiTS datasets. Please run corresponding bash files under medseg folder.

medseg/bcv_test.sh
medseg/bcv_train.sh
medseg/lidc_test.sh
medseg/lidc_train.sh
medseg/LiTS_test.sh
medseg/LiTS_train.sh

Detection

Please refer to our another repo to run experiments on the DeepLesion dataset. To train a P3D63 model, run:

bash tools/dist_train.sh configs/deeplesion/p3d.py 8

Contact

If you have questions or suggestions, please open an issue here.

cspr's People

Contributors

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