Skip to content

Commit aa92068

Browse files
committed
version 1.0.0
1 parent 75a9827 commit aa92068

File tree

9 files changed

+183
-0
lines changed

9 files changed

+183
-0
lines changed

HEMnet/HEMnet.egg-info/PKG-INFO

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/BiomedicalMachineLearning/HEMnet/master?filepath=Development)
11+
[![launch ImJoy](https://imjoy.io/static/badge/launch-imjoy-badge.svg)](https://imjoy.io/#/app?plugin=https://github.com/BiomedicalMachineLearning/HEMnet/blob/master/Demo/HEMnet_Tile_Predictor.imjoy.html)
12+
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](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

HEMnet/HEMnet.egg-info/SOURCES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
README.md
2+
pyproject.toml
3+
setup.py
4+
HEMnet/HEMnet.egg-info/PKG-INFO
5+
HEMnet/HEMnet.egg-info/SOURCES.txt
6+
HEMnet/HEMnet.egg-info/dependency_links.txt
7+
HEMnet/HEMnet.egg-info/top_level.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2018 The Python Packaging Authority
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

dist/HEMnet-1.0.0-py3-none-any.whl

3.75 KB
Binary file not shown.

dist/HEMnet-1.0.0.tar.gz

3.36 KB
Binary file not shown.

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel"
5+
]
6+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import setuptools
2+
3+
with open("README.md", "r", encoding="utf-8") as fh:
4+
long_description = fh.read()
5+
6+
setuptools.setup(
7+
name="HEMnet",
8+
version="1.0.0",
9+
author="Andrew Su, Xiao Tan and Quan Nguyen",
10+
author_email="a.su@uqconnect.edu.au, xiao.tan@uq.edu.au, quan.nguyen@uq.edu.au",
11+
description="HEMnet package",
12+
long_description=long_description,
13+
long_description_content_type="text/markdown",
14+
url="https://github.com/BiomedicalMachineLearning/HEMnet",
15+
project_urls={
16+
"Bug Tracker": "https://github.com/BiomedicalMachineLearning/HEMnet/issues",
17+
},
18+
classifiers=[
19+
"Programming Language :: Python :: 3",
20+
"License :: OSI Approved :: MIT License",
21+
"Operating System :: OS Independent",
22+
],
23+
package_dir={"": "HEMnet"},
24+
packages=setuptools.find_packages(where="HEMnet"),
25+
python_requires=">=3.6",
26+
)

0 commit comments

Comments
 (0)