Skip to content

NBouteldja/KidneyStainTranslation

Repository files navigation

KidneyStainTranslation

STAIN TRANSLATION: This repository provides a framework to train CycleGAN- and U-GAT-IT-based translators for unsupervised stain-to-stain translation in histology. It builds upon this CycleGAN repository.
An exemplary translation from the aSMA to PAS stain in kidney tissue is provided below and its applicability by a prior segmentation model is shown by comparison with the ground-truth. The employed segmentation model is from this paper and its code repo can be found here. In summary, its based on the U-net architecture and was trained to segment several renal structures including tubulus (colorful), glomerulus #00ff00, glomerular tuft #0000ff, vein (including renal pelvis) #00ffff, artery #ff00ff, and arterial lumen #ffff00 from kidney histopathology data.
Note:
STAIN AUGMENTATION: You can use your trained translators to augment an annotated data set and retrain the supervised model. We applied this to our previously published CNN (source code) for kidney structure segmentation on PAS-stained tissue to make it stain independent.
IMAGE REGISTRATION: You can also perform image registration between consecutive WSIs of different stains for stain-independent segmentation. We used the ANHIR challenge winning registration method from Fraunhofer Mevis. Please request access there.

Input aSMA image Fake PAS translation
Prediction Ground-truth

Training

To train a CycleGAN translator (e.g. incorporating a prior segmentation model), use the following command:

python ./KidneyStainTranslation/train.py --stain aSMA --stainB PAS --dataroot <path-to-data> --resultsPath <path-to-store-results> --netD n_layers --netG unet_7 --ngf 32 --ndf 32 --batch_size 3 --niters_init 0 --lr 0.0001 --preprocess none --niters 300000 --load_size 640 --crop_size 640 --lambda_A 1 --lambda_B 1 --lambda_id 1 --niters_linDecay 100 --saveModelEachNIteration 10000 --validation_freq 1000 --n_layers_D 4 --gpu_ids 0 --update_TB_images_freq 5000 --use_segm_model --lambda_Seg 1

Testing

Use the same arguments to test the trained translator:

python ./KidneyStainTranslation/test.py --stain aSMA --stainB PAS --dataroot <path-to-data> --resultsPath <path-to-store-results> --netD n_layers --netG unet_7 --ngf 32 --ndf 32 --batch_size 3 --niters_init 0 --lr 0.0001 --preprocess none --niters 300000 --load_size 640 --crop_size 640 --lambda_A 1 --lambda_B 1 --lambda_id 1 --niters_linDecay 100 --saveModelEachNIteration 10000 --validation_freq 1000 --n_layers_D 4 --gpu_ids 0 --update_TB_images_freq 5000 --use_segm_model --lambda_Seg 1

Contact

Nassim Bouteldja
Institute of Pathology
RWTH Aachen University Hospital
Pauwelsstrasse 30
52074 Aachen, Germany
E-mail: nbouteldja@ukaachen.de

/**************************************************************************
*                                                                         *
*   Copyright (C) 2021 by RWTH Aachen University                          *
*   http://www.rwth-aachen.de                                             *
*                                                                         *
*   License:                                                              *
*                                                                         *
*   This software is dual-licensed under:                                 *
*   • Commercial license (please contact: lfb@lfb.rwth-aachen.de)         *
*   • AGPL (GNU Affero General Public License) open source license        *
*                                                                         *
***************************************************************************/     

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages