|
| 1 | +Metadata-Version: 2.1 |
| 2 | +Name: HEMnet |
| 3 | +Version: 1.0.0 |
| 4 | +Summary: HEMnet package |
| 5 | +Home-page: https://github.com/BiomedicalMachineLearning/HEMnet |
| 6 | +Author: Andrew Su, Xiao Tan and Quan Nguyen |
| 7 | +Author-email: a.su@uqconnect.edu.au, xiao.tan@uq.edu.au, quan.nguyen@uq.edu.au |
| 8 | +License: UNKNOWN |
| 9 | +Project-URL: Bug Tracker, https://github.com/BiomedicalMachineLearning/HEMnet/issues |
| 10 | +Description: [](https://mybinder.org/v2/gh/BiomedicalMachineLearning/HEMnet/master?filepath=Development) |
| 11 | + [](https://imjoy.io/#/app?plugin=https://github.com/BiomedicalMachineLearning/HEMnet/blob/master/Demo/HEMnet_Tile_Predictor.imjoy.html) |
| 12 | + [](https://colab.research.google.com/github/BiomedicalMachineLearning/HEMnet/blob/master/Demo/TCGA_Inference.ipynb) |
| 13 | + |
| 14 | + # HEMnet - Haematoxylin & Eosin and Molecular neural network |
| 15 | + |
| 16 | + ## Description |
| 17 | + A deep learning automated cancer diagnosis software using molecular labelling to improve pathological annotation of |
| 18 | + Haematoxylin and Eosin (H&E) stained tissue. |
| 19 | + |
| 20 | + ## Installation |
| 21 | + |
| 22 | + 1. Docker |
| 23 | + |
| 24 | + You can download and run the docker image using the following commands: |
| 25 | + |
| 26 | + ``` |
| 27 | + docker pull andrewsu1/hemnet |
| 28 | + docker run -it andrewsu1/hemnet |
| 29 | + ``` |
| 30 | + 2. Conda |
| 31 | + |
| 32 | + Install Openslide (this is necessary to open whole slide images) - download it [here](https://openslide.org/download/) |
| 33 | + |
| 34 | + Create a conda environment from the `environment.yml` file |
| 35 | + |
| 36 | + ``` |
| 37 | + conda env create -f environment.yml |
| 38 | + conda activate HEMnet |
| 39 | + ``` |
| 40 | + |
| 41 | + ## Usage |
| 42 | + ### Slide Preparation |
| 43 | + |
| 44 | + Name slides in the format: `slide_id_TP53` for TP53 slides and `slide_id_HandE` for H&E slides |
| 45 | + The `TP53` and `HandE` suffix is used by HEMnet to identify the stain used. |
| 46 | + |
| 47 | + ### 1. Generate training and testing datasets |
| 48 | + |
| 49 | + a. Generate train dataset |
| 50 | + |
| 51 | + `python HEMnet_train_dataset.py -b /path/to/base/directory -s relative/path/to/slides -o relative/path/to/output/directory |
| 52 | + -t relative/path/to/template_slide.svs -v` |
| 53 | + |
| 54 | + b. Generate test dataset |
| 55 | + |
| 56 | + `python HEMnet_test_dataset.py -b /path/to/base/directory -s /relative/path/to/slides -o /relative/path/to/output/directory |
| 57 | + -t relative/path/to/template_slide -m tile_mag -a align_mag -c cancer_thresh -n non_cancer_thresh` |
| 58 | + |
| 59 | + Other parameters: |
| 60 | + * `-t` is the relative path to the template slide from which all other slides will be normalised against. The template |
| 61 | + slide should be the same for each step. |
| 62 | + * `-m` is the tile magnification. e.g. if the input is `10` then the tiles will be output at 10x |
| 63 | + * `-a` is the align magnification. Paired TP53 and H&E slides will be registered at this magnification. |
| 64 | + To reduce computation time we recommend this be less than the tile magnification - a five times downscale generally works well. |
| 65 | + * `-c` cancer threshold to apply to the DAB channel. DAB intensities less than this threshold indicate cancer. |
| 66 | + * `-n` non-cancer threshold to apply to the DAB channel. DAB intensities greater than this threshold indicate no cancer. |
| 67 | + |
| 68 | + ### 2. Train and evaluate model |
| 69 | + |
| 70 | + a. Training model |
| 71 | + |
| 72 | + `python train.py -b /path/to/base/directory -t relative/path/to/training_tile_directory -l relative/path/to/validation_tile_directory |
| 73 | + -o /relative/path/to/output/directory -m cnn_base -g num_gpus -e epochs -a batch_size -s -w -f -v` |
| 74 | + |
| 75 | + Other parameters: |
| 76 | + * `-m` is CNN base model. eg. `resnet50`, `vgg16`, `vgg19`, `inception_v3` and `xception`. |
| 77 | + * `-g` is number of GPUs for training. |
| 78 | + * `-e` is training epochs. Default is `100` epochs. |
| 79 | + * `-a` is batch size. Default is `32` |
| 80 | + * `-s` is option to save the trained model weights. |
| 81 | + * `-w` is option to used transfer learning. Model will used pre-trained weights from ImageNet at the initial stage. |
| 82 | + * `-f` is fine-tuning option. Model will re-train CNN base. |
| 83 | + |
| 84 | + b. Test model prediction |
| 85 | + |
| 86 | + `python test.py -b /path/to/base/directory -t relative/path/to/test_tile_directory -o /relative/path/to/output/directory |
| 87 | + -w model_weights -m cnn_base -g num_gpus -v` |
| 88 | + |
| 89 | + Other parameters: |
| 90 | + * `-w` is path to trained model. eg. `trained_model.h5`. |
| 91 | + * `-m` is CNN base model (same to training step). |
| 92 | + * `-g` is number of GPUs for prediction. |
| 93 | + |
| 94 | + c. Evaluate model performance and visualise model prediction |
| 95 | + |
| 96 | + `python visualisation.py -b /path/to/base/directory -t /relative/path/to/training_output_directory -p /relative/path/to/test_output_directory |
| 97 | + -o /relative/path/to/output/directory -i sample` |
| 98 | + |
| 99 | + Other parameters: |
| 100 | + * `-t` is path to training outputs. |
| 101 | + * `-p` is path to test outputs. |
| 102 | + * `-i` is name of Whole Slide Image for visualisation. |
| 103 | + |
| 104 | + ### 3. Apply model to diagnose new images |
| 105 | + `python HEMnet_inference.py -s '/path/to/new/HE/Slides/' -o '/path/to/output/directory/' -t '/path/to/template/slide/' -nn '/path/to/trained/model/' -v` |
| 106 | + |
| 107 | + Predict on TCGA images with our pretrained model for colorectal cancer using [google colab](https://colab.research.google.com/github/BiomedicalMachineLearning/HEMnet/blob/master/Demo/TCGA_Inference.ipynb) |
| 108 | + ## Results |
| 109 | + |
| 110 | + ## Citing HEMnet |
| 111 | + |
| 112 | + ## The Team |
| 113 | + Please contact Dr Quan Nguyen (quan.nguyen@uq.edu.au), Andrew Su (a.su@uqconnect.edu.au), |
| 114 | + and Xiao Tan (xiao.tan@uqconnect.edu.au) for issues, suggestions, |
| 115 | + and we are very welcome to collaboration opportunities. |
| 116 | + |
| 117 | + |
| 118 | +Platform: UNKNOWN |
| 119 | +Classifier: Programming Language :: Python :: 3 |
| 120 | +Classifier: License :: OSI Approved :: MIT License |
| 121 | +Classifier: Operating System :: OS Independent |
| 122 | +Requires-Python: >=3.6 |
| 123 | +Description-Content-Type: text/markdown |
0 commit comments