Applied on different medical datasets for different medical-based approaches (later we will be discussing Segmentation).
Unlike the original paper "Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks" we generate 128 x 128 Images that looks quite plausible.Check the results above and try it yourself.
The main objective of this work is twofold :
- Generate synthetic medical images that model the distribution of the input data
- [SOON] Use both of the synthetic and real images for training a context-aware CNN that can accurately segment the given images
In your terminal, run:
git clone https://github.com/AissamDjahnine/gans
cd gans
Then, install all dependencies with PIP using:
pip install -r requirements.txt
Since the main task behind this project is to generate synthetic medical images , we used these two datasets described below ( links are available as well )
You can use this Dataset consisted of 1032 ( 256 x 256 ) RPE cells images images.You can browse and donwload the data using this link : RpeCells
The dataset consists of 1144 images of size 1024 X 1024 at 10X resolution with the following distribution: 536 (47%) non-tumor images, 263 (23%) necrotic tumor images and 345 (30%) viable tumor tiles.
You can browse the data using this link : Osteosarcoma data from UT Southwestern/UT Dallas, to download the data that you can use directly: Osteosarcoma data
-
You can train the model on big datasets.The script saves your current model state (weights , bias ..) so that you can resume training from this point.the state is saved after 25 epochs (you can adjust the value depending on how big is your dataset) --Available only for the API.
-
Please respect this structure while feeding the model with your images directory :
./IMAGESFOLDER/Images/.. Examlpe : RPEDATA/Images/.. , Osteosarcoma_data/Images/..
Run a jupyter process :
Jupyter notebook
You find a Jupyter notebook version of the project , you can interactively run cells and check outputs for different sections
In your terminal, run:
mkdir Generated_Images_numpy_notebook
To create a directory for the generated imges ( numpy arrays ) version.
In your terminal, run:
python GAN_F_128.py --path IMAGEFOLDER --epochs 500 --batch-size 128 --lr 0.0002
Note : You may use default values ( see the file : GAN_F_128.py )
python GAN_F_128.py --path ./RPEDATA --epochs 500
- You can see generated images changing with time ( every 10 batches ), feel free to change the display time.
If you're familiar with Tensorboard , skip this section
In your terminal, run:
tensorboard --logdir ./runs
-
"Generative Adversarial Networks." Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, Yoshua Bengio. ArXiv 2014.
-
"Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks" Alec Radford, Luke Metz, Soumith Chintala
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please feel free to contact if case of issues.