Skip to main content

HNSC classifier

Project description

HNSC-classifier: an accuracy tool for head and neck cancer detection in digitized whole-slide histology using deep learning

an accuracy tools for head and neck cancer detection and stage inferred in digitized whole-slide histology using deep learning

The HNSC-classifier scheme and Deep learning framework:

Workflow

options

option Description
-i Path to a whole slide image
-o Name of the output file directory [default: output/]"
-p The pixel width and height for tiles
-l Extract tiles form resolution of level
-c The deep model path of cancer/normal classification
-s The deep model path of stage classification
-t The deep model path of T classification (TNM Staging System)
-n The deep model path of N classification (TNM Staging System)
-m The deep model path of M classification (TNM Staging System)

Dependents

pandas==1.4.3
pillow==8.4.0
matplotlib==3.5.2
scipy==1.8.0
numpy==1.22.3
openslide-python
fastai==2.7.9
histolab==0.5.1

Installation:

  1. install system dependency:

HNSC-classifier has one system-wide dependency: OpenSlide.

You should first download and install it from https://openslide.org/download/ according to your operating system.

  1. install HNSC-classifier
$pip install HNSC-classifier

Usage:

$ HNSC-calssifier - i TCGA-BB-4223-01A-01-BS1.7d09ad3d-016e-461a-a053-f9434945073b.svs -c learn.pkl

Example (test in linux OS: Ubuntu 20.4, python 3.9)

Download test data

The test Whole slide image download form TCGA TCGA-BB-4223-01A-01-BS1.7d09ad3d-016e-461a-a053-f9434945073b.svs.

Download deep learning model

DP model tarin tiles Description
learn.pkl 1,392,135 The deep learn model for detected tumor/normal
learn_S.pkl 1,428,765 The deep learn model for classified stage
learn_M.pkl 1,428,765 The deep model for classified stage M (TNM Staging System)
learn_N.pkl 1,428,765 The deep model for classified stage N (TNM Staging System)
learn_T.pkl 1,428,765 The deep model for classified stage T (TNM Staging System)

If you can not clink the hyperlink to obtain test data and DP model, you can download test data from ftp://23.105.208.65

Run HNSC-classifier in virtualenv

  1. install virtualenv
$ pip install virtualenv
  1. Create virtual environment
$ virtualenv ven
  1. Activate environment
$ source ven/bin/activate
  1. install HNSC-classifier
$pip install HNSC-classifier
  1. validate installation
$HNSC-classifier -h

HNSC-classifier for cancer detected.

$ HNSC-calssifier - i TCGA-BB-4223-01A-01-BS1.7d09ad3d-016e-461a-a053-f9434945073b.svs -c learn.pkl

HNSC-classifier for stage detected.

$ HNSC-calssifier - i TCGA-BB-4223-01A-01-BS1.7d09ad3d-016e-461a-a053-f9434945073b.svs -s learn_S.pkl

HNSC-classifier for TNM Staging System detected.

$ HNSC-calssifier - i TCGA-BB-4223-01A-01-BS1.7d09ad3d-016e-461a-a053-f9434945073b.svs -t learn_T.pkl -m learn_M.pkl -n learn_N.pkl

Output

Extract_tiles/  
                tile_0_level0_1499-7466-1723-7690.png
                tile_1_level0_1499-7690-1723-7914.png
                tile_2_level0_1499-8810-1723-9034.png
                tile_3_level0_1499-9034-1723-9258.png
                ...
cancer_heatmap.png
stage_heatmap.png
TNM_system_M_heatmap.png
TNM_system_N_heatmap.png
TNM_system_T_heatmap.png
summary.png
summary.csv

  • Extract_tiles: the tiles extract from WSI.
  • cancer_heatmap.png: cancer detected result.
  • stage_heatmap.png: stage detected result.
  • TNM_system_M_heatmap.png: TNM stage system (M) detected result.
  • TNM_system_N_heatmap.png: TNM stage system (N) detected result.
  • TNM_system_T_heatmap.png: TNM stage system (T) detected result.
  • summary.png: the summary of extracted and predicted tiles info.
  • summary.csv: the summary of extracted and predicted tiles info.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

HNSC-classifier-1.0.tar.gz (22.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page