ChristophJud / StaNoSA

[Paper Implementation]Stain Normalization using Sparse AutoEncoders (StaNoSA): Application to digital pathology.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StaNoSA

Stain Normalisation using Sparse Auto-Encoders. Implemented as close to the paper as possible.

Environment Setup

(I use Ubuntu 16.04, so the following instructions are tailored for it. If you are using a different OS, you may have to change these accordingly)

  1. If you don't have Anaconda, download and install Anaconda as per the instructions for your OS.
  2. Create environment and install the dependencies

conda create --name stanosa python=3.6 --file req.txt

  1. Activate the environment

source activate stanosa

Note: if you experience anything like "conda: command not found" then just restart your terminal.

Training

Configuration is done in "stanosa.conf".

Ensure that your training images are all stored directory under the folder specified in the data_path variable in the stanosa.conf file.

When ready, simply run:

python train.py

Model states will be saved to "$output_path/states".

Testing

As before, ensure all testing images are under the data_path variable (in the [testing] section). Make sure you set the state_path variable properly so the weights are loaded from training.

Testing will take each image under the testing data path and pass it through the encoder, patch-by-patch and then applies clustering to the activations. The output of the clustering as well as the activations will be stored in a folder with the same name as the image.

When ready:

python test.py

About

[Paper Implementation]Stain Normalization using Sparse AutoEncoders (StaNoSA): Application to digital pathology.


Languages

Language:Python 91.3%Language:Jupyter Notebook 8.7%