Histopathological image analysis using Grad-CAM representation map
Project description
HipoMap
Installation
HipoMap support Python 3
.
It requires numpy
, pandas
, tensorflow
, scipy
, scikit-learn
, seaborn
, matplotlib
, openslide-python
, cv2
.
Quick installation of openslide
- Update system
sudo apt-get update
- install openslide-tools
sudo apt-get install openslide-tools
- install openslide
pip install openslide
- install HipoMap
pip install HipoMap
Documentation
Quick Start
#Model load
#if you want to loaded keras pre-trained model
from tensorflow.keras.applications.vgg16 import VGG16
model = VGG16()
#if you want to loaded your pre-trained model
from tensorflow.keras.models import load_model
model = load_model(r'./pre_model.h5')
#make representation map
from HipoMap.hipoMap import generateHipoMap
generateHipoMap(inputpath="/home/user/Dataset/", outputpath="/home/user/Rep/", model = model, layer_name="block5_conv3", patch_size=(224, 224))
#draw heatmap
from HipoMap.hipoMap import draw_represent
draw_represent(path="/home/yeon/Dataset/", K=50, max_value=1000, save=False)
#Classify data to cancer/normal with representation map
from HipoMap.hipoClassify import HipoClass
hipo = HipoClass(K=50)
#1. split data with base(.csv)
trainset, validset, testset = hipo.split("./split.csv", dir_normal="/home/user/Dataset/Normal/", dir_cancer="/home/user/Dataset/Cancer")
#2. train the classifier
hipo_model = hipo.fit(trainset, validset, lr=0.1, epoch=20, batchsize=1, activation_size=196)
#3. get prediction value
prediction = hipo.predict(test_X=testset[0])
#4. get score (tpr, fpr, auc)
tpr, mean_fpr, auc = hipo.evaluate_score(label=testset[1])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
HipoMap-0.1.2.tar.gz
(17.9 kB
view hashes)
Built Distribution
HipoMap-0.1.2-py3-none-any.whl
(33.4 kB
view hashes)