Semantic Segmentation of Cancer Cells
PyTorch implementation of several CNN-based models for segmentation of cancer cells.
Requirement
Python 3.6.4
PyTorch 0.4.0
Some other libraries: NumPy 1.14.0, SciPy 1.0.0, Matpotlib 2.1.2
I recommend installation of PyTorch with CUDA using Anaconda, which includes most of the libraries required. For example, Linux users can run the following command in the terminal:
conda install pytorch torchvision cuda91 -c pytorch
(This is my environment, but others may also work)
Models
The idea of this model is from Learning Deconvolution Network for Semantic Segmentation. Unlike the original model, fully connected layers as well as some other layers are dropped in the DeConvNet. The output stride is 16. A similar CNN model with skip connections was also implemented as SegSkipNet.
20-layer DeConvNet configuration:
U-Net from U-Net: Convolutional Networks for Biomedical Image Segmentation was implemented in the models. Here the paddings of 3 by 3 convolutional layers were set as 1 to preserve the spatial size.
The model_stats.py
file in the misc folder can generate the configuration of the models, i.e., layers, activations and Mult-Adds.
Visualization
The maximum activations of deconvolutional layers can be visualized by running max_activation.py
, which illustrates coarse-to-fine pixel-wise segmentation via these learned layers. Besides, the features of the first convolutional layer can be visualized by running visualize_features.py
.