Coder Social home page Coder Social logo

reshalfahsi / covid19ct3d Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 221 KB

COVID-19 Classification from 3D CT Images

License: MIT License

Python 77.87% Shell 1.23% Jupyter Notebook 20.91%
3d-convolutional-network covid-19 deep-learning image-classification medical-image-classification pytorch ct-scans

covid19ct3d's Introduction

COVID-19 Classification from 3D CT Images

Tutorial on COVID-19 Classification from 3D CT Images.

An example of COVID-19 infected lung 3D CT image.

Install

Install covid19ct3d using pip `(for Python >=3.6)`
git clone https://github.com/reshalfahsi/covid19ct3d
cd covid19ct3d
pip install .

Use from Python

Training
import covid19ct3d
  
# set training parameters
epoch = 30  # epoch number
lr = 1e-2  # learning rate
augmentation = True # choose to do data augmentation
batchsize = 2 # training batch size
trainsize = "128 128 64" # training dataset size
train_path = "./dataset" # path to train dataset
train_save = "./model" # path to saved model
step_lr = 2 # set the epoch to drop learning rate

# perform training
covid19ct3d.train(epoch=epoch,
                  lr=lr,
                  augmentation=augmentation,
                  batchsize=batchsize,
                  trainsize=trainsize,
                  train_path=train_path,
                  train_save=train_save,
                  step_lr=step_lr
                  )
Prediction
import covid19ct3d
  
# set prediction parameters
predict_size = "128 128 64" # predict size
pth_path = './model/COVID19CT3D.pth' # path to the trained model
data_path = './dataset/CT-0/study_0100.nii.gz' # path to the dataset

# perform prediction
covid19ct3d.predict(predict_size=predict_size,
                    pth_path=pth_path,
                    data_path=data_path
                    )
Model Information
import covid19ct3d
  
covid19ct3d.info()

Use from CLI

Training
covid19ct3d train \
--epoch 30 \
--lr 1e-2 \
--batchsize 2 \
--trainsize "128 128 64" \
--train_path "./dataset" \
--train_save "./model" \
--augmentation

Prediction
covid19ct3d predict \
--predict_size "128 128 64" \
--pth_path "./model/COVID19CT3D.pth" \
--data_path "./dataset/CT-23/study_0982.nii.gz"

Model Information
covid19ct3d info

Credits

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.