Skip to content

c4lab/AML-WSI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIL_gene_prediction_WSI_AML

multiple instance learning for predicting gene mutations from whole slide images of acute myeloid leukemia

The idea

Overview of the proposed method.

Using PyHIST for Patches Generation

This process and code is based on PyHIST.

For single WSI:

python pyhist.py --content-threshold 0.05 --output /path/to/your/output/directory --output-downsample 1 --save-patches --save-tilecrossed-image --info "verbose" /path/to/your/WSI

For a WSI directory set:

python /run/run_pyHIST.py

ROI Detection

The model architecture and code is based on DenseNet121.

Detect all patches in a single WSI:

python /ROI_detection/main.py --predict-mode --report-excel --data-path /path/to/your/patches/directory/ --threshold 0.8 --output-dir /path/to/your/output/directory/ --down-scale 1 --batch-size 32

Detect patches in all WSIs:

python /run/run_ROI_detection.py

Cell Detection

This process is base on the fine-tuned model in previous research. Please download the best weights file.

Detect all cells in a single patch:

python /cell_detection/cell_detection.py --input_patch /path/to/your/patch/file --model_weights /path/to/best/weights/file --out_dir /path/to/your/output/directory/

MIL training

This model need to choose a pre-trained classification model in PyTorch library, including AlexNet, DenseNet, EfficientNet, ResNet and ResNeXt.

python  MIL/MIL_train.py --output /path/to/your/output/directory/ --train_lib /path/to/your/training/library --val_lib /path/to/your/validation/library --slide_path path/to/your/training/images/

ensemble learning

run the ensemble.ipynb, with parameters: ensemble_lib and gene to chose running dataset and target gene.

System Requirements

  • Python 3.9.16
  • other package in the requrement.txt file

About

Analyzing AML WSI images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published