Skip to content

DanGuo1223/DeepMSI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepMSI

This package implements deep learning methods for MSI classification and clustering. The classification methods include supervised training and semi-supervised training where only tissue-level labels are available.

Tissue classification

Load the package

from classification import *

Config the classification model

model_opts = model_opt( model_type = 'cnn', gpu = False, param_init = 0.0, 
                    num_layers = 3, kernel_width = [16, 22, 38],
                    chanels = [8,16,3]
)

model_type specifies the backbone of the classifier. It has the options of 'cnn' and 'rnn'.

gpu specifies whether to use GPU

param_init specifies the initialization of parameters, '0.0' for default initialization in pytorch, and other options can be 'uniform', 'xavier_uniform', 'xavier_normal'.

num_layers specifies the number of convolutional or recurrent layers.

Build a classifier

classifier = classify(model_opts, data = PATH_TO_DATA, batch_size = 32, optim = 'Adam', lr = 0.001, num_epochs = 10)

model_opts: the classification model configurations

data: path to the data file. The data file should be in .csv format

bacth_size: sample size for a mini-batch

optim: optimizer

lr: learning rate

num_epochs: number of training epochs

Train the classifier

classifier.train()

Validation

pred_label, _, _ = classifier.val()

pred_label is the predicted label by the classifier

Visualizations

viz(data = PATH_TO_DATA, classification = classifier).plot_data()

visualize the groud truth labels of data

viz(data = PATH_TO_DATA, classification = classifier).plot_results()

visualize the predicted labels of the classifier

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages