GithubHelp home page GithubHelp logo

najnaj / deeplearning-digital-pathology Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhaoxuanma/deeplearning-digital-pathology

0.0 1.0 0.0 1.39 MB

Full package for applying deep learning to virtual slides.

Python 100.00%

deeplearning-digital-pathology's Introduction

Deeplearning-digital-pathology

This repository contains utilities for virtual slides and images classification and semantic segmentation with Keras and Caffe and an extension class of ImageDataGenerator of Keras to generate batches of images with data augmentation for segmentation. Demo code is provided for reference.

Requirement

Python 2.7
OpenCV 3.4
Numpy 1.14
Tensorflow 1.7
Keras 2.1
OpenSlide 1.1
Caffe 0.15 (optional)

Getting started

slide_demo.py It shows an example of using the Keras or Caffe model to segment a whole virtual slide or classify slide in grid and saving the results.

Segmentation: Alt text

Classification: Alt text

image_demo.py It shows an example of using the Keras or Caffe model to segment or classify images from a folder and saving the results.

train_segmentation_demo.py It shows an example of training a segmentation model from scratch.

Contents

See comments or use help for detailed function usage.

ImageDataGeneratorEXT.py

An extension of ImageDataGenerator of Keras for semgentation images iteration , with similiar api of flow_from_directory.

The structure of the image directory would be like:

"directory"
├── "image_subfolder"
│   ├── image1.png
│   ├── image2.png
│   └── ...
└── "mask_subfolder"
    ├── image1.png
    ├── image2.png
    └── ...

slide_utils.py

Virtual slide class (Slideobject) for retrieving image batches and results reconstruction.

  • retrieve_tiles_to_queue_thread Retrieve image batches and put into a queue waiting for analysis.

  • reconstruct_segmentation_queue_to_level Reconstruct segmentation results on top of selected layer image.

  • reconstruct_classification_queue_to_level Reconstruct classification results on top of selected layer image.

  • preprocess_img Rewrite to include customized image preprocessing.

  • gray_code Rewrite based on given code to change color for each category for result_mask.

  • color_code Rewrite based on given code to change color for each category for result_rgb.

image_utils.py

Image class (Imageobject) for retrieving image batches and results reconstruction.

  • retrieve_tiles_to_queue_thread Retrieve image batches and put into a queue waiting for analysis.

  • reconstruct_segmentation_queue_to_file Reconstruct segmentation results on top of original image and save.

  • reconstruct_classification_queue_to_file Reconstruct classification results on top of original image and save.

  • preprocess_img Rewrite to include customized image pre-processing.

  • gray_code Rewrite based on given code to change color for each category for result_mask.

  • color_code Rewrite based on given code to change color for each category for result_rgb.

caffe_utils_queue.py

Caffe class (Caffeobject) for forwarding images batch to neural network.

  • forward_from_queue_to_queue Forward batch in data queue to neural network and put results in result queue.

tf_utils_queue.py

Tensorflow (Keras) class (TFobject) for forwarding images batch to neural network.

  • forward_from_queue_to_queue Forward batch in data queue to neural network and put results in result queue.

Related publications

  • Semantic Segmentation of Colon Glands in Inflammatory Bowel Disease Biopsies. Z Ma, Z Swiderska-Chadaj, N Ing, H Salemi, D McGovern, B Knudsen, A Gertych. Information Technologies in Biomedicine, Kamień Śląski, Poland, June 2018.

deeplearning-digital-pathology's People

Contributors

zhaoxuanma avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.