This repository implements a DCGAN (Deep Convolutional Generative Adversarial Network) for generating histopathological images, specifically glomerulus pathologies of the kidney represented by 12 classes. The code is adapted from Chapter 4 & 5 of Hands-on Generative Adversarial Networks with PyTorch 1.0 by Hany, J. & Walters, G. (2019).
- Linux OS
- Python 3
- CPU or NVIDIA GPU + CUDA CuDNN
-
Clone this repository:
git clone https://github.com/m4ln/pytorch_dcgan.git cd pytorch_dcgan
-
Install dependencies via pip
pip install -r requirements.txt
Note: It might be necessary to install PyTorch manually from https://pytorch.org/get-started/locally/
- If no input arguments are provided, the model is trained on the MNIST dataset
python train.py
- To train on your own data, provide the arguments via argparse (check inside
train.py
) - The directory to your input data should contain a subfolder of images for each class
- To generate new samples, run (by default using the MNIST trained model as in
train.py
):python test.py
- To test on your own data, provide the arguments via argparse (check inside
test.py
)
If you use this project for your research, please cite our paper.
@article{weis2022assessment,
title={Assessment of glomerular morphological patterns by deep learning algorithms},
author={Weis, Cleo-Aron and Bindzus, Jan Niklas and Voigt, Jonas and Runz, Marlen and Hertjens, Svetlana and Gaida, Matthias M and Popovic, Zoran V and Porubsky, Stefan},
journal={Journal of Nephrology},
volume={35},
number={2},
pages={417--427},
year={2022},
doi = {10.11588/data/8LKEZF},
publisher={Springer}
}